00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
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