Skip to content

Commit

Permalink
Include CMYK to RGB convert as unpacker
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Oct 6, 2023
1 parent 787daa9 commit b8c3065
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/libImaging/Convert.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down
2 changes: 2 additions & 0 deletions src/libImaging/Convert.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
extern void
cmyk2rgb(UINT8 *out, const UINT8 *in, int xsize);
15 changes: 1 addition & 14 deletions src/libImaging/Unpack.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
*/

#include "Imaging.h"
#include "Convert.h"

#define R 0
#define G 1
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b8c3065

Please sign in to comment.