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/fpdfdoc/cpvt_color.cpp | |
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/fpdfdoc/cpvt_color.cpp')
-rw-r--r-- | core/fpdfdoc/cpvt_color.cpp | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/core/fpdfdoc/cpvt_color.cpp b/core/fpdfdoc/cpvt_color.cpp deleted file mode 100644 index 914e416dbd..0000000000 --- a/core/fpdfdoc/cpvt_color.cpp +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2016 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#include "core/fpdfdoc/cpvt_color.h" - -#include "core/fpdfapi/parser/cpdf_simple_parser.h" - -// Static. -CPVT_Color CPVT_Color::ParseColor(const ByteString& str) { - CPDF_SimpleParser syntax(str.AsStringView()); - if (syntax.FindTagParamFromStart("g", 1)) - return CPVT_Color(CPVT_Color::kGray, FX_atof(syntax.GetWord())); - - if (syntax.FindTagParamFromStart("rg", 3)) { - float f1 = FX_atof(syntax.GetWord()); - float f2 = FX_atof(syntax.GetWord()); - float f3 = FX_atof(syntax.GetWord()); - return CPVT_Color(CPVT_Color::kRGB, f1, f2, f3); - } - if (syntax.FindTagParamFromStart("k", 4)) { - float f1 = FX_atof(syntax.GetWord()); - float f2 = FX_atof(syntax.GetWord()); - float f3 = FX_atof(syntax.GetWord()); - float f4 = FX_atof(syntax.GetWord()); - return CPVT_Color(CPVT_Color::kCMYK, f1, f2, f3, f4); - } - return CPVT_Color(CPVT_Color::kTransparent); -} - -// Static. -CPVT_Color CPVT_Color::ParseColor(const CPDF_Array& array) { - CPVT_Color rt; - switch (array.GetCount()) { - case 1: - rt = CPVT_Color(CPVT_Color::kGray, array.GetFloatAt(0)); - break; - case 3: - rt = CPVT_Color(CPVT_Color::kRGB, array.GetFloatAt(0), - array.GetFloatAt(1), array.GetFloatAt(2)); - break; - case 4: - rt = CPVT_Color(CPVT_Color::kCMYK, array.GetFloatAt(0), - array.GetFloatAt(1), array.GetFloatAt(2), - array.GetFloatAt(3)); - break; - } - return rt; -} |