libopenraw
arwfile.cpp
00001 /*
00002  * libopenraw - arwfile.cpp
00003  *
00004  * Copyright (C) 2006,2008 Hubert Figuiere
00005  *
00006  * This library is free software: you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public License
00008  * as published by the Free Software Foundation, either version 3 of
00009  * the License, or (at your option) any later version.
00010  *
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with this library.  If not, see
00018  * <http://www.gnu.org/licenses/>.
00019  */
00020 
00021 
00022 #include <libopenraw/libopenraw.h>
00023 #include <libopenraw++/thumbnail.h>
00024 
00025 #include "trace.h"
00026 #include "io/file.h"
00027 #include "ifdfilecontainer.h"
00028 #include "ifd.h"
00029 #include "arwfile.h"
00030 
00031 using namespace Debug;
00032 
00033 namespace OpenRaw {
00034 
00035 
00036     namespace Internals {
00037 
00038         const IFDFile::camera_ids_t ARWFile::s_def[] = {
00039             { "DSLR-A100", OR_MAKE_FILE_TYPEID(OR_TYPEID_VENDOR_SONY,
00040                                                OR_TYPEID_SONY_A100) },
00041             { "DSLR-A200", OR_MAKE_FILE_TYPEID(OR_TYPEID_VENDOR_SONY,
00042                                                OR_TYPEID_SONY_A200) },
00043             { "DSLR-A550", OR_MAKE_FILE_TYPEID(OR_TYPEID_VENDOR_SONY,
00044                                                OR_TYPEID_SONY_A550) },
00045             { "DSLR-A700", OR_MAKE_FILE_TYPEID(OR_TYPEID_VENDOR_SONY,
00046                                                OR_TYPEID_SONY_A700) },
00047             { 0, 0 }
00048         };
00049 
00050 
00051         RawFile *ARWFile::factory(IO::Stream * s)
00052         {
00053             return new ARWFile(s);
00054         }
00055 
00056         ARWFile::ARWFile(IO::Stream *s)
00057             : IFDFile(s, OR_RAWFILE_TYPE_ARW)
00058         {
00059             _setIdMap(s_def);
00060         }
00061 
00062         ARWFile::~ARWFile()
00063         {
00064         }
00065 
00066         IFDDir::Ref  ARWFile::_locateCfaIfd()
00067         {
00068             // in ARW the CFA IFD is the main IFD
00069             if(!m_mainIfd) {
00070                 m_mainIfd = _locateMainIfd();
00071             }
00072             return m_mainIfd;
00073         }
00074 
00075 
00076         IFDDir::Ref  ARWFile::_locateMainIfd()
00077         {
00078             return m_container->setDirectory(0);
00079         }
00080 
00081         ::or_error ARWFile::_getRawData(RawData & /*data*/, uint32_t /*options*/) 
00082         { 
00083             return OR_ERROR_NOT_FOUND; 
00084         }
00085 
00086     }
00087 }