summaryrefslogtreecommitdiff
path: root/core/fxcodec
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxcodec')
-rw-r--r--core/fxcodec/codec/fx_codec_icc.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/core/fxcodec/codec/fx_codec_icc.cpp b/core/fxcodec/codec/fx_codec_icc.cpp
index cb89584e11..b143dcc0c9 100644
--- a/core/fxcodec/codec/fx_codec_icc.cpp
+++ b/core/fxcodec/codec/fx_codec_icc.cpp
@@ -4,9 +4,6 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#include <algorithm>
-#include <vector>
-
#include "core/fxcodec/codec/codec_int.h"
#include "core/fxcodec/fx_codec.h"
#include "third_party/lcms2-2.6/include/lcms2.h"
@@ -168,12 +165,14 @@ void IccLib_Translate(void* pTransform,
CLcmsCmm* p = (CLcmsCmm*)pTransform;
uint8_t output[4];
if (p->m_bLab) {
- std::vector<double> input(std::max(16U, nSrcComponents));
+ CFX_FixedBufGrow<double, 16> inputs(nSrcComponents);
+ double* input = inputs;
for (uint32_t i = 0; i < nSrcComponents; i++)
input[i] = pSrcValues[i];
- cmsDoTransform(p->m_hTransform, input.data(), output, 1);
+ cmsDoTransform(p->m_hTransform, input, output, 1);
} else {
- std::vector<uint8_t> input(std::max(16U, nSrcComponents));
+ CFX_FixedBufGrow<uint8_t, 16> inputs(nSrcComponents);
+ uint8_t* input = inputs;
for (uint32_t i = 0; i < nSrcComponents; i++) {
if (pSrcValues[i] > 1.0f)
input[i] = 255;
@@ -182,7 +181,7 @@ void IccLib_Translate(void* pTransform,
else
input[i] = static_cast<int>(pSrcValues[i] * 255.0f);
}
- cmsDoTransform(p->m_hTransform, input.data(), output, 1);
+ cmsDoTransform(p->m_hTransform, input, output, 1);
}
switch (p->m_nDstComponents) {
case 1: