mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-11 04:07:21 +03:00
Include CMYK to RGB convert as unpacker
This commit is contained in:
parent
787daa9f19
commit
b8c30655cc
|
@ -564,7 +564,7 @@ rgb2cmyk(UINT8 *out, const UINT8 *in, int xsize) {
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
void
|
||||
cmyk2rgb(UINT8 *out, const UINT8 *in, int xsize) {
|
||||
int x, nk, tmp;
|
||||
for (x = 0; x < xsize; x++) {
|
||||
|
|
2
src/libImaging/Convert.h
Normal file
2
src/libImaging/Convert.h
Normal file
|
@ -0,0 +1,2 @@
|
|||
extern void
|
||||
cmyk2rgb(UINT8 *out, const UINT8 *in, int xsize);
|
|
@ -31,6 +31,7 @@
|
|||
*/
|
||||
|
||||
#include "Imaging.h"
|
||||
#include "Convert.h"
|
||||
|
||||
#define R 0
|
||||
#define G 1
|
||||
|
@ -813,20 +814,6 @@ ImagingUnpackXBGR(UINT8 *_out, const UINT8 *in, int pixels) {
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
cmyk2rgb(UINT8 *_out, const UINT8 *in, int pixels) {
|
||||
int i, nk, tmp;
|
||||
for (i = 0; i < pixels; i++) {
|
||||
nk = 255 - in[3];
|
||||
_out[0] = CLIP8(nk - MULDIV255(in[0], nk, tmp));
|
||||
_out[1] = CLIP8(nk - MULDIV255(in[1], nk, tmp));
|
||||
_out[2] = CLIP8(nk - MULDIV255(in[2], nk, tmp));
|
||||
_out[3] = 255;
|
||||
_out += 4;
|
||||
in += 4;
|
||||
}
|
||||
}
|
||||
|
||||
/* Unpack to "RGBA" image */
|
||||
|
||||
static void
|
||||
|
|
Loading…
Reference in New Issue
Block a user