00001
00068 #ifndef INC_MI32_JPEGEXT_H
00069 #define INC_MI32_JPEGEXT_H
00070
00071 #ifndef INC_MI32_STDDEFNS_H
00072 #include <mi32/stddefns.h>
00073 #endif
00074
00075 #ifdef RVCSYSDLL
00076 #define CLASSLIBEXPORT MI_DLLCLASSEXPORT
00077 #else
00078 #define CLASSLIBEXPORT MI_DLLCLASSIMPORT
00079 #endif
00080
00081 #ifndef GENERATING_DOXYGEN_OUTPUT
00082 class GENERICRW;
00083 class FILEPATH;
00084 class MISTRING;
00085 namespace Exiv2 {
00086 class ExifData;
00087 }
00088 #endif
00089
00090
00092 class CLASSLIBEXPORT JPEGEXT {
00093 public:
00094 class MAKEPARMS;
00095
00096 enum DCTMETHOD {
00097 DCT_ISLOW,
00098 DCT_IFAST,
00099 DCT_FLOAT,
00100 DCT_DEFAULT,
00101 DCT_FASTEST
00102 };
00103
00104 enum COLORSPACE {
00105 CS_Grayscale,
00106 CS_RGB,
00107 CS_CMYK
00108 };
00109
00111 virtual ~JPEGEXT ();
00112
00115 INT64 GetCompressedSize (
00116 ) const;
00117
00119 COLORSPACE GetColorSpace (
00120 ) const;
00121
00124 const Exiv2::ExifData* GetExifData (
00125 ) const;
00126
00129 UINT32 GetHeight (
00130 ) const;
00131
00135 bool GetMetadata (
00136 MISTRING& string
00137 );
00138
00140 UINT16 GetNumComponents (
00141 ) const;
00142
00145 UINT32 GetWidth (
00146 ) const;
00147
00150 ERRVALUE ReadLines (
00151 void* buffer,
00152 UINT32 numlines
00153 );
00154
00156 ERRVALUE Rewind (
00157 );
00158
00159 void SetNumComponents (
00160 UINT16 components
00161 );
00162
00166 ERRVALUE SetZoom (
00167 double zoom
00168 );
00169
00170 ERRVALUE WriteLines (
00171 const void* buffer,
00172 UINT32 numlines
00173 );
00174
00175 #ifndef GENERATING_DOXYGEN_OUTPUT
00176 class PRIV;
00177 #endif
00178
00179 protected:
00180 enum OPENMODE {
00181 OPENMODE_Read = 0,
00182 OPENMODE_Write = 1
00183 };
00184
00185 #ifndef GENERATING_DOXYGEN_OUTPUT
00186 PRIV* m_pPriv;
00187 #endif
00188
00190 JPEGEXT (
00191 PRIV *pPriv
00192 );
00193
00194 };
00195
00197 class CLASSLIBEXPORT JPEGEXT_FILE : public JPEGEXT {
00198 public:
00199 JPEGEXT_FILE (
00200 );
00201
00202 virtual ~JPEGEXT_FILE (
00203 );
00204
00205 ERRVALUE Close (
00206 );
00207
00208 ERRVALUE Make (
00209 const FILEPATH& fp,
00210 const MAKEPARMS& parms
00211 );
00212
00213 ERRVALUE Open (
00214 const FILEPATH& fp
00215 );
00216
00217 private:
00218 #ifndef GENERATING_DOXYGEN_OUTPUT
00219 class PRIV_FILE;
00220 PRIV_FILE* m_pPrivFile;
00221 #endif
00222 };
00223
00225 class CLASSLIBEXPORT JPEGEXT_MEM : public JPEGEXT {
00226 public:
00227
00228 JPEGEXT_MEM (
00229 );
00230
00231 virtual ~JPEGEXT_MEM (
00232 );
00233
00234 ERRVALUE Close (
00235 );
00236
00238 const UINT8* GetBuffer (
00239 ) const;
00240
00243 INT64 GetBufferSize (
00244 ) const;
00245
00247 UINT8* Detach (
00248 );
00249
00251 ERRVALUE Make (
00252 const MAKEPARMS& parms
00253 );
00254
00258 ERRVALUE Make (
00259 UINT8*& buf,
00260 UINT32 bufsize,
00261 const MAKEPARMS& parms
00262 );
00263
00265 ERRVALUE Open (
00266 UINT8*& buf,
00267 UINT32 bufsize
00268 );
00269
00270 private:
00271 #ifndef GENERATING_DOXYGEN_OUTPUT
00272 class PRIV_MEM;
00273 PRIV_MEM* m_pPrivMem;
00274 #endif
00275 };
00276
00277
00279 class CLASSLIBEXPORT JPEGEXT::MAKEPARMS {
00280 public:
00281
00283 MAKEPARMS (
00284 UINT32 width = 0,
00285 UINT32 height = 0,
00286 UINT32 quality = 75
00287 );
00288
00290 void SetDCTMethod (
00291 DCTMETHOD method
00292 );
00293
00295 void SetColorSpace (
00296 COLORSPACE colorspace
00297 );
00298
00299 private:
00300 #ifndef GENERATING_DOXYGEN_OUTPUT
00301 UINT32 m_Width;
00302 UINT32 m_Height;
00303 UINT32 m_Quality;
00304 DCTMETHOD m_DCTMethod;
00305 COLORSPACE m_ColorSpace;
00306 friend class JPEGEXT;
00307 friend class JPEGEXT::PRIV;
00308 #endif
00309 };
00310
00311 #undef CLASSLIBEXPORT
00312
00313 #endif // INC_MI32_JPEGEXT_H