tiffepfile.cpp
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include <vector>
00022
00023 #include "tiffepfile.h"
00024 #include "ifdfilecontainer.h"
00025
00026 namespace OpenRaw {
00027 namespace Internals {
00028
00029 TiffEpFile::TiffEpFile(const char* _filename, Type _type)
00030 : IFDFile(_filename, _type)
00031 {
00032 }
00033
00034
00035 IFDDir::Ref TiffEpFile::_locateCfaIfd()
00036 {
00037 if(!m_mainIfd) {
00038 m_mainIfd = _locateMainIfd();
00039 }
00040
00041 std::vector<IFDDir::Ref> subdirs;
00042 if (!m_mainIfd || !m_mainIfd->getSubIFDs(subdirs)) {
00043
00044 return IFDDir::Ref();
00045 }
00046 IFDDir::RefVec::const_iterator i = find_if(subdirs.begin(),
00047 subdirs.end(),
00048 IFDDir::isPrimary());
00049 if (i != subdirs.end()) {
00050 return *i;
00051 }
00052 return IFDDir::Ref();
00053 }
00054
00055 IFDDir::Ref TiffEpFile::_locateMainIfd()
00056 {
00057 return m_container->setDirectory(0);
00058 }
00059
00060 }
00061 }