diff --git a/Magick++/lib/Image.cpp b/Magick++/lib/Image.cpp
index 3d379cb..383394c 100644
--- a/Magick++/lib/Image.cpp
+++ b/Magick++/lib/Image.cpp
@@ -1929,7 +1929,7 @@
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();
}
diff --git a/Magick++/lib/Magick++/Include.h b/Magick++/lib/Magick++/Include.h
index 1269eb1..9b01e4f 100644
--- a/Magick++/lib/Magick++/Include.h
+++ b/Magick++/lib/Magick++/Include.h
@@ -867,7 +867,7 @@
using MagickCore::SharpenImageChannel;
using MagickCore::ShaveImage;
using MagickCore::ShearImage;
- using MagickCore::SigmoidalContrastImageChannel;
+ using MagickCore::SigmoidalContrastImage;
using MagickCore::SignatureImage;
using MagickCore::SolarizeImage;
using MagickCore::SparseColorImage;
diff --git a/MagickCore/display.c b/MagickCore/display.c
index 4291e8e..7f19bf4 100644
--- a/MagickCore/display.c
+++ b/MagickCore/display.c
@@ -7849,6 +7849,12 @@
}
case SigmoidalContrastCommand:
{
+ GeometryInfo
+ geometry_info;
+
+ MagickStatusType
+ flags;
+
static char
levels[MaxTextExtent] = "3x50%";
@@ -7864,7 +7870,13 @@
*/
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;
diff --git a/MagickCore/enhance.c b/MagickCore/enhance.c
index d2e35a9..86f2a71 100644
--- a/MagickCore/enhance.c
+++ b/MagickCore/enhance.c
@@ -214,36 +214,19 @@
%
% 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"
double
@@ -269,8 +252,8 @@
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);
}
@@ -3626,16 +3609,11 @@
%
% 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
@@ -3644,32 +3622,8 @@
% 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"
@@ -3810,7 +3764,7 @@
proceed;
#if defined(MAGICKCORE_OPENMP_SUPPORT)
- #pragma omp critical (MagickCore_SigmoidalContrastImageChannel)
+ #pragma omp critical (MagickCore_SigmoidalContrastImage)
#endif
proceed=SetImageProgress(image,SigmoidalContrastImageTag,progress++,
image->rows);
diff --git a/MagickCore/enhance.h b/MagickCore/enhance.h
index c53bf73..95d00c8 100644
--- a/MagickCore/enhance.h
+++ b/MagickCore/enhance.h
@@ -26,8 +26,6 @@
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 *),
@@ -57,9 +55,8 @@
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 *);
diff --git a/MagickCore/methods.h b/MagickCore/methods.h
index c02faeb..d031839 100644
--- a/MagickCore/methods.h
+++ b/MagickCore/methods.h
@@ -128,7 +128,7 @@
#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)
@@ -1128,7 +1128,7 @@
#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)
diff --git a/MagickCore/version.h b/MagickCore/version.h
index 0b955d1..fdb711e 100644
--- a/MagickCore/version.h
+++ b/MagickCore/version.h
@@ -34,7 +34,7 @@
#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)
diff --git a/MagickWand/magick-image.c b/MagickWand/magick-image.c
index 9e40723..587a9eb 100644
--- a/MagickWand/magick-image.c
+++ b/MagickWand/magick-image.c
@@ -1066,36 +1066,18 @@
%
% 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;
@@ -1106,8 +1088,7 @@
(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);
@@ -11025,16 +11006,11 @@
%
% 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
@@ -11043,21 +11019,9 @@
% 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;
@@ -11068,7 +11032,7 @@
(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);
diff --git a/MagickWand/magick-image.h b/MagickWand/magick-image.h
index e4e5cfd..814bce5 100644
--- a/MagickWand/magick-image.h
+++ b/MagickWand/magick-image.h
@@ -96,8 +96,6 @@
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),
@@ -324,8 +322,6 @@
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,
diff --git a/MagickWand/mogrify.c b/MagickWand/mogrify.c
index b23612f..e9853ac 100644
--- a/MagickWand/mogrify.c
+++ b/MagickWand/mogrify.c
@@ -947,8 +947,7 @@
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;
}
@@ -2745,9 +2744,8 @@
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;
}
diff --git a/PerlMagick/Magick.xs b/PerlMagick/Magick.xs
index 430a00e..0b7cf72 100644
--- a/PerlMagick/Magick.xs
+++ b/PerlMagick/Magick.xs
@@ -9706,13 +9706,16 @@
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 */
@@ -10464,9 +10467,11 @@
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 */