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
4f53be1a
Commit
4f53be1a
authored
Mar 05, 2020
by
Vincent Povirk
Committed by
Alexandre Julliard
Mar 05, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs: Set palette in WriteSource when necessary.
Signed-off-by:
Vincent Povirk
<
vincent@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9891afcb
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
35 additions
and
7 deletions
+35
-7
bmpencode.c
dlls/windowscodecs/bmpencode.c
+2
-1
jpegformat.c
dlls/windowscodecs/jpegformat.c
+2
-1
main.c
dlls/windowscodecs/main.c
+23
-1
pngformat.c
dlls/windowscodecs/pngformat.c
+3
-1
bmpformat.c
dlls/windowscodecs/tests/bmpformat.c
+1
-1
tiffformat.c
dlls/windowscodecs/tiffformat.c
+3
-1
wincodecs_private.h
dlls/windowscodecs/wincodecs_private.h
+1
-1
No files found.
dlls/windowscodecs/bmpencode.c
View file @
4f53be1a
...
...
@@ -316,7 +316,8 @@ static HRESULT WINAPI BmpFrameEncode_WriteSource(IWICBitmapFrameEncode *iface,
if
(
SUCCEEDED
(
hr
))
{
hr
=
write_source
(
iface
,
pIBitmapSource
,
prc
,
This
->
format
->
guid
,
This
->
format
->
bpp
,
This
->
width
,
This
->
height
);
This
->
format
->
guid
,
This
->
format
->
bpp
,
!
This
->
colors
&&
This
->
format
->
colors
,
This
->
width
,
This
->
height
);
}
return
hr
;
...
...
dlls/windowscodecs/jpegformat.c
View file @
4f53be1a
...
...
@@ -1181,7 +1181,8 @@ static HRESULT WINAPI JpegEncoder_Frame_WriteSource(IWICBitmapFrameEncode *iface
if
(
SUCCEEDED
(
hr
))
{
hr
=
write_source
(
iface
,
pIBitmapSource
,
prc
,
This
->
format
->
guid
,
This
->
format
->
bpp
,
This
->
width
,
This
->
height
);
This
->
format
->
guid
,
This
->
format
->
bpp
,
FALSE
,
This
->
width
,
This
->
height
);
}
return
hr
;
...
...
dlls/windowscodecs/main.c
View file @
4f53be1a
...
...
@@ -154,7 +154,7 @@ HRESULT configure_write_source(IWICBitmapFrameEncode *iface,
HRESULT
write_source
(
IWICBitmapFrameEncode
*
iface
,
IWICBitmapSource
*
source
,
const
WICRect
*
prc
,
const
WICPixelFormatGUID
*
format
,
UINT
bpp
,
const
WICPixelFormatGUID
*
format
,
UINT
bpp
,
BOOL
need_palette
,
INT
width
,
INT
height
)
{
IWICBitmapSource
*
converted_source
;
...
...
@@ -185,6 +185,28 @@ HRESULT write_source(IWICBitmapFrameEncode *iface,
return
E_NOTIMPL
;
}
if
(
need_palette
)
{
IWICPalette
*
palette
;
hr
=
PaletteImpl_Create
(
&
palette
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
IWICBitmapSource_CopyPalette
(
converted_source
,
palette
);
if
(
SUCCEEDED
(
hr
))
hr
=
IWICBitmapFrameEncode_SetPalette
(
iface
,
palette
);
IWICPalette_Release
(
palette
);
}
if
(
FAILED
(
hr
))
{
IWICBitmapSource_Release
(
converted_source
);
return
hr
;
}
}
stride
=
(
bpp
*
width
+
7
)
/
8
;
pixeldata
=
HeapAlloc
(
GetProcessHeap
(),
0
,
stride
*
prc
->
Height
);
...
...
dlls/windowscodecs/pngformat.c
View file @
4f53be1a
...
...
@@ -1772,7 +1772,9 @@ static HRESULT WINAPI PngFrameEncode_WriteSource(IWICBitmapFrameEncode *iface,
if
(
SUCCEEDED
(
hr
))
{
hr
=
write_source
(
iface
,
pIBitmapSource
,
prc
,
This
->
format
->
guid
,
This
->
format
->
bpp
,
This
->
width
,
This
->
height
);
This
->
format
->
guid
,
This
->
format
->
bpp
,
!
This
->
colors
&&
This
->
format
->
color_type
==
PNG_COLOR_TYPE_PALETTE
,
This
->
width
,
This
->
height
);
}
return
hr
;
...
...
dlls/windowscodecs/tests/bmpformat.c
View file @
4f53be1a
...
...
@@ -1247,7 +1247,7 @@ static void test_writesource_palette(void)
ok
(
hr
==
S_OK
,
"GetFrame error %#x
\n
"
,
hr
);
hr
=
IWICBitmapFrameDecode_CopyPalette
(
frame_decode
,
palette
);
todo_wine
ok
(
hr
==
S_OK
,
"CopyPalette error %#x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"CopyPalette error %#x
\n
"
,
hr
);
hr
=
IWICPalette_GetColors
(
palette
,
2
,
result_palette
,
&
result_colors
);
ok
(
hr
==
S_OK
,
"GetColors error %#x
\n
"
,
hr
);
...
...
dlls/windowscodecs/tiffformat.c
View file @
4f53be1a
...
...
@@ -1769,7 +1769,9 @@ static HRESULT WINAPI TiffFrameEncode_WriteSource(IWICBitmapFrameEncode *iface,
if
(
SUCCEEDED
(
hr
))
{
hr
=
write_source
(
iface
,
pIBitmapSource
,
prc
,
This
->
format
->
guid
,
This
->
format
->
bpp
,
This
->
width
,
This
->
height
);
This
->
format
->
guid
,
This
->
format
->
bpp
,
!
This
->
colors
&&
This
->
format
->
bpp
<=
8
&&
!
IsEqualGUID
(
This
->
format
->
guid
,
&
GUID_WICPixelFormatBlackWhite
),
This
->
width
,
This
->
height
);
}
return
hr
;
...
...
dlls/windowscodecs/wincodecs_private.h
View file @
4f53be1a
...
...
@@ -174,7 +174,7 @@ extern HRESULT configure_write_source(IWICBitmapFrameEncode *iface,
extern
HRESULT
write_source
(
IWICBitmapFrameEncode
*
iface
,
IWICBitmapSource
*
source
,
const
WICRect
*
prc
,
const
WICPixelFormatGUID
*
format
,
UINT
bpp
,
const
WICPixelFormatGUID
*
format
,
UINT
bpp
,
BOOL
need_palette
,
INT
width
,
INT
height
)
DECLSPEC_HIDDEN
;
extern
void
reverse_bgr8
(
UINT
bytesperpixel
,
LPBYTE
bits
,
UINT
width
,
UINT
height
,
INT
stride
)
DECLSPEC_HIDDEN
;
...
...
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