libopenraw
|
00001 /* 00002 * libopenraw - tiffepfile.cpp 00003 * 00004 * Copyright (C) 2007-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 #include <vector> 00022 00023 #include "tiffepfile.h" 00024 #include "ifdfilecontainer.h" 00025 00026 namespace OpenRaw { 00027 namespace Internals { 00028 00029 TiffEpFile::TiffEpFile(IO::Stream * s, Type _type) 00030 : IFDFile(s, _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 // error 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 00061 ::or_error TiffEpFile::_getRawData(RawData & /*data*/, uint32_t /*options*/) 00062 { 00063 return OR_ERROR_NOT_FOUND; 00064 } 00065 00066 } 00067 } 00068 /* 00069 Local Variables: 00070 mode:c++ 00071 c-file-style:"stroustrup" 00072 c-file-offsets:((innamespace . 0)) 00073 indent-tabs-mode:nil 00074 fill-column:80 00075 End: 00076 */