summaryrefslogtreecommitdiff
path: root/core/fxge/dib/cfx_imagetransformer.h
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2017-12-04 14:35:05 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-12-04 14:35:05 +0000
commitc5bfeec86aa70c2ec573c183bd3a8390a3d903e6 (patch)
tree9a38cfd045c8b2172e52f61e573bcb70201bd95d /core/fxge/dib/cfx_imagetransformer.h
parent8509d3eaec1b2fac27a24de7bc586ad12b7bb178 (diff)
downloadpdfium-c5bfeec86aa70c2ec573c183bd3a8390a3d903e6.tar.xz
Add functions for common code in CFX_ImageTransformer.
Change-Id: I556934f61f24883e684865e4a8fc5e0519248cee Reviewed-on: https://pdfium-review.googlesource.com/20251 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fxge/dib/cfx_imagetransformer.h')
-rw-r--r--core/fxge/dib/cfx_imagetransformer.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/core/fxge/dib/cfx_imagetransformer.h b/core/fxge/dib/cfx_imagetransformer.h
index 40d51ec2a1..dcda687d42 100644
--- a/core/fxge/dib/cfx_imagetransformer.h
+++ b/core/fxge/dib/cfx_imagetransformer.h
@@ -32,6 +32,21 @@ class CFX_ImageTransformer {
RetainPtr<CFX_DIBitmap> DetachBitmap();
private:
+ bool IsBilinear() const {
+ return !(m_Flags & FXDIB_DOWNSAMPLE) && !IsBiCubic();
+ }
+ bool IsBiCubic() const { return !!(m_Flags & FXDIB_BICUBIC_INTERPOL); }
+
+ int stretch_width() const { return m_StretchClip.Width(); }
+ int stretch_height() const { return m_StretchClip.Height(); }
+
+ bool InStretchBounds(int col, int row) const {
+ return col >= 0 && col <= stretch_width() && row >= 0 &&
+ row <= stretch_height();
+ }
+
+ void AdjustCoords(int* col, int* row) const;
+
const RetainPtr<CFX_DIBSource> m_pSrc;
UnownedPtr<const CFX_Matrix> const m_pMatrix;
const FX_RECT* const m_pClip;