goto error_cleanup;
if ( method == VoronoiMorphology ) {
-#if 0
/* Preserve the alpha channel of input image - but turned off */
SetImageAlphaChannel(rslt_image, DeactivateAlphaChannel);
(void) CompositeImageChannel(rslt_image, DefaultChannels,
CopyOpacityCompositeOp, image, 0, 0);
-#endif
- /* ensure alpha is turned off in resultant image */
SetImageAlphaChannel(rslt_image, DeactivateAlphaChannel);
}
goto exit_cleanup;
indexes=GetCacheViewAuthenticIndexQueue(image_view);
for (x=0; x < (ssize_t) image->columns; x++)
{
- indexes[x]=(IndexPacket) 0;
+ SetIndexPixelComponent(indexes+x,0);
for (cluster=head; cluster != (Cluster *) NULL; cluster=cluster->next)
{
if (((ssize_t) ScaleQuantumToChar(q->red) >=
/*
Classify this pixel.
*/
- indexes[x]=(IndexPacket) cluster->id;
+ SetIndexPixelComponent(indexes+x,cluster->id);
break;
}
}
Classify this pixel.
*/
local_minima=1.0/sum;
- indexes[x]=(IndexPacket) j;
+ SetIndexPixelComponent(indexes+x,j);
}
}
}
if ((indexes != (IndexPacket *) NULL) &&
(rotate_indexes != (IndexPacket *) NULL))
for (x=0; x < (ssize_t) image->columns; x++)
- rotate_indexes[image->columns-x-1]=indexes[x];
+ SetIndexPixelComponent(rotate_indexes+image->columns-x-1,
+ GetIndexPixelComponent(indexes+x));
sync=SyncCacheViewAuthenticPixels(rotate_view,exception);
if (sync == MagickFalse)
status=MagickFalse;
}
qsort((void *) evaluate_pixel,number_images,sizeof(*evaluate_pixel),
IntensityCompare);
- q->red=ClampToQuantum(evaluate_pixel[i/2].red);
- q->green=ClampToQuantum(evaluate_pixel[i/2].green);
- q->blue=ClampToQuantum(evaluate_pixel[i/2].blue);
+ SetRedPixelComponent(q,ClampToQuantum(evaluate_pixel[i/2].red));
+ SetGreenPixelComponent(q,ClampToQuantum(evaluate_pixel[i/2].green));
+ SetBluePixelComponent(q,ClampToQuantum(evaluate_pixel[i/2].blue));
if (evaluate_image->matte == MagickFalse)
- q->opacity=ClampToQuantum(evaluate_pixel[i/2].opacity);
+ SetOpacityPixelComponent(q,ClampToQuantum(
+ evaluate_pixel[i/2].opacity));
else
- q->opacity=ClampToQuantum(QuantumRange-evaluate_pixel[i/2].opacity);
+ SetOpacityPixelComponent(q,ClampToQuantum(QuantumRange-
+ evaluate_pixel[i/2].opacity));
if (evaluate_image->colorspace == CMYKColorspace)
- evaluate_indexes[i]=ClampToQuantum(evaluate_pixel[i/2].index);
+ SetIndexPixelComponent(evaluate_indexes+i,ClampToQuantum(
+ evaluate_pixel[i/2].index));
q++;
}
if (SyncCacheViewAuthenticPixels(evaluate_view,exception) == MagickFalse)
evaluate_pixel[x].red=ApplyEvaluateOperator(random_info[id],
GetRedPixelComponent(p),i == 0 ? AddEvaluateOperator : op,evaluate_pixel[x].red);
evaluate_pixel[x].green=ApplyEvaluateOperator(random_info[id],
- GetGreenPixelComponent(p),i == 0 ? AddEvaluateOperator : op,evaluate_pixel[x].green);
+ GetGreenPixelComponent(p),i == 0 ? AddEvaluateOperator : op,
+ evaluate_pixel[x].green);
evaluate_pixel[x].blue=ApplyEvaluateOperator(random_info[id],
- GetBluePixelComponent(p),i == 0 ? AddEvaluateOperator : op,evaluate_pixel[x].blue);
+ GetBluePixelComponent(p),i == 0 ? AddEvaluateOperator : op,
+ evaluate_pixel[x].blue);
evaluate_pixel[x].opacity=ApplyEvaluateOperator(random_info[id],
GetOpacityPixelComponent(p),i == 0 ? AddEvaluateOperator : op,
evaluate_pixel[x].opacity);
if (evaluate_image->colorspace == CMYKColorspace)
evaluate_pixel[x].index=ApplyEvaluateOperator(random_info[id],
- indexes[x],i == 0 ? AddEvaluateOperator : op,
- evaluate_pixel[x].index);
+ GetIndexPixelComponent(indexes+x),i == 0 ? AddEvaluateOperator :
+ op,evaluate_pixel[x].index);
p++;
}
image_view=DestroyCacheView(image_view);
}
for (x=0; x < (ssize_t) evaluate_image->columns; x++)
{
- q->red=ClampToQuantum(evaluate_pixel[x].red);
- q->green=ClampToQuantum(evaluate_pixel[x].green);
- q->blue=ClampToQuantum(evaluate_pixel[x].blue);
+ SetRedPixelComponent(q,ClampToQuantum(evaluate_pixel[x].red));
+ SetGreenPixelComponent(q,ClampToQuantum(evaluate_pixel[x].green));
+ SetBluePixelComponent(q,ClampToQuantum(evaluate_pixel[x].blue));
if (evaluate_image->matte == MagickFalse)
- q->opacity=ClampToQuantum(evaluate_pixel[x].opacity);
+ SetOpacityPixelComponent(q,ClampToQuantum(evaluate_pixel[x].opacity));
else
- q->opacity=ClampToQuantum(QuantumRange-evaluate_pixel[x].opacity);
+ SetOpacityPixelComponent(q,ClampToQuantum(QuantumRange-
+ evaluate_pixel[x].opacity));
if (evaluate_image->colorspace == CMYKColorspace)
- evaluate_indexes[x]=ClampToQuantum(evaluate_pixel[x].index);
+ SetIndexPixelComponent(evaluate_indexes+x,ClampToQuantum(
+ evaluate_pixel[x].index));
q++;
}
if (SyncCacheViewAuthenticPixels(evaluate_view,exception) == MagickFalse)
for (x=0; x < (ssize_t) image->columns; x++)
{
if ((channel & RedChannel) != 0)
- q->red=ClampToQuantum(ApplyEvaluateOperator(random_info[id],q->red,op,
- value));
+ SetRedPixelComponent(q,ClampToQuantum(ApplyEvaluateOperator(
+ random_info[id],GetRedPixelComponent(q),op,value)));
if ((channel & GreenChannel) != 0)
- q->green=ClampToQuantum(ApplyEvaluateOperator(random_info[id],q->green,
- op,value));
+ SetGreenPixelComponent(q,ClampToQuantum(ApplyEvaluateOperator(
+ random_info[id],GetGreenPixelComponent(q),op,value)));
if ((channel & BlueChannel) != 0)
- q->blue=ClampToQuantum(ApplyEvaluateOperator(random_info[id],q->blue,op,
- value));
+ SetBluePixelComponent(q,ClampToQuantum(ApplyEvaluateOperator(
+ random_info[id],GetBluePixelComponent(q),op,value)));
if ((channel & OpacityChannel) != 0)
{
if (image->matte == MagickFalse)
- q->opacity=ClampToQuantum(ApplyEvaluateOperator(random_info[id],
- q->opacity,op,value));
+ SetOpacityPixelComponent(q,ClampToQuantum(ApplyEvaluateOperator(
+ random_info[id],GetOpacityPixelComponent(q),op,value)));
else
- q->opacity=ClampToQuantum(QuantumRange-ApplyEvaluateOperator(
- random_info[id],(Quantum) GetAlphaPixelComponent(q),op,value));
+ SetOpacityPixelComponent(q,ClampToQuantum(QuantumRange-
+ ApplyEvaluateOperator(random_info[id],GetAlphaPixelComponent(q),
+ op,value)));
}
if (((channel & IndexChannel) != 0) && (indexes != (IndexPacket *) NULL))
- indexes[x]=(IndexPacket) ClampToQuantum(ApplyEvaluateOperator(
- random_info[id],indexes[x],op,value));
+ SetIndexPixelComponent(indexes+x,ClampToQuantum(ApplyEvaluateOperator(
+ random_info[id],GetIndexPixelComponent(indexes+x),op,value)));
q++;
}
if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
for (x=0; x < (ssize_t) image->columns; x++)
{
if ((channel & RedChannel) != 0)
- q->red=ApplyFunction(q->red,function,number_parameters,parameters,
- exception);
+ SetRedPixelComponent(q,ApplyFunction(GetRedPixelComponent(q),
+ function,number_parameters,parameters,exception));
if ((channel & GreenChannel) != 0)
- q->green=ApplyFunction(q->green,function,number_parameters,parameters,
- exception);
+ SetGreenPixelComponent(q,ApplyFunction(GetGreenPixelComponent(q),
+ function,number_parameters,parameters,exception));
if ((channel & BlueChannel) != 0)
- q->blue=ApplyFunction(q->blue,function,number_parameters,parameters,
- exception);
+ SetBluePixelComponent(q,ApplyFunction(GetBluePixelComponent(q),
+ function,number_parameters,parameters,exception));
if ((channel & OpacityChannel) != 0)
{
if (image->matte == MagickFalse)
- q->opacity=ApplyFunction(q->opacity,function,number_parameters,
- parameters,exception);
+ SetOpacityPixelComponent(q,ApplyFunction(
+ GetOpacityPixelComponent(q),function,number_parameters,parameters,
+ exception));
else
- q->opacity=(Quantum) QuantumRange-ApplyFunction((Quantum)
+ SetOpacityPixelComponent(q,QuantumRange-ApplyFunction((Quantum)
GetAlphaPixelComponent(q),function,number_parameters,parameters,
- exception);
+ exception));
}
if (((channel & IndexChannel) != 0) && (indexes != (IndexPacket *) NULL))
- indexes[x]=(IndexPacket) ApplyFunction(GetIndexPixelComponent(indexes+x),function,
- number_parameters,parameters,exception);
+ SetIndexPixelComponent(indexes+x,ApplyFunction(GetIndexPixelComponent(
+ indexes+x),function,number_parameters,parameters,exception));
q++;
}
if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
{
mean+=GetRedPixelComponent(p);
sum_squares+=(double) GetRedPixelComponent(p)*GetRedPixelComponent(p);
- sum_cubes+=(double) GetRedPixelComponent(p)*GetRedPixelComponent(p)*GetRedPixelComponent(p);
- sum_fourth_power+=(double) GetRedPixelComponent(p)*GetRedPixelComponent(p)*GetRedPixelComponent(p)*
+ sum_cubes+=(double) GetRedPixelComponent(p)*GetRedPixelComponent(p)*
+ GetRedPixelComponent(p);
+ sum_fourth_power+=(double) GetRedPixelComponent(p)*
+ GetRedPixelComponent(p)*GetRedPixelComponent(p)*
GetRedPixelComponent(p);
area++;
}
if ((channel & GreenChannel) != 0)
{
mean+=GetGreenPixelComponent(p);
- sum_squares+=(double) GetGreenPixelComponent(p)*GetGreenPixelComponent(p);
- sum_cubes+=(double) GetGreenPixelComponent(p)*GetGreenPixelComponent(p)*GetGreenPixelComponent(p);
- sum_fourth_power+=(double) GetGreenPixelComponent(p)*GetGreenPixelComponent(p)*GetGreenPixelComponent(p)*
+ sum_squares+=(double) GetGreenPixelComponent(p)*
+ GetGreenPixelComponent(p);
+ sum_cubes+=(double) GetGreenPixelComponent(p)*
+ GetGreenPixelComponent(p)*GetGreenPixelComponent(p);
+ sum_fourth_power+=(double) GetGreenPixelComponent(p)*
+ GetGreenPixelComponent(p)*GetGreenPixelComponent(p)*
GetGreenPixelComponent(p);
area++;
}
if ((channel & BlueChannel) != 0)
{
mean+=GetBluePixelComponent(p);
- sum_squares+=(double) GetBluePixelComponent(p)*GetBluePixelComponent(p);
- sum_cubes+=(double) GetBluePixelComponent(p)*GetBluePixelComponent(p)*GetBluePixelComponent(p);
- sum_fourth_power+=(double) GetBluePixelComponent(p)*GetBluePixelComponent(p)*GetBluePixelComponent(p)*
+ sum_squares+=(double) GetBluePixelComponent(p)*
+ GetBluePixelComponent(p);
+ sum_cubes+=(double) GetBluePixelComponent(p)*GetBluePixelComponent(p)*
+ GetBluePixelComponent(p);
+ sum_fourth_power+=(double) GetBluePixelComponent(p)*
+ GetBluePixelComponent(p)*GetBluePixelComponent(p)*
GetBluePixelComponent(p);
area++;
}
if ((channel & OpacityChannel) != 0)
{
mean+=GetOpacityPixelComponent(p);
- sum_squares+=(double) GetOpacityPixelComponent(p)*GetOpacityPixelComponent(p);
- sum_cubes+=(double) GetOpacityPixelComponent(p)*GetOpacityPixelComponent(p)*GetOpacityPixelComponent(p);
- sum_fourth_power+=(double) GetOpacityPixelComponent(p)*GetOpacityPixelComponent(p)*GetOpacityPixelComponent(p)*
+ sum_squares+=(double) GetOpacityPixelComponent(p)*
+ GetOpacityPixelComponent(p);
+ sum_cubes+=(double) GetOpacityPixelComponent(p)*
+ GetOpacityPixelComponent(p)*GetOpacityPixelComponent(p);
+ sum_fourth_power+=(double) GetOpacityPixelComponent(p)*
+ GetOpacityPixelComponent(p)*GetOpacityPixelComponent(p)*
GetOpacityPixelComponent(p);
area++;
}
if (((channel & IndexChannel) != 0) &&
(image->colorspace == CMYKColorspace))
{
- mean+=indexes[x];
- sum_squares+=(double) indexes[x]*indexes[x];
- sum_cubes+=(double) indexes[x]*indexes[x]*indexes[x];
- sum_fourth_power+=(double) indexes[x]*indexes[x]*indexes[x]*
- indexes[x];
+ mean+=GetIndexPixelComponent(indexes+x);
+ sum_squares+=(double) GetIndexPixelComponent(indexes+x)*
+ GetIndexPixelComponent(indexes+x);
+ sum_cubes+=(double) GetIndexPixelComponent(indexes+x)*
+ GetIndexPixelComponent(indexes+x)*GetIndexPixelComponent(indexes+x);
+ sum_fourth_power+=(double) GetIndexPixelComponent(indexes+x)*
+ GetIndexPixelComponent(indexes+x)*GetIndexPixelComponent(indexes+x)*
+ GetIndexPixelComponent(indexes+x);
area++;
}
p++;
if (((channel & IndexChannel) != 0) &&
(image->colorspace == CMYKColorspace))
{
- if ((double) indexes[x] < *minima)
- *minima=(double) indexes[x];
- if ((double) indexes[x] > *maxima)
- *maxima=(double) indexes[x];
+ if ((double) GetIndexPixelComponent(indexes+x) < *minima)
+ *minima=(double) GetIndexPixelComponent(indexes+x);
+ if ((double) GetIndexPixelComponent(indexes+x) > *maxima)
+ *maxima=(double) GetIndexPixelComponent(indexes+x);
}
p++;
}
{
depth=channel_statistics[BlackChannel].depth;
range=GetQuantumRange(depth);
- status=indexes[x] != ScaleAnyToQuantum(ScaleQuantumToAny(
- indexes[x],range),range) ? MagickTrue : MagickFalse;
+ status=GetIndexPixelComponent(indexes+x) !=
+ ScaleAnyToQuantum(ScaleQuantumToAny(GetIndexPixelComponent(
+ indexes+x),range),range) ? MagickTrue : MagickFalse;
if (status != MagickFalse)
{
channel_statistics[BlackChannel].depth++;
}
if (image->colorspace == CMYKColorspace)
{
- if ((double) indexes[x] < channel_statistics[BlackChannel].minima)
- channel_statistics[BlackChannel].minima=(double) indexes[x];
- if ((double) indexes[x] > channel_statistics[BlackChannel].maxima)
- channel_statistics[BlackChannel].maxima=(double) indexes[x];
- channel_statistics[BlackChannel].sum+=indexes[x];
+ if ((double) GetIndexPixelComponent(indexes+x) < channel_statistics[BlackChannel].minima)
+ channel_statistics[BlackChannel].minima=(double)
+ GetIndexPixelComponent(indexes+x);
+ if ((double) GetIndexPixelComponent(indexes+x) > channel_statistics[BlackChannel].maxima)
+ channel_statistics[BlackChannel].maxima=(double)
+ GetIndexPixelComponent(indexes+x);
+ channel_statistics[BlackChannel].sum+=
+ GetIndexPixelComponent(indexes+x);
channel_statistics[BlackChannel].sum_squared+=(double)
- indexes[x]*indexes[x];
- channel_statistics[BlackChannel].sum_cubed+=(double) indexes[x]*
- indexes[x]*indexes[x];
+ GetIndexPixelComponent(indexes+x)*GetIndexPixelComponent(indexes+x);
+ channel_statistics[BlackChannel].sum_cubed+=(double)
+ GetIndexPixelComponent(indexes+x)*GetIndexPixelComponent(indexes+x)*
+ GetIndexPixelComponent(indexes+x);
channel_statistics[BlackChannel].sum_fourth_power+=(double)
- indexes[x]*indexes[x]*indexes[x]*indexes[x];
+ GetIndexPixelComponent(indexes+x)*GetIndexPixelComponent(indexes+x)*
+ GetIndexPixelComponent(indexes+x)*GetIndexPixelComponent(indexes+x);
}
x++;
p++;
case BlackQuantum:
{
if (image->colorspace == CMYKColorspace)
- *q=ScaleQuantumToChar(indexes[x]);
+ *q=ScaleQuantumToChar(GetIndexPixelComponent(indexes+x));
break;
}
case IndexQuantum:
case BlackQuantum:
{
if (image->colorspace == CMYKColorspace)
- *q=(double) ((QuantumScale*indexes[x])*quantum_info->scale+
- quantum_info->minimum);
+ *q=(double) ((QuantumScale*GetIndexPixelComponent(indexes+x))*
+ quantum_info->scale+quantum_info->minimum);
break;
}
case IndexQuantum:
case BlackQuantum:
{
if (image->colorspace == CMYKColorspace)
- *q=(float) ((QuantumScale*indexes[x])*quantum_info->scale+
- quantum_info->minimum);
+ *q=(float) ((QuantumScale*GetIndexPixelComponent(indexes+x))*
+ quantum_info->scale+quantum_info->minimum);
break;
}
case IndexQuantum:
case BlackQuantum:
{
if (image->colorspace == CMYKColorspace)
- *q=(unsigned int) ScaleQuantumToLong(indexes[x]);
+ *q=(unsigned int) ScaleQuantumToLong(GetIndexPixelComponent(
+ indexes+x));
break;
}
case IndexQuantum:
case BlackQuantum:
{
if (image->colorspace == CMYKColorspace)
- *q=ScaleQuantumToLong(indexes[x]);
+ *q=ScaleQuantumToLong(GetIndexPixelComponent(indexes+x));
break;
}
case IndexQuantum:
case BlackQuantum:
{
if (image->colorspace == CMYKColorspace)
- *q=indexes[x];
+ *q=GetIndexPixelComponent(indexes+x);
break;
}
case IndexQuantum:
case BlackQuantum:
{
if (image->colorspace == CMYKColorspace)
- *q=ScaleQuantumToShort(indexes[x]);
+ *q=ScaleQuantumToShort(GetIndexPixelComponent(indexes+x));
break;
}
case IndexQuantum:
pixel.blue+=r[u].blue;
pixel.opacity+=r[u].opacity;
if (image->colorspace == CMYKColorspace)
- pixel.index=(MagickRealType) indexes[x+(r-p)+u];
+ pixel.index=(MagickRealType) GetIndexPixelComponent(
+ indexes+x+(r-p)+u);
}
r+=image->columns+width;
}
mean.opacity=(MagickRealType) (pixel.opacity/number_pixels+offset);
if (image->colorspace == CMYKColorspace)
mean.index=(MagickRealType) (pixel.index/number_pixels+offset);
- q->red=(Quantum) (((MagickRealType) q->red <= mean.red) ?
- 0 : QuantumRange);
- q->green=(Quantum) (((MagickRealType) q->green <= mean.green) ?
- 0 : QuantumRange);
- q->blue=(Quantum) (((MagickRealType) q->blue <= mean.blue) ?
- 0 : QuantumRange);
- q->opacity=(Quantum) (((MagickRealType) q->opacity <= mean.opacity) ?
- 0 : QuantumRange);
+ SetRedPixelComponent(q,((MagickRealType) GetRedPixelComponent(q) <=
+ mean.red) ? 0 : QuantumRange);
+ SetGreenPixelComponent(q,((MagickRealType) GetGreenPixelComponent(q) <=
+ mean.green) ? 0 : QuantumRange);
+ SetBluePixelComponent(q,((MagickRealType) GetBluePixelComponent(q) <=
+ mean.blue) ? 0 : QuantumRange);
+ SetOpacityPixelComponent(q,((MagickRealType) GetOpacityPixelComponent(q)
+ <= mean.opacity) ? 0 : QuantumRange);
if (image->colorspace == CMYKColorspace)
- threshold_indexes[x]=(IndexPacket) (((MagickRealType)
- threshold_indexes[x] <= mean.index) ? 0 : QuantumRange);
+ SetIndexPixelComponent(threshold_indexes+x,(((MagickRealType)
+ GetIndexPixelComponent(threshold_indexes+x) <= mean.index) ? 0 :
+ QuantumRange));
p++;
q++;
}
{
for (x=0; x < (ssize_t) image->columns; x++)
{
- q->red=(Quantum) ((MagickRealType) PixelIntensityToQuantum(q) <=
+ SetRedPixelComponent(q,(MagickRealType) PixelIntensityToQuantum(q) <=
threshold ? 0 : QuantumRange);
SetGreenPixelComponent(q,GetRedPixelComponent(q));
SetBluePixelComponent(q,GetRedPixelComponent(q));
for (x=0; x < (ssize_t) image->columns; x++)
{
if ((channel & RedChannel) != 0)
- q->red=(Quantum) ((MagickRealType) q->red <= threshold ? 0 :
- QuantumRange);
+ SetRedPixelComponent(q,(MagickRealType) GetRedPixelComponent(q) <=
+ threshold ? 0 : QuantumRange);
if ((channel & GreenChannel) != 0)
- q->green=(Quantum) ((MagickRealType) q->green <= threshold ? 0 :
- QuantumRange);
+ SetGreenPixelComponent(q,(MagickRealType) GetGreenPixelComponent(q) <=
+ threshold ? 0 : QuantumRange);
if ((channel & BlueChannel) != 0)
- q->blue=(Quantum) ((MagickRealType) q->blue <= threshold ? 0 :
- QuantumRange);
+ SetBluePixelComponent(q,(MagickRealType) GetBluePixelComponent(q) <=
+ threshold ? 0 : QuantumRange);
if ((channel & OpacityChannel) != 0)
{
if (image->matte == MagickFalse)
- q->opacity=(Quantum) ((MagickRealType) q->opacity <= threshold ?
- 0 : QuantumRange);
+ SetOpacityPixelComponent(q,(MagickRealType)
+ GetOpacityPixelComponent(q) <= threshold ? 0 : QuantumRange);
else
- q->opacity=(Quantum) ((MagickRealType) q->opacity <= threshold ?
- OpaqueOpacity : TransparentOpacity);
+ SetRedPixelComponent(q,(MagickRealType) GetOpacityPixelComponent(
+ q) <= threshold ? OpaqueOpacity : TransparentOpacity);
}
if (((channel & IndexChannel) != 0) &&
(image->colorspace == CMYKColorspace))
- indexes[x]=(IndexPacket) ((MagickRealType) indexes[x] <= threshold ?
- 0 : QuantumRange);
+ SetIndexPixelComponent(indexes+x,(MagickRealType)
+ GetIndexPixelComponent(indexes+x) <= threshold ? 0 : QuantumRange);
q++;
}
if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
{
if (PixelIntensity(q) < MagickPixelIntensity(&threshold))
{
- q->red=(Quantum) 0;
- q->green=(Quantum) 0;
- q->blue=(Quantum) 0;
+ SetRedPixelComponent(q,0);
+ SetGreenPixelComponent(q,0);
+ SetBluePixelComponent(q,0);
if (image->colorspace == CMYKColorspace)
- indexes[x]=(Quantum) 0;
+ SetIndexPixelComponent(indexes+x,0);
}
}
else
{
if (((channel & RedChannel) != 0) &&
- ((MagickRealType) q->red < threshold.red))
- q->red=(Quantum) 0;
+ ((MagickRealType) GetRedPixelComponent(q) < threshold.red))
+ SetRedPixelComponent(q,0);
if (((channel & GreenChannel) != 0) &&
- ((MagickRealType) q->green < threshold.green))
- q->green=(Quantum) 0;
+ ((MagickRealType) GetGreenPixelComponent(q) < threshold.green))
+ SetGreenPixelComponent(q,0);
if (((channel & BlueChannel) != 0) &&
- ((MagickRealType) q->blue < threshold.blue))
- q->blue=(Quantum) 0;
+ ((MagickRealType) GetBluePixelComponent(q) < threshold.blue))
+ SetBluePixelComponent(q,0);
if (((channel & OpacityChannel) != 0) &&
- ((MagickRealType) q->opacity < threshold.opacity))
- q->opacity=(Quantum) 0;
+ ((MagickRealType) GetOpacityPixelComponent(q) < threshold.opacity))
+ SetOpacityPixelComponent(q,0);
if (((channel & IndexChannel) != 0) &&
(image->colorspace == CMYKColorspace) &&
- ((MagickRealType) indexes[x] < threshold.index))
- indexes[x]=(Quantum) 0;
+ ((MagickRealType) GetIndexPixelComponent(indexes+x) <
+ threshold.index))
+ SetIndexPixelComponent(indexes+x,0);
}
q++;
}
q=image->colormap;
for (i=0; i < (ssize_t) image->colors; i++)
{
- q->red=ClampToUnsignedQuantum(q->red);
- q->green=ClampToUnsignedQuantum(q->green);
- q->blue=ClampToUnsignedQuantum(q->blue);
- q->opacity=ClampToUnsignedQuantum(q->opacity);
+ SetRedPixelComponent(q,ClampToUnsignedQuantum(
+ GetRedPixelComponent(q)));
+ SetGreenPixelComponent(q,ClampToUnsignedQuantum(
+ GetGreenPixelComponent(q)));
+ SetBluePixelComponent(q,ClampToUnsignedQuantum(
+ GetBluePixelComponent(q)));
+ SetOpacityPixelComponent(q,ClampToUnsignedQuantum(
+ GetOpacityPixelComponent(q)));
q++;
}
return(SyncImage(image));
for (x=0; x < (ssize_t) image->columns; x++)
{
if ((channel & RedChannel) != 0)
- q->red=ClampToUnsignedQuantum(q->red);
+ SetRedPixelComponent(q,ClampToUnsignedQuantum(
+ GetRedPixelComponent(q)));
if ((channel & GreenChannel) != 0)
- q->green=ClampToUnsignedQuantum(q->green);
+ SetGreenPixelComponent(q,ClampToUnsignedQuantum(
+ GetGreenPixelComponent(q)));
if ((channel & BlueChannel) != 0)
- q->blue=ClampToUnsignedQuantum(q->blue);
+ SetBluePixelComponent(q,ClampToUnsignedQuantum(
+ GetBluePixelComponent(q)));
if ((channel & OpacityChannel) != 0)
- q->opacity=ClampToUnsignedQuantum(q->opacity);
+ SetOpacityPixelComponent(q,ClampToUnsignedQuantum(
+ GetOpacityPixelComponent(q)));
if (((channel & IndexChannel) != 0) &&
(image->colorspace == CMYKColorspace))
- indexes[x]=(IndexPacket) ClampToUnsignedQuantum(indexes[x]);
+ SetIndexPixelComponent(indexes+x,ClampToUnsignedQuantum(
+ GetIndexPixelComponent(indexes+x)));
q++;
}
if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
Opacity is inverted so 'off' represents transparent.
*/
if (levels.red) {
- t = (ssize_t) (QuantumScale*q->red*(levels.red*d+1));
+ t = (ssize_t) (QuantumScale*GetRedPixelComponent(q)*(levels.red*d+1));
l = t/d; t = t-l*d;
- q->red=RoundToQuantum((MagickRealType) ((l+(t >= threshold))*
- (MagickRealType) QuantumRange/levels.red));
+ SetRedPixelComponent(q,RoundToQuantum((MagickRealType)
+ ((l+(t >= threshold))*(MagickRealType) QuantumRange/levels.red)));
}
if (levels.green) {
- t = (ssize_t) (QuantumScale*q->green*(levels.green*d+1));
+ t = (ssize_t) (QuantumScale*GetGreenPixelComponent(q)*
+ (levels.green*d+1));
l = t/d; t = t-l*d;
- q->green=RoundToQuantum((MagickRealType) ((l+(t >= threshold))*
- (MagickRealType) QuantumRange/levels.green));
+ SetGreenPixelComponent(q,RoundToQuantum((MagickRealType)
+ ((l+(t >= threshold))*(MagickRealType) QuantumRange/levels.green)));
}
if (levels.blue) {
- t = (ssize_t) (QuantumScale*q->blue*(levels.blue*d+1));
+ t = (ssize_t) (QuantumScale*GetBluePixelComponent(q)*
+ (levels.blue*d+1));
l = t/d; t = t-l*d;
- q->blue=RoundToQuantum((MagickRealType) ((l+(t >= threshold))*
- (MagickRealType) QuantumRange/levels.blue));
+ SetBluePixelComponent(q,RoundToQuantum((MagickRealType)
+ ((l+(t >= threshold))*(MagickRealType) QuantumRange/levels.blue)));
}
if (levels.opacity) {
- t = (ssize_t) ((1.0-QuantumScale*q->opacity)*(levels.opacity*d+1));
+ t = (ssize_t) ((1.0-QuantumScale*GetOpacityPixelComponent(q))*
+ (levels.opacity*d+1));
l = t/d; t = t-l*d;
- q->opacity=RoundToQuantum((MagickRealType) ((1.0-l-(t >= threshold))*
- (MagickRealType) QuantumRange/levels.opacity));
+ SetOpacityPixelComponent(q,RoundToQuantum((MagickRealType)
+ ((1.0-l-(t >= threshold))*(MagickRealType) QuantumRange/
+ levels.opacity)));
}
if (levels.index) {
- t = (ssize_t) (QuantumScale*indexes[x]*(levels.index*d+1));
+ t = (ssize_t) (QuantumScale*GetIndexPixelComponent(indexes+x)*
+ (levels.index*d+1));
l = t/d; t = t-l*d;
- indexes[x]=(IndexPacket) RoundToQuantum((MagickRealType) ((l+
- (t>=threshold))*(MagickRealType) QuantumRange/levels.index));
+ SetIndexPixelComponent(indexes+x,RoundToQuantum((MagickRealType) ((l+
+ (t>=threshold))*(MagickRealType) QuantumRange/levels.index)));
}
q++;
}
threshold.index=(MagickRealType)(QuantumRange*
GetPseudoRandomValue(random_info[id]));
index=(IndexPacket) (intensity <= threshold.index ? 0 : 1);
- indexes[x]=index;
- *q++=image->colormap[(ssize_t) index];
+ 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);
+ q++;
}
sync=SyncCacheViewAuthenticPixels(image_view,exception);
if (sync == MagickFalse)
{
if ((channel & RedChannel) != 0)
{
- if ((MagickRealType) q->red < min_threshold)
+ if ((MagickRealType) GetRedPixelComponent(q) < min_threshold)
threshold.red=min_threshold;
else
- if ((MagickRealType) q->red > max_threshold)
+ if ((MagickRealType) GetRedPixelComponent(q) > max_threshold)
threshold.red=max_threshold;
else
threshold.red=(MagickRealType) (QuantumRange*
}
if ((channel & GreenChannel) != 0)
{
- if ((MagickRealType) q->green < min_threshold)
+ if ((MagickRealType) GetGreenPixelComponent(q) < min_threshold)
threshold.green=min_threshold;
else
- if ((MagickRealType) q->green > max_threshold)
+ if ((MagickRealType) GetGreenPixelComponent(q) > max_threshold)
threshold.green=max_threshold;
else
threshold.green=(MagickRealType) (QuantumRange*
}
if ((channel & BlueChannel) != 0)
{
- if ((MagickRealType) q->blue < min_threshold)
+ if ((MagickRealType) GetBluePixelComponent(q) < min_threshold)
threshold.blue=min_threshold;
else
- if ((MagickRealType) q->blue > max_threshold)
+ if ((MagickRealType) GetBluePixelComponent(q) > max_threshold)
threshold.blue=max_threshold;
else
threshold.blue=(MagickRealType) (QuantumRange*
}
if ((channel & OpacityChannel) != 0)
{
- if ((MagickRealType) q->opacity < min_threshold)
+ if ((MagickRealType) GetOpacityPixelComponent(q) < min_threshold)
threshold.opacity=min_threshold;
else
- if ((MagickRealType) q->opacity > max_threshold)
+ if ((MagickRealType) GetOpacityPixelComponent(q) > max_threshold)
threshold.opacity=max_threshold;
else
threshold.opacity=(MagickRealType) (QuantumRange*
if (((channel & IndexChannel) != 0) &&
(image->colorspace == CMYKColorspace))
{
- if ((MagickRealType) indexes[x] < min_threshold)
+ if ((MagickRealType) GetIndexPixelComponent(indexes+x) < min_threshold)
threshold.index=min_threshold;
else
- if ((MagickRealType) indexes[x] > max_threshold)
+ if ((MagickRealType) GetIndexPixelComponent(indexes+x) > max_threshold)
threshold.index=max_threshold;
else
threshold.index=(MagickRealType) (QuantumRange*
GetPseudoRandomValue(random_info[id]));
}
if ((channel & RedChannel) != 0)
- q->red=(Quantum) ((MagickRealType) q->red <= threshold.red ? 0 :
- QuantumRange);
+ SetRedPixelComponent(q,(MagickRealType) GetRedPixelComponent(q) <=
+ threshold.red ? 0 : QuantumRange);
if ((channel & GreenChannel) != 0)
- q->green=(Quantum) ((MagickRealType) q->green <= threshold.green ? 0 :
- QuantumRange);
+ SetGreenPixelComponent(q,(MagickRealType) GetGreenPixelComponent(q) <=
+ threshold.green ? 0 : QuantumRange);
if ((channel & BlueChannel) != 0)
- q->blue=(Quantum) ((MagickRealType) q->blue <= threshold.blue ? 0 :
- QuantumRange);
+ SetBluePixelComponent(q,(MagickRealType) GetBluePixelComponent(q) <=
+ threshold.blue ? 0 : QuantumRange);
if ((channel & OpacityChannel) != 0)
- q->opacity=(Quantum) ((MagickRealType) q->opacity <= threshold.opacity ?
- 0 : QuantumRange);
+ SetOpacityPixelComponent(q,(MagickRealType) GetOpacityPixelComponent(q)
+ <= threshold.opacity ? 0 : QuantumRange);
if (((channel & IndexChannel) != 0) &&
(image->colorspace == CMYKColorspace))
- indexes[x]=(IndexPacket) ((MagickRealType) indexes[x] <=
- threshold.index ? 0 : QuantumRange);
+ SetIndexPixelComponent(indexes+x,(MagickRealType)
+ GetIndexPixelComponent(indexes+x) <= threshold.index ? 0 :
+ QuantumRange);
q++;
}
if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
{
if (PixelIntensity(q) > MagickPixelIntensity(&threshold))
{
- q->red=(Quantum) QuantumRange;
- q->green=(Quantum) QuantumRange;
- q->blue=(Quantum) QuantumRange;
+ SetRedPixelComponent(q,QuantumRange);
+ SetGreenPixelComponent(q,QuantumRange);
+ SetBluePixelComponent(q,QuantumRange);
if (image->colorspace == CMYKColorspace)
- indexes[x]=(Quantum) QuantumRange;
+ SetIndexPixelComponent(indexes+x,QuantumRange);
}
}
else
{
if (((channel & RedChannel) != 0) &&
- ((MagickRealType) q->red > threshold.red))
- q->red=(Quantum) QuantumRange;
+ ((MagickRealType) GetRedPixelComponent(q) > threshold.red))
+ SetRedPixelComponent(q,QuantumRange);
if (((channel & GreenChannel) != 0) &&
- ((MagickRealType) q->green > threshold.green))
- q->green=(Quantum) QuantumRange;
+ ((MagickRealType) GetGreenPixelComponent(q) > threshold.green))
+ SetGreenPixelComponent(q,QuantumRange);
if (((channel & BlueChannel) != 0) &&
- ((MagickRealType) q->blue > threshold.blue))
- q->blue=(Quantum) QuantumRange;
+ ((MagickRealType) GetBluePixelComponent(q) > threshold.blue))
+ SetBluePixelComponent(q,QuantumRange);
if (((channel & OpacityChannel) != 0) &&
- ((MagickRealType) q->opacity > threshold.opacity))
- q->opacity=(Quantum) QuantumRange;
+ ((MagickRealType) GetOpacityPixelComponent(q) > threshold.opacity))
+ SetOpacityPixelComponent(q,QuantumRange);
if (((channel & IndexChannel) != 0) &&
(image->colorspace == CMYKColorspace) &&
- ((MagickRealType) indexes[x] > threshold.index))
- indexes[x]=(Quantum) QuantumRange;
+ ((MagickRealType) GetIndexPixelComponent(indexes+x)) >
+ threshold.index)
+ SetIndexPixelComponent(indexes+x,QuantumRange);
}
q++;
}
if (indexes != (IndexPacket *) NULL)
{
if (chop_indexes != (IndexPacket *) NULL)
- *chop_indexes++=indexes[x];
+ *chop_indexes++=GetIndexPixelComponent(indexes+x);
}
q++;
}
if (indexes != (IndexPacket *) NULL)
{
if (chop_indexes != (IndexPacket *) NULL)
- *chop_indexes++=indexes[x];
+ *chop_indexes++=GetIndexPixelComponent(indexes+x);
}
q++;
}
break;
for (x=0; x < (ssize_t) images->columns; x++)
{
- q->red=(Quantum) (QuantumRange-PixelIntensityToQuantum(p));
+ SetRedPixelComponent(q,QuantumRange-PixelIntensityToQuantum(p));
p++;
q++;
}
indexes=GetCacheViewAuthenticIndexQueue(cmyk_view);
for (x=0; x < (ssize_t) images->columns; x++)
{
- indexes[x]=(IndexPacket) (QuantumRange-PixelIntensityToQuantum(p));
+ SetIndexPixelComponent(indexes+x,QuantumRange-
+ PixelIntensityToQuantum(p));
p++;
}
if (SyncCacheViewAuthenticPixels(cmyk_view,exception) == MagickFalse)
(*--q)=(*p++);
if ((indexes != (const IndexPacket *) NULL) &&
(flop_indexes != (IndexPacket *) NULL))
- flop_indexes[flop_image->columns-x-1]=indexes[x];
+ SetIndexPixelComponent(flop_indexes+flop_image->columns-x-1,
+ GetIndexPixelComponent( indexes+x));
}
if (SyncCacheViewAuthenticPixels(flop_view,exception) == MagickFalse)
status=MagickFalse;
if (image->matte != MagickFalse)
SetOpacityPixelComponent(q,GetOpacityPixelComponent(p));
if (image->colorspace == CMYKColorspace)
- splice_indexes[x]=(*indexes++);
+ SetIndexPixelComponent(splice_indexes+x,
+ GetIndexPixelComponent(indexes));
+ indexes++;
p++;
q++;
}
if (image->matte != MagickFalse)
SetOpacityPixelComponent(q,GetOpacityPixelComponent(p));
if (image->colorspace == CMYKColorspace)
- splice_indexes[x]=(*indexes++);
+ SetIndexPixelComponent(splice_indexes+x,
+ GetIndexPixelComponent(indexes));
+ indexes++;
p++;
q++;
}
if (image->matte != MagickFalse)
SetOpacityPixelComponent(q,GetOpacityPixelComponent(p));
if (image->colorspace == CMYKColorspace)
- splice_indexes[x]=(*indexes++);
+ SetIndexPixelComponent(splice_indexes+x,
+ GetIndexPixelComponent(indexes));
+ indexes++;
p++;
q++;
}
if (image->matte != MagickFalse)
SetOpacityPixelComponent(q,GetOpacityPixelComponent(p));
if (image->colorspace == CMYKColorspace)
- splice_indexes[x]=(*indexes++);
+ SetIndexPixelComponent(splice_indexes+x,
+ GetIndexPixelComponent(indexes));
+ indexes++;
p++;
q++;
}
transverse_indexes=GetCacheViewAuthenticIndexQueue(transverse_view);
if (transverse_indexes != (IndexPacket *) NULL)
for (x=0; x < (ssize_t) image->columns; x++)
- transverse_indexes[image->columns-x-1]=indexes[x];
+ SetIndexPixelComponent(transverse_indexes+image->columns-x-1,
+ GetIndexPixelComponent(indexes+x));
}
sync=SyncCacheViewAuthenticPixels(transverse_view,exception);
if (sync == MagickFalse)
/*
Set this pixel to the background color.
*/
- q->red=ScaleShortToQuantum(pixel->box_color.red);
- q->green=ScaleShortToQuantum(pixel->box_color.green);
- q->blue=ScaleShortToQuantum(pixel->box_color.blue);
+ SetRedPixelComponent(q,ScaleShortToQuantum(pixel->box_color.red));
+ SetGreenPixelComponent(q,ScaleShortToQuantum(pixel->box_color.green));
+ SetBluePixelComponent(q,ScaleShortToQuantum(pixel->box_color.blue));
if ((annotate_info->stencil == ForegroundStencil) ||
(annotate_info->stencil == OpaqueStencil))
- q->opacity=(Quantum) TransparentOpacity;
+ SetOpacityPixelComponent(q,TransparentOpacity);
}
else
{
/*
Set this pixel to the pen color.
*/
- q->red=ScaleShortToQuantum(pixel->pen_color.red);
- q->green=ScaleShortToQuantum(pixel->pen_color.green);
- q->blue=ScaleShortToQuantum(pixel->pen_color.blue);
+ SetRedPixelComponent(q,ScaleShortToQuantum(pixel->pen_color.red));
+ SetGreenPixelComponent(q,ScaleShortToQuantum(pixel->pen_color.green));
+ SetBluePixelComponent(q,ScaleShortToQuantum(pixel->pen_color.blue));
if (annotate_info->stencil == BackgroundStencil)
- q->opacity=(Quantum) TransparentOpacity;
+ SetOpacityPixelComponent(q,TransparentOpacity);
}
q++;
}
/*
Set this pixel to the pen color.
*/
- q->red=ScaleShortToQuantum(pixel->pen_color.red);
- q->green=ScaleShortToQuantum(pixel->pen_color.green);
- q->blue=ScaleShortToQuantum(pixel->pen_color.blue);
- q->opacity=(Quantum) (draw_info->stencil == OpaqueStencil ?
- OpaqueOpacity : TransparentOpacity);
+ SetRedPixelComponent(q,ScaleShortToQuantum(pixel->pen_color.red));
+ SetGreenPixelComponent(q,ScaleShortToQuantum(pixel->pen_color.green));
+ SetBluePixelComponent(q,ScaleShortToQuantum(pixel->pen_color.blue));
+ SetOpacityPixelComponent(q,(Quantum) (draw_info->stencil ==
+ OpaqueStencil ? OpaqueOpacity : TransparentOpacity));
}
q++;
}
{
pixel=XGetPixel(ximage,x,y);
index=(pixel >> red_shift) & red_mask;
- q->red=ScaleShortToQuantum(colors[index].red);
+ SetRedPixelComponent(q,ScaleShortToQuantum(
+ colors[index].red));
index=(pixel >> green_shift) & green_mask;
- q->green=ScaleShortToQuantum(colors[index].green);
+ SetGreenPixelComponent(q,ScaleShortToQuantum(
+ colors[index].green));
index=(pixel >> blue_shift) & blue_mask;
- q->blue=ScaleShortToQuantum(colors[index].blue);
+ SetBluePixelComponent(q,ScaleShortToQuantum(
+ colors[index].blue));
q++;
}
if (SyncCacheViewAuthenticPixels(composite_view,exception) == MagickFalse)
pixel=XGetPixel(ximage,x,y);
color=(pixel >> red_shift) & red_mask;
color=(65535UL*color)/red_mask;
- q->red=ScaleShortToQuantum((unsigned short) color);
+ SetRedPixelComponent(q,ScaleShortToQuantum((unsigned short)
+ color));
color=(pixel >> green_shift) & green_mask;
color=(65535UL*color)/green_mask;
- q->green=ScaleShortToQuantum((unsigned short) color);
+ SetGreenPixelComponent(q,ScaleShortToQuantum((unsigned short)
+ color));
color=(pixel >> blue_shift) & blue_mask;
color=(65535UL*color)/blue_mask;
- q->blue=ScaleShortToQuantum((unsigned short) color);
+ SetBluePixelComponent(q,ScaleShortToQuantum((unsigned short)
+ color));
q++;
}
if (SyncCacheViewAuthenticPixels(composite_view,exception) == MagickFalse)
for (x=0; x < (int) composite_image->columns; x++)
{
index=(IndexPacket) XGetPixel(ximage,x,y);
- indexes[x]=index;
+ SetIndexPixelComponent(indexes+x,index);
*q++=composite_image->colormap[(ssize_t) index];
}
if (SyncCacheViewAuthenticPixels(composite_view,exception) == MagickFalse)
for (x=0; x < (int) canvas->columns; x++)
{
byte>>=1;
- if (indexes[x] == (IndexPacket) polarity)
+ if (GetIndexPixelComponent(indexes+x) == (IndexPacket) polarity)
byte|=foreground;
else
byte|=background;
nibble=0;
for (x=0; x < (int) canvas->columns; x++)
{
- pixel=pixels[(ssize_t) indexes[x]] & 0x0f;
+ pixel=pixels[(ssize_t) GetIndexPixelComponent(indexes+x)] & 0x0f;
switch (nibble)
{
case 0:
nibble=0;
for (x=0; x < (int) canvas->columns; x++)
{
- pixel=pixels[(ssize_t) indexes[x]] & 0xf;
+ pixel=pixels[(ssize_t) GetIndexPixelComponent(indexes+x)] & 0xf;
switch (nibble)
{
case 0:
indexes=GetCacheViewVirtualIndexQueue(canvas_view);
for (x=0; x < (int) canvas->columns; x++)
{
- pixel=pixels[(ssize_t) indexes[x]];
+ pixel=pixels[(ssize_t) GetIndexPixelComponent(indexes+x)];
*q++=(unsigned char) pixel;
}
q+=scanline_pad;
indexes=GetCacheViewVirtualIndexQueue(canvas_view);
for (x=0; x < (int) canvas->columns; x++)
{
- pixel=pixels[(ssize_t) indexes[x]];
+ pixel=pixels[(ssize_t) GetIndexPixelComponent(indexes+x)];
for (k=0; k < (int) bytes_per_pixel; k++)
{
channel[k]=(unsigned char) pixel;
for (x=(int) canvas->columns-1; x >= 0; x--)
{
byte<<=1;
- if (indexes[x] == (IndexPacket) polarity)
+ if (GetIndexPixelComponent(indexes+x) == (IndexPacket) polarity)
byte|=foreground;
else
byte|=background;
nibble=0;
for (x=0; x < (int) canvas->columns; x++)
{
- pixel=pixels[(ssize_t) indexes[x]] & 0xf;
+ pixel=pixels[(ssize_t) GetIndexPixelComponent(indexes+x)] & 0xf;
switch (nibble)
{
case 0:
nibble=0;
for (x=0; x < (int) canvas->columns; x++)
{
- pixel=pixels[(ssize_t) indexes[x]] & 0xf;
+ pixel=pixels[(ssize_t) GetIndexPixelComponent(indexes+x)] & 0xf;
switch (nibble)
{
case 0:
indexes=GetCacheViewVirtualIndexQueue(canvas_view);
for (x=0; x < (int) canvas->columns; x++)
{
- pixel=pixels[(ssize_t) indexes[x]];
+ pixel=pixels[(ssize_t) GetIndexPixelComponent(indexes+x)];
*q++=(unsigned char) pixel;
}
q+=scanline_pad;
indexes=GetCacheViewVirtualIndexQueue(canvas_view);
for (x=0; x < (int) canvas->columns; x++)
{
- pixel=pixels[(ssize_t) indexes[x]];
+ pixel=pixels[(ssize_t) GetIndexPixelComponent(indexes+x)];
for (k=(int) bytes_per_pixel-1; k >= 0; k--)
{
channel[k]=(unsigned char) pixel;
{
for (i=0; i < (ssize_t) number_colors; i++)
{
- q->red=(Quantum) 0;
+ SetRedPixelComponent(q,0);
if (map_info->red_max != 0)
- q->red=ScaleXToQuantum((size_t) (i/
- map_info->red_mult),map_info->red_max);
- q->green=(Quantum) 0;
+ SetRedPixelComponent(q,ScaleXToQuantum((size_t) (i/
+ map_info->red_mult),map_info->red_max));
+ SetGreenPixelComponent(q,0);
if (map_info->green_max != 0)
- q->green=ScaleXToQuantum((size_t) ((i/
+ SetGreenPixelComponent(q,ScaleXToQuantum((size_t) ((i/
map_info->green_mult) % (map_info->green_max+1)),
- map_info->green_max);
- q->blue=(Quantum) 0;
+ map_info->green_max));
+ SetBluePixelComponent(q,0);
if (map_info->blue_max != 0)
- q->blue=ScaleXToQuantum((size_t) (i %
- map_info->green_mult),map_info->blue_max);
- q->opacity=(Quantum) TransparentOpacity;
+ SetBluePixelComponent(q,ScaleXToQuantum((size_t) (i %
+ map_info->green_mult),map_info->blue_max));
+ SetOpacityPixelComponent(q,TransparentOpacity);
q++;
}
(void) SyncAuthenticPixels(affinity_image,exception);
break;
indexes=GetCacheViewAuthenticIndexQueue(image_view);
for (x=(int) image->columns-1; x >= 0; x--)
- diversity[(ssize_t) indexes[x]].count++;
+ diversity[(ssize_t) GetIndexPixelComponent(indexes+x)].count++;
}
image_view=DestroyCacheView(image_view);
/*