% August 2009 %
% %
% %
-% Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2014 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
((ScaleQuantumToChar(ClampToQuantum(pixel->red)) >> index) & 0x01) |
((ScaleQuantumToChar(ClampToQuantum(pixel->green)) >> index) & 0x01) << 1 |
((ScaleQuantumToChar(ClampToQuantum(pixel->blue)) >> index) & 0x01) << 2);
- if (image->matte != MagickFalse)
+ if (image->alpha_trait == BlendPixelTrait)
id|=((ScaleQuantumToChar(ClampToQuantum(pixel->alpha)) >> index) &
0x01) << 3;
return(id);
}
GetPixelInfo(image,&pixel);
GetPixelInfo(image,&target);
- image_view=AcquireCacheView(image);
+ image_view=AcquireVirtualCacheView(image,exception);
for (y=0; y < (ssize_t) image->rows; y++)
{
p=GetCacheViewVirtualPixels(image_view,0,y,image->columns,1,exception);
image->filename);
return(0);
}
- node_info->list[i].red=GetPixelRed(image,p);
- node_info->list[i].green=GetPixelGreen(image,p);
- node_info->list[i].blue=GetPixelBlue(image,p);
+ node_info->list[i]=pixel;
+ node_info->list[i].red=(double) GetPixelRed(image,p);
+ node_info->list[i].green=(double) GetPixelGreen(image,p);
+ node_info->list[i].blue=(double) GetPixelBlue(image,p);
if (image->colorspace == CMYKColorspace)
- node_info->list[i].black=GetPixelBlack(image,p);
- node_info->list[i].alpha=GetPixelAlpha(image,p);
+ node_info->list[i].black=(double) GetPixelBlack(image,p);
+ node_info->list[i].alpha=(double) GetPixelAlpha(image,p);
node_info->list[i].count=1;
node_info->number_unique++;
cube_info->colors++;
/*
Traverse any children.
*/
- number_children=image->matte == MagickFalse ? 8UL : 16UL;
+ number_children=image->alpha_trait != BlendPixelTrait ? 8UL : 16UL;
for (i=0; i < (ssize_t) number_children; i++)
if (node_info->child[i] != (NodeInfo *) NULL)
DefineImageHistogram(image,node_info->child[i],histogram);
p=node_info->list;
for (i=0; i < (ssize_t) node_info->number_unique; i++)
{
- (*histogram)->red=p->red;
- (*histogram)->green=p->green;
- (*histogram)->blue=p->blue;
- (*histogram)->black=p->black;
- (*histogram)->alpha=p->alpha;
- (*histogram)->count=p->count;
+ **histogram=(*p);
(*histogram)++;
p++;
}
/*
Traverse any children.
*/
- number_children=image->matte == MagickFalse ? 8UL : 16UL;
+ number_children=image->alpha_trait != BlendPixelTrait ? 8UL : 16UL;
for (i=0; i < (ssize_t) number_children; i++)
if (node_info->child[i] != (NodeInfo *) NULL)
DestroyColorCube(image,node_info->child[i]);
}
GetPixelInfo(image,&pixel);
GetPixelInfo(image,&target);
- image_view=AcquireCacheView(image);
+ image_view=AcquireVirtualCacheView(image,exception);
for (y=0; y < (ssize_t) image->rows; y++)
{
p=GetCacheViewVirtualPixels(image_view,0,y,image->columns,1,exception);
image->filename);
break;
}
- node_info->list[i].red=GetPixelRed(image,p);
- node_info->list[i].green=GetPixelGreen(image,p);
- node_info->list[i].blue=GetPixelBlue(image,p);
+ node_info->list[i].red=(double) GetPixelRed(image,p);
+ node_info->list[i].green=(double) GetPixelGreen(image,p);
+ node_info->list[i].blue=(double) GetPixelBlue(image,p);
if (image->colorspace == CMYKColorspace)
- node_info->list[i].black=GetPixelBlack(image,p);
- node_info->list[i].alpha=GetPixelAlpha(image,p);
+ node_info->list[i].black=(double) GetPixelBlack(image,p);
+ node_info->list[i].alpha=(double) GetPixelAlpha(image,p);
node_info->list[i].count=1;
node_info->number_unique++;
cube_info->colors++;
}
GetPixelInfo(image,&pixel);
GetPixelInfo(image,&target);
- image_view=AcquireCacheView(image);
+ image_view=AcquireVirtualCacheView(image,exception);
for (y=0; y < (ssize_t) image->rows; y++)
{
p=GetCacheViewVirtualPixels(image_view,0,y,image->columns,1,exception);
image->filename);
break;
}
- node_info->list[i].red=GetPixelRed(image,p);
- node_info->list[i].green=GetPixelGreen(image,p);
- node_info->list[i].blue=GetPixelBlue(image,p);
+ node_info->list[i]=pixel;
+ node_info->list[i].red=(double) GetPixelRed(image,p);
+ node_info->list[i].green=(double) GetPixelGreen(image,p);
+ node_info->list[i].blue=(double) GetPixelBlue(image,p);
if (image->colorspace == CMYKColorspace)
- node_info->list[i].black=GetPixelBlack(image,p);
- node_info->list[i].alpha=GetPixelAlpha(image,p);
+ node_info->list[i].black=(double) GetPixelBlack(image,p);
+ node_info->list[i].alpha=(double) GetPixelAlpha(image,p);
node_info->list[i].count=1;
node_info->number_unique++;
cube_info->colors++;
ChannelType
channel_mask;
- PixelTrait
- traits;
-
- traits=GetPixelChannelMapTraits(image,i);
+ PixelChannel channel=GetPixelChannelChannel(image,i);
+ PixelTrait traits=GetPixelChannelTraits(image,channel);
if ((traits & UpdatePixelTrait) == 0)
continue;
- channel_mask=SetPixelChannelMask(image,(ChannelType) (1 << i));
+ channel_mask=SetImageChannelMask(image,(ChannelType) (1 << i));
status&=GetImageRange(image,&min,&max,exception);
min+=black;
max-=white;
if (fabs(min-max) >= MagickEpsilon)
status&=LevelImage(image,min,max,gamma,exception);
- (void) SetPixelChannelMask(image,channel_mask);
+ (void) SetImageChannelMask(image,channel_mask);
}
return(status != 0 ? MagickTrue : MagickFalse);
}
ConcatenateColorComponent(&pixel,BlackPixelChannel,X11Compliance,
tuple);
}
- if (pixel.matte != MagickFalse)
+ if (pixel.alpha_trait == BlendPixelTrait)
{
(void) ConcatenateMagickString(tuple,",",MaxTextExtent);
ConcatenateColorComponent(&pixel,AlphaPixelChannel,X11Compliance,
(void) ConcatenateMagickString(tuple,")",MaxTextExtent);
(void) QueryColorname(image,&pixel,SVGCompliance,color,exception);
GetColorTuple(&pixel,MagickTrue,hex);
- (void) FormatLocaleFile(file,"%10" MagickSizeFormat,p->count);
+ (void) FormatLocaleFile(file,"%10.20g",(double) ((MagickOffsetType)
+ p->count));
(void) FormatLocaleFile(file,": %s %s %s\n",tuple,hex,color);
if (image->progress_monitor != (MagickProgressMonitor) NULL)
{
/*
Traverse any children.
*/
- number_children=unique_image->matte == MagickFalse ? 8UL : 16UL;
+ number_children=unique_image->alpha_trait != BlendPixelTrait ? 8UL : 16UL;
for (i=0; i < (ssize_t) number_children; i++)
if (node_info->child[i] != (NodeInfo *) NULL)
UniqueColorsToImage(unique_image,unique_view,cube_info,
exception);
if (q == (Quantum *) NULL)
continue;
- SetPixelRed(unique_image,p->red,q);
- SetPixelGreen(unique_image,p->green,q);
- SetPixelBlue(unique_image,p->blue,q);
- SetPixelAlpha(unique_image,p->alpha,q);
+ SetPixelRed(unique_image,ClampToQuantum(p->red),q);
+ SetPixelGreen(unique_image,ClampToQuantum(p->green),q);
+ SetPixelBlue(unique_image,ClampToQuantum(p->blue),q);
+ SetPixelAlpha(unique_image,ClampToQuantum(p->alpha),q);
if (unique_image->colorspace == CMYKColorspace)
- SetPixelBlack(unique_image,p->black,q);
+ SetPixelBlack(unique_image,ClampToQuantum(p->black),q);
if (SyncCacheViewAuthenticPixels(unique_view,exception) == MagickFalse)
break;
cube_info->x++;
unique_image=DestroyImage(unique_image);
return((Image *) NULL);
}
- unique_view=AcquireCacheView(unique_image);
+ unique_view=AcquireAuthenticCacheView(unique_image,exception);
UniqueColorsToImage(unique_image,unique_view,cube_info,cube_info->root,
exception);
unique_view=DestroyCacheView(unique_view);
quantize_info=AcquireQuantizeInfo((ImageInfo *) NULL);
quantize_info->number_colors=MaxColormapSize;
- quantize_info->dither=MagickFalse;
+ quantize_info->dither_method=NoDitherMethod;
quantize_info->tree_depth=8;
(void) QuantizeImage(quantize_info,unique_image,exception);
quantize_info=DestroyQuantizeInfo(quantize_info);