ExceptionInfo exceptionInfo;
GetExceptionInfo( &exceptionInfo );
MagickCore::Image* newImage =
- MotionBlurImage( image(), radius_, sigma_, angle_, &exceptionInfo);
+ MotionBlurImage( image(), radius_, sigma_, angle_, 0.0, &exceptionInfo);
replaceImage( newImage );
throwException( exceptionInfo );
(void) DestroyExceptionInfo( &exceptionInfo );
% The format of the MotionBlurImage method is:
%
% Image *MotionBlurImage(const Image *image,const double radius,
-% const double sigma,const double angle,ExceptionInfo *exception)
+% const double sigma,const double angle,const double bias,
+% 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 *MotionBlurImage(const Image *image,const double radius,
- const double sigma,const double angle,ExceptionInfo *exception)
+ const double sigma,const double angle,const double bias,
+ ExceptionInfo *exception)
{
CacheView
*blur_view,
MagickOffsetType
progress;
- PixelInfo
- bias;
-
OffsetInfo
*offset;
*/
status=MagickTrue;
progress=0;
- GetPixelInfo(image,&bias);
image_view=AcquireCacheView(image);
blur_view=AcquireCacheView(blur_image);
#if defined(MAGICKCORE_OPENMP_SUPPORT)
#endif
for (y=0; y < (ssize_t) image->rows; y++)
{
+ register const Quantum
+ *restrict p;
+
register Quantum
*restrict q;
if (status == MagickFalse)
continue;
+ p=GetCacheViewVirtualPixels(blur_view,0,y,image->columns,1,exception);
q=GetCacheViewAuthenticPixels(blur_view,0,y,blur_image->columns,1,
exception);
- if (q == (Quantum *) NULL)
+ if ((p == (const Quantum *) NULL) || (q == (Quantum *) NULL))
{
status=MagickFalse;
continue;
}
for (x=0; x < (ssize_t) image->columns; x++)
{
- PixelInfo
- qixel;
+ register ssize_t
+ i;
- PixelPacket
- pixel;
+ for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
+ {
+ MagickRealType
+ alpha,
+ gamma,
+ pixel;
- register double
- *restrict k;
+ PixelChannel
+ channel;
- register ssize_t
- i;
+ PixelTrait
+ blur_traits,
+ traits;
- k=kernel;
- qixel=bias;
- if (((GetPixelAlphaTraits(image) & UpdatePixelTrait) == 0) ||
- (image->matte == MagickFalse))
- {
- for (i=0; i < (ssize_t) width; i++)
+ register const Quantum
+ *restrict r;
+
+ register double
+ *restrict k;
+
+ register ssize_t
+ j;
+
+ traits=GetPixelChannelMapTraits(image,(PixelChannel) i);
+ channel=GetPixelChannelMapChannel(image,(PixelChannel) i);
+ blur_traits=GetPixelChannelMapTraits(blur_image,channel);
+ if ((traits == UndefinedPixelTrait) ||
+ (blur_traits == UndefinedPixelTrait))
+ continue;
+ if ((blur_traits & CopyPixelTrait) != 0)
{
- (void) GetOneCacheViewVirtualPixel(image_view,x+offset[i].x,y+
- offset[i].y,&pixel,exception);
- qixel.red+=(*k)*pixel.red;
- qixel.green+=(*k)*pixel.green;
- qixel.blue+=(*k)*pixel.blue;
- qixel.alpha+=(*k)*pixel.alpha;
- if (image->colorspace == CMYKColorspace)
- qixel.black+=(*k)*pixel.black;
- k++;
+ q[channel]=p[i];
+ continue;
}
- if ((GetPixelRedTraits(image) & UpdatePixelTrait) != 0)
- SetPixelRed(blur_image,ClampToQuantum(qixel.red),q);
- if ((GetPixelGreenTraits(image) & UpdatePixelTrait) != 0)
- SetPixelGreen(blur_image,ClampToQuantum(qixel.green),q);
- if ((GetPixelBlueTraits(image) & UpdatePixelTrait) != 0)
- SetPixelBlue(blur_image,ClampToQuantum(qixel.blue),q);
- if (((GetPixelBlackTraits(image) & UpdatePixelTrait) != 0) &&
- (image->colorspace == CMYKColorspace))
- SetPixelBlack(blur_image,ClampToQuantum(qixel.black),q);
- if ((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0)
- SetPixelAlpha(blur_image,ClampToQuantum(qixel.alpha),q);
- }
- else
- {
- MagickRealType
- alpha,
- gamma;
-
- alpha=0.0;
- gamma=0.0;
- for (i=0; i < (ssize_t) width; i++)
+ k=kernel;
+ pixel=bias;
+ if ((blur_traits & BlendPixelTrait) == 0)
{
- (void) GetOneCacheViewVirtualPixel(image_view,x+offset[i].x,y+
- offset[i].y,&pixel,exception);
- alpha=(MagickRealType) (QuantumScale*pixel.alpha);
- qixel.red+=(*k)*alpha*pixel.red;
- qixel.green+=(*k)*alpha*pixel.green;
- qixel.blue+=(*k)*alpha*pixel.blue;
- qixel.alpha+=(*k)*pixel.alpha;
- if (image->colorspace == CMYKColorspace)
- qixel.black+=(*k)*alpha*pixel.black;
- gamma+=(*k)*alpha;
- k++;
+ for (j=0; j < (ssize_t) width; j++)
+ {
+ r=GetCacheViewVirtualPixels(image_view,x+offset[j].x,y+
+ offset[j].y,1,1,exception);
+ if (r == (const Quantum *) NULL)
+ {
+ status=MagickFalse;
+ continue;
+ }
+ pixel+=(*k)*r[i];
+ k++;
+ }
+ q[channel]=ClampToQuantum(pixel);
+ continue;
}
- gamma=1.0/(fabs((double) gamma) <= MagickEpsilon ? 1.0 : gamma);
- if ((GetPixelRedTraits(image) & UpdatePixelTrait) != 0)
- SetPixelRed(blur_image,ClampToQuantum(gamma*qixel.red),q);
- if ((GetPixelGreenTraits(image) & UpdatePixelTrait) != 0)
- SetPixelGreen(blur_image,ClampToQuantum(gamma*qixel.green),q);
- if ((GetPixelBlueTraits(image) & UpdatePixelTrait) != 0)
- SetPixelBlue(blur_image,ClampToQuantum(gamma*qixel.blue),q);
- if (((GetPixelBlackTraits(image) & UpdatePixelTrait) != 0) &&
- (image->colorspace == CMYKColorspace))
- SetPixelBlack(blur_image,ClampToQuantum(gamma*qixel.black),q);
- if ((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0)
- SetPixelAlpha(blur_image,ClampToQuantum(qixel.alpha),q);
+ alpha=0.0;
+ gamma=0.0;
+ for (j=0; j < (ssize_t) width; j++)
+ {
+ r=GetCacheViewVirtualPixels(image_view,x+offset[j].x,y+offset[j].y,1,
+ 1,exception);
+ if (r == (const Quantum *) NULL)
+ {
+ status=MagickFalse;
+ continue;
+ }
+ alpha=(MagickRealType) (QuantumScale*GetPixelAlpha(image,r));
+ pixel+=(*k)*alpha*r[i];
+ gamma+=(*k)*alpha;
+ k++;
}
+ gamma=1.0/(fabs((double) gamma) <= MagickEpsilon ? 1.0 : gamma);
+ q[channel]=ClampToQuantum(gamma*pixel);
+ }
+ p+=GetPixelChannels(image);
q+=GetPixelChannels(blur_image);
}
if (SyncCacheViewAuthenticPixels(blur_view,exception) == MagickFalse)
*GaussianBlurImage(const Image *,const double,const double,const double,
ExceptionInfo *),
*MotionBlurImage(const Image *,const double,const double,const double,
- ExceptionInfo *),
+ const double,ExceptionInfo *),
*PreviewImage(const Image *,const PreviewType,ExceptionInfo *),
*RadialBlurImage(const Image *,const double,ExceptionInfo *),
*SelectiveBlurImage(const Image *,const double,const double,const double,
% The format of the SketchImage method is:
%
% Image *SketchImage(const Image *image,const double radius,
-% const double sigma,const double angle,ExceptionInfo *exception)
+% const double sigma,const double angle,const double bias,
+% ExceptionInfo *exception)
%
% A description of each parameter follows:
%
%
% o sigma: the standard deviation of the Gaussian, in pixels.
%
-% o angle: Apply the effect along this angle.
+% 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,ExceptionInfo *exception)
+ const double sigma,const double angle,const double bias,
+ ExceptionInfo *exception)
{
CacheView
*random_view;
random_image=DestroyImage(random_image);
return(random_image);
}
- blur_image=MotionBlurImage(random_image,radius,sigma,angle,exception);
+ blur_image=MotionBlurImage(random_image,radius,sigma,angle,bias,exception);
random_image=DestroyImage(random_image);
if (blur_image == (Image *) NULL)
return((Image *) NULL);
*ShadowImage(const Image *,const double,const double,const ssize_t,
const ssize_t,ExceptionInfo *),
*SketchImage(const Image *,const double,const double,const double,
- ExceptionInfo *),
+ const double,ExceptionInfo *),
*SteganoImage(const Image *,const Image *,ExceptionInfo *),
*StereoImage(const Image *,const Image *,ExceptionInfo *),
*StereoAnaglyphImage(const Image *,const Image *,const ssize_t,const ssize_t,
/* #undef AUTOTRACE_DELEGATE */
/* Define if coders and filters are to be built as modules. */
-/* #undef BUILD_MODULES */
+#ifndef MAGICKCORE_BUILD_MODULES
+#define MAGICKCORE_BUILD_MODULES 1
+#endif
/* Define if you have the bzip2 library */
#ifndef MAGICKCORE_BZLIB_DELEGATE
#endif
/* Define if you have FFTW library */
-/* #undef FFTW_DELEGATE */
+#ifndef MAGICKCORE_FFTW_DELEGATE
+#define MAGICKCORE_FFTW_DELEGATE 1
+#endif
/* Location of filter modules */
#ifndef MAGICKCORE_FILTER_PATH
/* 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/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"
+#define MAGICKCORE_LT_DLSEARCH_PATH "/lib64:/usr/lib64:/lib:/usr/lib:/usr/lib64/R/lib:/usr/lib64/alliance/lib:/usr/lib64/atlas:/opt/modules/pkg/intel/f77/10.0.025/lib:/usr/lib64/kicad:/usr/lib/llvm:/usr/lib64/llvm:/usr/local/lib:/usr/lib64/mpich2/lib/:/usr/lib64/mysql:/usr/lib64/octave/3.4.2:/usr/lib64/openmotif:/usr/lib64/qt-3.3/lib:/usr/lib64/tcl8.5/tclx8.4:/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 */
-/* #undef OPENEXR_DELEGATE */
+#ifndef MAGICKCORE_OPENEXR_DELEGATE
+#define MAGICKCORE_OPENEXR_DELEGATE 1
+#endif
/* Define to the address where bug reports for this package should be sent. */
#ifndef MAGICKCORE_PACKAGE_BUGREPORT
#endif
/* Define if you have RSVG library */
-/* #undef RSVG_DELEGATE */
+#ifndef MAGICKCORE_RSVG_DELEGATE
+#define MAGICKCORE_RSVG_DELEGATE 1
+#endif
/* Define to the type of arg 1 for `select'. */
#ifndef MAGICKCORE_SELECT_TYPE_ARG1
/* #undef WITH_DMALLOC */
/* Define if you have WMF library */
-/* #undef WMF_DELEGATE */
+#ifndef MAGICKCORE_WMF_DELEGATE
+#define MAGICKCORE_WMF_DELEGATE 1
+#endif
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
*/
#define MagickPackageName "ImageMagick"
#define MagickCopyright "Copyright (C) 1999-2011 ImageMagick Studio LLC"
-#define MagickSVNRevision "5221"
+#define MagickSVNRevision "exported"
#define MagickLibVersion 0x700
#define MagickLibVersionText "7.0.0"
#define MagickLibVersionNumber 5,0,0
#define MagickLibAddendum "-0"
#define MagickLibInterface 5
#define MagickLibMinInterface 5
-#define MagickReleaseDate "2011-09-08"
+#define MagickReleaseDate "2011-09-09"
#define MagickChangeDate "20110801"
#define MagickAuthoritativeURL "http://www.imagemagick.org"
#if defined(MAGICKCORE_OPENMP_SUPPORT)
% The format of the MagickMotionBlurImage method is:
%
% MagickBooleanType MagickMotionBlurImage(MagickWand *wand,
-% const double radius,const double sigma,const double angle)
+% const double radius,const double sigma,const double angle,
+% const double bias)
%
% A description of each parameter follows:
%
%
*/
WandExport MagickBooleanType MagickMotionBlurImage(MagickWand *wand,
- const double radius,const double sigma,const double angle)
+ const double radius,const double sigma,const double angle,const double bias)
{
Image
*blur_image;
(void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
if (wand->images == (Image *) NULL)
ThrowWandException(WandError,"ContainsNoImages",wand->name);
- blur_image=MotionBlurImage(wand->images,radius,sigma,angle,wand->exception);
+ blur_image=MotionBlurImage(wand->images,radius,sigma,angle,bias,
+ wand->exception);
if (blur_image == (Image *) NULL)
return(MagickFalse);
ReplaceImageInList(&wand->images,blur_image);
% The format of the MagickSketchImage method is:
%
% MagickBooleanType MagickSketchImage(MagickWand *wand,
-% const double radius,const double sigma,const double angle)
+% const double radius,const double sigma,const double angle,
+% const double bias)
%
% A description of each parameter follows:
%
%
% o sigma: the standard deviation of the Gaussian, in pixels.
%
-% o angle: Apply the effect along this angle.
+% o angle: apply the effect along this angle.
+%
+% o bias: the bias.
%
*/
WandExport MagickBooleanType MagickSketchImage(MagickWand *wand,
- const double radius,const double sigma,const double angle)
+ const double radius,const double sigma,const double angle,const double bias)
{
Image
*sketch_image;
(void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
if (wand->images == (Image *) NULL)
ThrowWandException(WandError,"ContainsNoImages",wand->name);
- sketch_image=SketchImage(wand->images,radius,sigma,angle,wand->exception);
+ sketch_image=SketchImage(wand->images,radius,sigma,angle,bias,
+ wand->exception);
if (sketch_image == (Image *) NULL)
return(MagickFalse);
ReplaceImageInList(&wand->images,sketch_image);
MagickModulateImage(MagickWand *,const double,const double,const double),
MagickMorphologyImage(MagickWand *,MorphologyMethod,const ssize_t,
KernelInfo *),
- MagickMotionBlurImage(MagickWand *,const double,const double,const double),
+ MagickMotionBlurImage(MagickWand *,const double,const double,const double,
+ const double),
MagickNegateImage(MagickWand *,const MagickBooleanType),
MagickNewImage(MagickWand *,const size_t,const size_t,const PixelWand *),
MagickNextImage(MagickWand *),
MagickShearImage(MagickWand *,const PixelWand *,const double,const double),
MagickSigmoidalContrastImage(MagickWand *,const MagickBooleanType,
const double,const double),
- MagickSketchImage(MagickWand *,const double,const double,const double),
+ MagickSketchImage(MagickWand *,const double,const double,const double,
+ const double),
MagickSolarizeImage(MagickWand *,const double),
MagickSparseColorImage(MagickWand *,const SparseColorMethod,const size_t,
const double *),
if ((flags & SigmaValue) == 0)
geometry_info.sigma=1.0;
mogrify_image=MotionBlurImage(*image,geometry_info.rho,
- geometry_info.sigma,geometry_info.xi,exception);
+ geometry_info.sigma,geometry_info.xi,geometry_info.psi,
+ exception);
break;
}
break;
if ((flags & SigmaValue) == 0)
geometry_info.sigma=1.0;
mogrify_image=SketchImage(*image,geometry_info.rho,
- geometry_info.sigma,geometry_info.xi,exception);
+ geometry_info.sigma,geometry_info.xi,geometry_info.psi,exception);
break;
}
if (LocaleCompare("solarize",option+1) == 0)
{"channel", MagickChannelOptions} } },
{ "MotionBlur", { {"geometry", StringReference},
{"radius", RealReference}, {"sigma", RealReference},
- {"angle", RealReference}, {"channel", MagickChannelOptions} } },
+ {"angle", RealReference}, {"bias", RealReference},
+ {"channel", MagickChannelOptions} } },
{ "OrderedDither", { {"threshold", StringReference},
{"channel", MagickChannelOptions} } },
{ "Shave", { {"geometry", StringReference}, {"width", IntegerReference},
{"bias", RealReference}, {"channel", MagickChannelOptions} } },
{ "Sketch", { {"geometry", StringReference},
{"radius", RealReference}, {"sigma", RealReference},
- {"angle", RealReference} } },
+ {"angle", RealReference}, {"bias", RealReference} } },
{ "UniqueColors", },
{ "AdaptiveResize", { {"geometry", StringReference},
{"width", IntegerReference}, {"height", IntegerReference},
if (attribute_flag[3] != 0)
geometry_info.xi=argument_list[3].real_reference;
if (attribute_flag[4] != 0)
- channel=(ChannelType) argument_list[4].integer_reference;
+ geometry_info.psi=argument_list[4].real_reference;
+ if (attribute_flag[5] != 0)
+ channel=(ChannelType) argument_list[5].integer_reference;
channel_mask=SetPixelChannelMask(image,channel);
image=MotionBlurImage(image,geometry_info.rho,geometry_info.sigma,
- geometry_info.xi,exception);
+ geometry_info.xi,geometry_info.psi,exception);
if (image != (Image *) NULL)
(void) SetPixelChannelMask(image,channel_mask);
break;
geometry_info.sigma=argument_list[2].real_reference;
if (attribute_flag[3] != 0)
geometry_info.xi=argument_list[3].real_reference;
+ if (attribute_flag[4] != 0)
+ geometry_info.psi=argument_list[4].real_reference;
image=SketchImage(image,geometry_info.rho,geometry_info.sigma,
- geometry_info.xi,exception);
+ geometry_info.xi,geometry_info.psi,exception);
break;
}
case 104: /* UniqueColors */