Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
0595fc5e
Commit
0595fc5e
authored
Sep 14, 2009
by
Vincent Povirk
Committed by
Alexandre Julliard
Sep 15, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Implement GdipGetImageRawFormat.
parent
160d7dfb
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
22 deletions
+24
-22
gdiplus_private.h
dlls/gdiplus/gdiplus_private.h
+1
-0
graphics.c
dlls/gdiplus/graphics.c
+1
-0
image.c
dlls/gdiplus/image.c
+14
-14
image.c
dlls/gdiplus/tests/image.c
+8
-8
No files found.
dlls/gdiplus/gdiplus_private.h
View file @
0595fc5e
...
...
@@ -208,6 +208,7 @@ struct GpAdustableArrowCap{
struct
GpImage
{
IPicture
*
picture
;
ImageType
type
;
GUID
format
;
UINT
flags
;
};
...
...
dlls/gdiplus/graphics.c
View file @
0595fc5e
...
...
@@ -1235,6 +1235,7 @@ GpStatus WINGDIPAPI GdipCreateMetafileFromWmf(HMETAFILE hwmf, BOOL delete,
(
*
metafile
)
->
image
.
type
=
ImageTypeMetafile
;
memcpy
(
&
(
*
metafile
)
->
image
.
format
,
&
ImageFormatWMF
,
sizeof
(
GUID
));
(
*
metafile
)
->
bounds
.
X
=
((
REAL
)
placeable
->
BoundingBox
.
Left
)
/
((
REAL
)
placeable
->
Inch
);
(
*
metafile
)
->
bounds
.
Y
=
((
REAL
)
placeable
->
BoundingBox
.
Right
)
/
((
REAL
)
placeable
->
Inch
);
(
*
metafile
)
->
bounds
.
Width
=
((
REAL
)
(
placeable
->
BoundingBox
.
Right
...
...
dlls/gdiplus/image.c
View file @
0595fc5e
...
...
@@ -413,6 +413,9 @@ GpStatus WINGDIPAPI GdipCloneImage(GpImage *image, GpImage **cloneImage)
GdipDisposeImage
(
*
cloneImage
);
*
cloneImage
=
NULL
;
}
memcpy
(
&
(
*
cloneImage
)
->
format
,
&
image
->
format
,
sizeof
(
GUID
));
return
stat
;
}
else
...
...
@@ -858,6 +861,7 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT width, INT height, INT stride,
}
(
*
bitmap
)
->
image
.
type
=
ImageTypeBitmap
;
memcpy
(
&
(
*
bitmap
)
->
image
.
format
,
&
ImageFormatMemoryBMP
,
sizeof
(
GUID
));
(
*
bitmap
)
->
image
.
flags
=
ImageFlagsNone
;
(
*
bitmap
)
->
width
=
width
;
(
*
bitmap
)
->
height
=
height
;
...
...
@@ -1144,23 +1148,11 @@ GpStatus WINGDIPAPI GdipGetImagePixelFormat(GpImage *image, PixelFormat *format)
GpStatus
WINGDIPAPI
GdipGetImageRawFormat
(
GpImage
*
image
,
GUID
*
format
)
{
static
int
calls
;
if
(
!
image
||
!
format
)
return
InvalidParameter
;
if
(
!
(
calls
++
))
FIXME
(
"stub
\n
"
);
memcpy
(
format
,
&
image
->
format
,
sizeof
(
GUID
));
/* FIXME: should be detected from embedded picture or stored separately */
switch
(
image
->
type
)
{
case
ImageTypeBitmap
:
*
format
=
ImageFormatBMP
;
break
;
case
ImageTypeMetafile
:
*
format
=
ImageFormatEMF
;
break
;
default:
WARN
(
"unknown type %u
\n
"
,
image
->
type
);
*
format
=
ImageFormatUndefined
;
}
return
Ok
;
}
...
...
@@ -1647,7 +1639,15 @@ GpStatus WINGDIPAPI GdipLoadImageFromStream(IStream* stream, GpImage **image)
if
(
FAILED
(
hr
))
return
hresult_to_status
(
hr
);
/* call on the image decoder to do the real work */
return
codec
->
decode_func
(
stream
,
&
codec
->
info
.
Clsid
,
image
);
stat
=
codec
->
decode_func
(
stream
,
&
codec
->
info
.
Clsid
,
image
);
/* take note of the original data format */
if
(
stat
==
Ok
)
{
memcpy
(
&
(
*
image
)
->
format
,
&
codec
->
info
.
FormatID
,
sizeof
(
GUID
));
}
return
stat
;
}
/* FIXME: no ICM */
...
...
dlls/gdiplus/tests/image.c
View file @
0595fc5e
...
...
@@ -486,7 +486,7 @@ static void test_GdipCreateBitmapFromHBITMAP(void)
stat
=
GdipCreateBitmapFromHBITMAP
(
hbm
,
NULL
,
&
gpbm
);
expect
(
Ok
,
stat
);
/* raw format */
expect_rawformat
(
&
ImageFormatMemoryBMP
,
(
GpImage
*
)
gpbm
,
__LINE__
,
TRU
E
);
expect_rawformat
(
&
ImageFormatMemoryBMP
,
(
GpImage
*
)
gpbm
,
__LINE__
,
FALS
E
);
expect
(
Ok
,
GdipGetImageDimension
((
GpImage
*
)
gpbm
,
&
width
,
&
height
));
expectf
(
WIDTH2
,
width
);
...
...
@@ -564,12 +564,12 @@ static void test_GdipCloneImage(void)
/* Create an image, clone it, delete the original, make sure the copy works */
stat
=
GdipCreateBitmapFromScan0
(
WIDTH
,
HEIGHT
,
0
,
PixelFormat24bppRGB
,
NULL
,
&
bm
);
expect
(
Ok
,
stat
);
expect_rawformat
(
&
ImageFormatMemoryBMP
,
(
GpImage
*
)
bm
,
__LINE__
,
TRU
E
);
expect_rawformat
(
&
ImageFormatMemoryBMP
,
(
GpImage
*
)
bm
,
__LINE__
,
FALS
E
);
image_src
=
((
GpImage
*
)
bm
);
stat
=
GdipCloneImage
(
image_src
,
&
image_dest
);
expect
(
Ok
,
stat
);
expect_rawformat
(
&
ImageFormatMemoryBMP
,
image_dest
,
__LINE__
,
TRU
E
);
expect_rawformat
(
&
ImageFormatMemoryBMP
,
image_dest
,
__LINE__
,
FALS
E
);
stat
=
GdipDisposeImage
((
GpImage
*
)
bm
);
expect
(
Ok
,
stat
);
...
...
@@ -646,7 +646,7 @@ static void test_fromhicon(void)
stat
=
GdipGetImagePixelFormat
((
GpImage
*
)
bitmap
,
&
format
);
expect
(
PixelFormat32bppARGB
,
format
);
/* raw format */
expect_rawformat
(
&
ImageFormatMemoryBMP
,
(
GpImage
*
)
bitmap
,
__LINE__
,
TRU
E
);
expect_rawformat
(
&
ImageFormatMemoryBMP
,
(
GpImage
*
)
bitmap
,
__LINE__
,
FALS
E
);
GdipDisposeImage
((
GpImage
*
)
bitmap
);
}
DestroyIcon
(
hIcon
);
...
...
@@ -682,7 +682,7 @@ static void test_fromhicon(void)
stat
=
GdipGetImagePixelFormat
((
GpImage
*
)
bitmap
,
&
format
);
expect
(
PixelFormat32bppARGB
,
format
);
/* raw format */
expect_rawformat
(
&
ImageFormatMemoryBMP
,
(
GpImage
*
)
bitmap
,
__LINE__
,
TRU
E
);
expect_rawformat
(
&
ImageFormatMemoryBMP
,
(
GpImage
*
)
bitmap
,
__LINE__
,
FALS
E
);
GdipDisposeImage
((
GpImage
*
)
bitmap
);
}
DestroyIcon
(
hIcon
);
...
...
@@ -735,10 +735,10 @@ static const unsigned char jpgimage[285] = {
};
static
void
test_getrawformat
(
void
)
{
test_bufferrawformat
((
void
*
)
pngimage
,
sizeof
(
pngimage
),
&
ImageFormatPNG
,
__LINE__
,
TRU
E
);
test_bufferrawformat
((
void
*
)
gifimage
,
sizeof
(
gifimage
),
&
ImageFormatGIF
,
__LINE__
,
TRU
E
);
test_bufferrawformat
((
void
*
)
pngimage
,
sizeof
(
pngimage
),
&
ImageFormatPNG
,
__LINE__
,
FALS
E
);
test_bufferrawformat
((
void
*
)
gifimage
,
sizeof
(
gifimage
),
&
ImageFormatGIF
,
__LINE__
,
FALS
E
);
test_bufferrawformat
((
void
*
)
bmpimage
,
sizeof
(
bmpimage
),
&
ImageFormatBMP
,
__LINE__
,
FALSE
);
test_bufferrawformat
((
void
*
)
jpgimage
,
sizeof
(
jpgimage
),
&
ImageFormatJPEG
,
__LINE__
,
TRU
E
);
test_bufferrawformat
((
void
*
)
jpgimage
,
sizeof
(
jpgimage
),
&
ImageFormatJPEG
,
__LINE__
,
FALS
E
);
}
static
void
test_createhbitmap
(
void
)
...
...
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