2 * Copyright (C) 2007 Google (Evan Stade)
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
26 #include "gdiplus_private.h"
28 GpStatus WINGDIPAPI GdipCreateMatrix2(REAL m11, REAL m12, REAL m21, REAL m22,
29 REAL dx, REAL dy, GpMatrix **matrix)
32 return InvalidParameter;
34 *matrix = GdipAlloc(sizeof(GpMatrix));
35 if(!*matrix) return OutOfMemory;
38 (*matrix)->matrix[0] = m11;
39 (*matrix)->matrix[1] = m12;
41 (*matrix)->matrix[2] = m21;
42 (*matrix)->matrix[3] = m22;
44 (*matrix)->matrix[4] = dx;
45 (*matrix)->matrix[5] = dy;
50 GpStatus WINGDIPAPI GdipDeleteMatrix(GpMatrix *matrix)
53 return InvalidParameter;
60 GpStatus WINGDIPAPI GdipTransformMatrixPoints(GpMatrix *matrix, GpPointF *pts,
67 return InvalidParameter;
69 for(i = 0; i < count; i++)
74 pts[i].X = x * matrix->matrix[0] + y * matrix->matrix[2] + matrix->matrix[4];
75 pts[i].Y = x * matrix->matrix[1] + y * matrix->matrix[3] + matrix->matrix[5];