diff options
author | Lei Zhang <thestig@chromium.org> | 2017-03-15 13:26:37 -0700 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-03-15 21:10:29 +0000 |
commit | a12159b17085796e2b72d2b49e850092e0b4e8b7 (patch) | |
tree | df7a5d149c9bbfe5c2d2ec16631c3dcb6ae9a901 /core/fpdfapi/page/cpdf_color.cpp | |
parent | 59d9416553b293f6df923c2f3ef33def2d51d7b7 (diff) | |
download | pdfium-a12159b17085796e2b72d2b49e850092e0b4e8b7.tar.xz |
Refactor some CPDF_ColorSpace code.
Change-Id: I1e30d68dae3bf70cf3c426f6126d593b7f1c3ba4
Reviewed-on: https://pdfium-review.googlesource.com/2991
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'core/fpdfapi/page/cpdf_color.cpp')
-rw-r--r-- | core/fpdfapi/page/cpdf_color.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/core/fpdfapi/page/cpdf_color.cpp b/core/fpdfapi/page/cpdf_color.cpp index b191b24808..46771513f4 100644 --- a/core/fpdfapi/page/cpdf_color.cpp +++ b/core/fpdfapi/page/cpdf_color.cpp @@ -132,17 +132,19 @@ void CPDF_Color::Copy(const CPDF_Color* pSrc) { } } -bool CPDF_Color::GetRGB(int& R, int& G, int& B) const { +bool CPDF_Color::GetRGB(int* R, int* G, int* B) const { if (!m_pCS || !m_pBuffer) return false; - float r = 0.0f, g = 0.0f, b = 0.0f; - if (!m_pCS->GetRGB(m_pBuffer, r, g, b)) + float r = 0.0f; + float g = 0.0f; + float b = 0.0f; + if (!m_pCS->GetRGB(m_pBuffer, &r, &g, &b)) return false; - R = (int32_t)(r * 255 + 0.5f); - G = (int32_t)(g * 255 + 0.5f); - B = (int32_t)(b * 255 + 0.5f); + *R = static_cast<int32_t>(r * 255 + 0.5f); + *G = static_cast<int32_t>(g * 255 + 0.5f); + *B = static_cast<int32_t>(b * 255 + 0.5f); return true; } |