From 256874426dc6ec5260e3e729cb65d69f0b32f572 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Fri, 18 Apr 2008 04:39:03 +0400 Subject: [PATCH] gdiplus: Implemented GdipVectorTransformMatrixPoints. --- dlls/gdiplus/gdiplus.spec | 2 +- dlls/gdiplus/matrix.c | 20 ++++++++++++++++++++ include/gdiplusflat.h | 1 + 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index da338244d5..f2426b1912 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -619,7 +619,7 @@ @ stub GdipTranslateRegionI @ stub GdipTranslateTextureTransform @ stdcall GdipTranslateWorldTransform(ptr long long long) -@ stub GdipVectorTransformMatrixPoints +@ stdcall GdipVectorTransformMatrixPoints(ptr ptr long) @ stub GdipVectorTransformMatrixPointsI @ stub GdipWarpPath @ stub GdipWidenPath diff --git a/dlls/gdiplus/matrix.c b/dlls/gdiplus/matrix.c index dee6460f0f..a40f690e84 100644 --- a/dlls/gdiplus/matrix.c +++ b/dlls/gdiplus/matrix.c @@ -281,3 +281,23 @@ GpStatus WINGDIPAPI GdipTranslateMatrix(GpMatrix *matrix, REAL offsetX, return Ok; } + +GpStatus WINGDIPAPI GdipVectorTransformMatrixPoints(GpMatrix *matrix, GpPointF *pts, INT count) +{ + REAL x, y; + INT i; + + if(!matrix || !pts) + 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; +} diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index c181b21ec8..215864a3af 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -229,6 +229,7 @@ GpStatus WINGDIPAPI GdipRotateMatrix(GpMatrix*,REAL,GpMatrixOrder); GpStatus WINGDIPAPI GdipScaleMatrix(GpMatrix*,REAL,REAL,GpMatrixOrder); GpStatus WINGDIPAPI GdipSetMatrixElements(GpMatrix*,REAL,REAL,REAL,REAL,REAL,REAL); GpStatus WINGDIPAPI GdipTransformMatrixPoints(GpMatrix*,GpPointF*,INT); +GpStatus WINGDIPAPI GdipVectorTransformMatrixPoints(GpMatrix*,GpPointF*,INT); GpStatus WINGDIPAPI GdipTranslateMatrix(GpMatrix*,REAL,REAL,GpMatrixOrder); GpStatus WINGDIPAPI GdipCreatePathIter(GpPathIterator**,GpPath*);