[2/2] gdiplus: GdipTransformMatrixPointsI

Nikolay Sivov bunglehead at gmail.com
Fri Apr 18 16:28:57 CDT 2008


Changelog:
   - implemented GdipTransformMatrixPointsI
---
 dlls/gdiplus/gdiplus.spec |    2 +-
 dlls/gdiplus/matrix.c     |   27 +++++++++++++++++++++++++++
 include/gdiplusflat.h     |    1 +
 3 files changed, 29 insertions(+), 1 deletions(-)

diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec
index f2426b1..65ccf35 100644
--- a/dlls/gdiplus/gdiplus.spec
+++ b/dlls/gdiplus/gdiplus.spec
@@ -604,7 +604,7 @@
 @ stub GdipStringFormatGetGenericTypographic
 @ stub GdipTestControl
 @ stdcall GdipTransformMatrixPoints(ptr ptr long)
-@ stub GdipTransformMatrixPointsI
+@ stdcall GdipTransformMatrixPointsI(ptr ptr long)
 @ stdcall GdipTransformPath(ptr ptr)
 @ stub GdipTransformPoints
 @ stub GdipTransformPointsI
diff --git a/dlls/gdiplus/matrix.c b/dlls/gdiplus/matrix.c
index a40f690..8e45bf1 100644
--- a/dlls/gdiplus/matrix.c
+++ b/dlls/gdiplus/matrix.c
@@ -259,6 +259,33 @@ GpStatus WINGDIPAPI GdipTransformMatrixPoints(GpMatrix *matrix, GpPointF *pts,
     return Ok;
 }
 
+GpStatus WINGDIPAPI GdipTransformMatrixPointsI(GpMatrix *matrix, GpPoint *pts, INT count)
+{
+    GpPointF *ptsF;
+    GpStatus ret;    
+    INT i;
+
+    ptsF = GdipAlloc(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 = roundr(ptsF[i].X);
+            pts[i].Y = roundr(ptsF[i].Y);
+        }
+    GdipFree(ptsF);
+
+    return ret;
+}
+
 GpStatus WINGDIPAPI GdipTranslateMatrix(GpMatrix *matrix, REAL offsetX,
     REAL offsetY, GpMatrixOrder order)
 {
diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h
index 215864a..696065a 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 GdipTransformMatrixPointsI(GpMatrix*,GpPoint*,INT);
 GpStatus WINGDIPAPI GdipVectorTransformMatrixPoints(GpMatrix*,GpPointF*,INT);
 GpStatus WINGDIPAPI GdipTranslateMatrix(GpMatrix*,REAL,REAL,GpMatrixOrder);
 
-- 
1.4.4.4






More information about the wine-patches mailing list