summaryrefslogtreecommitdiff
path: root/core/fpdfapi/page
diff options
context:
space:
mode:
authorwileyrya <wileyrr@gmail.com>2017-05-26 15:20:23 -0500
committerChromium commit bot <commit-bot@chromium.org>2017-05-26 20:45:40 +0000
commit06bbdef296b483e6f666156b198319019d3c6373 (patch)
treeb63b6fe150abc4fb9eef8db39c76c63a60ba0ca9 /core/fpdfapi/page
parentcdfc035f4ea2e786c7d7820e143c18bdb11fac3f (diff)
downloadpdfium-06bbdef296b483e6f666156b198319019d3c6373.tar.xz
Add public API for setting the blend mode on a page object.
BUG=pdfium:720 R=npm@chromium.org Change-Id: I2a43b34da6946265ca06502b9ff19ad352fd18cb Reviewed-on: https://pdfium-review.googlesource.com/5953 Commit-Queue: Nicolás Peña <npm@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'core/fpdfapi/page')
-rw-r--r--core/fpdfapi/page/cpdf_generalstate.cpp37
-rw-r--r--core/fpdfapi/page/cpdf_generalstate.h1
2 files changed, 38 insertions, 0 deletions
diff --git a/core/fpdfapi/page/cpdf_generalstate.cpp b/core/fpdfapi/page/cpdf_generalstate.cpp
index e07a3ca13d..540707447e 100644
--- a/core/fpdfapi/page/cpdf_generalstate.cpp
+++ b/core/fpdfapi/page/cpdf_generalstate.cpp
@@ -78,6 +78,43 @@ CPDF_GeneralState::~CPDF_GeneralState() {}
void CPDF_GeneralState::SetRenderIntent(const CFX_ByteString& ri) {
m_Ref.GetPrivateCopy()->m_RenderIntent = RI_StringToId(ri);
}
+CFX_ByteString CPDF_GeneralState::GetBlendMode() const {
+ switch (GetBlendType()) {
+ case FXDIB_BLEND_NORMAL:
+ return CFX_ByteString("Normal");
+ case FXDIB_BLEND_MULTIPLY:
+ return CFX_ByteString("Multiply");
+ case FXDIB_BLEND_SCREEN:
+ return CFX_ByteString("Screen");
+ case FXDIB_BLEND_OVERLAY:
+ return CFX_ByteString("Overlay");
+ case FXDIB_BLEND_DARKEN:
+ return CFX_ByteString("Darken");
+ case FXDIB_BLEND_LIGHTEN:
+ return CFX_ByteString("Lighten");
+ case FXDIB_BLEND_COLORDODGE:
+ return CFX_ByteString("ColorDodge");
+ case FXDIB_BLEND_COLORBURN:
+ return CFX_ByteString("ColorBurn");
+ case FXDIB_BLEND_HARDLIGHT:
+ return CFX_ByteString("HardLight");
+ case FXDIB_BLEND_SOFTLIGHT:
+ return CFX_ByteString("SoftLight");
+ case FXDIB_BLEND_DIFFERENCE:
+ return CFX_ByteString("Difference");
+ case FXDIB_BLEND_EXCLUSION:
+ return CFX_ByteString("Exclusion");
+ case FXDIB_BLEND_HUE:
+ return CFX_ByteString("Hue");
+ case FXDIB_BLEND_SATURATION:
+ return CFX_ByteString("Saturation");
+ case FXDIB_BLEND_COLOR:
+ return CFX_ByteString("Color");
+ case FXDIB_BLEND_LUMINOSITY:
+ return CFX_ByteString("Luminosity");
+ }
+ return CFX_ByteString("Normal");
+}
int CPDF_GeneralState::GetBlendType() const {
const StateData* pData = m_Ref.GetObject();
diff --git a/core/fpdfapi/page/cpdf_generalstate.h b/core/fpdfapi/page/cpdf_generalstate.h
index 4ec08ca9c5..356841690b 100644
--- a/core/fpdfapi/page/cpdf_generalstate.h
+++ b/core/fpdfapi/page/cpdf_generalstate.h
@@ -27,6 +27,7 @@ class CPDF_GeneralState {
void SetRenderIntent(const CFX_ByteString& ri);
+ CFX_ByteString GetBlendMode() const;
int GetBlendType() const;
void SetBlendType(int type);