1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
|
diff --git a/filters/chalk/gmagick/kis_image_magick_converter.cc b/filters/chalk/gmagick/kis_image_magick_converter.cc
index 5bce37b..eea8000 100644
--- a/filters/chalk/gmagick/kis_image_magick_converter.cc
+++ b/filters/chalk/gmagick/kis_image_magick_converter.cc
@@ -182,6 +182,7 @@ namespace {
image -> addAnnotation(annotation);
}
+#if 0
for(int i = 0; i < src->generic_profiles; i++)
{
TQByteArray rawdata;
@@ -193,6 +194,7 @@ namespace {
image -> addAnnotation(annotation);
}
+#endif
const ImageAttribute* imgAttr = GetImageAttribute(src, NULL);
while(imgAttr)
@@ -480,7 +482,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 +536,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 +580,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 +610,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 +814,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 +849,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 +880,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;
|