ReactOS 0.4.16-dev-88-ga65b6ae
Matrix Class Reference

#include <gdiplusmatrix.h>

Inheritance diagram for Matrix:
Collaboration diagram for Matrix:

Public Member Functions

 Matrix (const RectF &rect, const PointF *dstplg)
 
 Matrix (const Rect &rect, const Point *dstplg)
 
 Matrix ()
 
 Matrix (REAL m11, REAL m12, REAL m21, REAL m22, REAL dx, REAL dy)
 
MatrixClone () const
 
 ~Matrix ()
 
BOOL Equals (const Matrix *matrix) const
 
Status GetElements (REAL *m) const
 
Status GetLastStatus () const
 
Status Invert ()
 
BOOL IsIdentity () const
 
BOOL IsInvertible () const
 
Status Multiply (const Matrix *matrix, MatrixOrder order=MatrixOrderPrepend)
 
REAL OffsetX () const
 
REAL OffsetY () const
 
Status Reset ()
 
Status Rotate (REAL angle, MatrixOrder order=MatrixOrderPrepend)
 
Status RotateAt (REAL angle, const PointF &center, MatrixOrder order=MatrixOrderPrepend)
 
Status Scale (REAL scaleX, REAL scaleY, MatrixOrder order=MatrixOrderPrepend)
 
Status SetElements (REAL m11, REAL m12, REAL m21, REAL m22, REAL dx, REAL dy)
 
Status Shear (REAL shearX, REAL shearY, MatrixOrder order=MatrixOrderPrepend)
 
Status TransformPoints (Point *pts, INT count)
 
Status TransformPoints (PointF *pts, INT count)
 
Status TransformVectors (Point *pts, INT count)
 
Status TransformVectors (PointF *pts, INT count)
 
Status Translate (REAL offsetX, REAL offsetY, MatrixOrder order=MatrixOrderPrepend)
 
- Public Member Functions inherited from GdiplusBase
void operator delete (void *in_pVoid)
 
void operator delete[] (void *in_pVoid)
 
voidoperator new (size_t in_size)
 
voidoperator new[] (size_t in_size)
 

Protected Member Functions

 Matrix (GpMatrix *matrix)
 
Status SetStatus (Status status) const
 

Protected Attributes

GpMatrixnativeMatrix
 
Status lastStatus
 

Friends

class Pen
 
class Region
 
class GraphicsPath
 
class Brush
 
class LinearGradientBrush
 
class TextureBrush
 
GpMatrix *& getNat (const Matrix *matrix)
 

Detailed Description

Definition at line 22 of file gdiplusmatrix.h.

Constructor & Destructor Documentation

◆ Matrix() [1/5]

Matrix::Matrix ( const RectF rect,
const PointF dstplg 
)
inline

Definition at line 32 of file gdiplusmatrix.h.

33 {
34 lastStatus = DllExports::GdipCreateMatrix3(&rect, dstplg, &nativeMatrix);
35 }
Status lastStatus
GpMatrix * nativeMatrix
& rect
Definition: startmenu.cpp:1413

◆ Matrix() [2/5]

Matrix::Matrix ( const Rect rect,
const Point dstplg 
)
inline

Definition at line 37 of file gdiplusmatrix.h.

38 {
39 lastStatus = DllExports::GdipCreateMatrix3I(&rect, dstplg, &nativeMatrix);
40 }

◆ Matrix() [3/5]

Matrix::Matrix ( )
inline

Definition at line 42 of file gdiplusmatrix.h.

43 {
44 lastStatus = DllExports::GdipCreateMatrix(&nativeMatrix);
45 }

Referenced by Clone().

◆ Matrix() [4/5]

Matrix::Matrix ( REAL  m11,
REAL  m12,
REAL  m21,
REAL  m22,
REAL  dx,
REAL  dy 
)
inline

Definition at line 47 of file gdiplusmatrix.h.

48 {
49 lastStatus = DllExports::GdipCreateMatrix2(m11, m12, m21, m22, dx, dy, &nativeMatrix);
50 }
#define m22
#define m11
#define m12
#define m21
GLint dy
Definition: linetemp.h:97
GLint dx
Definition: linetemp.h:97

◆ ~Matrix()

Matrix::~Matrix ( )
inline

Definition at line 68 of file gdiplusmatrix.h.

69 {
70 DllExports::GdipDeleteMatrix(nativeMatrix);
71 }

◆ Matrix() [5/5]

Matrix::Matrix ( GpMatrix matrix)
inlineprotected

Definition at line 220 of file gdiplusmatrix.h.

221 {
222 }
@ Ok
Definition: gdiplustypes.h:26
GLuint GLenum matrix
Definition: glext.h:9407

Member Function Documentation

◆ Clone()

Matrix * Matrix::Clone ( ) const
inline

