From 236ce3ba2f274307db9ed49c595e242cd811716c Mon Sep 17 00:00:00 2001 From: Nicolas Pena Date: Tue, 4 Apr 2017 17:47:50 -0400 Subject: Remove dib_int.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Commit-Queue: Nicolás Peña --- core/fxge/dib/cfx_imagetransformer.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'core/fxge/dib/cfx_imagetransformer.cpp') 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& 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) -- cgit v1.2.3