Include CMYK to RGB convert as unpacker

This commit is contained in:
Andrew Murray 2023-10-06 16:05:03 +11:00
parent 787daa9f19
commit b8c30655cc
3 changed files with 4 additions and 15 deletions

View File

@ -564,7 +564,7 @@ rgb2cmyk(UINT8 *out, const UINT8 *in, int xsize) {
} }
} }
static void void
cmyk2rgb(UINT8 *out, const UINT8 *in, int xsize) { cmyk2rgb(UINT8 *out, const UINT8 *in, int xsize) {
int x, nk, tmp; int x, nk, tmp;
for (x = 0; x < xsize; x++) { for (x = 0; x < xsize; x++) {

2
src/libImaging/Convert.h Normal file
View File

@ -0,0 +1,2 @@
extern void
cmyk2rgb(UINT8 *out, const UINT8 *in, int xsize);

View File

@ -31,6 +31,7 @@
*/ */
#include "Imaging.h" #include "Imaging.h"
#include "Convert.h"
#define R 0 #define R 0
#define G 1 #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 */ /* Unpack to "RGBA" image */
static void static void