erffile.cpp
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include <iostream>
00023 #include <libopenraw++/thumbnail.h>
00024 #include <libopenraw++/rawdata.h>
00025
00026 #include "debug.h"
00027 #include "ifd.h"
00028 #include "ifdfilecontainer.h"
00029 #include "ifddir.h"
00030 #include "ifdentry.h"
00031 #include "io/file.h"
00032 #include "erffile.h"
00033
00034 using namespace Debug;
00035
00036 namespace OpenRaw {
00037
00038
00039 namespace Internals {
00040
00041 const IFDFile::camera_ids_t ERFFile::s_def[] = {
00042 { "R-D1", OR_MAKE_FILE_TYPEID(OR_TYPEID_VENDOR_EPSON,
00043 OR_TYPEID_EPSON_RD1) },
00044 { 0, 0 }
00045 };
00046
00047
00048 RawFile *ERFFile::factory(IO::Stream *s)
00049 {
00050 return new ERFFile(s);
00051 }
00052
00053 ERFFile::ERFFile(IO::Stream *s)
00054 : TiffEpFile(s, OR_RAWFILE_TYPE_ERF)
00055 {
00056 _setIdMap(s_def);
00057 }
00058
00059
00060 ERFFile::~ERFFile()
00061 {
00062 }
00063
00064 ::or_error ERFFile::_getRawData(RawData & data, uint32_t )
00065 {
00066 ::or_error err;
00067 m_cfaIfd = _locateCfaIfd();
00068 if(m_cfaIfd) {
00069 err = _getRawDataFromDir(data, m_cfaIfd);
00070 }
00071 else {
00072 err = OR_ERROR_NOT_FOUND;
00073 }
00074 return err;
00075 }
00076 }
00077 }
00078