ifdfile.h

00001 /*
00002  * libopenraw - ifdfile.h
00003  *
00004  * Copyright (C) 2006 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019  */
00020 
00021 
00022 
00023 #ifndef _IFD_FILE_H_
00024 #define _IFD_FILE_H_
00025 
00026 #include <vector>
00027 #include <libopenraw/types.h>
00028 #include <libopenraw/consts.h>
00029 #include <libopenraw++/rawfile.h>
00030 
00031 #include "ifddir.h"
00032 
00033 namespace OpenRaw {
00034     namespace IO {
00035         class Stream;
00036         class File;
00037     }
00038 
00039     namespace Internals {
00040         class IFFileContainer;
00041 
00043         struct IFDThumbDesc
00044         {
00045             IFDThumbDesc(uint32_t _x, uint32_t _y, ::or_data_type _type,
00046                                      const IFDDir::Ref & _ifddir)
00047                 : x(_x), y(_y), type(_type), ifddir(_ifddir)
00048                 {
00049                 }
00050             IFDThumbDesc()
00051                 : x(0), y(0), type(OR_DATA_TYPE_NONE), ifddir((IFDDir*)NULL)
00052                 {
00053                 }
00054             uint32_t x;    
00055             uint32_t y;    
00056             ::or_data_type type; 
00057             IFDDir::Ref ifddir; 
00058         };
00059 
00060 
00062         class IFDFile
00063             : public OpenRaw::RawFile
00064         {
00065 
00066         protected:
00067             IFDFile(const char *_filename, Type _type);
00068             virtual ~IFDFile();
00069 
00075             virtual ::or_error _enumThumbnailSizes(std::vector<uint32_t> &list);
00076 
00082             virtual ::or_error _locateThumbnail(const IFDDir::Ref & dir,
00083                                                                         std::vector<uint32_t> &list);
00084 
00085             typedef std::map<uint32_t, IFDThumbDesc> ThumbLocations;
00086             ThumbLocations    m_thumbLocations;
00087             IO::Stream       *m_io; 
00088             IFDFileContainer *m_container; 
00090         private:
00091 
00092             IFDFile(const IFDFile&);
00093             IFDFile & operator=(const IFDFile &);
00094 
00095             virtual ::or_error _getThumbnail(uint32_t size, Thumbnail & thumbnail);
00096         };
00097 
00098     }
00099 }
00100 
00101 
00102 #endif

Generated on Sat Jan 27 11:36:13 2007 for libopenraw by  doxygen 1.4.7