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
416eb191
Commit
416eb191
authored
Mar 19, 2010
by
Vincent Povirk
Committed by
Alexandre Julliard
Mar 22, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs: Add support for decoding RGB TIFF images.
parent
2ed101f6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
2 deletions
+43
-2
tiffformat.c
dlls/windowscodecs/tiffformat.c
+43
-2
No files found.
dlls/windowscodecs/tiffformat.c
View file @
416eb191
...
...
@@ -220,7 +220,7 @@ static const IWICBitmapFrameDecodeVtbl TiffFrameDecode_Vtbl;
static
HRESULT
tiff_get_decode_info
(
TIFF
*
tiff
,
tiff_decode_info
*
decode_info
)
{
uint16
photometric
,
bps
;
uint16
photometric
,
bps
,
samples
,
planar
;
int
ret
;
decode_info
->
indexed
=
0
;
...
...
@@ -256,6 +256,29 @@ static HRESULT tiff_get_decode_info(TIFF *tiff, tiff_decode_info *decode_info)
return
E_FAIL
;
}
break
;
case
2
:
/* RGB */
if
(
bps
!=
8
)
{
FIXME
(
"unhandled RGB bit count %u
\n
"
,
bps
);
return
E_FAIL
;
}
ret
=
pTIFFGetField
(
tiff
,
TIFFTAG_SAMPLESPERPIXEL
,
&
samples
);
if
(
samples
!=
3
)
{
FIXME
(
"unhandled RGB sample count %u
\n
"
,
samples
);
return
E_FAIL
;
}
ret
=
pTIFFGetField
(
tiff
,
TIFFTAG_PLANARCONFIG
,
&
planar
);
if
(
!
ret
)
planar
=
1
;
if
(
planar
!=
1
)
{
FIXME
(
"unhandled planar configuration %u
\n
"
,
planar
);
return
E_FAIL
;
}
decode_info
->
bpp
=
bps
*
samples
;
decode_info
->
reverse_bgr
=
1
;
decode_info
->
format
=
&
GUID_WICPixelFormat24bppBGR
;
break
;
case
3
:
/* RGB Palette */
decode_info
->
indexed
=
1
;
decode_info
->
bpp
=
bps
;
...
...
@@ -273,7 +296,6 @@ static HRESULT tiff_get_decode_info(TIFF *tiff, tiff_decode_info *decode_info)
}
break
;
case
0
:
/* WhiteIsZero */
case
2
:
/* RGB */
case
4
:
/* Transparency mask */
case
5
:
/* CMYK */
case
6
:
/* YCbCr */
...
...
@@ -651,6 +673,25 @@ static HRESULT TiffFrameDecode_ReadTile(TiffFrameDecode *This, UINT tile_x, UINT
hr
=
E_FAIL
;
}
if
(
hr
==
S_OK
&&
This
->
decode_info
.
reverse_bgr
)
{
if
(
This
->
decode_info
.
format
==
&
GUID_WICPixelFormat24bppBGR
)
{
UINT
i
,
total_pixels
;
BYTE
*
pixel
,
temp
;
total_pixels
=
This
->
decode_info
.
tile_width
*
This
->
decode_info
.
tile_height
;
pixel
=
This
->
cached_tile
;
for
(
i
=
0
;
i
<
total_pixels
;
i
++
)
{
temp
=
pixel
[
2
];
pixel
[
2
]
=
pixel
[
0
];
pixel
[
0
]
=
temp
;
pixel
+=
3
;
}
}
}
if
(
hr
==
S_OK
)
{
This
->
cached_tile_x
=
tile_x
;
...
...
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