summaryrefslogtreecommitdiff
path: root/core/src/fxcodec/codec
diff options
context:
space:
mode:
authorWei Li <weili@chromium.org>2016-03-10 12:35:07 -0800
committerWei Li <weili@chromium.org>2016-03-10 12:35:07 -0800
commit79fcb5f6fa61967517566100415972848edefd24 (patch)
tree314016e327303cd3e4e3da06dd1789b79ecbf352 /core/src/fxcodec/codec
parent2852ce07c4e5b1053420cbf375e098e09faf679c (diff)
downloadpdfium-79fcb5f6fa61967517566100415972848edefd24.tar.xz
Change colorspace's number of components to be unsigned
Also remove unnecessary casts. BUG=pdfium:29 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1783933002 .
Diffstat (limited to 'core/src/fxcodec/codec')
-rw-r--r--core/src/fxcodec/codec/codec_int.h4
-rw-r--r--core/src/fxcodec/codec/fx_codec_icc.cpp14
2 files changed, 11 insertions, 7 deletions
diff --git a/core/src/fxcodec/codec/codec_int.h b/core/src/fxcodec/codec/codec_int.h
index bde3daeaea..5c784adad6 100644
--- a/core/src/fxcodec/codec/codec_int.h
+++ b/core/src/fxcodec/codec/codec_int.h
@@ -287,13 +287,13 @@ class CCodec_IccModule : public ICodec_IccModule {
void* CreateTransform_sRGB(
const uint8_t* pProfileData,
FX_DWORD dwProfileSize,
- int32_t& nComponents,
+ FX_DWORD& nComponents,
int32_t intent = 0,
FX_DWORD dwSrcFormat = Icc_FORMAT_DEFAULT) override;
void* CreateTransform_CMYK(
const uint8_t* pSrcProfileData,
FX_DWORD dwSrcProfileSize,
- int32_t& nSrcComponents,
+ FX_DWORD& nSrcComponents,
const uint8_t* pDstProfileData,
FX_DWORD dwDstProfileSize,
int32_t intent = 0,
diff --git a/core/src/fxcodec/codec/fx_codec_icc.cpp b/core/src/fxcodec/codec/fx_codec_icc.cpp
index 297f392a30..ebec0b0a34 100644
--- a/core/src/fxcodec/codec/fx_codec_icc.cpp
+++ b/core/src/fxcodec/codec/fx_codec_icc.cpp
@@ -66,7 +66,8 @@ FX_BOOL CheckComponents(cmsColorSpaceSignature cs,
}
return TRUE;
}
-int32_t GetCSComponents(cmsColorSpaceSignature cs) {
+
+FX_DWORD GetCSComponents(cmsColorSpaceSignature cs) {
FX_DWORD components;
switch (cs) {
case cmsSigLabData:
@@ -87,9 +88,10 @@ int32_t GetCSComponents(cmsColorSpaceSignature cs) {
}
return components;
}
+
void* IccLib_CreateTransform(const unsigned char* pSrcProfileData,
FX_DWORD dwSrcProfileSize,
- int32_t& nSrcComponents,
+ FX_DWORD& nSrcComponents,
const unsigned char* pDstProfileData,
FX_DWORD dwDstProfileSize,
int32_t nDstComponents,
@@ -169,7 +171,7 @@ void* IccLib_CreateTransform(const unsigned char* pSrcProfileData,
}
void* IccLib_CreateTransform_sRGB(const unsigned char* pProfileData,
FX_DWORD dwProfileSize,
- int32_t& nComponents,
+ FX_DWORD& nComponents,
int32_t intent,
FX_DWORD dwSrcFormat) {
return IccLib_CreateTransform(pProfileData, dwProfileSize, nComponents, NULL,
@@ -536,15 +538,16 @@ CCodec_IccModule::~CCodec_IccModule() {
}
void* CCodec_IccModule::CreateTransform_sRGB(const uint8_t* pProfileData,
FX_DWORD dwProfileSize,
- int32_t& nComponents,
+ FX_DWORD& nComponents,
int32_t intent,
FX_DWORD dwSrcFormat) {
return IccLib_CreateTransform_sRGB(pProfileData, dwProfileSize, nComponents,
intent, dwSrcFormat);
}
+
void* CCodec_IccModule::CreateTransform_CMYK(const uint8_t* pSrcProfileData,
FX_DWORD dwSrcProfileSize,
- int32_t& nSrcComponents,
+ FX_DWORD& nSrcComponents,
const uint8_t* pDstProfileData,
FX_DWORD dwDstProfileSize,
int32_t intent,
@@ -554,6 +557,7 @@ void* CCodec_IccModule::CreateTransform_CMYK(const uint8_t* pSrcProfileData,
pSrcProfileData, dwSrcProfileSize, nSrcComponents, pDstProfileData,
dwDstProfileSize, 4, intent, dwSrcFormat, dwDstFormat);
}
+
void CCodec_IccModule::DestroyTransform(void* pTransform) {
IccLib_DestroyTransform(pTransform);
}