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
f27dd774
Commit
f27dd774
authored
Nov 17, 2023
by
Paul Gofman
Committed by
Alexandre Julliard
Nov 20, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs: Enable WICPixelFormat32bppBGRA in BMP encoder.
parent
e55cae42
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
3 deletions
+69
-3
bmpencode.c
dlls/windowscodecs/bmpencode.c
+0
-3
bmpformat.c
dlls/windowscodecs/tests/bmpformat.c
+69
-0
No files found.
dlls/windowscodecs/bmpencode.c
View file @
f27dd774
...
...
@@ -54,10 +54,7 @@ static const struct bmp_pixelformat formats[] = {
{
&
GUID_WICPixelFormat16bppBGR555
,
16
,
0
,
BI_RGB
},
{
&
GUID_WICPixelFormat16bppBGR565
,
16
,
0
,
BI_BITFIELDS
,
0xf800
,
0x7e0
,
0x1f
,
0
},
{
&
GUID_WICPixelFormat32bppBGR
,
32
,
0
,
BI_RGB
},
#if 0
/* Windows doesn't seem to support this one. */
{
&
GUID_WICPixelFormat32bppBGRA
,
32
,
0
,
BI_BITFIELDS
,
0xff0000
,
0xff00
,
0xff
,
0xff000000
},
#endif
{
NULL
}
};
...
...
dlls/windowscodecs/tests/bmpformat.c
View file @
f27dd774
...
...
@@ -1263,6 +1263,74 @@ static void test_writesource_palette(void)
IWICImagingFactory_Release
(
factory
);
}
static
void
test_encoder_formats
(
void
)
{
static
const
struct
{
const
GUID
*
format
;
BOOL
supported
;
const
char
*
name
;
}
tests
[]
=
{
{
&
GUID_WICPixelFormat24bppBGR
,
TRUE
,
"WICPixelFormat24bppBGR"
},
{
&
GUID_WICPixelFormatBlackWhite
,
FALSE
,
"WICPixelFormatBlackWhite"
},
{
&
GUID_WICPixelFormat1bppIndexed
,
TRUE
,
"WICPixelFormat1bppIndexed"
},
{
&
GUID_WICPixelFormat2bppIndexed
,
FALSE
,
"WICPixelFormat2bppIndexed"
},
{
&
GUID_WICPixelFormat4bppIndexed
,
TRUE
,
"WICPixelFormat4bppIndexed"
},
{
&
GUID_WICPixelFormat8bppIndexed
,
TRUE
,
"WICPixelFormat8bppIndexed"
},
{
&
GUID_WICPixelFormat16bppBGR555
,
TRUE
,
"WICPixelFormat16bppBGR555"
},
{
&
GUID_WICPixelFormat16bppBGR565
,
TRUE
,
"WICPixelFormat16bppBGR565"
},
{
&
GUID_WICPixelFormat32bppBGR
,
TRUE
,
"WICPixelFormat32bppBGR"
},
{
&
GUID_WICPixelFormat32bppBGRA
,
TRUE
,
"WICPixelFormat32bppBGRA"
},
{
&
GUID_WICPixelFormat8bppGray
,
FALSE
,
"WICPixelFormat8bppGray"
},
};
IWICImagingFactory
*
factory
;
HRESULT
hr
;
IStream
*
stream
;
IWICBitmapEncoder
*
encoder
;
IWICBitmapFrameEncode
*
frame_encode
;
GUID
pixelformat
;
LONG
refcount
;
unsigned
int
i
;
BOOL
supported
;
hr
=
CoCreateInstance
(
&
CLSID_WICImagingFactory
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IWICImagingFactory
,
(
void
**
)
&
factory
);
ok
(
hr
==
S_OK
,
"got %#lx.
\n
"
,
hr
);
hr
=
CreateStreamOnHGlobal
(
NULL
,
TRUE
,
&
stream
);
ok
(
hr
==
S_OK
,
"got %#lx.
\n
"
,
hr
);
hr
=
IWICImagingFactory_CreateEncoder
(
factory
,
&
GUID_ContainerFormatBmp
,
&
GUID_VendorMicrosoft
,
&
encoder
);
ok
(
hr
==
S_OK
,
"got %#lx.
\n
"
,
hr
);
hr
=
IWICBitmapEncoder_Initialize
(
encoder
,
stream
,
WICBitmapEncoderNoCache
);
ok
(
hr
==
S_OK
,
"got %#lx.
\n
"
,
hr
);
hr
=
IWICBitmapEncoder_CreateNewFrame
(
encoder
,
&
frame_encode
,
NULL
);
ok
(
hr
==
S_OK
,
"got %#lx.
\n
"
,
hr
);
hr
=
IWICBitmapFrameEncode_Initialize
(
frame_encode
,
NULL
);
ok
(
hr
==
S_OK
,
"got %#lx.
\n
"
,
hr
);
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
tests
);
++
i
)
{
winetest_push_context
(
tests
[
i
].
name
);
pixelformat
=
*
tests
[
i
].
format
;
hr
=
IWICBitmapFrameEncode_SetPixelFormat
(
frame_encode
,
&
pixelformat
);
ok
(
hr
==
S_OK
,
"got %#lx.
\n
"
,
hr
);
supported
=
!
memcmp
(
&
pixelformat
,
tests
[
i
].
format
,
sizeof
(
pixelformat
));
ok
(
supported
==
tests
[
i
].
supported
,
"got %d.
\n
"
,
supported
);
winetest_pop_context
();
}
IWICBitmapFrameEncode_Release
(
frame_encode
);
refcount
=
IWICBitmapEncoder_Release
(
encoder
);
ok
(
!
refcount
,
"got %ld.
\n
"
,
refcount
);
IStream_Release
(
stream
);
IWICImagingFactory_Release
(
factory
);
}
START_TEST
(
bmpformat
)
{
CoInitializeEx
(
NULL
,
COINIT_APARTMENTTHREADED
);
...
...
@@ -1276,6 +1344,7 @@ START_TEST(bmpformat)
test_createfromstream
();
test_create_decoder
();
test_writesource_palette
();
test_encoder_formats
();
CoUninitialize
();
}
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