Definition at line 53 of file gdiplusmatrix.h.

54 {
55 GpMatrix *cloneMatrix = NULL;
56 SetStatus(DllExports::GdipCloneMatrix(nativeMatrix, &cloneMatrix));
57
58 if (lastStatus != Ok)
59 return NULL;
60
61 Matrix *newMatrix = new Matrix(cloneMatrix);
62 if (!newMatrix)
63 DllExports::GdipDeleteMatrix(cloneMatrix);
64
65 return newMatrix;
66 }
Status SetStatus(Status status) const
#define NULL
Definition: types.h:112

◆ Equals()

BOOL Matrix::Equals ( const Matrix matrix) const
inline

Definition at line 74 of file gdiplusmatrix.h.

75 {
77 SetStatus(DllExports::GdipIsMatrixEqual(nativeMatrix, matrix ? getNat(matrix) : NULL, &result));
78 return result;
79 }
friend GpMatrix *& getNat(const Matrix *matrix)
unsigned int BOOL
Definition: ntddk_ex.h:94
GLuint64EXT * result
Definition: glext.h:11304

◆ GetElements()

Status Matrix::GetElements ( REAL m) const
inline

Definition at line 82 of file gdiplusmatrix.h.

83 {
84 return SetStatus(DllExports::GdipGetMatrixElements(nativeMatrix, m));
85 }
const GLfloat * m
Definition: glext.h:10848

Referenced by OffsetX(), and OffsetY().

◆ GetLastStatus()

Status Matrix::GetLastStatus ( ) const
inline

Definition at line 88 of file gdiplusmatrix.h.

89 {
90 return lastStatus;
91 }

◆ Invert()

Status Matrix::Invert ( )
inline

Definition at line 94 of file gdiplusmatrix.h.

95 {
96 return SetStatus(DllExports::GdipInvertMatrix(nativeMatrix));
97 }

◆ IsIdentity()

BOOL Matrix::IsIdentity ( ) const
inline

Definition at line 100 of file gdiplusmatrix.h.

101 {
102 BOOL result;
103 SetStatus(DllExports::GdipIsMatrixIdentity(nativeMatrix, &result));
104 return result;
105 }

◆ IsInvertible()

BOOL Matrix::IsInvertible ( ) const
inline

Definition at line 108 of file gdiplusmatrix.h.

109 {
110 BOOL result;
111 SetStatus(DllExports::GdipIsMatrixInvertible(nativeMatrix, &result));
112 return result;
113 }

◆ Multiply()

Status Matrix::Multiply ( const Matrix matrix,
MatrixOrder  order = MatrixOrderPrepend 
)
inline

Definition at line 116 of file gdiplusmatrix.h.

117 {
118 return SetStatus(DllExports::GdipMultiplyMatrix(nativeMatrix, matrix ? getNat(matrix) : NULL, order));
119 }
GLuint GLdouble GLdouble GLint GLint order
Definition: glext.h:11194

◆ OffsetX()

REAL Matrix::OffsetX ( ) const
inline

Definition at line 122 of file gdiplusmatrix.h.

123 {
124 REAL elements[6];
125 if (GetElements(elements) == Ok)
126 return elements[4];
127 return 0.0f;
128 }
Status GetElements(REAL *m) const
Definition: gdiplusmatrix.h:82
float REAL
Definition: types.h:41

◆ OffsetY()

REAL Matrix::OffsetY ( ) const
inline

Definition at line 131 of file gdiplusmatrix.h.

132 {
133 REAL elements[6];
134 if (GetElements(elements) == Ok)
135 return elements[5];
136 return 0.0f;
137 }

◆ Reset()

Status Matrix::Reset ( )
inline

Definition at line 140 of file gdiplusmatrix.h.

141 {
142 return SetStatus(DllExports::GdipSetMatrixElements(nativeMatrix, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0));
143 }

◆ Rotate()

Status Matrix::Rotate ( REAL  angle,
MatrixOrder  order = MatrixOrderPrepend 
)
inline

Definition at line 146 of file gdiplusmatrix.h.

147 {
148 return SetStatus(DllExports::GdipRotateMatrix(nativeMatrix, angle, order));
149 }
GLfloat angle
Definition: glext.h:10853

◆ RotateAt()

Status Matrix::RotateAt ( REAL  angle,
const PointF center,
MatrixOrder  order = MatrixOrderPrepend 
)
inline

Definition at line 152 of file gdiplusmatrix.h.

