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
b9beb922
Commit
b9beb922
authored
May 29, 2010
by
Vincent Povirk
Committed by
Alexandre Julliard
Oct 21, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs: Support TIFF images with alpha data.
parent
0ce1c796
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
6 deletions
+48
-6
regsvr.c
dlls/windowscodecs/regsvr.c
+2
-0
tiffformat.c
dlls/windowscodecs/tiffformat.c
+45
-6
wincodec.idl
include/wincodec.idl
+1
-0
No files found.
dlls/windowscodecs/regsvr.c
View file @
b9beb922
...
@@ -1083,6 +1083,8 @@ static GUID const * const tiff_formats[] = {
...
@@ -1083,6 +1083,8 @@ static GUID const * const tiff_formats[] = {
&
GUID_WICPixelFormat32bppBGRA
,
&
GUID_WICPixelFormat32bppBGRA
,
&
GUID_WICPixelFormat32bppPBGRA
,
&
GUID_WICPixelFormat32bppPBGRA
,
&
GUID_WICPixelFormat48bppRGB
,
&
GUID_WICPixelFormat48bppRGB
,
&
GUID_WICPixelFormat64bppRGBA
,
&
GUID_WICPixelFormat64bppPRGBA
,
NULL
NULL
};
};
...
...
dlls/windowscodecs/tiffformat.c
View file @
b9beb922
...
@@ -227,6 +227,7 @@ static const IWICBitmapFrameDecodeVtbl TiffFrameDecode_Vtbl;
...
@@ -227,6 +227,7 @@ static const IWICBitmapFrameDecodeVtbl TiffFrameDecode_Vtbl;
static
HRESULT
tiff_get_decode_info
(
TIFF
*
tiff
,
tiff_decode_info
*
decode_info
)
static
HRESULT
tiff_get_decode_info
(
TIFF
*
tiff
,
tiff_decode_info
*
decode_info
)
{
{
uint16
photometric
,
bps
,
samples
,
planar
;
uint16
photometric
,
bps
,
samples
,
planar
;
uint16
extra_sample_count
,
*
extra_samples
;
int
ret
;
int
ret
;
decode_info
->
indexed
=
0
;
decode_info
->
indexed
=
0
;
...
@@ -293,7 +294,16 @@ static HRESULT tiff_get_decode_info(TIFF *tiff, tiff_decode_info *decode_info)
...
@@ -293,7 +294,16 @@ static HRESULT tiff_get_decode_info(TIFF *tiff, tiff_decode_info *decode_info)
case
2
:
/* RGB */
case
2
:
/* RGB */
decode_info
->
bpp
=
bps
*
samples
;
decode_info
->
bpp
=
bps
*
samples
;
if
(
samples
!=
3
)
if
(
samples
==
4
)
{
ret
=
pTIFFGetField
(
tiff
,
TIFFTAG_EXTRASAMPLES
,
&
extra_sample_count
,
&
extra_samples
);
if
(
!
ret
)
{
WARN
(
"Cannot get extra sample type for RGB data, ret=%i count=%i
\n
"
,
ret
,
extra_sample_count
);
return
E_FAIL
;
}
}
else
if
(
samples
!=
3
)
{
{
FIXME
(
"unhandled RGB sample count %u
\n
"
,
samples
);
FIXME
(
"unhandled RGB sample count %u
\n
"
,
samples
);
return
E_FAIL
;
return
E_FAIL
;
...
@@ -303,10 +313,38 @@ static HRESULT tiff_get_decode_info(TIFF *tiff, tiff_decode_info *decode_info)
...
@@ -303,10 +313,38 @@ static HRESULT tiff_get_decode_info(TIFF *tiff, tiff_decode_info *decode_info)
{
{
case
8
:
case
8
:
decode_info
->
reverse_bgr
=
1
;
decode_info
->
reverse_bgr
=
1
;
decode_info
->
format
=
&
GUID_WICPixelFormat24bppBGR
;
if
(
samples
==
3
)
decode_info
->
format
=
&
GUID_WICPixelFormat24bppBGR
;
else
switch
(
extra_samples
[
0
])
{
case
1
:
/* Associated (pre-multiplied) alpha data */
decode_info
->
format
=
&
GUID_WICPixelFormat32bppPBGRA
;
break
;
case
2
:
/* Unassociated alpha data */
decode_info
->
format
=
&
GUID_WICPixelFormat32bppBGRA
;
break
;
default:
FIXME
(
"unhandled extra sample type %i
\n
"
,
extra_samples
[
0
]);
return
E_FAIL
;
}
break
;
break
;
case
16
:
case
16
:
decode_info
->
format
=
&
GUID_WICPixelFormat48bppRGB
;
if
(
samples
==
3
)
decode_info
->
format
=
&
GUID_WICPixelFormat48bppRGB
;
else
switch
(
extra_samples
[
0
])
{
case
1
:
/* Associated (pre-multiplied) alpha data */
decode_info
->
format
=
&
GUID_WICPixelFormat64bppPRGBA
;
break
;
case
2
:
/* Unassociated alpha data */
decode_info
->
format
=
&
GUID_WICPixelFormat64bppRGBA
;
break
;
default:
FIXME
(
"unhandled extra sample type %i
\n
"
,
extra_samples
[
0
]);
return
E_FAIL
;
}
break
;
break
;
default:
default:
FIXME
(
"unhandled RGB bit count %u
\n
"
,
bps
);
FIXME
(
"unhandled RGB bit count %u
\n
"
,
bps
);
...
@@ -745,19 +783,20 @@ static HRESULT TiffFrameDecode_ReadTile(TiffFrameDecode *This, UINT tile_x, UINT
...
@@ -745,19 +783,20 @@ static HRESULT TiffFrameDecode_ReadTile(TiffFrameDecode *This, UINT tile_x, UINT
if
(
hr
==
S_OK
&&
This
->
decode_info
.
reverse_bgr
)
if
(
hr
==
S_OK
&&
This
->
decode_info
.
reverse_bgr
)
{
{
if
(
This
->
decode_info
.
format
==
&
GUID_WICPixelFormat24bppBGR
)
if
(
This
->
decode_info
.
bps
==
8
)
{
{
UINT
i
,
total_pixels
;
UINT
i
,
total_pixels
,
sample_count
;
BYTE
*
pixel
,
temp
;
BYTE
*
pixel
,
temp
;
total_pixels
=
This
->
decode_info
.
tile_width
*
This
->
decode_info
.
tile_height
;
total_pixels
=
This
->
decode_info
.
tile_width
*
This
->
decode_info
.
tile_height
;
pixel
=
This
->
cached_tile
;
pixel
=
This
->
cached_tile
;
sample_count
=
This
->
decode_info
.
samples
;
for
(
i
=
0
;
i
<
total_pixels
;
i
++
)
for
(
i
=
0
;
i
<
total_pixels
;
i
++
)
{
{
temp
=
pixel
[
2
];
temp
=
pixel
[
2
];
pixel
[
2
]
=
pixel
[
0
];
pixel
[
2
]
=
pixel
[
0
];
pixel
[
0
]
=
temp
;
pixel
[
0
]
=
temp
;
pixel
+=
3
;
pixel
+=
sample_count
;
}
}
}
}
}
}
...
...
include/wincodec.idl
View file @
b9beb922
...
@@ -165,6 +165,7 @@ cpp_quote("DEFINE_GUID(GUID_WICPixelFormat32bppPBGRA, 0x6fddc324,0x4e03,0x4bfe,0
...
@@ -165,6 +165,7 @@ cpp_quote("DEFINE_GUID(GUID_WICPixelFormat32bppPBGRA, 0x6fddc324,0x4e03,0x4bfe,0
cpp_quote
(
"DEFINE_GUID(GUID_WICPixelFormat48bppRGB, 0x6fddc324,0x4e03,0x4bfe,0xb1,0x85,0x3d,0x77,0x76,0x8d,0xc9,0x15);"
)
cpp_quote
(
"DEFINE_GUID(GUID_WICPixelFormat48bppRGB, 0x6fddc324,0x4e03,0x4bfe,0xb1,0x85,0x3d,0x77,0x76,0x8d,0xc9,0x15);"
)
cpp_quote
(
"DEFINE_GUID(GUID_WICPixelFormat64bppRGBA, 0x6fddc324,0x4e03,0x4bfe,0xb1,0x85,0x3d,0x77,0x76,0x8d,0xc9,0x16);"
)
cpp_quote
(
"DEFINE_GUID(GUID_WICPixelFormat64bppRGBA, 0x6fddc324,0x4e03,0x4bfe,0xb1,0x85,0x3d,0x77,0x76,0x8d,0xc9,0x16);"
)
cpp_quote
(
"DEFINE_GUID(GUID_WICPixelFormat64bppPRGBA, 0x6fddc324,0x4e03,0x4bfe,0xb1,0x85,0x3d,0x77,0x76,0x8d,0xc9,0x17);"
)
cpp_quote
(
"DEFINE_GUID(GUID_WICPixelFormat32bppCMYK, 0x6fddc324,0x4e03,0x4fbe,0xb1,0x85,0x3d,0x77,0x76,0x8d,0xc9,0x1c);"
)
cpp_quote
(
"DEFINE_GUID(GUID_WICPixelFormat32bppCMYK, 0x6fddc324,0x4e03,0x4fbe,0xb1,0x85,0x3d,0x77,0x76,0x8d,0xc9,0x1c);"
)
...
...
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