summaryrefslogtreecommitdiff
path: root/core/fpdfapi/page/cpdf_colorspace.h
diff options
context:
space:
mode:
authorHenrique Nakashima <hnakashima@chromium.org>2017-12-14 22:42:13 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-12-14 22:42:13 +0000
commitd92073b756277d2d4c9c839dd5ac8fa0e8bb9e28 (patch)
tree5a0f7850edcb9aa5131a9e00f5295a68357d7204 /core/fpdfapi/page/cpdf_colorspace.h
parent9a2c6552460c82417de13e86f07e23dc8c8cef74 (diff)
downloadpdfium-d92073b756277d2d4c9c839dd5ac8fa0e8bb9e28.tar.xz
Add restrictions to alternate color spaces.chromium/3295
- ICC color spaces cannot have a Pattern color space as Alternate - Separation and DeviceN color spaces cannot have a special color space as Alternate. Special color spaces are {Separation, DeviceN, Indexed and Pattern}. Bug: chromium:794492 Change-Id: Ia2199382c759d8d1d13c605c22d6495e935265ad Reviewed-on: https://pdfium-review.googlesource.com/21310 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fpdfapi/page/cpdf_colorspace.h')
-rw-r--r--core/fpdfapi/page/cpdf_colorspace.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/fpdfapi/page/cpdf_colorspace.h b/core/fpdfapi/page/cpdf_colorspace.h
index ff10dfce6a..9bd7c8d529 100644
--- a/core/fpdfapi/page/cpdf_colorspace.h
+++ b/core/fpdfapi/page/cpdf_colorspace.h
@@ -57,6 +57,11 @@ class CPDF_ColorSpace {
void GetDefaultColor(float* buf) const;
uint32_t CountComponents() const;
int GetFamily() const { return m_Family; }
+ bool IsSpecial() const {
+ return GetFamily() == PDFCS_SEPARATION || GetFamily() == PDFCS_DEVICEN ||
+ GetFamily() == PDFCS_INDEXED || GetFamily() == PDFCS_PATTERN;
+ }
+
virtual void GetDefaultValue(int iComponent,
float* value,
float* min,