rawfile.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef __RAWFILE_H
00024 #define __RAWFILE_H
00025
00026 #include <string>
00027 #include <vector>
00028
00029 #include <libopenraw/libopenraw.h>
00030
00031 namespace OpenRaw {
00032
00033 namespace IO {
00034 class Stream;
00035 }
00036 class Thumbnail;
00037 class RawData;
00038 class BitmapData;
00039 class MetaValue;
00040
00041 void init();
00042
00043 class RawFile
00044 {
00045 public:
00046 typedef ::or_rawfile_type Type;
00047 typedef ::or_rawfile_typeid TypeId;
00048
00049
00055 static const char **fileExtensions();
00056
00062 static RawFile *newRawFile(const char*_filename,
00063 Type _typeHint = OR_RAWFILE_TYPE_UNKNOWN);
00071 static RawFile *newRawFileFromMemory(const uint8_t *buffer, uint32_t len,
00072 Type _typeHint = OR_RAWFILE_TYPE_UNKNOWN);
00073
00075 virtual ~RawFile();
00077 Type type() const;
00078
00082 TypeId typeId();
00083
00084
00085
00086
00089 const std::vector<uint32_t> & listThumbnailSizes(void);
00095 ::or_error getThumbnail(uint32_t size, Thumbnail & thumbnail);
00096
00102 ::or_error getRawData(RawData & rawdata, uint32_t options);
00103
00109 ::or_error getRenderedImage(BitmapData & bitmapdata, uint32_t options);
00110
00113 int32_t getOrientation();
00114
00115 const MetaValue *getMetaValue(int32_t meta_index);
00116 protected:
00117 struct camera_ids_t {
00118 const char * model;
00119 const uint32_t type_id;
00120 };
00126 RawFile(IO::Stream *s, Type _type);
00127
00129 void _setTypeId(TypeId _type_id);
00130
00135 virtual ::or_error _enumThumbnailSizes(std::vector<uint32_t> &list) = 0;
00136
00144 virtual ::or_error _getThumbnail(uint32_t size, Thumbnail & thumbnail) = 0;
00151 virtual ::or_error _getRawData(RawData & data, uint32_t options) = 0;
00152
00153 virtual MetaValue *_getMetaValue(int32_t ) = 0;
00154
00155 TypeId _typeIdFromModel(const std::string & model);
00156 void _setIdMap(const camera_ids_t *map);
00157 virtual void _identifyId() = 0;
00158 private:
00159 static Type identify(const char*_filename);
00160 static ::or_error identifyBuffer(const uint8_t* buff, size_t len,
00161 Type &_type);
00162
00163
00164 RawFile(const RawFile&);
00165 RawFile & operator=(const RawFile &);
00166
00167 class Private;
00168
00169 Private *d;
00170 };
00171
00172
00173
00174 }
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185 #endif