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
4cedec59
Commit
4cedec59
authored
May 29, 2010
by
Vincent Povirk
Committed by
Alexandre Julliard
Aug 25, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs: Handle WhiteIsZero TIFF images.
parent
73d539e6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
1 deletion
+20
-1
tiffformat.c
dlls/windowscodecs/tiffformat.c
+20
-1
No files found.
dlls/windowscodecs/tiffformat.c
View file @
4cedec59
...
...
@@ -205,6 +205,7 @@ typedef struct {
int
planar
;
int
indexed
;
int
reverse_bgr
;
int
invert_grayscale
;
UINT
width
,
height
;
UINT
tile_width
,
tile_height
;
UINT
tile_stride
;
...
...
@@ -230,6 +231,7 @@ static HRESULT tiff_get_decode_info(TIFF *tiff, tiff_decode_info *decode_info)
decode_info
->
indexed
=
0
;
decode_info
->
reverse_bgr
=
0
;
decode_info
->
invert_grayscale
=
0
;
ret
=
pTIFFGetField
(
tiff
,
TIFFTAG_PHOTOMETRIC
,
&
photometric
);
if
(
!
ret
)
...
...
@@ -262,6 +264,8 @@ static HRESULT tiff_get_decode_info(TIFF *tiff, tiff_decode_info *decode_info)
switch
(
photometric
)
{
case
0
:
/* WhiteIsZero */
decode_info
->
invert_grayscale
=
1
;
case
1
:
/* BlackIsZero */
if
(
samples
!=
1
)
{
...
...
@@ -331,7 +335,6 @@ static HRESULT tiff_get_decode_info(TIFF *tiff, tiff_decode_info *decode_info)
return
E_FAIL
;
}
break
;
case
0
:
/* WhiteIsZero */
case
4
:
/* Transparency mask */
case
5
:
/* CMYK */
case
6
:
/* YCbCr */
...
...
@@ -759,6 +762,22 @@ static HRESULT TiffFrameDecode_ReadTile(TiffFrameDecode *This, UINT tile_x, UINT
}
}
if
(
hr
==
S_OK
&&
This
->
decode_info
.
invert_grayscale
)
{
BYTE
*
byte
,
*
end
;
if
(
This
->
decode_info
.
samples
!=
1
)
{
ERR
(
"cannot invert grayscale image with %u samples
\n
"
,
This
->
decode_info
.
samples
);
return
E_FAIL
;
}
end
=
This
->
cached_tile
+
This
->
decode_info
.
tile_size
;
for
(
byte
=
This
->
cached_tile
;
byte
!=
end
;
byte
++
)
*
byte
=
~
(
*
byte
);
}
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