refinery
RAW file processor

include/refinery/exif.h

00001 #ifndef _REFINERY_EXIF_H
00002 #define _REFINERY_EXIF_H
00003 
00004 #include <streambuf>
00005 #include <string>
00006 #include <vector>
00007 
00008 namespace refinery {
00009 
00023 class ExifData {
00024 public:
00025   typedef unsigned char byte; 
00027   virtual ~ExifData() {} 
00035   virtual bool hasKey(const char* key) const = 0;
00036 
00046   virtual std::string getString(const char* key) const = 0;
00047 
00059   virtual void getBytes(const char* key, std::vector<byte>& outBytes) const = 0;
00060 
00070   virtual int getInt(const char* key) const = 0;
00071 
00081   virtual float getFloat(const char* key) const = 0;
00082 };
00083 
00097 class InMemoryExifData : public ExifData {
00098   class Impl;
00099   Impl* impl;
00100 
00101 public:
00102   InMemoryExifData(); 
00103   ~InMemoryExifData(); 
00105   virtual bool hasKey(const char* key) const;
00106   virtual std::string getString(const char* key) const;
00107   virtual void getBytes(const char* key, std::vector<byte>& outBytes) const;
00108   virtual int getInt(const char* key) const;
00109   virtual float getFloat(const char* key) const;
00110 
00117   virtual void setString(const char* key, const std::string& s);
00118 };
00119 
00139 class DcrawExifData : public ExifData {
00140   class Impl;
00141   Impl* impl;
00142 
00143 public:
00151   DcrawExifData(std::streambuf& istream);
00159   DcrawExifData(FILE* f);
00160 
00161   ~DcrawExifData(); 
00171   const char* mime_type() const;
00172 
00173   virtual bool hasKey(const char* key) const;
00174   virtual std::string getString(const char* key) const;
00175   virtual void getBytes(const char* key, std::vector<byte>& outBytes) const;
00176   virtual int getInt(const char* key) const;
00177   virtual float getFloat(const char* key) const;
00178 };
00179 
00180 } // namespace refinery
00181 
00182 #endif /* _REFINERY_EXIF_H */
 All Classes Functions Variables Typedefs Enumerations Enumerator