% July 1992 %
% %
% %
-% Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2012 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
#include "MagickCore/artifact.h"
#include "MagickCore/blob.h"
#include "MagickCore/cache.h"
+#include "MagickCore/cache-private.h"
#include "MagickCore/client.h"
#include "MagickCore/color.h"
#include "MagickCore/colorspace.h"
#include "MagickCore/delegate.h"
#include "MagickCore/display.h"
#include "MagickCore/display-private.h"
+#include "MagickCore/distort.h"
#include "MagickCore/draw.h"
#include "MagickCore/effect.h"
#include "MagickCore/enhance.h"
#include "MagickCore/resource_.h"
#include "MagickCore/shear.h"
#include "MagickCore/segment.h"
+#include "MagickCore/statistic.h"
#include "MagickCore/string_.h"
#include "MagickCore/string-private.h"
#include "MagickCore/transform.h"
#include "MagickCore/threshold.h"
#include "MagickCore/utility.h"
+#include "MagickCore/utility-private.h"
#include "MagickCore/version.h"
#include "MagickCore/widget.h"
+#include "MagickCore/widget-private.h"
+#include "MagickCore/xwindow.h"
#include "MagickCore/xwindow-private.h"
\f
#if defined(MAGICKCORE_X11_DELEGATE)
*/
static CommandType
XImageWindowCommand(Display *,XResourceInfo *,XWindows *,
- const MagickStatusType,KeySym,Image **);
+ const MagickStatusType,KeySym,Image **,ExceptionInfo *);
static Image
*XMagickCommand(Display *,XResourceInfo *,XWindows *,const CommandType,
- Image **),
+ Image **,ExceptionInfo *),
*XOpenImage(Display *,XResourceInfo *,XWindows *,const MagickBooleanType),
- *XTileImage(Display *,XResourceInfo *,XWindows *,Image *,XEvent *),
- *XVisualDirectoryImage(Display *,XResourceInfo *,XWindows *);
+ *XTileImage(Display *,XResourceInfo *,XWindows *,Image *,XEvent *,
+ ExceptionInfo *),
+ *XVisualDirectoryImage(Display *,XResourceInfo *,XWindows *,
+ ExceptionInfo *);
static MagickBooleanType
- XAnnotateEditImage(Display *,XResourceInfo *,XWindows *,Image *),
- XDrawEditImage(Display *,XResourceInfo *,XWindows *,Image **),
- XChopImage(Display *,XResourceInfo *,XWindows *,Image **),
- XCropImage(Display *,XResourceInfo *,XWindows *,Image *,const ClipboardMode),
- XBackgroundImage(Display *,XResourceInfo *,XWindows *,Image **),
- XColorEditImage(Display *,XResourceInfo *,XWindows *,Image **),
- XCompositeImage(Display *,XResourceInfo *,XWindows *,Image *),
- XConfigureImage(Display *,XResourceInfo *,XWindows *,Image *),
- XMatteEditImage(Display *,XResourceInfo *,XWindows *,Image **),
- XPasteImage(Display *,XResourceInfo *,XWindows *,Image *),
- XPrintImage(Display *,XResourceInfo *,XWindows *,Image *),
- XRotateImage(Display *,XResourceInfo *,XWindows *,double,Image **),
- XROIImage(Display *,XResourceInfo *,XWindows *,Image **),
- XSaveImage(Display *,XResourceInfo *,XWindows *,Image *),
- XTrimImage(Display *,XResourceInfo *,XWindows *,Image *);
+ XAnnotateEditImage(Display *,XResourceInfo *,XWindows *,Image *,
+ ExceptionInfo *),
+ XBackgroundImage(Display *,XResourceInfo *,XWindows *,Image **,
+ ExceptionInfo *),
+ XChopImage(Display *,XResourceInfo *,XWindows *,Image **,
+ ExceptionInfo *),
+ XCropImage(Display *,XResourceInfo *,XWindows *,Image *,const ClipboardMode,
+ ExceptionInfo *),
+ XColorEditImage(Display *,XResourceInfo *,XWindows *,Image **,
+ ExceptionInfo *),
+ XCompositeImage(Display *,XResourceInfo *,XWindows *,Image *,
+ ExceptionInfo *),
+ XConfigureImage(Display *,XResourceInfo *,XWindows *,Image *,ExceptionInfo *),
+ XDrawEditImage(Display *,XResourceInfo *,XWindows *,Image **,
+ ExceptionInfo *),
+ XMatteEditImage(Display *,XResourceInfo *,XWindows *,Image **,
+ ExceptionInfo *),
+ XPasteImage(Display *,XResourceInfo *,XWindows *,Image *,ExceptionInfo *),
+ XPrintImage(Display *,XResourceInfo *,XWindows *,Image *,ExceptionInfo *),
+ XRotateImage(Display *,XResourceInfo *,XWindows *,double,Image **,
+ ExceptionInfo *),
+ XROIImage(Display *,XResourceInfo *,XWindows *,Image **,ExceptionInfo *),
+ XSaveImage(Display *,XResourceInfo *,XWindows *,Image *,ExceptionInfo *),
+ XTrimImage(Display *,XResourceInfo *,XWindows *,Image *,ExceptionInfo *);
static void
XDrawPanRectangle(Display *,XWindows *),
- XImageCache(Display *,XResourceInfo *,XWindows *,const CommandType,Image **),
- XMagnifyImage(Display *,XWindows *,XEvent *),
- XMakePanImage(Display *,XResourceInfo *,XWindows *,Image *),
- XPanImage(Display *,XWindows *,XEvent *),
+ XImageCache(Display *,XResourceInfo *,XWindows *,const CommandType,Image **,
+ ExceptionInfo *),
+ XMagnifyImage(Display *,XWindows *,XEvent *,ExceptionInfo *),
+ XMakePanImage(Display *,XResourceInfo *,XWindows *,Image *,ExceptionInfo *),
+ XPanImage(Display *,XWindows *,XEvent *,ExceptionInfo *),
XMagnifyWindowCommand(Display *,XWindows *,const MagickStatusType,
- const KeySym),
+ const KeySym,ExceptionInfo *),
XSetCropGeometry(Display *,XWindows *,RectangleInfo *,Image *),
- XScreenEvent(Display *,XWindows *,XEvent *),
+ XScreenEvent(Display *,XWindows *,XEvent *,ExceptionInfo *),
XTranslateImage(Display *,XWindows *,Image *,const KeySym);
\f
/*
% The format of the DisplayImages method is:
%
% MagickBooleanType DisplayImages(const ImageInfo *image_info,
-% Image *images)
+% Image *images,ExceptionInfo *exception)
%
% A description of each parameter follows:
%
%
% o image: the image.
%
+% o exception: return any errors or warnings in this structure.
+%
*/
MagickExport MagickBooleanType DisplayImages(const ImageInfo *image_info,
- Image *images)
+ Image *images,ExceptionInfo *exception)
{
char
*argv[1];
display=XOpenDisplay(image_info->server_name);
if (display == (Display *) NULL)
{
- (void) ThrowMagickException(&images->exception,GetMagickModule(),
- XServerError,"UnableToOpenXServer","`%s'",XDisplayName(
- image_info->server_name));
+ (void) ThrowMagickException(exception,GetMagickModule(),XServerError,
+ "UnableToOpenXServer","`%s'",XDisplayName(image_info->server_name));
return(MagickFalse);
}
- if (images->exception.severity != UndefinedException)
- CatchException(&images->exception);
+ if (exception->severity != UndefinedException)
+ CatchException(exception);
(void) XSetErrorHandler(XError);
resource_database=XGetResourceDatabase(display,GetClientName());
(void) ResetMagickMemory(&resource_info,0,sizeof(resource_info));
if ((images->iterations != 0) && (i >= (ssize_t) images->iterations))
break;
image=GetImageFromList(images,i % GetImageListLength(images));
- (void) XDisplayImage(display,&resource_info,argv,1,&image,&state);
+ (void) XDisplayImage(display,&resource_info,argv,1,&image,&state,exception);
}
+ (void) SetErrorHandler((ErrorHandler) NULL);
+ (void) SetWarningHandler((WarningHandler) NULL);
argv[0]=DestroyString(argv[0]);
(void) XCloseDisplay(display);
XDestroyResourceInfo(&resource_info);
- if (images->exception.severity != UndefinedException)
+ if (exception->severity != UndefinedException)
return(MagickFalse);
return(MagickTrue);
}
% The format of the XAnnotateEditImage method is:
%
% MagickBooleanType XAnnotateEditImage(Display *display,
-% XResourceInfo *resource_info,XWindows *windows,Image *image)
+% XResourceInfo *resource_info,XWindows *windows,Image *image,
+% ExceptionInfo *exception)
%
% A description of each parameter follows:
%
}
static MagickBooleanType XAnnotateEditImage(Display *display,
- XResourceInfo *resource_info,XWindows *windows,Image *image)
+ XResourceInfo *resource_info,XWindows *windows,Image *image,
+ ExceptionInfo *exception)
{
static const char
*AnnotateMenu[] =
/*
Wait for next event.
*/
- XScreenEvent(display,windows,&event);
+ XScreenEvent(display,windows,&event,exception);
if (event.xany.window == windows->command.id)
{
/*
break;
if (entry != 8)
{
- degrees=InterpretLocaleValue(RotateMenu[entry],(char **) NULL);
+ degrees=StringToDouble(RotateMenu[entry],(char **) NULL);
break;
}
(void) XDialogWidget(display,windows,"OK","Enter rotation angle:",
angle);
if (*angle == '\0')
break;
- degrees=InterpretLocaleValue(angle,(char **) NULL);
+ degrees=StringToDouble(angle,(char **) NULL);
break;
}
case AnnotateHelpCommand:
/*
Wait for next event.
*/
- XScreenEvent(display,windows,&event);
+ XScreenEvent(display,windows,&event,exception);
if (event.xany.window == windows->command.id)
{
/*
/*
Annotate image with text.
*/
- status=XAnnotateImage(display,windows->pixel_info,annotate_info,image);
+ status=XAnnotateImage(display,windows->pixel_info,annotate_info,image,
+ exception);
if (status == 0)
return(MagickFalse);
/*
/*
Update image configuration.
*/
- XConfigureImageColormap(display,resource_info,windows,image);
- (void) XConfigureImage(display,resource_info,windows,image);
+ XConfigureImageColormap(display,resource_info,windows,image,exception);
+ (void) XConfigureImage(display,resource_info,windows,image,exception);
return(MagickTrue);
}
\f
% The format of the XBackgroundImage method is:
%
% MagickBooleanType XBackgroundImage(Display *display,
-% XResourceInfo *resource_info,XWindows *windows,Image **image)
+% XResourceInfo *resource_info,XWindows *windows,Image **image,
+% ExceptionInfo *exception)
%
% A description of each parameter follows:
%
%
% o image: the image.
%
+% o exception: return any errors or warnings in this structure.
+%
*/
static MagickBooleanType XBackgroundImage(Display *display,
- XResourceInfo *resource_info,XWindows *windows,Image **image)
+ XResourceInfo *resource_info,XWindows *windows,Image **image,
+ ExceptionInfo *exception)
{
#define BackgroundImageTag "Background/Image"
"Enter window id (id 0x00 selects window with pointer):",window_id);
if (*window_id == '\0')
return(MagickFalse);
- (void) XMagickCommand(display,resource_info,windows,ApplyCommand,image);
+ (void) XMagickCommand(display,resource_info,windows,ApplyCommand,image,
+ exception);
XInfoWidget(display,windows,BackgroundImageTag);
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
background_resources=(*resource_info);
background_resources.window_id=window_id;
background_resources.backdrop=status != 0 ? MagickTrue : MagickFalse;
- status=XDisplayBackgroundImage(display,&background_resources,*image);
+ status=XDisplayBackgroundImage(display,&background_resources,*image,
+ exception);
if (status != MagickFalse)
XClientMessage(display,windows->image.id,windows->im_protocols,
windows->im_retain_colors,CurrentTime);
XSetCursorState(display,windows,MagickFalse);
- (void) XMagickCommand(display,resource_info,windows,UndoCommand,image);
+ (void) XMagickCommand(display,resource_info,windows,UndoCommand,image,
+ exception);
return(MagickTrue);
}
\f
% The format of the XChopImage method is:
%
% MagickBooleanType XChopImage(Display *display,XResourceInfo *resource_info,
-% XWindows *windows,Image **image)
+% XWindows *windows,Image **image,ExceptionInfo *exception)
%
% A description of each parameter follows:
%
%
% o image: the image.
%
+% o exception: return any errors or warnings in this structure.
+%
*/
static MagickBooleanType XChopImage(Display *display,
- XResourceInfo *resource_info,XWindows *windows,Image **image)
+ XResourceInfo *resource_info,XWindows *windows,Image **image,
+ ExceptionInfo *exception)
{
static const char
*ChopMenu[] =
/*
Wait for next event.
*/
- XScreenEvent(display,windows,&event);
+ XScreenEvent(display,windows,&event,exception);
if (event.xany.window == windows->command.id)
{
/*
/*
Wait for next event.
*/
- XScreenEvent(display,windows,&event);
+ XScreenEvent(display,windows,&event,exception);
if (distance > 9)
XHighlightLine(display,windows->image.id,
windows->image.highlight_context,&segment_info);
/*
Image chopping is relative to image configuration.
*/
- (void) XMagickCommand(display,resource_info,windows,ApplyCommand,image);
+ (void) XMagickCommand(display,resource_info,windows,ApplyCommand,image,
+ exception);
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
windows->image.window_changes.width=windows->image.ximage->width-
/*
Chop image.
*/
- chop_image=ChopImage(*image,&chop_info,&(*image)->exception);
+ chop_image=ChopImage(*image,&chop_info,exception);
XSetCursorState(display,windows,MagickFalse);
if (chop_image == (Image *) NULL)
return(MagickFalse);
/*
Update image configuration.
*/
- XConfigureImageColormap(display,resource_info,windows,*image);
- (void) XConfigureImage(display,resource_info,windows,*image);
+ XConfigureImageColormap(display,resource_info,windows,*image,exception);
+ (void) XConfigureImage(display,resource_info,windows,*image,exception);
return(MagickTrue);
}
\f
% The format of the XColorEditImage method is:
%
% MagickBooleanType XColorEditImage(Display *display,
-% XResourceInfo *resource_info,XWindows *windows,Image **image)
+% XResourceInfo *resource_info,XWindows *windows,Image **image,
+% ExceptionInfo *exception)
%
% A description of each parameter follows:
%
%
% o image: the image; returned from ReadImage.
%
+% o exception: return any errors or warnings in this structure.
+%
*/
-
-
static MagickBooleanType XColorEditImage(Display *display,
- XResourceInfo *resource_info,XWindows *windows,Image **image)
+ XResourceInfo *resource_info,XWindows *windows,Image **image,
+ ExceptionInfo *exception)
{
static const char
*ColorEditMenu[] =
Cursor
cursor;
- ExceptionInfo
- *exception;
-
int
entry,
id,
/*
Wait for next event.
*/
- XScreenEvent(display,windows,&event);
+ XScreenEvent(display,windows,&event,exception);
if (event.xany.window == windows->command.id)
{
/*
break;
if (entry != 5)
{
- (*image)->fuzz=SiPrefixToDouble(FuzzMenu[entry],1.0*
+ (*image)->fuzz=StringToDoubleInterval(FuzzMenu[entry],(double)
QuantumRange+1.0);
break;
}
if (*fuzz == '\0')
break;
(void) ConcatenateMagickString(fuzz,"%",MaxTextExtent);
- (*image)->fuzz=SiPrefixToDouble(fuzz,1.0*QuantumRange+1.0);
+ (*image)->fuzz=StringToDoubleInterval(fuzz,(double) QuantumRange+
+ 1.0);
break;
}
case ColorEditUndoCommand:
{
(void) XMagickCommand(display,resource_info,windows,UndoCommand,
- image);
+ image,exception);
break;
}
case ColorEditHelpCommand:
x=event.xbutton.x;
y=event.xbutton.y;
(void) XMagickCommand(display,resource_info,windows,
- SaveToUndoBufferCommand,image);
+ SaveToUndoBufferCommand,image,exception);
state|=UpdateConfigurationState;
break;
}
*/
x=event.xbutton.x;
y=event.xbutton.y;
- XConfigureImageColormap(display,resource_info,windows,*image);
- (void) XConfigureImage(display,resource_info,windows,*image);
+ XConfigureImageColormap(display,resource_info,windows,*image,exception);
+ (void) XConfigureImage(display,resource_info,windows,*image,exception);
XInfoWidget(display,windows,text);
(void) XCheckDefineCursor(display,windows->image.id,cursor);
state&=(~UpdateConfigurationState);
if ((x_offset >= (int) (*image)->columns) ||
(y_offset >= (int) (*image)->rows))
continue;
- exception=(&(*image)->exception);
image_view=AcquireCacheView(*image);
switch (method)
{
SetPixelRed(*image,ScaleShortToQuantum(color.red),q);
SetPixelGreen(*image,ScaleShortToQuantum(color.green),q);
SetPixelBlue(*image,ScaleShortToQuantum(color.blue),q);
- (void) SyncCacheViewAuthenticPixels(image_view,
- &(*image)->exception);
+ (void) SyncCacheViewAuthenticPixels(image_view,exception);
break;
}
case ReplaceMethod:
{
- PixelPacket
+ PixelInfo
pixel,
target;
/*
Update color information using replace algorithm.
*/
- (void) GetOneCacheViewVirtualPixel(image_view,(ssize_t) x_offset,
- (ssize_t) y_offset,&target,&(*image)->exception);
+ (void) GetOneCacheViewVirtualPixelInfo(image_view,(ssize_t)
+ x_offset,(ssize_t) y_offset,&target,exception);
if ((*image)->storage_class == DirectClass)
{
for (y=0; y < (int) (*image)->rows; y++)
break;
for (x=0; x < (int) (*image)->columns; x++)
{
- GetPixelPacket(*image,q,&pixel);
- if (IsFuzzyEquivalencePixelPacket(*image,&pixel,&target))
+ GetPixelInfoPixel(*image,q,&pixel);
+ if (IsFuzzyEquivalencePixelInfo(&pixel,&target))
{
SetPixelRed(*image,ScaleShortToQuantum(
color.red),q);
else
{
for (i=0; i < (ssize_t) (*image)->colors; i++)
- if (IsFuzzyEquivalencePixelPacket(*image,(*image)->colormap+i,&target))
+ if (IsFuzzyEquivalencePixelInfo((*image)->colormap+i,&target))
{
- (*image)->colormap[i].red=ScaleShortToQuantum(
+ (*image)->colormap[i].red=(double) ScaleShortToQuantum(
color.red);
- (*image)->colormap[i].green=ScaleShortToQuantum(
+ (*image)->colormap[i].green=(double) ScaleShortToQuantum(
color.green);
- (*image)->colormap[i].blue=ScaleShortToQuantum(
+ (*image)->colormap[i].blue=(double) ScaleShortToQuantum(
color.blue);
}
- (void) SyncImage(*image);
+ (void) SyncImage(*image,exception);
}
break;
}
/*
Update color information using floodfill algorithm.
*/
- (void) GetOneVirtualMagickPixel(*image,(ssize_t) x_offset,
- (ssize_t) y_offset,&target,exception);
+ (void) GetOneVirtualPixelInfo(*image,
+ GetPixelCacheVirtualMethod(*image),(ssize_t) x_offset,(ssize_t)
+ y_offset,&target,exception);
if (method == FillToBorderMethod)
{
target.red=(MagickRealType)
}
draw_info=CloneDrawInfo(resource_info->image_info,
(DrawInfo *) NULL);
- (void) QueryColorDatabase(resource_info->pen_colors[pen_id],
- &draw_info->fill,exception);
+ (void) QueryColorCompliance(resource_info->pen_colors[pen_id],
+ AllCompliance,&draw_info->fill,exception);
(void) FloodfillPaintImage(*image,draw_info,&target,(ssize_t)
x_offset,(ssize_t) y_offset,method == FloodfillMethod ?
MagickFalse : MagickTrue,exception);
% The format of the XCompositeImage method is:
%
% MagickBooleanType XCompositeImage(Display *display,
-% XResourceInfo *resource_info,XWindows *windows,Image *image)
+% XResourceInfo *resource_info,XWindows *windows,Image *image,
+% ExceptionInfo *exception)
%
% A description of each parameter follows:
%
%
% o image: the image; returned from ReadImage.
%
+% o exception: return any errors or warnings in this structure.
+%
*/
static MagickBooleanType XCompositeImage(Display *display,
- XResourceInfo *resource_info,XWindows *windows,Image *image)
+ XResourceInfo *resource_info,XWindows *windows,Image *image,
+ ExceptionInfo *exception)
{
static char
displacement_geometry[MaxTextExtent] = "30x30",
XCheckRefreshWindows(display,windows);
(void) CopyMagickString(resource_info->image_info->filename,filename,
MaxTextExtent);
- composite_image=ReadImage(resource_info->image_info,&image->exception);
- CatchException(&image->exception);
+ composite_image=ReadImage(resource_info->image_info,exception);
+ CatchException(exception);
XSetCursorState(display,windows,MagickFalse);
if (composite_image == (Image *) NULL)
return(MagickFalse);
/*
Wait for next event.
*/
- XScreenEvent(display,windows,&event);
+ XScreenEvent(display,windows,&event,exception);
XHighlightRectangle(display,windows->image.id,
windows->image.highlight_context,&highlight_info);
if (event.xany.window == windows->command.id)
GXinvert);
if (*factor == '\0')
break;
- blend=InterpretLocaleValue(factor,(char **) NULL);
+ blend=StringToDouble(factor,(char **) NULL);
compose=DissolveCompositeOp;
break;
}
Scale composite image.
*/
resize_image=ResizeImage(composite_image,composite_info.width,
- composite_info.height,composite_image->filter,composite_image->blur,
- &image->exception);
+ composite_info.height,composite_image->filter,exception);
composite_image=DestroyImage(composite_image);
if (resize_image == (Image *) NULL)
{
CacheView
*image_view;
- ExceptionInfo
- *exception;
-
int
y;
/*
Create mattes for blending.
*/
- exception=(&image->exception);
(void) SetImageAlphaChannel(composite_image,OpaqueAlphaChannel,exception);
opacity=(Quantum) (ScaleQuantumToChar((Quantum) QuantumRange)-
((ssize_t) ScaleQuantumToChar((Quantum) QuantumRange)*blend)/100);
/*
Composite image with X Image window.
*/
- (void) CompositeImage(image,compose,composite_image,composite_info.x,
- composite_info.y);
+ (void) CompositeImage(image,composite_image,compose,MagickTrue,
+ composite_info.x,composite_info.y,exception);
composite_image=DestroyImage(composite_image);
XSetCursorState(display,windows,MagickFalse);
/*
Update image configuration.
*/
- XConfigureImageColormap(display,resource_info,windows,image);
- (void) XConfigureImage(display,resource_info,windows,image);
+ XConfigureImageColormap(display,resource_info,windows,image,exception);
+ (void) XConfigureImage(display,resource_info,windows,image,exception);
return(MagickTrue);
}
\f
% The format of the XConfigureImage method is:
%
% MagickBooleanType XConfigureImage(Display *display,
-% XResourceInfo *resource_info,XWindows *windows,Image *image)
+% XResourceInfo *resource_info,XWindows *windows,Image *image,
+% ExceptionInfo *exception)
%
% A description of each parameter follows:
%
%
% o image: the image.
%
+% o exception: return any errors or warnings in this structure.
+%
+% o exception: return any errors or warnings in this structure.
%
*/
static MagickBooleanType XConfigureImage(Display *display,
- XResourceInfo *resource_info,XWindows *windows,Image *image)
+ XResourceInfo *resource_info,XWindows *windows,Image *image,
+ ExceptionInfo *exception)
{
char
geometry[MaxTextExtent];
windows->image.y=(int)
(height*windows->image.y/windows->image.ximage->height);
status=XMakeImage(display,resource_info,&windows->image,image,
- (unsigned int) width,(unsigned int) height);
+ (unsigned int) width,(unsigned int) height,exception);
if (status == MagickFalse)
XNoticeWidget(display,windows,"Unable to configure X image:",
windows->image.name);
Update Magnify window configuration.
*/
if (windows->magnify.mapped != MagickFalse)
- XMakeMagnifyImage(display,windows);
+ XMakeMagnifyImage(display,windows,exception);
windows->pan.crop_geometry=windows->image.crop_geometry;
XBestIconSize(display,&windows->pan,image);
while (((windows->pan.width << 1) < MaxIconSize) &&
%
% MagickBooleanType XCropImage(Display *display,
% XResourceInfo *resource_info,XWindows *windows,Image *image,
-% const ClipboardMode mode)
+% const ClipboardMode mode,ExceptionInfo *exception)
%
% A description of each parameter follows:
%
% o mode: This unsigned value specified whether the image should be
% cropped, copied, or cut.
%
+% o exception: return any errors or warnings in this structure.
+%
*/
static MagickBooleanType XCropImage(Display *display,
XResourceInfo *resource_info,XWindows *windows,Image *image,
- const ClipboardMode mode)
+ const ClipboardMode mode,ExceptionInfo *exception)
{
static const char
*CropModeMenu[] =
Cursor
cursor;
- ExceptionInfo
- *exception;
-
int
id,
x,
/*
Wait for next event.
*/
- XScreenEvent(display,windows,&event);
+ XScreenEvent(display,windows,&event,exception);
if (event.xany.window == windows->command.id)
{
/*
/*
Wait for next event.
*/
- XScreenEvent(display,windows,&event);
+ XScreenEvent(display,windows,&event,exception);
if ((highlight_info.width > 3) && (highlight_info.height > 3))
XHighlightRectangle(display,windows->image.id,
windows->image.highlight_context,&highlight_info);
}
XHighlightRectangle(display,windows->image.id,
windows->image.highlight_context,&highlight_info);
- XScreenEvent(display,windows,&event);
+ XScreenEvent(display,windows,&event,exception);
if (event.xany.window == windows->command.id)
{
/*
XSetCropGeometry(display,windows,&crop_info,image);
windows->image.window_changes.width=(int) crop_info.width;
windows->image.window_changes.height=(int) crop_info.height;
- (void) XConfigureImage(display,resource_info,windows,image);
+ (void) XConfigureImage(display,resource_info,windows,image,exception);
return(MagickTrue);
}
/*
crop_info.y+=y;
crop_info.y=(ssize_t) (scale_factor*crop_info.y+0.5);
crop_info.height=(unsigned int) (scale_factor*crop_info.height+0.5);
- crop_image=CropImage(image,&crop_info,&image->exception);
+ crop_image=CropImage(image,&crop_info,exception);
XSetCursorState(display,windows,MagickFalse);
if (crop_image == (Image *) NULL)
return(MagickFalse);
resource_info->copy_image=crop_image;
if (mode == CopyMode)
{
- (void) XConfigureImage(display,resource_info,windows,image);
+ (void) XConfigureImage(display,resource_info,windows,image,exception);
return(MagickTrue);
}
/*
Cut image.
*/
- exception=(&image->exception);
if (SetImageStorageClass(image,DirectClass,exception) == MagickFalse)
return(MagickFalse);
image->matte=MagickTrue;
/*
Update image configuration.
*/
- XConfigureImageColormap(display,resource_info,windows,image);
- (void) XConfigureImage(display,resource_info,windows,image);
+ XConfigureImageColormap(display,resource_info,windows,image,exception);
+ (void) XConfigureImage(display,resource_info,windows,image,exception);
return(MagickTrue);
}
\f
% The format of the XDrawEditImage method is:
%
% MagickBooleanType XDrawEditImage(Display *display,
-% XResourceInfo *resource_info,XWindows *windows,Image **image)
+% XResourceInfo *resource_info,XWindows *windows,Image **image,
+% ExceptionInfo *exception)
%
% A description of each parameter follows:
%
%
% o image: the image.
%
+% o exception: return any errors or warnings in this structure.
+%
*/
static MagickBooleanType XDrawEditImage(Display *display,
- XResourceInfo *resource_info,XWindows *windows,Image **image)
+ XResourceInfo *resource_info,XWindows *windows,Image **image,
+ ExceptionInfo *exception)
{
static const char
*DrawMenu[] =
sizeof(*coordinate_info));
if (coordinate_info == (XPoint *) NULL)
{
- (void) ThrowMagickException(&(*image)->exception,GetMagickModule(),
+ (void) ThrowMagickException(exception,GetMagickModule(),
ResourceLimitError,"MemoryAllocationFailed","`%s'","...");
return(MagickFalse);
}
/*
Wait for next event.
*/
- XScreenEvent(display,windows,&event);
+ XScreenEvent(display,windows,&event,exception);
if (event.xany.window == windows->command.id)
{
/*
image_info=AcquireImageInfo();
(void) CopyMagickString(image_info->filename,filename,
MaxTextExtent);
- stipple_image=ReadImage(image_info,&(*image)->exception);
- CatchException(&(*image)->exception);
+ stipple_image=ReadImage(image_info,exception);
+ CatchException(exception);
XSetCursorState(display,windows,MagickFalse);
if (stipple_image == (Image *) NULL)
break;
(void) AcquireUniqueFileResource(filename);
(void) FormatLocaleString(stipple_image->filename,MaxTextExtent,
"xbm:%s",filename);
- (void) WriteImage(image_info,stipple_image);
+ (void) WriteImage(image_info,stipple_image,exception);
stipple_image=DestroyImage(stipple_image);
image_info=DestroyImageInfo(image_info);
status=XReadBitmapFile(display,root_window,filename,&width,
case DrawUndoCommand:
{
(void) XMagickCommand(display,resource_info,windows,UndoCommand,
- image);
+ image,exception);
break;
}
case DrawHelpCommand:
/*
Wait for next event.
*/
- XScreenEvent(display,windows,&event);
+ XScreenEvent(display,windows,&event,exception);
switch (element)
{
case PointElement:
coordinate_info=(XPoint *) ResizeQuantumMemory(coordinate_info,
max_coordinates,sizeof(*coordinate_info));
if (coordinate_info == (XPoint *) NULL)
- (void) ThrowMagickException(&(*image)->exception,GetMagickModule(),
+ (void) ThrowMagickException(exception,GetMagickModule(),
ResourceLimitError,"MemoryAllocationFailed","`%s'","...");
break;
}
coordinate_info=(XPoint *) ResizeQuantumMemory(coordinate_info,
max_coordinates,sizeof(*coordinate_info));
if (coordinate_info == (XPoint *) NULL)
- (void) ThrowMagickException(&(*image)->exception,GetMagickModule(),
+ (void) ThrowMagickException(exception,GetMagickModule(),
ResourceLimitError,"MemoryAllocationFailed","`%s'","...");
break;
}
draw_info.x=(int) rectangle_info.x;
draw_info.y=(int) rectangle_info.y;
(void) XMagickCommand(display,resource_info,windows,SaveToUndoBufferCommand,
- image);
+ image,exception);
width=(unsigned int) (*image)->columns;
height=(unsigned int) (*image)->rows;
x=0;
*/
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
- status=XDrawImage(display,windows->pixel_info,&draw_info,*image);
+ status=XDrawImage(display,windows->pixel_info,&draw_info,*image,exception);
XSetCursorState(display,windows,MagickFalse);
/*
Update image colormap and return to image drawing.
*/
- XConfigureImageColormap(display,resource_info,windows,*image);
- (void) XConfigureImage(display,resource_info,windows,*image);
+ XConfigureImageColormap(display,resource_info,windows,*image,exception);
+ (void) XConfigureImage(display,resource_info,windows,*image,exception);
}
XSetCursorState(display,windows,MagickFalse);
coordinate_info=(XPoint *) RelinquishMagickMemory(coordinate_info);
% The format of the XImageCache method is:
%
% void XImageCache(Display *display,XResourceInfo *resource_info,
-% XWindows *windows,const CommandType command,Image **image)
+% XWindows *windows,const CommandType command,Image **image,
+% ExceptionInfo *exception)
%
% A description of each parameter follows:
%
% o image: the image; XImageCache may transform the image and return a new
% image pointer.
%
+% o exception: return any errors or warnings in this structure.
+%
*/
static void XImageCache(Display *display,XResourceInfo *resource_info,
- XWindows *windows,const CommandType command,Image **image)
+ XWindows *windows,const CommandType command,Image **image,
+ ExceptionInfo *exception)
{
Image
*cache_image;
windows->image.window_changes.height=(int) cache_image->rows;
(void) FormatLocaleString(image_geometry,MaxTextExtent,"%dx%d!",
windows->image.ximage->width,windows->image.ximage->height);
- (void) TransformImage(image,windows->image.crop_geometry,image_geometry);
+ (void) TransformImage(image,windows->image.crop_geometry,image_geometry,
+ exception);
if (windows->image.crop_geometry != (char *) NULL)
- windows->image.crop_geometry=(char *)
- RelinquishMagickMemory(windows->image.crop_geometry);
+ windows->image.crop_geometry=(char *) RelinquishMagickMemory(
+ windows->image.crop_geometry);
windows->image.crop_geometry=cache_image->geometry;
if (redo_image != (Image *) NULL)
redo_image=DestroyImage(redo_image);
cache_image=DestroyImage(cache_image);
if (windows->image.orphan != MagickFalse)
return;
- XConfigureImageColormap(display,resource_info,windows,*image);
- (void) XConfigureImage(display,resource_info,windows,*image);
+ XConfigureImageColormap(display,resource_info,windows,*image,exception);
+ (void) XConfigureImage(display,resource_info,windows,*image,exception);
return;
}
case CutCommand:
ssize_t
bytes;
- bytes=(ssize_t) ((*image)->columns*(*image)->rows*sizeof(PixelPacket));
+ bytes=(ssize_t) ((*image)->columns*(*image)->rows*sizeof(PixelInfo));
if (undo_image != (Image *) NULL)
{
/*
while (previous_image != (Image *) NULL)
{
bytes+=previous_image->list->columns*previous_image->list->rows*
- sizeof(PixelPacket);
+ sizeof(PixelInfo);
if (bytes <= (ssize_t) (resource_info->undo_cache << 20))
{
previous_image=GetPreviousImageInList(previous_image);
continue;
}
bytes-=previous_image->list->columns*previous_image->list->rows*
- sizeof(PixelPacket);
+ sizeof(PixelInfo);
if (previous_image == undo_image)
undo_image=NewImageList();
else
/*
Save image before transformations are applied.
*/
- cache_image=AcquireImage((ImageInfo *) NULL);
+ cache_image=AcquireImage((ImageInfo *) NULL,exception);
if (cache_image == (Image *) NULL)
break;
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
- cache_image->list=CloneImage(*image,0,0,MagickTrue,&(*image)->exception);
+ cache_image->list=CloneImage(*image,0,0,MagickTrue,exception);
XSetCursorState(display,windows,MagickFalse);
if (cache_image->list == (Image *) NULL)
{
redo_image=NewImageList();
if (windows->image.orphan != MagickFalse)
return;
- XConfigureImageColormap(display,resource_info,windows,*image);
- (void) XConfigureImage(display,resource_info,windows,*image);
+ XConfigureImageColormap(display,resource_info,windows,*image,exception);
+ (void) XConfigureImage(display,resource_info,windows,*image,exception);
return;
}
if (command != InfoCommand)
*/
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
- XDisplayImageInfo(display,resource_info,windows,undo_image,*image);
+ XDisplayImageInfo(display,resource_info,windows,undo_image,*image,exception);
XSetCursorState(display,windows,MagickFalse);
}
\f
% XImageWindowCommand() makes a transform to the image or Image window as
% specified by a user menu button or keyboard command.
%
-% The format of the XMagickCommand method is:
+% The format of the XImageWindowCommand method is:
%
% CommandType XImageWindowCommand(Display *display,
% XResourceInfo *resource_info,XWindows *windows,
-% const MagickStatusType state,KeySym key_symbol,Image **image)
+% const MagickStatusType state,KeySym key_symbol,Image **image,
+% ExceptionInfo *exception)
%
% A description of each parameter follows:
%
%
% o key_symbol: Specifies a command to perform.
%
-% o image: the image; XImageWIndowCommand
-% may transform the image and return a new image pointer.
+% o image: the image; XImageWIndowCommand may transform the image and
+% return a new image pointer.
+%
+% o exception: return any errors or warnings in this structure.
%
*/
static CommandType XImageWindowCommand(Display *display,
XResourceInfo *resource_info,XWindows *windows,const MagickStatusType state,
- KeySym key_symbol,Image **image)
+ KeySym key_symbol,Image **image,ExceptionInfo *exception)
{
static char
delta[MaxTextExtent] = "";
windows->image.window_changes.width=(int) crop_info.width;
windows->image.window_changes.height=(int) crop_info.height;
(void) XSetWindowBackgroundPixmap(display,windows->image.id,None);
- (void) XConfigureImage(display,resource_info,windows,*image);
+ (void) XConfigureImage(display,resource_info,windows,*image,
+ exception);
return(NullCommand);
}
XTranslateImage(display,windows,*image,key_symbol);
% The format of the XMagickCommand method is:
%
% Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
-% XWindows *windows,const CommandType command,Image **image)
+% XWindows *windows,const CommandType command,Image **image,
+% ExceptionInfo *exception)
%
% A description of each parameter follows:
%
-% o nexus: Method XMagickCommand returns an image when the
-% user chooses 'Load Image' from the command menu. Otherwise a null
-% image is returned.
-%
% o display: Specifies a connection to an X server; returned from
% XOpenDisplay.
%
%
% o command: Specifies a command to perform.
%
-% o image: the image; XMagickCommand
-% may transform the image and return a new image pointer.
+% o image: the image; XMagickCommand may transform the image and return a
+% new image pointer.
+%
+% o exception: return any errors or warnings in this structure.
%
*/
static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
- XWindows *windows,const CommandType command,Image **image)
+ XWindows *windows,const CommandType command,Image **image,
+ ExceptionInfo *exception)
{
char
filename[MaxTextExtent],
Process user command.
*/
XCheckRefreshWindows(display,windows);
- XImageCache(display,resource_info,windows,command,image);
+ XImageCache(display,resource_info,windows,command,image,exception);
nexus=NewImageList();
windows->image.window_changes.width=windows->image.ximage->width;
windows->image.window_changes.height=windows->image.ximage->height;
*/
status=chdir(resource_info->home_directory);
if (status == -1)
- (void) ThrowMagickException(&(*image)->exception,GetMagickModule(),
- FileOpenError,"UnableToOpenFile","%s",resource_info->home_directory);
+ (void) ThrowMagickException(exception,GetMagickModule(),FileOpenError,
+ "UnableToOpenFile","%s",resource_info->home_directory);
nexus=XOpenImage(display,resource_info,windows,MagickTrue);
break;
}
/*
Save image.
*/
- status=XSaveImage(display,resource_info,windows,*image);
+ status=XSaveImage(display,resource_info,windows,*image,exception);
if (status == MagickFalse)
{
- XNoticeWidget(display,windows,"Unable to write X image:",
- (*image)->filename);
+ char
+ message[MaxTextExtent];
+
+ (void) FormatLocaleString(message,MaxTextExtent,"%s:%s",
+ exception->reason != (char *) NULL ? exception->reason : "",
+ exception->description != (char *) NULL ? exception->description :
+ "");
+ XNoticeWidget(display,windows,"Unable to save file:",message);
break;
}
break;
/*
Print image.
*/
- status=XPrintImage(display,resource_info,windows,*image);
+ status=XPrintImage(display,resource_info,windows,*image,exception);
if (status == MagickFalse)
{
- XNoticeWidget(display,windows,"Unable to print X image:",
- (*image)->filename);
+ char
+ message[MaxTextExtent];
+
+ (void) FormatLocaleString(message,MaxTextExtent,"%s:%s",
+ exception->reason != (char *) NULL ? exception->reason : "",
+ exception->description != (char *) NULL ? exception->description :
+ "");
+ XNoticeWidget(display,windows,"Unable to print file:",message);
break;
}
break;
XFileBrowserWidget(display,windows,"Delete",filename);
if (*filename == '\0')
break;
- status=remove(filename) != 0 ? MagickTrue : MagickFalse;
+ status=remove_utf8(filename) != 0 ? MagickTrue : MagickFalse;
if (status != MagickFalse)
XNoticeWidget(display,windows,"Unable to delete image file:",filename);
break;
(void) FormatLocaleString(image_info->filename,MaxTextExtent,
"%s:%s",format,color);
(void) CloneString(&image_info->size,geometry);
- nexus=ReadImage(image_info,&(*image)->exception);
- CatchException(&(*image)->exception);
+ nexus=ReadImage(image_info,exception);
+ CatchException(exception);
XClientMessage(display,windows->image.id,windows->im_protocols,
windows->im_next_image,CurrentTime);
break;
/*
Visual Image directory.
*/
- nexus=XVisualDirectoryImage(display,resource_info,windows);
+ nexus=XVisualDirectoryImage(display,resource_info,windows,exception);
break;
}
case QuitCommand:
/*
Cut image.
*/
- (void) XCropImage(display,resource_info,windows,*image,CutMode);
+ (void) XCropImage(display,resource_info,windows,*image,CutMode,exception);
break;
}
case CopyCommand:
/*
Copy image.
*/
- (void) XCropImage(display,resource_info,windows,*image,CopyMode);
+ (void) XCropImage(display,resource_info,windows,*image,CopyMode,
+ exception);
break;
}
case PasteCommand:
/*
Paste image.
*/
- status=XPasteImage(display,resource_info,windows,*image);
+ status=XPasteImage(display,resource_info,windows,*image,exception);
if (status == MagickFalse)
{
XNoticeWidget(display,windows,"Unable to paste X image",
*/
windows->image.window_changes.width=windows->image.ximage->width/2;
windows->image.window_changes.height=windows->image.ximage->height/2;
- (void) XConfigureImage(display,resource_info,windows,*image);
+ (void) XConfigureImage(display,resource_info,windows,*image,exception);
break;
}
case OriginalSizeCommand:
*/
windows->image.window_changes.width=(int) (*image)->columns;
windows->image.window_changes.height=(int) (*image)->rows;
- (void) XConfigureImage(display,resource_info,windows,*image);
+ (void) XConfigureImage(display,resource_info,windows,*image,exception);
break;
}
case DoubleSizeCommand:
*/
windows->image.window_changes.width=windows->image.ximage->width << 1;
windows->image.window_changes.height=windows->image.ximage->height << 1;
- (void) XConfigureImage(display,resource_info,windows,*image);
+ (void) XConfigureImage(display,resource_info,windows,*image,exception);
break;
}
case ResizeCommand:
(void) ParseMetaGeometry(geometry,&x,&y,&width,&height);
windows->image.window_changes.width=(int) width;
windows->image.window_changes.height=(int) height;
- (void) XConfigureImage(display,resource_info,windows,*image);
+ (void) XConfigureImage(display,resource_info,windows,*image,exception);
break;
}
case ApplyCommand:
*/
(void) FormatLocaleString(image_geometry,MaxTextExtent,"%dx%d!",
windows->image.ximage->width,windows->image.ximage->height);
- (void) TransformImage(image,windows->image.crop_geometry,image_geometry);
+ (void) TransformImage(image,windows->image.crop_geometry,image_geometry,
+ exception);
if (windows->image.crop_geometry != (char *) NULL)
- windows->image.crop_geometry=(char *)
- RelinquishMagickMemory(windows->image.crop_geometry);
+ windows->image.crop_geometry=(char *) RelinquishMagickMemory(
+ windows->image.crop_geometry);
windows->image.x=0;
windows->image.y=0;
- XConfigureImageColormap(display,resource_info,windows,*image);
- (void) XConfigureImage(display,resource_info,windows,*image);
+ XConfigureImageColormap(display,resource_info,windows,*image,exception);
+ (void) XConfigureImage(display,resource_info,windows,*image,exception);
break;
}
case RefreshCommand:
{
- (void) XConfigureImage(display,resource_info,windows,*image);
+ (void) XConfigureImage(display,resource_info,windows,*image,exception);
break;
}
case RestoreCommand:
windows->image.x=0;
windows->image.y=0;
}
- XConfigureImageColormap(display,resource_info,windows,*image);
- (void) XConfigureImage(display,resource_info,windows,*image);
+ XConfigureImageColormap(display,resource_info,windows,*image,exception);
+ (void) XConfigureImage(display,resource_info,windows,*image,exception);
break;
}
case CropCommand:
/*
Crop image.
*/
- (void) XCropImage(display,resource_info,windows,*image,CropMode);
+ (void) XCropImage(display,resource_info,windows,*image,CropMode,
+ exception);
break;
}
case ChopCommand:
/*
Chop image.
*/
- status=XChopImage(display,resource_info,windows,image);
+ status=XChopImage(display,resource_info,windows,image,exception);
if (status == MagickFalse)
{
XNoticeWidget(display,windows,"Unable to cut X image",
*/
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
- flop_image=FlopImage(*image,&(*image)->exception);
+ flop_image=FlopImage(*image,exception);
if (flop_image != (Image *) NULL)
{
*image=DestroyImage(*image);
*image=flop_image;
}
- CatchException(&(*image)->exception);
+ CatchException(exception);
XSetCursorState(display,windows,MagickFalse);
if (windows->image.crop_geometry != (char *) NULL)
{
}
if (windows->image.orphan != MagickFalse)
break;
- (void) XConfigureImage(display,resource_info,windows,*image);
+ (void) XConfigureImage(display,resource_info,windows,*image,exception);
break;
}
case FlipCommand:
*/
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
- flip_image=FlipImage(*image,&(*image)->exception);
+ flip_image=FlipImage(*image,exception);
if (flip_image != (Image *) NULL)
{
*image=DestroyImage(*image);
*image=flip_image;
}
- CatchException(&(*image)->exception);
+ CatchException(exception);
XSetCursorState(display,windows,MagickFalse);
if (windows->image.crop_geometry != (char *) NULL)
{
}
if (windows->image.orphan != MagickFalse)
break;
- (void) XConfigureImage(display,resource_info,windows,*image);
+ (void) XConfigureImage(display,resource_info,windows,*image,exception);
break;
}
case RotateRightCommand:
/*
Rotate image 90 degrees clockwise.
*/
- status=XRotateImage(display,resource_info,windows,90.0,image);
+ status=XRotateImage(display,resource_info,windows,90.0,image,exception);
if (status == MagickFalse)
{
XNoticeWidget(display,windows,"Unable to rotate X image",
/*
Rotate image 90 degrees counter-clockwise.
*/
- status=XRotateImage(display,resource_info,windows,-90.0,image);
+ status=XRotateImage(display,resource_info,windows,-90.0,image,exception);
if (status == MagickFalse)
{
XNoticeWidget(display,windows,"Unable to rotate X image",
/*
Rotate image.
*/
- status=XRotateImage(display,resource_info,windows,0.0,image);
+ status=XRotateImage(display,resource_info,windows,0.0,image,exception);
if (status == MagickFalse)
{
XNoticeWidget(display,windows,"Unable to rotate X image",
/*
Shear image.
*/
- (void) XMagickCommand(display,resource_info,windows,ApplyCommand,image);
+ (void) XMagickCommand(display,resource_info,windows,ApplyCommand,image,
+ exception);
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
- (void) QueryColorDatabase(color,&(*image)->background_color,
- &(*image)->exception);
+ (void) QueryColorCompliance(color,AllCompliance,
+ &(*image)->background_color,exception);
flags=ParseGeometry(geometry,&geometry_info);
if ((flags & SigmaValue) == 0)
geometry_info.sigma=geometry_info.rho;
shear_image=ShearImage(*image,geometry_info.rho,geometry_info.sigma,
- &(*image)->exception);
+ exception);
if (shear_image != (Image *) NULL)
{
*image=DestroyImage(*image);
*image=shear_image;
}
- CatchException(&(*image)->exception);
+ CatchException(exception);
XSetCursorState(display,windows,MagickFalse);
if (windows->image.orphan != MagickFalse)
break;
windows->image.window_changes.width=(int) (*image)->columns;
windows->image.window_changes.height=(int) (*image)->rows;
- XConfigureImageColormap(display,resource_info,windows,*image);
- (void) XConfigureImage(display,resource_info,windows,*image);
+ XConfigureImageColormap(display,resource_info,windows,*image,exception);
+ (void) XConfigureImage(display,resource_info,windows,*image,exception);
break;
}
case RollCommand:
/*
Roll image.
*/
- (void) XMagickCommand(display,resource_info,windows,ApplyCommand,image);
+ (void) XMagickCommand(display,resource_info,windows,ApplyCommand,image,
+ exception);
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
(void) ParsePageGeometry(*image,geometry,&page_geometry,
- &(*image)->exception);
+ exception);
roll_image=RollImage(*image,page_geometry.x,page_geometry.y,
- &(*image)->exception);
+ exception);
if (roll_image != (Image *) NULL)
{
*image=DestroyImage(*image);
*image=roll_image;
}
- CatchException(&(*image)->exception);
+ CatchException(exception);
XSetCursorState(display,windows,MagickFalse);
if (windows->image.orphan != MagickFalse)
break;
windows->image.window_changes.width=(int) (*image)->columns;
windows->image.window_changes.height=(int) (*image)->rows;
- XConfigureImageColormap(display,resource_info,windows,*image);
- (void) XConfigureImage(display,resource_info,windows,*image);
+ XConfigureImageColormap(display,resource_info,windows,*image,exception);
+ (void) XConfigureImage(display,resource_info,windows,*image,exception);
break;
}
case TrimCommand:
(void) XDialogWidget(display,windows,"Trim","Enter fuzz factor:",fuzz);
if (*fuzz == '\0')
break;
- (*image)->fuzz=SiPrefixToDouble(fuzz,(double) QuantumRange+1.0);
+ (*image)->fuzz=StringToDoubleInterval(fuzz,(double) QuantumRange+1.0);
/*
Trim image.
*/
- status=XTrimImage(display,resource_info,windows,*image);
+ status=XTrimImage(display,resource_info,windows,*image,exception);
if (status == MagickFalse)
{
XNoticeWidget(display,windows,"Unable to trim X image",
(void) CopyMagickString(modulate_factors,"100.0/100.0/",MaxTextExtent);
(void) ConcatenateMagickString(modulate_factors,hue_percent,
MaxTextExtent);
- (void) ModulateImage(*image,modulate_factors,&(*image)->exception);
+ (void) ModulateImage(*image,modulate_factors,exception);
XSetCursorState(display,windows,MagickFalse);
if (windows->image.orphan != MagickFalse)
break;
- XConfigureImageColormap(display,resource_info,windows,*image);
- (void) XConfigureImage(display,resource_info,windows,*image);
+ XConfigureImageColormap(display,resource_info,windows,*image,exception);
+ (void) XConfigureImage(display,resource_info,windows,*image,exception);
break;
}
case SaturationCommand:
(void) CopyMagickString(modulate_factors,"100.0/",MaxTextExtent);
(void) ConcatenateMagickString(modulate_factors,saturation_percent,
MaxTextExtent);
- (void) ModulateImage(*image,modulate_factors,&(*image)->exception);
+ (void) ModulateImage(*image,modulate_factors,exception);
XSetCursorState(display,windows,MagickFalse);
if (windows->image.orphan != MagickFalse)
break;
- XConfigureImageColormap(display,resource_info,windows,*image);
- (void) XConfigureImage(display,resource_info,windows,*image);
+ XConfigureImageColormap(display,resource_info,windows,*image,exception);
+ (void) XConfigureImage(display,resource_info,windows,*image,exception);
break;
}
case BrightnessCommand:
XCheckRefreshWindows(display,windows);
(void) CopyMagickString(modulate_factors,brightness_percent,
MaxTextExtent);
- (void) ModulateImage(*image,modulate_factors,&(*image)->exception);
+ (void) ModulateImage(*image,modulate_factors,exception);
XSetCursorState(display,windows,MagickFalse);
if (windows->image.orphan != MagickFalse)
break;
- XConfigureImageColormap(display,resource_info,windows,*image);
- (void) XConfigureImage(display,resource_info,windows,*image);
+ XConfigureImageColormap(display,resource_info,windows,*image,exception);
+ (void) XConfigureImage(display,resource_info,windows,*image,exception);
break;
}
case GammaCommand:
*/
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
- (void) GammaImage(*image,atof(factor),&(*image)->exception);
+ (void) GammaImage(*image,atof(factor),exception);
XSetCursorState(display,windows,MagickFalse);
if (windows->image.orphan != MagickFalse)
break;
- XConfigureImageColormap(display,resource_info,windows,*image);
- (void) XConfigureImage(display,resource_info,windows,*image);
+ XConfigureImageColormap(display,resource_info,windows,*image,exception);
+ (void) XConfigureImage(display,resource_info,windows,*image,exception);
break;
}
case SpiffCommand:
*/
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
- (void) ContrastImage(*image,MagickTrue,&(*image)->exception);
+ (void) ContrastImage(*image,MagickTrue,exception);
XSetCursorState(display,windows,MagickFalse);
if (windows->image.orphan != MagickFalse)
break;
- XConfigureImageColormap(display,resource_info,windows,*image);
- (void) XConfigureImage(display,resource_info,windows,*image);
+ XConfigureImageColormap(display,resource_info,windows,*image,exception);
+ (void) XConfigureImage(display,resource_info,windows,*image,exception);
break;
}
case DullCommand:
*/
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
- (void) ContrastImage(*image,MagickFalse,&(*image)->exception);
+ (void) ContrastImage(*image,MagickFalse,exception);
XSetCursorState(display,windows,MagickFalse);
if (windows->image.orphan != MagickFalse)
break;
- XConfigureImageColormap(display,resource_info,windows,*image);
- (void) XConfigureImage(display,resource_info,windows,*image);
+ XConfigureImageColormap(display,resource_info,windows,*image,exception);
+ (void) XConfigureImage(display,resource_info,windows,*image,exception);
break;
}
case ContrastStretchCommand:
}
white_point=(MagickRealType) (*image)->columns*(*image)->rows-white_point;
(void) ContrastStretchImage(*image,black_point,white_point,
- &(*image)->exception);
+ exception);
XSetCursorState(display,windows,MagickFalse);
if (windows->image.orphan != MagickFalse)
break;
- XConfigureImageColormap(display,resource_info,windows,*image);
- (void) XConfigureImage(display,resource_info,windows,*image);
+ XConfigureImageColormap(display,resource_info,windows,*image,exception);
+ (void) XConfigureImage(display,resource_info,windows,*image,exception);
break;
}
case SigmoidalContrastCommand:
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,&(*image)->exception);
+ geometry_info.sigma,exception);
XSetCursorState(display,windows,MagickFalse);
if (windows->image.orphan != MagickFalse)
break;
- XConfigureImageColormap(display,resource_info,windows,*image);
- (void) XConfigureImage(display,resource_info,windows,*image);
+ XConfigureImageColormap(display,resource_info,windows,*image,exception);
+ (void) XConfigureImage(display,resource_info,windows,*image,exception);
break;
}
case NormalizeCommand:
*/
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
- (void) NormalizeImage(*image,&(*image)->exception);
+ (void) NormalizeImage(*image,exception);
XSetCursorState(display,windows,MagickFalse);
if (windows->image.orphan != MagickFalse)
break;
- XConfigureImageColormap(display,resource_info,windows,*image);
- (void) XConfigureImage(display,resource_info,windows,*image);
+ XConfigureImageColormap(display,resource_info,windows,*image,exception);
+ (void) XConfigureImage(display,resource_info,windows,*image,exception);
break;
}
case EqualizeCommand:
*/
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
- (void) EqualizeImage(*image,&(*image)->exception);
+ (void) EqualizeImage(*image,exception);
XSetCursorState(display,windows,MagickFalse);
if (windows->image.orphan != MagickFalse)
break;
- XConfigureImageColormap(display,resource_info,windows,*image);
- (void) XConfigureImage(display,resource_info,windows,*image);
+ XConfigureImageColormap(display,resource_info,windows,*image,exception);
+ (void) XConfigureImage(display,resource_info,windows,*image,exception);
break;
}
case NegateCommand:
*/
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
- (void) NegateImage(*image,MagickFalse,&(*image)->exception);
+ (void) NegateImage(*image,MagickFalse,exception);
XSetCursorState(display,windows,MagickFalse);
if (windows->image.orphan != MagickFalse)
break;
- XConfigureImageColormap(display,resource_info,windows,*image);
- (void) XConfigureImage(display,resource_info,windows,*image);
+ XConfigureImageColormap(display,resource_info,windows,*image,exception);
+ (void) XConfigureImage(display,resource_info,windows,*image,exception);
break;
}
case GrayscaleCommand:
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
(void) SetImageType(*image,(*image)->matte == MagickFalse ?
- GrayscaleType : GrayscaleMatteType);
+ GrayscaleType : GrayscaleMatteType,exception);
XSetCursorState(display,windows,MagickFalse);
if (windows->image.orphan != MagickFalse)
break;
- XConfigureImageColormap(display,resource_info,windows,*image);
- (void) XConfigureImage(display,resource_info,windows,*image);
+ XConfigureImageColormap(display,resource_info,windows,*image,exception);
+ (void) XConfigureImage(display,resource_info,windows,*image,exception);
break;
}
case MapCommand:
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
(void) CopyMagickString(image_info->filename,filename,MaxTextExtent);
- affinity_image=ReadImage(image_info,&(*image)->exception);
+ affinity_image=ReadImage(image_info,exception);
if (affinity_image != (Image *) NULL)
{
- (void) RemapImage(&quantize_info,*image,affinity_image);
+ (void) RemapImage(&quantize_info,*image,affinity_image,exception);
affinity_image=DestroyImage(affinity_image);
}
- CatchException(&(*image)->exception);
+ CatchException(exception);
XSetCursorState(display,windows,MagickFalse);
if (windows->image.orphan != MagickFalse)
break;
- XConfigureImageColormap(display,resource_info,windows,*image);
- (void) XConfigureImage(display,resource_info,windows,*image);
+ XConfigureImageColormap(display,resource_info,windows,*image,exception);
+ (void) XConfigureImage(display,resource_info,windows,*image,exception);
break;
}
case QuantizeCommand:
XCheckRefreshWindows(display,windows);
quantize_info.number_colors=StringToUnsignedLong(colors);
quantize_info.dither=status != 0 ? MagickTrue : MagickFalse;
- (void) QuantizeImage(&quantize_info,*image);
+ (void) QuantizeImage(&quantize_info,*image,exception);
XSetCursorState(display,windows,MagickFalse);
if (windows->image.orphan != MagickFalse)
break;
- XConfigureImageColormap(display,resource_info,windows,*image);
- (void) XConfigureImage(display,resource_info,windows,*image);
+ XConfigureImageColormap(display,resource_info,windows,*image,exception);
+ (void) XConfigureImage(display,resource_info,windows,*image,exception);
break;
}
case DespeckleCommand:
*/
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
- despeckle_image=DespeckleImage(*image,&(*image)->exception);
+ despeckle_image=DespeckleImage(*image,exception);
if (despeckle_image != (Image *) NULL)
{
*image=DestroyImage(*image);
*image=despeckle_image;
}
- CatchException(&(*image)->exception);
+ CatchException(exception);
XSetCursorState(display,windows,MagickFalse);
if (windows->image.orphan != MagickFalse)
break;
- XConfigureImageColormap(display,resource_info,windows,*image);
- (void) XConfigureImage(display,resource_info,windows,*image);
+ XConfigureImageColormap(display,resource_info,windows,*image,exception);
+ (void) XConfigureImage(display,resource_info,windows,*image,exception);
break;
}
case EmbossCommand:
if ((flags & SigmaValue) == 0)
geometry_info.sigma=1.0;
emboss_image=EmbossImage(*image,geometry_info.rho,geometry_info.sigma,
- &(*image)->exception);
+ exception);
if (emboss_image != (Image *) NULL)
{
*image=DestroyImage(*image);
*image=emboss_image;
}
- CatchException(&(*image)->exception);
+ CatchException(exception);
XSetCursorState(display,windows,MagickFalse);
if (windows->image.orphan != MagickFalse)
break;
- XConfigureImageColormap(display,resource_info,windows,*image);
- (void) XConfigureImage(display,resource_info,windows,*image);
+ XConfigureImageColormap(display,resource_info,windows,*image,exception);
+ (void) XConfigureImage(display,resource_info,windows,*image,exception);
break;
}
case ReduceNoiseCommand:
XCheckRefreshWindows(display,windows);
flags=ParseGeometry(radius,&geometry_info);
noise_image=StatisticImage(*image,NonpeakStatistic,(size_t)
- geometry_info.rho,(size_t) geometry_info.rho,&(*image)->exception);
+ geometry_info.rho,(size_t) geometry_info.rho,exception);
if (noise_image != (Image *) NULL)
{
*image=DestroyImage(*image);
*image=noise_image;
}
- CatchException(&(*image)->exception);
+ CatchException(exception);
XSetCursorState(display,windows,MagickFalse);
if (windows->image.orphan != MagickFalse)
break;
- XConfigureImageColormap(display,resource_info,windows,*image);
- (void) XConfigureImage(display,resource_info,windows,*image);
+ XConfigureImageColormap(display,resource_info,windows,*image,exception);
+ (void) XConfigureImage(display,resource_info,windows,*image,exception);
break;
}
case AddNoiseCommand:
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
noise_image=AddNoiseImage(*image,(NoiseType) ParseCommandOption(
- MagickNoiseOptions,MagickFalse,noise_type),&(*image)->exception);
+ MagickNoiseOptions,MagickFalse,noise_type),1.0,exception);
if (noise_image != (Image *) NULL)
{
*image=DestroyImage(*image);
*image=noise_image;
}
- CatchException(&(*image)->exception);
+ CatchException(exception);
XSetCursorState(display,windows,MagickFalse);
if (windows->image.orphan != MagickFalse)
break;
- XConfigureImageColormap(display,resource_info,windows,*image);
- (void) XConfigureImage(display,resource_info,windows,*image);
+ XConfigureImageColormap(display,resource_info,windows,*image,exception);
+ (void) XConfigureImage(display,resource_info,windows,*image,exception);
break;
}
case SharpenCommand:
XCheckRefreshWindows(display,windows);
flags=ParseGeometry(radius,&geometry_info);
sharp_image=SharpenImage(*image,geometry_info.rho,geometry_info.sigma,
- &(*image)->exception);
+ exception);
if (sharp_image != (Image *) NULL)
{
*image=DestroyImage(*image);
*image=sharp_image;
}
- CatchException(&(*image)->exception);
+ CatchException(exception);
XSetCursorState(display,windows,MagickFalse);
if (windows->image.orphan != MagickFalse)
break;
- XConfigureImageColormap(display,resource_info,windows,*image);
- (void) XConfigureImage(display,resource_info,windows,*image);
+ XConfigureImageColormap(display,resource_info,windows,*image,exception);
+ (void) XConfigureImage(display,resource_info,windows,*image,exception);
break;
}
case BlurCommand:
XCheckRefreshWindows(display,windows);
flags=ParseGeometry(radius,&geometry_info);
blur_image=BlurImage(*image,geometry_info.rho,geometry_info.sigma,
- &(*image)->exception);
+ exception);
if (blur_image != (Image *) NULL)
{
*image=DestroyImage(*image);
*image=blur_image;
}
- CatchException(&(*image)->exception);
+ CatchException(exception);
XSetCursorState(display,windows,MagickFalse);
if (windows->image.orphan != MagickFalse)
break;
- XConfigureImageColormap(display,resource_info,windows,*image);
- (void) XConfigureImage(display,resource_info,windows,*image);
+ XConfigureImageColormap(display,resource_info,windows,*image,exception);
+ (void) XConfigureImage(display,resource_info,windows,*image,exception);
break;
}
case ThresholdCommand:
*/
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
- threshold=SiPrefixToDouble(factor,QuantumRange);
- (void) BilevelImage(*image,threshold);
+ threshold=StringToDoubleInterval(factor,(double) QuantumRange+1.0);
+ (void) BilevelImage(*image,threshold,exception);
XSetCursorState(display,windows,MagickFalse);
if (windows->image.orphan != MagickFalse)
break;
- XConfigureImageColormap(display,resource_info,windows,*image);
- (void) XConfigureImage(display,resource_info,windows,*image);
+ XConfigureImageColormap(display,resource_info,windows,*image,exception);
+ (void) XConfigureImage(display,resource_info,windows,*image,exception);
break;
}
case EdgeDetectCommand:
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
flags=ParseGeometry(radius,&geometry_info);
- edge_image=EdgeImage(*image,geometry_info.rho,&(*image)->exception);
+ edge_image=EdgeImage(*image,geometry_info.rho,geometry_info.sigma,
+ exception);
if (edge_image != (Image *) NULL)
{
*image=DestroyImage(*image);
*image=edge_image;
}
- CatchException(&(*image)->exception);
+ CatchException(exception);
XSetCursorState(display,windows,MagickFalse);
if (windows->image.orphan != MagickFalse)
break;
- XConfigureImageColormap(display,resource_info,windows,*image);
- (void) XConfigureImage(display,resource_info,windows,*image);
+ XConfigureImageColormap(display,resource_info,windows,*image,exception);
+ (void) XConfigureImage(display,resource_info,windows,*image,exception);
break;
}
case SpreadCommand:
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
flags=ParseGeometry(amount,&geometry_info);
- spread_image=EdgeImage(*image,geometry_info.rho,&(*image)->exception);
+ spread_image=EdgeImage(*image,geometry_info.rho,geometry_info.sigma,
+ exception);
if (spread_image != (Image *) NULL)
{
*image=DestroyImage(*image);
*image=spread_image;
}
- CatchException(&(*image)->exception);
+ CatchException(exception);
XSetCursorState(display,windows,MagickFalse);
if (windows->image.orphan != MagickFalse)
break;
- XConfigureImageColormap(display,resource_info,windows,*image);
- (void) XConfigureImage(display,resource_info,windows,*image);
+ XConfigureImageColormap(display,resource_info,windows,*image,exception);
+ (void) XConfigureImage(display,resource_info,windows,*image,exception);
break;
}
case ShadeCommand:
if ((flags & SigmaValue) == 0)
geometry_info.sigma=1.0;
shade_image=ShadeImage(*image,status != 0 ? MagickFalse : MagickTrue,
- geometry_info.rho,geometry_info.sigma,&(*image)->exception);
+ geometry_info.rho,geometry_info.sigma,exception);
if (shade_image != (Image *) NULL)
{
*image=DestroyImage(*image);
*image=shade_image;
}
- CatchException(&(*image)->exception);
+ CatchException(exception);
XSetCursorState(display,windows,MagickFalse);
if (windows->image.orphan != MagickFalse)
break;
- XConfigureImageColormap(display,resource_info,windows,*image);
- (void) XConfigureImage(display,resource_info,windows,*image);
+ XConfigureImageColormap(display,resource_info,windows,*image,exception);
+ (void) XConfigureImage(display,resource_info,windows,*image,exception);
break;
}
case RaiseCommand:
/*
Raise an image.
*/
- (void) XMagickCommand(display,resource_info,windows,ApplyCommand,image);
+ (void) XMagickCommand(display,resource_info,windows,ApplyCommand,image,
+ exception);
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
(void) ParsePageGeometry(*image,bevel_width,&page_geometry,
- &(*image)->exception);
- (void) RaiseImage(*image,&page_geometry,MagickTrue);
+ exception);
+ (void) RaiseImage(*image,&page_geometry,MagickTrue,exception);
XSetCursorState(display,windows,MagickFalse);
if (windows->image.orphan != MagickFalse)
break;
- XConfigureImageColormap(display,resource_info,windows,*image);
- (void) XConfigureImage(display,resource_info,windows,*image);
+ XConfigureImageColormap(display,resource_info,windows,*image,exception);
+ (void) XConfigureImage(display,resource_info,windows,*image,exception);
break;
}
case SegmentCommand:
flags=ParseGeometry(threshold,&geometry_info);
if ((flags & SigmaValue) == 0)
geometry_info.sigma=1.0;
- (void) SegmentImage(*image,RGBColorspace,MagickFalse,geometry_info.rho,
- geometry_info.sigma);
+ (void) SegmentImage(*image,sRGBColorspace,MagickFalse,geometry_info.rho,
+ geometry_info.sigma,exception);
XSetCursorState(display,windows,MagickFalse);
if (windows->image.orphan != MagickFalse)
break;
- XConfigureImageColormap(display,resource_info,windows,*image);
- (void) XConfigureImage(display,resource_info,windows,*image);
+ XConfigureImageColormap(display,resource_info,windows,*image,exception);
+ (void) XConfigureImage(display,resource_info,windows,*image,exception);
break;
}
case SepiaToneCommand:
*/
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
- threshold=SiPrefixToDouble(factor,QuantumRange);
- sepia_image=SepiaToneImage(*image,threshold,&(*image)->exception);
+ threshold=StringToDoubleInterval(factor,(double) QuantumRange+1.0);
+ sepia_image=SepiaToneImage(*image,threshold,exception);
if (sepia_image != (Image *) NULL)
{
*image=DestroyImage(*image);
*image=sepia_image;
}
- CatchException(&(*image)->exception);
+ CatchException(exception);
XSetCursorState(display,windows,MagickFalse);
if (windows->image.orphan != MagickFalse)
break;
- XConfigureImageColormap(display,resource_info,windows,*image);
- (void) XConfigureImage(display,resource_info,windows,*image);
+ XConfigureImageColormap(display,resource_info,windows,*image,exception);
+ (void) XConfigureImage(display,resource_info,windows,*image,exception);
break;
}
case SolarizeCommand:
*/
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
- threshold=SiPrefixToDouble(factor,QuantumRange);
- (void) SolarizeImage(*image,threshold);
+ threshold=StringToDoubleInterval(factor,(double) QuantumRange+1.0);
+ (void) SolarizeImage(*image,threshold,exception);
XSetCursorState(display,windows,MagickFalse);
if (windows->image.orphan != MagickFalse)
break;
- XConfigureImageColormap(display,resource_info,windows,*image);
- (void) XConfigureImage(display,resource_info,windows,*image);
+ XConfigureImageColormap(display,resource_info,windows,*image,exception);
+ (void) XConfigureImage(display,resource_info,windows,*image,exception);
break;
}
case SwirlCommand:
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
flags=ParseGeometry(degrees,&geometry_info);
- swirl_image=SwirlImage(*image,geometry_info.rho,&(*image)->exception);
+ swirl_image=SwirlImage(*image,geometry_info.rho,(*image)->interpolate,
+ exception);
if (swirl_image != (Image *) NULL)
{
*image=DestroyImage(*image);
*image=swirl_image;
}
- CatchException(&(*image)->exception);
+ CatchException(exception);
XSetCursorState(display,windows,MagickFalse);
if (windows->image.orphan != MagickFalse)
break;
- XConfigureImageColormap(display,resource_info,windows,*image);
- (void) XConfigureImage(display,resource_info,windows,*image);
+ XConfigureImageColormap(display,resource_info,windows,*image,exception);
+ (void) XConfigureImage(display,resource_info,windows,*image,exception);
break;
}
case ImplodeCommand:
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
flags=ParseGeometry(factor,&geometry_info);
- implode_image=ImplodeImage(*image,geometry_info.rho,&(*image)->exception);
+ implode_image=ImplodeImage(*image,geometry_info.rho,(*image)->interpolate,
+ exception);
if (implode_image != (Image *) NULL)
{
*image=DestroyImage(*image);
*image=implode_image;
}
- CatchException(&(*image)->exception);
+ CatchException(exception);
XSetCursorState(display,windows,MagickFalse);
if (windows->image.orphan != MagickFalse)
break;
- XConfigureImageColormap(display,resource_info,windows,*image);
- (void) XConfigureImage(display,resource_info,windows,*image);
+ XConfigureImageColormap(display,resource_info,windows,*image,exception);
+ (void) XConfigureImage(display,resource_info,windows,*image,exception);
break;
}
case VignetteCommand:
geometry_info.xi=0.1*(*image)->columns;
if ((flags & PsiValue) == 0)
geometry_info.psi=0.1*(*image)->rows;
- vignette_image=VignetteImage(*image,geometry_info.rho,geometry_info.sigma,
- (ssize_t) ceil(geometry_info.xi-0.5),(ssize_t) ceil(geometry_info.psi-
- 0.5),&(*image)->exception);
+ vignette_image=VignetteImage(*image,geometry_info.rho,0.0,(ssize_t)
+ ceil(geometry_info.xi-0.5),(ssize_t) ceil(geometry_info.psi-0.5),
+ exception);
if (vignette_image != (Image *) NULL)
{
*image=DestroyImage(*image);
*image=vignette_image;
}
- CatchException(&(*image)->exception);
+ CatchException(exception);
XSetCursorState(display,windows,MagickFalse);
if (windows->image.orphan != MagickFalse)
break;
- XConfigureImageColormap(display,resource_info,windows,*image);
- (void) XConfigureImage(display,resource_info,windows,*image);
+ XConfigureImageColormap(display,resource_info,windows,*image,exception);
+ (void) XConfigureImage(display,resource_info,windows,*image,exception);
break;
}
case WaveCommand:
if ((flags & SigmaValue) == 0)
geometry_info.sigma=1.0;
wave_image=WaveImage(*image,geometry_info.rho,geometry_info.sigma,
- &(*image)->exception);
+ (*image)->interpolate,exception);
if (wave_image != (Image *) NULL)
{
*image=DestroyImage(*image);
*image=wave_image;
}
- CatchException(&(*image)->exception);
+ CatchException(exception);
XSetCursorState(display,windows,MagickFalse);
if (windows->image.orphan != MagickFalse)
break;
- XConfigureImageColormap(display,resource_info,windows,*image);
- (void) XConfigureImage(display,resource_info,windows,*image);
+ XConfigureImageColormap(display,resource_info,windows,*image,exception);
+ (void) XConfigureImage(display,resource_info,windows,*image,exception);
break;
}
case OilPaintCommand:
XCheckRefreshWindows(display,windows);
flags=ParseGeometry(radius,&geometry_info);
paint_image=OilPaintImage(*image,geometry_info.rho,geometry_info.sigma,
- &(*image)->exception);
+ exception);
if (paint_image != (Image *) NULL)
{
*image=DestroyImage(*image);
*image=paint_image;
}
- CatchException(&(*image)->exception);
+ CatchException(exception);
XSetCursorState(display,windows,MagickFalse);
if (windows->image.orphan != MagickFalse)
break;
- XConfigureImageColormap(display,resource_info,windows,*image);
- (void) XConfigureImage(display,resource_info,windows,*image);
+ XConfigureImageColormap(display,resource_info,windows,*image,exception);
+ (void) XConfigureImage(display,resource_info,windows,*image,exception);
break;
}
case CharcoalDrawCommand:
/*
Charcoal the image.
*/
- (void) XMagickCommand(display,resource_info,windows,ApplyCommand,image);
+ (void) XMagickCommand(display,resource_info,windows,ApplyCommand,image,
+ exception);
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
flags=ParseGeometry(radius,&geometry_info);
if ((flags & SigmaValue) == 0)
geometry_info.sigma=geometry_info.rho;
charcoal_image=CharcoalImage(*image,geometry_info.rho,geometry_info.sigma,
- &(*image)->exception);
+ exception);
if (charcoal_image != (Image *) NULL)
{
*image=DestroyImage(*image);
*image=charcoal_image;
}
- CatchException(&(*image)->exception);
+ CatchException(exception);
XSetCursorState(display,windows,MagickFalse);
if (windows->image.orphan != MagickFalse)
break;
- XConfigureImageColormap(display,resource_info,windows,*image);
- (void) XConfigureImage(display,resource_info,windows,*image);
+ XConfigureImageColormap(display,resource_info,windows,*image,exception);
+ (void) XConfigureImage(display,resource_info,windows,*image,exception);
break;
}
case AnnotateCommand:
/*
Annotate the image with text.
*/
- status=XAnnotateEditImage(display,resource_info,windows,*image);
+ status=XAnnotateEditImage(display,resource_info,windows,*image,exception);
if (status == MagickFalse)
{
XNoticeWidget(display,windows,"Unable to annotate X image",
/*
Draw image.
*/
- status=XDrawEditImage(display,resource_info,windows,image);
+ status=XDrawEditImage(display,resource_info,windows,image,exception);
if (status == MagickFalse)
{
XNoticeWidget(display,windows,"Unable to draw on the X image",
/*
Color edit.
*/
- status=XColorEditImage(display,resource_info,windows,image);
+ status=XColorEditImage(display,resource_info,windows,image,exception);
if (status == MagickFalse)
{
XNoticeWidget(display,windows,"Unable to pixel edit X image",
/*
Matte edit.
*/
- status=XMatteEditImage(display,resource_info,windows,image);
+ status=XMatteEditImage(display,resource_info,windows,image,exception);
if (status == MagickFalse)
{
XNoticeWidget(display,windows,"Unable to matte edit X image",
/*
Composite image.
*/
- status=XCompositeImage(display,resource_info,windows,*image);
+ status=XCompositeImage(display,resource_info,windows,*image,
+ exception);
if (status == MagickFalse)
{
XNoticeWidget(display,windows,"Unable to composite X image",
/*
Add a border to the image.
*/
- (void) XMagickCommand(display,resource_info,windows,ApplyCommand,image);
+ (void) XMagickCommand(display,resource_info,windows,ApplyCommand,image,
+ exception);
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
- (void) QueryColorDatabase(color,&(*image)->border_color,
- &(*image)->exception);
+ (void) QueryColorCompliance(color,AllCompliance,&(*image)->border_color,
+ exception);
(void) ParsePageGeometry(*image,geometry,&page_geometry,
- &(*image)->exception);
- border_image=BorderImage(*image,&page_geometry,&(*image)->exception);
+ exception);
+ border_image=BorderImage(*image,&page_geometry,(*image)->compose,
+ exception);
if (border_image != (Image *) NULL)
{
*image=DestroyImage(*image);
*image=border_image;
}
- CatchException(&(*image)->exception);
+ CatchException(exception);
XSetCursorState(display,windows,MagickFalse);
if (windows->image.orphan != MagickFalse)
break;
windows->image.window_changes.width=(int) (*image)->columns;
windows->image.window_changes.height=(int) (*image)->rows;
- XConfigureImageColormap(display,resource_info,windows,*image);
- (void) XConfigureImage(display,resource_info,windows,*image);
+ XConfigureImageColormap(display,resource_info,windows,*image,exception);
+ (void) XConfigureImage(display,resource_info,windows,*image,exception);
break;
}
case AddFrameCommand:
/*
Surround image with an ornamental border.
*/
- (void) XMagickCommand(display,resource_info,windows,ApplyCommand,image);
+ (void) XMagickCommand(display,resource_info,windows,ApplyCommand,image,
+ exception);
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
- (void) QueryColorDatabase(color,&(*image)->matte_color,
- &(*image)->exception);
+ (void) QueryColorCompliance(color,AllCompliance,&(*image)->matte_color,
+ exception);
(void) ParsePageGeometry(*image,geometry,&page_geometry,
- &(*image)->exception);
+ exception);
frame_info.width=page_geometry.width;
frame_info.height=page_geometry.height;
frame_info.outer_bevel=page_geometry.x;
frame_info.y=(ssize_t) frame_info.height;
frame_info.width=(*image)->columns+2*frame_info.width;
frame_info.height=(*image)->rows+2*frame_info.height;
- frame_image=FrameImage(*image,&frame_info,&(*image)->exception);
+ frame_image=FrameImage(*image,&frame_info,(*image)->compose,exception);
if (frame_image != (Image *) NULL)
{
*image=DestroyImage(*image);
*image=frame_image;
}
- CatchException(&(*image)->exception);
+ CatchException(exception);
XSetCursorState(display,windows,MagickFalse);
if (windows->image.orphan != MagickFalse)
break;
windows->image.window_changes.width=(int) (*image)->columns;
windows->image.window_changes.height=(int) (*image)->rows;
- XConfigureImageColormap(display,resource_info,windows,*image);
- (void) XConfigureImage(display,resource_info,windows,*image);
+ XConfigureImageColormap(display,resource_info,windows,*image,exception);
+ (void) XConfigureImage(display,resource_info,windows,*image,exception);
break;
}
case CommentCommand:
if (unique_file == -1)
XNoticeWidget(display,windows,"Unable to edit image comment",
image_info->filename);
- value=GetImageProperty(*image,"comment");
+ value=GetImageProperty(*image,"comment",exception);
if (value == (char *) NULL)
unique_file=close(unique_file)-1;
else
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
status=InvokeDelegate(image_info,*image,"edit",(char *) NULL,
- &(*image)->exception);
+ exception);
if (status == MagickFalse)
XNoticeWidget(display,windows,"Unable to edit image comment",
(char *) NULL);
char
*comment;
- comment=FileToString(image_info->filename,~0UL,&(*image)->exception);
+ comment=FileToString(image_info->filename,~0UL,exception);
if (comment != (char *) NULL)
{
- (void) SetImageProperty(*image,"comment",comment);
+ (void) SetImageProperty(*image,"comment",comment,exception);
(*image)->taint=MagickTrue;
}
}
(void) AcquireUniqueFilename(filename);
(void) FormatLocaleString((*image)->filename,MaxTextExtent,"launch:%s",
filename);
- status=WriteImage(image_info,*image);
+ status=WriteImage(image_info,*image,exception);
if (status == MagickFalse)
XNoticeWidget(display,windows,"Unable to launch image editor",
(char *) NULL);
else
{
- nexus=ReadImage(resource_info->image_info,&(*image)->exception);
- CatchException(&(*image)->exception);
+ nexus=ReadImage(resource_info->image_info,exception);
+ CatchException(exception);
XClientMessage(display,windows->image.id,windows->im_protocols,
windows->im_next_image,CurrentTime);
}
/*
Apply an image processing technique to a region of interest.
*/
- (void) XROIImage(display,resource_info,windows,image);
+ (void) XROIImage(display,resource_info,windows,image,exception);
break;
}
case InfoCommand:
ParseCommandOption(MagickPreviewOptions,MagickFalse,preview_type);
image_info->group=(ssize_t) windows->image.id;
(void) DeleteImageProperty(*image,"label");
- (void) SetImageProperty(*image,"label","Preview");
+ (void) SetImageProperty(*image,"label","Preview",exception);
(void) AcquireUniqueFilename(filename);
(void) FormatLocaleString((*image)->filename,MaxTextExtent,"preview:%s",
filename);
- status=WriteImage(image_info,*image);
+ status=WriteImage(image_info,*image,exception);
(void) CopyMagickString(image_info->filename,filename,MaxTextExtent);
- preview_image=ReadImage(image_info,&(*image)->exception);
+ preview_image=ReadImage(image_info,exception);
(void) RelinquishUniqueFileResource(filename);
if (preview_image == (Image *) NULL)
break;
(void) FormatLocaleString(preview_image->filename,MaxTextExtent,"show:%s",
filename);
- status=WriteImage(image_info,preview_image);
+ status=WriteImage(image_info,preview_image,exception);
preview_image=DestroyImage(preview_image);
if (status == MagickFalse)
XNoticeWidget(display,windows,"Unable to show image preview",
XCheckRefreshWindows(display,windows);
image_info->group=(ssize_t) windows->image.id;
(void) DeleteImageProperty(*image,"label");
- (void) SetImageProperty(*image,"label","Histogram");
+ (void) SetImageProperty(*image,"label","Histogram",exception);
(void) AcquireUniqueFilename(filename);
(void) FormatLocaleString((*image)->filename,MaxTextExtent,"histogram:%s",
filename);
- status=WriteImage(image_info,*image);
+ status=WriteImage(image_info,*image,exception);
(void) CopyMagickString(image_info->filename,filename,MaxTextExtent);
- histogram_image=ReadImage(image_info,&(*image)->exception);
+ histogram_image=ReadImage(image_info,exception);
(void) RelinquishUniqueFileResource(filename);
if (histogram_image == (Image *) NULL)
break;
(void) FormatLocaleString(histogram_image->filename,MaxTextExtent,
"show:%s",filename);
- status=WriteImage(image_info,histogram_image);
+ status=WriteImage(image_info,histogram_image,exception);
histogram_image=DestroyImage(histogram_image);
if (status == MagickFalse)
XNoticeWidget(display,windows,"Unable to show histogram",
XCheckRefreshWindows(display,windows);
image_info->group=(ssize_t) windows->image.id;
(void) DeleteImageProperty(*image,"label");
- (void) SetImageProperty(*image,"label","Matte");
+ (void) SetImageProperty(*image,"label","Matte",exception);
(void) AcquireUniqueFilename(filename);
(void) FormatLocaleString((*image)->filename,MaxTextExtent,"matte:%s",
filename);
- status=WriteImage(image_info,*image);
+ status=WriteImage(image_info,*image,exception);
(void) CopyMagickString(image_info->filename,filename,MaxTextExtent);
- matte_image=ReadImage(image_info,&(*image)->exception);
+ matte_image=ReadImage(image_info,exception);
(void) RelinquishUniqueFileResource(filename);
if (matte_image == (Image *) NULL)
break;
(void) FormatLocaleString(matte_image->filename,MaxTextExtent,"show:%s",
filename);
- status=WriteImage(image_info,matte_image);
+ status=WriteImage(image_info,matte_image,exception);
matte_image=DestroyImage(matte_image);
if (status == MagickFalse)
XNoticeWidget(display,windows,"Unable to show matte",
/*
Background image.
*/
- status=XBackgroundImage(display,resource_info,windows,image);
+ status=XBackgroundImage(display,resource_info,windows,image,exception);
if (status == MagickFalse)
break;
- nexus=CloneImage(*image,0,0,MagickTrue,&(*image)->exception);
+ nexus=CloneImage(*image,0,0,MagickTrue,exception);
if (nexus != (Image *) NULL)
XClientMessage(display,windows->image.id,windows->im_protocols,
windows->im_next_image,CurrentTime);
status=XPreferencesWidget(display,resource_info,windows);
if (status == MagickFalse)
break;
- nexus=CloneImage(*image,0,0,MagickTrue,&(*image)->exception);
+ nexus=CloneImage(*image,0,0,MagickTrue,exception);
if (nexus != (Image *) NULL)
XClientMessage(display,windows->image.id,windows->im_protocols,
windows->im_next_image,CurrentTime);
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
status=InvokeDelegate(image_info,*image,"browse",(char *) NULL,
- &(*image)->exception);
+ exception);
if (status == MagickFalse)
XNoticeWidget(display,windows,"Unable to browse documentation",
(char *) NULL);
%
% The format of the XMagnifyImage method is:
%
-% void XMagnifyImage(Display *display,XWindows *windows,XEvent *event)
+% void XMagnifyImage(Display *display,XWindows *windows,XEvent *event,
+% ExceptionInfo *exception)
%
% A description of each parameter follows:
%
% o event: Specifies a pointer to a XEvent structure. If it is NULL,
% the entire image is refreshed.
%
+% o exception: return any errors or warnings in this structure.
+%
*/
-static void XMagnifyImage(Display *display,XWindows *windows,XEvent *event)
+static void XMagnifyImage(Display *display,XWindows *windows,XEvent *event,
+ ExceptionInfo *exception)
{
char
text[MaxTextExtent];
/*
Wait for next event.
*/
- XScreenEvent(display,windows,event);
+ XScreenEvent(display,windows,event,exception);
switch (event->type)
{
case ButtonPress:
% The format of the XMagnifyWindowCommand method is:
%
% void XMagnifyWindowCommand(Display *display,XWindows *windows,
-% const MagickStatusType state,const KeySym key_symbol)
+% const MagickStatusType state,const KeySym key_symbol,
+% ExceptionInfo *exception)
%
% A description of each parameter follows:
%
% o key_symbol: Specifies a KeySym which indicates which side of the image
% to trim.
%
+% o exception: return any errors or warnings in this structure.
+%
*/
static void XMagnifyWindowCommand(Display *display,XWindows *windows,
- const MagickStatusType state,const KeySym key_symbol)
+ const MagickStatusType state,const KeySym key_symbol,ExceptionInfo *exception)
{
unsigned int
quantum;
default:
break;
}
- XMakeMagnifyImage(display,windows);
+ XMakeMagnifyImage(display,windows,exception);
}
\f
/*
% The format of the XMakePanImage method is:
%
% void XMakePanImage(Display *display,XResourceInfo *resource_info,
-% XWindows *windows,Image *image)
+% XWindows *windows,Image *image,ExceptionInfo *exception)
%
% A description of each parameter follows:
%
%
% o image: the image.
%
+% o exception: return any errors or warnings in this structure.
+%
*/
static void XMakePanImage(Display *display,XResourceInfo *resource_info,
- XWindows *windows,Image *image)
+ XWindows *windows,Image *image,ExceptionInfo *exception)
{
MagickStatusType
status;
windows->pan.x=(int) windows->image.x;
windows->pan.y=(int) windows->image.y;
status=XMakeImage(display,resource_info,&windows->pan,image,
- windows->pan.width,windows->pan.height);
+ windows->pan.width,windows->pan.height,exception);
if (status == MagickFalse)
- ThrowXWindowFatalException(XServerError,image->exception.reason,
- image->exception.description);
+ ThrowXWindowFatalException(ResourceLimitError,
+ "MemoryAllocationFailed",image->filename);
(void) XSetWindowBackgroundPixmap(display,windows->pan.id,
windows->pan.pixmap);
(void) XClearWindow(display,windows->pan.id);
% The format of the XMatteEditImage method is:
%
% MagickBooleanType XMatteEditImage(Display *display,
-% XResourceInfo *resource_info,XWindows *windows,Image **image)
+% XResourceInfo *resource_info,XWindows *windows,Image **image,
+% ExceptionInfo *exception)
%
% A description of each parameter follows:
%
%
% o image: the image; returned from ReadImage.
%
+% o exception: return any errors or warnings in this structure.
+%
*/
static MagickBooleanType XMatteEditImage(Display *display,
- XResourceInfo *resource_info,XWindows *windows,Image **image)
+ XResourceInfo *resource_info,XWindows *windows,Image **image,
+ ExceptionInfo *exception)
{
static char
matte[MaxTextExtent] = "0";
/*
Wait for next event.
*/
- XScreenEvent(display,windows,&event);
+ XScreenEvent(display,windows,&event,exception);
if (event.xany.window == windows->command.id)
{
/*
break;
if (entry != 5)
{
- (*image)->fuzz=SiPrefixToDouble(FuzzMenu[entry],1.0*
+ (*image)->fuzz=StringToDoubleInterval(FuzzMenu[entry],(double)
QuantumRange+1.0);
break;
}
if (*fuzz == '\0')
break;
(void) ConcatenateMagickString(fuzz,"%",MaxTextExtent);
- (*image)->fuzz=SiPrefixToDouble(fuzz,1.0*QuantumRange+1.0);
+ (*image)->fuzz=StringToDoubleInterval(fuzz,(double) QuantumRange+
+ 1.0);
break;
}
case MatteEditValueCommand:
case MatteEditUndoCommand:
{
(void) XMagickCommand(display,resource_info,windows,UndoCommand,
- image);
+ image,exception);
break;
}
case MatteEditHelpCommand:
x=event.xbutton.x;
y=event.xbutton.y;
(void) XMagickCommand(display,resource_info,windows,
- SaveToUndoBufferCommand,image);
+ SaveToUndoBufferCommand,image,exception);
state|=UpdateConfigurationState;
break;
}
*/
x=event.xbutton.x;
y=event.xbutton.y;
- XConfigureImageColormap(display,resource_info,windows,*image);
- (void) XConfigureImage(display,resource_info,windows,*image);
+ XConfigureImageColormap(display,resource_info,windows,*image,exception);
+ (void) XConfigureImage(display,resource_info,windows,*image,exception);
XInfoWidget(display,windows,text);
(void) XCheckDefineCursor(display,windows->image.id,cursor);
state&=(~UpdateConfigurationState);
CacheView
*image_view;
- ExceptionInfo
- *exception;
-
int
x,
y;
if ((x_offset >= (int) (*image)->columns) ||
(y_offset >= (int) (*image)->rows))
continue;
- exception=(&(*image)->exception);
if (SetImageStorageClass(*image,DirectClass,exception) == MagickFalse)
return(MagickFalse);
- (*image)->matte=MagickTrue;
+ if ((*image)->matte == MagickFalse)
+ (void) SetImageAlphaChannel(*image,OpaqueAlphaChannel,exception);
image_view=AcquireCacheView(*image);
switch (method)
{
}
case ReplaceMethod:
{
- PixelPacket
+ PixelInfo
pixel,
target;
/*
Update matte information using replace algorithm.
*/
- (void) GetOneCacheViewVirtualPixel(image_view,(ssize_t) x_offset,
- (ssize_t) y_offset,&target,exception);
+ (void) GetOneCacheViewVirtualPixelInfo(image_view,(ssize_t)
+ x_offset,(ssize_t) y_offset,&target,exception);
for (y=0; y < (int) (*image)->rows; y++)
{
q=GetCacheViewAuthenticPixels(image_view,0,(ssize_t) y,
- (*image)->columns,1,&(*image)->exception);
+ (*image)->columns,1,exception);
if (q == (Quantum *) NULL)
break;
for (x=0; x < (int) (*image)->columns; x++)
{
- GetPixelPacket(*image,q,&pixel);
- if (IsFuzzyEquivalencePixelPacket(*image,&pixel,&target))
+ GetPixelInfoPixel(*image,q,&pixel);
+ if (IsFuzzyEquivalencePixelInfo(&pixel,&target))
SetPixelAlpha(*image,(Quantum) StringToLong(matte),q);
q+=GetPixelChannels(*image);
}
/*
Update matte information using floodfill algorithm.
*/
- (void) GetOneVirtualMagickPixel(*image,(ssize_t) x_offset,
- (ssize_t) y_offset,&target,exception);
+ (void) GetOneVirtualPixelInfo(*image,
+ GetPixelCacheVirtualMethod(*image),(ssize_t) x_offset,(ssize_t)
+ y_offset,&target,exception);
if (method == FillToBorderMethod)
{
target.red=(MagickRealType) ScaleShortToQuantum(
}
draw_info=CloneDrawInfo(resource_info->image_info,
(DrawInfo *) NULL);
- draw_info->fill.alpha=ClampToQuantum(InterpretLocaleValue(matte,
- (char **) NULL));
+ draw_info->fill.alpha=(MagickRealType) ClampToQuantum(
+ StringToDouble(matte,(char **) NULL));
channel_mask=SetPixelChannelMask(*image,AlphaChannel);
(void) FloodfillPaintImage(*image,draw_info,&target,(ssize_t)
x_offset,(ssize_t) y_offset,method == FloodfillMethod ?
MagickFalse : MagickTrue,exception);
- (void) SetPixelChannelMap(*image,channel_mask);
+ (void) SetPixelChannelMapMask(*image,channel_mask);
draw_info=DestroyDrawInfo(draw_info);
break;
}
%
% The format of the XPanImage method is:
%
-% void XPanImage(Display *display,XWindows *windows,XEvent *event)
+% void XPanImage(Display *display,XWindows *windows,XEvent *event,
+% ExceptionInfo *exception)
%
% A description of each parameter follows:
%
% o event: Specifies a pointer to a XEvent structure. If it is NULL,
% the entire image is refreshed.
%
+% o exception: return any errors or warnings in this structure.
+%
*/
-static void XPanImage(Display *display,XWindows *windows,XEvent *event)
+static void XPanImage(Display *display,XWindows *windows,XEvent *event,
+ ExceptionInfo *exception)
{
char
text[MaxTextExtent];
Wait for next event.
*/
if ((state & ExitState) == 0)
- XScreenEvent(display,windows,event);
+ XScreenEvent(display,windows,event,exception);
} while ((state & ExitState) == 0);
/*
Restore cursor.
% The format of the XPasteImage method is:
%
% MagickBooleanType XPasteImage(Display *display,
-% XResourceInfo *resource_info,XWindows *windows,Image *image)
+% XResourceInfo *resource_info,XWindows *windows,Image *image,
+% ExceptionInfo *exception)
%
% A description of each parameter follows:
%
%
% o image: the image; returned from ReadImage.
%
+% o exception: return any errors or warnings in this structure.
+%
*/
static MagickBooleanType XPasteImage(Display *display,
- XResourceInfo *resource_info,XWindows *windows,Image *image)
+ XResourceInfo *resource_info,XWindows *windows,Image *image,
+ ExceptionInfo *exception)
{
static const char
*PasteMenu[] =
*/
if (resource_info->copy_image == (Image *) NULL)
return(MagickFalse);
- paste_image=CloneImage(resource_info->copy_image,0,0,MagickTrue,
- &image->exception);
+ paste_image=CloneImage(resource_info->copy_image,0,0,MagickTrue,exception);
/*
Map Command widget.
*/
/*
Wait for next event.
*/
- XScreenEvent(display,windows,&event);
+ XScreenEvent(display,windows,&event,exception);
XHighlightRectangle(display,windows->image.id,
windows->image.highlight_context,&highlight_info);
if (event.xany.window == windows->command.id)
/*
Paste image with X Image window.
*/
- (void) CompositeImage(image,compose,paste_image,paste_info.x,paste_info.y);
+ (void) CompositeImage(image,paste_image,compose,MagickTrue,paste_info.x,
+ paste_info.y,exception);
paste_image=DestroyImage(paste_image);
XSetCursorState(display,windows,MagickFalse);
/*
Update image colormap.
*/
- XConfigureImageColormap(display,resource_info,windows,image);
- (void) XConfigureImage(display,resource_info,windows,image);
+ XConfigureImageColormap(display,resource_info,windows,image,exception);
+ (void) XConfigureImage(display,resource_info,windows,image,exception);
return(MagickTrue);
}
\f
% The format of the XPrintImage method is:
%
% MagickBooleanType XPrintImage(Display *display,
-% XResourceInfo *resource_info,XWindows *windows,Image *image)
+% XResourceInfo *resource_info,XWindows *windows,Image *image,
+% ExceptionInfo *exception)
%
% A description of each parameter follows:
%
%
% o image: the image.
%
+% o exception: return any errors or warnings in this structure.
+%
*/
static MagickBooleanType XPrintImage(Display *display,
- XResourceInfo *resource_info,XWindows *windows,Image *image)
+ XResourceInfo *resource_info,XWindows *windows,Image *image,
+ ExceptionInfo *exception)
{
char
filename[MaxTextExtent],
*/
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
- print_image=CloneImage(image,0,0,MagickTrue,&image->exception);
+ print_image=CloneImage(image,0,0,MagickTrue,exception);
if (print_image == (Image *) NULL)
return(MagickFalse);
(void) FormatLocaleString(geometry,MaxTextExtent,"%dx%d!",
windows->image.ximage->width,windows->image.ximage->height);
- (void) TransformImage(&print_image,windows->image.crop_geometry,geometry);
+ (void) TransformImage(&print_image,windows->image.crop_geometry,geometry,
+ exception);
/*
Print image.
*/
(void) AcquireUniqueFilename(filename);
(void) FormatLocaleString(print_image->filename,MaxTextExtent,"print:%s",
filename);
- status=WriteImage(image_info,print_image);
+ status=WriteImage(image_info,print_image,exception);
(void) RelinquishUniqueFileResource(filename);
print_image=DestroyImage(print_image);
image_info=DestroyImageInfo(image_info);
% The format of the XROIImage method is:
%
% MagickBooleanType XROIImage(Display *display,
-% XResourceInfo *resource_info,XWindows *windows,Image **image)
+% XResourceInfo *resource_info,XWindows *windows,Image **image,
+% ExceptionInfo *exception)
%
% A description of each parameter follows:
%
%
% o image: the image; returned from ReadImage.
%
+% o exception: return any errors or warnings in this structure.
+%
*/
static MagickBooleanType XROIImage(Display *display,
- XResourceInfo *resource_info,XWindows *windows,Image **image)
+ XResourceInfo *resource_info,XWindows *windows,Image **image,
+ ExceptionInfo *exception)
{
#define ApplyMenus 7
/*
Wait for next event.
*/
- XScreenEvent(display,windows,&event);
+ XScreenEvent(display,windows,&event,exception);
if (event.xany.window == windows->command.id)
{
/*
/*
Wait for next event.
*/
- XScreenEvent(display,windows,&event);
+ XScreenEvent(display,windows,&event,exception);
if ((highlight_info.width > 3) && (highlight_info.height > 3))
XHighlightRectangle(display,windows->image.id,
windows->image.highlight_context,&highlight_info);
case RedoCommand:
{
(void) XMagickCommand(display,resource_info,windows,command_type,
- image);
+ image,exception);
break;
}
default:
crop_info.y=(ssize_t) (scale_factor*crop_info.y+0.5);
crop_info.height=(unsigned int)
(scale_factor*crop_info.height+0.5);
- roi_image=CropImage(*image,&crop_info,&(*image)->exception);
+ roi_image=CropImage(*image,&crop_info,exception);
(void) SetImageProgressMonitor(*image,progress_monitor,
(*image)->client_data);
if (roi_image == (Image *) NULL)
*/
windows->image.orphan=MagickTrue;
(void) XMagickCommand(display,resource_info,windows,command_type,
- &roi_image);
+ &roi_image,exception);
progress_monitor=SetImageProgressMonitor(*image,
(MagickProgressMonitor) NULL,(*image)->client_data);
(void) XMagickCommand(display,resource_info,windows,
- SaveToUndoBufferCommand,image);
+ SaveToUndoBufferCommand,image,exception);
windows->image.orphan=MagickFalse;
- (void) CompositeImage(*image,CopyCompositeOp,roi_image,
- crop_info.x,crop_info.y);
+ (void) CompositeImage(*image,roi_image,CopyCompositeOp,
+ MagickTrue,crop_info.x,crop_info.y,exception);
roi_image=DestroyImage(roi_image);
(void) SetImageProgressMonitor(*image,progress_monitor,
(*image)->client_data);
}
if (command_type != InfoCommand)
{
- XConfigureImageColormap(display,resource_info,windows,*image);
- (void) XConfigureImage(display,resource_info,windows,*image);
+ XConfigureImageColormap(display,resource_info,windows,*image,
+ exception);
+ (void) XConfigureImage(display,resource_info,windows,*image,
+ exception);
}
XCheckRefreshWindows(display,windows);
XInfoWidget(display,windows,text);
}
XHighlightRectangle(display,windows->image.id,
windows->image.highlight_context,&highlight_info);
- XScreenEvent(display,windows,&event);
+ XScreenEvent(display,windows,&event,exception);
if (event.xany.window == windows->command.id)
{
/*
default:
{
command_type=XImageWindowCommand(display,resource_info,windows,
- event.xkey.state,key_symbol,image);
+ event.xkey.state,key_symbol,image,exception);
if (command_type != NullCommand)
state|=UpdateRegionState;
break;
%
% MagickBooleanType XRotateImage(Display *display,
% XResourceInfo *resource_info,XWindows *windows,double degrees,
-% Image **image)
+% Image **image,ExceptionInfo *exception)
%
% A description of each parameter follows:
%
%
% o image: the image.
%
+% o exception: return any errors or warnings in this structure.
+%
*/
static MagickBooleanType XRotateImage(Display *display,
- XResourceInfo *resource_info,XWindows *windows,double degrees,Image **image)
+ XResourceInfo *resource_info,XWindows *windows,double degrees,Image **image,
+ ExceptionInfo *exception)
{
static const char
*RotateMenu[] =
/*
Wait for next event.
*/
- XScreenEvent(display,windows,&event);
+ XScreenEvent(display,windows,&event,exception);
XHighlightLine(display,windows->image.id,
windows->image.highlight_context,&rotate_info);
if (event.xany.window == windows->command.id)
/*
Wait for next event.
*/
- XScreenEvent(display,windows,&event);
+ XScreenEvent(display,windows,&event,exception);
if (distance > 9)
XHighlightLine(display,windows->image.id,
windows->image.highlight_context,&rotate_info);
for (rotations=0; normalized_degrees > 45.0; rotations++)
normalized_degrees-=90.0;
if (normalized_degrees != 0.0)
- (void) XMagickCommand(display,resource_info,windows,ApplyCommand,image);
+ (void) XMagickCommand(display,resource_info,windows,ApplyCommand,image,
+ exception);
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
- (*image)->background_color.red=ScaleShortToQuantum(
+ (*image)->background_color.red=(double) ScaleShortToQuantum(
windows->pixel_info->pen_colors[pen_id].red);
- (*image)->background_color.green=ScaleShortToQuantum(
+ (*image)->background_color.green=(double) ScaleShortToQuantum(
windows->pixel_info->pen_colors[pen_id].green);
- (*image)->background_color.blue=ScaleShortToQuantum(
+ (*image)->background_color.blue=(double) ScaleShortToQuantum(
windows->pixel_info->pen_colors[pen_id].blue);
- rotate_image=RotateImage(*image,degrees,&(*image)->exception);
+ rotate_image=RotateImage(*image,degrees,exception);
XSetCursorState(display,windows,MagickFalse);
if (rotate_image == (Image *) NULL)
return(MagickFalse);
windows->image.window_changes.width=(int) width;
windows->image.window_changes.height=(int) height;
}
- XConfigureImageColormap(display,resource_info,windows,*image);
+ XConfigureImageColormap(display,resource_info,windows,*image,exception);
}
else
if (((rotations % 4) == 1) || ((rotations % 4) == 3))
/*
Update image configuration.
*/
- (void) XConfigureImage(display,resource_info,windows,*image);
+ (void) XConfigureImage(display,resource_info,windows,*image,exception);
return(MagickTrue);
}
\f
% The format of the XSaveImage method is:
%
% MagickBooleanType XSaveImage(Display *display,
-% XResourceInfo *resource_info,XWindows *windows,Image *image)
+% XResourceInfo *resource_info,XWindows *windows,Image *image,
+% ExceptionInfo *exception)
%
% A description of each parameter follows:
%
%
% o image: the image.
%
+% o exception: return any errors or warnings in this structure.
+%
*/
static MagickBooleanType XSaveImage(Display *display,
- XResourceInfo *resource_info,XWindows *windows,Image *image)
+ XResourceInfo *resource_info,XWindows *windows,Image *image,
+ ExceptionInfo *exception)
{
char
filename[MaxTextExtent],
GetPathComponent(image->filename,HeadPath,path);
GetPathComponent(image->filename,TailPath,filename);
- status=chdir(path);
- if (status == -1)
- (void) ThrowMagickException(&image->exception,GetMagickModule(),
- FileOpenError,"UnableToOpenFile","%s",path);
+ if (*path != '\0')
+ {
+ status=chdir(path);
+ if (status == -1)
+ (void) ThrowMagickException(exception,GetMagickModule(),
+ FileOpenError,"UnableToOpenFile","%s",path);
+ }
}
XFileBrowserWidget(display,windows,"Save",filename);
if (*filename == '\0')
}
image_info=CloneImageInfo(resource_info->image_info);
(void) CopyMagickString(image_info->filename,filename,MaxTextExtent);
- (void) SetImageInfo(image_info,1,&image->exception);
+ (void) SetImageInfo(image_info,1,exception);
if ((LocaleCompare(image_info->magick,"JPEG") == 0) ||
(LocaleCompare(image_info->magick,"JPG") == 0))
{
*/
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
- save_image=CloneImage(image,0,0,MagickTrue,&image->exception);
+ save_image=CloneImage(image,0,0,MagickTrue,exception);
if (save_image == (Image *) NULL)
return(MagickFalse);
(void) FormatLocaleString(geometry,MaxTextExtent,"%dx%d!",
windows->image.ximage->width,windows->image.ximage->height);
- (void) TransformImage(&save_image,windows->image.crop_geometry,geometry);
+ (void) TransformImage(&save_image,windows->image.crop_geometry,geometry,
+ exception);
/*
Write image.
*/
(void) CopyMagickString(save_image->filename,filename,MaxTextExtent);
- status=WriteImage(image_info,save_image);
+ status=WriteImage(image_info,save_image,exception);
if (status != MagickFalse)
image->taint=MagickFalse;
save_image=DestroyImage(save_image);
%
% The format of the XScreenEvent function is:
%
-% void XScreenEvent(Display *display,XWindows *windows,XEvent *event)
+% void XScreenEvent(Display *display,XWindows *windows,XEvent *event,
+% ExceptionInfo *exception)
%
% A description of each parameter follows:
%
%
% o event: Specifies a pointer to a X11 XEvent structure.
%
+% o exception: return any errors or warnings in this structure.
%
*/
}
#endif
-static void XScreenEvent(Display *display,XWindows *windows,XEvent *event)
+static void XScreenEvent(Display *display,XWindows *windows,XEvent *event,
+ ExceptionInfo *exception)
{
register int
x,
}
if (event->xbutton.window == windows->pan.id)
{
- XPanImage(display,windows,event);
+ XPanImage(display,windows,event,exception);
break;
}
if (event->xbutton.window == windows->image.id)
windows->magnify.y=windows->image.y+y;
if (windows->magnify.mapped == MagickFalse)
(void) XMapRaised(display,windows->magnify.id);
- XMakeMagnifyImage(display,windows);
+ XMakeMagnifyImage(display,windows,exception);
if (event->type == ButtonRelease)
(void) XWithdrawWindow(display,windows->info.id,
windows->info.screen);
&window_changes);
break;
}
- XMakeMagnifyImage(display,windows);
+ XMakeMagnifyImage(display,windows,exception);
break;
}
break;
if (event->xexpose.window == windows->magnify.id)
if (event->xexpose.count == 0)
{
- XMakeMagnifyImage(display,windows);
+ XMakeMagnifyImage(display,windows,exception);
break;
}
break;
*/
(void) XLookupString((XKeyEvent *) &event->xkey,command,(int)
sizeof(command),&key_symbol,(XComposeStatus *) NULL);
- XMagnifyWindowCommand(display,windows,event->xkey.state,key_symbol);
+ XMagnifyWindowCommand(display,windows,event->xkey.state,key_symbol,
+ exception);
break;
}
case MapNotify:
if (y >= (int) windows->image.height)
y=(int) (windows->image.height-1);
windows->magnify.y=windows->image.y+y;
- XMakeMagnifyImage(display,windows);
+ XMakeMagnifyImage(display,windows,exception);
}
break;
}
% The format of the XTileImage method is:
%
% Image *XTileImage(Display *display,XResourceInfo *resource_info,
-% XWindows *windows,Image *image,XEvent *event)
+% XWindows *windows,Image *image,XEvent *event,ExceptionInfo *exception)
%
% A description of each parameter follows:
%
% o event: Specifies a pointer to a XEvent structure. If it is NULL,
% the entire image is refreshed.
%
+% o exception: return any errors or warnings in this structure.
+%
*/
static Image *XTileImage(Display *display,XResourceInfo *resource_info,
- XWindows *windows,Image *image,XEvent *event)
+ XWindows *windows,Image *image,XEvent *event,ExceptionInfo *exception)
{
static const char
*VerbMenu[] =
MaxTextExtent);
(void) CopyMagickString(resource_info->image_info->filename,filename,
MaxTextExtent);
- tile_image=ReadImage(resource_info->image_info,&image->exception);
- CatchException(&image->exception);
+ tile_image=ReadImage(resource_info->image_info,exception);
+ CatchException(exception);
(void) XWithdrawWindow(display,windows->info.id,windows->info.screen);
break;
}
status=XConfirmWidget(display,windows,"Really delete tile",filename);
if (status <= 0)
break;
- status=remove(filename) != 0 ? MagickTrue : MagickFalse;
+ status=remove_utf8(filename) != 0 ? MagickTrue : MagickFalse;
if (status != MagickFalse)
{
XNoticeWidget(display,windows,"Unable to delete image file:",
}
case TileUpdateCommand:
{
- ExceptionInfo
- *exception;
-
int
x_offset,
y_offset;
- PixelPacket
+ PixelInfo
pixel;
register int
Ensure all the images exist.
*/
tile=0;
+ GetPixelInfo(image,&pixel);
for (p=image->directory; *p != '\0'; p++)
{
CacheView
*/
x_offset=(int) (width*(tile % (((int) image->columns-x)/width))+x);
y_offset=(int) (height*(tile/(((int) image->columns-x)/width))+y);
- exception=(&image->exception);
image_view=AcquireCacheView(image);
- (void) GetOneCacheViewVirtualPixel(image_view,0,0,&pixel,exception);
+ (void) GetOneCacheViewVirtualPixelInfo(image_view,0,0,&pixel,exception);
for (i=0; i < (int) height; i++)
{
s=GetCacheViewAuthenticPixels(image_view,(ssize_t) x_offset,(ssize_t)
break;
for (j=0; j < (int) width; j++)
{
- SetPixelPacket(image,&pixel,s);
+ SetPixelInfoPixel(image,&pixel,s);
s+=GetPixelChannels(image);
}
if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
}
windows->image.window_changes.width=(int) image->columns;
windows->image.window_changes.height=(int) image->rows;
- XConfigureImageColormap(display,resource_info,windows,image);
- (void) XConfigureImage(display,resource_info,windows,image);
+ XConfigureImageColormap(display,resource_info,windows,image,exception);
+ (void) XConfigureImage(display,resource_info,windows,image,exception);
break;
}
default:
% The format of the XTrimImage method is:
%
% MagickBooleanType XTrimImage(Display *display,
-% XResourceInfo *resource_info,XWindows *windows,Image *image)
+% XResourceInfo *resource_info,XWindows *windows,Image *image,
+% ExceptionInfo *exception)
%
% A description of each parameter follows:
%
%
% o image: the image.
%
+% o exception: return any errors or warnings in this structure.
+%
*/
static MagickBooleanType XTrimImage(Display *display,
- XResourceInfo *resource_info,XWindows *windows,Image *image)
+ XResourceInfo *resource_info,XWindows *windows,Image *image,
+ ExceptionInfo *exception)
{
RectangleInfo
trim_info;
XSetCropGeometry(display,windows,&trim_info,image);
windows->image.window_changes.width=(int) trim_info.width;
windows->image.window_changes.height=(int) trim_info.height;
- (void) XConfigureImage(display,resource_info,windows,image);
+ (void) XConfigureImage(display,resource_info,windows,image,exception);
}
XSetCursorState(display,windows,MagickFalse);
return(MagickTrue);
% The format of the XVisualDirectoryImage method is:
%
% Image *XVisualDirectoryImage(Display *display,
-% XResourceInfo *resource_info,XWindows *windows)
+% XResourceInfo *resource_info,XWindows *windows,
+% ExceptionInfo *exception)
%
% A description of each parameter follows:
%
-% o nexus: Method XVisualDirectoryImage returns a visual image
-% directory if it can be created successfully. Otherwise a null image
-% is returned.
-%
% o display: Specifies a connection to an X server; returned from
% XOpenDisplay.
%
%
% o windows: Specifies a pointer to a XWindows structure.
%
+% o exception: return any errors or warnings in this structure.
+%
*/
static Image *XVisualDirectoryImage(Display *display,
- XResourceInfo *resource_info,XWindows *windows)
+ XResourceInfo *resource_info,XWindows *windows,ExceptionInfo *exception)
{
#define TileImageTag "Scale/Image"
#define XClientName "montage"
char
**filelist;
- ExceptionInfo
- *exception;
-
Image
*images,
*montage_image,
(void) SetImageInfoProgressMonitor(read_info,(MagickProgressMonitor) NULL,
(void *) NULL);
images=NewImageList();
- exception=AcquireExceptionInfo();
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
for (i=0; i < (int) number_files; i++)
{
(void) DeleteImageProperty(next_image,"label");
(void) SetImageProperty(next_image,"label",InterpretImageProperties(
- read_info,next_image,DefaultTileLabel));
+ read_info,next_image,DefaultTileLabel,exception),exception);
(void) ParseRegionGeometry(next_image,read_info->size,&geometry,
exception);
thumbnail_image=ThumbnailImage(next_image,geometry.width,
if (backdrop)
{
(void) XDisplayBackgroundImage(display,&background_resources,
- next_image);
+ next_image,exception);
XSetCursorState(display,windows,MagickTrue);
}
AppendImageToList(&images,next_image);
}
}
}
- exception=DestroyExceptionInfo(exception);
filelist=(char **) RelinquishMagickMemory(filelist);
if (images == (Image *) NULL)
{
(void) CloneString(&montage_info->font,resource_info->font);
(void) CopyMagickString(montage_info->filename,filename,MaxTextExtent);
montage_image=MontageImageList(read_info,montage_info,GetFirstImageInList(
- images),&images->exception);
+ images),exception);
images=DestroyImageList(images);
montage_info=DestroyMontageInfo(montage_info);
read_info=DestroyImageInfo(read_info);
% The format of the XDisplayBackgroundImage method is:
%
% MagickBooleanType XDisplayBackgroundImage(Display *display,
-% XResourceInfo *resource_info,Image *image)
+% XResourceInfo *resource_info,Image *image,ExceptionInfo *exception)
%
% A description of each parameter follows:
%
%
% o image: the image.
%
+% o exception: return any errors or warnings in this structure.
+%
*/
MagickExport MagickBooleanType XDisplayBackgroundImage(Display *display,
- XResourceInfo *resource_info,Image *image)
+ XResourceInfo *resource_info,Image *image,ExceptionInfo *exception)
{
char
geometry[MaxTextExtent],
Initialize Standard Colormap.
*/
resources.colormap=SharedColormap;
- XMakeStandardColormap(display,visual_info,&resources,image,map_info,&pixel);
+ XMakeStandardColormap(display,visual_info,&resources,image,map_info,&pixel,
+ exception);
/*
Graphic context superclass.
*/
window_info.x=(int) geometry_info.x;
window_info.y=(int) geometry_info.y;
status=XMakeImage(display,&resources,&window_info,image,window_info.width,
- window_info.height);
+ window_info.height,exception);
if (status == MagickFalse)
ThrowXWindowFatalException(XServerFatalError,"UnableToCreateXImage",
image->filename);
% The format of the XDisplayImage method is:
%
% Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
-% char **argv,int argc,Image **image,size_t *state)
+% char **argv,int argc,Image **image,size_t *state,
+% ExceptionInfo *exception)
%
% A description of each parameter follows:
%
%
% o image: Specifies an address to an address of an Image structure;
%
+% o exception: return any errors or warnings in this structure.
+%
*/
MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
- char **argv,int argc,Image **image,size_t *state)
+ char **argv,int argc,Image **image,size_t *state,ExceptionInfo *exception)
{
#define MagnifySize 256 /* must be a power of 2 */
#define MagickMenus 10
status=chdir(working_directory);
if (status == -1)
- (void) ThrowMagickException(&(*image)->exception,GetMagickModule(),
- FileOpenError,"UnableToOpenFile","%s",working_directory);
+ (void) ThrowMagickException(exception,GetMagickModule(),FileOpenError,
+ "UnableToOpenFile","%s",working_directory);
warning_handler=resource_info->display_warnings ?
SetErrorHandler(XWarning) : SetErrorHandler((ErrorHandler) NULL);
warning_handler=resource_info->display_warnings ?
display_image->magick);
}
XMakeStandardColormap(display,visual_info,resource_info,display_image,
- map_info,pixel);
+ map_info,pixel,exception);
display_image->taint=MagickFalse;
/*
Initialize graphic context.
*title;
title=InterpretImageProperties(resource_info->image_info,display_image,
- resource_info->title);
+ resource_info->title,exception);
(void) CopyMagickString(windows->image.name,title,MaxTextExtent);
(void) CopyMagickString(windows->image.icon_name,title,MaxTextExtent);
title=DestroyString(title);
Window name is the base of the filename.
*/
GetPathComponent(display_image->magick_filename,TailPath,filename);
- if (GetImageListLength(display_image) == 1)
+ if (display_image->scene == 0)
(void) FormatLocaleString(windows->image.name,MaxTextExtent,
"%s: %s",MagickPackageName,filename);
else
ThrowXWindowFatalException(XServerFatalError,"UnableToCreateXImage",
display_image->filename);
status=XMakeImage(display,resource_info,&windows->image,display_image,
- width,height);
+ width,height,exception);
if (status == MagickFalse)
ThrowXWindowFatalException(XServerFatalError,"UnableToCreateXImage",
display_image->filename);
status=XMakeImage(display,resource_info,&windows->magnify,(Image *) NULL,
- windows->magnify.width,windows->magnify.height);
+ windows->magnify.width,windows->magnify.height,exception);
if (status == MagickFalse)
ThrowXWindowFatalException(XServerFatalError,"UnableToCreateXImage",
display_image->filename);
(void) XMapRaised(display,windows->pan.id);
windows->image.window_changes.width=(int) display_image->columns;
windows->image.window_changes.height=(int) display_image->rows;
- (void) XConfigureImage(display,resource_info,windows,display_image);
+ (void) XConfigureImage(display,resource_info,windows,display_image,exception);
(void) XWithdrawWindow(display,windows->info.id,windows->info.screen);
(void) XSync(display,MagickFalse);
/*
resource_info->image_info->filename,MaxTextExtent,
"%s:%s",display_image->magick,
display_image->filename);
- nexus=ReadImage(resource_info->image_info,
- &display_image->exception);
+ nexus=ReadImage(resource_info->image_info,exception);
if (nexus != (Image *) NULL)
{
nexus=DestroyImage(nexus);
}
if (command_type != NullCommand)
nexus=XMagickCommand(display,resource_info,windows,command_type,
- &display_image);
+ &display_image,exception);
continue;
}
switch (event.type)
command);
if (entry >= 0)
nexus=XMagickCommand(display,resource_info,windows,
- VirtualCommands[entry],&display_image);
+ VirtualCommands[entry],&display_image,exception);
break;
}
/*
User pressed the image magnify button.
*/
(void) XMagickCommand(display,resource_info,windows,ZoomCommand,
- &display_image);
- XMagnifyImage(display,windows,&event);
+ &display_image,exception);
+ XMagnifyImage(display,windows,&event,exception);
break;
}
case Button3:
command);
if (entry >= 0)
nexus=XMagickCommand(display,resource_info,windows,
- VirtualCommands[entry],&display_image);
+ VirtualCommands[entry],&display_image,exception);
break;
}
if (display_image->montage != (char *) NULL)
Open or delete a tile from a visual image directory.
*/
nexus=XTileImage(display,resource_info,windows,
- display_image,&event);
+ display_image,&event,exception);
if (nexus != (Image *) NULL)
*state|=MontageImageState | NextImageState | ExitState;
vid_info.x=(short int) windows->image.x;
command);
if (entry >= 0)
nexus=XMagickCommand(display,resource_info,windows,
- ShortCutsCommands[entry],&display_image);
+ ShortCutsCommands[entry],&display_image,exception);
break;
}
case Button4:
*/
factor=XMenuWidget(display,windows,"Magnify",MagnifyMenu,command);
if (factor >= 0)
- XMagnifyWindowCommand(display,windows,0,MagnifyCommands[factor]);
+ XMagnifyWindowCommand(display,windows,0,MagnifyCommands[factor],
+ exception);
break;
}
if (event.xbutton.window == windows->pan.id)
}
default:
{
- XPanImage(display,windows,&event);
+ XPanImage(display,windows,&event,exception);
break;
}
}
(void) CopyMagickString(resource_info->image_info->filename,
((char *) data)+5,MaxTextExtent);
}
- nexus=ReadImage(resource_info->image_info,
- &display_image->exception);
- CatchException(&display_image->exception);
+ nexus=ReadImage(resource_info->image_info,exception);
+ CatchException(exception);
if (nexus != (Image *) NULL)
*state|=NextImageState | ExitState;
(void) XFree((void *) data);
windows->image.window_changes.width=windows->image.ximage->width;
windows->image.window_changes.height=windows->image.ximage->height;
(void) XConfigureImage(display,resource_info,windows,
- display_image);
+ display_image,exception);
}
break;
}
windows->image.window_changes.width=event.xconfigure.width;
windows->image.window_changes.height=event.xconfigure.height;
(void) XConfigureImage(display,resource_info,windows,
- display_image);
+ display_image,exception);
}
/*
Update pan window configuration.
(windows->magnify.stasis != MagickFalse))
{
status=XMakeImage(display,resource_info,&windows->magnify,
- display_image,windows->magnify.width,windows->magnify.height);
- XMakeMagnifyImage(display,windows);
+ display_image,windows->magnify.width,windows->magnify.height,
+ exception);
+ XMakeMagnifyImage(display,windows,exception);
}
break;
}
if ((event.xexpose.window == windows->magnify.id) &&
(windows->magnify.mapped != MagickFalse))
{
- XMakeMagnifyImage(display,windows);
+ XMakeMagnifyImage(display,windows,exception);
break;
}
if (event.xexpose.window == windows->pan.id)
if (event.xkey.window == windows->image.id)
{
command_type=XImageWindowCommand(display,resource_info,windows,
- event.xkey.state,key_symbol,&display_image);
+ event.xkey.state,key_symbol,&display_image,exception);
if (command_type != NullCommand)
nexus=XMagickCommand(display,resource_info,windows,command_type,
- &display_image);
+ &display_image,exception);
}
if (event.xkey.window == windows->magnify.id)
- XMagnifyWindowCommand(display,windows,event.xkey.state,key_symbol);
+ XMagnifyWindowCommand(display,windows,event.xkey.state,key_symbol,
+ exception);
if (event.xkey.window == windows->pan.id)
{
if ((key_symbol == XK_q) || (key_symbol == XK_Escape))
}
if (event.xmap.window == windows->magnify.id)
{
- XMakeMagnifyImage(display,windows);
+ XMakeMagnifyImage(display,windows,exception);
windows->magnify.mapped=MagickTrue;
(void) XWithdrawWindow(display,windows->info.id,
windows->info.screen);
}
if (event.xmap.window == windows->pan.id)
{
- XMakePanImage(display,resource_info,windows,display_image);
+ XMakePanImage(display,resource_info,windows,display_image,
+ exception);
windows->pan.mapped=MagickTrue;
break;
}
*/
taint=display_image->taint;
XMakeStandardColormap(display,icon_visual,icon_resources,
- display_image,icon_map,icon_pixel);
+ display_image,icon_map,icon_pixel,exception);
(void) XMakeImage(display,icon_resources,&windows->icon,
- display_image,windows->icon.width,windows->icon.height);
+ display_image,windows->icon.width,windows->icon.height,
+ exception);
display_image->taint=taint;
(void) XSetWindowBackgroundPixmap(display,windows->icon.id,
windows->icon.pixmap);
(void) CopyMagickString(resource_info->image_info->filename,
(char *) data,MaxTextExtent);
(void) XFree((void *) data);
- nexus=ReadImage(resource_info->image_info,&display_image->exception);
- CatchException(&display_image->exception);
+ nexus=ReadImage(resource_info->image_info,exception);
+ CatchException(exception);
if (nexus != (Image *) NULL)
*state|=NextImageState | ExitState;
break;
{
if (map_info->colormap == icon_map->colormap)
XConfigureImageColormap(display,resource_info,windows,
- display_image);
+ display_image,exception);
(void) XFreeStandardColormap(display,icon_visual,icon_map,
icon_pixel);
windows->icon.mapped=MagickFalse;
} while (!(*state & ExitState));
if ((*state & ExitState) == 0)
(void) XMagickCommand(display,resource_info,windows,FreeBuffersCommand,
- &display_image);
+ &display_image,exception);
else
if (resource_info->confirm_edit != MagickFalse)
{
else
if (status > 0)
(void) XMagickCommand(display,resource_info,windows,SaveCommand,
- &display_image);
+ &display_image,exception);
}
}
if ((windows->visual_info->klass == GrayScale) ||
status=chdir(resource_info->home_directory);
if (status == -1)
- (void) ThrowMagickException(&display_image->exception,GetMagickModule(),
- FileOpenError,"UnableToOpenFile","%s",resource_info->home_directory);
+ (void) ThrowMagickException(exception,GetMagickModule(),FileOpenError,
+ "UnableToOpenFile","%s",resource_info->home_directory);
}
*image=display_image;
return(nexus);
% The format of the DisplayImages method is:
%
% MagickBooleanType DisplayImages(const ImageInfo *image_info,
-% Image *images)
+% Image *images,ExceptionInfo *exception)
%
% A description of each parameter follows:
%
%
% o image: the image.
%
+% o exception: return any errors or warnings in this structure.
+%
*/
MagickExport MagickBooleanType DisplayImages(const ImageInfo *image_info,
- Image *image)
+ Image *image,ExceptionInfo *exception)
{
assert(image_info != (const ImageInfo *) NULL);
assert(image_info->signature == MagickSignature);
assert(image->signature == MagickSignature);
if (image->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
- (void) ThrowMagickException(&image->exception,GetMagickModule(),
- MissingDelegateError,"DelegateLibrarySupportNotBuiltIn","`%s' (X11)",
- image->filename);
+ (void) ThrowMagickException(exception,GetMagickModule(),MissingDelegateError,
+ "DelegateLibrarySupportNotBuiltIn","`%s' (X11)",image->filename);
return(MagickFalse);
}
\f