diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-10-16 11:35:42 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-10-16 16:23:11 +0000 |
commit | 8e7f932410732a4f05d2e69e9ff66277f54d1bd7 (patch) | |
tree | 963cf7fd3558da33edbc8b4e9ce52107d574037e /core/fxge/cfx_color.h | |
parent | a74a6277a0913a674719da3134efd877a5e8d091 (diff) | |
download | pdfium-8e7f932410732a4f05d2e69e9ff66277f54d1bd7.tar.xz |
Convert CPVT_Color to CFX_Color
This CL converts the use of CPVT_Color to CFX_Color and removes the
CPVT_Color class.
Change-Id: I86a2d06524cd8f0fbce2335f0185426cc41dbe84
Reviewed-on: https://pdfium-review.googlesource.com/16030
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fxge/cfx_color.h')
-rw-r--r-- | core/fxge/cfx_color.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/core/fxge/cfx_color.h b/core/fxge/cfx_color.h index b92c0bcc28..413c0a49c1 100644 --- a/core/fxge/cfx_color.h +++ b/core/fxge/cfx_color.h @@ -11,10 +11,15 @@ #include "core/fxge/fx_dib.h" struct CFX_Color { + static CFX_Color ParseColor(const CPDF_Array& array); + static CFX_Color ParseColor(const ByteString& str); + + enum Type { kTransparent = 0, kGray, kRGB, kCMYK }; + explicit CFX_Color(FX_COLORREF ref) : CFX_Color(FXARGB_R(ref), FXARGB_G(ref), FXARGB_B(ref)) {} - CFX_Color(int32_t type = COLORTYPE_TRANSPARENT, + CFX_Color(int32_t type = CFX_Color::kTransparent, float color1 = 0.0f, float color2 = 0.0f, float color3 = 0.0f, @@ -26,7 +31,7 @@ struct CFX_Color { fColor4(color4) {} CFX_Color(int32_t r, int32_t g, int32_t b) - : nColorType(COLORTYPE_RGB), + : nColorType(CFX_Color::kRGB), fColor1(r / 255.0f), fColor2(g / 255.0f), fColor3(b / 255.0f), @@ -40,7 +45,7 @@ struct CFX_Color { FX_COLORREF ToFXColor(int32_t nTransparency) const; void Reset() { - nColorType = COLORTYPE_TRANSPARENT; + nColorType = CFX_Color::kTransparent; fColor1 = 0.0f; fColor2 = 0.0f; fColor3 = 0.0f; |