ThrowImageException;
}
+void Magick::Image::localContrast(const double radius_,const double strength_)
+{
+ MagickCore::Image
+ *newImage;
+
+ GetPPException;
+ newImage=LocalContrastImage(constImage(),radius_,strength_,exceptionInfo);
+ replaceImage(newImage);
+ ThrowImageException;
+}
+
void Magick::Image::magnify(void)
{
MagickCore::Image
// Rescales image with seam carving.
void liquidRescale(const Geometry &geometry_);
+ // Local contrast enhancement
+ void localContrast(const double radius_,const double strength_);
+
// Magnify image by integral size
void magnify(void);
using MagickCore::LevelizeImage;
using MagickCore::LinearStretchImage;
using MagickCore::LiquidRescaleImage;
+ using MagickCore::LocalContrastImage;
using MagickCore::LocaleCompare;
using MagickCore::LockSemaphoreInfo;
using MagickCore::LogMagickEvent;
%
% o image: the image.
%
-% o channel: the channel type.
-%
-% o radius: the radius of the Gaussian blur, in percentage with 100%
-% resulting in a blur radius of 20% of largest dimension.
+% o radius: the radius of the Gaussian, in pixels, not counting
+% the center pixel.
%
% o strength: the strength of the blur mask in percentage.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% LocalContrastImage() attempts to increase the appearance of large-scale
-% light-dark transitions. Local contrast enhancement works similarly to
+% light-dark transitions. Local contrast enhancement works similarly to
% sharpening with an unsharp mask, however the mask is instead created using
% an image with a greater blur distance.
%
%
% o image: the image.
%
-% o channel: the channel type.
-%
% o radius: the radius of the Gaussian, in pixels, not counting
% the center pixel.
%
ReplaceImageInList(&wand->images,rescale_image);
return(MagickTrue);
}
+
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %
+% %
+% %
+% M a g i c k L o c a l C o n t r a s t I m a g e %
+% %
+% %
+% %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% MagickLocalContrastImage() attempts to increase the appearance of
+% large-scale light-dark transitions. Local contrast enhancement works
+% similarly to sharpening with an unsharp mask, however the mask is instead
+% created using an image with a greater blur distance.
+%
+% MagickBooleanType MagickLocalContrastImage(MagickWand *wand,
+% const double radius,const double strength)
+%
+% A description of each parameter follows:
+%
+% o image: the image.
+%
+% o radius: the radius of the Gaussian, in pixels, not counting
+% the center pixel.
+%
+% o strength: the strength of the blur mask in percentage.
+%
+*/
+WandExport MagickBooleanType MagickLocalContrastImage(MagickWand *wand,
+ const double radius, const double strength)
+{
+ Image
+ *contrast_image;
+
+ assert(wand != (MagickWand *)NULL);
+ assert(wand->signature == MagickWandSignature);
+ if (wand->debug != MagickFalse)
+ (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s", wand->name);
+ if (wand->images == (Image *)NULL)
+ ThrowWandException(WandError,"ContainsNoImages",wand->name);
+ contrast_image=LocalContrastImage(wand->images,radius,strength,
+ wand->exception);
+ if (contrast_image == (Image *)NULL)
+ return(MagickFalse);
+ ReplaceImageInList(&wand->images,contrast_image);
+ return(MagickTrue);
+}
\f
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
MagickLinearStretchImage(MagickWand *,const double,const double),
MagickLiquidRescaleImage(MagickWand *,const size_t,const size_t,const double,
const double),
+ MagickLocalContrastImage(MagickWand *,const double,const double),
MagickMagnifyImage(MagickWand *),
MagickMedianConvolveImage(MagickWand *,const double),
MagickMinifyImage(MagickWand *),