// Gamma correct image
void Magick::Image::gamma ( const double gamma_ )
{
+ ExceptionInfo exceptionInfo;
+ GetExceptionInfo( &exceptionInfo );
modifyImage();
- GammaImage ( image(), gamma_ );
+ GammaImage ( image(), gamma_, &exceptionInfo );
+ throwException( exceptionInfo );
+ (void) DestroyExceptionInfo( &exceptionInfo );
}
void Magick::Image::gamma ( const double gammaRed_,
FormatLocaleString( gamma, MaxTextExtent, "%3.6f/%3.6f/%3.6f/",
gammaRed_, gammaGreen_, gammaBlue_);
+ ExceptionInfo exceptionInfo;
+ GetExceptionInfo( &exceptionInfo );
modifyImage();
- GammaImage ( image(), atof(gamma) );
- throwImageException();
+ GammaImage ( image(), atof(gamma), &exceptionInfo );
+ throwException( exceptionInfo );
+ (void) DestroyExceptionInfo( &exceptionInfo );
}
// Gaussian blur image
// only
void Magick::Image::negate ( const bool grayscale_ )
{
+ ExceptionInfo exceptionInfo;
+ GetExceptionInfo( &exceptionInfo );
modifyImage();
- NegateImage ( image(), grayscale_ == true ? MagickTrue : MagickFalse );
- throwImageException();
+ NegateImage ( image(), grayscale_ == true ? MagickTrue : MagickFalse,
+ &exceptionInfo );
+ throwException( exceptionInfo );
+ (void) DestroyExceptionInfo( &exceptionInfo );
}
// Normalize image
*/
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
- (void) GammaImage(*image,atof(factor));
+ (void) GammaImage(*image,atof(factor),&(*image)->exception);
XSetCursorState(display,windows,MagickFalse);
if (windows->image.orphan != MagickFalse)
break;
*/
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
- (void) NegateImage(*image,MagickFalse);
+ (void) NegateImage(*image,MagickFalse,&(*image)->exception);
XSetCursorState(display,windows,MagickFalse);
if (windows->image.orphan != MagickFalse)
break;
(void) QueryColorDatabase("#ffffff",&clone_info->fill,&image->exception);
clone_info->clip_mask=(char *) NULL;
status=DrawImage(image->clip_mask,clone_info);
- status|=NegateImage(image->clip_mask,MagickFalse);
+ status|=NegateImage(image->clip_mask,MagickFalse,&image->exception);
clone_info=DestroyDrawInfo(clone_info);
if (image->debug != MagickFalse)
(void) LogMagickEvent(DrawEvent,GetMagickModule(),"end clip-path");
if (preview_image == (Image *) NULL)
break;
gamma+=0.4f;
- (void) GammaImage(preview_image,gamma);
+ (void) GammaImage(preview_image,gamma,exception);
(void) FormatLocaleString(label,MaxTextExtent,"gamma %g",gamma);
break;
}
%
% The format of the GammaImage method is:
%
-% MagickBooleanType GammaImage(Image *image,const double gamma)
+% MagickBooleanType GammaImage(Image *image,const double gamma,
+% ExceptionInfo *exception)
%
% A description of each parameter follows:
%
% o gamma: the image gamma.
%
*/
-MagickExport MagickBooleanType GammaImage(Image *image,const double gamma)
+MagickExport MagickBooleanType GammaImage(Image *image,const double gamma,
+ ExceptionInfo *exception)
{
#define GammaCorrectImageTag "GammaCorrect/Image"
CacheView
*image_view;
- ExceptionInfo
- *exception;
-
MagickBooleanType
status;
*/
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 NegateImage method is:
%
% MagickBooleanType NegateImage(Image *image,
-% const MagickBooleanType grayscale)
+% const MagickBooleanType grayscale,ExceptionInfo *exception)
%
% A description of each parameter follows:
%
%
% o grayscale: If MagickTrue, only negate grayscale pixels within the image.
%
+% o exception: return any errors or warnings in this structure.
+%
*/
MagickExport MagickBooleanType NegateImage(Image *image,
- const MagickBooleanType grayscale)
+ const MagickBooleanType grayscale,ExceptionInfo *exception)
{
#define NegateImageTag "Negate/Image"
CacheView
*image_view;
- ExceptionInfo
- *exception;
-
MagickBooleanType
status;
*/
status=MagickTrue;
progress=0;
- exception=(&image->exception);
image_view=AcquireCacheView(image);
if (grayscale != MagickFalse)
{
ContrastImage(Image *,const MagickBooleanType),
ContrastStretchImage(Image *,const double,const double),
EqualizeImage(Image *image),
- GammaImage(Image *,const double),
+ GammaImage(Image *,const double,ExceptionInfo *),
HaldClutImage(Image *,const Image *),
LevelImage(Image *,const double,const double,const double),
LevelizeImage(Image *,const double,const double,const double),
const MagickBooleanType),
LinearStretchImage(Image *,const double,const double),
ModulateImage(Image *,const char *),
- NegateImage(Image *,const MagickBooleanType),
+ NegateImage(Image *,const MagickBooleanType,ExceptionInfo *),
NormalizeImage(Image *),
SigmoidalContrastImage(Image *,const MagickBooleanType,const double,
const double);
if (charcoal_image == (Image *) NULL)
return((Image *) NULL);
(void) NormalizeImage(charcoal_image);
- (void) NegateImage(charcoal_image,MagickFalse);
+ (void) NegateImage(charcoal_image,MagickFalse,exception);
(void) SetImageType(charcoal_image,GrayscaleType);
return(charcoal_image);
}
if (dodge_image == (Image *) NULL)
return((Image *) NULL);
(void) NormalizeImage(dodge_image);
- (void) NegateImage(dodge_image,MagickFalse);
+ (void) NegateImage(dodge_image,MagickFalse,exception);
(void) TransformImage(&dodge_image,(char *) NULL,"50%");
sketch_image=CloneImage(image,0,0,MagickTrue,exception);
if (sketch_image == (Image *) NULL)
return(MagickFalse);
}
if (inside == MagickFalse)
- (void) NegateImage(clip_mask,MagickFalse);
+ (void) NegateImage(clip_mask,MagickFalse,&image->exception);
(void) FormatLocaleString(clip_mask->magick_filename,MaxTextExtent,
"8BIM:1999,2998:%s\nPS",pathname);
(void) SetImageClipMask(image,clip_mask);
(image->compose == DstOutCompositeOp))
{
SetPixelChannelMap(image,AlphaChannel);
- (void) NegateImage(image,MagickFalse);
+ (void) NegateImage(image,MagickFalse,exception);
SetPixelChannelMap(image,DefaultChannels);
}
}
#define MagickLibAddendum "-0"
#define MagickLibInterface 5
#define MagickLibMinInterface 5
-#define MagickReleaseDate "2011-07-18"
-#define MagickChangeDate "20110701"
+#define MagickReleaseDate "2011-07-23"
+#define MagickChangeDate "20110721"
#define MagickAuthoritativeURL "http://www.imagemagick.org"
#if defined(MAGICKCORE_OPENMP_SUPPORT)
#define MagickOpenMPFeature "OpenMP "
Set a blending mask for the composition.
*/
images->mask=mask_image;
- (void) NegateImage(images->mask,MagickFalse);
+ (void) NegateImage(images->mask,MagickFalse,exception);
}
}
status&=CompositeImageList(image_info,&images,composite_image,
(void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
if (wand->images == (Image *) NULL)
ThrowWandException(WandError,"ContainsNoImages",wand->name);
- status=GammaImage(wand->images,gamma);
- if (status == MagickFalse)
- InheritException(wand->exception,&wand->images->exception);
+ status=GammaImage(wand->images,gamma,wand->exception);
return(status);
}
\f
(void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
if (wand->images == (Image *) NULL)
ThrowWandException(WandError,"ContainsNoImages",wand->name);
- status=NegateImage(wand->images,gray);
- if (status == MagickFalse)
- InheritException(wand->exception,&wand->images->exception);
+ status=NegateImage(wand->images,gray,wand->exception);
return(status);
}
\f
if (*option == '+')
(*image)->gamma=InterpretLocaleValue(argv[i+1],(char **) NULL);
else
- {
- (void) GammaImage(*image,InterpretLocaleValue(argv[i+1],
- (char **) NULL));
- InheritException(exception,&(*image)->exception);
- }
+ (void) GammaImage(*image,InterpretLocaleValue(argv[i+1],
+ (char **) NULL),exception);
break;
}
if ((LocaleCompare("gaussian-blur",option+1) == 0) ||
{
(void) SyncImageSettings(mogrify_info,*image);
(void) NegateImage(*image,*option == '+' ? MagickTrue :
- MagickFalse);
- InheritException(exception,&(*image)->exception);
+ MagickFalse,exception);
break;
}
if (LocaleCompare("noise",option+1) == 0)
*/
/* POSIBLE ERROR; what if image->mask already set */
image->mask=mask_image;
- (void) NegateImage(image->mask,MagickFalse);
+ (void) NegateImage(image->mask,MagickFalse,exception);
}
}
(void) CompositeImage(image,image->compose,composite_image,
*/
image->mask=CloneImage(argument_list[10].image_reference,0,0,
MagickTrue,&image->exception);
- (void) NegateImage(image->mask,MagickFalse);
+ (void) NegateImage(image->mask,MagickFalse,exception);
}
}
if (attribute_flag[11] != 0) /* channel */
argument_list[0].string_reference=message;
}
(void) GammaImage(image,InterpretLocaleValue(
- argument_list[0].string_reference,(char **) NULL));
+ argument_list[0].string_reference,(char **) NULL),exception);
break;
}
case 41: /* Map */
channel=(ChannelType) argument_list[1].integer_reference;
PushPixelChannelMap(image,channel);
(void) NegateImage(image,argument_list[0].integer_reference != 0 ?
- MagickTrue : MagickFalse);
+ MagickTrue : MagickFalse,exception);
PopPixelChannelMap(image);
break;
}
}
image->clip_mask=CloneImage(argument_list[0].image_reference,0,0,
MagickTrue,exception);
- (void) NegateImage(image->clip_mask,MagickFalse);
+ (void) NegateImage(image->clip_mask,MagickFalse,exception);
break;
}
case 107: /* LinearStretch */
}
image->mask=CloneImage(argument_list[0].image_reference,0,0,
MagickTrue,exception);
- (void) NegateImage(image->mask,MagickFalse);
+ (void) NegateImage(image->mask,MagickFalse,exception);
break;
}
case 110: /* Polaroid */
if (*gamma == '\0')
(void) FormatLocaleString(gamma,MaxTextExtent,"%g,%g,%g",
(double) pixel.red,(double) pixel.green,(double) pixel.blue);
- (void) GammaImage(msl_info->image[n],atof(gamma));
+ (void) GammaImage(msl_info->image[n],atof(gamma),
+ &msl_info->image[n]->exception);
break;
}
else if (LocaleCompare((const char *) tag,"get") == 0)
}
}
PushPixelChannelMap(msl_info->image[n],channel);
- (void) NegateImage(msl_info->image[n],gray);
+ (void) NegateImage(msl_info->image[n],gray,
+ &msl_info->image[n]->exception);
PopPixelChannelMap(msl_info->image[n]);
break;
}
}
}
if (layer_info[i].image->colorspace == CMYKColorspace)
- (void) NegateImage(layer_info[i].image,MagickFalse);
+ (void) NegateImage(layer_info[i].image,MagickFalse,exception);
status=SetImageProgress(image,LoadImagesTag,i,(MagickSizeType)
number_layers);
if (status == MagickFalse)
if (compression == 1)
offsets=(MagickOffsetType *) RelinquishMagickMemory(offsets);
if (image->colorspace == CMYKColorspace)
- (void) NegateImage(image,MagickFalse);
+ (void) NegateImage(image,MagickFalse,exception);
(void) CloseBlob(image);
return(GetFirstImageInList(image));
}
else
{
if (next_image->colorspace == CMYKColorspace)
- (void) NegateImage(next_image,MagickFalse);
+ (void) NegateImage(next_image,MagickFalse,&next_image->exception);
if (next_image->compression == RLECompression)
{
/*
MagickFalse);
(void) SetImageProgress(image,SaveImagesTag,5,6);
if (next_image->colorspace == CMYKColorspace)
- (void) NegateImage(next_image,MagickFalse);
+ (void) NegateImage(next_image,MagickFalse,&next_image->exception);
}
if (next_image->compression == RLECompression)
compact_pixels=(unsigned char *) RelinquishMagickMemory(compact_pixels);