OLD | NEW |
1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #ifndef CORE_FPDFDOC_CPVT_COLOR_H_ | 7 #ifndef CORE_FPDFDOC_CPVT_COLOR_H_ |
8 #define CORE_FPDFDOC_CPVT_COLOR_H_ | 8 #define CORE_FPDFDOC_CPVT_COLOR_H_ |
9 | 9 |
10 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" | 10 #include "core/fpdfapi/fpdf_parser/cpdf_array.h" |
11 #include "core/fxcrt/include/fx_string.h" | 11 #include "core/fxcrt/include/fx_string.h" |
12 #include "core/fxcrt/include/fx_system.h" | 12 #include "core/fxcrt/include/fx_system.h" |
13 | 13 |
14 struct CPVT_Color { | 14 struct CPVT_Color { |
15 enum Type { kTransparent = 0, kGray, kRGB, kCMYK }; | 15 enum Type { kTransparent = 0, kGray, kRGB, kCMYK }; |
16 | 16 |
17 CPVT_Color(Type type = kTransparent, | 17 CPVT_Color(Type type = kTransparent, |
18 FX_FLOAT color1 = 0.0f, | 18 FX_FLOAT color1 = 0.0f, |
19 FX_FLOAT color2 = 0.0f, | 19 FX_FLOAT color2 = 0.0f, |
20 FX_FLOAT color3 = 0.0f, | 20 FX_FLOAT color3 = 0.0f, |
21 FX_FLOAT color4 = 0.0f) | 21 FX_FLOAT color4 = 0.0f) |
22 : nColorType(type), | 22 : nColorType(type), |
23 fColor1(color1), | 23 fColor1(color1), |
24 fColor2(color2), | 24 fColor2(color2), |
25 fColor3(color3), | 25 fColor3(color3), |
26 fColor4(color4) {} | 26 fColor4(color4) {} |
27 | 27 |
28 Type nColorType; | 28 Type nColorType; |
29 FX_FLOAT fColor1; | 29 FX_FLOAT fColor1; |
30 FX_FLOAT fColor2; | 30 FX_FLOAT fColor2; |
31 FX_FLOAT fColor3; | 31 FX_FLOAT fColor3; |
32 FX_FLOAT fColor4; | 32 FX_FLOAT fColor4; |
33 | 33 |
34 static CPVT_Color ParseColor(const CFX_ByteString& str); | 34 static CPVT_Color ParseColor(const CFX_ByteString& str); |
35 static CPVT_Color ParseColor(const CPDF_Array& array); | 35 static CPVT_Color ParseColor(const CPDF_Array& array); |
36 }; | 36 }; |
37 | 37 |
38 #endif // CORE_FPDFDOC_CPVT_COLOR_H_ | 38 #endif // CORE_FPDFDOC_CPVT_COLOR_H_ |
OLD | NEW |