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
10080298
Commit
10080298
authored
Mar 25, 2011
by
Vincent Povirk
Committed by
Alexandre Julliard
Mar 28, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs: Add support for reading tiled TIFF images.
parent
19b71b03
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
4 deletions
+35
-4
tiffformat.c
dlls/windowscodecs/tiffformat.c
+35
-4
No files found.
dlls/windowscodecs/tiffformat.c
View file @
10080298
...
...
@@ -62,6 +62,7 @@ MAKE_FUNCPTR(TIFFGetField);
MAKE_FUNCPTR
(
TIFFIsByteSwapped
);
MAKE_FUNCPTR
(
TIFFReadDirectory
);
MAKE_FUNCPTR
(
TIFFReadEncodedStrip
);
MAKE_FUNCPTR
(
TIFFReadEncodedTile
);
MAKE_FUNCPTR
(
TIFFSetDirectory
);
#undef MAKE_FUNCPTR
...
...
@@ -89,6 +90,7 @@ static void *load_libtiff(void)
LOAD_FUNCPTR
(
TIFFIsByteSwapped
);
LOAD_FUNCPTR
(
TIFFReadDirectory
);
LOAD_FUNCPTR
(
TIFFReadEncodedStrip
);
LOAD_FUNCPTR
(
TIFFReadEncodedTile
);
LOAD_FUNCPTR
(
TIFFSetDirectory
);
#undef LOAD_FUNCPTR
...
...
@@ -215,6 +217,8 @@ typedef struct {
UINT
tile_width
,
tile_height
;
UINT
tile_stride
;
UINT
tile_size
;
int
tiled
;
UINT
tiles_across
;
}
tiff_decode_info
;
typedef
struct
{
...
...
@@ -248,6 +252,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
;
decode_info
->
tiled
=
0
;
ret
=
pTIFFGetField
(
tiff
,
TIFFTAG_PHOTOMETRIC
,
&
photometric
);
if
(
!
ret
)
...
...
@@ -418,8 +423,28 @@ static HRESULT tiff_get_decode_info(TIFF *tiff, tiff_decode_info *decode_info)
return
E_FAIL
;
}
ret
=
pTIFFGetField
(
tiff
,
TIFFTAG_ROWSPERSTRIP
,
&
decode_info
->
tile_height
);
if
(
ret
)
if
((
ret
=
pTIFFGetField
(
tiff
,
TIFFTAG_TILEWIDTH
,
&
decode_info
->
tile_width
)))
{
decode_info
->
tiled
=
1
;
if
(
!
ret
)
{
WARN
(
"missing tile width
\n
"
);
return
E_FAIL
;
}
ret
=
pTIFFGetField
(
tiff
,
TIFFTAG_TILELENGTH
,
&
decode_info
->
tile_height
);
if
(
!
ret
)
{
WARN
(
"missing tile height
\n
"
);
return
E_FAIL
;
}
decode_info
->
tile_stride
=
((
decode_info
->
bpp
*
decode_info
->
tile_width
+
7
)
/
8
);
decode_info
->
tile_size
=
decode_info
->
tile_height
*
decode_info
->
tile_stride
;
decode_info
->
tiles_across
=
(
decode_info
->
width
+
decode_info
->
tile_width
-
1
)
/
decode_info
->
tile_width
;
}
else
if
((
ret
=
pTIFFGetField
(
tiff
,
TIFFTAG_ROWSPERSTRIP
,
&
decode_info
->
tile_height
)))
{
if
(
decode_info
->
tile_height
>
decode_info
->
height
)
decode_info
->
tile_height
=
decode_info
->
height
;
...
...
@@ -429,7 +454,6 @@ static HRESULT tiff_get_decode_info(TIFF *tiff, tiff_decode_info *decode_info)
}
else
{
/* Probably a tiled image */
FIXME
(
"missing RowsPerStrip value
\n
"
);
return
E_FAIL
;
}
...
...
@@ -797,7 +821,14 @@ static HRESULT TiffFrameDecode_ReadTile(TiffFrameDecode *This, UINT tile_x, UINT
if
(
hr
==
S_OK
)
{
ret
=
pTIFFReadEncodedStrip
(
This
->
parent
->
tiff
,
tile_y
,
This
->
cached_tile
,
This
->
decode_info
.
tile_size
);
if
(
This
->
decode_info
.
tiled
)
{
ret
=
pTIFFReadEncodedTile
(
This
->
parent
->
tiff
,
tile_x
+
tile_y
*
This
->
decode_info
.
tiles_across
,
This
->
cached_tile
,
This
->
decode_info
.
tile_size
);
}
else
{
ret
=
pTIFFReadEncodedStrip
(
This
->
parent
->
tiff
,
tile_y
,
This
->
cached_tile
,
This
->
decode_info
.
tile_size
);
}
if
(
ret
==
-
1
)
hr
=
E_FAIL
;
...
...
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