153 {
155 {
156 SetStatus(DllExports::GdipTranslateMatrix(nativeMatrix, center.X, center.Y, order));
157 SetStatus(DllExports::GdipRotateMatrix(nativeMatrix, angle, order));
158 return SetStatus(DllExports::GdipTranslateMatrix(nativeMatrix, -center.X, -center.Y, order));
159 }
160 else
161 {
162 SetStatus(DllExports::GdipTranslateMatrix(nativeMatrix, -center.X, -center.Y, order));
163 SetStatus(DllExports::GdipRotateMatrix(nativeMatrix, angle, order));
164 return SetStatus(DllExports::GdipTranslateMatrix(nativeMatrix, center.X, center.Y, order));
165 }
166 }
@ MatrixOrderPrepend
Definition: gdiplusenums.h:188
REAL Y
Definition: gdiplustypes.h:649
REAL X
Definition: gdiplustypes.h:648

◆ Scale()

Status Matrix::Scale ( REAL  scaleX,
REAL  scaleY,
MatrixOrder  order = MatrixOrderPrepend 
)
inline

Definition at line 169 of file gdiplusmatrix.h.

170 {
171 return SetStatus(DllExports::GdipScaleMatrix(nativeMatrix, scaleX, scaleY, order));
172 }

◆ SetElements()

Status Matrix::SetElements ( REAL  m11,
REAL  m12,
REAL  m21,
REAL  m22,
REAL  dx,
REAL  dy 
)
inline

Definition at line 175 of file gdiplusmatrix.h.

176 {
177 return SetStatus(DllExports::GdipSetMatrixElements(nativeMatrix, m11, m12, m21, m22, dx, dy));
178 }

◆ SetStatus()

Status Matrix::SetStatus ( Status  status) const
inlineprotected

◆ Shear()

Status Matrix::Shear ( REAL  shearX,
REAL  shearY,
MatrixOrder  order = MatrixOrderPrepend 
)
inline

Definition at line 181 of file gdiplusmatrix.h.

182 {
183 return SetStatus(DllExports::GdipShearMatrix(nativeMatrix, shearX, shearY, order));
184 }

◆ TransformPoints() [1/2]

Status Matrix::TransformPoints ( Point pts,
INT  count 
)
inline

Definition at line 187 of file gdiplusmatrix.h.

188 {
189 return SetStatus(DllExports::GdipTransformMatrixPointsI(nativeMatrix, pts, count));
190 }
GLuint GLuint GLsizei count
Definition: gl.h:1545

◆ TransformPoints() [2/2]

Status Matrix::TransformPoints ( PointF pts,
INT  count 
)
inline

Definition at line 193 of file gdiplusmatrix.h.

194 {
195 return SetStatus(DllExports::GdipTransformMatrixPoints(nativeMatrix, pts, count));
196 }

◆ TransformVectors() [1/2]

Status Matrix::TransformVectors ( Point pts,
INT  count 
)
inline

Definition at line 199 of file gdiplusmatrix.h.

200 {
201 return SetStatus(DllExports::GdipVectorTransformMatrixPointsI(nativeMatrix, pts, count));
202 }

◆ TransformVectors() [2/2]

Status Matrix::TransformVectors ( PointF pts,
INT  count 
)
inline

Definition at line 205 of file gdiplusmatrix.h.

206 {
207 return SetStatus(DllExports::GdipVectorTransformMatrixPoints(nativeMatrix, pts, count));
208 }

◆ Translate()

Status Matrix::Translate ( REAL  offsetX,
REAL  offsetY,
MatrixOrder  order = MatrixOrderPrepend 
)
inline

Definition at line 211 of file gdiplusmatrix.h.

212 {
213 return SetStatus(DllExports::GdipTranslateMatrix(nativeMatrix, offsetX, offsetY, order));
214 }

Friends And Related Function Documentation

◆ Brush

friend class Brush
friend

Definition at line 27 of file gdiplusmatrix.h.

◆ getNat

GpMatrix *& getNat ( const Matrix matrix)
friend

Definition at line 234 of file gdiplusmatrix.h.

235 {
236 return const_cast<Matrix *>(matrix)->nativeMatrix;
237 }

Referenced by Equals(), and Multiply().

◆ GraphicsPath

friend class GraphicsPath
friend

Definition at line 26 of file gdiplusmatrix.h.

◆ LinearGradientBrush

friend class LinearGradientBrush
friend

Definition at line 28 of file gdiplusmatrix.h.

◆ Pen

friend class Pen
friend

Definition at line 24 of file gdiplusmatrix.h.

◆ Region

friend class Region
friend

Definition at line 25 of file gdiplusmatrix.h.

◆ TextureBrush

friend class TextureBrush
friend

Definition at line 29 of file gdiplusmatrix.h.

Member Data Documentation

◆ lastStatus

Status Matrix::lastStatus
mutableprotected

Definition at line 218 of file gdiplusmatrix.h.

Referenced by Clone(), GetLastStatus(), Matrix(), and SetStatus().

◆ nativeMatrix


The documentation for this class was generated from the following file: