From 022da0014faa103901ec107ed6a33e5ab00c7931 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Thu, 1 Oct 2015 13:49:28 -0700 Subject: Clean up some image decoder classes: - Use std::vector instead of raw uint8_t* - Make ICodec_ScanlineDecoder::GetScanline() return const uint8_t* - Add FxFreeDeleter, use it in CCodec_ImageDataCache. - Make CCodec_ImageDataCache encapsulate its data members. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1361053002 . --- core/include/fxcodec/fx_codec.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'core/include/fxcodec/fx_codec.h') diff --git a/core/include/fxcodec/fx_codec.h b/core/include/fxcodec/fx_codec.h index b3133694b8..625ec08e7d 100644 --- a/core/include/fxcodec/fx_codec.h +++ b/core/include/fxcodec/fx_codec.h @@ -7,6 +7,8 @@ #ifndef CORE_INCLUDE_FXCODEC_FX_CODEC_H_ #define CORE_INCLUDE_FXCODEC_FX_CODEC_H_ +#include + #include "../../../third_party/base/nonstd_unique_ptr.h" #include "../fxcrt/fx_basic.h" #include "fx_codec_def.h" @@ -64,6 +66,7 @@ class ICodec_BasicModule { int nComps, int bpc) = 0; }; + class ICodec_ScanlineDecoder { public: virtual ~ICodec_ScanlineDecoder() {} @@ -72,7 +75,7 @@ class ICodec_ScanlineDecoder { virtual void DownScale(int dest_width, int dest_height) = 0; - virtual uint8_t* GetScanline(int line) = 0; + virtual const uint8_t* GetScanline(int line) = 0; virtual FX_BOOL SkipToScanline(int line, IFX_Pause* pPause) = 0; @@ -88,6 +91,7 @@ class ICodec_ScanlineDecoder { virtual void ClearImageData() = 0; }; + class ICodec_FlateModule { public: virtual ~ICodec_FlateModule() {} @@ -211,10 +215,10 @@ class ICodec_JpxModule { FX_DWORD* height, FX_DWORD* components) = 0; - virtual FX_BOOL Decode(CJPX_Decoder* pDecoder, - uint8_t* dest_data, - int pitch, - uint8_t* offsets) = 0; + virtual bool Decode(CJPX_Decoder* pDecoder, + uint8_t* dest_data, + int pitch, + const std::vector& offsets) = 0; virtual void DestroyDecoder(CJPX_Decoder* pDecoder) = 0; }; -- cgit v1.2.3