Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
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
Aleksandr Isakov
wine-fonts
Commits
2e2b045d
Commit
2e2b045d
authored
Jun 10, 2011
by
Vincent Povirk
Committed by
Alexandre Julliard
Apr 12, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs: Add stub JPEG encoder.
parent
cdc2c531
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
193 additions
and
0 deletions
+193
-0
clsfactory.c
dlls/windowscodecs/clsfactory.c
+1
-0
jpegformat.c
dlls/windowscodecs/jpegformat.c
+175
-0
regsvr.c
dlls/windowscodecs/regsvr.c
+9
-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 @
2e2b045d
...
...
@@ -53,6 +53,7 @@ static classinfo wic_classes[] = {
{
&
CLSID_WICGifDecoder
,
GifDecoder_CreateInstance
},
{
&
CLSID_WICIcoDecoder
,
IcoDecoder_CreateInstance
},
{
&
CLSID_WICJpegDecoder
,
JpegDecoder_CreateInstance
},
{
&
CLSID_WICJpegEncoder
,
JpegEncoder_CreateInstance
},
{
&
CLSID_WICTiffDecoder
,
TiffDecoder_CreateInstance
},
{
&
CLSID_WICTiffEncoder
,
TiffEncoder_CreateInstance
},
{
&
CLSID_WICIcnsEncoder
,
IcnsEncoder_CreateInstance
},
...
...
dlls/windowscodecs/jpegformat.c
View file @
2e2b045d
...
...
@@ -697,6 +697,175 @@ HRESULT JpegDecoder_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv)
return
ret
;
}
typedef
struct
JpegEncoder
{
IWICBitmapEncoder
IWICBitmapEncoder_iface
;
LONG
ref
;
}
JpegEncoder
;
static
inline
JpegEncoder
*
impl_from_IWICBitmapEncoder
(
IWICBitmapEncoder
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
JpegEncoder
,
IWICBitmapEncoder_iface
);
}
static
HRESULT
WINAPI
JpegEncoder_QueryInterface
(
IWICBitmapEncoder
*
iface
,
REFIID
iid
,
void
**
ppv
)
{
JpegEncoder
*
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
JpegEncoder_AddRef
(
IWICBitmapEncoder
*
iface
)
{
JpegEncoder
*
This
=
impl_from_IWICBitmapEncoder
(
iface
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p) refcount=%u
\n
"
,
iface
,
ref
);
return
ref
;
}
static
ULONG
WINAPI
JpegEncoder_Release
(
IWICBitmapEncoder
*
iface
)
{
JpegEncoder
*
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
JpegEncoder_Initialize
(
IWICBitmapEncoder
*
iface
,
IStream
*
pIStream
,
WICBitmapEncoderCacheOption
cacheOption
)
{
FIXME
(
"(%p,%p,%u): stub
\n
"
,
iface
,
pIStream
,
cacheOption
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
JpegEncoder_GetContainerFormat
(
IWICBitmapEncoder
*
iface
,
GUID
*
pguidContainerFormat
)
{
FIXME
(
"(%p,%s): stub
\n
"
,
iface
,
debugstr_guid
(
pguidContainerFormat
));
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
JpegEncoder_GetEncoderInfo
(
IWICBitmapEncoder
*
iface
,
IWICBitmapEncoderInfo
**
ppIEncoderInfo
)
{
FIXME
(
"(%p,%p): stub
\n
"
,
iface
,
ppIEncoderInfo
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
JpegEncoder_SetColorContexts
(
IWICBitmapEncoder
*
iface
,
UINT
cCount
,
IWICColorContext
**
ppIColorContext
)
{
FIXME
(
"(%p,%u,%p): stub
\n
"
,
iface
,
cCount
,
ppIColorContext
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
JpegEncoder_SetPalette
(
IWICBitmapEncoder
*
iface
,
IWICPalette
*
pIPalette
)
{
TRACE
(
"(%p,%p)
\n
"
,
iface
,
pIPalette
);
return
WINCODEC_ERR_UNSUPPORTEDOPERATION
;
}
static
HRESULT
WINAPI
JpegEncoder_SetThumbnail
(
IWICBitmapEncoder
*
iface
,
IWICBitmapSource
*
pIThumbnail
)
{
TRACE
(
"(%p,%p)
\n
"
,
iface
,
pIThumbnail
);
return
WINCODEC_ERR_UNSUPPORTEDOPERATION
;
}
static
HRESULT
WINAPI
JpegEncoder_SetPreview
(
IWICBitmapEncoder
*
iface
,
IWICBitmapSource
*
pIPreview
)
{
TRACE
(
"(%p,%p)
\n
"
,
iface
,
pIPreview
);
return
WINCODEC_ERR_UNSUPPORTEDOPERATION
;
}
static
HRESULT
WINAPI
JpegEncoder_CreateNewFrame
(
IWICBitmapEncoder
*
iface
,
IWICBitmapFrameEncode
**
ppIFrameEncode
,
IPropertyBag2
**
ppIEncoderOptions
)
{
FIXME
(
"(%p,%p,%p): stub
\n
"
,
iface
,
ppIFrameEncode
,
ppIEncoderOptions
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
JpegEncoder_Commit
(
IWICBitmapEncoder
*
iface
)
{
FIXME
(
"(%p): stub
\n
"
,
iface
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
JpegEncoder_GetMetadataQueryWriter
(
IWICBitmapEncoder
*
iface
,
IWICMetadataQueryWriter
**
ppIMetadataQueryWriter
)
{
FIXME
(
"(%p,%p): stub
\n
"
,
iface
,
ppIMetadataQueryWriter
);
return
E_NOTIMPL
;
}
static
const
IWICBitmapEncoderVtbl
JpegEncoder_Vtbl
=
{
JpegEncoder_QueryInterface
,
JpegEncoder_AddRef
,
JpegEncoder_Release
,
JpegEncoder_Initialize
,
JpegEncoder_GetContainerFormat
,
JpegEncoder_GetEncoderInfo
,
JpegEncoder_SetColorContexts
,
JpegEncoder_SetPalette
,
JpegEncoder_SetThumbnail
,
JpegEncoder_SetPreview
,
JpegEncoder_CreateNewFrame
,
JpegEncoder_Commit
,
JpegEncoder_GetMetadataQueryWriter
};
HRESULT
JpegEncoder_CreateInstance
(
IUnknown
*
pUnkOuter
,
REFIID
iid
,
void
**
ppv
)
{
JpegEncoder
*
This
;
HRESULT
ret
;
TRACE
(
"(%p,%s,%p)
\n
"
,
pUnkOuter
,
debugstr_guid
(
iid
),
ppv
);
*
ppv
=
NULL
;
if
(
pUnkOuter
)
return
CLASS_E_NOAGGREGATION
;
if
(
!
libjpeg_handle
&&
!
load_libjpeg
())
{
ERR
(
"Failed writing JPEG because unable to find %s
\n
"
,
SONAME_LIBJPEG
);
return
E_FAIL
;
}
This
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
JpegEncoder
));
if
(
!
This
)
return
E_OUTOFMEMORY
;
This
->
IWICBitmapEncoder_iface
.
lpVtbl
=
&
JpegEncoder_Vtbl
;
This
->
ref
=
1
;
ret
=
IUnknown_QueryInterface
((
IUnknown
*
)
This
,
iid
,
ppv
);
IUnknown_Release
((
IUnknown
*
)
This
);
return
ret
;
}
#else
/* !defined(SONAME_LIBJPEG) */
HRESULT
JpegDecoder_CreateInstance
(
IUnknown
*
pUnkOuter
,
REFIID
iid
,
void
**
ppv
)
...
...
@@ -705,4 +874,10 @@ HRESULT JpegDecoder_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv)
return
E_FAIL
;
}
HRESULT
JpegEncoder_CreateInstance
(
IUnknown
*
pUnkOuter
,
REFIID
iid
,
void
**
ppv
)
{
ERR
(
"Trying to save JPEG picture, but JPEG support is not compiled in.
\n
"
);
return
E_FAIL
;
}
#endif
dlls/windowscodecs/regsvr.c
View file @
2e2b045d
...
...
@@ -937,6 +937,15 @@ static struct regsvr_encoder const encoder_list[] = {
".bmp,.dib,.rle"
,
bmp_encode_formats
},
{
&
CLSID_WICJpegEncoder
,
"The Wine Project"
,
"JPEG Encoder"
,
"1.0.0.0"
,
&
GUID_VendorMicrosoft
,
"image/jpeg"
,
".jpg;.jpeg;.jfif"
,
jpeg_formats
},
{
&
CLSID_WICPngEncoder
,
"The Wine Project"
,
"PNG Encoder"
,
...
...
dlls/windowscodecs/wincodecs_private.h
View file @
2e2b045d
...
...
@@ -37,6 +37,7 @@ extern HRESULT DibDecoder_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void**
extern
HRESULT
GifDecoder_CreateInstance
(
IUnknown
*
pUnkOuter
,
REFIID
riid
,
void
**
ppv
)
DECLSPEC_HIDDEN
;
extern
HRESULT
IcoDecoder_CreateInstance
(
IUnknown
*
pUnkOuter
,
REFIID
iid
,
void
**
ppv
)
DECLSPEC_HIDDEN
;
extern
HRESULT
JpegDecoder_CreateInstance
(
IUnknown
*
pUnkOuter
,
REFIID
iid
,
void
**
ppv
)
DECLSPEC_HIDDEN
;
extern
HRESULT
JpegEncoder_CreateInstance
(
IUnknown
*
pUnkOuter
,
REFIID
iid
,
void
**
ppv
)
DECLSPEC_HIDDEN
;
extern
HRESULT
TiffDecoder_CreateInstance
(
IUnknown
*
pUnkOuter
,
REFIID
iid
,
void
**
ppv
)
DECLSPEC_HIDDEN
;
extern
HRESULT
TiffEncoder_CreateInstance
(
IUnknown
*
pUnkOuter
,
REFIID
iid
,
void
**
ppv
)
DECLSPEC_HIDDEN
;
extern
HRESULT
IcnsEncoder_CreateInstance
(
IUnknown
*
pUnkOuter
,
REFIID
iid
,
void
**
ppv
)
DECLSPEC_HIDDEN
;
...
...
dlls/windowscodecs/windowscodecs_wincodec.idl
View file @
2e2b045d
...
...
@@ -81,6 +81,13 @@ coclass WICIcoDecoder { interface IWICBitmapDecoder; }
coclass
WICJpegDecoder
{
interface
IWICBitmapDecoder
; }
[
helpstring
(
"WIC JPEG Encoder"
),
threading
(
both
),
uuid
(
1
a34f5c1
-
4
a5a
-
46
dc
-
b644
-
1
f4567e7a676
)
]
coclass
WICJpegEncoder
{
interface
IWICBitmapEncoder
; }
[
helpstring
(
"WIC TIFF Decoder"
),
threading
(
both
),
uuid
(
b54e85d9
-
fe23
-
499
f
-
8b88
-
6
acea713752b
)
...
...
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