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
fb356a3e
Commit
fb356a3e
authored
Mar 29, 2011
by
Vincent Povirk
Committed by
Alexandre Julliard
Apr 06, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs: Add stub TIFF encoder.
parent
562267a7
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
209 additions
and
2 deletions
+209
-2
clsfactory.c
dlls/windowscodecs/clsfactory.c
+1
-0
regsvr.c
dlls/windowscodecs/regsvr.c
+25
-2
tiffformat.c
dlls/windowscodecs/tiffformat.c
+175
-0
wincodecs_private.h
dlls/windowscodecs/wincodecs_private.h
+1
-0
windowscodecs_wincodec.idl
dlls/windowscodecs/windowscodecs_wincodec.idl
+7
-0
No files found.
dlls/windowscodecs/clsfactory.c
View file @
fb356a3e
...
...
@@ -53,6 +53,7 @@ static classinfo wic_classes[] = {
{
&
CLSID_WICIcoDecoder
,
IcoDecoder_CreateInstance
},
{
&
CLSID_WICJpegDecoder
,
JpegDecoder_CreateInstance
},
{
&
CLSID_WICTiffDecoder
,
TiffDecoder_CreateInstance
},
{
&
CLSID_WICTiffEncoder
,
TiffEncoder_CreateInstance
},
{
&
CLSID_WICIcnsEncoder
,
IcnsEncoder_CreateInstance
},
{
&
CLSID_WICDefaultFormatConverter
,
FormatConverter_CreateInstance
},
{
&
CLSID_WineTgaDecoder
,
TgaDecoder_CreateInstance
},
...
...
dlls/windowscodecs/regsvr.c
View file @
fb356a3e
...
...
@@ -761,12 +761,13 @@ static struct decoder_pattern const png_patterns[] = {
static
const
BYTE
tiff_magic_le
[]
=
{
0x49
,
0x49
,
42
,
0
};
static
const
BYTE
tiff_magic_be
[]
=
{
0x4d
,
0x4d
,
0
,
42
};
static
GUID
const
*
const
tiff_formats
[]
=
{
static
GUID
const
*
const
tiff_
decode_
formats
[]
=
{
&
GUID_WICPixelFormatBlackWhite
,
&
GUID_WICPixelFormat4bppGray
,
&
GUID_WICPixelFormat8bppGray
,
&
GUID_WICPixelFormat4bppIndexed
,
&
GUID_WICPixelFormat8bppIndexed
,
&
GUID_WICPixelFormat24bppBGR
,
&
GUID_WICPixelFormat32bppBGR
,
&
GUID_WICPixelFormat32bppBGRA
,
&
GUID_WICPixelFormat32bppPBGRA
,
...
...
@@ -870,7 +871,7 @@ static struct regsvr_decoder const decoder_list[] = {
&
GUID_VendorMicrosoft
,
"image/tiff"
,
".tif;.tiff"
,
tiff_formats
,
tiff_
decode_
formats
,
tiff_patterns
},
{
&
CLSID_WineTgaDecoder
,
...
...
@@ -908,6 +909,19 @@ static GUID const * const png_encode_formats[] = {
NULL
};
static
GUID
const
*
const
tiff_encode_formats
[]
=
{
&
GUID_WICPixelFormatBlackWhite
,
&
GUID_WICPixelFormat4bppGray
,
&
GUID_WICPixelFormat8bppGray
,
&
GUID_WICPixelFormat24bppBGR
,
&
GUID_WICPixelFormat32bppBGRA
,
&
GUID_WICPixelFormat32bppPBGRA
,
&
GUID_WICPixelFormat48bppRGB
,
&
GUID_WICPixelFormat64bppRGBA
,
&
GUID_WICPixelFormat64bppPRGBA
,
NULL
};
static
GUID
const
*
const
icns_encode_formats
[]
=
{
&
GUID_WICPixelFormat32bppBGRA
,
NULL
...
...
@@ -932,6 +946,15 @@ static struct regsvr_encoder const encoder_list[] = {
".png"
,
png_encode_formats
},
{
&
CLSID_WICTiffEncoder
,
"The Wine Project"
,
"TIFF Encoder"
,
"1.0.0.0"
,
&
GUID_VendorMicrosoft
,
"image/tiff"
,
".tif;.tiff"
,
tiff_encode_formats
},
{
&
CLSID_WICIcnsEncoder
,
"The Wine Project"
,
"ICNS Encoder"
,
...
...
dlls/windowscodecs/tiffformat.c
View file @
fb356a3e
...
...
@@ -1114,6 +1114,175 @@ HRESULT TiffDecoder_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv)
return
ret
;
}
typedef
struct
TiffEncoder
{
IWICBitmapEncoder
IWICBitmapEncoder_iface
;
LONG
ref
;
}
TiffEncoder
;
static
inline
TiffEncoder
*
impl_from_IWICBitmapEncoder
(
IWICBitmapEncoder
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
TiffEncoder
,
IWICBitmapEncoder_iface
);
}
static
HRESULT
WINAPI
TiffEncoder_QueryInterface
(
IWICBitmapEncoder
*
iface
,
REFIID
iid
,
void
**
ppv
)
{
TiffEncoder
*
This
=
impl_from_IWICBitmapEncoder
(
iface
);
TRACE
(
"(%p,%s,%p)
\n
"
,
iface
,
debugstr_guid
(
iid
),
ppv
);
if
(
!
ppv
)
return
E_INVALIDARG
;
if
(
IsEqualIID
(
&
IID_IUnknown
,
iid
)
||
IsEqualIID
(
&
IID_IWICBitmapEncoder
,
iid
))
{
*
ppv
=
This
;
}
else
{
*
ppv
=
NULL
;
return
E_NOINTERFACE
;
}
IUnknown_AddRef
((
IUnknown
*
)
*
ppv
);
return
S_OK
;
}
static
ULONG
WINAPI
TiffEncoder_AddRef
(
IWICBitmapEncoder
*
iface
)
{
TiffEncoder
*
This
=
impl_from_IWICBitmapEncoder
(
iface
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p) refcount=%u
\n
"
,
iface
,
ref
);
return
ref
;
}
static
ULONG
WINAPI
TiffEncoder_Release
(
IWICBitmapEncoder
*
iface
)
{
TiffEncoder
*
This
=
impl_from_IWICBitmapEncoder
(
iface
);
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p) refcount=%u
\n
"
,
iface
,
ref
);
if
(
ref
==
0
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
return
ref
;
}
static
HRESULT
WINAPI
TiffEncoder_Initialize
(
IWICBitmapEncoder
*
iface
,
IStream
*
pIStream
,
WICBitmapEncoderCacheOption
cacheOption
)
{
FIXME
(
"(%p,%p,%u): stub
\n
"
,
iface
,
pIStream
,
cacheOption
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
TiffEncoder_GetContainerFormat
(
IWICBitmapEncoder
*
iface
,
GUID
*
pguidContainerFormat
)
{
FIXME
(
"(%p,%s): stub
\n
"
,
iface
,
debugstr_guid
(
pguidContainerFormat
));
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
TiffEncoder_GetEncoderInfo
(
IWICBitmapEncoder
*
iface
,
IWICBitmapEncoderInfo
**
ppIEncoderInfo
)
{
FIXME
(
"(%p,%p): stub
\n
"
,
iface
,
ppIEncoderInfo
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
TiffEncoder_SetColorContexts
(
IWICBitmapEncoder
*
iface
,
UINT
cCount
,
IWICColorContext
**
ppIColorContext
)
{
FIXME
(
"(%p,%u,%p): stub
\n
"
,
iface
,
cCount
,
ppIColorContext
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
TiffEncoder_SetPalette
(
IWICBitmapEncoder
*
iface
,
IWICPalette
*
pIPalette
)
{
TRACE
(
"(%p,%p)
\n
"
,
iface
,
pIPalette
);
return
WINCODEC_ERR_UNSUPPORTEDOPERATION
;
}
static
HRESULT
WINAPI
TiffEncoder_SetThumbnail
(
IWICBitmapEncoder
*
iface
,
IWICBitmapSource
*
pIThumbnail
)
{
TRACE
(
"(%p,%p)
\n
"
,
iface
,
pIThumbnail
);
return
WINCODEC_ERR_UNSUPPORTEDOPERATION
;
}
static
HRESULT
WINAPI
TiffEncoder_SetPreview
(
IWICBitmapEncoder
*
iface
,
IWICBitmapSource
*
pIPreview
)
{
TRACE
(
"(%p,%p)
\n
"
,
iface
,
pIPreview
);
return
WINCODEC_ERR_UNSUPPORTEDOPERATION
;
}
static
HRESULT
WINAPI
TiffEncoder_CreateNewFrame
(
IWICBitmapEncoder
*
iface
,
IWICBitmapFrameEncode
**
ppIFrameEncode
,
IPropertyBag2
**
ppIEncoderOptions
)
{
FIXME
(
"(%p,%p,%p): stub
\n
"
,
iface
,
ppIFrameEncode
,
ppIEncoderOptions
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
TiffEncoder_Commit
(
IWICBitmapEncoder
*
iface
)
{
FIXME
(
"(%p): stub
\n
"
,
iface
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
TiffEncoder_GetMetadataQueryWriter
(
IWICBitmapEncoder
*
iface
,
IWICMetadataQueryWriter
**
ppIMetadataQueryWriter
)
{
FIXME
(
"(%p,%p): stub
\n
"
,
iface
,
ppIMetadataQueryWriter
);
return
E_NOTIMPL
;
}
static
const
IWICBitmapEncoderVtbl
TiffEncoder_Vtbl
=
{
TiffEncoder_QueryInterface
,
TiffEncoder_AddRef
,
TiffEncoder_Release
,
TiffEncoder_Initialize
,
TiffEncoder_GetContainerFormat
,
TiffEncoder_GetEncoderInfo
,
TiffEncoder_SetColorContexts
,
TiffEncoder_SetPalette
,
TiffEncoder_SetThumbnail
,
TiffEncoder_SetPreview
,
TiffEncoder_CreateNewFrame
,
TiffEncoder_Commit
,
TiffEncoder_GetMetadataQueryWriter
};
HRESULT
TiffEncoder_CreateInstance
(
IUnknown
*
pUnkOuter
,
REFIID
iid
,
void
**
ppv
)
{
TiffEncoder
*
This
;
HRESULT
ret
;
TRACE
(
"(%p,%s,%p)
\n
"
,
pUnkOuter
,
debugstr_guid
(
iid
),
ppv
);
*
ppv
=
NULL
;
if
(
pUnkOuter
)
return
CLASS_E_NOAGGREGATION
;
if
(
!
load_libtiff
())
{
ERR
(
"Failed writing TIFF because unable to load %s
\n
"
,
SONAME_LIBTIFF
);
return
E_FAIL
;
}
This
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
TiffEncoder
));
if
(
!
This
)
return
E_OUTOFMEMORY
;
This
->
IWICBitmapEncoder_iface
.
lpVtbl
=
&
TiffEncoder_Vtbl
;
This
->
ref
=
1
;
ret
=
IUnknown_QueryInterface
((
IUnknown
*
)
This
,
iid
,
ppv
);
IUnknown_Release
((
IUnknown
*
)
This
);
return
ret
;
}
#else
/* !SONAME_LIBTIFF */
HRESULT
TiffDecoder_CreateInstance
(
IUnknown
*
pUnkOuter
,
REFIID
iid
,
void
**
ppv
)
...
...
@@ -1122,4 +1291,10 @@ HRESULT TiffDecoder_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv)
return
E_FAIL
;
}
HRESULT
TiffEncoder_CreateInstance
(
IUnknown
*
pUnkOuter
,
REFIID
iid
,
void
**
ppv
)
{
ERR
(
"Trying to save TIFF picture, but Wine was compiled without TIFF support.
\n
"
);
return
E_FAIL
;
}
#endif
dlls/windowscodecs/wincodecs_private.h
View file @
fb356a3e
...
...
@@ -38,6 +38,7 @@ extern HRESULT GifDecoder_CreateInstance(IUnknown *pUnkOuter, REFIID riid, void*
extern
HRESULT
IcoDecoder_CreateInstance
(
IUnknown
*
pUnkOuter
,
REFIID
iid
,
void
**
ppv
);
extern
HRESULT
JpegDecoder_CreateInstance
(
IUnknown
*
pUnkOuter
,
REFIID
iid
,
void
**
ppv
);
extern
HRESULT
TiffDecoder_CreateInstance
(
IUnknown
*
pUnkOuter
,
REFIID
iid
,
void
**
ppv
);
extern
HRESULT
TiffEncoder_CreateInstance
(
IUnknown
*
pUnkOuter
,
REFIID
iid
,
void
**
ppv
);
extern
HRESULT
IcnsEncoder_CreateInstance
(
IUnknown
*
pUnkOuter
,
REFIID
iid
,
void
**
ppv
);
extern
HRESULT
TgaDecoder_CreateInstance
(
IUnknown
*
pUnkOuter
,
REFIID
iid
,
void
**
ppv
);
...
...
dlls/windowscodecs/windowscodecs_wincodec.idl
View file @
fb356a3e
...
...
@@ -82,6 +82,13 @@ coclass WICJpegDecoder { interface IWICBitmapDecoder; }
coclass
WICTiffDecoder
{
interface
IWICBitmapDecoder
; }
[
helpstring
(
"WIC TIFF Encoder"
),
threading
(
both
),
uuid
(
0131b
e10
-
2001
-
4
c5f
-
a9b0
-
cc88fab64ce8
)
]
coclass
WICTiffEncoder
{
interface
IWICBitmapEncoder
; }
[
helpstring
(
"WIC ICNS Encoder"
),
threading
(
both
),
uuid
(
312
fb6f1
-
b767
-409d-8
a6d
-
0
fc154d4f05c
)
...
...
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