Convert CMYK to RGB like Google Chrome

This commit is contained in:
Alexander 2017-08-28 17:11:08 +03:00
parent c7136f7ff8
commit efb0915b19

View File

@ -536,12 +536,15 @@ rgb2cmyk(UINT8* out, const UINT8* in, int xsize)
static void
cmyk2rgb(UINT8* out, const UINT8* in, int xsize)
{
int x;
for (x = 0; x < xsize; x++, in += 4) {
*out++ = CLIP(255 - (in[0] + in[3]));
*out++ = CLIP(255 - (in[1] + in[3]));
*out++ = CLIP(255 - (in[2] + in[3]));
*out++ = 255;
int x, nk, tmp;
for (x = 0; x < xsize; x++) {
nk = 255 - in[3];
out[0] = CLIP(nk - MULDIV255(in[0], nk, tmp));
out[1] = CLIP(nk - MULDIV255(in[1], nk, tmp));
out[2] = CLIP(nk - MULDIV255(in[2], nk, tmp));
out[3] = 255;
out += 4;
in += 4;
}
}