From: cristy Date: Sat, 21 May 2011 21:33:06 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~7503 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=99327bb5b51d4c0fde083923b5faf984ff73c8f2;p=imagemagick --- diff --git a/coders/gif.c b/coders/gif.c index 9442ef869..2453568d2 100644 --- a/coders/gif.c +++ b/coders/gif.c @@ -446,9 +446,7 @@ static MagickBooleanType DecodeImage(Image *image,const ssize_t opacity) break; index=ConstrainColormapIndex(image,(size_t) c); SetIndexPixelComponent(indexes+x,index); - SetRedPixelComponent(q,image->colormap[(ssize_t) index].red); - SetGreenPixelComponent(q,image->colormap[(ssize_t) index].green); - SetBluePixelComponent(q,image->colormap[(ssize_t) index].blue); + SetRGBOPixelComponent(q,image->colormap+index); SetOpacityPixelComponent(q,(ssize_t) index == opacity ? TransparentOpacity : OpaqueOpacity); x++; diff --git a/coders/jbig.c b/coders/jbig.c index 96185f52d..3a0b5a0f2 100644 --- a/coders/jbig.c +++ b/coders/jbig.c @@ -238,9 +238,7 @@ static Image *ReadJBIGImage(const ImageInfo *image_info, if (bit == 8) bit=0; SetIndexPixelComponent(indexes+x,index); - SetRedPixelComponent(q,image->colormap[(ssize_t) index].red); - SetGreenPixelComponent(q,image->colormap[(ssize_t) index].green); - SetBluePixelComponent(q,image->colormap[(ssize_t) index].blue); + SetRGBOPixelComponent(q,image->colormap+index); q++; } if (SyncAuthenticPixels(image,exception) == MagickFalse) diff --git a/coders/jpeg.c b/coders/jpeg.c index 4ab629cfd..25e636bc1 100644 --- a/coders/jpeg.c +++ b/coders/jpeg.c @@ -1249,9 +1249,7 @@ static Image *ReadJPEGImage(const ImageInfo *image_info, pixel=(size_t) ((GETJSAMPLE(*p) ^ 0x80) << 4); index=ConstrainColormapIndex(image,pixel); SetIndexPixelComponent(indexes+x,index); - SetRedPixelComponent(q,image->colormap[(int) index].red); - SetGreenPixelComponent(q,image->colormap[(int) index].green); - SetBluePixelComponent(q,image->colormap[(int) index].blue); + SetRGBOPixelComponent(q,image->colormap+index); p++; q++; } @@ -1289,9 +1287,7 @@ static Image *ReadJPEGImage(const ImageInfo *image_info, { index=ConstrainColormapIndex(image,(size_t) GETJSAMPLE(*p)); SetIndexPixelComponent(indexes+x,index); - SetRedPixelComponent(q,image->colormap[(int) index].red); - SetGreenPixelComponent(q,image->colormap[(int) index].green); - SetBluePixelComponent(q,image->colormap[(int) index].blue); + SetRGBOPixelComponent(q,image->colormap+index); p++; q++; } diff --git a/coders/map.c b/coders/map.c index 0a5593fb9..dc21b7bc2 100644 --- a/coders/map.c +++ b/coders/map.c @@ -228,9 +228,7 @@ static Image *ReadMAPImage(const ImageInfo *image_info,ExceptionInfo *exception) p++; } SetIndexPixelComponent(indexes+x,index); - SetRedPixelComponent(q,image->colormap[(ssize_t) index].red); - SetGreenPixelComponent(q,image->colormap[(ssize_t) index].green); - SetBluePixelComponent(q,image->colormap[(ssize_t) index].blue); + SetRGBOPixelComponent(q,image->colormap+index); } if (SyncAuthenticPixels(image,exception) == MagickFalse) break; diff --git a/coders/palm.c b/coders/palm.c index faaa06f1a..439d73e85 100644 --- a/coders/palm.c +++ b/coders/palm.c @@ -494,9 +494,7 @@ static Image *ReadPALMImage(const ImageInfo *image_info, ThrowReaderException(CorruptImageError,"CorruptImage"); index=(IndexPacket) (mask-(((*ptr) & (mask << bit)) >> bit)); SetIndexPixelComponent(indexes+x,index); - SetRedPixelComponent(q,image->colormap[(ssize_t) index].red); - SetGreenPixelComponent(q,image->colormap[(ssize_t) index].green); - SetBluePixelComponent(q,image->colormap[(ssize_t) index].blue); + SetRGBOPixelComponent(q,image->colormap+index); if (bit) bit-=bits_per_pixel; else diff --git a/coders/psd.c b/coders/psd.c index da2b0a7d6..9739045b2 100644 --- a/coders/psd.c +++ b/coders/psd.c @@ -653,12 +653,8 @@ static MagickBooleanType ReadPSDLayer(Image *image,const size_t channels, SetIndexPixelComponent(indexes+x,ScaleQuantumToChar(pixel)); else SetIndexPixelComponent(indexes+x,ScaleQuantumToShort(pixel)); - SetRedPixelComponent(q,image->colormap[(ssize_t) - GetIndexPixelComponent(indexes+x)].red); - SetGreenPixelComponent(q,image->colormap[(ssize_t) - GetIndexPixelComponent(indexes+x)].green); - SetBluePixelComponent(q,image->colormap[(ssize_t) - GetIndexPixelComponent(indexes+x)].blue); + SetRGBOPixelComponent(q,image->colormap+ + GetIndexPixelComponent(indexes+x)); if (image->depth == 1) { ssize_t @@ -672,12 +668,8 @@ static MagickBooleanType ReadPSDLayer(Image *image,const size_t channels, { SetIndexPixelComponent(indexes+x,(((unsigned char) pixel) & (0x01 << (7-bit))) != 0 ? 0 : 255); - SetRedPixelComponent(q,image->colormap[(ssize_t) - GetIndexPixelComponent(indexes+x)].red); - SetGreenPixelComponent(q,image->colormap[(ssize_t) - GetIndexPixelComponent(indexes+x)].green); - SetBluePixelComponent(q,image->colormap[(ssize_t) - GetIndexPixelComponent(indexes+x)].blue); + SetRGBOPixelComponent(q,image->colormap+ + GetIndexPixelComponent(indexes+x)); q++; x++; } diff --git a/coders/wpg.c b/coders/wpg.c index ffd8fe8b5..d140a712e 100644 --- a/coders/wpg.c +++ b/coders/wpg.c @@ -297,9 +297,7 @@ static void InsertRow(unsigned char *p,ssize_t y,Image *image, int bpp) { index=((*p) & (0x80 >> bit) ? 0x01 : 0x00); SetIndexPixelComponent(indexes+x+bit,index); - SetRedPixelComponent(q,image->colormap[(int) index].red); - SetGreenPixelComponent(q,image->colormap[(int) index].green); - SetBluePixelComponent(q,image->colormap[(int) index].blue); + SetRGBOPixelComponent(q,image->colormap+index); q++; } p++; @@ -310,9 +308,7 @@ static void InsertRow(unsigned char *p,ssize_t y,Image *image, int bpp) { index=((*p) & (0x80 >> bit) ? 0x01 : 0x00); SetIndexPixelComponent(indexes+x+bit,index); - SetRedPixelComponent(q,image->colormap[(int) index].red); - SetGreenPixelComponent(q,image->colormap[(int) index].green); - SetBluePixelComponent(q,image->colormap[(int) index].blue); + SetRGBOPixelComponent(q,image->colormap+index); q++; } p++; @@ -331,27 +327,19 @@ static void InsertRow(unsigned char *p,ssize_t y,Image *image, int bpp) { index=ConstrainColormapIndex(image,(*p >> 6) & 0x3); SetIndexPixelComponent(indexes+x,index); - SetRedPixelComponent(q,image->colormap[(ssize_t) index].red); - SetGreenPixelComponent(q,image->colormap[(ssize_t) index].green); - SetBluePixelComponent(q,image->colormap[(ssize_t) index].blue); + SetRGBOPixelComponent(q,image->colormap+index); q++; index=ConstrainColormapIndex(image,(*p >> 4) & 0x3); SetIndexPixelComponent(indexes+x,index); - SetRedPixelComponent(q,image->colormap[(ssize_t) index].red); - SetGreenPixelComponent(q,image->colormap[(ssize_t) index].green); - SetBluePixelComponent(q,image->colormap[(ssize_t) index].blue); + SetRGBOPixelComponent(q,image->colormap+index); q++; index=ConstrainColormapIndex(image,(*p >> 2) & 0x3); SetIndexPixelComponent(indexes+x,index); - SetRedPixelComponent(q,image->colormap[(ssize_t) index].red); - SetGreenPixelComponent(q,image->colormap[(ssize_t) index].green); - SetBluePixelComponent(q,image->colormap[(ssize_t) index].blue); + SetRGBOPixelComponent(q,image->colormap+index); q++; index=ConstrainColormapIndex(image,(*p) & 0x3); SetIndexPixelComponent(indexes+x+1,index); - SetRedPixelComponent(q,image->colormap[(ssize_t) index].red); - SetGreenPixelComponent(q,image->colormap[(ssize_t) index].green); - SetBluePixelComponent(q,image->colormap[(ssize_t) index].blue); + SetRGBOPixelComponent(q,image->colormap+index); p++; q++; } @@ -359,31 +347,21 @@ static void InsertRow(unsigned char *p,ssize_t y,Image *image, int bpp) { index=ConstrainColormapIndex(image,(*p >> 6) & 0x3); SetIndexPixelComponent(indexes+x,index); - SetRedPixelComponent(q,image->colormap[(ssize_t) index].red); - SetGreenPixelComponent(q,image->colormap[(ssize_t) index].green); - SetBluePixelComponent(q,image->colormap[(ssize_t) index].blue); + SetRGBOPixelComponent(q,image->colormap+index); q++; if ((image->columns % 4) >= 1) { index=ConstrainColormapIndex(image,(*p >> 4) & 0x3); SetIndexPixelComponent(indexes+x,index); - SetRedPixelComponent(q,image->colormap[(ssize_t) index].red); - SetGreenPixelComponent(q,image->colormap[(ssize_t) - index].green); - SetBluePixelComponent(q,image->colormap[(ssize_t) index].blue); + SetRGBOPixelComponent(q,image->colormap+index); q++; if ((image->columns % 4) >= 2) { index=ConstrainColormapIndex(image,(*p >> 2) & 0x3); SetIndexPixelComponent(indexes+x,index); - SetRedPixelComponent(q,image->colormap[(ssize_t) - index].red); - SetGreenPixelComponent(q,image->colormap[(ssize_t) - index].green); - SetBluePixelComponent(q,image->colormap[(ssize_t) - index].blue); + SetRGBOPixelComponent(q,image->colormap+index); q++; } } @@ -404,15 +382,11 @@ static void InsertRow(unsigned char *p,ssize_t y,Image *image, int bpp) { index=ConstrainColormapIndex(image,(*p >> 4) & 0x0f); SetIndexPixelComponent(indexes+x,index); - SetRedPixelComponent(q,image->colormap[(ssize_t) index].red); - SetGreenPixelComponent(q,image->colormap[(ssize_t) index].green); - SetBluePixelComponent(q,image->colormap[(ssize_t) index].blue); + SetRGBOPixelComponent(q,image->colormap+index); q++; index=ConstrainColormapIndex(image,(*p) & 0x0f); SetIndexPixelComponent(indexes+x+1,index); - SetRedPixelComponent(q,image->colormap[(ssize_t) index].red); - SetGreenPixelComponent(q,image->colormap[(ssize_t) index].green); - SetBluePixelComponent(q,image->colormap[(ssize_t) index].blue); + SetRGBOPixelComponent(q,image->colormap+index); p++; q++; } @@ -420,9 +394,7 @@ static void InsertRow(unsigned char *p,ssize_t y,Image *image, int bpp) { index=ConstrainColormapIndex(image,(*p >> 4) & 0x0f); SetIndexPixelComponent(indexes+x,index); - SetRedPixelComponent(q,image->colormap[(ssize_t) index].red); - SetGreenPixelComponent(q,image->colormap[(ssize_t) index].green); - SetBluePixelComponent(q,image->colormap[(ssize_t) index].blue); + SetRGBOPixelComponent(q,image->colormap+index); p++; q++; } @@ -440,9 +412,7 @@ static void InsertRow(unsigned char *p,ssize_t y,Image *image, int bpp) { index=ConstrainColormapIndex(image,*p); SetIndexPixelComponent(indexes+x,index); - SetRedPixelComponent(q,image->colormap[(ssize_t) index].red); - SetGreenPixelComponent(q,image->colormap[(ssize_t) index].green); - SetBluePixelComponent(q,image->colormap[(ssize_t) index].blue); + SetRGBOPixelComponent(q,image->colormap+index); p++; q++; } diff --git a/coders/xwd.c b/coders/xwd.c index 5d2ec6d80..0ad00e3dd 100644 --- a/coders/xwd.c +++ b/coders/xwd.c @@ -478,9 +478,7 @@ static Image *ReadXWDImage(const ImageInfo *image_info,ExceptionInfo *exception) index=ConstrainColormapIndex(image,XGetPixel(ximage,(int) x, (int) y)); SetIndexPixelComponent(indexes+x,index); - SetRedPixelComponent(q,image->colormap[(ssize_t) index].red); - SetGreenPixelComponent(q,image->colormap[(ssize_t) index].green); - SetBluePixelComponent(q,image->colormap[(ssize_t) index].blue); + SetRGBOPixelComponent(q,image->colormap+index); q++; } if (SyncAuthenticPixels(image,exception) == MagickFalse) diff --git a/magick/colormap.c b/magick/colormap.c index 1b6247e89..1955fd80a 100644 --- a/magick/colormap.c +++ b/magick/colormap.c @@ -237,9 +237,7 @@ MagickExport MagickBooleanType CycleColormapImage(Image *image, if (index < 0) index+=(ssize_t) image->colors; SetIndexPixelComponent(indexes+x,index); - SetRedPixelComponent(q,image->colormap[index].red); - SetGreenPixelComponent(q,image->colormap[index].green); - SetBluePixelComponent(q,image->colormap[index].blue); + SetRGBOPixelComponent(q,image->colormap+index); q++; } if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse) @@ -380,9 +378,7 @@ MagickExport MagickBooleanType SortColormapByIntensity(Image *image) { index=(IndexPacket) pixels[(ssize_t) GetIndexPixelComponent(indexes+x)]; SetIndexPixelComponent(indexes+x,index); - SetRedPixelComponent(q,image->colormap[(ssize_t) index].red); - SetGreenPixelComponent(q,image->colormap[(ssize_t) index].green); - SetBluePixelComponent(q,image->colormap[(ssize_t) index].blue); + SetRGBOPixelComponent(q,image->colormap+index); } if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse) status=MagickFalse; diff --git a/magick/compress.c b/magick/compress.c index 1cde7f5ed..571ac9618 100644 --- a/magick/compress.c +++ b/magick/compress.c @@ -638,9 +638,7 @@ MagickExport MagickBooleanType HuffmanDecodeImage(Image *image) { index=(IndexPacket) (*p++); SetIndexPixelComponent(indexes+x,index); - SetRedPixelComponent(q,image->colormap[(ssize_t) index].red); - SetGreenPixelComponent(q,image->colormap[(ssize_t) index].green); - SetBluePixelComponent(q,image->colormap[(ssize_t) index].blue); + SetRGBOPixelComponent(q,image->colormap+index); } if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse) break; diff --git a/magick/deprecate.c b/magick/deprecate.c index 703ded272..710431503 100644 --- a/magick/deprecate.c +++ b/magick/deprecate.c @@ -5554,9 +5554,7 @@ MagickExport unsigned int RandomChannelThresholdImage(Image *image,const char threshold=(MagickRealType) QuantumRange*o4[(x%4)+4*(y%4)]; index=(IndexPacket) (intensity <= threshold ? 0 : 1); SetIndexPixelComponent(indexes+x,index); - SetRedPixelComponent(q,image->colormap[(ssize_t) index].red); - SetGreenPixelComponent(q,image->colormap[(ssize_t) index].green); - SetBluePixelComponent(q,image->colormap[(ssize_t) index].blue); + SetRGBOPixelComponent(q,image->colormap+index); q++; } } @@ -6623,9 +6621,7 @@ MagickExport unsigned int ThresholdImage(Image *image,const double threshold) index=(IndexPacket) ((MagickRealType) PixelIntensityToQuantum(q) <= threshold ? 0 : 1); SetIndexPixelComponent(indexes+x,index); - SetRedPixelComponent(q,image->colormap[(ssize_t) index].red); - SetGreenPixelComponent(q,image->colormap[(ssize_t) index].green); - SetBluePixelComponent(q,image->colormap[(ssize_t) index].blue); + SetRGBOPixelComponent(q,image->colormap+index); q++; } if (!SyncAuthenticPixels(image,&image->exception)) diff --git a/magick/quantize.c b/magick/quantize.c index 685466521..64d5e0755 100644 --- a/magick/quantize.c +++ b/magick/quantize.c @@ -610,9 +610,7 @@ static MagickBooleanType AssignImageColors(Image *image,CubeInfo *cube_info) SetIndexPixelComponent(indexes+x+i,index); if (cube.quantize_info->measure_error == MagickFalse) { - SetRedPixelComponent(q,image->colormap[index].red); - SetGreenPixelComponent(q,image->colormap[index].green); - SetBluePixelComponent(q,image->colormap[index].blue); + SetRGBPixelComponent(q,image->colormap+index); if (cube.associate_alpha != MagickFalse) SetOpacityPixelComponent(q,image->colormap[index].opacity); } @@ -1600,9 +1598,7 @@ static MagickBooleanType FloydSteinbergDither(Image *image,CubeInfo *cube_info) SetIndexPixelComponent(indexes+u,index); if (cube.quantize_info->measure_error == MagickFalse) { - SetRedPixelComponent(q+u,image->colormap[index].red); - SetGreenPixelComponent(q+u,image->colormap[index].green); - SetBluePixelComponent(q+u,image->colormap[index].blue); + SetRGBPixelComponent(q,image->colormap+index); if (cube.associate_alpha != MagickFalse) SetOpacityPixelComponent(q+u,image->colormap[index].opacity); } @@ -1823,9 +1819,7 @@ static MagickBooleanType RiemersmaDither(Image *image,CacheView *image_view, *indexes=(IndexPacket) index; if (cube_info->quantize_info->measure_error == MagickFalse) { - SetRedPixelComponent(q,image->colormap[index].red); - SetGreenPixelComponent(q,image->colormap[index].green); - SetBluePixelComponent(q,image->colormap[index].blue); + SetRGBPixelComponent(q,image->colormap+index); if (cube_info->associate_alpha != MagickFalse) SetOpacityPixelComponent(q,image->colormap[index].opacity); } diff --git a/magick/quantum-import.c b/magick/quantum-import.c index 4ce53fd36..8af104837 100644 --- a/magick/quantum-import.c +++ b/magick/quantum-import.c @@ -346,12 +346,8 @@ MagickExport size_t ImportQuantumPixels(Image *image,CacheView *image_view, 0x00 : 0x01); SetIndexPixelComponent(indexes+x+bit,PushColormapIndex(image, pixel,&range_exception)); - SetRedPixelComponent(q,image->colormap[(ssize_t) - GetIndexPixelComponent(indexes+x+bit)].red); - SetGreenPixelComponent(q,image->colormap[(ssize_t) - GetIndexPixelComponent(indexes+x+bit)].green); - SetBluePixelComponent(q,image->colormap[(ssize_t) - GetIndexPixelComponent(indexes+x+bit)].blue); + SetRGBOPixelComponent(q,image->colormap+ + GetIndexPixelComponent(indexes+x+bit)); q++; } p++; @@ -366,12 +362,8 @@ MagickExport size_t ImportQuantumPixels(Image *image,CacheView *image_view, 0x00 : 0x01); SetIndexPixelComponent(indexes+x+bit,PushColormapIndex(image,pixel, &range_exception)); - SetRedPixelComponent(q,image->colormap[(ssize_t) - GetIndexPixelComponent(indexes+x+bit)].red); - SetGreenPixelComponent(q,image->colormap[(ssize_t) - GetIndexPixelComponent(indexes+x+bit)].green); - SetBluePixelComponent(q,image->colormap[(ssize_t) - GetIndexPixelComponent(indexes+x+bit)].blue); + SetRGBOPixelComponent(q,image->colormap+ + GetIndexPixelComponent(indexes+x+bit)); q++; } break; @@ -386,12 +378,8 @@ MagickExport size_t ImportQuantumPixels(Image *image,CacheView *image_view, pixel=(unsigned char) ((*p >> 4) & 0xf); SetIndexPixelComponent(indexes+x,PushColormapIndex(image,pixel, &range_exception)); - SetRedPixelComponent(q,image->colormap[(ssize_t) - GetIndexPixelComponent(indexes+x)].red); - SetGreenPixelComponent(q,image->colormap[(ssize_t) - GetIndexPixelComponent(indexes+x)].green); - SetBluePixelComponent(q,image->colormap[(ssize_t) - GetIndexPixelComponent(indexes+x)].blue); + SetRGBOPixelComponent(q,image->colormap+ + GetIndexPixelComponent(indexes+x)); q++; pixel=(unsigned char) ((*p) & 0xf); SetIndexPixelComponent(indexes+x+1,PushColormapIndex(image,pixel, @@ -405,12 +393,8 @@ MagickExport size_t ImportQuantumPixels(Image *image,CacheView *image_view, pixel=(unsigned char) ((*p++ >> 4) & 0xf); SetIndexPixelComponent(indexes+x+bit,PushColormapIndex(image,pixel, &range_exception)); - SetRedPixelComponent(q,image->colormap[(ssize_t) - GetIndexPixelComponent(indexes+x+bit)].red); - SetGreenPixelComponent(q,image->colormap[(ssize_t) - GetIndexPixelComponent(indexes+x+bit)].green); - SetBluePixelComponent(q,image->colormap[(ssize_t) - GetIndexPixelComponent(indexes+x+bit)].blue); + SetRGBOPixelComponent(q,image->colormap+ + GetIndexPixelComponent(indexes+x+bit)); q++; } break; @@ -425,12 +409,8 @@ MagickExport size_t ImportQuantumPixels(Image *image,CacheView *image_view, p=PushCharPixel(p,&pixel); SetIndexPixelComponent(indexes+x,PushColormapIndex(image,pixel, &range_exception)); - SetRedPixelComponent(q,image->colormap[(ssize_t) - GetIndexPixelComponent(indexes+x)].red); - SetGreenPixelComponent(q,image->colormap[(ssize_t) - GetIndexPixelComponent(indexes+x)].green); - SetBluePixelComponent(q,image->colormap[(ssize_t) - GetIndexPixelComponent(indexes+x)].blue); + SetRGBOPixelComponent(q,image->colormap+ + GetIndexPixelComponent(indexes+x)); p+=quantum_info->pad; q++; } @@ -449,12 +429,8 @@ MagickExport size_t ImportQuantumPixels(Image *image,CacheView *image_view, SetIndexPixelComponent(indexes+x,PushColormapIndex(image, ClampToQuantum((MagickRealType) QuantumRange* HalfToSinglePrecision(pixel)),&range_exception)); - SetRedPixelComponent(q,image->colormap[(ssize_t) - GetIndexPixelComponent(indexes+x)].red); - SetGreenPixelComponent(q,image->colormap[(ssize_t) - GetIndexPixelComponent(indexes+x)].green); - SetBluePixelComponent(q,image->colormap[(ssize_t) - GetIndexPixelComponent(indexes+x)].blue); + SetRGBOPixelComponent(q,image->colormap+ + GetIndexPixelComponent(indexes+x)); p+=quantum_info->pad; q++; } @@ -465,12 +441,8 @@ MagickExport size_t ImportQuantumPixels(Image *image,CacheView *image_view, p=PushShortPixel(endian,p,&pixel); SetIndexPixelComponent(indexes+x,PushColormapIndex(image,pixel, &range_exception)); - SetRedPixelComponent(q,image->colormap[(ssize_t) - GetIndexPixelComponent(indexes+x)].red); - SetGreenPixelComponent(q,image->colormap[(ssize_t) - GetIndexPixelComponent(indexes+x)].green); - SetBluePixelComponent(q,image->colormap[(ssize_t) - GetIndexPixelComponent(indexes+x)].blue); + SetRGBOPixelComponent(q,image->colormap+ + GetIndexPixelComponent(indexes+x)); p+=quantum_info->pad; q++; } @@ -491,7 +463,8 @@ MagickExport size_t ImportQuantumPixels(Image *image,CacheView *image_view, p=PushFloatPixel(&quantum_state,p,&pixel); SetIndexPixelComponent(indexes+x,PushColormapIndex(image, ClampToQuantum(pixel),&range_exception)); - *q=image->colormap[(ssize_t) GetIndexPixelComponent(indexes+x)]; + SetRGBOPixelComponent(q,image->colormap+ + GetIndexPixelComponent(indexes+x)); p+=quantum_info->pad; q++; } @@ -502,7 +475,8 @@ MagickExport size_t ImportQuantumPixels(Image *image,CacheView *image_view, p=PushLongPixel(endian,p,&pixel); SetIndexPixelComponent(indexes+x,PushColormapIndex(image,pixel, &range_exception)); - *q=image->colormap[(ssize_t) GetIndexPixelComponent(indexes+x)]; + SetRGBOPixelComponent(q,image->colormap+ + GetIndexPixelComponent(indexes+x)); p+=quantum_info->pad; q++; } @@ -520,7 +494,8 @@ MagickExport size_t ImportQuantumPixels(Image *image,CacheView *image_view, p=PushDoublePixel(&quantum_state,p,&pixel); SetIndexPixelComponent(indexes+x,PushColormapIndex(image, ClampToQuantum(pixel),&range_exception)); - *q=image->colormap[(ssize_t) GetIndexPixelComponent(indexes+x)]; + SetRGBOPixelComponent(q,image->colormap+ + GetIndexPixelComponent(indexes+x)); p+=quantum_info->pad; q++; } @@ -534,7 +509,8 @@ MagickExport size_t ImportQuantumPixels(Image *image,CacheView *image_view, p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel); SetIndexPixelComponent(indexes+x,PushColormapIndex(image,pixel, &range_exception)); - *q=image->colormap[(ssize_t) GetIndexPixelComponent(indexes+x)]; + SetRGBOPixelComponent(q,image->colormap+ + GetIndexPixelComponent(indexes+x)); p+=quantum_info->pad; q++; } diff --git a/magick/threshold.c b/magick/threshold.c index 10fe87291..d3f49c2b4 100644 --- a/magick/threshold.c +++ b/magick/threshold.c @@ -1779,9 +1779,7 @@ MagickExport MagickBooleanType RandomThresholdImageChannel(Image *image, GetPseudoRandomValue(random_info[id])); index=(IndexPacket) (intensity <= threshold.index ? 0 : 1); SetIndexPixelComponent(indexes+x,index); - SetRedPixelComponent(q,image->colormap[(ssize_t) index].red); - SetGreenPixelComponent(q,image->colormap[(ssize_t) index].green); - SetBluePixelComponent(q,image->colormap[(ssize_t) index].blue); + SetRGBOPixelComponent(q,image->colormap+index); q++; } sync=SyncCacheViewAuthenticPixels(image_view,exception);