summaryrefslogtreecommitdiff
path: root/core/include/fxcodec
diff options
context:
space:
mode:
Diffstat (limited to 'core/include/fxcodec')
-rw-r--r--core/include/fxcodec/fx_codec.h110
-rw-r--r--core/include/fxcodec/fx_codec_provider.h18
2 files changed, 64 insertions, 64 deletions
diff --git a/core/include/fxcodec/fx_codec.h b/core/include/fxcodec/fx_codec.h
index 31dea3b8d2..dab637ccc1 100644
--- a/core/include/fxcodec/fx_codec.h
+++ b/core/include/fxcodec/fx_codec.h
@@ -114,11 +114,11 @@ class ICodec_BasicModule
public:
virtual ~ICodec_BasicModule() {}
- virtual FX_BOOL RunLengthEncode(const uint8_t* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf,
+ virtual FX_BOOL RunLengthEncode(const uint8_t* src_buf, FX_DWORD src_size, uint8_t*& dest_buf,
FX_DWORD& dest_size) = 0;
- virtual FX_BOOL A85Encode(const uint8_t* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf,
+ virtual FX_BOOL A85Encode(const uint8_t* src_buf, FX_DWORD src_size, uint8_t*& dest_buf,
FX_DWORD& dest_size) = 0;
- virtual ICodec_ScanlineDecoder* CreateRunLengthDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height,
+ virtual ICodec_ScanlineDecoder* CreateRunLengthDecoder(const uint8_t* src_buf, FX_DWORD src_size, int width, int height,
int nComps, int bpc) = 0;
};
class ICodec_ScanlineDecoder
@@ -131,7 +131,7 @@ public:
virtual void DownScale(int dest_width, int dest_height) = 0;
- virtual FX_LPBYTE GetScanline(int line) = 0;
+ virtual uint8_t* GetScanline(int line) = 0;
virtual FX_BOOL SkipToScanline(int line, IFX_Pause* pPause) = 0;
@@ -152,15 +152,15 @@ class ICodec_FlateModule
public:
virtual ~ICodec_FlateModule() {}
- virtual ICodec_ScanlineDecoder* CreateDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height,
+ virtual ICodec_ScanlineDecoder* CreateDecoder(const uint8_t* src_buf, FX_DWORD src_size, int width, int height,
int nComps, int bpc, int predictor, int Colors, int BitsPerComponent, int Columns) = 0;
virtual FX_DWORD FlateOrLZWDecode(FX_BOOL bLZW, const uint8_t* src_buf, FX_DWORD src_size, FX_BOOL bEarlyChange,
int predictor, int Colors, int BitsPerComponent, int Columns,
- FX_DWORD estimated_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size) = 0;
+ FX_DWORD estimated_size, uint8_t*& dest_buf, FX_DWORD& dest_size) = 0;
virtual FX_BOOL Encode(const uint8_t* src_buf, FX_DWORD src_size,
int predictor, int Colors, int BitsPerComponent, int Columns,
- FX_LPBYTE& dest_buf, FX_DWORD& dest_size) = 0;
- virtual FX_BOOL Encode(FX_LPCBYTE src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size) = 0;
+ uint8_t*& dest_buf, FX_DWORD& dest_size) = 0;
+ virtual FX_BOOL Encode(const uint8_t* src_buf, FX_DWORD src_size, uint8_t*& dest_buf, FX_DWORD& dest_size) = 0;
};
class ICodec_FaxModule
{
@@ -168,12 +168,12 @@ public:
virtual ~ICodec_FaxModule() {}
- virtual ICodec_ScanlineDecoder* CreateDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height,
+ virtual ICodec_ScanlineDecoder* CreateDecoder(const uint8_t* src_buf, FX_DWORD src_size, int width, int height,
int K, FX_BOOL EndOfLine, FX_BOOL EncodedByteAlign, FX_BOOL BlackIs1, int Columns, int Rows) = 0;
- virtual FX_BOOL Encode(FX_LPCBYTE src_buf, int width, int height, int pitch,
- FX_LPBYTE& dest_buf, FX_DWORD& dest_size) = 0;
+ virtual FX_BOOL Encode(const uint8_t* src_buf, int width, int height, int pitch,
+ uint8_t*& dest_buf, FX_DWORD& dest_size) = 0;
};
class ICodec_JpegModule
{
@@ -183,21 +183,21 @@ public:
virtual void SetPovider(IFX_JpegProvider* pJP) = 0;
- virtual ICodec_ScanlineDecoder* CreateDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size,
+ virtual ICodec_ScanlineDecoder* CreateDecoder(const uint8_t* src_buf, FX_DWORD src_size,
int width, int height, int nComps, FX_BOOL ColorTransform) = 0;
- virtual FX_BOOL LoadInfo(FX_LPCBYTE src_buf, FX_DWORD src_size, int& width, int& height,
+ virtual FX_BOOL LoadInfo(const uint8_t* src_buf, FX_DWORD src_size, int& width, int& height,
int& num_components, int& bits_per_components, FX_BOOL& color_transform,
- FX_LPBYTE* icc_buf_ptr = NULL, FX_DWORD* icc_length = NULL) = 0;
+ uint8_t** icc_buf_ptr = NULL, FX_DWORD* icc_length = NULL) = 0;
- virtual FX_BOOL Encode(const class CFX_DIBSource* pSource, FX_LPBYTE& dest_buf, FX_STRSIZE& dest_size, int quality = 75,
- FX_LPCBYTE icc_buf = NULL, FX_DWORD icc_length = 0) = 0;
+ virtual FX_BOOL Encode(const class CFX_DIBSource* pSource, uint8_t*& dest_buf, FX_STRSIZE& dest_size, int quality = 75,
+ const uint8_t* icc_buf = NULL, FX_DWORD icc_length = 0) = 0;
virtual void* Start() = 0;
virtual void Finish(void* pContext) = 0;
- virtual void Input(void* pContext, FX_LPCBYTE src_buf, FX_DWORD src_size) = 0;
+ virtual void Input(void* pContext, const uint8_t* src_buf, FX_DWORD src_size) = 0;
virtual int ReadHeader(void* pContext, int* width, int* height, int* nComps, CFX_DIBAttribute* pAttribute = NULL) = 0;
@@ -205,10 +205,10 @@ public:
virtual int StartScanline(void* pContext, int down_scale) = 0;
- virtual FX_BOOL ReadScanline(void* pContext, FX_LPBYTE dest_buf) = 0;
+ virtual FX_BOOL ReadScanline(void* pContext, uint8_t* dest_buf) = 0;
- virtual FX_DWORD GetAvailInput(void* pContext, FX_LPBYTE* avail_buf_ptr = NULL) = 0;
+ virtual FX_DWORD GetAvailInput(void* pContext, uint8_t** avail_buf_ptr = NULL) = 0;
};
class ICodec_JpxModule
{
@@ -216,15 +216,15 @@ public:
virtual ~ICodec_JpxModule() {}
- virtual FX_LPVOID CreateDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, FX_BOOL useColorSpace = FALSE) = 0;
+ virtual void* CreateDecoder(const uint8_t* src_buf, FX_DWORD src_size, FX_BOOL useColorSpace = FALSE) = 0;
- virtual void GetImageInfo(FX_LPVOID ctx, FX_DWORD& width, FX_DWORD& height,
+ virtual void GetImageInfo(void* ctx, FX_DWORD& width, FX_DWORD& height,
FX_DWORD& codestream_nComps, FX_DWORD& output_nComps) = 0;
- virtual FX_BOOL Decode(FX_LPVOID ctx, FX_LPBYTE dest_data, int pitch,
- FX_BOOL bTranslateColor, FX_LPBYTE offsets) = 0;
+ virtual FX_BOOL Decode(void* ctx, uint8_t* dest_data, int pitch,
+ FX_BOOL bTranslateColor, uint8_t* offsets) = 0;
- virtual void DestroyDecoder(FX_LPVOID ctx) = 0;
+ virtual void DestroyDecoder(void* ctx) = 0;
};
class ICodec_PngModule
{
@@ -236,11 +236,11 @@ public:
virtual void Finish(void* pContext) = 0;
- virtual FX_BOOL Input(void* pContext, FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_DIBAttribute* pAttribute = NULL) = 0;
+ virtual FX_BOOL Input(void* pContext, const uint8_t* src_buf, FX_DWORD src_size, CFX_DIBAttribute* pAttribute = NULL) = 0;
FX_BOOL (*ReadHeaderCallback)(void* pModule, int width, int height, int bpc, int pass, int* color_type, double* gamma);
- FX_BOOL (*AskScanlineBufCallback)(void* pModule, int line, FX_LPBYTE& src_buf);
+ FX_BOOL (*AskScanlineBufCallback)(void* pModule, int line, uint8_t*& src_buf);
void (*FillScanlineBufCompletedCallback)(void* pModule, int pass, int line);
};
@@ -254,9 +254,9 @@ public:
virtual void Finish(void* pContext) = 0;
- virtual FX_DWORD GetAvailInput(void* pContext, FX_LPBYTE* avail_buf_ptr = NULL) = 0;
+ virtual FX_DWORD GetAvailInput(void* pContext, uint8_t** avail_buf_ptr = NULL) = 0;
- virtual void Input(void* pContext, FX_LPCBYTE src_buf, FX_DWORD src_size) = 0;
+ virtual void Input(void* pContext, const uint8_t* src_buf, FX_DWORD src_size) = 0;
virtual int32_t ReadHeader(void* pContext, int* width, int* height,
int* pal_num, void** pal_pp, int* bg_index, CFX_DIBAttribute* pAttribute = NULL) = 0;
@@ -265,7 +265,7 @@ public:
void (*RecordCurrentPositionCallback)(void* pModule, FX_DWORD& cur_pos);
- FX_LPBYTE (*AskLocalPaletteBufCallback)(void* pModule, int32_t frame_num, int32_t pal_size);
+ uint8_t* (*AskLocalPaletteBufCallback)(void* pModule, int32_t frame_num, int32_t pal_size);
virtual int32_t LoadFrame(void* pContext, int frame_num, CFX_DIBAttribute* pAttribute = NULL) = 0;
@@ -274,7 +274,7 @@ public:
int32_t delay_time, FX_BOOL user_input,
int32_t trans_index, int32_t disposal_method, FX_BOOL interlace);
- void (*ReadScanlineCallback)(void* pModule, int32_t row_num, FX_LPBYTE row_buf);
+ void (*ReadScanlineCallback)(void* pModule, int32_t row_num, uint8_t* row_buf);
};
class ICodec_BmpModule
{
@@ -286,9 +286,9 @@ public:
virtual void Finish(void* pContext) = 0;
- virtual FX_DWORD GetAvailInput(void* pContext, FX_LPBYTE* avail_buf_ptr = NULL) = 0;
+ virtual FX_DWORD GetAvailInput(void* pContext, uint8_t** avail_buf_ptr = NULL) = 0;
- virtual void Input(void* pContext, FX_LPCBYTE src_buf, FX_DWORD src_size) = 0;
+ virtual void Input(void* pContext, const uint8_t* src_buf, FX_DWORD src_size) = 0;
virtual int32_t ReadHeader(void* pContext, int32_t* width, int32_t* height, FX_BOOL* tb_flag, int32_t* components,
int* pal_num, FX_DWORD** pal_pp, CFX_DIBAttribute* pAttribute = NULL) = 0;
@@ -297,7 +297,7 @@ public:
FX_BOOL (*InputImagePositionBufCallback)(void* pModule, FX_DWORD rcd_pos);
- void (*ReadScanlineCallback)(void* pModule, int32_t row_num, FX_LPBYTE row_buf);
+ void (*ReadScanlineCallback)(void* pModule, int32_t row_num, uint8_t* row_buf);
};
class ICodec_TiffModule
{
@@ -305,17 +305,17 @@ public:
virtual ~ICodec_TiffModule() {}
- virtual FX_LPVOID CreateDecoder(IFX_FileRead* file_ptr) = 0;
+ virtual void* CreateDecoder(IFX_FileRead* file_ptr) = 0;
- virtual void GetFrames(FX_LPVOID ctx, int32_t& frames) = 0;
+ virtual void GetFrames(void* ctx, int32_t& frames) = 0;
- virtual FX_BOOL LoadFrameInfo(FX_LPVOID ctx, int32_t frame, FX_DWORD& width, FX_DWORD& height, FX_DWORD& comps, FX_DWORD& bpc, CFX_DIBAttribute* pAttribute = NULL) = 0;
+ virtual FX_BOOL LoadFrameInfo(void* ctx, int32_t frame, FX_DWORD& width, FX_DWORD& height, FX_DWORD& comps, FX_DWORD& bpc, CFX_DIBAttribute* pAttribute = NULL) = 0;
- virtual FX_BOOL Decode(FX_LPVOID ctx, class CFX_DIBitmap* pDIBitmap) = 0;
+ virtual FX_BOOL Decode(void* ctx, class CFX_DIBitmap* pDIBitmap) = 0;
- virtual void DestroyDecoder(FX_LPVOID ctx) = 0;
+ virtual void DestroyDecoder(void* ctx) = 0;
};
class ICodec_Jbig2Module
{
@@ -323,18 +323,18 @@ public:
virtual ~ICodec_Jbig2Module() {}
- virtual FX_BOOL Decode(FX_DWORD width, FX_DWORD height, FX_LPCBYTE src_buf, FX_DWORD src_size,
- FX_LPCBYTE global_data, FX_DWORD global_size, FX_LPBYTE dest_buf, FX_DWORD dest_pitch) = 0;
+ virtual FX_BOOL Decode(FX_DWORD width, FX_DWORD height, const uint8_t* src_buf, FX_DWORD src_size,
+ const uint8_t* global_data, FX_DWORD global_size, uint8_t* dest_buf, FX_DWORD dest_pitch) = 0;
virtual FX_BOOL Decode(IFX_FileRead* file_ptr, FX_DWORD& width, FX_DWORD& height,
- FX_DWORD& pitch, FX_LPBYTE& dest_buf) = 0;
+ FX_DWORD& pitch, uint8_t*& dest_buf) = 0;
virtual void* CreateJbig2Context() = 0;
- virtual FXCODEC_STATUS StartDecode(void* pJbig2Context, FX_DWORD width, FX_DWORD height, FX_LPCBYTE src_buf, FX_DWORD src_size,
- FX_LPCBYTE global_data, FX_DWORD global_size, FX_LPBYTE dest_buf, FX_DWORD dest_pitch, IFX_Pause* pPause) = 0;
+ virtual FXCODEC_STATUS StartDecode(void* pJbig2Context, FX_DWORD width, FX_DWORD height, const uint8_t* src_buf, FX_DWORD src_size,
+ const uint8_t* global_data, FX_DWORD global_size, uint8_t* dest_buf, FX_DWORD dest_pitch, IFX_Pause* pPause) = 0;
virtual FXCODEC_STATUS StartDecode(void* pJbig2Context, IFX_FileRead* file_ptr,
- FX_DWORD& width, FX_DWORD& height, FX_DWORD& pitch, FX_LPBYTE& dest_buf, IFX_Pause* pPause) = 0;
+ FX_DWORD& width, FX_DWORD& height, FX_DWORD& pitch, uint8_t*& dest_buf, IFX_Pause* pPause) = 0;
virtual FXCODEC_STATUS ContinueDecode(void* pJbig2Content, IFX_Pause* pPause) = 0;
virtual void DestroyJbig2Context(void* pJbig2Content) = 0;
};
@@ -394,18 +394,18 @@ public:
IccCS ColorSpace;
FX_DWORD dwProfileType;
FX_DWORD dwFormat;
- FX_LPBYTE pProfileData;
+ uint8_t* pProfileData;
FX_DWORD dwProfileSize;
double Gamma;
} IccParam;
virtual ~ICodec_IccModule() {}
- virtual IccCS GetProfileCS(FX_LPCBYTE pProfileData, unsigned int dwProfileSize) = 0;
+ virtual IccCS GetProfileCS(const uint8_t* pProfileData, unsigned int dwProfileSize) = 0;
virtual IccCS GetProfileCS(IFX_FileRead* pFile) = 0;
- virtual FX_LPVOID CreateTransform(ICodec_IccModule::IccParam* pInputParam,
+ virtual void* CreateTransform(ICodec_IccModule::IccParam* pInputParam,
ICodec_IccModule::IccParam* pOutputParam,
ICodec_IccModule::IccParam* pProofParam = NULL,
FX_DWORD dwIntent = Icc_INTENT_PERCEPTUAL,
@@ -415,26 +415,26 @@ public:
) = 0;
- virtual FX_LPVOID CreateTransform_sRGB(FX_LPCBYTE pProfileData, FX_DWORD dwProfileSize, int32_t& nComponents, int32_t intent = 0,
+ virtual void* CreateTransform_sRGB(const uint8_t* pProfileData, FX_DWORD dwProfileSize, int32_t& nComponents, int32_t intent = 0,
FX_DWORD dwSrcFormat = Icc_FORMAT_DEFAULT) = 0;
- virtual FX_LPVOID CreateTransform_CMYK(FX_LPCBYTE pSrcProfileData, FX_DWORD dwSrcProfileSize, int32_t& nSrcComponents,
- FX_LPCBYTE pDstProfileData, FX_DWORD dwDstProfileSize, int32_t intent = 0,
+ virtual void* CreateTransform_CMYK(const uint8_t* pSrcProfileData, FX_DWORD dwSrcProfileSize, int32_t& nSrcComponents,
+ const uint8_t* pDstProfileData, FX_DWORD dwDstProfileSize, int32_t intent = 0,
FX_DWORD dwSrcFormat = Icc_FORMAT_DEFAULT,
FX_DWORD dwDstFormat = Icc_FORMAT_DEFAULT
) = 0;
- virtual void DestroyTransform(FX_LPVOID pTransform) = 0;
+ virtual void DestroyTransform(void* pTransform) = 0;
- virtual void Translate(FX_LPVOID pTransform, FX_FLOAT* pSrcValues, FX_FLOAT* pDestValues) = 0;
+ virtual void Translate(void* pTransform, FX_FLOAT* pSrcValues, FX_FLOAT* pDestValues) = 0;
- virtual void TranslateScanline(FX_LPVOID pTransform, FX_LPBYTE pDest, FX_LPCBYTE pSrc, int pixels) = 0;
+ virtual void TranslateScanline(void* pTransform, uint8_t* pDest, const uint8_t* pSrc, int pixels) = 0;
virtual void SetComponents(FX_DWORD nComponents) = 0;
};
void AdobeCMYK_to_sRGB(FX_FLOAT c, FX_FLOAT m, FX_FLOAT y, FX_FLOAT k, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B);
void AdobeCMYK_to_sRGB1(uint8_t c, uint8_t m, uint8_t y, uint8_t k, uint8_t& R, uint8_t& G, uint8_t& B);
-FX_BOOL MD5ComputeID(FX_LPCVOID buf, FX_DWORD dwSize, uint8_t ID[16]);
+FX_BOOL MD5ComputeID(const void* buf, FX_DWORD dwSize, uint8_t ID[16]);
class CFX_DIBAttribute
{
public:
@@ -467,7 +467,7 @@ class IFX_DIBAttributeExif
{
public:
virtual ~IFX_DIBAttributeExif() {};
- virtual FX_BOOL GetInfo(FX_WORD tag, FX_LPVOID val) = 0;
+ virtual FX_BOOL GetInfo(FX_WORD tag, void* val) = 0;
};
#endif // CORE_INCLUDE_FXCODEC_FX_CODEC_H_
diff --git a/core/include/fxcodec/fx_codec_provider.h b/core/include/fxcodec/fx_codec_provider.h
index 8d2b4980ec..276977bc1d 100644
--- a/core/include/fxcodec/fx_codec_provider.h
+++ b/core/include/fxcodec/fx_codec_provider.h
@@ -13,7 +13,7 @@ class IFX_JpegProvider
public:
virtual void Release() = 0;
- virtual void* CreateDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, int width, int height, int nComps, FX_BOOL ColorTransform) = 0;
+ virtual void* CreateDecoder(const uint8_t* src_buf, FX_DWORD src_size, int width, int height, int nComps, FX_BOOL ColorTransform) = 0;
virtual void DestroyDecoder(void* pDecoder) = 0;
@@ -22,33 +22,33 @@ public:
virtual FX_BOOL Rewind(void* pDecoder) = 0;
- virtual FX_LPBYTE GetNextLine(void* pDecoder) = 0;
+ virtual uint8_t* GetNextLine(void* pDecoder) = 0;
virtual FX_DWORD GetSrcOffset(void* pDecoder) = 0;
- virtual FX_BOOL LoadInfo(FX_LPCBYTE src_buf, FX_DWORD src_size, int& width, int& height,
+ virtual FX_BOOL LoadInfo(const uint8_t* src_buf, FX_DWORD src_size, int& width, int& height,
int& num_components, int& bits_per_components, FX_BOOL& color_transform,
- FX_LPBYTE* icc_buf_ptr = NULL, FX_DWORD* icc_length = NULL) = 0;
+ uint8_t** icc_buf_ptr = NULL, FX_DWORD* icc_length = NULL) = 0;
- virtual FX_BOOL Encode(const class CFX_DIBSource* pSource, FX_LPBYTE& dest_buf, FX_STRSIZE& dest_size, int quality = 75,
- FX_LPCBYTE icc_buf = NULL, FX_DWORD icc_length = 0) = 0;
+ virtual FX_BOOL Encode(const class CFX_DIBSource* pSource, uint8_t*& dest_buf, FX_STRSIZE& dest_size, int quality = 75,
+ const uint8_t* icc_buf = NULL, FX_DWORD icc_length = 0) = 0;
virtual void* Start() = 0;
virtual void Finish(void* pContext) = 0;
- virtual void Input(void* pContext, FX_LPCBYTE src_buf, FX_DWORD src_size) = 0;
+ virtual void Input(void* pContext, const uint8_t* src_buf, FX_DWORD src_size) = 0;
virtual int ReadHeader(void* pContext, int* width, int* height, int* nComps, CFX_DIBAttribute* pAttribute = NULL) = 0;
virtual int StartScanline(void* pContext, int down_scale) = 0;
- virtual FX_BOOL ReadScanline(void* pContext, FX_LPBYTE dest_buf) = 0;
+ virtual FX_BOOL ReadScanline(void* pContext, uint8_t* dest_buf) = 0;
- virtual FX_DWORD GetAvailInput(void* pContext, FX_LPBYTE* avail_buf_ptr = NULL) = 0;
+ virtual FX_DWORD GetAvailInput(void* pContext, uint8_t** avail_buf_ptr = NULL) = 0;
protected:
~IFX_JpegProvider() { }