00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include <libopenraw++/thumbnail.h>
00022 #include <libopenraw++/rawdata.h>
00023
00024 #include "debug.h"
00025 #include "orffile.h"
00026 #include "ifd.h"
00027 #include "ifddir.h"
00028 #include "ifdentry.h"
00029 #include "orfcontainer.h"
00030 #include "io/file.h"
00031
00032 using namespace Debug;
00033
00034 namespace OpenRaw {
00035
00036 namespace Internals {
00037
00038 RawFile *ORFFile::factory(const char* _filename)
00039 {
00040 return new ORFFile(_filename);
00041 }
00042
00043
00044 ORFFile::ORFFile(const char* _filename)
00045 : IFDFile(_filename, OR_RAWFILE_TYPE_ORF, false)
00046 {
00047 m_container = new ORFContainer(m_io, 0);
00048 }
00049
00050 ORFFile::~ORFFile()
00051 {
00052 }
00053
00054 IFDDir::Ref ORFFile::_locateCfaIfd()
00055 {
00056
00057 if(!m_mainIfd) {
00058 m_mainIfd = _locateMainIfd();
00059 }
00060 return m_mainIfd;
00061 }
00062
00063
00064 IFDDir::Ref ORFFile::_locateMainIfd()
00065 {
00066 return m_container->setDirectory(0);
00067 }
00068
00069 ::or_error ORFFile::_getRawData(RawData & data, uint32_t )
00070 {
00071 if(!m_cfaIfd) {
00072 m_cfaIfd = _locateCfaIfd();
00073 }
00074 return _getRawDataFromDir(data, m_cfaIfd);
00075 }
00076
00077 }
00078 }
00079