#include "MagickCore/cache-view.h"
#include "MagickCore/color.h"
#include "MagickCore/color-private.h"
+#include "MagickCore/colorspace-private.h"
#include "MagickCore/composite.h"
#include "MagickCore/decorate.h"
#include "MagickCore/distort.h"
*noise_image;
MagickBooleanType
+ concurrent,
status;
MagickOffsetType
status=MagickTrue;
progress=0;
random_info=AcquireRandomInfoThreadSet();
+ concurrent=GetRandomSecretKey(random_info[0]) == ~0UL ? MagickTrue :
+ MagickFalse;
image_view=AcquireCacheView(image);
noise_view=AcquireCacheView(noise_image);
#if defined(MAGICKCORE_OPENMP_SUPPORT)
- #pragma omp parallel for schedule(dynamic,4) shared(progress,status)
+ #pragma omp parallel for schedule(static,4) shared(progress,status) omp_concurrent(concurrent)
#endif
for (y=0; y < (ssize_t) image->rows; y++)
{
if (status == MagickFalse)
continue;
p=GetCacheViewVirtualPixels(image_view,0,y,image->columns,1,exception);
- q=GetCacheViewAuthenticPixels(noise_view,0,y,noise_image->columns,1,
+ q=QueueCacheViewAuthenticPixels(noise_view,0,y,noise_image->columns,1,
exception);
if ((p == (const Quantum *) NULL) || (q == (Quantum *) NULL))
{
register ssize_t
i;
+ if (GetPixelMask(image,p) != 0)
+ {
+ p+=GetPixelChannels(image);
+ q+=GetPixelChannels(noise_image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
assert(exception != (ExceptionInfo *) NULL);
assert(exception->signature == MagickSignature);
- shift_image=CloneImage(image,image->columns,image->rows,MagickTrue,
- exception);
+ shift_image=CloneImage(image,image->columns,image->rows,MagickTrue,exception);
if (shift_image == (Image *) NULL)
return((Image *) NULL);
if (SetImageStorageClass(shift_image,DirectClass,exception) == MagickFalse)
image_view=AcquireCacheView(image);
shift_view=AcquireCacheView(shift_image);
#if defined(MAGICKCORE_OPENMP_SUPPORT)
- #pragma omp parallel for schedule(dynamic,4) shared(progress,status)
+ #pragma omp parallel for schedule(static,4) shared(progress,status)
#endif
for (y=0; y < (ssize_t) image->rows; y++)
{
proceed;
#if defined(MAGICKCORE_OPENMP_SUPPORT)
- #pragma omp critical (MagickCore_BlueShiftImage)
+ #pragma omp critical (MagickCore_BlueShiftImage)
#endif
proceed=SetImageProgress(image,BlueShiftImageTag,progress++,
image->rows);
% The format of the CharcoalImage method is:
%
% Image *CharcoalImage(const Image *image,const double radius,
-% const double sigma,const double bias,ExceptionInfo *exception)
+% const double sigma,ExceptionInfo *exception)
%
% A description of each parameter follows:
%
%
% o sigma: the standard deviation of the Gaussian, in pixels.
%
-% o bias: the bias.
-%
% o exception: return any errors or warnings in this structure.
%
*/
MagickExport Image *CharcoalImage(const Image *image,const double radius,
- const double sigma,const double bias,ExceptionInfo *exception)
+ const double sigma,ExceptionInfo *exception)
{
Image
*charcoal_image,
clone_image=DestroyImage(clone_image);
if (edge_image == (Image *) NULL)
return((Image *) NULL);
- charcoal_image=BlurImage(edge_image,radius,sigma,bias,exception);
+ charcoal_image=BlurImage(edge_image,radius,sigma,exception);
edge_image=DestroyImage(edge_image);
if (charcoal_image == (Image *) NULL)
return((Image *) NULL);
const PixelInfo *colorize,ExceptionInfo *exception)
{
#define ColorizeImageTag "Colorize/Image"
+#define Colorize(pixel,blend_percentage,colorize) \
+ (pixel)=((pixel)*(100.0-(blend_percentage))+(colorize)*(blend_percentage))/100.0;
CacheView
*colorize_view,
flags;
PixelInfo
- pixel;
+ blend_percentage;
ssize_t
y;
colorize_image=DestroyImage(colorize_image);
return((Image *) NULL);
}
+ if ((IsGrayColorspace(image->colorspace) != MagickFalse) &&
+ (IsPixelInfoGray(colorize) != MagickFalse))
+ (void) SetImageColorspace(colorize_image,sRGBColorspace,exception);
+ if ((colorize_image->matte == MagickFalse) &&
+ (colorize->matte != MagickFalse))
+ (void) SetImageAlpha(colorize_image,OpaqueAlpha,exception);
if (blend == (const char *) NULL)
return(colorize_image);
- /*
- Determine RGB values of the pen color.
- */
- GetPixelInfo(image,&pixel);
+ GetPixelInfo(image,&blend_percentage);
flags=ParseGeometry(blend,&geometry_info);
- pixel.red=geometry_info.rho;
- pixel.green=geometry_info.rho;
- pixel.blue=geometry_info.rho;
- pixel.alpha=100.0;
+ blend_percentage.red=geometry_info.rho;
+ blend_percentage.green=geometry_info.rho;
+ blend_percentage.blue=geometry_info.rho;
+ blend_percentage.black=geometry_info.rho;
+ blend_percentage.alpha=geometry_info.rho;
if ((flags & SigmaValue) != 0)
- pixel.green=geometry_info.sigma;
+ blend_percentage.green=geometry_info.sigma;
if ((flags & XiValue) != 0)
- pixel.blue=geometry_info.xi;
+ blend_percentage.blue=geometry_info.xi;
if ((flags & PsiValue) != 0)
- pixel.alpha=geometry_info.psi;
- if (pixel.colorspace == CMYKColorspace)
+ blend_percentage.alpha=geometry_info.psi;
+ if (blend_percentage.colorspace == CMYKColorspace)
{
- pixel.black=geometry_info.rho;
if ((flags & PsiValue) != 0)
- pixel.black=geometry_info.psi;
+ blend_percentage.black=geometry_info.psi;
if ((flags & ChiValue) != 0)
- pixel.alpha=geometry_info.chi;
+ blend_percentage.alpha=geometry_info.chi;
}
/*
Colorize DirectClass image.
image_view=AcquireCacheView(image);
colorize_view=AcquireCacheView(colorize_image);
#if defined(MAGICKCORE_OPENMP_SUPPORT)
- #pragma omp parallel for schedule(dynamic,4) shared(progress,status)
+ #pragma omp parallel for schedule(static,4) shared(progress,status)
#endif
for (y=0; y < (ssize_t) image->rows; y++)
{
MagickBooleanType
sync;
+ PixelInfo
+ pixel;
+
register const Quantum
*restrict p;
status=MagickFalse;
continue;
}
+ GetPixelInfo(colorize_image,&pixel);
for (x=0; x < (ssize_t) image->columns; x++)
{
- register ssize_t
- i;
-
- for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
- {
- PixelChannel
- channel;
-
- PixelTrait
- colorize_traits,
- traits;
-
- channel=GetPixelChannelMapChannel(image,i);
- traits=GetPixelChannelMapTraits(image,channel);
- colorize_traits=GetPixelChannelMapTraits(colorize_image,channel);
- if ((traits == UndefinedPixelTrait) ||
- (colorize_traits == UndefinedPixelTrait))
- continue;
- if ((colorize_traits & CopyPixelTrait) != 0)
- {
- SetPixelChannel(colorize_image,channel,p[i],q);
- continue;
- }
- switch (channel)
+ if (GetPixelMask(colorize_image,q) != 0)
{
- case RedPixelChannel:
- {
- SetPixelChannel(colorize_image,channel,ClampToQuantum((p[i]*
- (100.0-pixel.red)+colorize->red*pixel.red)/100.0),q);
- break;
- }
- case GreenPixelChannel:
- {
- SetPixelChannel(colorize_image,channel,ClampToQuantum((p[i]*
- (100.0-pixel.green)+colorize->green*pixel.green)/100.0),q);
- break;
- }
- case BluePixelChannel:
- {
- SetPixelChannel(colorize_image,channel,ClampToQuantum((p[i]*
- (100.0-pixel.blue)+colorize->blue*pixel.blue)/100.0),q);
- break;
- }
- case BlackPixelChannel:
- {
- SetPixelChannel(colorize_image,channel,ClampToQuantum((p[i]*
- (100.0-pixel.black)+colorize->black*pixel.black)/100.0),q);
- break;
- }
- case AlphaPixelChannel:
- {
- SetPixelChannel(colorize_image,channel,ClampToQuantum((p[i]*
- (100.0-pixel.alpha)+colorize->alpha*pixel.alpha)/100.0),q);
- break;
- }
- default:
- {
- SetPixelChannel(colorize_image,channel,p[i],q);
- break;
- }
+ p+=GetPixelChannels(image);
+ q+=GetPixelChannels(colorize_image);
+ continue;
}
- }
+ GetPixelInfoPixel(image,p,&pixel);
+ Colorize(pixel.red,blend_percentage.red,colorize->red);
+ Colorize(pixel.green,blend_percentage.green,colorize->green);
+ Colorize(pixel.blue,blend_percentage.blue,colorize->blue);
+ Colorize(pixel.black,blend_percentage.black,colorize->black);
+ Colorize(pixel.alpha,blend_percentage.alpha,colorize->alpha);
+ SetPixelInfoPixel(colorize_image,&pixel,q);
p+=GetPixelChannels(image);
q+=GetPixelChannels(colorize_image);
}
proceed;
#if defined(MAGICKCORE_OPENMP_SUPPORT)
- #pragma omp critical (MagickCore_ColorizeImage)
+ #pragma omp critical (MagickCore_ColorizeImage)
#endif
proceed=SetImageProgress(image,ColorizeImageTag,progress++,image->rows);
if (proceed == MagickFalse)
% o exception: return any errors or warnings in this structure.
%
*/
+/* FUTURE: modify to make use of a MagickMatrix Mutliply function
+ That should be provided in "matrix.c"
+ (ASIDE: actually distorts should do this too but currently doesn't)
+*/
+
MagickExport Image *ColorMatrixImage(const Image *image,
const KernelInfo *color_matrix,ExceptionInfo *exception)
{
y;
/*
- Create color matrix.
+ Map given color_matrix, into a 6x6 matrix RGBKA and a constant
*/
assert(image != (Image *) NULL);
assert(image->signature == MagickSignature);
message=DestroyString(message);
}
/*
- ColorMatrix image.
+ Apply the ColorMatrix to image.
*/
status=MagickTrue;
progress=0;
image_view=AcquireCacheView(image);
color_view=AcquireCacheView(color_image);
#if defined(MAGICKCORE_OPENMP_SUPPORT)
- #pragma omp parallel for schedule(dynamic,4) shared(progress,status)
+ #pragma omp parallel for schedule(static,4) shared(progress,status)
#endif
for (y=0; y < (ssize_t) image->rows; y++)
{
- MagickRealType
+ PixelInfo
pixel;
register const Quantum
status=MagickFalse;
continue;
}
+ GetPixelInfo(image,&pixel);
for (x=0; x < (ssize_t) image->columns; x++)
{
register ssize_t
size_t
height;
+ GetPixelInfoPixel(image,p,&pixel);
height=color_matrix->height > 6 ? 6UL : color_matrix->height;
for (v=0; v < (ssize_t) height; v++)
{
- pixel=ColorMatrix[v][0]*GetPixelRed(image,p)+ColorMatrix[v][1]*
+ MagickRealType
+ sum;
+
+ sum=ColorMatrix[v][0]*GetPixelRed(image,p)+ColorMatrix[v][1]*
GetPixelGreen(image,p)+ColorMatrix[v][2]*GetPixelBlue(image,p);
if (image->colorspace == CMYKColorspace)
- pixel+=ColorMatrix[v][3]*GetPixelBlack(image,p);
+ sum+=ColorMatrix[v][3]*GetPixelBlack(image,p);
if (image->matte != MagickFalse)
- pixel+=ColorMatrix[v][4]*GetPixelAlpha(image,p);
- pixel+=QuantumRange*ColorMatrix[v][5];
+ sum+=ColorMatrix[v][4]*GetPixelAlpha(image,p);
+ sum+=QuantumRange*ColorMatrix[v][5];
switch (v)
{
- case 0: SetPixelRed(color_image,ClampToQuantum(pixel),q); break;
- case 1: SetPixelGreen(color_image,ClampToQuantum(pixel),q); break;
- case 2: SetPixelBlue(color_image,ClampToQuantum(pixel),q); break;
- case 3:
- {
- if (image->colorspace == CMYKColorspace)
- SetPixelBlack(color_image,ClampToQuantum(pixel),q);
- break;
- }
- case 4:
- {
- if (image->matte != MagickFalse)
- SetPixelAlpha(color_image,ClampToQuantum(pixel),q);
- break;
- }
+ case 0: pixel.red=sum; break;
+ case 1: pixel.green=sum; break;
+ case 2: pixel.blue=sum; break;
+ case 3: pixel.black=sum; break;
+ case 4: pixel.alpha=sum; break;
+ default: break;
}
}
+ SetPixelInfoPixel(color_image,&pixel,q);
p+=GetPixelChannels(image);
q+=GetPixelChannels(color_image);
}
proceed;
#if defined(MAGICKCORE_OPENMP_SUPPORT)
- #pragma omp critical (MagickCore_ColorMatrixImage)
+ #pragma omp critical (MagickCore_ColorMatrixImage)
#endif
proceed=SetImageProgress(image,ColorMatrixImageTag,progress++,
image->rows);
i;
size_t
- length;
-
- size_t
+ length,
level;
p=expression;
GetPixelInfo(image,&pixel);
(void) InterpolatePixelInfo(image,fx_info->view[i],image->interpolate,
point.x,point.y,&pixel,exception);
- if ((strlen(p) > 2) &&
- (LocaleCompare(p,"intensity") != 0) &&
- (LocaleCompare(p,"luminance") != 0) &&
- (LocaleCompare(p,"hue") != 0) &&
+ if ((strlen(p) > 2) && (LocaleCompare(p,"intensity") != 0) &&
+ (LocaleCompare(p,"luminance") != 0) && (LocaleCompare(p,"hue") != 0) &&
(LocaleCompare(p,"saturation") != 0) &&
(LocaleCompare(p,"lightness") != 0))
{
p+=strlen(name);
}
else
- if (QueryColorCompliance(name,AllCompliance,&pixel,fx_info->exception) != MagickFalse)
- {
- (void) AddValueToSplayTree(fx_info->colors,ConstantString(name),
- ClonePixelInfo(&pixel));
- p+=strlen(name);
- }
+ {
+ MagickBooleanType
+ status;
+
+ status=QueryColorCompliance(name,AllCompliance,&pixel,
+ fx_info->exception);
+ if (status != MagickFalse)
+ {
+ (void) AddValueToSplayTree(fx_info->colors,ConstantString(
+ name),ClonePixelInfo(&pixel));
+ p+=strlen(name);
+ }
+ }
}
}
(void) CopyMagickString(symbol,p,MaxTextExtent);
case LeftShiftOperator:
{
gamma=FxEvaluateSubexpression(fx_info,channel,x,y,++p,beta,exception);
- *beta=(MagickRealType) ((size_t) (alpha+0.5) << (size_t)
- (gamma+0.5));
+ *beta=(MagickRealType) ((size_t) (alpha+0.5) << (size_t) (gamma+0.5));
return(*beta);
}
case RightShiftOperator:
{
gamma=FxEvaluateSubexpression(fx_info,channel,x,y,++p,beta,exception);
- *beta=(MagickRealType) ((size_t) (alpha+0.5) >> (size_t)
- (gamma+0.5));
+ *beta=(MagickRealType) ((size_t) (alpha+0.5) >> (size_t) (gamma+0.5));
return(*beta);
}
case '<':
case '&':
{
gamma=FxEvaluateSubexpression(fx_info,channel,x,y,++p,beta,exception);
- *beta=(MagickRealType) ((size_t) (alpha+0.5) & (size_t)
- (gamma+0.5));
+ *beta=(MagickRealType) ((size_t) (alpha+0.5) & (size_t) (gamma+0.5));
return(*beta);
}
case '|':
{
gamma=FxEvaluateSubexpression(fx_info,channel,x,y,++p,beta,exception);
- *beta=(MagickRealType) ((size_t) (alpha+0.5) | (size_t)
- (gamma+0.5));
+ *beta=(MagickRealType) ((size_t) (alpha+0.5) | (size_t) (gamma+0.5));
return(*beta);
}
case LogicalAndOperator:
if (strlen(subexpression) > 1)
subexpression[strlen(subexpression)-1]='\0';
if (fx_info->file != (FILE *) NULL)
- (void) FormatLocaleFile(fx_info->file,
- "%s[%.20g,%.20g].%s: %s=%.*g\n",fx_info->images->filename,
- (double) x,(double) y,type,subexpression,GetMagickPrecision(),
- (double) alpha);
+ (void) FormatLocaleFile(fx_info->file,"%s[%.20g,%.20g].%s: "
+ "%s=%.*g\n",fx_info->images->filename,(double) x,(double) y,type,
+ subexpression,GetMagickPrecision(),(double) alpha);
return(0.0);
}
if (LocaleNCompare(expression,"drc",3) == 0)
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+3,beta,
exception);
- gcd=FxGCD((MagickOffsetType) (alpha+0.5),(MagickOffsetType)
- (*beta+0.5));
+ gcd=FxGCD((MagickOffsetType) (alpha+0.5),(MagickOffsetType) (*beta+
+ 0.5));
return((MagickRealType) gcd);
}
if (LocaleCompare(expression,"g") == 0)
exception);
if (alpha == 0.0)
return(1.0);
- gamma=(MagickRealType) (2.0*j1((double) (MagickPI*alpha))/
- (MagickPI*alpha));
+ gamma=(MagickRealType) (2.0*j1((double) (MagickPI*alpha))/(MagickPI*
+ alpha));
return(gamma);
}
#endif
image_view=AcquireCacheView(image);
fx_view=AcquireCacheView(fx_image);
#if defined(MAGICKCORE_OPENMP_SUPPORT)
- #pragma omp parallel for schedule(dynamic,4) shared(progress,status)
+ #pragma omp parallel for schedule(static,4) shared(progress,status)
#endif
for (y=0; y < (ssize_t) fx_image->rows; y++)
{
if (status == MagickFalse)
continue;
p=GetCacheViewVirtualPixels(image_view,0,y,image->columns,1,exception);
- q=GetCacheViewAuthenticPixels(fx_view,0,y,fx_image->columns,1,exception);
+ q=QueueCacheViewAuthenticPixels(fx_view,0,y,fx_image->columns,1,exception);
if ((p == (const Quantum *) NULL) || (q == (Quantum *) NULL))
{
status=MagickFalse;
register ssize_t
i;
+ if (GetPixelMask(image,p) != 0)
+ {
+ p+=GetPixelChannels(image);
+ q+=GetPixelChannels(fx_image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
MagickRealType
proceed;
#if defined(MAGICKCORE_OPENMP_SUPPORT)
- #pragma omp critical (MagickCore_FxImage)
+ #pragma omp critical (MagickCore_FxImage)
#endif
proceed=SetImageProgress(image,FxImageTag,progress++,image->rows);
if (proceed == MagickFalse)
image_view=AcquireCacheView(image);
implode_view=AcquireCacheView(implode_image);
#if defined(MAGICKCORE_OPENMP_SUPPORT)
- #pragma omp parallel for schedule(dynamic,4) shared(progress,status)
+ #pragma omp parallel for schedule(static,4) shared(progress,status)
#endif
for (y=0; y < (ssize_t) image->rows; y++)
{
if (status == MagickFalse)
continue;
p=GetCacheViewAuthenticPixels(image_view,0,y,image->columns,1,exception);
- q=GetCacheViewAuthenticPixels(implode_view,0,y,implode_image->columns,1,
+ q=QueueCacheViewAuthenticPixels(implode_view,0,y,implode_image->columns,1,
exception);
if ((p == (const Quantum *) NULL) || (q == (Quantum *) NULL))
{
/*
Determine if the pixel is within an ellipse.
*/
+ if (GetPixelMask(image,p) != 0)
+ {
+ p+=GetPixelChannels(image);
+ q+=GetPixelChannels(implode_image);
+ continue;
+ }
delta.x=scale.x*(double) (x-center.x);
distance=delta.x*delta.x+delta.y*delta.y;
if (distance >= (radius*radius))
+ for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
- for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
- q[i]=p[i];
+ PixelChannel
+ channel;
+
+ PixelTrait
+ implode_traits,
+ traits;
+
+ channel=GetPixelChannelMapChannel(image,i);
+ traits=GetPixelChannelMapTraits(image,channel);
+ implode_traits=GetPixelChannelMapTraits(implode_image,channel);
+ if ((traits == UndefinedPixelTrait) ||
+ (implode_traits == UndefinedPixelTrait))
+ continue;
+ SetPixelChannel(implode_image,channel,p[i],q);
}
else
{
*/
factor=1.0;
if (distance > 0.0)
- factor=pow(sin((double) (MagickPI*sqrt((double) distance)/
- radius/2)),-amount);
+ factor=pow(sin((double) (MagickPI*sqrt((double) distance)/radius/
+ 2)),-amount);
status=InterpolatePixelChannels(image,image_view,implode_image,method,
(double) (factor*delta.x/scale.x+center.x),(double) (factor*delta.y/
scale.y+center.y),q,exception);
proceed;
#if defined(MAGICKCORE_OPENMP_SUPPORT)
- #pragma omp critical (MagickCore_ImplodeImage)
+ #pragma omp critical (MagickCore_ImplodeImage)
#endif
proceed=SetImageProgress(image,ImplodeImageTag,progress++,image->rows);
if (proceed == MagickFalse)
beta=(MagickRealType) (i+1.0)/(MagickRealType) (number_frames+1.0);
alpha=1.0-beta;
morph_image=ResizeImage(next,(size_t) (alpha*next->columns+beta*
- GetNextImageInList(next)->columns+0.5),(size_t) (alpha*
- next->rows+beta*GetNextImageInList(next)->rows+0.5),
- next->filter,next->blur,exception);
+ GetNextImageInList(next)->columns+0.5),(size_t) (alpha*next->rows+beta*
+ GetNextImageInList(next)->rows+0.5),next->filter,exception);
if (morph_image == (Image *) NULL)
{
morph_images=DestroyImageList(morph_images);
return((Image *) NULL);
}
- if (SetImageStorageClass(morph_image,DirectClass,exception) == MagickFalse)
+ status=SetImageStorageClass(morph_image,DirectClass,exception);
+ if (status == MagickFalse)
{
morph_image=DestroyImage(morph_image);
return((Image *) NULL);
AppendImageToList(&morph_images,morph_image);
morph_images=GetLastImageInList(morph_images);
morph_image=ResizeImage(GetNextImageInList(next),morph_images->columns,
- morph_images->rows,GetNextImageInList(next)->filter,
- GetNextImageInList(next)->blur,exception);
+ morph_images->rows,GetNextImageInList(next)->filter,exception);
if (morph_image == (Image *) NULL)
{
morph_images=DestroyImageList(morph_images);
image_view=AcquireCacheView(morph_image);
morph_view=AcquireCacheView(morph_images);
#if defined(MAGICKCORE_OPENMP_SUPPORT)
- #pragma omp parallel for schedule(dynamic,4) shared(status)
+ #pragma omp parallel for schedule(static,4) shared(status)
#endif
for (y=0; y < (ssize_t) morph_images->rows; y++)
{
}
for (x=0; x < (ssize_t) morph_images->columns; x++)
{
- SetPixelRed(morph_images,ClampToQuantum(alpha*
- GetPixelRed(morph_images,q)+beta*GetPixelRed(morph_image,p)),q);
- SetPixelGreen(morph_images,ClampToQuantum(alpha*
- GetPixelGreen(morph_images,q)+beta*GetPixelGreen(morph_image,p)),q);
- SetPixelBlue(morph_images,ClampToQuantum(alpha*
- GetPixelBlue(morph_images,q)+beta*GetPixelBlue(morph_image,p)),q);
- SetPixelAlpha(morph_images,ClampToQuantum(alpha*
- GetPixelAlpha(morph_images,q)+beta*GetPixelAlpha(morph_image,p)),q);
- if ((morph_image->colorspace == CMYKColorspace) &&
- (morph_images->colorspace == CMYKColorspace))
- SetPixelBlack(morph_images,ClampToQuantum(alpha*
- GetPixelBlack(morph_images,q)+beta*GetPixelBlack(morph_image,p)),
- q);
+ register ssize_t
+ i;
+
+ if (GetPixelMask(image,p) != 0)
+ {
+ p+=GetPixelChannels(image);
+ q+=GetPixelChannels(morph_image);
+ continue;
+ }
+ for (i=0; i < (ssize_t) GetPixelChannels(morph_image); i++)
+ {
+ PixelChannel
+ channel;
+
+ PixelTrait
+ morph_traits,
+ traits;
+
+ channel=GetPixelChannelMapChannel(image,i);
+ traits=GetPixelChannelMapTraits(image,channel);
+ morph_traits=GetPixelChannelMapTraits(morph_image,channel);
+ if ((traits == UndefinedPixelTrait) ||
+ (morph_traits == UndefinedPixelTrait))
+ continue;
+ if ((morph_traits & CopyPixelTrait) != 0)
+ {
+ SetPixelChannel(morph_image,channel,p[i],q);
+ continue;
+ }
+ SetPixelChannel(morph_image,channel,ClampToQuantum(alpha*
+ GetPixelChannel(morph_images,channel,q)+beta*p[i]),q);
+ }
p+=GetPixelChannels(morph_image);
q+=GetPixelChannels(morph_images);
}
proceed;
#if defined(MAGICKCORE_OPENMP_SUPPORT)
- #pragma omp critical (MagickCore_MorphImages)
+ #pragma omp critical (MagickCore_MorphImages)
#endif
proceed=SetImageProgress(image,MorphImageTag,scene,
GetImageListLength(image));
Left pixel.
*/
x=(ssize_t) ceil(segment->x1-0.5);
- 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);
+ 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 ((u == (const Quantum *) NULL) || (v == (const Quantum *) NULL) ||
(q == (Quantum *) NULL))
}
picture_image->background_color=image->border_color;
(void) SetImageBackgroundColor(picture_image,exception);
- (void) CompositeImage(picture_image,OverCompositeOp,image,quantum,quantum,
- exception);
+ (void) CompositeImage(picture_image,image,OverCompositeOp,MagickTrue,quantum,
+ quantum,exception);
if (caption_image != (Image *) NULL)
{
- (void) CompositeImage(picture_image,OverCompositeOp,caption_image,
- quantum,(ssize_t) (image->rows+3*quantum/2),exception);
+ (void) CompositeImage(picture_image,caption_image,OverCompositeOp,
+ MagickTrue,quantum,(ssize_t) (image->rows+3*quantum/2),exception);
caption_image=DestroyImage(caption_image);
}
(void) QueryColorCompliance("none",AllCompliance,
return((Image *) NULL);
picture_image=rotate_image;
picture_image->background_color=image->background_color;
- polaroid_image=ShadowImage(picture_image,80.0,2.0,0.0,quantum/3,quantum/3,
+ polaroid_image=ShadowImage(picture_image,80.0,2.0,quantum/3,quantum/3,
exception);
if (polaroid_image == (Image *) NULL)
{
return(picture_image);
}
polaroid_image=flop_image;
- (void) CompositeImage(polaroid_image,OverCompositeOp,picture_image,
- (ssize_t) (-0.01*picture_image->columns/2.0),0L,exception);
+ (void) CompositeImage(polaroid_image,picture_image,OverCompositeOp,
+ MagickTrue,(ssize_t) (-0.01*picture_image->columns/2.0),0L,exception);
picture_image=DestroyImage(picture_image);
(void) QueryColorCompliance("none",AllCompliance,
&polaroid_image->background_color,exception);
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
assert(exception != (ExceptionInfo *) NULL);
assert(exception->signature == MagickSignature);
- sepia_image=CloneImage(image,image->columns,image->rows,MagickTrue,exception);
+ sepia_image=CloneImage(image,0,0,MagickTrue,exception);
if (sepia_image == (Image *) NULL)
return((Image *) NULL);
if (SetImageStorageClass(sepia_image,DirectClass,exception) == MagickFalse)
image_view=AcquireCacheView(image);
sepia_view=AcquireCacheView(sepia_image);
#if defined(MAGICKCORE_OPENMP_SUPPORT)
- #pragma omp parallel for schedule(dynamic,4) shared(progress,status)
+ #pragma omp parallel for schedule(static,4) shared(progress,status)
#endif
for (y=0; y < (ssize_t) image->rows; y++)
{
if (status == MagickFalse)
continue;
p=GetCacheViewVirtualPixels(image_view,0,y,image->columns,1,exception);
- q=QueueCacheViewAuthenticPixels(sepia_view,0,y,sepia_image->columns,1,
+ q=GetCacheViewAuthenticPixels(sepia_view,0,y,sepia_image->columns,1,
exception);
if ((p == (const Quantum *) NULL) || (q == (Quantum *) NULL))
{
proceed;
#if defined(MAGICKCORE_OPENMP_SUPPORT)
- #pragma omp critical (MagickCore_SepiaToneImage)
+ #pragma omp critical (MagickCore_SepiaToneImage)
#endif
proceed=SetImageProgress(image,SepiaToneImageTag,progress++,
image->rows);
% The format of the ShadowImage method is:
%
% Image *ShadowImage(const Image *image,const double alpha,
-% const double sigma,const double bias,const ssize_t x_offset,
-% const ssize_t y_offset,ExceptionInfo *exception)
+% const double sigma,const ssize_t x_offset,const ssize_t y_offset,
+% ExceptionInfo *exception)
%
% A description of each parameter follows:
%
%
% o sigma: the standard deviation of the Gaussian, in pixels.
%
-% o bias: the bias.
-%
% o x_offset: the shadow x-offset.
%
% o y_offset: the shadow y-offset.
%
*/
MagickExport Image *ShadowImage(const Image *image,const double alpha,
- const double sigma,const double bias,const ssize_t x_offset,
- const ssize_t y_offset,ExceptionInfo *exception)
+ const double sigma,const ssize_t x_offset,const ssize_t y_offset,
+ ExceptionInfo *exception)
{
#define ShadowImageTag "Shadow/Image"
clone_image=CloneImage(image,0,0,MagickTrue,exception);
if (clone_image == (Image *) NULL)
return((Image *) NULL);
- (void) SetImageVirtualPixelMethod(clone_image,EdgeVirtualPixelMethod);
+ if (IsGrayColorspace(image->colorspace) != MagickFalse)
+ (void) TransformImageColorspace(clone_image,sRGBColorspace,exception);
+ (void) SetImageVirtualPixelMethod(clone_image,EdgeVirtualPixelMethod,
+ exception);
border_info.width=(size_t) floor(2.0*sigma+0.5);
border_info.height=(size_t) floor(2.0*sigma+0.5);
border_info.x=0;
return((Image *) NULL);
}
channel_mask=SetPixelChannelMask(border_image,AlphaChannel);
- shadow_image=BlurImage(border_image,0.0,sigma,bias,exception);
+ shadow_image=BlurImage(border_image,0.0,sigma,exception);
border_image=DestroyImage(border_image);
if (shadow_image == (Image *) NULL)
return((Image *) NULL);
% The format of the SketchImage method is:
%
% Image *SketchImage(const Image *image,const double radius,
-% const double sigma,const double angle,const double bias,
-% ExceptionInfo *exception)
+% const double sigma,const double angle,ExceptionInfo *exception)
%
% A description of each parameter follows:
%
%
% o angle: apply the effect along this angle.
%
-% o bias: the bias.
-%
% o exception: return any errors or warnings in this structure.
%
*/
MagickExport Image *SketchImage(const Image *image,const double radius,
- const double sigma,const double angle,const double bias,
- ExceptionInfo *exception)
+ const double sigma,const double angle,ExceptionInfo *exception)
{
CacheView
*random_view;
*sketch_image;
MagickBooleanType
+ concurrent,
status;
RandomInfo
return((Image *) NULL);
status=MagickTrue;
random_info=AcquireRandomInfoThreadSet();
+ concurrent=GetRandomSecretKey(random_info[0]) == ~0UL ? MagickTrue :
+ MagickFalse;
random_view=AcquireCacheView(random_image);
#if defined(MAGICKCORE_OPENMP_SUPPORT)
- #pragma omp parallel for schedule(dynamic,4) shared(status)
+ #pragma omp parallel for schedule(static,4) shared(status) omp_concurrent(concurrent)
#endif
for (y=0; y < (ssize_t) random_image->rows; y++)
{
register ssize_t
i;
+ if (GetPixelMask(random_image,q) != 0)
+ {
+ q+=GetPixelChannels(random_image);
+ continue;
+ }
value=GetPseudoRandomValue(random_info[id]);
for (i=0; i < (ssize_t) GetPixelChannels(random_image); i++)
{
random_image=DestroyImage(random_image);
return(random_image);
}
- blur_image=MotionBlurImage(random_image,radius,sigma,angle,bias,exception);
+ blur_image=MotionBlurImage(random_image,radius,sigma,angle,exception);
random_image=DestroyImage(random_image);
if (blur_image == (Image *) NULL)
return((Image *) NULL);
dodge_image=DestroyImage(dodge_image);
return((Image *) NULL);
}
- (void) CompositeImage(sketch_image,ColorDodgeCompositeOp,dodge_image,0,0,
- exception);
+ (void) CompositeImage(sketch_image,dodge_image,ColorDodgeCompositeOp,
+ MagickTrue,0,0,exception);
dodge_image=DestroyImage(dodge_image);
blend_image=CloneImage(image,0,0,MagickTrue,exception);
if (blend_image == (Image *) NULL)
return((Image *) NULL);
}
(void) SetImageArtifact(blend_image,"compose:args","20x80");
- (void) CompositeImage(sketch_image,BlendCompositeOp,blend_image,0,0,
- exception);
+ (void) CompositeImage(sketch_image,blend_image,BlendCompositeOp,MagickTrue,
+ 0,0,exception);
blend_image=DestroyImage(blend_image);
return(sketch_image);
}
progress=0;
image_view=AcquireCacheView(image);
#if defined(MAGICKCORE_OPENMP_SUPPORT)
- #pragma omp parallel for schedule(dynamic,4) shared(progress,status)
+ #pragma omp parallel for schedule(static,4) shared(progress,status)
#endif
for (y=0; y < (ssize_t) image->rows; y++)
{
register ssize_t
i;
+ if (GetPixelMask(image,q) != 0)
+ {
+ q+=GetPixelChannels(image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
proceed;
#if defined(MAGICKCORE_OPENMP_SUPPORT)
- #pragma omp critical (MagickCore_SolarizeImage)
+ #pragma omp critical (MagickCore_SolarizeImage)
#endif
proceed=SetImageProgress(image,SolarizeImageTag,progress++,image->rows);
if (proceed == MagickFalse)
stegano_image=CloneImage(image,0,0,MagickTrue,exception);
if (stegano_image == (Image *) NULL)
return((Image *) NULL);
+ stegano_image->depth=MAGICKCORE_QUANTUM_DEPTH;
if (SetImageStorageClass(stegano_image,DirectClass,exception) == MagickFalse)
{
stegano_image=DestroyImage(stegano_image);
return((Image *) NULL);
}
- stegano_image->depth=MAGICKCORE_QUANTUM_DEPTH;
/*
Hide watermark in low-order bits of image.
*/
i=0;
j=0;
depth=stegano_image->depth;
- k=image->offset;
+ k=stegano_image->offset;
status=MagickTrue;
watermark_view=AcquireCacheView(watermark);
stegano_view=AcquireCacheView(stegano_image);
{
for (x=0; (x < (ssize_t) watermark->columns) && (j < (ssize_t) depth); x++)
{
- Quantum
- virtual_pixel[CompositePixelChannel];
+ ssize_t
+ offset;
- (void) GetOneCacheViewVirtualPixel(watermark_view,x,y,virtual_pixel,
+ (void) GetOneCacheViewVirtualPixelInfo(watermark_view,x,y,&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)
+ offset=k/(ssize_t) stegano_image->columns;
+ if (offset >= (ssize_t) stegano_image->rows)
break;
q=GetCacheViewAuthenticPixels(stegano_view,k % (ssize_t)
stegano_image->columns,k/(ssize_t) stegano_image->columns,1,1,
{
case 0:
{
- SetPixelRed(image,SetBit(GetPixelRed(image,q),j,GetBit(
- GetPixelInfoIntensity(&pixel),i)),q);
+ SetPixelRed(stegano_image,SetBit(GetPixelRed(stegano_image,q),j,
+ GetBit(GetPixelInfoIntensity(&pixel),i)),q);
break;
}
case 1:
{
- SetPixelGreen(image,SetBit(GetPixelGreen(image,q),j,GetBit(
- GetPixelInfoIntensity(&pixel),i)),q);
+ SetPixelGreen(stegano_image,SetBit(GetPixelGreen(stegano_image,q),j,
+ GetBit(GetPixelInfoIntensity(&pixel),i)),q);
break;
}
case 2:
{
- SetPixelBlue(image,SetBit(GetPixelBlue(image,q),j,GetBit(
- GetPixelInfoIntensity(&pixel),i)),q);
+ SetPixelBlue(stegano_image,SetBit(GetPixelBlue(stegano_image,q),j,
+ GetBit(GetPixelInfoIntensity(&pixel),i)),q);
break;
}
}
k++;
if (k == (ssize_t) (stegano_image->columns*stegano_image->columns))
k=0;
- if (k == image->offset)
+ if (k == stegano_image->offset)
j++;
}
}
}
stegano_view=DestroyCacheView(stegano_view);
watermark_view=DestroyCacheView(watermark_view);
- if (stegano_image->storage_class == PseudoClass)
- (void) SyncImage(stegano_image,exception);
if (status == MagickFalse)
{
stegano_image=DestroyImage(stegano_image);
image_view=AcquireCacheView(image);
swirl_view=AcquireCacheView(swirl_image);
#if defined(MAGICKCORE_OPENMP_SUPPORT)
- #pragma omp parallel for schedule(dynamic,4) shared(progress,status)
+ #pragma omp parallel for schedule(static,4) shared(progress,status)
#endif
for (y=0; y < (ssize_t) image->rows; y++)
{
if (status == MagickFalse)
continue;
p=GetCacheViewAuthenticPixels(image_view,0,y,image->columns,1,exception);
- q=GetCacheViewAuthenticPixels(swirl_view,0,y,swirl_image->columns,1,
+ q=QueueCacheViewAuthenticPixels(swirl_view,0,y,swirl_image->columns,1,
exception);
if ((p == (const Quantum *) NULL) || (q == (Quantum *) NULL))
{
delta.y=scale.y*(double) (y-center.y);
for (x=0; x < (ssize_t) image->columns; x++)
{
- register ssize_t
- i;
-
/*
Determine if the pixel is within an ellipse.
*/
+ if (GetPixelMask(image,p) != 0)
+ {
+ p+=GetPixelChannels(image);
+ q+=GetPixelChannels(swirl_image);
+ continue;
+ }
delta.x=scale.x*(double) (x-center.x);
distance=delta.x*delta.x+delta.y*delta.y;
if (distance >= (radius*radius))
{
+ register ssize_t
+ i;
+
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
- q[i]=p[i];
+ {
+ PixelChannel
+ channel;
+
+ PixelTrait
+ swirl_traits,
+ traits;
+
+ channel=GetPixelChannelMapChannel(image,i);
+ traits=GetPixelChannelMapTraits(image,channel);
+ swirl_traits=GetPixelChannelMapTraits(swirl_image,channel);
+ if ((traits == UndefinedPixelTrait) ||
+ (swirl_traits == UndefinedPixelTrait))
+ continue;
+ SetPixelChannel(swirl_image,channel,p[i],q);
+ }
}
else
{
proceed;
#if defined(MAGICKCORE_OPENMP_SUPPORT)
- #pragma omp critical (MagickCore_SwirlImage)
+ #pragma omp critical (MagickCore_SwirlImage)
#endif
proceed=SetImageProgress(image,SwirlImageTag,progress++,image->rows);
if (proceed == MagickFalse)
intensity;
PixelInfo
- color_vector,
- pixel;
+ color_vector;
MagickStatusType
flags;
/*
Determine RGB values of the color.
*/
- GetPixelInfo(image,&pixel);
+ GetPixelInfo(image,&color_vector);
flags=ParseGeometry(blend,&geometry_info);
- pixel.red=geometry_info.rho;
- pixel.green=geometry_info.rho;
- pixel.blue=geometry_info.rho;
- pixel.alpha=OpaqueAlpha;
+ color_vector.red=geometry_info.rho;
+ color_vector.green=geometry_info.rho;
+ color_vector.blue=geometry_info.rho;
+ color_vector.alpha=OpaqueAlpha;
if ((flags & SigmaValue) != 0)
- pixel.green=geometry_info.sigma;
+ color_vector.green=geometry_info.sigma;
if ((flags & XiValue) != 0)
- pixel.blue=geometry_info.xi;
+ color_vector.blue=geometry_info.xi;
if ((flags & PsiValue) != 0)
- pixel.alpha=geometry_info.psi;
+ color_vector.alpha=geometry_info.psi;
if (image->colorspace == CMYKColorspace)
{
- pixel.black=geometry_info.rho;
+ color_vector.black=geometry_info.rho;
if ((flags & PsiValue) != 0)
- pixel.black=geometry_info.psi;
+ color_vector.black=geometry_info.psi;
if ((flags & ChiValue) != 0)
- pixel.alpha=geometry_info.chi;
+ color_vector.alpha=geometry_info.chi;
}
intensity=(MagickRealType) GetPixelInfoIntensity(tint);
- color_vector.red=(MagickRealType) (pixel.red*tint->red/100.0-intensity);
- color_vector.green=(MagickRealType) (pixel.green*tint->green/100.0-intensity);
- color_vector.blue=(MagickRealType) (pixel.blue*tint->blue/100.0-intensity);
- color_vector.black=(MagickRealType) (pixel.black*tint->black/100.0-intensity);
- color_vector.alpha=(MagickRealType) (pixel.alpha*tint->alpha/100.0-intensity);
+ color_vector.red=(MagickRealType) (color_vector.red*tint->red/100.0-
+ intensity);
+ color_vector.green=(MagickRealType) (color_vector.green*tint->green/100.0-
+ intensity);
+ color_vector.blue=(MagickRealType) (color_vector.blue*tint->blue/100.0-
+ intensity);
+ color_vector.black=(MagickRealType) (color_vector.black*tint->black/100.0-
+ intensity);
+ color_vector.alpha=(MagickRealType) (color_vector.alpha*tint->alpha/100.0-
+ intensity);
/*
Tint image.
*/
image_view=AcquireCacheView(image);
tint_view=AcquireCacheView(tint_image);
#if defined(MAGICKCORE_OPENMP_SUPPORT)
- #pragma omp parallel for schedule(dynamic,4) shared(progress,status)
+ #pragma omp parallel for schedule(static,4) shared(progress,status)
#endif
for (y=0; y < (ssize_t) image->rows; y++)
{
MagickRealType
weight;
- if ((GetPixelRedTraits(tint_image) & UpdatePixelTrait) != 0)
- {
- weight=QuantumScale*GetPixelRed(image,p)-0.5;
- pixel.red=(MagickRealType) GetPixelRed(image,p)+
- color_vector.red*(1.0-(4.0*(weight*weight)));
- SetPixelRed(tint_image,ClampToQuantum(pixel.red),q);
- }
- if ((GetPixelGreenTraits(tint_image) & UpdatePixelTrait) != 0)
- {
- weight=QuantumScale*GetPixelGreen(image,p)-0.5;
- pixel.green=(MagickRealType) GetPixelGreen(image,p)+
- color_vector.green*(1.0-(4.0*(weight*weight)));
- SetPixelGreen(tint_image,ClampToQuantum(pixel.green),q);
- }
- if ((GetPixelBlueTraits(tint_image) & UpdatePixelTrait) != 0)
- {
- weight=QuantumScale*GetPixelBlue(image,p)-0.5;
- pixel.blue=(MagickRealType) GetPixelBlue(image,p)+
- color_vector.blue*(1.0-(4.0*(weight*weight)));
- SetPixelBlue(tint_image,ClampToQuantum(pixel.blue),q);
- }
- if ((GetPixelBlackTraits(tint_image) & UpdatePixelTrait) != 0)
+ register ssize_t
+ i;
+
+ if (GetPixelMask(image,p) != 0)
{
- weight=QuantumScale*GetPixelBlack(image,p)-0.5;
- pixel.black=(MagickRealType) GetPixelBlack(image,p)+
- color_vector.black*(1.0-(4.0*(weight*weight)));
- SetPixelBlack(tint_image,ClampToQuantum(pixel.black),q);
+ p+=GetPixelChannels(image);
+ q+=GetPixelChannels(tint_image);
+ continue;
}
- if ((GetPixelAlphaTraits(tint_image) & CopyPixelTrait) != 0)
- SetPixelAlpha(tint_image,GetPixelAlpha(image,p),q);
+ for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
+ {
+ PixelChannel
+ channel;
+
+ PixelTrait
+ tint_traits,
+ traits;
+
+ channel=GetPixelChannelMapChannel(image,i);
+ traits=GetPixelChannelMapTraits(image,channel);
+ tint_traits=GetPixelChannelMapTraits(tint_image,channel);
+ if ((traits == UndefinedPixelTrait) ||
+ (tint_traits == UndefinedPixelTrait))
+ continue;
+ if ((tint_traits & CopyPixelTrait) != 0)
+ {
+ SetPixelChannel(tint_image,channel,p[i],q);
+ continue;
+ }
+ }
+ GetPixelInfo(image,&pixel);
+ weight=QuantumScale*GetPixelRed(image,p)-0.5;
+ pixel.red=(MagickRealType) GetPixelRed(image,p)+color_vector.red*
+ (1.0-(4.0*(weight*weight)));
+ weight=QuantumScale*GetPixelGreen(image,p)-0.5;
+ pixel.green=(MagickRealType) GetPixelGreen(image,p)+color_vector.green*
+ (1.0-(4.0*(weight*weight)));
+ weight=QuantumScale*GetPixelBlue(image,p)-0.5;
+ pixel.blue=(MagickRealType) GetPixelBlue(image,p)+color_vector.blue*
+ (1.0-(4.0*(weight*weight)));
+ weight=QuantumScale*GetPixelBlack(image,p)-0.5;
+ pixel.black=(MagickRealType) GetPixelBlack(image,p)+color_vector.black*
+ (1.0-(4.0*(weight*weight)));
+ SetPixelInfoPixel(tint_image,&pixel,q);
p+=GetPixelChannels(image);
q+=GetPixelChannels(tint_image);
}
proceed;
#if defined(MAGICKCORE_OPENMP_SUPPORT)
- #pragma omp critical (MagickCore_TintImage)
+ #pragma omp critical (MagickCore_TintImage)
#endif
proceed=SetImageProgress(image,TintImageTag,progress++,image->rows);
if (proceed == MagickFalse)
% The format of the VignetteImage method is:
%
% Image *VignetteImage(const Image *image,const double radius,
-% const double sigma,const double bias,const ssize_t x,const ssize_t y,
+% const double sigma,const ssize_t x,const ssize_t y,
% ExceptionInfo *exception)
%
% A description of each parameter follows:
%
% o sigma: the standard deviation of the Gaussian, in pixels.
%
-% o bias: the bias.
-%
% o x, y: Define the x and y ellipse offset.
%
% o exception: return any errors or warnings in this structure.
%
*/
MagickExport Image *VignetteImage(const Image *image,const double radius,
- const double sigma,const double bias,const ssize_t x,const ssize_t y,
- ExceptionInfo *exception)
+ const double sigma,const ssize_t x,const ssize_t y,ExceptionInfo *exception)
{
char
ellipse[MaxTextExtent];
return((Image *) NULL);
}
canvas_image->matte=MagickTrue;
- oval_image=CloneImage(canvas_image,canvas_image->columns,
- canvas_image->rows,MagickTrue,exception);
+ oval_image=CloneImage(canvas_image,canvas_image->columns,canvas_image->rows,
+ MagickTrue,exception);
if (oval_image == (Image *) NULL)
{
canvas_image=DestroyImage(canvas_image);
exception);
(void) QueryColorCompliance("#ffffff",AllCompliance,&draw_info->stroke,
exception);
- (void) FormatLocaleString(ellipse,MaxTextExtent,
- "ellipse %g,%g,%g,%g,0.0,360.0",image->columns/2.0,
- image->rows/2.0,image->columns/2.0-x,image->rows/2.0-y);
+ (void) FormatLocaleString(ellipse,MaxTextExtent,"ellipse %g,%g,%g,%g,"
+ "0.0,360.0",image->columns/2.0,image->rows/2.0,image->columns/2.0-x,
+ image->rows/2.0-y);
draw_info->primitive=AcquireString(ellipse);
(void) DrawImage(oval_image,draw_info,exception);
draw_info=DestroyDrawInfo(draw_info);
- blur_image=BlurImage(oval_image,radius,sigma,bias,exception);
+ blur_image=BlurImage(oval_image,radius,sigma,exception);
oval_image=DestroyImage(oval_image);
if (blur_image == (Image *) NULL)
{
return((Image *) NULL);
}
blur_image->matte=MagickFalse;
- (void) CompositeImage(canvas_image,CopyAlphaCompositeOp,blur_image,0,0,
- exception);
+ (void) CompositeImage(canvas_image,blur_image,IntensityCompositeOp,MagickTrue,
+ 0,0,exception);
blur_image=DestroyImage(blur_image);
vignette_image=MergeImageLayers(canvas_image,FlattenLayer,exception);
canvas_image=DestroyImage(canvas_image);
(void) SetCacheViewVirtualPixelMethod(image_view,
BackgroundVirtualPixelMethod);
#if defined(MAGICKCORE_OPENMP_SUPPORT)
- #pragma omp parallel for schedule(dynamic,4) shared(progress,status)
+ #pragma omp parallel for schedule(static,4) shared(progress,status)
#endif
for (y=0; y < (ssize_t) wave_image->rows; y++)
{
proceed;
#if defined(MAGICKCORE_OPENMP_SUPPORT)
- #pragma omp critical (MagickCore_WaveImage)
+ #pragma omp critical (MagickCore_WaveImage)
#endif
proceed=SetImageProgress(image,WaveImageTag,progress++,image->rows);
if (proceed == MagickFalse)