void Magick::Image::sigmoidalContrast ( const size_t sharpen_, const double contrast, const double midpoint )
{
modifyImage();
- (void) SigmoidalContrastImageChannel( image(), DefaultChannels, (MagickBooleanType) sharpen_, contrast, midpoint );
+ (void) SigmoidalContrastImage( image(), (MagickBooleanType) sharpen_, contrast, midpoint );
throwImageException();
}
using MagickCore::SharpenImageChannel;
using MagickCore::ShaveImage;
using MagickCore::ShearImage;
- using MagickCore::SigmoidalContrastImageChannel;
+ using MagickCore::SigmoidalContrastImage;
using MagickCore::SignatureImage;
using MagickCore::SolarizeImage;
using MagickCore::SparseColorImage;
}
case SigmoidalContrastCommand:
{
+ GeometryInfo
+ geometry_info;
+
+ MagickStatusType
+ flags;
+
static char
levels[MaxTextExtent] = "3x50%";
*/
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
- (void) SigmoidalContrastImage(*image,MagickTrue,levels);
+ flags=ParseGeometry(levels,&geometry_info);
+ if ((flags & SigmaValue) == 0)
+ geometry_info.sigma=1.0*QuantumRange/2.0;
+ if ((flags & PercentValue) != 0)
+ geometry_info.sigma=1.0*QuantumRange*geometry_info.sigma/100.0;
+ (void) SigmoidalContrastImage(*image,MagickTrue,geometry_info.rho,
+ geometry_info.sigma);
XSetCursorState(display,windows,MagickFalse);
if (windows->image.orphan != MagickFalse)
break;
%
% MagickBooleanType BrightnessContrastImage(Image *image,
% const double brightness,const double contrast)
-% MagickBooleanType BrightnessContrastImageChannel(Image *image,
-% const ChannelType channel,const double brightness,
-% const double contrast)
%
% A description of each parameter follows:
%
% o image: the image.
%
-% o channel: the channel.
-%
% o brightness: the brightness percent (-100 .. 100).
%
% o contrast: the contrast percent (-100 .. 100).
%
*/
-
MagickExport MagickBooleanType BrightnessContrastImage(Image *image,
const double brightness,const double contrast)
-{
- MagickBooleanType
- status;
-
- status=BrightnessContrastImageChannel(image,DefaultChannels,brightness,
- contrast);
- return(status);
-}
-
-MagickExport MagickBooleanType BrightnessContrastImageChannel(Image *image,
- const ChannelType channel,const double brightness,const double contrast)
{
#define BrightnessContastImageTag "BrightnessContast/Image"
intercept=brightness/100.0+((100-brightness)/200.0)*(1.0-slope);
coefficients[0]=slope;
coefficients[1]=intercept;
- status=FunctionImageChannel(image,channel,PolynomialFunction,2,coefficients,
- &image->exception);
+ status=FunctionImageChannel(image,DefaultChannels,PolynomialFunction,2,
+ coefficients,&image->exception);
return(status);
}
\f
%
% MagickBooleanType SigmoidalContrastImage(Image *image,
% const MagickBooleanType sharpen,const char *levels)
-% MagickBooleanType SigmoidalContrastImageChannel(Image *image,
-% const ChannelType channel,const MagickBooleanType sharpen,
-% const double contrast,const double midpoint)
%
% A description of each parameter follows:
%
% o image: the image.
%
-% o channel: the channel.
-%
% o sharpen: Increase or decrease image contrast.
%
% o alpha: strength of the contrast, the larger the number the more
% o beta: midpoint of the function as a color value 0 to QuantumRange.
%
*/
-
MagickExport MagickBooleanType SigmoidalContrastImage(Image *image,
- const MagickBooleanType sharpen,const char *levels)
-{
- GeometryInfo
- geometry_info;
-
- MagickBooleanType
- status;
-
- MagickStatusType
- flags;
-
- flags=ParseGeometry(levels,&geometry_info);
- if ((flags & SigmaValue) == 0)
- geometry_info.sigma=1.0*QuantumRange/2.0;
- if ((flags & PercentValue) != 0)
- geometry_info.sigma=1.0*QuantumRange*geometry_info.sigma/100.0;
- status=SigmoidalContrastImageChannel(image,DefaultChannels,sharpen,
- geometry_info.rho,geometry_info.sigma);
- return(status);
-}
-
-MagickExport MagickBooleanType SigmoidalContrastImageChannel(Image *image,
- const ChannelType channel,const MagickBooleanType sharpen,
- const double contrast,const double midpoint)
+ const MagickBooleanType sharpen,const double contrast,const double midpoint)
{
#define SigmoidalContrastImageTag "SigmoidalContrast/Image"
proceed;
#if defined(MAGICKCORE_OPENMP_SUPPORT)
- #pragma omp critical (MagickCore_SigmoidalContrastImageChannel)
+ #pragma omp critical (MagickCore_SigmoidalContrastImage)
#endif
proceed=SetImageProgress(image,SigmoidalContrastImageTag,progress++,
image->rows);
AutoGammaImage(Image *),
AutoLevelImage(Image *),
BrightnessContrastImage(Image *,const double,const double),
- BrightnessContrastImageChannel(Image *,const ChannelType,const double,
- const double),
ClutImage(Image *,const Image *),
ClutImageChannel(Image *,const ChannelType,const Image *),
ColorDecisionListImage(Image *,const char *),
NegateImageChannel(Image *,const ChannelType,const MagickBooleanType),
NormalizeImage(Image *),
NormalizeImageChannel(Image *,const ChannelType),
- SigmoidalContrastImage(Image *,const MagickBooleanType,const char *),
- SigmoidalContrastImageChannel(Image *,const ChannelType,
- const MagickBooleanType,const double,const double);
+ SigmoidalContrastImage(Image *,const MagickBooleanType,const double,
+ const double);
extern MagickExport Image
*EnhanceImage(const Image *,ExceptionInfo *);
#define BlurImageChannel PrependMagickMethod(BlurImageChannel)
#define BlurImage PrependMagickMethod(BlurImage)
#define BorderImage PrependMagickMethod(BorderImage)
-#define BrightnessContrastImageChannel PrependMagickMethod(BrightnessContrastImageChannel)
+#define BrightnessContrastImage PrependMagickMethod(BrightnessContrastImage)
#define BrightnessContrastImage PrependMagickMethod(BrightnessContrastImage)
#define CacheComponentGenesis PrependMagickMethod(CacheComponentGenesis)
#define CacheComponentTerminus PrependMagickMethod(CacheComponentTerminus)
#define ShaveImage PrependMagickMethod(ShaveImage)
#define ShearImage PrependMagickMethod(ShearImage)
#define ShiftImageList PrependMagickMethod(ShiftImageList)
-#define SigmoidalContrastImageChannel PrependMagickMethod(SigmoidalContrastImageChannel)
+#define SigmoidalContrastImage PrependMagickMethod(SigmoidalContrastImage)
#define SigmoidalContrastImage PrependMagickMethod(SigmoidalContrastImage)
#define SignatureImage PrependMagickMethod(SignatureImage)
#define SimilarityImage PrependMagickMethod(SimilarityImage)
#define MagickLibAddendum "-0"
#define MagickLibInterface 5
#define MagickLibMinInterface 5
-#define MagickReleaseDate "2011-07-05"
+#define MagickReleaseDate "2011-07-06"
#define MagickChangeDate "20110701"
#define MagickAuthoritativeURL "http://www.imagemagick.org"
#if defined(MAGICKCORE_OPENMP_SUPPORT)
%
% MagickBooleanType MagickBrightnessContrastImage(MagickWand *wand,
% const double brightness,const double contrast)
-% MagickBooleanType MagickBrightnessContrastImageChannel(MagickWand *wand,
-% const ChannelType channel,const double brightness,
-% const double contrast)
%
% A description of each parameter follows:
%
% o wand: the magick wand.
%
-% o channel: the image channel(s).
-%
% o brightness: the brightness percent (-100 .. 100).
%
% o contrast: the contrast percent (-100 .. 100).
%
*/
-
-WandExport MagickBooleanType MagickBrightnessContrastImage(MagickWand *wand,
- const double brightness,const double contrast)
-{
- MagickBooleanType
- status;
-
- status=MagickBrightnessContrastImageChannel(wand,DefaultChannels,brightness,
- contrast);
- return(status);
-}
-
-WandExport MagickBooleanType MagickBrightnessContrastImageChannel(
- MagickWand *wand,const ChannelType channel,const double brightness,
- const double contrast)
+WandExport MagickBooleanType MagickBrightnessContrastImage(
+ MagickWand *wand,const double brightness,const double contrast)
{
MagickBooleanType
status;
(void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
if (wand->images == (Image *) NULL)
ThrowWandException(WandError,"ContainsNoImages",wand->name);
- status=BrightnessContrastImageChannel(wand->images,channel,brightness,
- contrast);
+ status=BrightnessContrastImage(wand->images,brightness,contrast);
if (status == MagickFalse)
InheritException(wand->exception,&wand->images->exception);
return(status);
%
% MagickBooleanType MagickSigmoidalContrastImage(MagickWand *wand,
% const MagickBooleanType sharpen,const double alpha,const double beta)
-% MagickBooleanType MagickSigmoidalContrastImageChannel(MagickWand *wand,
-% const ChannelType channel,const MagickBooleanType sharpen,
-% const double alpha,const double beta)
%
% A description of each parameter follows:
%
% o wand: the magick wand.
%
-% o channel: Identify which channel to level: RedChannel, GreenChannel,
-%
% o sharpen: Increase or decrease image contrast.
%
% o alpha: strength of the contrast, the larger the number the more
% o beta: midpoint of the function as a color value 0 to QuantumRange.
%
*/
-
-WandExport MagickBooleanType MagickSigmoidalContrastImage(MagickWand *wand,
- const MagickBooleanType sharpen,const double alpha,const double beta)
-{
- MagickBooleanType
- status;
-
- status=MagickSigmoidalContrastImageChannel(wand,DefaultChannels,sharpen,
- alpha,beta);
- return(status);
-}
-
-WandExport MagickBooleanType MagickSigmoidalContrastImageChannel(
- MagickWand *wand,const ChannelType channel,const MagickBooleanType sharpen,
- const double alpha,const double beta)
+WandExport MagickBooleanType MagickSigmoidalContrastImage(
+ MagickWand *wand,const MagickBooleanType sharpen,const double alpha,
+ const double beta)
{
MagickBooleanType
status;
(void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
if (wand->images == (Image *) NULL)
ThrowWandException(WandError,"ContainsNoImages",wand->name);
- status=SigmoidalContrastImageChannel(wand->images,channel,sharpen,alpha,beta);
+ status=SigmoidalContrastImage(wand->images,sharpen,alpha,beta);
if (status == MagickFalse)
InheritException(wand->exception,&wand->images->exception);
return(status);
const double),
MagickBorderImage(MagickWand *,const PixelWand *,const size_t,const size_t),
MagickBrightnessContrastImage(MagickWand *,const double,const double),
- MagickBrightnessContrastImageChannel(MagickWand *,const ChannelType,
- const double,const double),
MagickCharcoalImage(MagickWand *,const double,const double),
MagickChopImage(MagickWand *,const size_t,const size_t,const ssize_t,
const ssize_t),
MagickShearImage(MagickWand *,const PixelWand *,const double,const double),
MagickSigmoidalContrastImage(MagickWand *,const MagickBooleanType,
const double,const double),
- MagickSigmoidalContrastImageChannel(MagickWand *,const ChannelType,
- const MagickBooleanType,const double,const double),
MagickSketchImage(MagickWand *,const double,const double,const double),
MagickSolarizeImage(MagickWand *,const double),
MagickSparseColorImage(MagickWand *,const ChannelType,const SparseColorMethod,
contrast=0.0;
if ((flags & SigmaValue) != 0)
contrast=geometry_info.sigma;
- (void) BrightnessContrastImageChannel(*image,channel,brightness,
- contrast);
+ (void) BrightnessContrastImage(*image,brightness,contrast);
InheritException(exception,&(*image)->exception);
break;
}
if ((flags & PercentValue) != 0)
geometry_info.sigma=(double) QuantumRange*geometry_info.sigma/
100.0;
- (void) SigmoidalContrastImageChannel(*image,channel,
- (*option == '-') ? MagickTrue : MagickFalse,geometry_info.rho,
- geometry_info.sigma);
+ (void) SigmoidalContrastImage(*image,(*option == '-') ?
+ MagickTrue : MagickFalse,geometry_info.rho,geometry_info.sigma);
InheritException(exception,&(*image)->exception);
break;
}
if (attribute_flag[2] != 0)
geometry_info.sigma=argument_list[2].real_reference;
if (attribute_flag[3] != 0)
- channel=(ChannelType) argument_list[3].integer_reference;
+ {
+ channel=(ChannelType) argument_list[3].integer_reference;
+ SetPixelComponentMap(image,channel);
+ }
sharpen=MagickTrue;
if (attribute_flag[4] != 0)
sharpen=argument_list[4].integer_reference != 0 ? MagickTrue :
MagickFalse;
- (void) SigmoidalContrastImageChannel(image,channel,sharpen,
- geometry_info.rho,geometry_info.sigma);
+ (void) SigmoidalContrastImage(image,sharpen,geometry_info.rho,
+ geometry_info.sigma);
break;
}
case 93: /* Extent */
if (attribute_flag[2] != 0)
contrast=argument_list[2].real_reference;
if (attribute_flag[4] != 0)
- channel=(ChannelType) argument_list[4].integer_reference;
- (void) BrightnessContrastImageChannel(image,channel,brightness,
- contrast);
+ {
+ channel=(ChannelType) argument_list[4].integer_reference;
+ SetPixelComponentMap(image,channel);
+ }
+ (void) BrightnessContrastImage(image,brightness,contrast);
break;
}
case 133: /* Morphology */