Tesseract  3.02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
xform2d.h
Go to the documentation of this file.
1 /******************************************************************************
2  ** Filename: xform2d.h
3  ** Purpose: Definitions for using 2D point transformation library
4  ** Author: Dan Johnson
5  ** History: Fri Sep 22 09:57:08 1989, DSJ, Created.
6  **
7  ** (c) Copyright Hewlett-Packard Company, 1988.
8  ** Licensed under the Apache License, Version 2.0 (the "License");
9  ** you may not use this file except in compliance with the License.
10  ** You may obtain a copy of the License at
11  ** http://www.apache.org/licenses/LICENSE-2.0
12  ** Unless required by applicable law or agreed to in writing, software
13  ** distributed under the License is distributed on an "AS IS" BASIS,
14  ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  ** See the License for the specific language governing permissions and
16  ** limitations under the License.
17  ******************************************************************************/
18 #ifndef XFORM2D_H
19 #define XFORM2D_H
20 
24 #include "fpoint.h"
25 
26 typedef struct
27 {
28  FLOAT32 a, b, c, d, tx, ty;
29 }
30 
31 
33 
38 void InitMatrix(MATRIX_2D *M);
39 void CopyMatrix(MATRIX_2D *A, MATRIX_2D *B);
40 
41 /* matrix scaling, translation, rotation, mirroring, etc.*/
43 void ScaleMatrix(MATRIX_2D *M, FLOAT32 X, FLOAT32 Y);
44 
45 void MirrorMatrixInX(MATRIX_2D *M);
46 void MirrorMatrixInY(MATRIX_2D *M);
48 
49 /* using a matrix to map points*/
51 
53 
54 void MapPoint(MATRIX_2D *M, const FPOINT &A, FPOINT* B);
55 
58 
59  void RotateMatrix(MATRIX_2D_PTR Matrix, FLOAT32 Angle);
60 #endif
FLOAT32 MapY(MATRIX_2D *M, FLOAT32 X, FLOAT32 Y)
Definition: xform2d.cpp:66
void CopyMatrix(MATRIX_2D *A, MATRIX_2D *B)
Definition: xform2d.cpp:37
float FLOAT32
Definition: host.h:111
FLOAT32 MapX(MATRIX_2D *M, FLOAT32 X, FLOAT32 Y)
Definition: xform2d.cpp:62
Definition: fpoint.h:29
void RotateMatrix(MATRIX_2D_PTR Matrix, FLOAT32 Angle)
Definition: xform2d.cpp:85
void MapPoint(MATRIX_2D *M, const FPOINT &A, FPOINT *B)
Definition: xform2d.cpp:70
void MirrorMatrixInY(MATRIX_2D *M)
Definition: xform2d.cpp:59
struct MATRIX_2D * MATRIX_2D_PTR
void MirrorMatrixInXY(MATRIX_2D *M)
Definition: xform2d.cpp:60
FLOAT32 MapDx(MATRIX_2D *M, FLOAT32 DX, FLOAT32 DY)
Definition: xform2d.cpp:75
void MirrorMatrixInX(MATRIX_2D *M)
Definition: xform2d.cpp:58
FLOAT32 ty
Definition: xform2d.h:28
void InitMatrix(MATRIX_2D *M)
Definition: xform2d.cpp:28
void TranslateMatrix(MATRIX_2D *M, FLOAT32 X, FLOAT32 Y)
Definition: xform2d.cpp:46
FLOAT32 MapDy(MATRIX_2D M, FLOAT32 DX, FLOAT32 DY)
void ScaleMatrix(MATRIX_2D *M, FLOAT32 X, FLOAT32 Y)
Definition: xform2d.cpp:51