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
2b7b3abc
Commit
2b7b3abc
authored
May 09, 2019
by
Vincent Povirk
Committed by
Alexandre Julliard
May 10, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs: Treat 16-bit channels as little endian.
Signed-off-by:
Vincent Povirk
<
vincent@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0c0def96
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
8 deletions
+24
-8
converter.c
dlls/windowscodecs/converter.c
+9
-8
converter.c
dlls/windowscodecs/tests/converter.c
+15
-0
No files found.
dlls/windowscodecs/converter.c
View file @
2b7b3abc
...
...
@@ -458,8 +458,9 @@ static HRESULT copypixels_to_32bppBGRA(struct FormatConverter *This, const WICRe
dstpixel
=
(
DWORD
*
)
dstrow
;
for
(
x
=
0
;
x
<
prc
->
Width
;
x
++
)
{
srcbyte
++
;
*
dstpixel
++
=
0xff000000
|
(
*
srcbyte
<<
16
)
|
(
*
srcbyte
<<
8
)
|*
srcbyte
;
srcbyte
+
=
2
;
srcbyte
+
+
;
}
srcrow
+=
srcstride
;
dstrow
+=
cbStride
;
...
...
@@ -776,9 +777,9 @@ static HRESULT copypixels_to_32bppBGRA(struct FormatConverter *This, const WICRe
dstpixel
=
(
DWORD
*
)
dstrow
;
for
(
x
=
0
;
x
<
prc
->
Width
;
x
++
)
{
BYTE
red
,
green
,
blue
;
red
=
*
srcpixel
++
;
srcpixel
++
;
green
=
*
srcpixel
++
;
srcpixel
++
;
blue
=
*
srcpixel
++
;
srcpixel
++
;
srcpixel
++
;
red
=
*
srcpixel
++
;
srcpixel
++
;
green
=
*
srcpixel
++
;
srcpixel
++
;
blue
=
*
srcpixel
++
;
*
dstpixel
++=
0xff000000
|
red
<<
16
|
green
<<
8
|
blue
;
}
srcrow
+=
srcstride
;
...
...
@@ -820,10 +821,10 @@ static HRESULT copypixels_to_32bppBGRA(struct FormatConverter *This, const WICRe
dstpixel
=
(
DWORD
*
)
dstrow
;
for
(
x
=
0
;
x
<
prc
->
Width
;
x
++
)
{
BYTE
red
,
green
,
blue
,
alpha
;
red
=
*
srcpixel
++
;
srcpixel
++
;
green
=
*
srcpixel
++
;
srcpixel
++
;
blue
=
*
srcpixel
++
;
srcpixel
++
;
alpha
=
*
srcpixel
++
;
srcpixel
++
;
srcpixel
++
;
red
=
*
srcpixel
++
;
srcpixel
++
;
green
=
*
srcpixel
++
;
srcpixel
++
;
blue
=
*
srcpixel
++
;
srcpixel
++
;
alpha
=
*
srcpixel
++
;
*
dstpixel
++=
alpha
<<
24
|
red
<<
16
|
green
<<
8
|
blue
;
}
srcrow
+=
srcstride
;
...
...
dlls/windowscodecs/tests/converter.c
View file @
2b7b3abc
...
...
@@ -491,6 +491,18 @@ static const struct bitmap_data testdata_32bppPBGRA = {
static
const
struct
bitmap_data
testdata_32bppPRGBA
=
{
&
GUID_WICPixelFormat32bppPRGBA
,
32
,
bits_32bppPBGRA
,
32
,
2
,
96
.
0
,
96
.
0
};
static
const
BYTE
bits_64bppRGBA
[]
=
{
128
,
255
,
128
,
0
,
128
,
0
,
128
,
255
,
128
,
0
,
128
,
255
,
128
,
0
,
128
,
255
,
128
,
0
,
128
,
0
,
128
,
255
,
128
,
255
,
128
,
0
,
128
,
0
,
128
,
0
,
128
,
255
,
128
,
255
,
128
,
0
,
128
,
0
,
128
,
255
,
128
,
0
,
128
,
255
,
128
,
0
,
128
,
255
,
128
,
0
,
128
,
0
,
128
,
255
,
128
,
255
,
128
,
0
,
128
,
0
,
128
,
0
,
128
,
255
,
128
,
255
,
128
,
0
,
128
,
0
,
128
,
255
,
128
,
0
,
128
,
255
,
128
,
0
,
128
,
255
,
128
,
0
,
128
,
0
,
128
,
255
,
128
,
255
,
128
,
0
,
128
,
0
,
128
,
0
,
128
,
255
,
128
,
255
,
128
,
0
,
128
,
0
,
128
,
255
,
128
,
0
,
128
,
255
,
128
,
0
,
128
,
255
,
128
,
0
,
128
,
0
,
128
,
255
,
128
,
255
,
128
,
0
,
128
,
0
,
128
,
0
,
128
,
255
,
128
,
255
,
128
,
0
,
128
,
0
,
128
,
255
,
128
,
0
,
128
,
255
,
128
,
0
,
128
,
255
,
128
,
0
,
128
,
0
,
128
,
255
,
128
,
255
,
128
,
0
,
128
,
0
,
128
,
0
,
128
,
255
,
128
,
255
,
128
,
0
,
128
,
0
,
128
,
255
,
128
,
0
,
128
,
255
,
128
,
0
,
128
,
255
,
128
,
0
,
128
,
0
,
128
,
255
,
128
,
255
,
128
,
0
,
128
,
0
,
128
,
0
,
128
,
255
,
128
,
255
,
128
,
0
,
128
,
0
,
128
,
255
,
128
,
0
,
128
,
255
,
128
,
0
,
128
,
255
,
128
,
0
,
128
,
0
,
128
,
255
,
128
,
255
,
128
,
0
,
128
,
0
,
128
,
0
,
128
,
255
,
128
,
255
,
128
,
0
,
128
,
0
,
128
,
255
,
128
,
0
,
128
,
255
,
128
,
0
,
128
,
255
,
128
,
0
,
128
,
0
,
128
,
255
,
128
,
255
,
128
,
0
,
128
,
0
,
128
,
0
,
128
,
255
,
128
,
0
,
128
,
255
,
128
,
255
,
128
,
255
,
128
,
255
,
128
,
0
,
128
,
255
,
128
,
255
,
128
,
255
,
128
,
255
,
128
,
0
,
128
,
255
,
128
,
255
,
128
,
255
,
128
,
255
,
128
,
255
,
128
,
0
,
128
,
255
,
128
,
255
,
128
,
255
,
128
,
255
,
128
,
0
,
128
,
255
,
128
,
255
,
128
,
255
,
128
,
255
,
128
,
0
,
128
,
255
,
128
,
255
,
128
,
255
,
128
,
255
,
128
,
255
,
128
,
0
,
128
,
255
,
128
,
255
,
128
,
255
,
128
,
255
,
128
,
0
,
128
,
255
,
128
,
255
,
128
,
255
,
128
,
255
,
128
,
0
,
128
,
255
,
128
,
255
,
128
,
255
,
128
,
255
,
128
,
255
,
128
,
0
,
128
,
255
,
128
,
255
,
128
,
255
,
128
,
255
,
128
,
0
,
128
,
255
,
128
,
255
,
128
,
255
,
128
,
255
,
128
,
0
,
128
,
255
,
128
,
255
,
128
,
255
,
128
,
255
,
128
,
255
,
128
,
0
,
128
,
255
,
128
,
255
,
128
,
255
,
128
,
255
,
128
,
0
,
128
,
255
,
128
,
255
,
128
,
255
,
128
,
255
,
128
,
0
,
128
,
255
,
128
,
255
,
128
,
255
,
128
,
255
,
128
,
255
,
128
,
0
,
128
,
255
,
128
,
255
,
128
,
255
,
128
,
255
,
128
,
0
,
128
,
255
,
128
,
255
,
128
,
255
,
128
,
255
,
128
,
0
,
128
,
255
,
128
,
255
,
128
,
255
,
128
,
255
,
128
,
255
,
128
,
0
,
128
,
255
,
128
,
255
,
128
,
255
,
128
,
255
,
128
,
0
,
128
,
255
,
128
,
255
,
128
,
255
,
128
,
255
,
128
,
0
,
128
,
255
,
128
,
255
,
128
,
255
,
128
,
255
,
128
,
255
,
128
,
0
,
128
,
255
,
128
,
255
,
128
,
255
,
128
,
255
,
128
,
0
,
128
,
255
,
128
,
255
,
128
,
255
,
128
,
255
,
128
,
0
,
128
,
255
,
128
,
255
,
128
,
255
,
128
,
255
,
128
,
255
};
static
const
struct
bitmap_data
testdata_64bppRGBA
=
{
&
GUID_WICPixelFormat64bppRGBA
,
64
,
bits_64bppRGBA
,
32
,
2
,
96
.
0
,
96
.
0
};
/* XP and 2003 use linear color conversion, later versions use sRGB gamma */
static
const
float
bits_32bppGrayFloat_xp
[]
=
{
0
.
114000
f
,
0
.
587000
f
,
0
.
299000
f
,
0
.
000000
f
,
0
.
114000
f
,
0
.
587000
f
,
0
.
299000
f
,
0
.
000000
f
,
...
...
@@ -1807,6 +1819,9 @@ START_TEST(converter)
test_conversion
(
&
testdata_24bppRGB
,
&
testdata_32bppBGR
,
"24bppRGB -> 32bppBGR"
,
FALSE
);
test_conversion
(
&
testdata_32bppBGRA
,
&
testdata_24bppRGB
,
"32bppBGRA -> 24bppRGB"
,
FALSE
);
test_conversion
(
&
testdata_64bppRGBA
,
&
testdata_32bppRGBA
,
"64bppRGBA -> 32bppRGBA"
,
FALSE
);
test_conversion
(
&
testdata_64bppRGBA
,
&
testdata_32bppRGB
,
"64bppRGBA -> 32bppRGB"
,
FALSE
);
test_conversion
(
&
testdata_24bppRGB
,
&
testdata_32bppGrayFloat
,
"24bppRGB -> 32bppGrayFloat"
,
FALSE
);
test_conversion
(
&
testdata_32bppBGR
,
&
testdata_32bppGrayFloat
,
"32bppBGR -> 32bppGrayFloat"
,
FALSE
);
...
...
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