summaryrefslogtreecommitdiff
path: root/core/fpdfapi/page/cpdf_color.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-04-13 18:31:55 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-04-13 18:31:55 +0000
commitdc62019316b411c2e8fe1e9c1a3aa5fb89762cd4 (patch)
treed6d4fe77336ad2f92580a9f0e363837958cdcde0 /core/fpdfapi/page/cpdf_color.cpp
parent00e72c1d1787c71e08d42a06cca3a53419e369da (diff)
downloadpdfium-dc62019316b411c2e8fe1e9c1a3aa5fb89762cd4.tar.xz
Get rid of CPDF_Color::GetColorSpace().
Replace it with more narrowly focused methods to get specific bits from the colorspace. Change-Id: Ifd2980f0fd06230d4d94d28eddf72219d2e9e6eb Reviewed-on: https://pdfium-review.googlesource.com/30590 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fpdfapi/page/cpdf_color.cpp')
-rw-r--r--core/fpdfapi/page/cpdf_color.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/core/fpdfapi/page/cpdf_color.cpp b/core/fpdfapi/page/cpdf_color.cpp
index 3c87457d1b..dfee9d93ca 100644
--- a/core/fpdfapi/page/cpdf_color.cpp
+++ b/core/fpdfapi/page/cpdf_color.cpp
@@ -146,6 +146,14 @@ void CPDF_Color::Copy(const CPDF_Color& src) {
pPattern->pattern_obj(), false, pPattern->parent_matrix());
}
+uint32_t CPDF_Color::CountComponents() const {
+ return m_pCS->CountComponents();
+}
+
+bool CPDF_Color::IsColorSpaceRGB() const {
+ return m_pCS == CPDF_ColorSpace::GetStockCS(PDFCS_DEVICERGB);
+}
+
bool CPDF_Color::GetRGB(int* R, int* G, int* B) const {
if (!m_pCS || !m_pBuffer)
return false;