% Methods to Interactively Display and Edit an Image %
% %
% Software Design %
-% John Cristy %
+% Cristy %
% July 1992 %
% %
% %
-% Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2014 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 "MagickWand/MagickWand.h"
#include "MagickWand/mogrify-private.h"
#include "MagickCore/display-private.h"
+#include "MagickCore/nt-base-private.h"
#include "MagickCore/string-private.h"
+#include "MagickCore/xwindow-private.h"
\f
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
"-limit type value pixel cache resource limit",
"-loop iterations loop images then exit",
"-map type display image using this Standard Colormap",
+ "-matte store matte channel if the image has one",
"-monitor monitor progress",
"-page geometry size and location of an image canvas",
"-profile filename add, delete, or apply an image profile",
"-respect-parentheses settings remain in effect until parenthesis boundary",
"-sampling-factor geometry",
" horizontal and vertical sampling factor",
+ "-scenes range image scene range",
"-seed value seed a new sequence of pseudo-random numbers",
"-set property value set an image property",
"-size geometry width and height of image",
+ "-support factor resize support: > 1.0 is blurry, < 1.0 is sharp",
"-texture filename name of texture to tile onto the image background",
"-transparent-color color",
" transparent color",
(char *) NULL
};
- (void) printf("Version: %s\n",GetMagickVersion((size_t *) NULL));
- (void) printf("Copyright: %s\n",GetMagickCopyright());
- (void) printf("Features: %s\n\n",GetMagickFeatures());
+ ListMagickVersion(stdout);
(void) printf("Usage: %s [options ...] file [ [options ...] file ...]\n",
GetClientName());
(void) printf("\nImage Settings:\n");
"-borderwidth, -font, -foreground, -iconGeometry, -iconic, -mattecolor,\n");
(void) printf("-name, -shared-memory, -usePixmap, or -title.\n");
(void) printf(
- "\nBy default, the image format of `file' is determined by its magic\n");
+ "\nBy default, the image format of 'file' is determined by its magic\n");
(void) printf(
"number. To specify a particular image format, precede the filename\n");
(void) printf(
#define ThrowDisplayInvalidArgumentException(option,argument) \
{ \
(void) ThrowMagickException(exception,GetMagickModule(),OptionError, \
- "InvalidArgument","`%s': %s",option,argument); \
+ "InvalidArgument","'%s': %s",option,argument); \
DestroyDisplay(); \
return(MagickFalse); \
}
if ((LocaleCompare("version",option+1) == 0) ||
(LocaleCompare("-version",option+1) == 0))
{
- (void) FormatLocaleFile(stdout,"Version: %s\n",
- GetMagickVersion((size_t *) NULL));
- (void) FormatLocaleFile(stdout,"Copyright: %s\n",
- GetMagickCopyright());
- (void) FormatLocaleFile(stdout,"Features: %s\n\n",
- GetMagickFeatures());
+ ListMagickVersion(stdout);
return(MagickFalse);
}
}
image_info->quality=StringToUnsignedLong(resource_value);
resource_value=XGetResourceInstance(resource_database,GetClientName(),
"verbose","False");
- image_info->verbose=IsMagickTrue(resource_value);
+ image_info->verbose=IsStringTrue(resource_value);
resource_value=XGetResourceInstance(resource_database,GetClientName(),
"dither","True");
- quantize_info->dither=IsMagickTrue(resource_value);
+ quantize_info->dither_method=IsStringTrue(resource_value) != MagickFalse ?
+ RiemersmaDitherMethod : NoDitherMethod;
/*
Parse command line.
*/
c=getc(stdin);
if (c == EOF)
- break;
+ option="logo:";
else
{
c=ungetc(c,stdin);
Image
*display_image,
+ *image_list,
*images;
/*
iterations=0;
if (i == (ssize_t) (argc-1))
iterations=image->iterations;
- display_image=CloneImageList(image,exception);
- if (display_image == (Image *) NULL)
+ image_list=CloneImageList(image,exception);
+ if (image_list == (Image *) NULL)
ThrowDisplayException(ResourceLimitError,"MemoryAllocationFailed",
GetExceptionMessage(errno));
+ display_image=image_list;
do
{
/*
state|=RetainColorsState;
status=MagickFalse;
}
+ if (GetNextImageInList(display_image) == (Image *) NULL)
+ state|=ExitState;
}
else
do
*/
(void) CopyMagickString(display_image->filename,
resource_info.write_filename,MaxTextExtent);
- (void) SetImageInfo(image_info,1,&display_image->exception);
- status&=WriteImage(image_info,display_image,
- &display_image->exception);
- GetImageException(display_image,exception);
+ (void) SetImageInfo(image_info,1,exception);
+ status&=WriteImage(image_info,display_image,exception);
}
/*
Proceed to next/previous image.
if ((state & FormerImageState) != 0)
for (l=0; l < (ssize_t) resource_info.quantum; l++)
{
- display_image=GetPreviousImageInList(display_image);
- if (display_image == (Image *) NULL)
+ if (GetPreviousImageInList(display_image) == (Image *) NULL)
break;
+ display_image=GetPreviousImageInList(display_image);
}
else
for (l=0; l < (ssize_t) resource_info.quantum; l++)
{
- display_image=GetNextImageInList(display_image);
- if (display_image == (Image *) NULL)
+ if (GetNextImageInList(display_image) == (Image *) NULL)
break;
+ display_image=GetNextImageInList(display_image);
}
+ if (l < (ssize_t) resource_info.quantum)
+ break;
} while ((display_image != (Image *) NULL) && ((state & ExitState) == 0));
/*
Free image resources.
state|=ExitState;
if (LocaleCompare(filename,"-") == 0)
state|=ExitState;
+ RemoveAllImageStack();
continue;
}
pend=image != (Image *) NULL ? MagickTrue : MagickFalse;
i++;
if (i == (ssize_t) argc)
ThrowDisplayException(OptionError,"MissingArgument",option);
- type=ParseCommandOption(MagickAlphaOptions,MagickFalse,argv[i]);
+ type=ParseCommandOption(MagickAlphaChannelOptions,MagickFalse,argv[i]);
if (type < 0)
- ThrowDisplayException(OptionError,"UnrecognizedAlphaChannelType",
+ ThrowDisplayException(OptionError,"UnrecognizedAlphaChannelOption",
argv[i]);
break;
}
ssize_t
method;
- quantize_info->dither=MagickFalse;
+ quantize_info->dither_method=NoDitherMethod;
if (*option == '+')
break;
i++;
if (method < 0)
ThrowDisplayException(OptionError,"UnrecognizedDitherMethod",
argv[i]);
- quantize_info->dither=MagickTrue;
quantize_info->dither_method=(DitherMethod) method;
break;
}
i++;
if (i == (ssize_t) argc)
ThrowDisplayException(OptionError,"MissingArgument",option);
- value=InterpretLocaleValue(argv[i],&p);
+ value=StringToDouble(argv[i],&p);
(void) value;
if ((p == argv[i]) && (LocaleCompare("unlimited",argv[i]) != 0))
ThrowDisplayInvalidArgumentException(option,argv[i]);
if ((LocaleCompare("version",option+1) == 0) ||
(LocaleCompare("-version",option+1) == 0))
{
- (void) FormatLocaleFile(stdout,"Version: %s\n",
- GetMagickVersion((size_t *) NULL));
- (void) FormatLocaleFile(stdout,"Copyright: %s\n",
- GetMagickCopyright());
- (void) FormatLocaleFile(stdout,"Features: %s\n\n",
- GetMagickFeatures());
+ ListMagickVersion(stdout);
break;
}
if (LocaleCompare("visual",option+1) == 0)
i++;
if (i == (ssize_t) argc)
ThrowDisplayException(OptionError,"MissingArgument",option);
- if (InterpretLocaleValue(argv[i],(char **) NULL) != 0)
+ if (StringToDouble(argv[i],(char **) NULL) != 0)
resource_info.window_group=argv[i];
break;
}
(void) argc;
(void) argv;
(void) ThrowMagickException(exception,GetMagickModule(),MissingDelegateError,
- "DelegateLibrarySupportNotBuiltIn","`%s' (X11)",image_info->filename);
+ "DelegateLibrarySupportNotBuiltIn","'%s' (X11)",image_info->filename);
return(DisplayUsage());
#endif
}