diff options
Diffstat (limited to 'core/fxcodec/codec/ccodec_iccmodule.h')
-rw-r--r-- | core/fxcodec/codec/ccodec_iccmodule.h | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/core/fxcodec/codec/ccodec_iccmodule.h b/core/fxcodec/codec/ccodec_iccmodule.h index 08878acc98..e775475249 100644 --- a/core/fxcodec/codec/ccodec_iccmodule.h +++ b/core/fxcodec/codec/ccodec_iccmodule.h @@ -7,23 +7,41 @@ #ifndef CORE_FXCODEC_CODEC_CCODEC_ICCMODULE_H_ #define CORE_FXCODEC_CODEC_CCODEC_ICCMODULE_H_ +#include <memory> + #include "core/fxcodec/fx_codec_def.h" #include "core/fxcrt/fx_string.h" #include "core/fxcrt/fx_system.h" +#include "third_party/base/ptr_util.h" + +#if defined(USE_SYSTEM_LCMS2) +#include <lcms2.h> +#else +#include "third_party/lcms2-2.6/include/lcms2.h" +#endif + +class CLcmsCmm { + public: + CLcmsCmm(int srcComponents, cmsHTRANSFORM transform, bool isLab); + ~CLcmsCmm(); + + cmsHTRANSFORM m_hTransform; + int m_nSrcComponents; + bool m_bLab; +}; class CCodec_IccModule { public: CCodec_IccModule(); ~CCodec_IccModule(); - void* CreateTransform_sRGB(const uint8_t* pProfileData, - uint32_t dwProfileSize, - uint32_t& nComponents, - int32_t intent = 0, - uint32_t dwSrcFormat = Icc_FORMAT_DEFAULT); - void DestroyTransform(void* pTransform); - void Translate(void* pTransform, const float* pSrcValues, float* pDestValues); - void TranslateScanline(void* pTransform, + std::unique_ptr<CLcmsCmm> CreateTransform_sRGB(const uint8_t* pProfileData, + uint32_t dwProfileSize, + uint32_t* nComponents); + void Translate(CLcmsCmm* pTransform, + const float* pSrcValues, + float* pDestValues); + void TranslateScanline(CLcmsCmm* pTransform, uint8_t* pDest, const uint8_t* pSrc, int pixels); |