rawfile.h

00001 /*
00002  * libopenraw - rawfile.h
00003  *
00004  * Copyright (C) 2005-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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
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     class Thumbnail;
00034     class RawData;
00035     class MetaValue;
00036 
00037     void init();
00038 
00039     class RawFile
00040     {
00041     public:
00042         typedef ::or_rawfile_type Type;
00043 
00049         static RawFile *newRawFile(const char*_filename, 
00050                                    Type _typeHint = OR_RAWFILE_TYPE_UNKNOWN);
00051 
00053         virtual ~RawFile();
00055         Type type() const;
00056 
00057         // standard api, like get thumbnail
00058         // and get exif.
00059 
00062         const std::vector<uint32_t> & listThumbnailSizes(void);
00068         ::or_error getThumbnail(uint32_t size, Thumbnail & thumbnail);
00069 
00075         ::or_error getRawData(RawData & rawdata, uint32_t options);
00076 
00077 
00078         int32_t getOrientation();
00079 
00080         const MetaValue *getMetaValue(int32_t meta_index);
00081     protected:
00087         RawFile(const char *_filename, Type _type);
00092         virtual ::or_error _enumThumbnailSizes(std::vector<uint32_t> &list) = 0;
00093         
00101         virtual ::or_error _getThumbnail(uint32_t size, Thumbnail & thumbnail) = 0;
00108         virtual ::or_error _getRawData(RawData & data, uint32_t options) = 0;
00109 
00110         virtual MetaValue *_getMetaValue(int32_t /*meta_index*/) = 0;
00111     private:
00112         static Type identify(const char*_filename);
00113 
00114         RawFile(const RawFile&);
00115         RawFile & operator=(const RawFile &);
00116 
00117         class Private;
00118 
00119         Private *d;
00120     };
00121 
00122 
00123 
00124 }
00125 
00126 
00127 #endif

Generated on Tue Jun 17 11:47:19 2008 for libopenraw by  doxygen 1.5.6