FormatLocaleString( modulate, MaxTextExtent, "%3.6f,%3.6f,%3.6f",
brightness_, saturation_, hue_);
+ ExceptionInfo exceptionInfo;
+ GetExceptionInfo( &exceptionInfo );
modifyImage();
- ModulateImage( image(), modulate );
- throwImageException();
+ ModulateImage( image(), modulate, &exceptionInfo );
+ throwException( exceptionInfo );
+ (void) DestroyExceptionInfo( &exceptionInfo );
}
// Motion blur image with specified blur factor
// Contrast image
void Magick::Image::sigmoidalContrast ( const size_t sharpen_, const double contrast, const double midpoint )
{
+ ExceptionInfo exceptionInfo;
+ GetExceptionInfo( &exceptionInfo );
modifyImage();
- (void) SigmoidalContrastImage( image(), (MagickBooleanType) sharpen_, contrast, midpoint );
- throwImageException();
+ (void) SigmoidalContrastImage( image(), (MagickBooleanType) sharpen_, contrast, midpoint, &exceptionInfo );
+ throwException( exceptionInfo );
+ (void) DestroyExceptionInfo( &exceptionInfo );
}
// Solarize image (similar to effect seen when exposing a photographic
(void) CopyMagickString(modulate_factors,"100.0/100.0/",MaxTextExtent);
(void) ConcatenateMagickString(modulate_factors,hue_percent,
MaxTextExtent);
- (void) ModulateImage(*image,modulate_factors);
+ (void) ModulateImage(*image,modulate_factors,&(*image)->exception);
XSetCursorState(display,windows,MagickFalse);
if (windows->image.orphan != MagickFalse)
break;
(void) CopyMagickString(modulate_factors,"100.0/",MaxTextExtent);
(void) ConcatenateMagickString(modulate_factors,saturation_percent,
MaxTextExtent);
- (void) ModulateImage(*image,modulate_factors);
+ (void) ModulateImage(*image,modulate_factors,&(*image)->exception);
XSetCursorState(display,windows,MagickFalse);
if (windows->image.orphan != MagickFalse)
break;
XCheckRefreshWindows(display,windows);
(void) CopyMagickString(modulate_factors,brightness_percent,
MaxTextExtent);
- (void) ModulateImage(*image,modulate_factors);
+ (void) ModulateImage(*image,modulate_factors,&(*image)->exception);
XSetCursorState(display,windows,MagickFalse);
if (windows->image.orphan != MagickFalse)
break;
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);
+ geometry_info.sigma,&(*image)->exception);
XSetCursorState(display,windows,MagickFalse);
if (windows->image.orphan != MagickFalse)
break;
break;
(void) FormatLocaleString(factor,MaxTextExtent,"100,100,%g",
2.0*percentage);
- (void) ModulateImage(preview_image,factor);
+ (void) ModulateImage(preview_image,factor,exception);
(void) FormatLocaleString(label,MaxTextExtent,"modulate %s",factor);
break;
}
break;
(void) FormatLocaleString(factor,MaxTextExtent,"100,%g",
2.0*percentage);
- (void) ModulateImage(preview_image,factor);
+ (void) ModulateImage(preview_image,factor,exception);
(void) FormatLocaleString(label,MaxTextExtent,"modulate %s",factor);
break;
}
if (preview_image == (Image *) NULL)
break;
(void) FormatLocaleString(factor,MaxTextExtent,"%g",2.0*percentage);
- (void) ModulateImage(preview_image,factor);
+ (void) ModulateImage(preview_image,factor,exception);
(void) FormatLocaleString(label,MaxTextExtent,"modulate %s",factor);
break;
}
% %
% %
% %
-% L e v e l i z e I m a g e C h a n n e l %
+% L e v e l i z e I m a g e %
% %
% %
% %
% The format of the LinearStretchImage method is:
%
% MagickBooleanType LinearStretchImage(Image *image,
-% const double black_point,const double white_point)
+% const double black_point,const double white_point,
+% ExceptionInfo *exception)
%
% A description of each parameter follows:
%
%
% o white_point: the white point.
%
+% o exception: return any errors or warnings in this structure.
+%
*/
MagickExport MagickBooleanType LinearStretchImage(Image *image,
- const double black_point,const double white_point)
+ const double black_point,const double white_point,ExceptionInfo *exception)
{
#define LinearStretchImageTag "LinearStretch/Image"
- ExceptionInfo
- *exception;
+ CacheView
+ *image_view;
MagickBooleanType
status;
Form histogram.
*/
(void) ResetMagickMemory(histogram,0,(MaxMap+1)*sizeof(*histogram));
- exception=(&image->exception);
+ image_view=AcquireCacheView(image);
for (y=0; y < (ssize_t) image->rows; y++)
{
register const Quantum
register ssize_t
x;
- p=GetVirtualPixels(image,0,y,image->columns,1,exception);
+ p=GetCacheViewVirtualPixels(image_view,0,y,image->columns,1,exception);
if (p == (const Quantum *) NULL)
break;
- for (x=(ssize_t) image->columns-1; x >= 0; x--)
+ for (x=0; x < (ssize_t) image->columns; x++)
{
histogram[ScaleQuantumToMap(GetPixelIntensity(image,p))]++;
p+=GetPixelChannels(image);
}
}
+ image_view=DestroyCacheView(image_view);
/*
Find the histogram boundaries by locating the black and white point levels.
*/
%
% The format of the ModulateImage method is:
%
-% MagickBooleanType ModulateImage(Image *image,const char *modulate)
+% MagickBooleanType ModulateImage(Image *image,const char *modulate,
+% ExceptionInfo *exception)
%
% A description of each parameter follows:
%
% o image: the image.
%
-% o modulate: Define the percent change in brightness, saturation, and
-% hue.
+% o modulate: Define the percent change in brightness, saturation, and hue.
+%
+% o exception: return any errors or warnings in this structure.
%
*/
ConvertHWBToRGB(hue,whiteness,blackness,red,green,blue);
}
-MagickExport MagickBooleanType ModulateImage(Image *image,const char *modulate)
+MagickExport MagickBooleanType ModulateImage(Image *image,const char *modulate,
+ ExceptionInfo *exception)
{
#define ModulateImageTag "Modulate/Image"
percent_hue,
percent_saturation;
- ExceptionInfo
- *exception;
-
GeometryInfo
geometry_info;
*/
status=MagickTrue;
progress=0;
- exception=(&image->exception);
image_view=AcquireCacheView(image);
#if defined(MAGICKCORE_OPENMP_SUPPORT)
#pragma omp parallel for schedule(dynamic,4) shared(progress,status)
% The format of the SigmoidalContrastImage method is:
%
% MagickBooleanType SigmoidalContrastImage(Image *image,
-% const MagickBooleanType sharpen,const char *levels)
+% const MagickBooleanType sharpen,const char *levels,
+% ExceptionInfo *exception)
%
% A description of each parameter follows:
%
%
% o beta: midpoint of the function as a color value 0 to QuantumRange.
%
+% o exception: return any errors or warnings in this structure.
+%
*/
MagickExport MagickBooleanType SigmoidalContrastImage(Image *image,
- const MagickBooleanType sharpen,const double contrast,const double midpoint)
+ const MagickBooleanType sharpen,const double contrast,const double midpoint,
+ ExceptionInfo *exception)
{
#define SigmoidalContrastImageTag "SigmoidalContrast/Image"
CacheView
*image_view;
- ExceptionInfo
- *exception;
-
MagickBooleanType
status;
{
sigmoidal_map[i]=(MagickRealType) ScaleMapToQuantum((MagickRealType)
(MaxMap*((1.0/(1.0+exp(contrast*(midpoint/(double) QuantumRange-
- (double) i/MaxMap))))-(1.0/(1.0+exp(contrast*(midpoint/
- (double) QuantumRange)))))/((1.0/(1.0+exp(contrast*(midpoint/
- (double) QuantumRange-1.0))))-(1.0/(1.0+exp(contrast*(midpoint/
- (double) QuantumRange)))))+0.5));
+ (double) i/MaxMap))))-(1.0/(1.0+exp(contrast*(midpoint/(double)
+ QuantumRange)))))/((1.0/(1.0+exp(contrast*(midpoint/(double)
+ QuantumRange-1.0))))-(1.0/(1.0+exp(contrast*(midpoint/(double)
+ QuantumRange)))))+0.5));
continue;
}
sigmoidal_map[i]=(MagickRealType) ScaleMapToQuantum((MagickRealType)
- (MaxMap*(QuantumScale*midpoint-log((1.0-(1.0/(1.0+exp(midpoint/
- (double) QuantumRange*contrast))+((double) i/MaxMap)*((1.0/
- (1.0+exp(contrast*(midpoint/(double) QuantumRange-1.0))))-(1.0/
- (1.0+exp(midpoint/(double) QuantumRange*contrast))))))/
- (1.0/(1.0+exp(midpoint/(double) QuantumRange*contrast))+
- ((double) i/MaxMap)*((1.0/(1.0+exp(contrast*(midpoint/
- (double) QuantumRange-1.0))))-(1.0/(1.0+exp(midpoint/
- (double) QuantumRange*contrast))))))/contrast)));
+ (MaxMap*(QuantumScale*midpoint-log((1.0-(1.0/(1.0+exp(midpoint/(double)
+ QuantumRange*contrast))+((double) i/MaxMap)*((1.0/(1.0+exp(contrast*(
+ midpoint/(double) QuantumRange-1.0))))-(1.0/(1.0+exp(midpoint/(double)
+ QuantumRange*contrast))))))/(1.0/(1.0+exp(midpoint/(double) QuantumRange*
+ contrast))+((double) i/MaxMap)*((1.0/(1.0+exp(contrast*(midpoint/(double)
+ QuantumRange-1.0))))-(1.0/(1.0+exp(midpoint/(double) QuantumRange*
+ contrast))))))/contrast)));
}
if (image->storage_class == PseudoClass)
{
*/
status=MagickTrue;
progress=0;
- exception=(&image->exception);
image_view=AcquireCacheView(image);
#if defined(MAGICKCORE_OPENMP_SUPPORT)
#pragma omp parallel for schedule(dynamic,4) shared(progress,status)
}
for (x=0; x < (ssize_t) image->columns; x++)
{
- if ((GetPixelRedTraits(image) & UpdatePixelTrait) != 0)
- SetPixelRed(image,ClampToQuantum(sigmoidal_map[ScaleQuantumToMap(
- GetPixelRed(image,q))]),q);
- if ((GetPixelGreenTraits(image) & UpdatePixelTrait) != 0)
- SetPixelGreen(image,ClampToQuantum(sigmoidal_map[ScaleQuantumToMap(
- GetPixelGreen(image,q))]),q);
- if ((GetPixelBlueTraits(image) & UpdatePixelTrait) != 0)
- SetPixelBlue(image,ClampToQuantum(sigmoidal_map[ScaleQuantumToMap(
- GetPixelBlue(image,q))]),q);
- if (((GetPixelBlackTraits(image) & UpdatePixelTrait) != 0) &&
- (image->colorspace == CMYKColorspace))
- SetPixelBlack(image,ClampToQuantum(sigmoidal_map[ScaleQuantumToMap(
- GetPixelBlack(image,q))]),q);
- if ((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0)
- SetPixelAlpha(image,ClampToQuantum(sigmoidal_map[ScaleQuantumToMap(
- GetPixelAlpha(image,q))]),q);
+ register ssize_t
+ i;
+
+ for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
+ {
+ PixelTrait
+ traits;
+
+ traits=GetPixelChannelMapTraits(image,(PixelChannel) i);
+ if ((traits & UpdatePixelTrait) != 0)
+ q[i]=ClampToQuantum(sigmoidal_map[ScaleQuantumToMap(q[i])]);
+ }
q+=GetPixelChannels(image);
}
if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
LevelizeImage(Image *,const double,const double,const double,ExceptionInfo *),
LevelImageColors(Image *,const PixelInfo *,const PixelInfo *,
const MagickBooleanType,ExceptionInfo *),
- LinearStretchImage(Image *,const double,const double),
- ModulateImage(Image *,const char *),
+ LinearStretchImage(Image *,const double,const double,ExceptionInfo *),
+ ModulateImage(Image *,const char *,ExceptionInfo *),
NegateImage(Image *,const MagickBooleanType,ExceptionInfo *),
NormalizeImage(Image *,ExceptionInfo *),
SigmoidalContrastImage(Image *,const MagickBooleanType,const double,
- const double);
+ const double,ExceptionInfo *);
extern MagickExport Image
*EnhanceImage(const Image *,ExceptionInfo *);
/* #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
#endif
/* Define if you have the <lcms2.h> header file. */
-#ifndef MAGICKCORE_HAVE_LCMS2_H
-#define MAGICKCORE_HAVE_LCMS2_H 1
-#endif
+/* #undef HAVE_LCMS2_H */
/* Define if you have the <lcms2/lcms2.h> header file. */
/* #undef HAVE_LCMS2_LCMS2_H */
/* Define if you have the <lcms.h> header file. */
-/* #undef HAVE_LCMS_H */
+#ifndef MAGICKCORE_HAVE_LCMS_H
+#define MAGICKCORE_HAVE_LCMS_H 1
+#endif
/* Define if you have the <lcms/lcms.h> header file. */
/* #undef HAVE_LCMS_LCMS_H */
/* #undef HasUMEM */
/* Define if you have wmflite library */
-/* #undef HasWMFlite */
+#ifndef MAGICKCORE_HasWMFlite
+#define MAGICKCORE_HasWMFlite 1
+#endif
/* ImageMagick is formally installed under prefix */
#ifndef MAGICKCORE_INSTALLED_SUPPORT
#endif
/* Define if you have JBIG library */
-/* #undef JBIG_DELEGATE */
+#ifndef MAGICKCORE_JBIG_DELEGATE
+#define MAGICKCORE_JBIG_DELEGATE 1
+#endif
/* Define if you have JPEG version 2 "Jasper" library */
#ifndef MAGICKCORE_JP2_DELEGATE
#endif
/* Define if you have LQR library */
-/* #undef LQR_DELEGATE */
+#ifndef MAGICKCORE_LQR_DELEGATE
+#define MAGICKCORE_LQR_DELEGATE 1
+#endif
/* Define if using libltdl to support dynamically loadable modules */
#ifndef MAGICKCORE_LTDL_DELEGATE
/* 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/atlas:/opt/modules/pkg/intel/f77/10.0.025/lib:/usr/lib64/llvm:/usr/local/lib:/usr/lib64/mysql:/usr/lib64/qt-3.3/lib:/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
/* Define if you have WEBP library */
-/* #undef WEBP_DELEGATE */
+#ifndef MAGICKCORE_WEBP_DELEGATE
+#define MAGICKCORE_WEBP_DELEGATE 1
+#endif
/* Define to use the Windows GDI32 library */
/* #undef WINGDI32_DELEGATE */
*/
#define MagickPackageName "ImageMagick"
#define MagickCopyright "Copyright (C) 1999-2011 ImageMagick Studio LLC"
-#define MagickSVNRevision "5041"
+#define MagickSVNRevision "exported"
#define MagickLibVersion 0x700
#define MagickLibVersionText "7.0.0"
#define MagickLibVersionNumber 5,0,0
(void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
if (wand->images == (Image *) NULL)
ThrowWandException(WandError,"ContainsNoImages",wand->name);
- status=LinearStretchImage(wand->images,black_point,white_point);
- if (status == MagickFalse)
- InheritException(wand->exception,&wand->images->exception);
+ status=LinearStretchImage(wand->images,black_point,white_point,
+ &wand->images->exception);
return(status);
}
\f
ThrowWandException(WandError,"ContainsNoImages",wand->name);
(void) FormatLocaleString(modulate,MaxTextExtent,"%g,%g,%g",
brightness,saturation,hue);
- status=ModulateImage(wand->images,modulate);
- if (status == MagickFalse)
- InheritException(wand->exception,&wand->images->exception);
+ status=ModulateImage(wand->images,modulate,&wand->images->exception);
return(status);
}
\f
(void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
if (wand->images == (Image *) NULL)
ThrowWandException(WandError,"ContainsNoImages",wand->name);
- status=SigmoidalContrastImage(wand->images,sharpen,alpha,beta);
- if (status == MagickFalse)
- InheritException(wand->exception,&wand->images->exception);
+ status=SigmoidalContrastImage(wand->images,sharpen,alpha,beta,
+ &wand->images->exception);
return(status);
}
\f
if ((flags & SigmaValue) == 0)
white_point=(MagickRealType) (*image)->columns*(*image)->rows-
black_point;
- (void) LinearStretchImage(*image,black_point,white_point);
+ (void) LinearStretchImage(*image,black_point,white_point,exception);
InheritException(exception,&(*image)->exception);
break;
}
if (LocaleCompare("modulate",option+1) == 0)
{
(void) SyncImageSettings(mogrify_info,*image);
- (void) ModulateImage(*image,argv[i+1]);
- InheritException(exception,&(*image)->exception);
+ (void) ModulateImage(*image,argv[i+1],exception);
break;
}
if (LocaleCompare("monitor",option+1) == 0)
geometry_info.sigma=(double) QuantumRange*geometry_info.sigma/
100.0;
(void) SigmoidalContrastImage(*image,(*option == '-') ?
- MagickTrue : MagickFalse,geometry_info.rho,geometry_info.sigma);
- InheritException(exception,&(*image)->exception);
+ MagickTrue : MagickFalse,geometry_info.rho,geometry_info.sigma,
+ exception);
break;
}
if (LocaleCompare("sketch",option+1) == 0)
}
(void) FormatLocaleString(modulate,MaxTextExtent,"%.15g,%.15g,%.15g",
geometry_info.rho,geometry_info.sigma,geometry_info.xi);
- (void) ModulateImage(image,modulate);
+ (void) ModulateImage(image,modulate,exception);
break;
}
case 44: /* Negate */
MagickFalse;
channel_mask=SetPixelChannelMask(image,channel);
(void) SigmoidalContrastImage(image,sharpen,geometry_info.rho,
- geometry_info.sigma);
+ geometry_info.sigma,exception);
(void) SetPixelChannelMask(image,channel_mask);
break;
}
black_point=argument_list[1].real_reference;
if (attribute_flag[2] != 0)
white_point=argument_list[2].real_reference;
- (void) LinearStretchImage(image,black_point,white_point);
+ (void) LinearStretchImage(image,black_point,white_point,exception);
break;
}
case 109: /* Mask */
}
(void) FormatLocaleString(modulate,MaxTextExtent,"%g,%g,%g",
geometry_info.rho,geometry_info.sigma,geometry_info.xi);
- (void) ModulateImage(msl_info->image[n],modulate);
+ (void) ModulateImage(msl_info->image[n],modulate,
+ &msl_info->image[n]->exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedElement",(const char *) tag);