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
60d1be13
Commit
60d1be13
authored
Sep 23, 2009
by
Vincent Povirk
Committed by
Alexandre Julliard
Oct 09, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs: Add stub PNG encoder.
parent
7833b68a
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
178 additions
and
0 deletions
+178
-0
clsfactory.c
dlls/windowscodecs/clsfactory.c
+1
-0
pngformat.c
dlls/windowscodecs/pngformat.c
+170
-0
regsvr.c
dlls/windowscodecs/regsvr.c
+6
-0
wincodecs_private.h
dlls/windowscodecs/wincodecs_private.h
+1
-0
No files found.
dlls/windowscodecs/clsfactory.c
View file @
60d1be13
...
...
@@ -45,6 +45,7 @@ static classinfo wic_classes[] = {
{
&
CLSID_WICImagingFactory
,
ImagingFactory_CreateInstance
},
{
&
CLSID_WICBmpDecoder
,
BmpDecoder_CreateInstance
},
{
&
CLSID_WICPngDecoder
,
PngDecoder_CreateInstance
},
{
&
CLSID_WICPngEncoder
,
PngEncoder_CreateInstance
},
{
&
CLSID_WICBmpEncoder
,
BmpEncoder_CreateInstance
},
{
&
CLSID_WICGifDecoder
,
GifDecoder_CreateInstance
},
{
&
CLSID_WICIcoDecoder
,
IcoDecoder_CreateInstance
},
...
...
dlls/windowscodecs/pngformat.c
View file @
60d1be13
...
...
@@ -659,6 +659,170 @@ HRESULT PngDecoder_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv)
return
ret
;
}
typedef
struct
PngEncoder
{
const
IWICBitmapEncoderVtbl
*
lpVtbl
;
LONG
ref
;
}
PngEncoder
;
static
HRESULT
WINAPI
PngEncoder_QueryInterface
(
IWICBitmapEncoder
*
iface
,
REFIID
iid
,
void
**
ppv
)
{
PngEncoder
*
This
=
(
PngEncoder
*
)
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
PngEncoder_AddRef
(
IWICBitmapEncoder
*
iface
)
{
PngEncoder
*
This
=
(
PngEncoder
*
)
iface
;
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p) refcount=%u
\n
"
,
iface
,
ref
);
return
ref
;
}
static
ULONG
WINAPI
PngEncoder_Release
(
IWICBitmapEncoder
*
iface
)
{
PngEncoder
*
This
=
(
PngEncoder
*
)
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
PngEncoder_Initialize
(
IWICBitmapEncoder
*
iface
,
IStream
*
pIStream
,
WICBitmapEncoderCacheOption
cacheOption
)
{
FIXME
(
"(%p,%p,%u): stub
\n
"
,
iface
,
pIStream
,
cacheOption
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
PngEncoder_GetContainerFormat
(
IWICBitmapEncoder
*
iface
,
GUID
*
pguidContainerFormat
)
{
FIXME
(
"(%p,%s): stub
\n
"
,
iface
,
debugstr_guid
(
pguidContainerFormat
));
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
PngEncoder_GetEncoderInfo
(
IWICBitmapEncoder
*
iface
,
IWICBitmapEncoderInfo
**
ppIEncoderInfo
)
{
FIXME
(
"(%p,%p): stub
\n
"
,
iface
,
ppIEncoderInfo
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
PngEncoder_SetColorContexts
(
IWICBitmapEncoder
*
iface
,
UINT
cCount
,
IWICColorContext
**
ppIColorContext
)
{
FIXME
(
"(%p,%u,%p): stub
\n
"
,
iface
,
cCount
,
ppIColorContext
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
PngEncoder_SetPalette
(
IWICBitmapEncoder
*
iface
,
IWICPalette
*
pIPalette
)
{
TRACE
(
"(%p,%p)
\n
"
,
iface
,
pIPalette
);
return
WINCODEC_ERR_UNSUPPORTEDOPERATION
;
}
static
HRESULT
WINAPI
PngEncoder_SetThumbnail
(
IWICBitmapEncoder
*
iface
,
IWICBitmapSource
*
pIThumbnail
)
{
TRACE
(
"(%p,%p)
\n
"
,
iface
,
pIThumbnail
);
return
WINCODEC_ERR_UNSUPPORTEDOPERATION
;
}
static
HRESULT
WINAPI
PngEncoder_SetPreview
(
IWICBitmapEncoder
*
iface
,
IWICBitmapSource
*
pIPreview
)
{
TRACE
(
"(%p,%p)
\n
"
,
iface
,
pIPreview
);
return
WINCODEC_ERR_UNSUPPORTEDOPERATION
;
}
static
HRESULT
WINAPI
PngEncoder_CreateNewFrame
(
IWICBitmapEncoder
*
iface
,
IWICBitmapFrameEncode
**
ppIFrameEncode
,
IPropertyBag2
**
ppIEncoderOptions
)
{
FIXME
(
"(%p,%p,%p): stub
\n
"
,
iface
,
ppIFrameEncode
,
ppIEncoderOptions
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
PngEncoder_Commit
(
IWICBitmapEncoder
*
iface
)
{
TRACE
(
"(%p): stub
\n
"
,
iface
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
PngEncoder_GetMetadataQueryWriter
(
IWICBitmapEncoder
*
iface
,
IWICMetadataQueryWriter
**
ppIMetadataQueryWriter
)
{
FIXME
(
"(%p,%p): stub
\n
"
,
iface
,
ppIMetadataQueryWriter
);
return
E_NOTIMPL
;
}
static
const
IWICBitmapEncoderVtbl
PngEncoder_Vtbl
=
{
PngEncoder_QueryInterface
,
PngEncoder_AddRef
,
PngEncoder_Release
,
PngEncoder_Initialize
,
PngEncoder_GetContainerFormat
,
PngEncoder_GetEncoderInfo
,
PngEncoder_SetColorContexts
,
PngEncoder_SetPalette
,
PngEncoder_SetThumbnail
,
PngEncoder_SetPreview
,
PngEncoder_CreateNewFrame
,
PngEncoder_Commit
,
PngEncoder_GetMetadataQueryWriter
};
HRESULT
PngEncoder_CreateInstance
(
IUnknown
*
pUnkOuter
,
REFIID
iid
,
void
**
ppv
)
{
PngEncoder
*
This
;
HRESULT
ret
;
TRACE
(
"(%p,%s,%p)
\n
"
,
pUnkOuter
,
debugstr_guid
(
iid
),
ppv
);
*
ppv
=
NULL
;
if
(
pUnkOuter
)
return
CLASS_E_NOAGGREGATION
;
if
(
!
libpng_handle
&&
!
load_libpng
())
{
ERR
(
"Failed writing PNG because unable to find %s
\n
"
,
SONAME_LIBPNG
);
return
E_FAIL
;
}
This
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
PngEncoder
));
if
(
!
This
)
return
E_OUTOFMEMORY
;
This
->
lpVtbl
=
&
PngEncoder_Vtbl
;
This
->
ref
=
1
;
ret
=
IUnknown_QueryInterface
((
IUnknown
*
)
This
,
iid
,
ppv
);
IUnknown_Release
((
IUnknown
*
)
This
);
return
ret
;
}
#else
/* !HAVE_PNG_H */
HRESULT
PngDecoder_CreateInstance
(
IUnknown
*
pUnkOuter
,
REFIID
iid
,
void
**
ppv
)
...
...
@@ -667,4 +831,10 @@ HRESULT PngDecoder_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv)
return
E_FAIL
;
}
HRESULT
PngEncoder_CreateInstance
(
IUnknown
*
pUnkOuter
,
REFIID
iid
,
void
**
ppv
)
{
ERR
(
"Trying to save PNG picture, but PNG supported not compiled in.
\n
"
);
return
E_FAIL
;
}
#endif
dlls/windowscodecs/regsvr.c
View file @
60d1be13
...
...
@@ -741,6 +741,12 @@ static struct regsvr_coclass const coclass_list[] = {
"windowscodecs.dll"
,
"Apartment"
},
{
&
CLSID_WICPngEncoder
,
"WIC PNG Encoder"
,
NULL
,
"windowscodecs.dll"
,
"Apartment"
},
{
&
CLSID_WICBmpEncoder
,
"WIC BMP Encoder"
,
NULL
,
...
...
dlls/windowscodecs/wincodecs_private.h
View file @
60d1be13
...
...
@@ -23,6 +23,7 @@ extern HRESULT FormatConverter_CreateInstance(IUnknown *pUnkOuter, REFIID riid,
extern
HRESULT
ImagingFactory_CreateInstance
(
IUnknown
*
pUnkOuter
,
REFIID
riid
,
void
**
ppv
);
extern
HRESULT
BmpDecoder_CreateInstance
(
IUnknown
*
pUnkOuter
,
REFIID
riid
,
void
**
ppv
);
extern
HRESULT
PngDecoder_CreateInstance
(
IUnknown
*
pUnkOuter
,
REFIID
iid
,
void
**
ppv
);
extern
HRESULT
PngEncoder_CreateInstance
(
IUnknown
*
pUnkOuter
,
REFIID
iid
,
void
**
ppv
);
extern
HRESULT
BmpEncoder_CreateInstance
(
IUnknown
*
pUnkOuter
,
REFIID
iid
,
void
**
ppv
);
extern
HRESULT
GifDecoder_CreateInstance
(
IUnknown
*
pUnkOuter
,
REFIID
riid
,
void
**
ppv
);
extern
HRESULT
IcoDecoder_CreateInstance
(
IUnknown
*
pUnkOuter
,
REFIID
iid
,
void
**
ppv
);
...
...
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