Commit 37840827 authored by Thomas Freitag's avatar Thomas Freitag Committed by Albert Astals Cid

Ignore the alternateSpace and tintTransform

As a reasonable compromise in my eyes this new patch
now also checks the alternate colorspace, and if this
is DeviceGray in case of a separation colorspace with
name black this patch treats is as if it is really a
DeviceGray and so ignore tintTransform and alternate
colorspace just in this case when using getGray() and getRGB().

Bug #92381
parent 72f0ea4f
......@@ -18,7 +18,7 @@
// Copyright (C) 2006, 2010 Carlos Garcia Campos <carlosgc@gnome.org>
// Copyright (C) 2006-2015 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2009, 2012 Koji Otani <sho@bbr.jp>
// Copyright (C) 2009, 2011-2014 Thomas Freitag <Thomas.Freitag@alfa.de>
// Copyright (C) 2009, 2011-2015 Thomas Freitag <Thomas.Freitag@alfa.de>
// Copyright (C) 2009 Christian Persch <chpe@gnome.org>
// Copyright (C) 2010 Paweł Wiejacha <pawel.wiejacha@gmail.com>
// Copyright (C) 2010 Christian Feuersänger <cfeuersaenger@googlemail.com>
......@@ -2864,12 +2864,16 @@ void GfxSeparationColorSpace::getGray(GfxColor *color, GfxGray *gray) {
GfxColor color2;
int i;
x = colToDbl(color->c[0]);
func->transform(&x, c);
for (i = 0; i < alt->getNComps(); ++i) {
color2.c[i] = dblToCol(c[i]);
if (alt->getMode() == csDeviceGray && name->cmp("Black") == 0) {
*gray = clip01(gfxColorComp1 - color->c[0]);
} else {
x = colToDbl(color->c[0]);
func->transform(&x, c);
for (i = 0; i < alt->getNComps(); ++i) {
color2.c[i] = dblToCol(c[i]);
}
alt->getGray(&color2, gray);
}
alt->getGray(&color2, gray);
}
void GfxSeparationColorSpace::getRGB(GfxColor *color, GfxRGB *rgb) {
......@@ -2878,12 +2882,18 @@ void GfxSeparationColorSpace::getRGB(GfxColor *color, GfxRGB *rgb) {
GfxColor color2;
int i;
x = colToDbl(color->c[0]);
func->transform(&x, c);
for (i = 0; i < alt->getNComps(); ++i) {
color2.c[i] = dblToCol(c[i]);
if (alt->getMode() == csDeviceGray && name->cmp("Black") == 0) {
rgb->r = clip01(gfxColorComp1 - color->c[0]);
rgb->g = clip01(gfxColorComp1 - color->c[0]);
rgb->b = clip01(gfxColorComp1 - color->c[0]);
} else {
x = colToDbl(color->c[0]);
func->transform(&x, c);
for (i = 0; i < alt->getNComps(); ++i) {
color2.c[i] = dblToCol(c[i]);
}
alt->getRGB(&color2, rgb);
}
alt->getRGB(&color2, rgb);
}
void GfxSeparationColorSpace::getCMYK(GfxColor *color, GfxCMYK *cmyk) {
......@@ -2892,12 +2902,34 @@ void GfxSeparationColorSpace::getCMYK(GfxColor *color, GfxCMYK *cmyk) {
GfxColor color2;
int i;
x = colToDbl(color->c[0]);
func->transform(&x, c);
for (i = 0; i < alt->getNComps(); ++i) {
color2.c[i] = dblToCol(c[i]);
if (name->cmp("Black") == 0) {
cmyk->c = 0;
cmyk->m = 0;
cmyk->y = 0;
cmyk->k = color->c[0];
} else if (name->cmp("Cyan") == 0) {
cmyk->c = color->c[0];
cmyk->m = 0;
cmyk->y = 0;
cmyk->k = 0;
} else if (name->cmp("Magenta") == 0) {
cmyk->c = 0;
cmyk->m = color->c[0];
cmyk->y = 0;
cmyk->k = 0;
} else if (name->cmp("Yellow") == 0) {
cmyk->c = 0;
cmyk->m = 0;
cmyk->y = color->c[0];
cmyk->k = 0;
} else {
x = colToDbl(color->c[0]);
func->transform(&x, c);
for (i = 0; i < alt->getNComps(); ++i) {
color2.c[i] = dblToCol(c[i]);
}
alt->getCMYK(&color2, cmyk);
}
alt->getCMYK(&color2, cmyk);
}
void GfxSeparationColorSpace::getDeviceN(GfxColor *color, GfxColor *deviceN) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment