Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
d4554ad5
Commit
d4554ad5
authored
Jul 08, 2008
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jul 08, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: GdipIsMatrixInvertible implementation with tests.
parent
9fbec615
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
1 deletion
+46
-1
gdiplus.spec
dlls/gdiplus/gdiplus.spec
+1
-1
matrix.c
dlls/gdiplus/matrix.c
+14
-0
matrix.c
dlls/gdiplus/tests/matrix.c
+30
-0
gdiplusflat.h
include/gdiplusflat.h
+1
-0
No files found.
dlls/gdiplus/gdiplus.spec
View file @
d4554ad5
...
...
@@ -420,7 +420,7 @@
@ stdcall GdipIsInfiniteRegion(ptr ptr ptr)
@ stdcall GdipIsMatrixEqual(ptr ptr ptr)
@ stdcall GdipIsMatrixIdentity(ptr ptr)
@ st
ub GdipIsMatrixInvertible
@ st
dcall GdipIsMatrixInvertible(ptr ptr)
@ stub GdipIsOutlineVisiblePathPoint
@ stdcall GdipIsOutlineVisiblePathPointI(ptr long long ptr ptr ptr)
@ stub GdipIsStyleAvailable
...
...
dlls/gdiplus/matrix.c
View file @
d4554ad5
...
...
@@ -158,6 +158,20 @@ GpStatus WINGDIPAPI GdipGetMatrixElements(GDIPCONST GpMatrix *matrix,
return
Ok
;
}
GpStatus
WINGDIPAPI
GdipIsMatrixInvertible
(
GDIPCONST
GpMatrix
*
matrix
,
BOOL
*
result
)
{
REAL
det
;
if
(
!
matrix
||
!
result
)
return
InvalidParameter
;
det
=
matrix
->
matrix
[
0
]
*
matrix
->
matrix
[
3
]
-
matrix
->
matrix
[
1
]
*
matrix
->
matrix
[
2
];
*
result
=
(
fabs
(
det
)
>=
1e-5
);
return
Ok
;
}
GpStatus
WINGDIPAPI
GdipMultiplyMatrix
(
GpMatrix
*
matrix
,
GpMatrix
*
matrix2
,
GpMatrixOrder
order
)
{
...
...
dlls/gdiplus/tests/matrix.c
View file @
d4554ad5
...
...
@@ -89,6 +89,35 @@ static void test_transform(void)
GdipDeleteMatrix
(
matrix
);
}
static
void
test_isinvertible
(
void
)
{
GpStatus
status
;
GpMatrix
*
matrix
=
NULL
;
BOOL
result
;
/* NULL arguments */
status
=
GdipIsMatrixInvertible
(
NULL
,
&
result
);
expect
(
InvalidParameter
,
status
);
status
=
GdipIsMatrixInvertible
((
GpMatrix
*
)
0xdeadbeef
,
NULL
);
expect
(
InvalidParameter
,
status
);
status
=
GdipIsMatrixInvertible
(
NULL
,
NULL
);
expect
(
InvalidParameter
,
status
);
/* invertible */
GdipCreateMatrix2
(
1
.
0
,
1
.
2
,
2
.
3
,
-
1
.
0
,
2
.
0
,
3
.
0
,
&
matrix
);
status
=
GdipIsMatrixInvertible
(
matrix
,
&
result
);
expect
(
Ok
,
status
);
expect
(
TRUE
,
result
);
GdipDeleteMatrix
(
matrix
);
/* noninvertible */
GdipCreateMatrix2
(
2
.
0
,
-
1
.
0
,
6
.
0
,
-
3
.
0
,
2
.
2
,
3
.
0
,
&
matrix
);
status
=
GdipIsMatrixInvertible
(
matrix
,
&
result
);
expect
(
Ok
,
status
);
expect
(
FALSE
,
result
);
GdipDeleteMatrix
(
matrix
);
}
START_TEST
(
matrix
)
{
struct
GdiplusStartupInput
gdiplusStartupInput
;
...
...
@@ -103,6 +132,7 @@ START_TEST(matrix)
test_constructor_destructor
();
test_transform
();
test_isinvertible
();
GdiplusShutdown
(
gdiplusToken
);
}
include/gdiplusflat.h
View file @
d4554ad5
...
...
@@ -264,6 +264,7 @@ GpStatus WINGDIPAPI GdipCreateMatrix3(GDIPCONST GpRectF *,GDIPCONST GpPointF*,Gp
GpStatus
WINGDIPAPI
GdipCreateMatrix3I
(
GDIPCONST
GpRect
*
,
GDIPCONST
GpPoint
*
,
GpMatrix
**
);
GpStatus
WINGDIPAPI
GdipIsMatrixEqual
(
GDIPCONST
GpMatrix
*
,
GDIPCONST
GpMatrix
*
,
BOOL
*
);
GpStatus
WINGDIPAPI
GdipIsMatrixIdentity
(
GDIPCONST
GpMatrix
*
,
BOOL
*
);
GpStatus
WINGDIPAPI
GdipIsMatrixInvertible
(
GDIPCONST
GpMatrix
*
,
BOOL
*
);
GpStatus
WINGDIPAPI
GdipDeleteMatrix
(
GpMatrix
*
);
GpStatus
WINGDIPAPI
GdipGetMatrixElements
(
GDIPCONST
GpMatrix
*
,
REAL
*
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment