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
0a8be862
Commit
0a8be862
authored
Jun 19, 2012
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Jun 22, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs: Create a IWICMetadataReader for a TIFF frame.
parent
a02ad10f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
69 additions
and
6 deletions
+69
-6
tiffformat.c
dlls/windowscodecs/tiffformat.c
+69
-6
No files found.
dlls/windowscodecs/tiffformat.c
View file @
0a8be862
...
...
@@ -58,9 +58,10 @@ static void *libtiff_handle;
#define MAKE_FUNCPTR(f) static typeof(f) * p##f
MAKE_FUNCPTR
(
TIFFClientOpen
);
MAKE_FUNCPTR
(
TIFFClose
);
MAKE_FUNCPTR
(
TIFF
NumberOfDirectories
);
MAKE_FUNCPTR
(
TIFF
CurrentDirOffset
);
MAKE_FUNCPTR
(
TIFFGetField
);
MAKE_FUNCPTR
(
TIFFIsByteSwapped
);
MAKE_FUNCPTR
(
TIFFNumberOfDirectories
);
MAKE_FUNCPTR
(
TIFFReadDirectory
);
MAKE_FUNCPTR
(
TIFFReadEncodedStrip
);
MAKE_FUNCPTR
(
TIFFReadEncodedTile
);
...
...
@@ -89,9 +90,10 @@ static void *load_libtiff(void)
}
LOAD_FUNCPTR
(
TIFFClientOpen
);
LOAD_FUNCPTR
(
TIFFClose
);
LOAD_FUNCPTR
(
TIFF
NumberOfDirectories
);
LOAD_FUNCPTR
(
TIFF
CurrentDirOffset
);
LOAD_FUNCPTR
(
TIFFGetField
);
LOAD_FUNCPTR
(
TIFFIsByteSwapped
);
LOAD_FUNCPTR
(
TIFFNumberOfDirectories
);
LOAD_FUNCPTR
(
TIFFReadDirectory
);
LOAD_FUNCPTR
(
TIFFReadEncodedStrip
);
LOAD_FUNCPTR
(
TIFFReadEncodedTile
);
...
...
@@ -1133,15 +1135,76 @@ static HRESULT WINAPI TiffFrameDecode_Block_GetContainerFormat(IWICMetadataBlock
static
HRESULT
WINAPI
TiffFrameDecode_Block_GetCount
(
IWICMetadataBlockReader
*
iface
,
UINT
*
count
)
{
FIXME
(
"(%p,%p): stub
\n
"
,
iface
,
count
);
return
E_NOTIMPL
;
TRACE
(
"%p,%p
\n
"
,
iface
,
count
);
if
(
!
count
)
return
E_INVALIDARG
;
*
count
=
1
;
return
S_OK
;
}
static
HRESULT
create_metadata_reader
(
TiffFrameDecode
*
This
,
IWICMetadataReader
**
reader
)
{
HRESULT
hr
;
LARGE_INTEGER
dir_offset
;
IWICMetadataReader
*
metadata_reader
;
IWICPersistStream
*
persist
;
/* FIXME: Use IWICComponentFactory_CreateMetadataReader once it's implemented */
hr
=
CoCreateInstance
(
&
CLSID_WICIfdMetadataReader
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IWICMetadataReader
,
(
void
**
)
&
metadata_reader
);
if
(
FAILED
(
hr
))
return
hr
;
hr
=
IWICMetadataReader_QueryInterface
(
metadata_reader
,
&
IID_IWICPersistStream
,
(
void
**
)
&
persist
);
if
(
FAILED
(
hr
))
{
IWICMetadataReader_Release
(
metadata_reader
);
return
hr
;
}
EnterCriticalSection
(
&
This
->
parent
->
lock
);
dir_offset
.
QuadPart
=
pTIFFCurrentDirOffset
(
This
->
parent
->
tiff
);
hr
=
IStream_Seek
(
This
->
parent
->
stream
,
dir_offset
,
STREAM_SEEK_SET
,
NULL
);
if
(
SUCCEEDED
(
hr
))
{
BOOL
byte_swapped
=
pTIFFIsByteSwapped
(
This
->
parent
->
tiff
);
#ifdef WORDS_BIGENDIAN
DWORD
persist_options
=
byte_swapped
?
WICPersistOptionsLittleEndian
:
WICPersistOptionsBigEndian
;
#else
DWORD
persist_options
=
byte_swapped
?
WICPersistOptionsBigEndian
:
WICPersistOptionsLittleEndian
;
#endif
persist_options
|=
WICPersistOptionsNoCacheStream
;
hr
=
IWICPersistStream_LoadEx
(
persist
,
This
->
parent
->
stream
,
NULL
,
persist_options
);
if
(
FAILED
(
hr
))
ERR
(
"IWICPersistStream_LoadEx error %#x
\n
"
,
hr
);
}
LeaveCriticalSection
(
&
This
->
parent
->
lock
);
IWICPersistStream_Release
(
persist
);
if
(
FAILED
(
hr
))
{
IWICMetadataReader_Release
(
metadata_reader
);
return
hr
;
}
*
reader
=
metadata_reader
;
return
S_OK
;
}
static
HRESULT
WINAPI
TiffFrameDecode_Block_GetReaderByIndex
(
IWICMetadataBlockReader
*
iface
,
UINT
index
,
IWICMetadataReader
**
reader
)
{
FIXME
(
"(%p,%u,%p): stub
\n
"
,
iface
,
index
,
reader
);
return
E_NOTIMPL
;
TiffFrameDecode
*
This
=
impl_from_IWICMetadataBlockReader
(
iface
);
TRACE
(
"(%p,%u,%p)
\n
"
,
iface
,
index
,
reader
);
if
(
!
reader
||
index
!=
0
)
return
E_INVALIDARG
;
return
create_metadata_reader
(
This
,
reader
);
}
static
HRESULT
WINAPI
TiffFrameDecode_Block_GetEnumerator
(
IWICMetadataBlockReader
*
iface
,
...
...
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