#endif
status=GetOneVirtualMethodPixel(pattern,TileVirtualPixelMethod,x+
pattern->tile_offset.x,y+pattern->tile_offset.y,pixel,exception);
- fill->red=pixel[RedPixelChannel];
- fill->green=pixel[GreenPixelChannel];
- fill->blue=pixel[BluePixelChannel];
- fill->alpha=pixel[AlphaPixelChannel];
+ fill->red=(double) pixel[RedPixelChannel];
+ fill->green=(double) pixel[GreenPixelChannel];
+ fill->blue=(double) pixel[BluePixelChannel];
+ fill->alpha=(double) pixel[AlphaPixelChannel];
return(status);
}
}
#endif
status=GetOneVirtualMethodPixel(pattern,TileVirtualPixelMethod,x+
pattern->tile_offset.x,y+pattern->tile_offset.y,pixel,exception);
- stroke->red=pixel[RedPixelChannel];
- stroke->green=pixel[GreenPixelChannel];
- stroke->blue=pixel[BluePixelChannel];
- stroke->alpha=pixel[AlphaPixelChannel];
+ stroke->red=(double) pixel[RedPixelChannel];
+ stroke->green=(double) pixel[GreenPixelChannel];
+ stroke->blue=(double) pixel[BluePixelChannel];
+ stroke->alpha=(double) pixel[AlphaPixelChannel];
return(status);
}
}
{
GetMagickToken(q,&q,token);
factor=strchr(token,'%') != (char *) NULL ? 0.01 : 1.0;
- graphic_context[n]->fill.alpha=ClampToQuantum((MagickRealType)
- QuantumRange*factor*InterpretLocaleValue(token,
- (char **) NULL));
+ graphic_context[n]->fill.alpha=(MagickRealType) QuantumRange*
+ factor*InterpretLocaleValue(token,(char **) NULL);
break;
}
if (LocaleCompare("fill-rule",keyword) == 0)
graphic_context[n]->alpha=ClampToQuantum((MagickRealType)
QuantumRange*(1.0-((1.0-QuantumScale*graphic_context[n]->alpha)*
factor*InterpretLocaleValue(token,(char **) NULL))));
- graphic_context[n]->fill.alpha=graphic_context[n]->alpha;
- graphic_context[n]->stroke.alpha=graphic_context[n]->alpha;
+ graphic_context[n]->fill.alpha=(double) graphic_context[n]->alpha;
+ graphic_context[n]->stroke.alpha=(double) graphic_context[n]->alpha;
break;
}
status=MagickFalse;
{
GetMagickToken(q,&q,token);
factor=strchr(token,'%') != (char *) NULL ? 0.01 : 1.0;
- graphic_context[n]->stroke.alpha=ClampToQuantum((MagickRealType)
- QuantumRange*factor*InterpretLocaleValue(token,
- (char **) NULL));
+ graphic_context[n]->stroke.alpha=(MagickRealType) QuantumRange*
+ factor*InterpretLocaleValue(token,(char **) NULL);
break;
}
if (LocaleCompare("stroke-width",keyword) == 0)
(void) GetOneCacheViewVirtualPixel(image_view,x,y,virtual_pixel,
exception);
- target.red=virtual_pixel[RedPixelChannel];
- target.green=virtual_pixel[GreenPixelChannel];
- target.blue=virtual_pixel[BluePixelChannel];
- target.alpha=virtual_pixel[AlphaPixelChannel];
+ target.red=(double) virtual_pixel[RedPixelChannel];
+ target.green=(double) virtual_pixel[GreenPixelChannel];
+ target.blue=(double) virtual_pixel[BluePixelChannel];
+ target.alpha=(double) virtual_pixel[AlphaPixelChannel];
for (y=0; y < (ssize_t) image->rows; y++)
{
register Quantum
if (q == (Quantum *) NULL)
break;
(void) GetFillColor(draw_info,x,y,&pixel,exception);
- SetPixelAlpha(image,pixel.alpha,q);
+ SetPixelAlpha(image,ClampToQuantum(pixel.alpha),q);
(void) SyncCacheViewAuthenticPixels(image_view,exception);
break;
}
(void) GetOneCacheViewVirtualPixel(image_view,x,y,virtual_pixel,
exception);
- target.red=virtual_pixel[RedPixelChannel];
- target.green=virtual_pixel[GreenPixelChannel];
- target.blue=virtual_pixel[BluePixelChannel];
- target.alpha=virtual_pixel[AlphaPixelChannel];
+ target.red=(double) virtual_pixel[RedPixelChannel];
+ target.green=(double) virtual_pixel[GreenPixelChannel];
+ target.blue=(double) virtual_pixel[BluePixelChannel];
+ target.alpha=(double) virtual_pixel[AlphaPixelChannel];
for (y=0; y < (ssize_t) image->rows; y++)
{
register Quantum
continue;
}
(void) GetFillColor(draw_info,x,y,&pixel,exception);
- SetPixelAlpha(image,pixel.alpha,q);
+ SetPixelAlpha(image,ClampToQuantum(pixel.alpha),q);
q+=GetPixelChannels(image);
}
sync=SyncCacheViewAuthenticPixels(image_view,exception);
for (x=0; x < (ssize_t) image->columns; x++)
{
(void) GetFillColor(draw_info,x,y,&pixel,exception);
- SetPixelAlpha(image,pixel.alpha,q);
+ SetPixelAlpha(image,ClampToQuantum(pixel.alpha),q);
q+=GetPixelChannels(image);
}
sync=SyncCacheViewAuthenticPixels(image_view,exception);
#endif
for (i=0; i <= (ssize_t) MaxMap; i++)
{
- cdl_map[i].red=ClampToQuantum((MagickRealType) ScaleMapToQuantum(
- (MagickRealType) (MaxMap*(pow(color_correction.red.slope*i/MaxMap+
- color_correction.red.offset,color_correction.red.power)))));
- cdl_map[i].green=ClampToQuantum((MagickRealType) ScaleMapToQuantum(
- (MagickRealType) (MaxMap*(pow(color_correction.green.slope*i/MaxMap+
- color_correction.green.offset,color_correction.green.power)))));
- cdl_map[i].blue=ClampToQuantum((MagickRealType) ScaleMapToQuantum(
- (MagickRealType) (MaxMap*(pow(color_correction.blue.slope*i/MaxMap+
- color_correction.blue.offset,color_correction.blue.power)))));
+ cdl_map[i].red=(MagickRealType) ScaleMapToQuantum((MagickRealType)
+ (MaxMap*(pow(color_correction.red.slope*i/MaxMap+
+ color_correction.red.offset,color_correction.red.power))));
+ cdl_map[i].green=(MagickRealType) ScaleMapToQuantum((MagickRealType)
+ (MaxMap*(pow(color_correction.green.slope*i/MaxMap+
+ color_correction.green.offset,color_correction.green.power))));
+ cdl_map[i].blue=(MagickRealType) ScaleMapToQuantum((MagickRealType)
+ (MaxMap*(pow(color_correction.blue.slope*i/MaxMap+
+ color_correction.blue.offset,color_correction.blue.power))));
}
if (image->storage_class == PseudoClass)
{
luma=0.2126*image->colormap[i].red+0.7152*image->colormap[i].green+
0.0722*image->colormap[i].blue;
- image->colormap[i].red=ClampToQuantum(luma+
- color_correction.saturation*cdl_map[ScaleQuantumToMap(
- image->colormap[i].red)].red-luma);
- image->colormap[i].green=ClampToQuantum(luma+
- color_correction.saturation*cdl_map[ScaleQuantumToMap(
- image->colormap[i].green)].green-luma);
- image->colormap[i].blue=ClampToQuantum(luma+
- color_correction.saturation*cdl_map[ScaleQuantumToMap(
- image->colormap[i].blue)].blue-luma);
+ image->colormap[i].red=luma+color_correction.saturation*
+ cdl_map[ScaleQuantumToMap(ClampToQuantum(
+ image->colormap[i].red))].red-luma;
+ image->colormap[i].green=luma+color_correction.saturation*
+ cdl_map[ScaleQuantumToMap(ClampToQuantum(
+ image->colormap[i].green))].green-luma;
+ image->colormap[i].blue=luma+color_correction.saturation*
+ cdl_map[ScaleQuantumToMap(ClampToQuantum(
+ image->colormap[i].blue))].blue-luma;
}
}
/*
}
for (x=0; x < (ssize_t) image->columns; x++)
{
- red=GetPixelRed(image,q);
- green=GetPixelGreen(image,q);
- blue=GetPixelBlue(image,q);
+ red=(double) GetPixelRed(image,q);
+ green=(double) GetPixelGreen(image,q);
+ blue=(double) GetPixelBlue(image,q);
Contrast(sign,&red,&green,&blue);
- SetPixelRed(image,red,q);
- SetPixelGreen(image,green,q);
- SetPixelBlue(image,blue,q);
+ SetPixelRed(image,ClampToQuantum(red),q);
+ SetPixelGreen(image,ClampToQuantum(green),q);
+ SetPixelBlue(image,ClampToQuantum(blue),q);
q+=GetPixelChannels(image);
}
if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
{
i=GetPixelChannelMapChannel(image,RedPixelChannel);
if (black[i] != white[i])
- image->colormap[j].red=ClampToQuantum(stretch_map[
- GetPixelChannels(image)*ScaleQuantumToMap(
- image->colormap[j].red)]+i);
+ image->colormap[j].red=stretch_map[GetPixelChannels(image)*
+ ScaleQuantumToMap(ClampToQuantum(image->colormap[j].red))]+i;
}
if ((GetPixelGreenTraits(image) & UpdatePixelTrait) != 0)
{
i=GetPixelChannelMapChannel(image,GreenPixelChannel);
if (black[i] != white[i])
- image->colormap[j].green=ClampToQuantum(stretch_map[
- GetPixelChannels(image)*ScaleQuantumToMap(
- image->colormap[j].green)]+i);
+ image->colormap[j].green=stretch_map[GetPixelChannels(image)*
+ ScaleQuantumToMap(ClampToQuantum(image->colormap[j].green))]+i;
}
if ((GetPixelBlueTraits(image) & UpdatePixelTrait) != 0)
{
i=GetPixelChannelMapChannel(image,BluePixelChannel);
if (black[i] != white[i])
- image->colormap[j].blue=ClampToQuantum(stretch_map[
- GetPixelChannels(image)*ScaleQuantumToMap(
- image->colormap[j].blue)]+i);
+ image->colormap[j].blue=stretch_map[GetPixelChannels(image)*
+ ScaleQuantumToMap(ClampToQuantum(image->colormap[j].blue))]+i;
}
if ((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0)
{
i=GetPixelChannelMapChannel(image,AlphaPixelChannel);
if (black[i] != white[i])
- image->colormap[j].alpha=ClampToQuantum(stretch_map[
- GetPixelChannels(image)*ScaleQuantumToMap(
- image->colormap[j].alpha)]+i);
+ image->colormap[j].alpha=stretch_map[GetPixelChannels(image)*
+ ScaleQuantumToMap(ClampToQuantum(image->colormap[j].alpha))]+i;
}
}
}
{
i=GetPixelChannelMapChannel(image,RedPixelChannel);
if (black[i] != white[i])
- image->colormap[j].red=ClampToQuantum(equalize_map[
- GetPixelChannels(image)*ScaleQuantumToMap(
- image->colormap[j].red)]+i);
+ image->colormap[j].red=equalize_map[GetPixelChannels(image)*
+ ScaleQuantumToMap(ClampToQuantum(image->colormap[j].red))]+i;
}
if (((GetPixelGreenTraits(image) & UpdatePixelTrait) != 0) &&
(white[i]!= black[i]))
{
i=GetPixelChannelMapChannel(image,GreenPixelChannel);
if (black[i] != white[i])
- image->colormap[j].green=ClampToQuantum(equalize_map[
- GetPixelChannels(image)*ScaleQuantumToMap(
- image->colormap[j].red)]+i);
+ image->colormap[j].green=equalize_map[GetPixelChannels(image)*
+ ScaleQuantumToMap(ClampToQuantum(image->colormap[j].green))]+i;
}
if (((GetPixelBlueTraits(image) & UpdatePixelTrait) != 0) &&
(white[i]!= black[i]))
{
i=GetPixelChannelMapChannel(image,BluePixelChannel);
if (black[i] != white[i])
- image->colormap[j].blue=ClampToQuantum(equalize_map[
- GetPixelChannels(image)*ScaleQuantumToMap(
- image->colormap[j].blue)]+i);
+ image->colormap[j].blue=equalize_map[GetPixelChannels(image)*
+ ScaleQuantumToMap(ClampToQuantum(image->colormap[j].blue))]+i;
}
if (((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0) &&
(white[i]!= black[i]))
{
i=GetPixelChannelMapChannel(image,AlphaPixelChannel);
if (black[i] != white[i])
- image->colormap[j].alpha=ClampToQuantum(equalize_map[
- GetPixelChannels(image)*ScaleQuantumToMap(
- image->colormap[j].alpha)]+i);
+ image->colormap[j].alpha=equalize_map[GetPixelChannels(image)*
+ ScaleQuantumToMap(ClampToQuantum(image->colormap[j].alpha))]+i;
}
}
}
CacheView
*image_view;
+ double
+ *gamma_map;
+
MagickBooleanType
status;
MagickOffsetType
progress;
- Quantum
- *gamma_map;
-
register ssize_t
i;
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
if (gamma == 1.0)
return(MagickTrue);
- gamma_map=(Quantum *) AcquireQuantumMemory(MaxMap+1UL,sizeof(*gamma_map));
- if (gamma_map == (Quantum *) NULL)
+ gamma_map=(double *) AcquireQuantumMemory(MaxMap+1UL,sizeof(*gamma_map));
+ if (gamma_map == (double *) NULL)
ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed",
image->filename);
(void) ResetMagickMemory(gamma_map,0,(MaxMap+1)*sizeof(*gamma_map));
#pragma omp parallel for
#endif
for (i=0; i <= (ssize_t) MaxMap; i++)
- gamma_map[i]=ClampToQuantum((MagickRealType) ScaleMapToQuantum((
- MagickRealType) (MaxMap*pow((double) i/MaxMap,1.0/gamma))));
+ gamma_map[i]=(MagickRealType) ScaleMapToQuantum((
+ MagickRealType) (MaxMap*pow((double) i/MaxMap,1.0/gamma)));
if (image->storage_class == PseudoClass)
{
/*
{
if ((GetPixelRedTraits(image) & UpdatePixelTrait) != 0)
image->colormap[i].red=gamma_map[
- ScaleQuantumToMap(image->colormap[i].red)];
+ ScaleQuantumToMap(ClampToQuantum(image->colormap[i].red))];
if ((GetPixelGreenTraits(image) & UpdatePixelTrait) != 0)
image->colormap[i].green=gamma_map[
- ScaleQuantumToMap(image->colormap[i].green)];
+ ScaleQuantumToMap(ClampToQuantum(image->colormap[i].green))];
if ((GetPixelBlueTraits(image) & UpdatePixelTrait) != 0)
image->colormap[i].blue=gamma_map[
- ScaleQuantumToMap(image->colormap[i].blue)];
+ ScaleQuantumToMap(ClampToQuantum(image->colormap[i].blue))];
if ((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0)
image->colormap[i].alpha=gamma_map[
- ScaleQuantumToMap(image->colormap[i].alpha)];
+ ScaleQuantumToMap(ClampToQuantum(image->colormap[i].alpha))];
}
}
/*
traits=GetPixelChannelMapTraits(image,(PixelChannel) i);
if ((traits & UpdatePixelTrait) != 0)
- q[i]=gamma_map[ScaleQuantumToMap(q[i])];
+ q[i]=ClampToQuantum(gamma_map[ScaleQuantumToMap(q[i])]);
}
q+=GetPixelChannels(image);
}
}
}
image_view=DestroyCacheView(image_view);
- gamma_map=(Quantum *) RelinquishMagickMemory(gamma_map);
+ gamma_map=(double *) RelinquishMagickMemory(gamma_map);
if (image->gamma != 0.0)
image->gamma*=gamma;
return(status);
Level colormap.
*/
if ((GetPixelRedTraits(image) & UpdatePixelTrait) != 0)
- image->colormap[i].red=LevelQuantum(image->colormap[i].red);
+ image->colormap[i].red=(double) LevelQuantum(
+ image->colormap[i].red);
if ((GetPixelGreenTraits(image) & UpdatePixelTrait) != 0)
- image->colormap[i].green=LevelQuantum(image->colormap[i].green);
+ image->colormap[i].green=(double) LevelQuantum(
+ image->colormap[i].green);
if ((GetPixelBlueTraits(image) & UpdatePixelTrait) != 0)
- image->colormap[i].blue=LevelQuantum(image->colormap[i].blue);
+ image->colormap[i].blue=(double) LevelQuantum(
+ image->colormap[i].blue);
if ((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0)
- image->colormap[i].alpha=LevelQuantum(image->colormap[i].alpha);
+ image->colormap[i].alpha=(double) LevelQuantum(
+ image->colormap[i].alpha);
}
/*
Level image.
Level colormap.
*/
if ((GetPixelRedTraits(image) & UpdatePixelTrait) != 0)
- image->colormap[i].red=LevelizeValue(image->colormap[i].red);
+ image->colormap[i].red=(double) LevelizeValue(
+ image->colormap[i].red);
if ((GetPixelGreenTraits(image) & UpdatePixelTrait) != 0)
- image->colormap[i].green=LevelizeValue(image->colormap[i].green);
+ image->colormap[i].green=(double) LevelizeValue(
+ image->colormap[i].green);
if ((GetPixelBlueTraits(image) & UpdatePixelTrait) != 0)
- image->colormap[i].blue=LevelizeValue(image->colormap[i].blue);
+ image->colormap[i].blue=(double) LevelizeValue(
+ image->colormap[i].blue);
if ((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0)
- image->colormap[i].alpha=LevelizeValue(image->colormap[i].alpha);
+ image->colormap[i].alpha=(double) LevelizeValue(
+ image->colormap[i].alpha);
}
/*
Level image.
}
for (x=0; x < (ssize_t) image->columns; x++)
{
- red=GetPixelRed(image,q);
- green=GetPixelGreen(image,q);
- blue=GetPixelBlue(image,q);
+ red=(double) GetPixelRed(image,q);
+ green=(double) GetPixelGreen(image,q);
+ blue=(double) GetPixelBlue(image,q);
switch (colorspace)
{
case HSBColorspace:
for (i=0; i < (ssize_t) image->colors; i++)
{
if ((GetPixelRedTraits(image) & UpdatePixelTrait) != 0)
- image->colormap[i].red=ClampToQuantum(sigmoidal_map[
- ScaleQuantumToMap(image->colormap[i].red)]);
+ image->colormap[i].red=sigmoidal_map[ScaleQuantumToMap(
+ ClampToQuantum(image->colormap[i].red))];
if ((GetPixelGreenTraits(image) & UpdatePixelTrait) != 0)
- image->colormap[i].green=ClampToQuantum(sigmoidal_map[
- ScaleQuantumToMap(image->colormap[i].green)]);
+ image->colormap[i].green=sigmoidal_map[ScaleQuantumToMap(
+ ClampToQuantum(image->colormap[i].green))];
if ((GetPixelBlueTraits(image) & UpdatePixelTrait) != 0)
- image->colormap[i].blue=ClampToQuantum(sigmoidal_map[
- ScaleQuantumToMap(image->colormap[i].blue)]);
+ image->colormap[i].blue=sigmoidal_map[ScaleQuantumToMap(
+ ClampToQuantum(image->colormap[i].blue))];
if ((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0)
- image->colormap[i].alpha=ClampToQuantum(sigmoidal_map[
- ScaleQuantumToMap(image->colormap[i].alpha)]);
+ image->colormap[i].alpha=sigmoidal_map[ScaleQuantumToMap(
+ ClampToQuantum(image->colormap[i].alpha))];
}
}
/*
lightness,
saturation;
- ConvertRGBToHSL(ClampToQuantum(pixel.red),ClampToQuantum(pixel.green),
- ClampToQuantum(pixel.blue),&hue,&saturation,&lightness);
+ ConvertRGBToHSL(pixel.red,pixel.green,pixel.blue,&hue,&saturation,
+ &lightness);
return(hue);
}
break;
lightness,
saturation;
- ConvertRGBToHSL(ClampToQuantum(pixel.red),ClampToQuantum(pixel.green),
- ClampToQuantum(pixel.blue),&hue,&saturation,&lightness);
+ ConvertRGBToHSL(pixel.red,pixel.green,pixel.blue,&hue,&saturation,
+ &lightness);
return(lightness);
}
if (LocaleCompare(symbol,"luminance") == 0)
lightness,
saturation;
- ConvertRGBToHSL(ClampToQuantum(pixel.red),ClampToQuantum(pixel.green),
- ClampToQuantum(pixel.blue),&hue,&saturation,&lightness);
+ ConvertRGBToHSL(pixel.red,pixel.green,pixel.blue,&hue,&saturation,
+ &lightness);
return(saturation);
}
if (LocaleNCompare(symbol,"skewness",8) == 0)
return(plasma);
}
-static MagickBooleanType PlasmaImageProxy(Image *image,
- CacheView *image_view,RandomInfo *random_info,const SegmentInfo *segment,
- size_t attenuate,size_t depth,ExceptionInfo *exception)
+static MagickBooleanType PlasmaImageProxy(Image *image,CacheView *image_view,
+ CacheView *u_view,CacheView *v_view,RandomInfo *random_info,
+ const SegmentInfo *segment,size_t attenuate,size_t depth,
+ ExceptionInfo *exception)
{
MagickRealType
plasma;
- PixelPacket
- u,
- v;
+ PixelChannel
+ channel;
+
+ PixelTrait
+ traits;
+
+ register const Quantum
+ *restrict u,
+ *restrict v;
+
+ register Quantum
+ *restrict q;
+
+ register ssize_t
+ i;
ssize_t
x,
local_info=(*segment);
local_info.x2=(double) x_mid;
local_info.y2=(double) y_mid;
- (void) PlasmaImageProxy(image,image_view,random_info,&local_info,
- attenuate,depth,exception);
+ (void) PlasmaImageProxy(image,image_view,u_view,v_view,random_info,
+ &local_info,attenuate,depth,exception);
local_info=(*segment);
local_info.y1=(double) y_mid;
local_info.x2=(double) x_mid;
- (void) PlasmaImageProxy(image,image_view,random_info,&local_info,
- attenuate,depth,exception);
+ (void) PlasmaImageProxy(image,image_view,u_view,v_view,random_info,
+ &local_info,attenuate,depth,exception);
local_info=(*segment);
local_info.x1=(double) x_mid;
local_info.y2=(double) y_mid;
- (void) PlasmaImageProxy(image,image_view,random_info,&local_info,
- attenuate,depth,exception);
+ (void) PlasmaImageProxy(image,image_view,u_view,v_view,random_info,
+ &local_info,attenuate,depth,exception);
local_info=(*segment);
local_info.x1=(double) x_mid;
local_info.y1=(double) y_mid;
- return(PlasmaImageProxy(image,image_view,random_info,&local_info,
- attenuate,depth,exception));
+ return(PlasmaImageProxy(image,image_view,u_view,v_view,random_info,
+ &local_info,attenuate,depth,exception));
}
x_mid=(ssize_t) ceil((segment->x1+segment->x2)/2-0.5);
y_mid=(ssize_t) ceil((segment->y1+segment->y2)/2-0.5);
plasma=(MagickRealType) QuantumRange/(2.0*attenuate);
if ((segment->x1 != (double) x_mid) || (segment->x2 != (double) x_mid))
{
- register Quantum
- *restrict q;
-
/*
Left pixel.
*/
x=(ssize_t) ceil(segment->x1-0.5);
- (void) GetOneCacheViewVirtualPixel(image_view,x,(ssize_t)
- ceil(segment->y1-0.5),&u,exception);
- (void) GetOneCacheViewVirtualPixel(image_view,x,(ssize_t)
- ceil(segment->y2-0.5),&v,exception);
+ u=GetCacheViewVirtualPixels(u_view,x,(ssize_t) ceil(segment->y1-0.5),
+ 1,1,exception);
+ v=GetCacheViewVirtualPixels(v_view,x,(ssize_t) ceil(segment->y2-0.5),
+ 1,1,exception);
q=QueueCacheViewAuthenticPixels(image_view,x,y_mid,1,1,exception);
- if (q == (Quantum *) NULL)
+ if ((u == (const Quantum *) NULL) || (v == (const Quantum *) NULL) ||
+ (q == (Quantum *) NULL))
return(MagickTrue);
- SetPixelRed(image,PlasmaPixel(random_info,(MagickRealType)
- (u.red+v.red)/2.0,plasma),q);
- SetPixelGreen(image,PlasmaPixel(random_info,(MagickRealType)
- (u.green+v.green)/2.0,plasma),q);
- SetPixelBlue(image,PlasmaPixel(random_info,(MagickRealType)
- (u.blue+v.blue)/2.0,plasma),q);
+ for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
+ {
+ traits=GetPixelChannelMapTraits(image,(PixelChannel) i);
+ channel=GetPixelChannelMapChannel(image,(PixelChannel) i);
+ if (traits == UndefinedPixelTrait)
+ continue;
+ q[i]=PlasmaPixel(random_info,(u[channel]+v[channel])/2.0,plasma);
+ }
(void) SyncCacheViewAuthenticPixels(image_view,exception);
if (segment->x1 != segment->x2)
{
Right pixel.
*/
x=(ssize_t) ceil(segment->x2-0.5);
- (void) GetOneCacheViewVirtualPixel(image_view,x,(ssize_t)
- ceil(segment->y1-0.5),&u,exception);
- (void) GetOneCacheViewVirtualPixel(image_view,x,(ssize_t)
- ceil(segment->y2-0.5),&v,exception);
+ u=GetCacheViewVirtualPixels(u_view,x,(ssize_t) ceil(segment->y1-0.5),
+ 1,1,exception);
+ v=GetCacheViewVirtualPixels(v_view,x,(ssize_t) ceil(segment->y2-0.5),
+ 1,1,exception);
q=QueueCacheViewAuthenticPixels(image_view,x,y_mid,1,1,exception);
- if (q == (Quantum *) NULL)
+ if ((u == (const Quantum *) NULL) || (v == (const Quantum *) NULL) ||
+ (q == (Quantum *) NULL))
return(MagickTrue);
- SetPixelRed(image,PlasmaPixel(random_info,(MagickRealType)
- (u.red+v.red)/2.0,plasma),q);
- SetPixelGreen(image,PlasmaPixel(random_info,(MagickRealType)
- (u.green+v.green)/2.0,plasma),q);
- SetPixelBlue(image,PlasmaPixel(random_info,(MagickRealType)
- (u.blue+v.blue)/2.0,plasma),q);
+ for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
+ {
+ traits=GetPixelChannelMapTraits(image,(PixelChannel) i);
+ channel=GetPixelChannelMapChannel(image,(PixelChannel) i);
+ if (traits == UndefinedPixelTrait)
+ continue;
+ q[i]=PlasmaPixel(random_info,(u[channel]+v[channel])/2.0,plasma);
+ }
(void) SyncCacheViewAuthenticPixels(image_view,exception);
}
}
{
if ((segment->x1 != (double) x_mid) || (segment->y2 != (double) y_mid))
{
- register Quantum
- *restrict q;
-
/*
Bottom pixel.
*/
y=(ssize_t) ceil(segment->y2-0.5);
- (void) GetOneCacheViewVirtualPixel(image_view,(ssize_t)
- ceil(segment->x1-0.5),y,&u,exception);
- (void) GetOneCacheViewVirtualPixel(image_view,(ssize_t)
- ceil(segment->x2-0.5),y,&v,exception);
+ u=GetCacheViewVirtualPixels(u_view,(ssize_t) ceil(segment->x1-0.5),y,
+ 1,1,exception);
+ v=GetCacheViewVirtualPixels(v_view,(ssize_t) ceil(segment->x2-0.5),y,
+ 1,1,exception);
q=QueueCacheViewAuthenticPixels(image_view,x_mid,y,1,1,exception);
- if (q == (Quantum *) NULL)
+ if ((u == (const Quantum *) NULL) || (v == (const Quantum *) NULL) ||
+ (q == (Quantum *) NULL))
return(MagickTrue);
- SetPixelRed(image,PlasmaPixel(random_info,(MagickRealType)
- (u.red+v.red)/2.0,plasma),q);
- SetPixelGreen(image,PlasmaPixel(random_info,(MagickRealType)
- (u.green+v.green)/2.0,plasma),q);
- SetPixelBlue(image,PlasmaPixel(random_info,(MagickRealType)
- (u.blue+v.blue)/2.0,plasma),q);
+ for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
+ {
+ traits=GetPixelChannelMapTraits(image,(PixelChannel) i);
+ channel=GetPixelChannelMapChannel(image,(PixelChannel) i);
+ if (traits == UndefinedPixelTrait)
+ continue;
+ q[i]=PlasmaPixel(random_info,(u[channel]+v[channel])/2.0,plasma);
+ }
(void) SyncCacheViewAuthenticPixels(image_view,exception);
}
if (segment->y1 != segment->y2)
{
- register Quantum
- *restrict q;
-
/*
Top pixel.
*/
y=(ssize_t) ceil(segment->y1-0.5);
- (void) GetOneCacheViewVirtualPixel(image_view,(ssize_t)
- ceil(segment->x1-0.5),y,&u,exception);
- (void) GetOneCacheViewVirtualPixel(image_view,(ssize_t)
- ceil(segment->x2-0.5),y,&v,exception);
+ u=GetCacheViewVirtualPixels(u_view,(ssize_t) ceil(segment->x1-0.5),y,
+ 1,1,exception);
+ v=GetCacheViewVirtualPixels(v_view,(ssize_t) ceil(segment->x2-0.5),y,
+ 1,1,exception);
q=QueueCacheViewAuthenticPixels(image_view,x_mid,y,1,1,exception);
- if (q == (Quantum *) NULL)
+ if ((u == (const Quantum *) NULL) || (v == (const Quantum *) NULL) ||
+ (q == (Quantum *) NULL))
return(MagickTrue);
- SetPixelRed(image,PlasmaPixel(random_info,(MagickRealType)
- (u.red+v.red)/2.0,plasma),q);
- SetPixelGreen(image,PlasmaPixel(random_info,(MagickRealType)
- (u.green+v.green)/2.0,plasma),q);
- SetPixelBlue(image,PlasmaPixel(random_info,(MagickRealType)
- (u.blue+v.blue)/2.0,plasma),q);
+ for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
+ {
+ traits=GetPixelChannelMapTraits(image,(PixelChannel) i);
+ channel=GetPixelChannelMapChannel(image,(PixelChannel) i);
+ if (traits == UndefinedPixelTrait)
+ continue;
+ q[i]=PlasmaPixel(random_info,(u[channel]+v[channel])/2.0,plasma);
+ }
(void) SyncCacheViewAuthenticPixels(image_view,exception);
}
}
if ((segment->x1 != segment->x2) || (segment->y1 != segment->y2))
{
- register Quantum
- *restrict q;
-
/*
Middle pixel.
*/
x=(ssize_t) ceil(segment->x1-0.5);
y=(ssize_t) ceil(segment->y1-0.5);
- (void) GetOneVirtualPixel(image,x,y,&u,exception);
+ u=GetCacheViewVirtualPixels(u_view,x,y,1,1,exception);
x=(ssize_t) ceil(segment->x2-0.5);
y=(ssize_t) ceil(segment->y2-0.5);
- (void) GetOneCacheViewVirtualPixel(image_view,x,y,&v,exception);
+ v=GetCacheViewVirtualPixels(v_view,x,y,1,1,exception);
q=QueueCacheViewAuthenticPixels(image_view,x_mid,y_mid,1,1,exception);
- if (q == (Quantum *) NULL)
+ if ((u == (const Quantum *) NULL) || (v == (const Quantum *) NULL) ||
+ (q == (Quantum *) NULL))
return(MagickTrue);
- SetPixelRed(image,PlasmaPixel(random_info,(MagickRealType)
- (u.red+v.red)/2.0,plasma),q);
- SetPixelGreen(image,PlasmaPixel(random_info,(MagickRealType)
- (u.green+v.green)/2.0,plasma),q);
- SetPixelBlue(image,PlasmaPixel(random_info,(MagickRealType)
- (u.blue+v.blue)/2.0,plasma),q);
+ for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
+ {
+ traits=GetPixelChannelMapTraits(image,(PixelChannel) i);
+ channel=GetPixelChannelMapChannel(image,(PixelChannel) i);
+ if (traits == UndefinedPixelTrait)
+ continue;
+ q[i]=PlasmaPixel(random_info,(u[channel]+v[channel])/2.0,plasma);
+ }
(void) SyncCacheViewAuthenticPixels(image_view,exception);
}
if (((segment->x2-segment->x1) < 3.0) && ((segment->y2-segment->y1) < 3.0))
return(MagickTrue);
return(MagickFalse);
}
-\f
+
MagickExport MagickBooleanType PlasmaImage(Image *image,
const SegmentInfo *segment,size_t attenuate,size_t depth,
ExceptionInfo *exception)
{
CacheView
- *image_view;
+ *image_view,
+ *u_view,
+ *v_view;
MagickBooleanType
status;
if (SetImageStorageClass(image,DirectClass,exception) == MagickFalse)
return(MagickFalse);
image_view=AcquireCacheView(image);
+ u_view=AcquireCacheView(image);
+ v_view=AcquireCacheView(image);
random_info=AcquireRandomInfo();
- status=PlasmaImageProxy(image,image_view,random_info,segment,attenuate,depth,
- exception);
+ status=PlasmaImageProxy(image,image_view,u_view,v_view,random_info,segment,
+ attenuate,depth,exception);
random_info=DestroyRandomInfo(random_info);
+ v_view=DestroyCacheView(v_view);
+ u_view=DestroyCacheView(u_view);
image_view=DestroyCacheView(image_view);
return(status);
}
/*
Shadow image.
*/
- SetImageBackgroundColor(border_image);
+ (void) SetImageBackgroundColor(border_image);
channel_mask=SetPixelChannelMask(border_image,AlphaChannel);
shadow_image=BlurImage(border_image,0.0,sigma,image->bias,exception);
(void) SetPixelChannelMap(border_image,channel_mask);
{
for (x=0; (x < (ssize_t) watermark->columns) && (j < (ssize_t) depth); x++)
{
- (void) GetOneCacheViewVirtualPixel(watermark_view,x,y,&pixel,exception);
+ Quantum
+ virtual_pixel[MaxPixelChannels];
+
+ (void) GetOneCacheViewVirtualPixel(watermark_view,x,y,virtual_pixel,
+ exception);
+ pixel.red=(double) virtual_pixel[RedPixelChannel];
+ pixel.green=(double) virtual_pixel[GreenPixelChannel];
+ pixel.blue=(double) virtual_pixel[BluePixelChannel];
+ pixel.alpha=(double) virtual_pixel[AlphaPixelChannel];
if ((k/(ssize_t) stegano_image->columns) >= (ssize_t) stegano_image->rows)
break;
q=GetCacheViewAuthenticPixels(stegano_view,k % (ssize_t)
/* #undef AUTOTRACE_DELEGATE */
/* Define if coders and filters are to be built as modules. */
-#ifndef MAGICKCORE_BUILD_MODULES
-#define MAGICKCORE_BUILD_MODULES 1
-#endif
+/* #undef BUILD_MODULES */
/* Define if you have the bzip2 library */
#ifndef MAGICKCORE_BZLIB_DELEGATE
#endif
/* Define if you have FFTW library */
-#ifndef MAGICKCORE_FFTW_DELEGATE
-#define MAGICKCORE_FFTW_DELEGATE 1
-#endif
+/* #undef FFTW_DELEGATE */
/* Location of filter modules */
#ifndef MAGICKCORE_FILTER_PATH
#endif
/* Define to 1 if you have the <CL/cl.h> header file. */
-#ifndef MAGICKCORE_HAVE_CL_CL_H
-#define MAGICKCORE_HAVE_CL_CL_H 1
-#endif
+/* #undef HAVE_CL_CL_H */
/* Define to 1 if you have the <complex.h> header file. */
#ifndef MAGICKCORE_HAVE_COMPLEX_H
#endif
/* Define if you have the <lcms2.h> header file. */
-/* #undef HAVE_LCMS2_H */
+#ifndef MAGICKCORE_HAVE_LCMS2_H
+#define MAGICKCORE_HAVE_LCMS2_H 1
+#endif
/* Define if you have the <lcms2/lcms2.h> header file. */
/* #undef HAVE_LCMS2_LCMS2_H */
/* Define if you have the <lcms.h> header file. */
-#ifndef MAGICKCORE_HAVE_LCMS_H
-#define MAGICKCORE_HAVE_LCMS_H 1
-#endif
+/* #undef HAVE_LCMS_H */
/* Define if you have the <lcms/lcms.h> header file. */
/* #undef HAVE_LCMS_LCMS_H */
#endif
/* Define if you have JBIG library */
-#ifndef MAGICKCORE_JBIG_DELEGATE
-#define MAGICKCORE_JBIG_DELEGATE 1
-#endif
+/* #undef JBIG_DELEGATE */
/* Define if you have JPEG version 2 "Jasper" library */
#ifndef MAGICKCORE_JP2_DELEGATE
#endif
/* Define if you have LQR library */
-#ifndef MAGICKCORE_LQR_DELEGATE
-#define MAGICKCORE_LQR_DELEGATE 1
-#endif
+/* #undef LQR_DELEGATE */
/* Define if using libltdl to support dynamically loadable modules */
#ifndef MAGICKCORE_LTDL_DELEGATE
/* Define to the system default library search path. */
#ifndef MAGICKCORE_LT_DLSEARCH_PATH
-#define MAGICKCORE_LT_DLSEARCH_PATH "/lib64:/usr/lib64:/lib:/usr/lib:/usr/lib64/R/lib:/usr/lib64/atlas:/opt/modules/pkg/intel/f77/10.0.025/lib:/opt/intel/lib/intel64:/usr/lib64/llvm:/usr/local/lib:/usr/lib64/mysql:/usr/lib64/nvidia:/usr/lib64/qt-3.3/lib:/usr/lib64/xulrunner-2"
+#define MAGICKCORE_LT_DLSEARCH_PATH "/lib64:/usr/lib64:/lib:/usr/lib:/usr/lib64/atlas:/usr/lib/llvm:/usr/lib64/llvm:/usr/lib64/mysql:/usr/lib64/qt-3.3/lib:/usr/lib64/tcl8.5/tclx8.4:/usr/lib64/tcl8.5:/usr/lib/wine/:/usr/lib64/wine/:/usr/lib64/xulrunner-2"
#endif
/* The archive extension */
/* #undef NO_MINUS_C_MINUS_O */
/* Define if you have OPENEXR library */
-#ifndef MAGICKCORE_OPENEXR_DELEGATE
-#define MAGICKCORE_OPENEXR_DELEGATE 1
-#endif
+/* #undef OPENEXR_DELEGATE */
/* Define to the address where bug reports for this package should be sent. */
#ifndef MAGICKCORE_PACKAGE_BUGREPORT
#endif
/* Define if you have RSVG library */
-#ifndef MAGICKCORE_RSVG_DELEGATE
-#define MAGICKCORE_RSVG_DELEGATE 1
-#endif
+/* #undef RSVG_DELEGATE */
/* Define to the type of arg 1 for `select'. */
#ifndef MAGICKCORE_SELECT_TYPE_ARG1
/* Define if you have WEBP library */
-#ifndef MAGICKCORE_WEBP_DELEGATE
-#define MAGICKCORE_WEBP_DELEGATE 1
-#endif
+/* #undef WEBP_DELEGATE */
/* Define to use the Windows GDI32 library */
/* #undef WINGDI32_DELEGATE */
/* #undef WITH_DMALLOC */
/* Define if you have WMF library */
-#ifndef MAGICKCORE_WMF_DELEGATE
-#define MAGICKCORE_WMF_DELEGATE 1
-#endif
+/* #undef WMF_DELEGATE */
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
/* #undef _MINIX */
/* Define this for the OpenCL Accelerator */
-#ifndef MAGICKCORE__OPENCL
-#define MAGICKCORE__OPENCL 1
-#endif
+/* #undef _OPENCL */
/* Define to 2 if the system does not provide POSIX.1 features except with
this defined. */
static inline void GetPixelPacketPixel(const Image *image,const Quantum *pixel,
PixelPacket *packet)
{
- packet->red=pixel[image->channel_map[RedPixelChannel].channel];
- packet->green=pixel[image->channel_map[GreenPixelChannel].channel];
- packet->blue=pixel[image->channel_map[BluePixelChannel].channel];
- packet->alpha=pixel[image->channel_map[AlphaPixelChannel].channel];
+ packet->red=(double) pixel[image->channel_map[RedPixelChannel].channel];
+ packet->green=(double) pixel[image->channel_map[GreenPixelChannel].channel];
+ packet->blue=(double) pixel[image->channel_map[BluePixelChannel].channel];
+ packet->alpha=(double) pixel[image->channel_map[AlphaPixelChannel].channel];
}
static inline Quantum GetPixelPacketIntensity(const PixelPacket *pixel)
{
#if !defined(MAGICKCORE_HDRI_SUPPORT)
if ((pixel->red == pixel->green) && (pixel->green == pixel->blue))
- return(pixel->red);
+ return((Quantum) pixel->red);
return((Quantum) (0.299*pixel->red+0.587*pixel->green+0.114*pixel->blue+0.5));
#else
{
alpha=pixel->red-pixel->green;
beta=pixel->green-pixel->blue;
if ((fabs(alpha) <= MagickEpsilon) && (fabs(beta) <= MagickEpsilon))
- return(pixel->red);
+ return((Quantum) pixel->red);
return((Quantum) (0.299*pixel->red+0.587*pixel->green+0.114*pixel->blue));
}
#endif
static inline MagickBooleanType IsPixelEquivalent(const Image *image,
const Quantum *p,const PixelPacket *q)
{
- if ((p[image->channel_map[RedPixelChannel].channel] == q->red) &&
- (p[image->channel_map[GreenPixelChannel].channel] == q->green) &&
- (p[image->channel_map[BluePixelChannel].channel] == q->blue))
+ if (((double) p[image->channel_map[RedPixelChannel].channel] == q->red) &&
+ ((double) p[image->channel_map[GreenPixelChannel].channel] == q->green) &&
+ ((double) p[image->channel_map[BluePixelChannel].channel] == q->blue))
return(MagickTrue);
return(MagickFalse);
}
static inline void SetPacketPixelInfo(const Image *image,
const PixelInfo *pixel_info,PixelPacket *packet)
{
- packet->red=ClampToQuantum(pixel_info->red);
- packet->green=ClampToQuantum(pixel_info->green);
- packet->blue=ClampToQuantum(pixel_info->blue);
- packet->alpha=ClampToQuantum(pixel_info->alpha);
+ packet->red=pixel_info->red;
+ packet->green=pixel_info->green;
+ packet->blue=pixel_info->blue;
+ packet->alpha=pixel_info->alpha;
if (image->colorspace == CMYKColorspace)
- packet->black=ClampToQuantum(pixel_info->black);
+ packet->black=pixel_info->black;
if (image->storage_class == PseudoClass)
- packet->index=ClampToQuantum(pixel_info->index);
+ packet->index=pixel_info->index;
}
static inline void SetPixelAlpha(const Image *image,const Quantum alpha,
static inline void SetPixelPacket(const Image *image,const PixelPacket *packet,
Quantum *pixel)
{
- pixel[image->channel_map[RedPixelChannel].channel]=packet->red;
- pixel[image->channel_map[GreenPixelChannel].channel]=packet->green;
- pixel[image->channel_map[BluePixelChannel].channel]=packet->blue;
- pixel[image->channel_map[AlphaPixelChannel].channel]=packet->alpha;
+ pixel[image->channel_map[RedPixelChannel].channel]=
+ ClampToQuantum(packet->red);
+ pixel[image->channel_map[GreenPixelChannel].channel]=
+ ClampToQuantum(packet->green);
+ pixel[image->channel_map[BluePixelChannel].channel]=
+ ClampToQuantum(packet->blue);
+ pixel[image->channel_map[AlphaPixelChannel].channel]=
+ ClampToQuantum(packet->alpha);
}
static inline void SetPixelPixelInfo(const Image *image,
*/
#define MagickPackageName "ImageMagick"
#define MagickCopyright "Copyright (C) 1999-2011 ImageMagick Studio LLC"
-#define MagickSVNRevision "exported"
+#define MagickSVNRevision "5446"
#define MagickLibVersion 0x700
#define MagickLibVersionText "7.0.0"
#define MagickLibVersionNumber 7,0,0
<configure name="LIB_VERSION" value="0x700"/>
<configure name="LIB_VERSION_NUMBER" value="7,0,0,0"/>
<configure name="SVN_REVISION" value="5446" />
- <configure name="RELEASE_DATE" value="2011-09-28"/>
+ <configure name="RELEASE_DATE" value="2011-10-02"/>
<configure name="CONFIGURE" value="./configure "/>
<configure name="PREFIX" value="/usr/local"/>
<configure name="EXEC-PREFIX" value="/usr/local"/>