summaryrefslogtreecommitdiffstats
path: root/filters
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-01-11 17:32:13 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-01-11 17:32:13 -0600
commitc1904c6066b9d3c8391b851364c9cea7c7e51de4 (patch)
treef88e6bdb4848f880259faeacf7362ae8feb9658a /filters
parentc91e96258b6c127201397dd5309c4433655e63b2 (diff)
downloadkoffice-c1904c6066b9d3c8391b851364c9cea7c7e51de4.tar.gz
koffice-c1904c6066b9d3c8391b851364c9cea7c7e51de4.zip
Fix chalk graphicsmagick filter FTBFS
This closes Bug 353
Diffstat (limited to 'filters')
-rw-r--r--filters/chalk/gmagick/kis_image_magick_converter.cc54
1 files changed, 28 insertions, 26 deletions
diff --git a/filters/chalk/gmagick/kis_image_magick_converter.cc b/filters/chalk/gmagick/kis_image_magick_converter.cc
index 5bce37b2..2a49bede 100644
--- a/filters/chalk/gmagick/kis_image_magick_converter.cc
+++ b/filters/chalk/gmagick/kis_image_magick_converter.cc
@@ -182,6 +182,8 @@ namespace {
image -> addAnnotation(annotation);
}
+/* This code is no longer needed or supported by graphicsmagick */
+#if 0
for(int i = 0; i < src->generic_profiles; i++)
{
TQByteArray rawdata;
@@ -193,6 +195,7 @@ namespace {
image -> addAnnotation(annotation);
}
+#endif
const ImageAttribute* imgAttr = GetImageAttribute(src, NULL);
while(imgAttr)
@@ -480,7 +483,7 @@ KisImageBuilder_Result KisImageMagickConverter::decode(const KURL& uri, bool isB
TQ_UINT8 opacity = OPACITY_OPAQUE;
const ImageAttribute * attr = GetImageAttribute(image, "[layer-opacity]");
if (attr != 0) {
- opacity = TQ_UINT8_MAX - Downscale(TQString(attr->value).toInt());
+ opacity = TQ_UINT8_MAX - ScaleQuantumToChar(TQString(attr->value).toInt());
}
KisPaintLayerSP layer = 0;
@@ -534,17 +537,17 @@ KisImageBuilder_Result KisImageMagickConverter::decode(const KURL& uri, bool isB
while (!hiter.isDone())
{
TQ_UINT8 *ptr= hiter.rawData();
- *(ptr++) = Downscale(pp->red); // cyan
- *(ptr++) = Downscale(pp->green); // magenta
- *(ptr++) = Downscale(pp->blue); // yellow
- *(ptr++) = Downscale(indexes[x]); // Black
+ *(ptr++) = ScaleQuantumToChar(pp->red); // cyan
+ *(ptr++) = ScaleQuantumToChar(pp->green); // magenta
+ *(ptr++) = ScaleQuantumToChar(pp->blue); // yellow
+ *(ptr++) = ScaleQuantumToChar(indexes[x]); // Black
// XXX: Warning! This ifdef messes up the paren matching big-time!
#ifdef HAVE_MAGICK6
if (image->matte != MagickFalse) {
#else
if (image->matte == true) {
#endif
- *(ptr++) = OPACITY_OPAQUE - Downscale(pp->opacity);
+ *(ptr++) = OPACITY_OPAQUE - ScaleQuantumToChar(pp->opacity);
}
else {
*(ptr++) = OPACITY_OPAQUE;
@@ -578,10 +581,10 @@ KisImageBuilder_Result KisImageMagickConverter::decode(const KURL& uri, bool isB
{
TQ_UINT8 *ptr= hiter.rawData();
// XXX: not colorstrategy and bitdepth independent
- *(ptr++) = Downscale(pp->blue);
- *(ptr++) = Downscale(pp->green);
- *(ptr++) = Downscale(pp->red);
- *(ptr++) = OPACITY_OPAQUE - Downscale(pp->opacity);
+ *(ptr++) = ScaleQuantumToChar(pp->blue);
+ *(ptr++) = ScaleQuantumToChar(pp->green);
+ *(ptr++) = ScaleQuantumToChar(pp->red);
+ *(ptr++) = OPACITY_OPAQUE - ScaleQuantumToChar(pp->opacity);
pp++;
++hiter;
@@ -608,8 +611,8 @@ KisImageBuilder_Result KisImageMagickConverter::decode(const KURL& uri, bool isB
{
TQ_UINT8 *ptr= hiter.rawData();
// XXX: not colorstrategy and bitdepth independent
- *(ptr++) = Downscale(pp->blue);
- *(ptr++) = OPACITY_OPAQUE - Downscale(pp->opacity);
+ *(ptr++) = ScaleQuantumToChar(pp->blue);
+ *(ptr++) = OPACITY_OPAQUE - ScaleQuantumToChar(pp->opacity);
pp++;
++hiter;
@@ -812,13 +815,12 @@ KisImageBuilder_Result KisImageMagickConverter::decode(const KURL& uri, bool isB
while (!it.isDone()) {
TQ_UINT8 * d = it.rawData();
- pp -> red = Upscale(d[PIXEL_CYAN]);
- pp -> green = Upscale(d[PIXEL_MAGENTA]);
- pp -> blue = Upscale(d[PIXEL_YELLOW]);
+ pp -> red = ScaleCharToQuantum(d[PIXEL_CYAN]);
+ pp -> green = ScaleCharToQuantum(d[PIXEL_MAGENTA]);
+ pp -> blue = ScaleCharToQuantum(d[PIXEL_YELLOW]);
if (alpha)
- pp -> opacity = Upscale(OPACITY_OPAQUE - d[PIXEL_CMYK_ALPHA]);
-
- indexes[x]= Upscale(d[PIXEL_BLACK]);
+ pp -> opacity = ScaleCharToQuantum(OPACITY_OPAQUE - d[PIXEL_CMYK_ALPHA]);
+ indexes[x]= ScaleCharToQuantum(d[PIXEL_BLACK]);
x++;
pp++;
@@ -848,11 +850,11 @@ KisImageBuilder_Result KisImageMagickConverter::decode(const KURL& uri, bool isB
while (!it.isDone()) {
TQ_UINT8 * d = it.rawData();
- pp -> red = Upscale(d[PIXEL_RED]);
- pp -> green = Upscale(d[PIXEL_GREEN]);
- pp -> blue = Upscale(d[PIXEL_BLUE]);
+ pp -> red = ScaleCharToQuantum(d[PIXEL_RED]);
+ pp -> green = ScaleCharToQuantum(d[PIXEL_GREEN]);
+ pp -> blue = ScaleCharToQuantum(d[PIXEL_BLUE]);
if (alpha)
- pp -> opacity = Upscale(OPACITY_OPAQUE - d[PIXEL_ALPHA]);
+ pp -> opacity = ScaleCharToQuantum(OPACITY_OPAQUE - d[PIXEL_ALPHA]);
pp++;
++it;
@@ -879,11 +881,11 @@ KisImageBuilder_Result KisImageMagickConverter::decode(const KURL& uri, bool isB
else {
while (!it.isDone()) {
TQ_UINT8 * d = it.rawData();
- pp -> red = Upscale(d[PIXEL_GRAY]);
- pp -> green = Upscale(d[PIXEL_GRAY]);
- pp -> blue = Upscale(d[PIXEL_GRAY]);
+ pp -> red = ScaleCharToQuantum(d[PIXEL_GRAY]);
+ pp -> green = ScaleCharToQuantum(d[PIXEL_GRAY]);
+ pp -> blue = ScaleCharToQuantum(d[PIXEL_GRAY]);
if (alpha)
- pp -> opacity = Upscale(OPACITY_OPAQUE - d[PIXEL_GRAY_ALPHA]);
+ pp -> opacity = ScaleCharToQuantum(OPACITY_OPAQUE - d[PIXEL_GRAY_ALPHA]);
pp++;
++it;