erffile.cpp

00001 /*
00002  * libopenraw - erffile.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
00008  * License as published by the Free Software Foundation; either
00009  * version 2.1 of 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, write to the Free Software
00018  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
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         RawFile *ERFFile::factory(const char* _filename)
00042         {
00043             return new ERFFile(_filename);
00044         }
00045 
00046         ERFFile::ERFFile(const char* _filename)
00047             : TiffEpFile(_filename, OR_RAWFILE_TYPE_ERF)
00048         {
00049         }
00050 
00051 
00052         ERFFile::~ERFFile()
00053         {
00054         }
00055 
00056 
00057         ::or_error ERFFile::_getRawData(RawData & data, uint32_t /*options*/)
00058         {
00059             ::or_error err;
00060             m_cfaIfd = _locateCfaIfd();
00061             if(m_cfaIfd) {
00062                 err = _getRawDataFromDir(data, m_cfaIfd);
00063             }
00064             else {
00065                 err = OR_ERROR_NOT_FOUND;
00066             }
00067             return err;
00068         }
00069     }
00070 }
00071 

Generated on Sat Nov 7 19:23:17 2009 for libopenraw by  doxygen 1.5.8