|
Lines 182-187
namespace {
Link Here
|
| 182 |
|
182 |
|
| 183 |
image -> addAnnotation(annotation); |
183 |
image -> addAnnotation(annotation); |
| 184 |
} |
184 |
} |
|
|
185 |
// #if 0 |
| 185 |
for(int i = 0; i < src->generic_profiles; i++) |
186 |
for(int i = 0; i < src->generic_profiles; i++) |
| 186 |
{ |
187 |
{ |
| 187 |
TQByteArray rawdata; |
188 |
TQByteArray rawdata; |
|
Lines 193-198
namespace {
Link Here
|
| 193 |
|
194 |
|
| 194 |
image -> addAnnotation(annotation); |
195 |
image -> addAnnotation(annotation); |
| 195 |
} |
196 |
} |
|
|
197 |
// #endif |
| 196 |
|
198 |
|
| 197 |
const ImageAttribute* imgAttr = GetImageAttribute(src, NULL); |
199 |
const ImageAttribute* imgAttr = GetImageAttribute(src, NULL); |
| 198 |
while(imgAttr) |
200 |
while(imgAttr) |
|
Lines 480-486
KisImageBuilder_Result KisImageMagickConverter::decode(const KURL& uri, bool isB
Link Here
|
| 480 |
TQ_UINT8 opacity = OPACITY_OPAQUE; |
482 |
TQ_UINT8 opacity = OPACITY_OPAQUE; |
| 481 |
const ImageAttribute * attr = GetImageAttribute(image, "[layer-opacity]"); |
483 |
const ImageAttribute * attr = GetImageAttribute(image, "[layer-opacity]"); |
| 482 |
if (attr != 0) { |
484 |
if (attr != 0) { |
| 483 |
opacity = TQ_UINT8_MAX - Downscale(TQString(attr->value).toInt()); |
485 |
opacity = TQ_UINT8_MAX - ScaleQuantumToChar(TQString(attr->value).toInt()); |
| 484 |
} |
486 |
} |
| 485 |
|
487 |
|
| 486 |
KisPaintLayerSP layer = 0; |
488 |
KisPaintLayerSP layer = 0; |
|
Lines 534-550
KisImageBuilder_Result KisImageMagickConverter::decode(const KURL& uri, bool isB
Link Here
|
| 534 |
while (!hiter.isDone()) |
536 |
while (!hiter.isDone()) |
| 535 |
{ |
537 |
{ |
| 536 |
TQ_UINT8 *ptr= hiter.rawData(); |
538 |
TQ_UINT8 *ptr= hiter.rawData(); |
| 537 |
*(ptr++) = Downscale(pp->red); // cyan |
539 |
*(ptr++) = ScaleQuantumToChar(pp->red); // cyan |
| 538 |
*(ptr++) = Downscale(pp->green); // magenta |
540 |
*(ptr++) = ScaleQuantumToChar(pp->green); // magenta |
| 539 |
*(ptr++) = Downscale(pp->blue); // yellow |
541 |
*(ptr++) = ScaleQuantumToChar(pp->blue); // yellow |
| 540 |
*(ptr++) = Downscale(indexes[x]); // Black |
542 |
*(ptr++) = ScaleQuantumToChar(indexes[x]); // Black |
| 541 |
// XXX: Warning! This ifdef messes up the paren matching big-time! |
543 |
// XXX: Warning! This ifdef messes up the paren matching big-time! |
| 542 |
#ifdef HAVE_MAGICK6 |
544 |
#ifdef HAVE_MAGICK6 |
| 543 |
if (image->matte != MagickFalse) { |
545 |
if (image->matte != MagickFalse) { |
| 544 |
#else |
546 |
#else |
| 545 |
if (image->matte == true) { |
547 |
if (image->matte == true) { |
| 546 |
#endif |
548 |
#endif |
| 547 |
*(ptr++) = OPACITY_OPAQUE - Downscale(pp->opacity); |
549 |
*(ptr++) = OPACITY_OPAQUE - ScaleQuantumToChar(pp->opacity); |
| 548 |
} |
550 |
} |
| 549 |
else { |
551 |
else { |
| 550 |
*(ptr++) = OPACITY_OPAQUE; |
552 |
*(ptr++) = OPACITY_OPAQUE; |
|
Lines 578-587
KisImageBuilder_Result KisImageMagickConverter::decode(const KURL& uri, bool isB
Link Here
|
| 578 |
{ |
580 |
{ |
| 579 |
TQ_UINT8 *ptr= hiter.rawData(); |
581 |
TQ_UINT8 *ptr= hiter.rawData(); |
| 580 |
// XXX: not colorstrategy and bitdepth independent |
582 |
// XXX: not colorstrategy and bitdepth independent |
| 581 |
*(ptr++) = Downscale(pp->blue); |
583 |
*(ptr++) = ScaleQuantumToChar(pp->blue); |
| 582 |
*(ptr++) = Downscale(pp->green); |
584 |
*(ptr++) = ScaleQuantumToChar(pp->green); |
| 583 |
*(ptr++) = Downscale(pp->red); |
585 |
*(ptr++) = ScaleQuantumToChar(pp->red); |
| 584 |
*(ptr++) = OPACITY_OPAQUE - Downscale(pp->opacity); |
586 |
*(ptr++) = OPACITY_OPAQUE - ScaleQuantumToChar(pp->opacity); |
| 585 |
|
587 |
|
| 586 |
pp++; |
588 |
pp++; |
| 587 |
++hiter; |
589 |
++hiter; |
|
Lines 608-615
KisImageBuilder_Result KisImageMagickConverter::decode(const KURL& uri, bool isB
Link Here
|
| 608 |
{ |
610 |
{ |
| 609 |
TQ_UINT8 *ptr= hiter.rawData(); |
611 |
TQ_UINT8 *ptr= hiter.rawData(); |
| 610 |
// XXX: not colorstrategy and bitdepth independent |
612 |
// XXX: not colorstrategy and bitdepth independent |
| 611 |
*(ptr++) = Downscale(pp->blue); |
613 |
*(ptr++) = ScaleQuantumToChar(pp->blue); |
| 612 |
*(ptr++) = OPACITY_OPAQUE - Downscale(pp->opacity); |
614 |
*(ptr++) = OPACITY_OPAQUE - ScaleQuantumToChar(pp->opacity); |
| 613 |
|
615 |
|
| 614 |
pp++; |
616 |
pp++; |
| 615 |
++hiter; |
617 |
++hiter; |
|
Lines 812-824
KisImageBuilder_Result KisImageMagickConverter::decode(const KURL& uri, bool isB
Link Here
|
| 812 |
while (!it.isDone()) { |
814 |
while (!it.isDone()) { |
| 813 |
|
815 |
|
| 814 |
TQ_UINT8 * d = it.rawData(); |
816 |
TQ_UINT8 * d = it.rawData(); |
| 815 |
pp -> red = Upscale(d[PIXEL_CYAN]); |
817 |
pp -> red = ScaleCharToQuantum(d[PIXEL_CYAN]); |
| 816 |
pp -> green = Upscale(d[PIXEL_MAGENTA]); |
818 |
pp -> green = ScaleCharToQuantum(d[PIXEL_MAGENTA]); |
| 817 |
pp -> blue = Upscale(d[PIXEL_YELLOW]); |
819 |
pp -> blue = ScaleCharToQuantum(d[PIXEL_YELLOW]); |
| 818 |
if (alpha) |
820 |
if (alpha) |
| 819 |
pp -> opacity = Upscale(OPACITY_OPAQUE - d[PIXEL_CMYK_ALPHA]); |
821 |
pp -> opacity = ScaleCharToQuantum(OPACITY_OPAQUE - d[PIXEL_CMYK_ALPHA]); |
| 820 |
|
822 |
indexes[x]= ScaleCharToQuantum(d[PIXEL_BLACK]); |
| 821 |
indexes[x]= Upscale(d[PIXEL_BLACK]); |
|
|
| 822 |
|
823 |
|
| 823 |
x++; |
824 |
x++; |
| 824 |
pp++; |
825 |
pp++; |
|
Lines 848-858
KisImageBuilder_Result KisImageMagickConverter::decode(const KURL& uri, bool isB
Link Here
|
| 848 |
while (!it.isDone()) { |
849 |
while (!it.isDone()) { |
| 849 |
|
850 |
|
| 850 |
TQ_UINT8 * d = it.rawData(); |
851 |
TQ_UINT8 * d = it.rawData(); |
| 851 |
pp -> red = Upscale(d[PIXEL_RED]); |
852 |
pp -> red = ScaleCharToQuantum(d[PIXEL_RED]); |
| 852 |
pp -> green = Upscale(d[PIXEL_GREEN]); |
853 |
pp -> green = ScaleCharToQuantum(d[PIXEL_GREEN]); |
| 853 |
pp -> blue = Upscale(d[PIXEL_BLUE]); |
854 |
pp -> blue = ScaleCharToQuantum(d[PIXEL_BLUE]); |
| 854 |
if (alpha) |
855 |
if (alpha) |
| 855 |
pp -> opacity = Upscale(OPACITY_OPAQUE - d[PIXEL_ALPHA]); |
856 |
pp -> opacity = ScaleCharToQuantum(OPACITY_OPAQUE - d[PIXEL_ALPHA]); |
| 856 |
|
857 |
|
| 857 |
pp++; |
858 |
pp++; |
| 858 |
++it; |
859 |
++it; |
|
Lines 879-889
KisImageBuilder_Result KisImageMagickConverter::decode(const KURL& uri, bool isB
Link Here
|
| 879 |
else { |
880 |
else { |
| 880 |
while (!it.isDone()) { |
881 |
while (!it.isDone()) { |
| 881 |
TQ_UINT8 * d = it.rawData(); |
882 |
TQ_UINT8 * d = it.rawData(); |
| 882 |
pp -> red = Upscale(d[PIXEL_GRAY]); |
883 |
pp -> red = ScaleCharToQuantum(d[PIXEL_GRAY]); |
| 883 |
pp -> green = Upscale(d[PIXEL_GRAY]); |
884 |
pp -> green = ScaleCharToQuantum(d[PIXEL_GRAY]); |
| 884 |
pp -> blue = Upscale(d[PIXEL_GRAY]); |
885 |
pp -> blue = ScaleCharToQuantum(d[PIXEL_GRAY]); |
| 885 |
if (alpha) |
886 |
if (alpha) |
| 886 |
pp -> opacity = Upscale(OPACITY_OPAQUE - d[PIXEL_GRAY_ALPHA]); |
887 |
pp -> opacity = ScaleCharToQuantum(OPACITY_OPAQUE - d[PIXEL_GRAY_ALPHA]); |
| 887 |
|
888 |
|
| 888 |
pp++; |
889 |
pp++; |
| 889 |
++it; |
890 |
++it; |