diff options
author | Nicolas Pena <npm@chromium.org> | 2017-07-12 14:45:08 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-07-12 18:58:24 +0000 |
commit | d79ac21b7595442bce82ec93f59cda9f8fb3cb24 (patch) | |
tree | 2c479141e360094a21cad7a1566a0c1a04e8a9c9 /core/fxcodec/codec/fx_codec_progress.cpp | |
parent | 58bf3de718e510648ee136c887be5b2d577644a7 (diff) | |
download | pdfium-d79ac21b7595442bce82ec93f59cda9f8fb3cb24.tar.xz |
Move CMYKtoRGB methods to fx_codec and clean them up
This CL moves CMYKtoRGB methods to fx_codec. It also cleans them up a
bit, including allowing them to return tuples instead of having
non-const refs in their parameters.
Change-Id: Ib3ec45102ec7eff623cd07a624e852d39bf335e4
Reviewed-on: https://pdfium-review.googlesource.com/7591
Commit-Queue: Nicolás Peña <npm@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fxcodec/codec/fx_codec_progress.cpp')
-rw-r--r-- | core/fxcodec/codec/fx_codec_progress.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/core/fxcodec/codec/fx_codec_progress.cpp b/core/fxcodec/codec/fx_codec_progress.cpp index e6832f2773..905a957184 100644 --- a/core/fxcodec/codec/fx_codec_progress.cpp +++ b/core/fxcodec/codec/fx_codec_progress.cpp @@ -1513,10 +1513,12 @@ void CCodec_ProgressiveDecoder::ReSampleScanline( int pixel_weight = pPixelWeights->m_Weights[j - pPixelWeights->m_SrcStart]; const uint8_t* src_pixel = src_scan + j * src_Bpp; - uint8_t src_b = 0, src_g = 0, src_r = 0; - AdobeCMYK_to_sRGB1(255 - src_pixel[0], 255 - src_pixel[1], - 255 - src_pixel[2], 255 - src_pixel[3], src_r, - src_g, src_b); + uint8_t src_b = 0; + uint8_t src_g = 0; + uint8_t src_r = 0; + std::tie(src_r, src_g, src_b) = + AdobeCMYK_to_sRGB1(255 - src_pixel[0], 255 - src_pixel[1], + 255 - src_pixel[2], 255 - src_pixel[3]); des_b += pixel_weight * src_b; des_g += pixel_weight * src_g; des_r += pixel_weight * src_r; @@ -1610,10 +1612,12 @@ void CCodec_ProgressiveDecoder::ReSampleScanline( int pixel_weight = pPixelWeights->m_Weights[j - pPixelWeights->m_SrcStart]; const uint8_t* src_pixel = src_scan + j * src_Bpp; - uint8_t src_b = 0, src_g = 0, src_r = 0; - AdobeCMYK_to_sRGB1(255 - src_pixel[0], 255 - src_pixel[1], - 255 - src_pixel[2], 255 - src_pixel[3], src_r, - src_g, src_b); + uint8_t src_b = 0; + uint8_t src_g = 0; + uint8_t src_r = 0; + std::tie(src_r, src_g, src_b) = + AdobeCMYK_to_sRGB1(255 - src_pixel[0], 255 - src_pixel[1], + 255 - src_pixel[2], 255 - src_pixel[3]); des_b += pixel_weight * src_b; des_g += pixel_weight * src_g; des_r += pixel_weight * src_r; |