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
116cf47d
Commit
116cf47d
authored
Sep 11, 2010
by
Vincent Povirk
Committed by
Alexandre Julliard
Sep 13, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs: Decode CMYK/YCCK JPEG images as CMYK.
parent
72bd5349
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
2 deletions
+27
-2
jpegformat.c
dlls/windowscodecs/jpegformat.c
+24
-2
regsvr.c
dlls/windowscodecs/regsvr.c
+1
-0
wincodec.idl
include/wincodec.idl
+2
-0
No files found.
dlls/windowscodecs/jpegformat.c
View file @
116cf47d
...
...
@@ -266,10 +266,24 @@ static HRESULT WINAPI JpegDecoder_Initialize(IWICBitmapDecoder *iface, IStream *
return
E_FAIL
;
}
if
(
This
->
cinfo
.
jpeg_color_space
==
JCS_GRAYSCALE
)
switch
(
This
->
cinfo
.
jpeg_color_space
)
{
case
JCS_GRAYSCALE
:
This
->
cinfo
.
out_color_space
=
JCS_GRAYSCALE
;
else
break
;
case
JCS_RGB
:
case
JCS_YCbCr
:
This
->
cinfo
.
out_color_space
=
JCS_RGB
;
break
;
case
JCS_CMYK
:
case
JCS_YCCK
:
This
->
cinfo
.
out_color_space
=
JCS_CMYK
;
break
;
default:
ERR
(
"Unknown JPEG color space %i
\n
"
,
This
->
cinfo
.
jpeg_color_space
);
LeaveCriticalSection
(
&
This
->
lock
);
return
E_FAIL
;
}
if
(
!
pjpeg_start_decompress
(
&
This
->
cinfo
))
{
...
...
@@ -427,6 +441,8 @@ static HRESULT WINAPI JpegDecoder_Frame_GetPixelFormat(IWICBitmapFrameDecode *if
TRACE
(
"(%p,%p)
\n
"
,
iface
,
pPixelFormat
);
if
(
This
->
cinfo
.
out_color_space
==
JCS_RGB
)
memcpy
(
pPixelFormat
,
&
GUID_WICPixelFormat24bppBGR
,
sizeof
(
GUID
));
else
if
(
This
->
cinfo
.
out_color_space
==
JCS_CMYK
)
memcpy
(
pPixelFormat
,
&
GUID_WICPixelFormat32bppCMYK
,
sizeof
(
GUID
));
else
/* This->cinfo.out_color_space == JCS_GRAYSCALE */
memcpy
(
pPixelFormat
,
&
GUID_WICPixelFormat8bppGray
,
sizeof
(
GUID
));
return
S_OK
;
...
...
@@ -457,6 +473,7 @@ static HRESULT WINAPI JpegDecoder_Frame_CopyPixels(IWICBitmapFrameDecode *iface,
TRACE
(
"(%p,%p,%u,%u,%p)
\n
"
,
iface
,
prc
,
cbStride
,
cbBufferSize
,
pbBuffer
);
if
(
This
->
cinfo
.
out_color_space
==
JCS_GRAYSCALE
)
bpp
=
8
;
else
if
(
This
->
cinfo
.
out_color_space
==
JCS_CMYK
)
bpp
=
32
;
else
bpp
=
24
;
stride
=
bpp
*
This
->
cinfo
.
output_width
;
...
...
@@ -514,6 +531,11 @@ static HRESULT WINAPI JpegDecoder_Frame_CopyPixels(IWICBitmapFrameDecode *iface,
}
}
}
if
(
This
->
cinfo
.
out_color_space
==
JCS_CMYK
&&
This
->
cinfo
.
saw_Adobe_marker
)
/* Adobe JPEG's have inverted CMYK data. */
for
(
i
=
0
;
i
<
data_size
;
i
++
)
This
->
image_data
[
i
]
^=
0xff
;
}
LeaveCriticalSection
(
&
This
->
lock
);
...
...
dlls/windowscodecs/regsvr.c
View file @
116cf47d
...
...
@@ -1036,6 +1036,7 @@ static const BYTE jpeg_magic[] = {0xff, 0xd8, 0xff, 0xe0};
static
GUID
const
*
const
jpeg_formats
[]
=
{
&
GUID_WICPixelFormat24bppBGR
,
&
GUID_WICPixelFormat32bppCMYK
,
&
GUID_WICPixelFormat8bppGray
,
NULL
};
...
...
include/wincodec.idl
View file @
116cf47d
...
...
@@ -166,6 +166,8 @@ cpp_quote("DEFINE_GUID(GUID_WICPixelFormat32bppPBGRA, 0x6fddc324,0x4e03,0x4bfe,0
cpp_quote
(
"DEFINE_GUID(GUID_WICPixelFormat48bppRGB, 0x6fddc324,0x4e03,0x4bfe,0xb1,0x85,0x3d,0x77,0x76,0x8d,0xc9,0x15);"
)
cpp_quote
(
"DEFINE_GUID(GUID_WICPixelFormat64bppRGBA, 0x6fddc324,0x4e03,0x4bfe,0xb1,0x85,0x3d,0x77,0x76,0x8d,0xc9,0x16);"
)
cpp_quote
(
"DEFINE_GUID(GUID_WICPixelFormat32bppCMYK, 0x6fddc324,0x4e03,0x4fbe,0xb1,0x85,0x3d,0x77,0x76,0x8d,0xc9,0x1c);"
)
typedef
struct
WICRect
{
INT
X
;
INT
Y
;
...
...
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