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
d13d34d1
Commit
d13d34d1
authored
Dec 06, 2018
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Dec 06, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs: Add support for palette image formats to TIFF encoder.
Signed-off-by:
Dmitry Timoshkov
<
dmitry@baikal.ru
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1d7da01f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
6 deletions
+36
-6
main.c
dlls/windowscodecs/main.c
+1
-1
regsvr.c
dlls/windowscodecs/regsvr.c
+5
-0
converter.c
dlls/windowscodecs/tests/converter.c
+0
-3
tiffformat.c
dlls/windowscodecs/tiffformat.c
+30
-2
No files found.
dlls/windowscodecs/main.c
View file @
d13d34d1
...
@@ -182,7 +182,7 @@ HRESULT write_source(IWICBitmapFrameEncode *iface,
...
@@ -182,7 +182,7 @@ HRESULT write_source(IWICBitmapFrameEncode *iface,
if
(
FAILED
(
hr
))
if
(
FAILED
(
hr
))
{
{
ERR
(
"Failed to convert source, target format %s, %#x
\n
"
,
debugstr_guid
(
format
),
hr
);
ERR
(
"Failed to convert source, target format %s, %#x
\n
"
,
debugstr_guid
(
format
),
hr
);
return
hr
;
return
E_NOTIMPL
;
}
}
stride
=
(
bpp
*
width
+
7
)
/
8
;
stride
=
(
bpp
*
width
+
7
)
/
8
;
...
...
dlls/windowscodecs/regsvr.c
View file @
d13d34d1
...
@@ -1211,6 +1211,8 @@ static GUID const * const tiff_decode_formats[] = {
...
@@ -1211,6 +1211,8 @@ static GUID const * const tiff_decode_formats[] = {
&
GUID_WICPixelFormatBlackWhite
,
&
GUID_WICPixelFormatBlackWhite
,
&
GUID_WICPixelFormat4bppGray
,
&
GUID_WICPixelFormat4bppGray
,
&
GUID_WICPixelFormat8bppGray
,
&
GUID_WICPixelFormat8bppGray
,
&
GUID_WICPixelFormat1bppIndexed
,
&
GUID_WICPixelFormat2bppIndexed
,
&
GUID_WICPixelFormat4bppIndexed
,
&
GUID_WICPixelFormat4bppIndexed
,
&
GUID_WICPixelFormat8bppIndexed
,
&
GUID_WICPixelFormat8bppIndexed
,
&
GUID_WICPixelFormat24bppBGR
,
&
GUID_WICPixelFormat24bppBGR
,
...
@@ -1370,6 +1372,9 @@ static GUID const * const tiff_encode_formats[] = {
...
@@ -1370,6 +1372,9 @@ static GUID const * const tiff_encode_formats[] = {
&
GUID_WICPixelFormatBlackWhite
,
&
GUID_WICPixelFormatBlackWhite
,
&
GUID_WICPixelFormat4bppGray
,
&
GUID_WICPixelFormat4bppGray
,
&
GUID_WICPixelFormat8bppGray
,
&
GUID_WICPixelFormat8bppGray
,
&
GUID_WICPixelFormat1bppIndexed
,
&
GUID_WICPixelFormat4bppIndexed
,
&
GUID_WICPixelFormat8bppIndexed
,
&
GUID_WICPixelFormat24bppBGR
,
&
GUID_WICPixelFormat24bppBGR
,
&
GUID_WICPixelFormat32bppBGRA
,
&
GUID_WICPixelFormat32bppBGRA
,
&
GUID_WICPixelFormat32bppPBGRA
,
&
GUID_WICPixelFormat32bppPBGRA
,
...
...
dlls/windowscodecs/tests/converter.c
View file @
d13d34d1
...
@@ -1510,8 +1510,6 @@ if (!strcmp(winetest_platform, "windows")) /* FIXME: enable once implemented in
...
@@ -1510,8 +1510,6 @@ if (!strcmp(winetest_platform, "windows")) /* FIXME: enable once implemented in
test_encoder
(
&
testdata_BlackWhite
,
&
CLSID_WICTiffEncoder
,
test_encoder
(
&
testdata_BlackWhite
,
&
CLSID_WICTiffEncoder
,
&
testdata_BlackWhite
,
&
CLSID_WICTiffDecoder
,
"TIFF encoder BlackWhite"
);
&
testdata_BlackWhite
,
&
CLSID_WICTiffDecoder
,
"TIFF encoder BlackWhite"
);
if
(
!
strcmp
(
winetest_platform
,
"windows"
))
/* FIXME: enable once implemented in Wine */
{
test_encoder
(
&
testdata_1bppIndexed
,
&
CLSID_WICTiffEncoder
,
test_encoder
(
&
testdata_1bppIndexed
,
&
CLSID_WICTiffEncoder
,
&
testdata_1bppIndexed
,
&
CLSID_WICTiffDecoder
,
"TIFF encoder 1bppIndexed"
);
&
testdata_1bppIndexed
,
&
CLSID_WICTiffDecoder
,
"TIFF encoder 1bppIndexed"
);
test_encoder
(
&
testdata_2bppIndexed
,
&
CLSID_WICTiffEncoder
,
test_encoder
(
&
testdata_2bppIndexed
,
&
CLSID_WICTiffEncoder
,
...
@@ -1520,7 +1518,6 @@ if (!strcmp(winetest_platform, "windows")) /* FIXME: enable once implemented in
...
@@ -1520,7 +1518,6 @@ if (!strcmp(winetest_platform, "windows")) /* FIXME: enable once implemented in
&
testdata_4bppIndexed
,
&
CLSID_WICTiffDecoder
,
"TIFF encoder 4bppIndexed"
);
&
testdata_4bppIndexed
,
&
CLSID_WICTiffDecoder
,
"TIFF encoder 4bppIndexed"
);
test_encoder
(
&
testdata_8bppIndexed
,
&
CLSID_WICTiffEncoder
,
test_encoder
(
&
testdata_8bppIndexed
,
&
CLSID_WICTiffEncoder
,
&
testdata_8bppIndexed
,
&
CLSID_WICTiffDecoder
,
"TIFF encoder 8bppIndexed"
);
&
testdata_8bppIndexed
,
&
CLSID_WICTiffDecoder
,
"TIFF encoder 8bppIndexed"
);
}
test_encoder
(
&
testdata_24bppBGR
,
&
CLSID_WICTiffEncoder
,
test_encoder
(
&
testdata_24bppBGR
,
&
CLSID_WICTiffEncoder
,
&
testdata_24bppBGR
,
&
CLSID_WICTiffDecoder
,
"TIFF encoder 24bppBGR"
);
&
testdata_24bppBGR
,
&
CLSID_WICTiffDecoder
,
"TIFF encoder 24bppBGR"
);
...
...
dlls/windowscodecs/tiffformat.c
View file @
d13d34d1
/*
/*
* Copyright 2010 Vincent Povirk for CodeWeavers
* Copyright 2010 Vincent Povirk for CodeWeavers
* Copyright 2016 Dmitry Timoshkov
*
*
* This library is free software; you can redistribute it and/or
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* modify it under the terms of the GNU Lesser General Public
...
@@ -461,6 +462,12 @@ static HRESULT tiff_get_decode_info(TIFF *tiff, tiff_decode_info *decode_info)
...
@@ -461,6 +462,12 @@ static HRESULT tiff_get_decode_info(TIFF *tiff, tiff_decode_info *decode_info)
decode_info
->
bpp
=
bps
;
decode_info
->
bpp
=
bps
;
switch
(
bps
)
switch
(
bps
)
{
{
case
1
:
decode_info
->
format
=
&
GUID_WICPixelFormat1bppIndexed
;
break
;
case
2
:
decode_info
->
format
=
&
GUID_WICPixelFormat2bppIndexed
;
break
;
case
4
:
case
4
:
decode_info
->
format
=
&
GUID_WICPixelFormat4bppIndexed
;
decode_info
->
format
=
&
GUID_WICPixelFormat4bppIndexed
;
break
;
break
;
...
@@ -469,7 +476,7 @@ static HRESULT tiff_get_decode_info(TIFF *tiff, tiff_decode_info *decode_info)
...
@@ -469,7 +476,7 @@ static HRESULT tiff_get_decode_info(TIFF *tiff, tiff_decode_info *decode_info)
break
;
break
;
default:
default:
FIXME
(
"unhandled indexed bit count %u
\n
"
,
bps
);
FIXME
(
"unhandled indexed bit count %u
\n
"
,
bps
);
return
E_
FAI
L
;
return
E_
NOTIMP
L
;
}
}
break
;
break
;
case
4
:
/* Transparency mask */
case
4
:
/* Transparency mask */
...
@@ -1408,6 +1415,9 @@ static const struct tiff_encode_format formats[] = {
...
@@ -1408,6 +1415,9 @@ static const struct tiff_encode_format formats[] = {
{
&
GUID_WICPixelFormat48bppRGB
,
2
,
16
,
3
,
48
,
0
,
0
,
0
},
{
&
GUID_WICPixelFormat48bppRGB
,
2
,
16
,
3
,
48
,
0
,
0
,
0
},
{
&
GUID_WICPixelFormat64bppRGBA
,
2
,
16
,
4
,
64
,
1
,
2
,
0
},
{
&
GUID_WICPixelFormat64bppRGBA
,
2
,
16
,
4
,
64
,
1
,
2
,
0
},
{
&
GUID_WICPixelFormat64bppPRGBA
,
2
,
16
,
4
,
64
,
1
,
1
,
0
},
{
&
GUID_WICPixelFormat64bppPRGBA
,
2
,
16
,
4
,
64
,
1
,
1
,
0
},
{
&
GUID_WICPixelFormat1bppIndexed
,
3
,
1
,
1
,
1
,
0
,
0
,
0
},
{
&
GUID_WICPixelFormat4bppIndexed
,
3
,
4
,
1
,
4
,
0
,
0
,
0
},
{
&
GUID_WICPixelFormat8bppIndexed
,
3
,
8
,
1
,
8
,
0
,
0
,
0
},
{
0
}
{
0
}
};
};
...
@@ -1579,9 +1589,12 @@ static HRESULT WINAPI TiffFrameEncode_SetPixelFormat(IWICBitmapFrameEncode *ifac
...
@@ -1579,9 +1589,12 @@ static HRESULT WINAPI TiffFrameEncode_SetPixelFormat(IWICBitmapFrameEncode *ifac
return
WINCODEC_ERR_WRONGSTATE
;
return
WINCODEC_ERR_WRONGSTATE
;
}
}
if
(
IsEqualGUID
(
pPixelFormat
,
&
GUID_WICPixelFormat2bppIndexed
))
*
pPixelFormat
=
GUID_WICPixelFormat4bppIndexed
;
for
(
i
=
0
;
formats
[
i
].
guid
;
i
++
)
for
(
i
=
0
;
formats
[
i
].
guid
;
i
++
)
{
{
if
(
memcmp
(
formats
[
i
].
guid
,
pPixelFormat
,
sizeof
(
GUID
))
==
0
)
if
(
IsEqualGUID
(
formats
[
i
].
guid
,
pPixelFormat
)
)
break
;
break
;
}
}
...
@@ -1690,6 +1703,21 @@ static HRESULT WINAPI TiffFrameEncode_WritePixels(IWICBitmapFrameEncode *iface,
...
@@ -1690,6 +1703,21 @@ static HRESULT WINAPI TiffFrameEncode_WritePixels(IWICBitmapFrameEncode *iface,
pTIFFSetField
(
This
->
parent
->
tiff
,
TIFFTAG_YRESOLUTION
,
(
float
)
This
->
yres
);
pTIFFSetField
(
This
->
parent
->
tiff
,
TIFFTAG_YRESOLUTION
,
(
float
)
This
->
yres
);
}
}
if
(
This
->
format
->
bpp
<=
8
&&
This
->
colors
&&
!
IsEqualGUID
(
This
->
format
->
guid
,
&
GUID_WICPixelFormatBlackWhite
))
{
uint16
red
[
256
],
green
[
256
],
blue
[
256
];
UINT
i
;
for
(
i
=
0
;
i
<
This
->
colors
;
i
++
)
{
red
[
i
]
=
(
This
->
palette
[
i
]
>>
8
)
&
0xff00
;
green
[
i
]
=
This
->
palette
[
i
]
&
0xff00
;
blue
[
i
]
=
(
This
->
palette
[
i
]
<<
8
)
&
0xff00
;
}
pTIFFSetField
(
This
->
parent
->
tiff
,
TIFFTAG_COLORMAP
,
red
,
green
,
blue
);
}
This
->
info_written
=
TRUE
;
This
->
info_written
=
TRUE
;
}
}
...
...
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