summaryrefslogtreecommitdiff
path: root/core/fxge/dib/cfx_imagetransformer.cpp
diff options
context:
space:
mode:
authorNicolas Pena <npm@chromium.org>2017-04-04 17:47:50 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-04-04 22:20:42 +0000
commit236ce3ba2f274307db9ed49c595e242cd811716c (patch)
treec155d54f3f917a5ae28047776f8109cd688bf249 /core/fxge/dib/cfx_imagetransformer.cpp
parentafd0d1f488ea55da545b3310fd8f22e45522a695 (diff)
downloadpdfium-236ce3ba2f274307db9ed49c595e242cd811716c.tar.xz
Remove dib_int.h
This CL removes dib_int.h by moving CStretchEngine to its own file, other classes to where they are used, and the remaining to fx_dib.h. Change-Id: Ie2d4bb39389737cd631f92b88000ea942608da21 Reviewed-on: https://pdfium-review.googlesource.com/3714 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'core/fxge/dib/cfx_imagetransformer.cpp')
-rw-r--r--core/fxge/dib/cfx_imagetransformer.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/core/fxge/dib/cfx_imagetransformer.cpp b/core/fxge/dib/cfx_imagetransformer.cpp
index 65f6bc8ec9..c5fb467ad8 100644
--- a/core/fxge/dib/cfx_imagetransformer.cpp
+++ b/core/fxge/dib/cfx_imagetransformer.cpp
@@ -115,6 +115,32 @@ FXDIB_Format GetTransformedFormat(const CFX_RetainPtr<CFX_DIBSource>& pDrc) {
return format;
}
+class CPDF_FixedMatrix {
+ public:
+ CPDF_FixedMatrix(const CFX_Matrix& src, int bits) {
+ base = 1 << bits;
+ a = FXSYS_round(src.a * base);
+ b = FXSYS_round(src.b * base);
+ c = FXSYS_round(src.c * base);
+ d = FXSYS_round(src.d * base);
+ e = FXSYS_round(src.e * base);
+ f = FXSYS_round(src.f * base);
+ }
+
+ inline void Transform(int x, int y, int& x1, int& y1) {
+ x1 = (a * x + c * y + e + base / 2) / base;
+ y1 = (b * x + d * y + f + base / 2) / base;
+ }
+
+ int a;
+ int b;
+ int c;
+ int d;
+ int e;
+ int f;
+ int base;
+};
+
class CFX_BilinearMatrix : public CPDF_FixedMatrix {
public:
CFX_BilinearMatrix(const CFX_Matrix& src, int bits)