Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #ifndef CORE_INCLUDE_FXCODEC_FX_CODEC_H_ | 7 #ifndef CORE_INCLUDE_FXCODEC_FX_CODEC_H_ |
| 8 #define CORE_INCLUDE_FXCODEC_FX_CODEC_H_ | 8 #define CORE_INCLUDE_FXCODEC_FX_CODEC_H_ |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "../../../third_party/base/nonstd_unique_ptr.h" | 13 #include "../../../third_party/base/nonstd_unique_ptr.h" |
| 14 #include "../fxcrt/fx_basic.h" | 14 #include "../fxcrt/fx_basic.h" |
| 15 #include "../fxcrt/fx_coordinates.h" | |
| 16 #include "fx_codec_def.h" | 15 #include "fx_codec_def.h" |
| 17 #include "fx_codec_provider.h" | 16 #include "fx_codec_provider.h" |
| 18 | 17 |
| 18 #include "../fxcrt/fx_coordinates.h" // For FX_RECT. | |
|
Tom Sepez
2015/10/29 21:54:03
note: moved because XFA only. Will look nice when
Lei Zhang
2015/10/30 06:06:31
Acknowledged.
| |
| 19 | |
| 19 class CFX_DIBSource; | 20 class CFX_DIBSource; |
| 20 class CJPX_Decoder; | 21 class CJPX_Decoder; |
| 21 class CPDF_PrivateData; | 22 class CPDF_PrivateData; |
| 22 class CPDF_StreamAcc; | 23 class CPDF_StreamAcc; |
| 23 class ICodec_ScanlineDecoder; | 24 class ICodec_ScanlineDecoder; |
| 24 class ICodec_ProgressiveDecoder; | |
| 25 class ICodec_BasicModule; | 25 class ICodec_BasicModule; |
| 26 class ICodec_FaxModule; | 26 class ICodec_FaxModule; |
| 27 class ICodec_JpegModule; | 27 class ICodec_JpegModule; |
| 28 class ICodec_JpxModule; | 28 class ICodec_JpxModule; |
| 29 class ICodec_Jbig2Module; | 29 class ICodec_Jbig2Module; |
| 30 class ICodec_IccModule; | 30 class ICodec_IccModule; |
| 31 class ICodec_FlateModule; | 31 class ICodec_FlateModule; |
| 32 class ICodec_Jbig2Encoder; | 32 class ICodec_Jbig2Encoder; |
| 33 class ICodec_ScanlineDecoder; | |
| 34 | |
| 35 class ICodec_ProgressiveDecoder; | |
|
Tom Sepez
2015/10/29 21:54:03
***
Lei Zhang
2015/10/30 06:06:31
Care to sort this section and the one above?
Tom Sepez
2015/10/30 20:10:34
Done. And there was a duplicate class that popped
| |
| 33 class ICodec_PngModule; | 36 class ICodec_PngModule; |
| 34 class ICodec_GifModule; | 37 class ICodec_GifModule; |
| 35 class ICodec_BmpModule; | 38 class ICodec_BmpModule; |
| 36 class ICodec_TiffModule; | 39 class ICodec_TiffModule; |
| 37 class CFX_DIBAttribute; | 40 |
| 38 class ICodec_ScanlineDecoder; | 41 class CFX_DIBAttribute { |
| 42 public: | |
| 43 CFX_DIBAttribute(); | |
| 44 ~CFX_DIBAttribute(); | |
| 45 | |
| 46 int32_t m_nXDPI; | |
| 47 int32_t m_nYDPI; | |
| 48 FX_FLOAT m_fAspectRatio; | |
| 49 FX_WORD m_wDPIUnit; | |
| 50 CFX_ByteString m_strAuthor; | |
| 51 uint8_t m_strTime[20]; | |
| 52 int32_t m_nGifLeft; | |
| 53 int32_t m_nGifTop; | |
| 54 FX_DWORD* m_pGifLocalPalette; | |
| 55 FX_DWORD m_nGifLocalPalNum; | |
| 56 int32_t m_nBmpCompressType; | |
| 57 std::map<FX_DWORD, void*> m_Exif; | |
| 58 }; | |
| 39 | 59 |
| 40 class CCodec_ModuleMgr { | 60 class CCodec_ModuleMgr { |
| 41 public: | 61 public: |
| 42 CCodec_ModuleMgr(); | 62 CCodec_ModuleMgr(); |
| 43 ICodec_ProgressiveDecoder* CreateProgressiveDecoder(); | |
| 44 ICodec_Jbig2Encoder* CreateJbig2Encoder(); | 63 ICodec_Jbig2Encoder* CreateJbig2Encoder(); |
| 45 ICodec_BasicModule* GetBasicModule() const { return m_pBasicModule.get(); } | 64 ICodec_BasicModule* GetBasicModule() const { return m_pBasicModule.get(); } |
| 46 ICodec_FaxModule* GetFaxModule() const { return m_pFaxModule.get(); } | 65 ICodec_FaxModule* GetFaxModule() const { return m_pFaxModule.get(); } |
| 47 ICodec_JpegModule* GetJpegModule() const { return m_pJpegModule.get(); } | 66 ICodec_JpegModule* GetJpegModule() const { return m_pJpegModule.get(); } |
| 48 ICodec_JpxModule* GetJpxModule() const { return m_pJpxModule.get(); } | 67 ICodec_JpxModule* GetJpxModule() const { return m_pJpxModule.get(); } |
| 49 ICodec_Jbig2Module* GetJbig2Module() const { return m_pJbig2Module.get(); } | 68 ICodec_Jbig2Module* GetJbig2Module() const { return m_pJbig2Module.get(); } |
| 50 ICodec_IccModule* GetIccModule() const { return m_pIccModule.get(); } | 69 ICodec_IccModule* GetIccModule() const { return m_pIccModule.get(); } |
| 51 ICodec_FlateModule* GetFlateModule() const { return m_pFlateModule.get(); } | 70 ICodec_FlateModule* GetFlateModule() const { return m_pFlateModule.get(); } |
| 71 | |
| 72 ICodec_ProgressiveDecoder* CreateProgressiveDecoder(); | |
|
Tom Sepez
2015/10/29 21:54:03
***
Lei Zhang
2015/10/30 06:06:32
Acknowledged.
| |
| 52 ICodec_PngModule* GetPngModule() const { return m_pPngModule.get(); } | 73 ICodec_PngModule* GetPngModule() const { return m_pPngModule.get(); } |
| 53 ICodec_GifModule* GetGifModule() const { return m_pGifModule.get(); } | 74 ICodec_GifModule* GetGifModule() const { return m_pGifModule.get(); } |
| 54 ICodec_BmpModule* GetBmpModule() const { return m_pBmpModule.get(); } | 75 ICodec_BmpModule* GetBmpModule() const { return m_pBmpModule.get(); } |
| 55 ICodec_TiffModule* GetTiffModule() const { return m_pTiffModule.get(); } | 76 ICodec_TiffModule* GetTiffModule() const { return m_pTiffModule.get(); } |
| 56 | 77 |
| 57 protected: | 78 protected: |
| 58 nonstd::unique_ptr<ICodec_BasicModule> m_pBasicModule; | 79 nonstd::unique_ptr<ICodec_BasicModule> m_pBasicModule; |
| 59 nonstd::unique_ptr<ICodec_FaxModule> m_pFaxModule; | 80 nonstd::unique_ptr<ICodec_FaxModule> m_pFaxModule; |
| 60 nonstd::unique_ptr<ICodec_JpegModule> m_pJpegModule; | 81 nonstd::unique_ptr<ICodec_JpegModule> m_pJpegModule; |
| 61 nonstd::unique_ptr<ICodec_JpxModule> m_pJpxModule; | 82 nonstd::unique_ptr<ICodec_JpxModule> m_pJpxModule; |
| 62 nonstd::unique_ptr<ICodec_Jbig2Module> m_pJbig2Module; | 83 nonstd::unique_ptr<ICodec_Jbig2Module> m_pJbig2Module; |
| 63 nonstd::unique_ptr<ICodec_IccModule> m_pIccModule; | 84 nonstd::unique_ptr<ICodec_IccModule> m_pIccModule; |
| 64 nonstd::unique_ptr<ICodec_FlateModule> m_pFlateModule; | 85 nonstd::unique_ptr<ICodec_FlateModule> m_pFlateModule; |
| 86 | |
| 65 nonstd::unique_ptr<ICodec_PngModule> m_pPngModule; | 87 nonstd::unique_ptr<ICodec_PngModule> m_pPngModule; |
|
Lei Zhang
2015/10/30 06:06:32
*** ?
Tom Sepez
2015/10/30 20:10:34
***
| |
| 66 nonstd::unique_ptr<ICodec_GifModule> m_pGifModule; | 88 nonstd::unique_ptr<ICodec_GifModule> m_pGifModule; |
| 67 nonstd::unique_ptr<ICodec_BmpModule> m_pBmpModule; | 89 nonstd::unique_ptr<ICodec_BmpModule> m_pBmpModule; |
| 68 nonstd::unique_ptr<ICodec_TiffModule> m_pTiffModule; | 90 nonstd::unique_ptr<ICodec_TiffModule> m_pTiffModule; |
| 69 }; | 91 }; |
| 70 class ICodec_BasicModule { | 92 class ICodec_BasicModule { |
| 71 public: | 93 public: |
| 72 virtual ~ICodec_BasicModule() {} | 94 virtual ~ICodec_BasicModule() {} |
| 73 virtual FX_BOOL RunLengthEncode(const uint8_t* src_buf, | 95 virtual FX_BOOL RunLengthEncode(const uint8_t* src_buf, |
| 74 FX_DWORD src_size, | 96 FX_DWORD src_size, |
| 75 uint8_t*& dest_buf, | 97 uint8_t*& dest_buf, |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 205 virtual void Finish(void* pContext) = 0; | 227 virtual void Finish(void* pContext) = 0; |
| 206 | 228 |
| 207 virtual void Input(void* pContext, | 229 virtual void Input(void* pContext, |
| 208 const uint8_t* src_buf, | 230 const uint8_t* src_buf, |
| 209 FX_DWORD src_size) = 0; | 231 FX_DWORD src_size) = 0; |
| 210 | 232 |
| 211 virtual int ReadHeader(void* pContext, | 233 virtual int ReadHeader(void* pContext, |
| 212 int* width, | 234 int* width, |
| 213 int* height, | 235 int* height, |
| 214 int* nComps, | 236 int* nComps, |
| 215 CFX_DIBAttribute* pAttribute = NULL) = 0; | 237 CFX_DIBAttribute* pAttribute) = 0; |
| 216 | 238 |
| 217 virtual int StartScanline(void* pContext, int down_scale) = 0; | 239 virtual int StartScanline(void* pContext, int down_scale) = 0; |
| 218 | 240 |
| 219 virtual FX_BOOL ReadScanline(void* pContext, uint8_t* dest_buf) = 0; | 241 virtual FX_BOOL ReadScanline(void* pContext, uint8_t* dest_buf) = 0; |
| 220 | 242 |
| 221 virtual FX_DWORD GetAvailInput(void* pContext, | 243 virtual FX_DWORD GetAvailInput(void* pContext, |
| 222 uint8_t** avail_buf_ptr = NULL) = 0; | 244 uint8_t** avail_buf_ptr = NULL) = 0; |
| 223 }; | 245 }; |
| 224 | 246 |
| 225 class ICodec_JpxModule { | 247 class ICodec_JpxModule { |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 246 public: | 268 public: |
| 247 virtual ~ICodec_PngModule() {} | 269 virtual ~ICodec_PngModule() {} |
| 248 | 270 |
| 249 virtual void* Start(void* pModule) = 0; | 271 virtual void* Start(void* pModule) = 0; |
| 250 | 272 |
| 251 virtual void Finish(void* pContext) = 0; | 273 virtual void Finish(void* pContext) = 0; |
| 252 | 274 |
| 253 virtual FX_BOOL Input(void* pContext, | 275 virtual FX_BOOL Input(void* pContext, |
| 254 const uint8_t* src_buf, | 276 const uint8_t* src_buf, |
| 255 FX_DWORD src_size, | 277 FX_DWORD src_size, |
| 256 CFX_DIBAttribute* pAttribute = NULL) = 0; | 278 CFX_DIBAttribute* pAttribute) = 0; |
| 257 | 279 |
| 258 FX_BOOL» » » » (*ReadHeaderCallback)(void* pModule, int width, int height, int bpc, int pass, int* color_type, double* gamma); | 280 FX_BOOL (*ReadHeaderCallback)(void* pModule, |
| 281 int width, | |
| 282 int height, | |
| 283 int bpc, | |
| 284 int pass, | |
| 285 int* color_type, | |
| 286 double* gamma); | |
| 259 | 287 |
| 260 FX_BOOL (*AskScanlineBufCallback)(void* pModule, int line, uint8_t*& src_buf); | 288 FX_BOOL (*AskScanlineBufCallback)(void* pModule, int line, uint8_t*& src_buf); |
| 261 | 289 |
| 262 void (*FillScanlineBufCompletedCallback)(void* pModule, int pass, int line); | 290 void (*FillScanlineBufCompletedCallback)(void* pModule, int pass, int line); |
| 263 }; | 291 }; |
| 264 class ICodec_GifModule { | 292 class ICodec_GifModule { |
| 265 public: | 293 public: |
| 266 virtual ~ICodec_GifModule() {} | 294 virtual ~ICodec_GifModule() {} |
| 267 | 295 |
| 268 virtual void* Start(void* pModule) = 0; | 296 virtual void* Start(void* pModule) = 0; |
| 269 | 297 |
| 270 virtual void Finish(void* pContext) = 0; | 298 virtual void Finish(void* pContext) = 0; |
| 271 | 299 |
| 272 virtual FX_DWORD GetAvailInput(void* pContext, | 300 virtual FX_DWORD GetAvailInput(void* pContext, |
| 273 uint8_t** avail_buf_ptr = NULL) = 0; | 301 uint8_t** avail_buf_ptr = NULL) = 0; |
| 274 | 302 |
| 275 virtual void Input(void* pContext, | 303 virtual void Input(void* pContext, |
| 276 const uint8_t* src_buf, | 304 const uint8_t* src_buf, |
| 277 FX_DWORD src_size) = 0; | 305 FX_DWORD src_size) = 0; |
| 278 | 306 |
| 279 virtual int32_t ReadHeader(void* pContext, | 307 virtual int32_t ReadHeader(void* pContext, |
| 280 int* width, | 308 int* width, |
| 281 int* height, | 309 int* height, |
| 282 int* pal_num, | 310 int* pal_num, |
| 283 void** pal_pp, | 311 void** pal_pp, |
| 284 int* bg_index, | 312 int* bg_index, |
| 285 CFX_DIBAttribute* pAttribute = NULL) = 0; | 313 CFX_DIBAttribute* pAttribute) = 0; |
| 286 | 314 |
| 287 virtual int32_t LoadFrameInfo(void* pContext, int* frame_num) = 0; | 315 virtual int32_t LoadFrameInfo(void* pContext, int* frame_num) = 0; |
| 288 | 316 |
| 289 void (*RecordCurrentPositionCallback)(void* pModule, FX_DWORD& cur_pos); | 317 void (*RecordCurrentPositionCallback)(void* pModule, FX_DWORD& cur_pos); |
| 290 | 318 |
| 291 uint8_t* (*AskLocalPaletteBufCallback)(void* pModule, | 319 uint8_t* (*AskLocalPaletteBufCallback)(void* pModule, |
| 292 int32_t frame_num, | 320 int32_t frame_num, |
| 293 int32_t pal_size); | 321 int32_t pal_size); |
| 294 | 322 |
| 295 virtual int32_t LoadFrame(void* pContext, | 323 virtual int32_t LoadFrame(void* pContext, |
| 296 int frame_num, | 324 int frame_num, |
| 297 CFX_DIBAttribute* pAttribute = NULL) = 0; | 325 CFX_DIBAttribute* pAttribute) = 0; |
| 298 | 326 |
| 299 FX_BOOL» » » » (*InputRecordPositionBufCallback)(void* pModule, FX_DWORD rcd_pos, const FX_RECT& img_rc, | 327 FX_BOOL (*InputRecordPositionBufCallback)(void* pModule, |
| 300 int32_t pal_num, void* pal_ptr, | 328 FX_DWORD rcd_pos, |
| 301 int32_t delay_time, FX_BOOL user_input, | 329 const FX_RECT& img_rc, |
| 302 int32_t trans_index, int32_t disposal_method, FX_BOOL interlace); | 330 int32_t pal_num, |
| 331 void* pal_ptr, | |
| 332 int32_t delay_time, | |
| 333 FX_BOOL user_input, | |
| 334 int32_t trans_index, | |
| 335 int32_t disposal_method, | |
| 336 FX_BOOL interlace); | |
| 303 | 337 |
| 304 void (*ReadScanlineCallback)(void* pModule, | 338 void (*ReadScanlineCallback)(void* pModule, |
| 305 int32_t row_num, | 339 int32_t row_num, |
| 306 uint8_t* row_buf); | 340 uint8_t* row_buf); |
| 307 }; | 341 }; |
| 308 class ICodec_BmpModule { | 342 class ICodec_BmpModule { |
| 309 public: | 343 public: |
| 310 virtual ~ICodec_BmpModule() {} | 344 virtual ~ICodec_BmpModule() {} |
| 311 | 345 |
| 312 virtual void* Start(void* pModule) = 0; | 346 virtual void* Start(void* pModule) = 0; |
| 313 | 347 |
| 314 virtual void Finish(void* pContext) = 0; | 348 virtual void Finish(void* pContext) = 0; |
| 315 | 349 |
| 316 virtual FX_DWORD GetAvailInput(void* pContext, | 350 virtual FX_DWORD GetAvailInput(void* pContext, |
| 317 uint8_t** avail_buf_ptr = NULL) = 0; | 351 uint8_t** avail_buf_ptr = NULL) = 0; |
| 318 | 352 |
| 319 virtual void Input(void* pContext, | 353 virtual void Input(void* pContext, |
| 320 const uint8_t* src_buf, | 354 const uint8_t* src_buf, |
| 321 FX_DWORD src_size) = 0; | 355 FX_DWORD src_size) = 0; |
| 322 | 356 |
| 323 virtual int32_t ReadHeader(void* pContext, | 357 virtual int32_t ReadHeader(void* pContext, |
| 324 int32_t* width, | 358 int32_t* width, |
| 325 int32_t* height, | 359 int32_t* height, |
| 326 FX_BOOL* tb_flag, | 360 FX_BOOL* tb_flag, |
| 327 int32_t* components, | 361 int32_t* components, |
| 328 int* pal_num, | 362 int* pal_num, |
| 329 FX_DWORD** pal_pp, | 363 FX_DWORD** pal_pp, |
| 330 CFX_DIBAttribute* pAttribute = NULL) = 0; | 364 CFX_DIBAttribute* pAttribute) = 0; |
| 331 | 365 |
| 332 virtual int32_t LoadImage(void* pContext) = 0; | 366 virtual int32_t LoadImage(void* pContext) = 0; |
| 333 | 367 |
| 334 FX_BOOL (*InputImagePositionBufCallback)(void* pModule, FX_DWORD rcd_pos); | 368 FX_BOOL (*InputImagePositionBufCallback)(void* pModule, FX_DWORD rcd_pos); |
| 335 | 369 |
| 336 void (*ReadScanlineCallback)(void* pModule, | 370 void (*ReadScanlineCallback)(void* pModule, |
| 337 int32_t row_num, | 371 int32_t row_num, |
| 338 uint8_t* row_buf); | 372 uint8_t* row_buf); |
| 339 }; | 373 }; |
| 340 class ICodec_TiffModule { | 374 class ICodec_TiffModule { |
| 341 public: | 375 public: |
| 342 virtual ~ICodec_TiffModule() {} | 376 virtual ~ICodec_TiffModule() {} |
| 343 | 377 |
| 344 virtual void* CreateDecoder(IFX_FileRead* file_ptr) = 0; | 378 virtual void* CreateDecoder(IFX_FileRead* file_ptr) = 0; |
| 345 | 379 |
| 346 virtual void GetFrames(void* ctx, int32_t& frames) = 0; | 380 virtual void GetFrames(void* ctx, int32_t& frames) = 0; |
| 347 | 381 |
| 348 virtual FX_BOOL LoadFrameInfo(void* ctx, | 382 virtual FX_BOOL LoadFrameInfo(void* ctx, |
| 349 int32_t frame, | 383 int32_t frame, |
| 350 FX_DWORD& width, | 384 FX_DWORD& width, |
| 351 FX_DWORD& height, | 385 FX_DWORD& height, |
| 352 FX_DWORD& comps, | 386 FX_DWORD& comps, |
| 353 FX_DWORD& bpc, | 387 FX_DWORD& bpc, |
| 354 CFX_DIBAttribute* pAttribute = NULL) = 0; | 388 CFX_DIBAttribute* pAttribute) = 0; |
| 355 | 389 |
| 356 virtual FX_BOOL Decode(void* ctx, class CFX_DIBitmap* pDIBitmap) = 0; | 390 virtual FX_BOOL Decode(void* ctx, class CFX_DIBitmap* pDIBitmap) = 0; |
| 357 | 391 |
| 358 virtual void DestroyDecoder(void* ctx) = 0; | 392 virtual void DestroyDecoder(void* ctx) = 0; |
| 359 }; | 393 }; |
| 360 | 394 |
| 361 class ICodec_Jbig2Module { | 395 class ICodec_Jbig2Module { |
| 362 public: | 396 public: |
| 363 virtual ~ICodec_Jbig2Module() {} | 397 virtual ~ICodec_Jbig2Module() {} |
| 364 | 398 |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 375 IFX_Pause* pPause) = 0; | 409 IFX_Pause* pPause) = 0; |
| 376 | 410 |
| 377 virtual FXCODEC_STATUS ContinueDecode(void* pJbig2Content, | 411 virtual FXCODEC_STATUS ContinueDecode(void* pJbig2Content, |
| 378 IFX_Pause* pPause) = 0; | 412 IFX_Pause* pPause) = 0; |
| 379 virtual void DestroyJbig2Context(void* pJbig2Content) = 0; | 413 virtual void DestroyJbig2Context(void* pJbig2Content) = 0; |
| 380 }; | 414 }; |
| 381 class ICodec_ProgressiveDecoder { | 415 class ICodec_ProgressiveDecoder { |
| 382 public: | 416 public: |
| 383 virtual ~ICodec_ProgressiveDecoder() {} | 417 virtual ~ICodec_ProgressiveDecoder() {} |
| 384 | 418 |
| 385 virtual FXCODEC_STATUS LoadImageInfo( | 419 virtual FXCODEC_STATUS LoadImageInfo(IFX_FileRead* pFile, |
| 386 IFX_FileRead* pFile, | 420 FXCODEC_IMAGE_TYPE imageType, |
| 387 FXCODEC_IMAGE_TYPE imageType = FXCODEC_IMAGE_UNKNOWN, | 421 CFX_DIBAttribute* pAttribute) = 0; |
| 388 CFX_DIBAttribute* pAttribute = NULL) = 0; | |
| 389 | 422 |
| 390 virtual FXCODEC_IMAGE_TYPE GetType() = 0; | 423 virtual FXCODEC_IMAGE_TYPE GetType() const = 0; |
| 391 | 424 virtual int32_t GetWidth() const = 0; |
| 392 virtual int32_t GetWidth() = 0; | 425 virtual int32_t GetHeight() const = 0; |
| 393 | 426 virtual int32_t GetNumComponents() const = 0; |
| 394 virtual int32_t GetHeight() = 0; | 427 virtual int32_t GetBPC() const = 0; |
| 395 | |
| 396 virtual int32_t GetNumComponents() = 0; | |
| 397 | |
| 398 virtual int32_t GetBPC() = 0; | |
| 399 | 428 |
| 400 virtual void SetClipBox(FX_RECT* clip) = 0; | 429 virtual void SetClipBox(FX_RECT* clip) = 0; |
| 401 | 430 |
| 402 virtual FXCODEC_STATUS GetFrames(int32_t& frames, | 431 virtual FXCODEC_STATUS GetFrames(int32_t& frames, |
| 403 IFX_Pause* pPause = NULL) = 0; | 432 IFX_Pause* pPause = NULL) = 0; |
| 404 | 433 |
| 405 virtual FXCODEC_STATUS StartDecode(class CFX_DIBitmap* pDIBitmap, | 434 virtual FXCODEC_STATUS StartDecode(class CFX_DIBitmap* pDIBitmap, |
| 406 int32_t start_x, | 435 int32_t start_x, |
| 407 int32_t start_y, | 436 int32_t start_y, |
| 408 int32_t size_x, | 437 int32_t size_x, |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 496 FX_FLOAT& G, | 525 FX_FLOAT& G, |
| 497 FX_FLOAT& B); | 526 FX_FLOAT& B); |
| 498 void AdobeCMYK_to_sRGB1(uint8_t c, | 527 void AdobeCMYK_to_sRGB1(uint8_t c, |
| 499 uint8_t m, | 528 uint8_t m, |
| 500 uint8_t y, | 529 uint8_t y, |
| 501 uint8_t k, | 530 uint8_t k, |
| 502 uint8_t& R, | 531 uint8_t& R, |
| 503 uint8_t& G, | 532 uint8_t& G, |
| 504 uint8_t& B); | 533 uint8_t& B); |
| 505 FX_BOOL MD5ComputeID(const void* buf, FX_DWORD dwSize, uint8_t ID[16]); | 534 FX_BOOL MD5ComputeID(const void* buf, FX_DWORD dwSize, uint8_t ID[16]); |
| 506 | |
| 507 class CFX_DIBAttribute { | |
| 508 public: | |
| 509 CFX_DIBAttribute(); | |
| 510 ~CFX_DIBAttribute(); | |
| 511 | |
| 512 int32_t m_nXDPI; | |
| 513 int32_t m_nYDPI; | |
| 514 FX_FLOAT m_fAspectRatio; | |
| 515 FX_WORD m_wDPIUnit; | |
| 516 CFX_ByteString m_strAuthor; | |
| 517 uint8_t m_strTime[20]; | |
| 518 int32_t m_nGifLeft; | |
| 519 int32_t m_nGifTop; | |
| 520 FX_DWORD* m_pGifLocalPalette; | |
| 521 FX_DWORD m_nGifLocalPalNum; | |
| 522 int32_t m_nBmpCompressType; | |
| 523 std::map<FX_DWORD, void*> m_Exif; | |
| 524 }; | |
| 525 | |
| 526 FX_BOOL FaxSkipEOL(const uint8_t* src_buf, int bitsize, int& bitpos); | 535 FX_BOOL FaxSkipEOL(const uint8_t* src_buf, int bitsize, int& bitpos); |
| 527 FX_BOOL FaxGet1DLine(const uint8_t* src_buf, | 536 FX_BOOL FaxGet1DLine(const uint8_t* src_buf, |
| 528 int bitsize, | 537 int bitsize, |
| 529 int& bitpos, | 538 int& bitpos, |
| 530 uint8_t* dest_buf, | 539 uint8_t* dest_buf, |
| 531 int columns); | 540 int columns); |
| 532 FX_BOOL FaxG4GetRow(const uint8_t* src_buf, | 541 FX_BOOL FaxG4GetRow(const uint8_t* src_buf, |
| 533 int bitsize, | 542 int bitsize, |
| 534 int& bitpos, | 543 int& bitpos, |
| 535 uint8_t* dest_buf, | 544 uint8_t* dest_buf, |
| 536 const uint8_t* ref_buf, | 545 const uint8_t* ref_buf, |
| 537 int columns); | 546 int columns); |
| 538 void FaxG4Decode(const uint8_t* src_buf, | 547 void FaxG4Decode(const uint8_t* src_buf, |
| 539 FX_DWORD src_size, | 548 FX_DWORD src_size, |
| 540 int* pbitpos, | 549 int* pbitpos, |
| 541 uint8_t* dest_buf, | 550 uint8_t* dest_buf, |
| 542 int width, | 551 int width, |
| 543 int height, | 552 int height, |
| 544 int pitch); | 553 int pitch); |
| 545 | 554 |
| 546 #endif // CORE_INCLUDE_FXCODEC_FX_CODEC_H_ | 555 #endif // CORE_INCLUDE_FXCODEC_FX_CODEC_H_ |
| OLD | NEW |