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
91e0ee26
Commit
91e0ee26
authored
Sep 04, 2009
by
Vincent Povirk
Committed by
Alexandre Julliard
Sep 08, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Use WIC to decode PNG files.
parent
947e39db
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
91 deletions
+5
-91
image.c
dlls/gdiplus/image.c
+5
-91
No files found.
dlls/gdiplus/image.c
View file @
91e0ee26
...
...
@@ -1517,100 +1517,14 @@ static GpStatus decode_image_jpeg(IStream* stream, REFCLSID clsid, GpImage **ima
return
decode_image_wic
(
stream
,
&
CLSID_WICJpegDecoder
,
image
);
}
static
GpStatus
decode_image_
gif
(
IStream
*
stream
,
REFCLSID
clsid
,
GpImage
**
image
)
static
GpStatus
decode_image_
png
(
IStream
*
stream
,
REFCLSID
clsid
,
GpImage
**
image
)
{
return
decode_image_wic
(
stream
,
&
CLSID_WIC
Gif
Decoder
,
image
);
return
decode_image_wic
(
stream
,
&
CLSID_WIC
Png
Decoder
,
image
);
}
static
GpStatus
decode_image_
olepicture_bitmap
(
IStream
*
stream
,
REFCLSID
clsid
,
GpImage
**
image
)
static
GpStatus
decode_image_
gif
(
IStream
*
stream
,
REFCLSID
clsid
,
GpImage
**
image
)
{
IPicture
*
pic
;
BITMAPINFO
*
pbmi
;
BITMAPCOREHEADER
*
bmch
;
HBITMAP
hbm
;
HDC
hdc
;
TRACE
(
"%p %p
\n
"
,
stream
,
image
);
if
(
!
stream
||
!
image
)
return
InvalidParameter
;
if
(
OleLoadPicture
(
stream
,
0
,
FALSE
,
&
IID_IPicture
,
(
LPVOID
*
)
&
pic
)
!=
S_OK
){
TRACE
(
"Could not load picture
\n
"
);
return
GenericError
;
}
pbmi
=
GdipAlloc
(
sizeof
(
BITMAPINFOHEADER
)
+
256
*
sizeof
(
RGBQUAD
));
if
(
!
pbmi
)
return
OutOfMemory
;
*
image
=
GdipAlloc
(
sizeof
(
GpBitmap
));
if
(
!*
image
){
GdipFree
(
pbmi
);
return
OutOfMemory
;
}
(
*
image
)
->
type
=
ImageTypeBitmap
;
(
*
((
GpBitmap
**
)
image
))
->
width
=
ipicture_pixel_width
(
pic
);
(
*
((
GpBitmap
**
)
image
))
->
height
=
ipicture_pixel_height
(
pic
);
/* get the pixel format */
IPicture_get_Handle
(
pic
,
(
OLE_HANDLE
*
)
&
hbm
);
IPicture_get_CurDC
(
pic
,
&
hdc
);
(
*
((
GpBitmap
**
)
image
))
->
hbitmap
=
hbm
;
(
*
((
GpBitmap
**
)
image
))
->
hdc
=
hdc
;
(
*
((
GpBitmap
**
)
image
))
->
bits
=
NULL
;
bmch
=
(
BITMAPCOREHEADER
*
)
(
&
pbmi
->
bmiHeader
);
bmch
->
bcSize
=
sizeof
(
BITMAPCOREHEADER
);
if
(
!
hdc
){
HBITMAP
old
;
hdc
=
CreateCompatibleDC
(
0
);
old
=
SelectObject
(
hdc
,
hbm
);
GetDIBits
(
hdc
,
hbm
,
0
,
0
,
NULL
,
pbmi
,
DIB_RGB_COLORS
);
SelectObject
(
hdc
,
old
);
DeleteDC
(
hdc
);
}
else
GetDIBits
(
hdc
,
hbm
,
0
,
0
,
NULL
,
pbmi
,
DIB_RGB_COLORS
);
switch
(
bmch
->
bcBitCount
)
{
case
1
:
(
*
((
GpBitmap
**
)
image
))
->
format
=
PixelFormat1bppIndexed
;
break
;
case
4
:
(
*
((
GpBitmap
**
)
image
))
->
format
=
PixelFormat4bppIndexed
;
break
;
case
8
:
(
*
((
GpBitmap
**
)
image
))
->
format
=
PixelFormat8bppIndexed
;
break
;
case
16
:
(
*
((
GpBitmap
**
)
image
))
->
format
=
PixelFormat16bppRGB565
;
break
;
case
24
:
(
*
((
GpBitmap
**
)
image
))
->
format
=
PixelFormat24bppRGB
;
break
;
case
32
:
(
*
((
GpBitmap
**
)
image
))
->
format
=
PixelFormat32bppRGB
;
break
;
case
48
:
(
*
((
GpBitmap
**
)
image
))
->
format
=
PixelFormat48bppRGB
;
break
;
default:
FIXME
(
"Bit depth %d is not fully supported yet
\n
"
,
bmch
->
bcBitCount
);
(
*
((
GpBitmap
**
)
image
))
->
format
=
(
bmch
->
bcBitCount
<<
8
)
|
PixelFormatGDI
;
break
;
}
GdipFree
(
pbmi
);
(
*
image
)
->
picture
=
pic
;
(
*
image
)
->
flags
=
ImageFlagsNone
;
return
Ok
;
return
decode_image_wic
(
stream
,
&
CLSID_WICGifDecoder
,
image
);
}
static
GpStatus
decode_image_olepicture_metafile
(
IStream
*
stream
,
REFCLSID
clsid
,
GpImage
**
image
)
...
...
@@ -2151,7 +2065,7 @@ static const struct image_codec codecs[NUM_CODECS] = {
/* SigMask */
png_sig_mask
,
},
NULL
,
decode_image_
olepicture_bitmap
decode_image_
png
},
{
{
/* ICO */
...
...
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