reactos/dll/win32/gdiplus/matrix.c

528 lines
13 KiB
C
Raw Normal View History

/*
* Copyright (C) 2007 Google (Evan Stade)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdarg.h>
#include <math.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "objbase.h"
#include "gdiplus.h"
#include "gdiplus_private.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(gdiplus);
/* Multiplies two matrices of the form
*
* idx:0 idx:1 0
* idx:2 idx:3 0
* idx:4 idx:5 1
*
* and puts the output in out.
* */
static void matrix_multiply(GDIPCONST REAL * left, GDIPCONST REAL * right, REAL * out)
{
REAL temp[6];
int i, odd;
for(i = 0; i < 6; i++){
odd = i % 2;
temp[i] = left[i - odd] * right[odd] + left[i - odd + 1] * right[odd + 2] +
(i >= 4 ? right[odd + 4] : 0.0);
}
memcpy(out, temp, 6 * sizeof(REAL));
}
static REAL matrix_det(GDIPCONST GpMatrix *matrix)
{
return matrix->matrix[0]*matrix->matrix[3] - matrix->matrix[1]*matrix->matrix[2];
}
GpStatus WINGDIPAPI GdipCreateMatrix2(REAL m11, REAL m12, REAL m21, REAL m22,
REAL dx, REAL dy, GpMatrix **matrix)
{
TRACE("(%.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %p)\n", m11, m12, m21, m22, dx, dy, matrix);
if(!matrix)
return InvalidParameter;
*matrix = heap_alloc_zero(sizeof(GpMatrix));
if(!*matrix) return OutOfMemory;
/* first row */
(*matrix)->matrix[0] = m11;
(*matrix)->matrix[1] = m12;
/* second row */
(*matrix)->matrix[2] = m21;
(*matrix)->matrix[3] = m22;
/* third row */
(*matrix)->matrix[4] = dx;
(*matrix)->matrix[5] = dy;
return Ok;
}
GpStatus WINGDIPAPI GdipCreateMatrix3(GDIPCONST GpRectF *rect,
GDIPCONST GpPointF *pt, GpMatrix **matrix)
{
REAL m11, m12, m21, m22, dx, dy;
TRACE("(%p, %p, %p)\n", rect, pt, matrix);
if(!matrix || !pt)
return InvalidParameter;
m11 = (pt[1].X - pt[0].X) / rect->Width;
m21 = (pt[2].X - pt[0].X) / rect->Height;
dx = pt[0].X - m11 * rect->X - m21 * rect->Y;
m12 = (pt[1].Y - pt[0].Y) / rect->Width;
m22 = (pt[2].Y - pt[0].Y) / rect->Height;
dy = pt[0].Y - m12 * rect->X - m22 * rect->Y;
return GdipCreateMatrix2(m11, m12, m21, m22, dx, dy, matrix);
}
GpStatus WINGDIPAPI GdipCreateMatrix3I(GDIPCONST GpRect *rect, GDIPCONST GpPoint *pt,
GpMatrix **matrix)
{
GpRectF rectF;
GpPointF ptF[3];
int i;
TRACE("(%p, %p, %p)\n", rect, pt, matrix);
rectF.X = (REAL)rect->X;
rectF.Y = (REAL)rect->Y;
rectF.Width = (REAL)rect->Width;
rectF.Height = (REAL)rect->Height;
for (i = 0; i < 3; i++) {
ptF[i].X = (REAL)pt[i].X;
ptF[i].Y = (REAL)pt[i].Y;
}
return GdipCreateMatrix3(&rectF, ptF, matrix);
}
GpStatus WINGDIPAPI GdipCloneMatrix(GpMatrix *matrix, GpMatrix **clone)
{
TRACE("(%p, %p)\n", matrix, clone);
if(!matrix || !clone)
return InvalidParameter;
*clone = heap_alloc_zero(sizeof(GpMatrix));
if(!*clone) return OutOfMemory;
**clone = *matrix;
return Ok;
}
GpStatus WINGDIPAPI GdipCreateMatrix(GpMatrix **matrix)
{
TRACE("(%p)\n", matrix);
if(!matrix)
return InvalidParameter;
*matrix = heap_alloc_zero(sizeof(GpMatrix));
if(!*matrix) return OutOfMemory;
(*matrix)->matrix[0] = 1.0;
(*matrix)->matrix[1] = 0.0;
(*matrix)->matrix[2] = 0.0;
(*matrix)->matrix[3] = 1.0;
(*matrix)->matrix[4] = 0.0;
(*matrix)->matrix[5] = 0.0;
return Ok;
}
GpStatus WINGDIPAPI GdipDeleteMatrix(GpMatrix *matrix)
{
TRACE("(%p)\n", matrix);
if(!matrix)
return InvalidParameter;
heap_free(matrix);
return Ok;
}
GpStatus WINGDIPAPI GdipGetMatrixElements(GDIPCONST GpMatrix *matrix,
REAL *out)
{
TRACE("(%p, %p)\n", matrix, out);
if(!matrix || !out)
return InvalidParameter;
memcpy(out, matrix->matrix, sizeof(matrix->matrix));
return Ok;
}
GpStatus WINGDIPAPI GdipInvertMatrix(GpMatrix *matrix)
{
GpMatrix copy;
REAL det;
BOOL invertible;
TRACE("(%p)\n", matrix);
if(!matrix)
return InvalidParameter;
GdipIsMatrixInvertible(matrix, &invertible);
if(!invertible)
return InvalidParameter;
[GDIPLUS] Sync with Wine Staging 2.16. CORE-13762 6bf1b63 gdiplus: Account for gdi32 transform in SOFTWARE_GdipDrawThinPath. e127101 gdiplus: Send paths to gdi32 in device coordinates. 93e8507 gdiplus: Account for gdi32 transform in GdipDrawImage. be95252 gdiplus: Use SOFTWARE_GdipDrawPath with alpha hdc's. 0914f62 gdiplus: Account for gdi transform in brush_fill_pixels. 399fd55 gdiplus: Account for gdi transform in SOFTWARE_GdipFillRegion. 016dc76 gdiplus: Transform clipping region to gdi device coordinates. cfa4f08 gdiplus: Replace DPtoLP with an internal coordinate space constant. 5c12ced gdiplus: Check for invalid coordinate space in GdipTransformPoints. 8c593bd gdiplus: Set correct color space flags for grayscale images. 7860d11 gdiplus: Don't call PlayEnhMetaFileRecord for records handled by gdiplus. 5870431 gdiplus: Force conversion of 8 bpp grayscale PNG images to 32 bpp BGRA. 42e5d27 gdiplus: Use defined constants for wrap modes. 79ebd3f gdiplus: Fix copy-paste typo. a4ab858 gdiplus: GdipCreateMetafileFromWmfFile will also load EMFs. aac33da gdiplus: Implement transform matrix for line gradient brushes. 14bb8df gdiplus: Support GdipSetClipRegion in metafiles. 4a02870 gdiplus: Add write_region_data helper and use it in GdipGetRegionData. 595959c gdiplus: Add more accurate algorithm for inverting scaling and translation matrices in GdipInvertMatrix. 1744277 gdiplus: Implement stub for GdipGraphicsSetAbort. 331a7af gdiplus: Fix a possible floating point exception in path gradients. 400cfb0 gdiplus: Avoid division by zero in SOFTWARE_GdipDrawThinPath. 2176348 gdiplus: Return success saving path to metafile. 70afb4e gdiplus: Fix saving pen dashed line cap style to metafile. a172cc6 gdiplus: Free dash_pattern_scaled (Coverity). 58eb74c gdiplus: Use write_path_data helper in GdipGetRegionData. a892b68 gdiplus: Add write_path_data helper to create EMF+ path object. 5545332 gdiplus: Store newer gdi+ version in created GdipRegions. cfe2b3f gdiplus: Don't require specific gdi+ versions in metafile structures. a8b5fdd gdiplus: Use VERSION_MAGIC2 constant in metafiles functions. 8498aa3 gdiplus: Add support for creating image object containing metafile. 9f22041 gdiplus: Fix leak in widen_dashed_figure. f9b881e gdiplus: Fix GdipGetVisibleClipBounds behavior on metafiles. de37ced gdiplus: Add partial support for GdipFillPath on metafiles. e79c4ca gdiplus: Add partial support for GdipDrawPath on metafiles. 7d6896e gdiplus: Add helper for saving pens to metafile. e502a8d gdiplus: Add helper for saving path objects in metafile. 8608bf5 gdiplus: Add DrawPath stub for metafiles. 29968cf gdiplus: Support GdipSetInterpolationMode in metafiles. f248374 gdiplus: Support GdipSetCompositingQuality in metafiles. 1cecd47 gdiplus: Support GdipSetCompositingMode in metafiles. 910975a gdiplus: Support GdipSetSmoothingMode in metafiles. f716029 gdiplus: Support GdipSetPixelOffsetMode in metafiles. 683315d gdiplus: Support GdipSetTextRenderingHint in metafiles. 689268d gdiplus: Add support for ImageAttributes when drawing image to metafile. ac231b1 gdiplus: Add function for managing metafile objects id. e1e4dd2 gdiplus: Add partial support for GdipDrawImagePointsRect on metafile. 1a75f76 gdiplus: Remove unused clsid parameter from encode_image_func helpers. 01c9fb9 gdiplus: Remove a duplicate word in a comment. 6ec3cd9 gdiplus: Set flatness more appropriately in GdipDrawPath. 7e1522c gdiplus: Scale widened dashes to the pen width. c95877d gdiplus: Write API documentation for GdipAddPathArc and GdipAddPathArcI. f1123f3 gdiplus: Write API for GdipClonePath. f96e319 gdiplus: Write API for GdipAddPathLine and GdipAddPathLineI. 260cbd0 gdiplus: Implement triangular line caps in widened paths. a4b7fe6 gdiplus: Initialize containers list in GdipCloneImage. svn path=/trunk/; revision=75872
2017-09-17 12:34:15 +00:00
/* optimize inverting simple scaling and translation matrices */
if(matrix->matrix[1] == 0 && matrix->matrix[2] == 0)
{
matrix->matrix[4] = -matrix->matrix[4] / matrix->matrix[0];
matrix->matrix[5] = -matrix->matrix[5] / matrix->matrix[3];
matrix->matrix[0] = 1 / matrix->matrix[0];
matrix->matrix[3] = 1 / matrix->matrix[3];
return Ok;
}
det = matrix_det(matrix);
copy = *matrix;
/* store result */
matrix->matrix[0] = copy.matrix[3] / det;
matrix->matrix[1] = -copy.matrix[1] / det;
matrix->matrix[2] = -copy.matrix[2] / det;
matrix->matrix[3] = copy.matrix[0] / det;
matrix->matrix[4] = (copy.matrix[2]*copy.matrix[5]-copy.matrix[3]*copy.matrix[4]) / det;
matrix->matrix[5] = -(copy.matrix[0]*copy.matrix[5]-copy.matrix[1]*copy.matrix[4]) / det;
return Ok;
}
GpStatus WINGDIPAPI GdipIsMatrixInvertible(GDIPCONST GpMatrix *matrix, BOOL *result)
{
TRACE("(%p, %p)\n", matrix, result);
if(!matrix || !result)
return InvalidParameter;
[GDIPLUS] Sync with Wine Staging 2.16. CORE-13762 6bf1b63 gdiplus: Account for gdi32 transform in SOFTWARE_GdipDrawThinPath. e127101 gdiplus: Send paths to gdi32 in device coordinates. 93e8507 gdiplus: Account for gdi32 transform in GdipDrawImage. be95252 gdiplus: Use SOFTWARE_GdipDrawPath with alpha hdc's. 0914f62 gdiplus: Account for gdi transform in brush_fill_pixels. 399fd55 gdiplus: Account for gdi transform in SOFTWARE_GdipFillRegion. 016dc76 gdiplus: Transform clipping region to gdi device coordinates. cfa4f08 gdiplus: Replace DPtoLP with an internal coordinate space constant. 5c12ced gdiplus: Check for invalid coordinate space in GdipTransformPoints. 8c593bd gdiplus: Set correct color space flags for grayscale images. 7860d11 gdiplus: Don't call PlayEnhMetaFileRecord for records handled by gdiplus. 5870431 gdiplus: Force conversion of 8 bpp grayscale PNG images to 32 bpp BGRA. 42e5d27 gdiplus: Use defined constants for wrap modes. 79ebd3f gdiplus: Fix copy-paste typo. a4ab858 gdiplus: GdipCreateMetafileFromWmfFile will also load EMFs. aac33da gdiplus: Implement transform matrix for line gradient brushes. 14bb8df gdiplus: Support GdipSetClipRegion in metafiles. 4a02870 gdiplus: Add write_region_data helper and use it in GdipGetRegionData. 595959c gdiplus: Add more accurate algorithm for inverting scaling and translation matrices in GdipInvertMatrix. 1744277 gdiplus: Implement stub for GdipGraphicsSetAbort. 331a7af gdiplus: Fix a possible floating point exception in path gradients. 400cfb0 gdiplus: Avoid division by zero in SOFTWARE_GdipDrawThinPath. 2176348 gdiplus: Return success saving path to metafile. 70afb4e gdiplus: Fix saving pen dashed line cap style to metafile. a172cc6 gdiplus: Free dash_pattern_scaled (Coverity). 58eb74c gdiplus: Use write_path_data helper in GdipGetRegionData. a892b68 gdiplus: Add write_path_data helper to create EMF+ path object. 5545332 gdiplus: Store newer gdi+ version in created GdipRegions. cfe2b3f gdiplus: Don't require specific gdi+ versions in metafile structures. a8b5fdd gdiplus: Use VERSION_MAGIC2 constant in metafiles functions. 8498aa3 gdiplus: Add support for creating image object containing metafile. 9f22041 gdiplus: Fix leak in widen_dashed_figure. f9b881e gdiplus: Fix GdipGetVisibleClipBounds behavior on metafiles. de37ced gdiplus: Add partial support for GdipFillPath on metafiles. e79c4ca gdiplus: Add partial support for GdipDrawPath on metafiles. 7d6896e gdiplus: Add helper for saving pens to metafile. e502a8d gdiplus: Add helper for saving path objects in metafile. 8608bf5 gdiplus: Add DrawPath stub for metafiles. 29968cf gdiplus: Support GdipSetInterpolationMode in metafiles. f248374 gdiplus: Support GdipSetCompositingQuality in metafiles. 1cecd47 gdiplus: Support GdipSetCompositingMode in metafiles. 910975a gdiplus: Support GdipSetSmoothingMode in metafiles. f716029 gdiplus: Support GdipSetPixelOffsetMode in metafiles. 683315d gdiplus: Support GdipSetTextRenderingHint in metafiles. 689268d gdiplus: Add support for ImageAttributes when drawing image to metafile. ac231b1 gdiplus: Add function for managing metafile objects id. e1e4dd2 gdiplus: Add partial support for GdipDrawImagePointsRect on metafile. 1a75f76 gdiplus: Remove unused clsid parameter from encode_image_func helpers. 01c9fb9 gdiplus: Remove a duplicate word in a comment. 6ec3cd9 gdiplus: Set flatness more appropriately in GdipDrawPath. 7e1522c gdiplus: Scale widened dashes to the pen width. c95877d gdiplus: Write API documentation for GdipAddPathArc and GdipAddPathArcI. f1123f3 gdiplus: Write API for GdipClonePath. f96e319 gdiplus: Write API for GdipAddPathLine and GdipAddPathLineI. 260cbd0 gdiplus: Implement triangular line caps in widened paths. a4b7fe6 gdiplus: Initialize containers list in GdipCloneImage. svn path=/trunk/; revision=75872
2017-09-17 12:34:15 +00:00
if(matrix->matrix[1] == 0 && matrix->matrix[2] == 0)
*result = matrix->matrix[0] != 0 && matrix->matrix[3] != 0;
else
*result = (fabs(matrix_det(matrix)) >= 1e-5);
return Ok;
}
GpStatus WINGDIPAPI GdipMultiplyMatrix(GpMatrix *matrix, GDIPCONST GpMatrix* matrix2,
GpMatrixOrder order)
{
TRACE("(%p, %p, %d)\n", matrix, matrix2, order);
if(!matrix || !matrix2)
return InvalidParameter;
if(order == MatrixOrderAppend)
matrix_multiply(matrix->matrix, matrix2->matrix, matrix->matrix);
else if (order == MatrixOrderPrepend)
matrix_multiply(matrix2->matrix, matrix->matrix, matrix->matrix);
else
return InvalidParameter;
return Ok;
}
GpStatus WINGDIPAPI GdipRotateMatrix(GpMatrix *matrix, REAL angle,
GpMatrixOrder order)
{
REAL cos_theta, sin_theta, rotate[6];
TRACE("(%p, %.2f, %d)\n", matrix, angle, order);
if(!matrix)
return InvalidParameter;
angle = deg2rad(angle);
cos_theta = cos(angle);
sin_theta = sin(angle);
rotate[0] = cos_theta;
rotate[1] = sin_theta;
rotate[2] = -sin_theta;
rotate[3] = cos_theta;
rotate[4] = 0.0;
rotate[5] = 0.0;
if(order == MatrixOrderAppend)
matrix_multiply(matrix->matrix, rotate, matrix->matrix);
else if (order == MatrixOrderPrepend)
matrix_multiply(rotate, matrix->matrix, matrix->matrix);
else
return InvalidParameter;
return Ok;
}
GpStatus WINGDIPAPI GdipScaleMatrix(GpMatrix *matrix, REAL scaleX, REAL scaleY,
GpMatrixOrder order)
{
REAL scale[6];
TRACE("(%p, %.2f, %.2f, %d)\n", matrix, scaleX, scaleY, order);
if(!matrix)
return InvalidParameter;
scale[0] = scaleX;
scale[1] = 0.0;
scale[2] = 0.0;
scale[3] = scaleY;
scale[4] = 0.0;
scale[5] = 0.0;
if(order == MatrixOrderAppend)
matrix_multiply(matrix->matrix, scale, matrix->matrix);
else if (order == MatrixOrderPrepend)
matrix_multiply(scale, matrix->matrix, matrix->matrix);
else
return InvalidParameter;
return Ok;
}
GpStatus WINGDIPAPI GdipSetMatrixElements(GpMatrix *matrix, REAL m11, REAL m12,
REAL m21, REAL m22, REAL dx, REAL dy)
{
TRACE("(%p, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f)\n", matrix, m11, m12,
m21, m22, dx, dy);
if(!matrix)
return InvalidParameter;
matrix->matrix[0] = m11;
matrix->matrix[1] = m12;
matrix->matrix[2] = m21;
matrix->matrix[3] = m22;
matrix->matrix[4] = dx;
matrix->matrix[5] = dy;
return Ok;
}
GpStatus WINGDIPAPI GdipShearMatrix(GpMatrix *matrix, REAL shearX, REAL shearY,
GpMatrixOrder order)
{
REAL shear[6];
TRACE("(%p, %.2f, %.2f, %d)\n", matrix, shearX, shearY, order);
if(!matrix)
return InvalidParameter;
/* prepare transformation matrix */
shear[0] = 1.0;
shear[1] = shearY;
shear[2] = shearX;
shear[3] = 1.0;
shear[4] = 0.0;
shear[5] = 0.0;
if(order == MatrixOrderAppend)
matrix_multiply(matrix->matrix, shear, matrix->matrix);
else if (order == MatrixOrderPrepend)
matrix_multiply(shear, matrix->matrix, matrix->matrix);
else
return InvalidParameter;
return Ok;
}
GpStatus WINGDIPAPI GdipTransformMatrixPoints(GpMatrix *matrix, GpPointF *pts,
INT count)
{
REAL x, y;
INT i;
TRACE("(%p, %p, %d)\n", matrix, pts, count);
if(!matrix || !pts || count <= 0)
return InvalidParameter;
for(i = 0; i < count; i++)
{
x = pts[i].X;
y = pts[i].Y;
pts[i].X = x * matrix->matrix[0] + y * matrix->matrix[2] + matrix->matrix[4];
pts[i].Y = x * matrix->matrix[1] + y * matrix->matrix[3] + matrix->matrix[5];
}
return Ok;
}
GpStatus WINGDIPAPI GdipTransformMatrixPointsI(GpMatrix *matrix, GpPoint *pts, INT count)
{
GpPointF *ptsF;
GpStatus ret;
INT i;
TRACE("(%p, %p, %d)\n", matrix, pts, count);
if(count <= 0)
return InvalidParameter;
ptsF = heap_alloc_zero(sizeof(GpPointF) * count);
if(!ptsF)
return OutOfMemory;
for(i = 0; i < count; i++){
ptsF[i].X = (REAL)pts[i].X;
ptsF[i].Y = (REAL)pts[i].Y;
}
ret = GdipTransformMatrixPoints(matrix, ptsF, count);
if(ret == Ok)
for(i = 0; i < count; i++){
pts[i].X = gdip_round(ptsF[i].X);
pts[i].Y = gdip_round(ptsF[i].Y);
}
heap_free(ptsF);
return ret;
}
GpStatus WINGDIPAPI GdipTranslateMatrix(GpMatrix *matrix, REAL offsetX,
REAL offsetY, GpMatrixOrder order)
{
REAL translate[6];
TRACE("(%p, %.2f, %.2f, %d)\n", matrix, offsetX, offsetY, order);
if(!matrix)
return InvalidParameter;
translate[0] = 1.0;
translate[1] = 0.0;
translate[2] = 0.0;
translate[3] = 1.0;
translate[4] = offsetX;
translate[5] = offsetY;
if(order == MatrixOrderAppend)
matrix_multiply(matrix->matrix, translate, matrix->matrix);
else if (order == MatrixOrderPrepend)
matrix_multiply(translate, matrix->matrix, matrix->matrix);
else
return InvalidParameter;
return Ok;
}
GpStatus WINGDIPAPI GdipVectorTransformMatrixPoints(GpMatrix *matrix, GpPointF *pts, INT count)
{
REAL x, y;
INT i;
TRACE("(%p, %p, %d)\n", matrix, pts, count);
if(!matrix || !pts || count <= 0)
return InvalidParameter;
for(i = 0; i < count; i++)
{
x = pts[i].X;
y = pts[i].Y;
pts[i].X = x * matrix->matrix[0] + y * matrix->matrix[2];
pts[i].Y = x * matrix->matrix[1] + y * matrix->matrix[3];
}
return Ok;
}
GpStatus WINGDIPAPI GdipVectorTransformMatrixPointsI(GpMatrix *matrix, GpPoint *pts, INT count)
{
GpPointF *ptsF;
GpStatus ret;
INT i;
TRACE("(%p, %p, %d)\n", matrix, pts, count);
if(count <= 0)
return InvalidParameter;
ptsF = heap_alloc_zero(sizeof(GpPointF) * count);
if(!ptsF)
return OutOfMemory;
for(i = 0; i < count; i++){
ptsF[i].X = (REAL)pts[i].X;
ptsF[i].Y = (REAL)pts[i].Y;
}
ret = GdipVectorTransformMatrixPoints(matrix, ptsF, count);
/* store back */
if(ret == Ok)
for(i = 0; i < count; i++){
pts[i].X = gdip_round(ptsF[i].X);
pts[i].Y = gdip_round(ptsF[i].Y);
}
heap_free(ptsF);
return ret;
}
GpStatus WINGDIPAPI GdipIsMatrixEqual(GDIPCONST GpMatrix *matrix, GDIPCONST GpMatrix *matrix2,
BOOL *result)
{
TRACE("(%p, %p, %p)\n", matrix, matrix2, result);
if(!matrix || !matrix2 || !result)
return InvalidParameter;
/* based on single array member of GpMatrix */
*result = (memcmp(matrix->matrix, matrix2->matrix, sizeof(GpMatrix)) == 0);
return Ok;
}
GpStatus WINGDIPAPI GdipIsMatrixIdentity(GDIPCONST GpMatrix *matrix, BOOL *result)
{
static const GpMatrix identity =
{
{ 1.0, 0.0,
0.0, 1.0,
0.0, 0.0 }
};
TRACE("(%p, %p)\n", matrix, result);
if(!matrix || !result)
return InvalidParameter;
return GdipIsMatrixEqual(matrix, &identity, result);
}