1 // Copyright 2014 PDFium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 6 7 #ifndef _BC_COMMONPERSPECTIVETRANSFORM_H_ 8 #define _BC_COMMONPERSPECTIVETRANSFORM_H_ 9 class CBC_CommonPerspectiveTransform { 10 public: 11 CBC_CommonPerspectiveTransform(FX_FLOAT a11, 12 FX_FLOAT a21, 13 FX_FLOAT a31, 14 FX_FLOAT a12, 15 FX_FLOAT a22, 16 FX_FLOAT a32, 17 FX_FLOAT a13, 18 FX_FLOAT a23, 19 FX_FLOAT a33); 20 virtual ~CBC_CommonPerspectiveTransform(); 21 static CBC_CommonPerspectiveTransform* QuadrilateralToQuadrilateral( 22 FX_FLOAT x0, 23 FX_FLOAT y0, 24 FX_FLOAT x1, 25 FX_FLOAT y1, 26 FX_FLOAT x2, 27 FX_FLOAT y2, 28 FX_FLOAT x3, 29 FX_FLOAT y3, 30 FX_FLOAT x0p, 31 FX_FLOAT y0p, 32 FX_FLOAT x1p, 33 FX_FLOAT y1p, 34 FX_FLOAT x2p, 35 FX_FLOAT y2p, 36 FX_FLOAT x3p, 37 FX_FLOAT y3p); 38 static CBC_CommonPerspectiveTransform* SquareToQuadrilateral(FX_FLOAT x0, 39 FX_FLOAT y0, 40 FX_FLOAT x1, 41 FX_FLOAT y1, 42 FX_FLOAT x2, 43 FX_FLOAT y2, 44 FX_FLOAT x3, 45 FX_FLOAT y3); 46 static CBC_CommonPerspectiveTransform* QuadrilateralToSquare(FX_FLOAT x0, 47 FX_FLOAT y0, 48 FX_FLOAT x1, 49 FX_FLOAT y1, 50 FX_FLOAT x2, 51 FX_FLOAT y2, 52 FX_FLOAT x3, 53 FX_FLOAT y3); 54 CBC_CommonPerspectiveTransform* BuildAdjoint(); 55 CBC_CommonPerspectiveTransform* Times(CBC_CommonPerspectiveTransform& other); 56 void TransformPoints(CFX_FloatArray* points); 57 58 private: 59 FX_FLOAT m_a11, m_a12, m_a13, m_a21, m_a22, m_a23, m_a31, m_a32, m_a33; 60 }; 61 #endif 62