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
9293ad7e
Commit
9293ad7e
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: Implement conversion from CMYK to RGB.
parent
116cf47d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
0 deletions
+24
-0
converter.c
dlls/windowscodecs/converter.c
+23
-0
regsvr.c
dlls/windowscodecs/regsvr.c
+1
-0
No files found.
dlls/windowscodecs/converter.c
View file @
9293ad7e
...
...
@@ -52,6 +52,7 @@ enum pixelformat {
format_32bppBGRA
,
format_48bppRGB
,
format_64bppRGBA
,
format_32bppCMYK
,
};
typedef
HRESULT
(
*
copyfunc
)(
struct
FormatConverter
*
This
,
const
WICRect
*
prc
,
...
...
@@ -673,6 +674,27 @@ static HRESULT copypixels_to_32bppBGRA(struct FormatConverter *This, const WICRe
return
res
;
}
return
S_OK
;
case
format_32bppCMYK
:
if
(
prc
)
{
HRESULT
res
;
UINT
x
,
y
;
res
=
IWICBitmapSource_CopyPixels
(
This
->
source
,
prc
,
cbStride
,
cbBufferSize
,
pbBuffer
);
if
(
FAILED
(
res
))
return
res
;
for
(
y
=
0
;
y
<
prc
->
Height
;
y
++
)
for
(
x
=
0
;
x
<
prc
->
Width
;
x
++
)
{
BYTE
*
pixel
=
pbBuffer
+
cbStride
*
y
+
4
*
x
;
BYTE
c
=
pixel
[
0
],
m
=
pixel
[
1
],
y
=
pixel
[
2
],
k
=
pixel
[
3
];
pixel
[
0
]
=
(
255
-
y
)
*
(
255
-
k
)
/
255
;
/* blue */
pixel
[
1
]
=
(
255
-
m
)
*
(
255
-
k
)
/
255
;
/* green */
pixel
[
2
]
=
(
255
-
c
)
*
(
255
-
k
)
/
255
;
/* red */
pixel
[
3
]
=
255
;
/* alpha */
}
}
return
S_OK
;
default:
return
WINCODEC_ERR_UNSUPPORTEDOPERATION
;
}
...
...
@@ -710,6 +732,7 @@ static const struct pixelformatinfo supported_formats[] = {
{
format_32bppBGRA
,
&
GUID_WICPixelFormat32bppBGRA
,
copypixels_to_32bppBGRA
},
{
format_48bppRGB
,
&
GUID_WICPixelFormat48bppRGB
,
NULL
},
{
format_64bppRGBA
,
&
GUID_WICPixelFormat64bppRGBA
,
NULL
},
{
format_32bppCMYK
,
&
GUID_WICPixelFormat32bppCMYK
,
NULL
},
{
0
}
};
...
...
dlls/windowscodecs/regsvr.c
View file @
9293ad7e
...
...
@@ -1231,6 +1231,7 @@ static GUID const * const converter_formats[] = {
&
GUID_WICPixelFormat32bppBGRA
,
&
GUID_WICPixelFormat48bppRGB
,
&
GUID_WICPixelFormat64bppRGBA
,
&
GUID_WICPixelFormat32bppCMYK
,
NULL
};
...
...
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