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