Thread View: alt.sources.patches
1 messages
1 total messages
Started by Cristy
Thu, 12 Nov 1992 22:50
ImageMagick 2.1 - patch 01
Author: Cristy
Date: Thu, 12 Nov 1992 22:50
Date: Thu, 12 Nov 1992 22:50
1403 lines
54133 bytes
54133 bytes
To apply this patch:
cd to the top of the source tree (to the directory containing the
"ImageMagick" directory) and do:
patch -p -s < ThisFile
Patch will work silently unless an error occurs. If you want to watch
patch do its thing, leave out the "-s" argument to patch.
Finally, to rebuild after applying this patch, cd to the "ImageMagick"
directory and type:
make
Brief notes on what this patch fixes:
o Some compilers have read-only strings. ImageMagick no longer writes on
read-only strings.
o For colormapped X servers, the color reduction has been sped up by
trading image quality for processing time. See the README for details.
o Latin1Upper was declared wrong in X.h.
diff -c -r ImageMagick/README ImageMagick2.1.1/README
*** ImageMagick/README Thu Nov 12 16:53:35 1992
--- ImageMagick2.1.1/README Wed Nov 11 14:12:22 1992
***************
*** 106,127 ****
make Makefiles
make
! You can now display images in the JPEG or TIFF format. If you have a
! colormapped X server, the number of unique colors in a JPEG images
! must first be reduced to match the requirements of your server.
! ImageMagick tries to make the color reduced image closely resemble
! the original. However, this process can be time consuming. To speed
! it up, you can trade image quality for processing time. Type
! display -treedepth 5 image.jpeg
or add this to your X resources file:
! display.treedepth: 5
! Alternatively if you view the JPEG image frequently, reduce the
! number of colors to match the resolution of your X server once and
! write to a new image. Then display this new image. For example,
convert -colors 256 -dither image.jpeg image.miff
display image.miff
--- 106,131 ----
make Makefiles
make
! You can now display images in the JPEG or TIFF format.
! If you have a colormapped X server, the number of unique colors in an
! image must first be reduced to match the requirements of your server
! before it can be displayed. ImageMagick tries to make the color reduced
! image closely resemble the original. However, this process can be
! time consuming. To speed it up, ImageMagick trades image quality for
! processing time. For the "best" image possible, type
+ display -colors 256 image.jpeg
+
or add this to your X resources file:
! display.colors: 256
! This example assumes your server supports 256 colors. Choose
! whatever value is appropriate for your X server. Alternatively if
! you intend to view the image frequently, reduce the number of colors
! to match the resolution of your X server once and write to a new
! image. Then display this new image. For example,
convert -colors 256 -dither image.jpeg image.miff
display image.miff
***************
*** 233,239 ****
from LSBFirst to MSBFirst X server (or visa-versa) you may get the
error
! Illegal unit size: 8 found in routine: _normalizeimagebits
4. On occasion, a window manager (twm) may get in strange state which will
cause the display program to work improperly. Fix this by restarting the
--- 237,243 ----
from LSBFirst to MSBFirst X server (or visa-versa) you may get the
error
! Illegal unit size: 8 found in routine: _normalizeimagebits
4. On occasion, a window manager (twm) may get in strange state which will
cause the display program to work improperly. Fix this by restarting the
diff -c -r ImageMagick/X.c ImageMagick2.1.1/X.c
*** ImageMagick/X.c Thu Nov 12 16:54:11 1992
--- ImageMagick2.1.1/X.c Thu Nov 12 13:35:08 1992
***************
*** 105,118 ****
return(False);
(void) strncpy(keyword,boolean,Min(strlen(boolean)+1,MaxKeywordLength));
keyword[MaxKeywordLength]='\0';
! Latin1Lower(keyword);
! if (strcmp(keyword,"true") == 0)
return(True);
! if (strcmp(keyword,"on") == 0)
return(True);
! if (strcmp(keyword,"yes") == 0)
return(True);
! if (strcmp(keyword,"1") == 0)
return(True);
return(False);
}
--- 105,117 ----
return(False);
(void) strncpy(keyword,boolean,Min(strlen(boolean)+1,MaxKeywordLength));
keyword[MaxKeywordLength]='\0';
! if (strcasecmp(keyword,"true") == 0)
return(True);
! if (strcasecmp(keyword,"on") == 0)
return(True);
! if (strcasecmp(keyword,"yes") == 0)
return(True);
! if (strcasecmp(keyword,"1") == 0)
return(True);
return(False);
}
***************
*** 122,173 ****
% %
% %
% %
- % L a t i n 1 L o w e r %
- % %
- % %
- % %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %
- % Function Latin1Lower converts a string to lower-case Latin1.
- %
- % The format of the Latin1Lower routine is:
- %
- % Latin1Lower(string)
- %
- % A description of each parameter follows:
- %
- % o string: A pointer to the string to convert to lower-case Latin1.
- %
- %
- */
- void Latin1Lower(string)
- unsigned char
- *string;
- {
- unsigned char
- c;
-
- c=(*string);
- while (c != '\0')
- {
- if ((c >= XK_A) && (c <= XK_Z))
- *string=c+(XK_a-XK_A);
- else
- if ((c >= XK_agrave) && (c <= XK_odiaeresis))
- *string=c+(XK_agrave-XK_Agrave);
- else
- if ((c >= XK_Ooblique) && (c <= XK_thorn))
- *string=c+(XK_oslash-XK_Ooblique);
- string++;
- c=(*string);
- }
- }
-
- /*
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % %
- % %
- % %
% L a t i n 1 U p p e r %
% %
% %
--- 121,126 ----
***************
*** 187,198 ****
%
*/
void Latin1Upper(string)
! unsigned char
*string;
{
unsigned char
c;
!
c=(*string);
while (c != '\0')
{
--- 140,151 ----
%
*/
void Latin1Upper(string)
! char
*string;
{
unsigned char
c;
!
c=(*string);
while (c != '\0')
{
***************
*** 676,682 ****
root_window=XRootWindow(display,XDefaultScreen(display));
target_window=(Window) NULL;
if ((filename != (char *) NULL) && (*filename != '\0'))
! if (strcmp(filename,"root") == 0)
target_window=root_window;
else
{
--- 629,635 ----
root_window=XRootWindow(display,XDefaultScreen(display));
target_window=(Window) NULL;
if ((filename != (char *) NULL) && (*filename != '\0'))
! if (strcasecmp(filename,"root") == 0)
target_window=root_window;
else
{
***************
*** 1769,1812 ****
/*
Restrict visual search by class or visual id.
*/
! Latin1Lower(visual_type);
! if (strcmp("staticgray",visual_type) == 0)
{
visual_mask|=VisualClassMask;
visual_template.class=StaticGray;
}
else
! if (strcmp("grayscale",visual_type) == 0)
{
visual_mask|=VisualClassMask;
visual_template.class=GrayScale;
}
else
! if (strcmp("staticcolor",visual_type) == 0)
{
visual_mask|=VisualClassMask;
visual_template.class=StaticColor;
}
else
! if (strcmp("pseudocolor",visual_type) == 0)
{
visual_mask|=VisualClassMask;
visual_template.class=PseudoColor;
}
else
! if (strcmp("truecolor",visual_type) == 0)
{
visual_mask|=VisualClassMask;
visual_template.class=TrueColor;
}
else
! if (strcmp("directcolor",visual_type) == 0)
{
visual_mask|=VisualClassMask;
visual_template.class=DirectColor;
}
else
! if (strcmp("default",visual_type) == 0)
{
visual_mask|=VisualIDMask;
visual_template.visualid=XVisualIDFromVisual(
--- 1722,1764 ----
/*
Restrict visual search by class or visual id.
*/
! if (strcasecmp("staticgray",visual_type) == 0)
{
visual_mask|=VisualClassMask;
visual_template.class=StaticGray;
}
else
! if (strcasecmp("grayscale",visual_type) == 0)
{
visual_mask|=VisualClassMask;
visual_template.class=GrayScale;
}
else
! if (strcasecmp("staticcolor",visual_type) == 0)
{
visual_mask|=VisualClassMask;
visual_template.class=StaticColor;
}
else
! if (strcasecmp("pseudocolor",visual_type) == 0)
{
visual_mask|=VisualClassMask;
visual_template.class=PseudoColor;
}
else
! if (strcasecmp("truecolor",visual_type) == 0)
{
visual_mask|=VisualClassMask;
visual_template.class=TrueColor;
}
else
! if (strcasecmp("directcolor",visual_type) == 0)
{
visual_mask|=VisualClassMask;
visual_template.class=DirectColor;
}
else
! if (strcasecmp("default",visual_type) == 0)
{
visual_mask|=VisualIDMask;
visual_template.visualid=XVisualIDFromVisual(
***************
*** 2431,2439 ****
"BorderWidth","2");
resource_info->border_width=atoi(resource_value);
resource_value=XGetResource(resource_database,application_name,"colormap",
! (char *) NULL,"Colormap");
! Latin1Lower(resource_value);
! if (strncmp("private",resource_value,1) == 0)
resource_info->colormap=PrivateColormap;
else
resource_info->colormap=SharedColormap;
--- 2383,2390 ----
"BorderWidth","2");
resource_info->border_width=atoi(resource_value);
resource_value=XGetResource(resource_database,application_name,"colormap",
! (char *) NULL,"shared");
! if (strncasecmp("private",resource_value,1) == 0)
resource_info->colormap=PrivateColormap;
else
resource_info->colormap=SharedColormap;
***************
*** 2441,2458 ****
(char *) NULL,"0");
resource_info->number_colors=atoi(resource_value);
resource_value=XGetResource(resource_database,application_name,"colorspace",
! (char *) NULL,"Colorspace");
! Latin1Upper(resource_value);
! if (strncmp("GRAY",resource_value,3) == 0)
resource_info->colorspace=GRAYColorspace;
else
! if (strncmp("YIQ",resource_value,3) == 0)
resource_info->colorspace=YIQColorspace;
else
! if (strncmp("YUV",resource_value,3) == 0)
resource_info->colorspace=YUVColorspace;
else
! if (strncmp("XYZ",resource_value,3) == 0)
resource_info->colorspace=XYZColorspace;
else
resource_info->colorspace=RGBColorspace;
--- 2392,2408 ----
(char *) NULL,"0");
resource_info->number_colors=atoi(resource_value);
resource_value=XGetResource(resource_database,application_name,"colorspace",
! (char *) NULL,"RGB");
! if (strncasecmp("GRAY",resource_value,3) == 0)
resource_info->colorspace=GRAYColorspace;
else
! if (strncasecmp("YIQ",resource_value,3) == 0)
resource_info->colorspace=YIQColorspace;
else
! if (strncasecmp("YUV",resource_value,3) == 0)
resource_info->colorspace=YUVColorspace;
else
! if (strncasecmp("XYZ",resource_value,3) == 0)
resource_info->colorspace=XYZColorspace;
else
resource_info->colorspace=RGBColorspace;
***************
*** 2460,2466 ****
(char *) NULL,"False");
resource_info->debug=IsTrue(resource_value);
resource_value=XGetResource(resource_database,application_name,"delay",
! "Delay","0");
resource_info->delay=atoi(resource_value);
resource_value=XGetResource(resource_database,application_name,"dither",
(char *) NULL,"False");
--- 2410,2416 ----
(char *) NULL,"False");
resource_info->debug=IsTrue(resource_value);
resource_value=XGetResource(resource_database,application_name,"delay",
! (char *) NULL,"0");
resource_info->delay=atoi(resource_value);
resource_value=XGetResource(resource_database,application_name,"dither",
(char *) NULL,"False");
***************
*** 2523,2536 ****
resource_info->pen_color[8]=XGetResource(resource_database,application_name,
"pen9","Pen9","white");
resource_info->print_filename=XGetResource(resource_database,application_name,
! "printFilename","PrintFilename",(char *) NULL);
resource_info->title=XGetResource(resource_database,application_name,"title",
"Title",(char *) NULL);
resource_value=XGetResource(resource_database,application_name,"treeDepth",
! "TreeDepth","0");
resource_info->tree_depth=atoi(resource_value);
resource_info->write_filename=XGetResource(resource_database,application_name,
! "writeFilename","WriteFilename",(char *) NULL);
resource_info->visual_type=XGetResource(resource_database,application_name,
"visual","Visual",(char *) NULL);
}
--- 2473,2486 ----
resource_info->pen_color[8]=XGetResource(resource_database,application_name,
"pen9","Pen9","white");
resource_info->print_filename=XGetResource(resource_database,application_name,
! "printFilename",(char *) NULL,(char *) NULL);
resource_info->title=XGetResource(resource_database,application_name,"title",
"Title",(char *) NULL);
resource_value=XGetResource(resource_database,application_name,"treeDepth",
! (char *) NULL,"0");
resource_info->tree_depth=atoi(resource_value);
resource_info->write_filename=XGetResource(resource_database,application_name,
! "writeFilename",(char *) NULL,(char *) NULL);
resource_info->visual_type=XGetResource(resource_database,application_name,
"visual","Visual",(char *) NULL);
}
diff -c -r ImageMagick/X.h ImageMagick2.1.1/X.h
*** ImageMagick/X.h Thu Nov 12 16:54:06 1992
--- ImageMagick2.1.1/X.h Thu Nov 12 13:35:04 1992
***************
*** 244,250 ****
*XBestVisualInfo _Declare((Display *,char *,char *,XStandardColormap *));
extern void
- Latin1Lower _Declare((char *)),
Latin1Upper _Declare((char *)),
XBestIconSize _Declare((Display *,XWindowInfo *,Image *)),
XFreeStandardColormap _Declare((Display *,XVisualInfo *,XPixelInfo *,
--- 244,249 ----
diff -c -r ImageMagick/XWDFile.h ImageMagick2.1.1/XWDFile.h
*** ImageMagick/XWDFile.h Thu Nov 12 16:54:24 1992
--- ImageMagick2.1.1/XWDFile.h Thu Nov 12 13:34:59 1992
***************
*** 1,19 ****
- /* $XConsortium: XWDFile.h,v 1.14 91/01/06 12:18:26 rws Exp $ */
/* Copyright 1985, 1986, Massachusetts Institute of Technology */
/*
- Permission to use, copy, modify, distribute, and sell this software and its
- documentation for any purpose is hereby granted without fee, provided that
- the above copyright notice appear in all copies and that both that
- copyright notice and this permission notice appear in supporting
- documentation, and that the name of M.I.T. not be used in advertising or
- publicity pertaining to distribution of the software without specific,
- written prior permission. M.I.T. makes no representations about the
- suitability of this software for any purpose. It is provided "as is"
- without express or implied warranty.
- */
-
- /*
* XWDFile.h MIT Project Athena, X Window system window raster
* image dumper, dump file format header file.
*
--- 1,7 ----
/* Copyright 1985, 1986, Massachusetts Institute of Technology */
+ /* $XConsortium: XWDFile.h,v 1.12 89/10/08 16:33:57 rws Exp $ */
/*
* XWDFile.h MIT Project Athena, X Window system window raster
* image dumper, dump file format header file.
*
***************
*** 88,94 ****
#endif
} XWDFileHeader;
! typedef struct {
CARD32 pixel B32;
CARD16 red B16;
CARD16 green B16;
--- 76,82 ----
#endif
} XWDFileHeader;
! struct {
CARD32 pixel B32;
CARD16 red B16;
CARD16 green B16;
diff -c -r ImageMagick/XtoPS.c ImageMagick2.1.1/XtoPS.c
*** ImageMagick/XtoPS.c Thu Nov 12 16:53:35 1992
--- ImageMagick2.1.1/XtoPS.c Wed Nov 11 14:12:11 1992
***************
*** 464,470 ****
}
}
if (monochrome)
! QuantizeImage(image,2,8,False,GRAYColorspace,False);
(void) strcpy(image->filename,filename);
(void) PrintImage(image,image_geometry);
if (verbose)
--- 464,470 ----
}
}
if (monochrome)
! QuantizeImage(image,2,8,False,GRAYColorspace,True);
(void) strcpy(image->filename,filename);
(void) PrintImage(image,image_geometry);
if (verbose)
diff -c -r ImageMagick/alien.c ImageMagick2.1.1/alien.c
*** ImageMagick/alien.c Thu Nov 12 16:54:20 1992
--- ImageMagick2.1.1/alien.c Thu Nov 12 16:19:56 1992
***************
*** 3133,3139 ****
}
(void) free((void *) pixels);
if (samples_per_pixel == 1)
! QuantizeImage(image,(unsigned int) range,8,False,RGBColorspace,False);
}
else
{
--- 3133,3139 ----
}
(void) free((void *) pixels);
if (samples_per_pixel == 1)
! QuantizeImage(image,(unsigned int) range,8,False,RGBColorspace,True);
}
else
{
***************
*** 3368,3384 ****
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
! % Function ReadImage reads an image file and returns it. It allocates the
% memory necessary for the new Image structure and returns a pointer to the
% new image.
%
! % The format of the ReadImage routine is:
%
! % image=ReadImage(alien_info)
%
% A description of each parameter follows:
%
! % o image: Function ReadImage returns a pointer to the image after
% reading. A null image is returned if there is a a memory shortage or
% if the image cannot be read.
%
--- 3368,3384 ----
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
! % Function ReadXBMImage reads an image file and returns it. It allocates the
% memory necessary for the new Image structure and returns a pointer to the
% new image.
%
! % The format of the ReadXBMImage routine is:
%
! % image=ReadXBMImage(alien_info)
%
% A description of each parameter follows:
%
! % o image: Function ReadXBMImage returns a pointer to the image after
% reading. A null image is returned if there is a a memory shortage or
% if the image cannot be read.
%
***************
*** 4354,4360 ****
/*
Convert MIFF to monochrome.
*/
! QuantizeImage(image,2,8,False,GRAYColorspace,False);
(void) HuffmanEncodeImage(image);
CloseImage(image);
return(True);
--- 4354,4360 ----
/*
Convert MIFF to monochrome.
*/
! QuantizeImage(image,2,8,False,GRAYColorspace,True);
(void) HuffmanEncodeImage(image);
CloseImage(image);
return(True);
***************
*** 4415,4421 ****
GIF colormap must be 256 entries or less.
*/
if ((image->class == DirectClass) || (image->colors > 256))
! QuantizeImage(image,256,8,False,RGBColorspace,False);
for (bits_per_pixel=1; bits_per_pixel < 8; bits_per_pixel++)
if ((1 << bits_per_pixel) >= image->colors)
break;
--- 4415,4421 ----
GIF colormap must be 256 entries or less.
*/
if ((image->class == DirectClass) || (image->colors > 256))
! QuantizeImage(image,256,8,False,RGBColorspace,True);
for (bits_per_pixel=1; bits_per_pixel < 8; bits_per_pixel++)
if ((1 << bits_per_pixel) >= image->colors)
break;
***************
*** 5778,5784 ****
/*
Convert MIFF to X bitmap pixels.
*/
! QuantizeImage(image,2,8,False,GRAYColorspace,False);
p=image->pixels;
polarity=(Intensity(image->colormap[0]) >
Intensity(image->colormap[1]) ? 0 : 1);
--- 5778,5784 ----
/*
Convert MIFF to X bitmap pixels.
*/
! QuantizeImage(image,2,8,False,GRAYColorspace,True);
p=image->pixels;
polarity=(Intensity(image->colormap[0]) >
Intensity(image->colormap[1]) ? 0 : 1);
diff -c -r ImageMagick/animate.c ImageMagick2.1.1/animate.c
*** ImageMagick/animate.c Thu Nov 12 16:54:14 1992
--- ImageMagick2.1.1/animate.c Thu Nov 12 13:35:10 1992
***************
*** 1650,1660 ****
if (i == argc)
Error("missing type on -colormap",(char *) NULL);
option=argv[i];
! Latin1Lower(option);
! if (strncmp("private",option,1) == 0)
resource_info.colormap=PrivateColormap;
else
! if (strncmp("shared",option,1) == 0)
resource_info.colormap=SharedColormap;
else
Error("invalid colormap type on -colormap",option);
--- 1650,1659 ----
if (i == argc)
Error("missing type on -colormap",(char *) NULL);
option=argv[i];
! if (strncasecmp("private",option,1) == 0)
resource_info.colormap=PrivateColormap;
else
! if (strncasecmp("shared",option,1) == 0)
resource_info.colormap=SharedColormap;
else
Error("invalid colormap type on -colormap",option);
***************
*** 1682,1701 ****
if (i == argc)
Error("missing type on -colorspace",(char *) NULL);
option=argv[i];
! Latin1Upper(option);
! if (strncmp("GRAY",option,3) == 0)
resource_info.colorspace=GRAYColorspace;
else
! if (strncmp("RGB",option,3) == 0)
resource_info.colorspace=RGBColorspace;
else
! if (strncmp("YIQ",option,3) == 0)
resource_info.colorspace=YIQColorspace;
else
! if (strncmp("YUV",option,3) == 0)
resource_info.colorspace=YUVColorspace;
else
! if (strncmp("XYZ",option,3) == 0)
resource_info.colorspace=XYZColorspace;
else
Error("invalid colorspace type on -colorspace",
--- 1681,1699 ----
if (i == argc)
Error("missing type on -colorspace",(char *) NULL);
option=argv[i];
! if (strncasecmp("GRAY",option,3) == 0)
resource_info.colorspace=GRAYColorspace;
else
! if (strncasecmp("RGB",option,3) == 0)
resource_info.colorspace=RGBColorspace;
else
! if (strncasecmp("YIQ",option,3) == 0)
resource_info.colorspace=YIQColorspace;
else
! if (strncasecmp("YUV",option,3) == 0)
resource_info.colorspace=YUVColorspace;
else
! if (strncasecmp("XYZ",option,3) == 0)
resource_info.colorspace=XYZColorspace;
else
Error("invalid colorspace type on -colorspace",
diff -c -r ImageMagick/display.c ImageMagick2.1.1/display.c
*** ImageMagick/display.c Thu Nov 12 16:54:05 1992
--- ImageMagick2.1.1/display.c Thu Nov 12 13:35:03 1992
***************
*** 3413,3419 ****
Determine target window.
*/
target_window=(Window) NULL;
! if (strcmp(window_id,"root") == 0)
target_window=root_window;
else
{
--- 3413,3419 ----
Determine target window.
*/
target_window=(Window) NULL;
! if (strcasecmp(window_id,"root") == 0)
target_window=root_window;
else
{
***************
*** 4873,4880 ****
"ClipGeometry",(char *) NULL);
resource_value=XGetResource(resource_database,application_name,"compression",
(char *) NULL,"RunlengthEncoded");
! Latin1Lower(resource_value);
! if (strncmp("qencoded",resource_value,1) == 0)
compression=QEncodedCompression;
else
compression=RunlengthEncodedCompression;
--- 4873,4879 ----
"ClipGeometry",(char *) NULL);
resource_value=XGetResource(resource_database,application_name,"compression",
(char *) NULL,"RunlengthEncoded");
! if (strncasecmp("qencoded",resource_value,1) == 0)
compression=QEncodedCompression;
else
compression=RunlengthEncodedCompression;
***************
*** 4987,4997 ****
if (i == argc)
Error("missing type on -colormap",(char *) NULL);
option=argv[i];
! Latin1Lower(option);
! if (strncmp("private",option,1) == 0)
resource_info.colormap=PrivateColormap;
else
! if (strncmp("shared",option,1) == 0)
resource_info.colormap=SharedColormap;
else
Error("invalid colormap type on -colormap",option);
--- 4986,4995 ----
if (i == argc)
Error("missing type on -colormap",(char *) NULL);
option=argv[i];
! if (strncasecmp("private",option,1) == 0)
resource_info.colormap=PrivateColormap;
else
! if (strncasecmp("shared",option,1) == 0)
resource_info.colormap=SharedColormap;
else
Error("invalid colormap type on -colormap",option);
***************
*** 5019,5038 ****
if (i == argc)
Error("missing type on -colorspace",(char *) NULL);
option=argv[i];
! Latin1Upper(option);
! if (strncmp("GRAY",option,3) == 0)
resource_info.colorspace=GRAYColorspace;
else
! if (strncmp("RGB",option,3) == 0)
resource_info.colorspace=RGBColorspace;
else
! if (strncmp("YIQ",option,3) == 0)
resource_info.colorspace=YIQColorspace;
else
! if (strncmp("YUV",option,3) == 0)
resource_info.colorspace=YUVColorspace;
else
! if (strncmp("XYZ",option,3) == 0)
resource_info.colorspace=XYZColorspace;
else
Error("invalid colorspace type on -colorspace",
--- 5017,5035 ----
if (i == argc)
Error("missing type on -colorspace",(char *) NULL);
option=argv[i];
! if (strncasecmp("GRAY",option,3) == 0)
resource_info.colorspace=GRAYColorspace;
else
! if (strncasecmp("RGB",option,3) == 0)
resource_info.colorspace=RGBColorspace;
else
! if (strncasecmp("YIQ",option,3) == 0)
resource_info.colorspace=YIQColorspace;
else
! if (strncasecmp("YUV",option,3) == 0)
resource_info.colorspace=YUVColorspace;
else
! if (strncasecmp("XYZ",option,3) == 0)
resource_info.colorspace=XYZColorspace;
else
Error("invalid colorspace type on -colorspace",
***************
*** 5049,5059 ****
if (i == argc)
Error("missing type on -compress",(char *) NULL);
option=argv[i];
! Latin1Lower(option);
! if (strncmp("runlengthencoded",option,1) == 0)
compression=RunlengthEncodedCompression;
else
! if (strncmp("qencoded",option,1) == 0)
compression=QEncodedCompression;
else
Error("invalid compression type on -compress",option);
--- 5046,5055 ----
if (i == argc)
Error("missing type on -compress",(char *) NULL);
option=argv[i];
! if (strncasecmp("runlengthencoded",option,1) == 0)
compression=RunlengthEncodedCompression;
else
! if (strncasecmp("qencoded",option,1) == 0)
compression=QEncodedCompression;
else
Error("invalid compression type on -compress",option);
diff -c -r ImageMagick/image.c ImageMagick2.1.1/image.c
*** ImageMagick/image.c Thu Nov 12 16:53:51 1992
--- ImageMagick2.1.1/image.c Wed Nov 11 14:12:17 1992
***************
*** 4312,4321 ****
/*
Copy left image to red channel and right image to blue channel.
*/
! QuantizeImage(left_image,256,8,False,GRAYColorspace,False);
p=left_image->pixels;
left_image->runlength=p->length+1;
! QuantizeImage(right_image,256,8,False,GRAYColorspace,False);
q=right_image->pixels;
right_image->runlength=q->length+1;
r=stereo_image->pixels;
--- 4312,4321 ----
/*
Copy left image to red channel and right image to blue channel.
*/
! QuantizeImage(left_image,256,8,False,GRAYColorspace,True);
p=left_image->pixels;
left_image->runlength=p->length+1;
! QuantizeImage(right_image,256,8,False,GRAYColorspace,True);
q=right_image->pixels;
right_image->runlength=q->length+1;
r=stereo_image->pixels;
Common subdirectories: ImageMagick/images and ImageMagick2.1.1/images
diff -c -r ImageMagick/import.c ImageMagick2.1.1/import.c
*** ImageMagick/import.c Thu Nov 12 16:53:55 1992
--- ImageMagick2.1.1/import.c Wed Nov 11 14:12:12 1992
***************
*** 453,459 ****
exit(1);
image->scene=scene;
if (monochrome)
! QuantizeImage(image,2,8,False,GRAYColorspace,False);
if (compression != UnknownCompression)
image->compression=compression;
(void) strcpy(image->filename,filename);
--- 453,459 ----
exit(1);
image->scene=scene;
if (monochrome)
! QuantizeImage(image,2,8,False,GRAYColorspace,True);
if (compression != UnknownCompression)
image->compression=compression;
(void) strcpy(image->filename,filename);
diff -c -r ImageMagick/montage.c ImageMagick2.1.1/montage.c
*** ImageMagick/montage.c Thu Nov 12 16:54:16 1992
--- ImageMagick2.1.1/montage.c Thu Nov 12 13:35:11 1992
***************
*** 761,769 ****
clip_geometry=XGetResource(resource_database,application_name,
"clipGeometry","ClipGeometry",(char *) NULL);
resource_value=XGetResource(resource_database,application_name,
! "compression",(char *) NULL,"RunlengthEncodedCompression");
! Latin1Lower(resource_value);
! if (strncmp("qencoded",resource_value,1) == 0)
compression=QEncodedCompression;
else
compression=RunlengthEncodedCompression;
--- 761,768 ----
clip_geometry=XGetResource(resource_database,application_name,
"clipGeometry","ClipGeometry",(char *) NULL);
resource_value=XGetResource(resource_database,application_name,
! "compression",(char *) NULL,"RunlengthEncoded");
! if (strncasecmp("qencoded",resource_value,1) == 0)
compression=QEncodedCompression;
else
compression=RunlengthEncodedCompression;
***************
*** 885,904 ****
if (i == argc)
Error("missing type on -colorspace",(char *) NULL);
option=argv[i];
! Latin1Upper(option);
! if (strncmp("GRAY",option,3) == 0)
resource_info.colorspace=GRAYColorspace;
else
! if (strncmp("RGB",option,3) == 0)
resource_info.colorspace=RGBColorspace;
else
! if (strncmp("YIQ",option,3) == 0)
resource_info.colorspace=YIQColorspace;
else
! if (strncmp("YUV",option,3) == 0)
resource_info.colorspace=YUVColorspace;
else
! if (strncmp("XYZ",option,3) == 0)
resource_info.colorspace=XYZColorspace;
else
Error("invalid colorspace type on -colorspace",
--- 884,902 ----
if (i == argc)
Error("missing type on -colorspace",(char *) NULL);
option=argv[i];
! if (strncasecmp("GRAY",option,3) == 0)
resource_info.colorspace=GRAYColorspace;
else
! if (strncasecmp("RGB",option,3) == 0)
resource_info.colorspace=RGBColorspace;
else
! if (strncasecmp("YIQ",option,3) == 0)
resource_info.colorspace=YIQColorspace;
else
! if (strncasecmp("YUV",option,3) == 0)
resource_info.colorspace=YUVColorspace;
else
! if (strncasecmp("XYZ",option,3) == 0)
resource_info.colorspace=XYZColorspace;
else
Error("invalid colorspace type on -colorspace",
***************
*** 915,925 ****
if (i == argc)
Error("missing type on -compress",(char *) NULL);
option=argv[i];
! Latin1Lower(option);
! if (strncmp("runlengthencoded",option,1) == 0)
compression=RunlengthEncodedCompression;
else
! if (strncmp("qencoded",option,1) == 0)
compression=QEncodedCompression;
else
Error("invalid compression type on -compress",option);
--- 913,922 ----
if (i == argc)
Error("missing type on -compress",(char *) NULL);
option=argv[i];
! if (strncasecmp("runlengthencoded",option,1) == 0)
compression=RunlengthEncodedCompression;
else
! if (strncasecmp("qencoded",option,1) == 0)
compression=QEncodedCompression;
else
Error("invalid compression type on -compress",option);
diff -c -r ImageMagick/quantize.c ImageMagick2.1.1/quantize.c
*** ImageMagick/quantize.c Thu Nov 12 16:53:58 1992
--- ImageMagick2.1.1/quantize.c Wed Nov 11 14:12:13 1992
***************
*** 318,324 ****
%
% The format of the Assignment routine is:
%
! % Assignment(image,dither)
%
% A description of each parameter follows.
%
--- 318,324 ----
%
% The format of the Assignment routine is:
%
! % Assignment(image,dither,optimal)
%
% A description of each parameter follows.
%
***************
*** 335,347 ****
% Note, dithering is a computationally expensive process and will
% increase processing time significantly.
%
*/
! static void Assignment(image,dither)
Image
*image;
unsigned int
! dither;
{
register int
i;
--- 335,352 ----
% Note, dithering is a computationally expensive process and will
% increase processing time significantly.
%
+ % o optimal: An unsigned integer value greater than zero indicates that
+ % the optimal representation of the reference image should be returned.
+ %
+ %
*/
! static void Assignment(image,dither,optimal)
Image
*image;
unsigned int
! dither,
! optimal;
{
register int
i;
***************
*** 376,390 ****
cube.colors=0;
Colormap(cube.root);
image->colors=cube.colors;
if (dither)
dither=!DitherImage(image);
if (!dither)
! {
! /*
! Create a reduced color image. For the non-optimal case we trade
! accuracy for speed improvements.
! */
! p=image->pixels;
for (i=0; i < image->packets; i++)
{
/*
--- 381,395 ----
cube.colors=0;
Colormap(cube.root);
image->colors=cube.colors;
+ /*
+ Create a reduced color image. For the non-optimal case we trade
+ accuracy for speed improvements.
+ */
if (dither)
dither=!DitherImage(image);
+ p=image->pixels;
if (!dither)
! if (!optimal)
for (i=0; i < image->packets; i++)
{
/*
***************
*** 400,405 ****
--- 405,429 ----
node=node->child[id];
}
while (True);
+ p->index=(unsigned short) node->color_number;
+ p++;
+ }
+ else
+ for (i=0; i < image->packets; i++)
+ {
+ /*
+ Identify the deepest node containing the pixel's color.
+ */
+ node=cube.root;
+ do
+ {
+ id=(p->red > node->mid_red) | (p->green > node->mid_green) << 1 |
+ (p->blue > node->mid_blue) << 2;
+ if ((node->children & (1 << id)) == 0)
+ break;
+ node=node->child[id];
+ }
+ while (True);
if ((node->parent->children &~ (1 << node->id)) == 0)
index=node->color_number; /* only child */
else
***************
*** 417,423 ****
p->index=(unsigned short) index;
p++;
}
- }
}
/*
--- 441,446 ----
***************
*** 548,554 ****
node->total_blue+=p->blue*count;
p++;
}
- image->colors=cube.colors;
}
/*
--- 571,576 ----
***************
*** 965,971 ****
%
% The format of the InitializeCube routine is:
%
! % InitializeCube(number_colors,tree_depth,number_pixels)
%
% A description of each parameter follows.
%
--- 987,993 ----
%
% The format of the InitializeCube routine is:
%
! % InitializeCube(number_colors,tree_depth,number_pixels,optimal)
%
% A description of each parameter follows.
%
***************
*** 984,996 ****
%
% o number_pixels: Specifies the number of individual pixels in the image.
%
%
*/
! static void InitializeCube(number_colors,tree_depth,number_pixels)
unsigned int
number_colors,
tree_depth,
! number_pixels;
{
register int
i;
--- 1006,1021 ----
%
% o number_pixels: Specifies the number of individual pixels in the image.
%
+ % o optimal: An unsigned integer value greater than zero indicates that
+ % the optimal representation of the reference image should be returned.
%
*/
! static void InitializeCube(number_colors,tree_depth,number_pixels,optimal)
unsigned int
number_colors,
tree_depth,
! number_pixels,
! optimal;
{
register int
i;
***************
*** 1018,1023 ****
--- 1043,1050 ----
if (number_colors <= log4[i])
break;
cube.depth=i+3;
+ if (!optimal)
+ cube.depth--;
}
/*
Initialize the shift values.
***************
*** 1420,1426 ****
register RunlengthPacket
*p;
! register unsigned long int
blue_distance,
green_distance,
red_distance;
--- 1447,1453 ----
register RunlengthPacket
*p;
! register unsigned int
blue_distance,
green_distance,
red_distance;
***************
*** 1440,1448 ****
p=image->pixels;
for (i=0; i < image->packets; i++)
{
! red_distance=p->red-image->colormap[p->index].red+MaxRGB;
! green_distance=p->green-image->colormap[p->index].green+MaxRGB;
! blue_distance=p->blue-image->colormap[p->index].blue+MaxRGB;
distance=cube.squares[red_distance]+cube.squares[green_distance]+
cube.squares[blue_distance];
total_error+=(distance*(p->length+1));
--- 1467,1475 ----
p=image->pixels;
for (i=0; i < image->packets; i++)
{
! red_distance=(int) p->red-(int) image->colormap[p->index].red+MaxRGB;
! green_distance=(int) p->green-(int) image->colormap[p->index].green+MaxRGB;
! blue_distance=(int) p->blue-(int) image->colormap[p->index].blue+MaxRGB;
distance=cube.squares[red_distance]+cube.squares[green_distance]+
cube.squares[blue_distance];
total_error+=(distance*(p->length+1));
***************
*** 1546,1552 ****
*/
if (number_colors > MaxColormapSize)
number_colors=MaxColormapSize;
! InitializeCube(number_colors,tree_depth,image->columns*image->rows);
if ((image->compression == RunlengthEncodedCompression) &&
(image->packets == (image->columns*image->rows)))
CompressImage(image);
--- 1573,1579 ----
*/
if (number_colors > MaxColormapSize)
number_colors=MaxColormapSize;
! InitializeCube(number_colors,tree_depth,image->columns*image->rows,optimal);
if ((image->compression == RunlengthEncodedCompression) &&
(image->packets == (image->columns*image->rows)))
CompressImage(image);
***************
*** 1553,1561 ****
if (colorspace != RGBColorspace)
RGBTransformImage(image,colorspace);
Classification(image);
Reduction(number_colors);
! Assignment(image,(unsigned int) (dither || (!optimal &&
! (image->colors > (1 << (cube.depth+2))))));
if (colorspace != RGBColorspace)
TransformRGBImage(image,colorspace);
/*
--- 1580,1589 ----
if (colorspace != RGBColorspace)
RGBTransformImage(image,colorspace);
Classification(image);
+ if (!optimal)
+ dither|=cube.colors > (1 << (cube.depth+2));
Reduction(number_colors);
! Assignment(image,dither,optimal);
if (colorspace != RGBColorspace)
TransformRGBImage(image,colorspace);
/*
***************
*** 1654,1660 ****
/*
Reduce the number of colors in the continuous tone image sequence.
*/
! InitializeCube(number_colors,tree_depth,~0);
for (i=0; i < number_images; i++)
{
if ((images[i]->compression == RunlengthEncodedCompression) &&
--- 1682,1688 ----
/*
Reduce the number of colors in the continuous tone image sequence.
*/
! InitializeCube(number_colors,tree_depth,~0,optimal);
for (i=0; i < number_images; i++)
{
if ((images[i]->compression == RunlengthEncodedCompression) &&
***************
*** 1664,1674 ****
RGBTransformImage(images[i],colorspace);
Classification(images[i]);
}
Reduction(number_colors);
for (i=0; i < number_images; i++)
{
! Assignment(images[i],(unsigned int) (dither || (!optimal &&
! (images[i]->colors > (1 << (cube.depth+2))))));
if (colorspace != RGBColorspace)
TransformRGBImage(images[i],colorspace);
}
--- 1692,1703 ----
RGBTransformImage(images[i],colorspace);
Classification(images[i]);
}
+ if (!optimal)
+ dither|=cube.colors > (1 << (cube.depth+2));
Reduction(number_colors);
for (i=0; i < number_images; i++)
{
! Assignment(images[i],dither,optimal);
if (colorspace != RGBColorspace)
TransformRGBImage(images[i],colorspace);
}
Common subdirectories: ImageMagick/scenes and ImageMagick2.1.1/scenes
Common subdirectories: ImageMagick/utilities and ImageMagick2.1.1/utilities
Common subdirectories: ImageMagick/xtp and ImageMagick2.1.1/xtp
diff -c -r ImageMagick/utilities/convert.c ImageMagick2.1.1/utilities/convert.c
*** ImageMagick/utilities/convert.c Thu Nov 12 16:54:29 1992
--- ImageMagick2.1.1/utilities/convert.c Thu Nov 12 13:35:13 1992
***************
*** 294,313 ****
if (i == argc)
Error("missing type on -colorspace",(char *) NULL);
option=argv[i];
! Latin1Upper(option);
! if (strncmp("GRAY",option,3) == 0)
colorspace=GRAYColorspace;
else
! if (strncmp("RGB",option,3) == 0)
colorspace=RGBColorspace;
else
! if (strncmp("YIQ",option,3) == 0)
colorspace=YIQColorspace;
else
! if (strncmp("YUV",option,3) == 0)
colorspace=YUVColorspace;
else
! if (strncmp("XYZ",option,3) == 0)
colorspace=XYZColorspace;
else
Error("invalid colorspace type on -colorspace",
--- 294,312 ----
if (i == argc)
Error("missing type on -colorspace",(char *) NULL);
option=argv[i];
! if (strncasecmp("GRAY",option,3) == 0)
colorspace=GRAYColorspace;
else
! if (strncasecmp("RGB",option,3) == 0)
colorspace=RGBColorspace;
else
! if (strncasecmp("YIQ",option,3) == 0)
colorspace=YIQColorspace;
else
! if (strncasecmp("YUV",option,3) == 0)
colorspace=YUVColorspace;
else
! if (strncasecmp("XYZ",option,3) == 0)
colorspace=XYZColorspace;
else
Error("invalid colorspace type on -colorspace",
***************
*** 324,334 ****
if (i == argc)
Error("missing type on -compress",(char *) NULL);
option=argv[i];
! Latin1Lower(option);
! if (strncmp("runlengthencoded",option,1) == 0)
compression=RunlengthEncodedCompression;
else
! if (strncmp("qencoded",option,1) == 0)
compression=QEncodedCompression;
else
Error("invalid compression type on -compress",option);
--- 323,332 ----
if (i == argc)
Error("missing type on -compress",(char *) NULL);
option=argv[i];
! if (strncasecmp("runlengthencoded",option,1) == 0)
compression=RunlengthEncodedCompression;
else
! if (strncasecmp("qencoded",option,1) == 0)
compression=QEncodedCompression;
else
Error("invalid compression type on -compress",option);
diff -c -r ImageMagick/utilities/mogrify.c ImageMagick2.1.1/utilities/mogrify.c
*** ImageMagick/utilities/mogrify.c Thu Nov 12 16:54:27 1992
--- ImageMagick2.1.1/utilities/mogrify.c Thu Nov 12 13:35:14 1992
***************
*** 335,354 ****
if (i == argc)
Error("missing type on -colorspace",(char *) NULL);
option=argv[i];
! Latin1Upper(option);
! if (strncmp("GRAY",option,3) == 0)
colorspace=GRAYColorspace;
else
! if (strncmp("RGB",option,3) == 0)
colorspace=RGBColorspace;
else
! if (strncmp("YIQ",option,3) == 0)
colorspace=YIQColorspace;
else
! if (strncmp("YUV",option,3) == 0)
colorspace=YUVColorspace;
else
! if (strncmp("XYZ",option,3) == 0)
colorspace=XYZColorspace;
else
Error("invalid colorspace type on -colorspace",
--- 335,353 ----
if (i == argc)
Error("missing type on -colorspace",(char *) NULL);
option=argv[i];
! if (strncasecmp("GRAY",option,3) == 0)
colorspace=GRAYColorspace;
else
! if (strncasecmp("RGB",option,3) == 0)
colorspace=RGBColorspace;
else
! if (strncasecmp("YIQ",option,3) == 0)
colorspace=YIQColorspace;
else
! if (strncasecmp("YUV",option,3) == 0)
colorspace=YUVColorspace;
else
! if (strncasecmp("XYZ",option,3) == 0)
colorspace=XYZColorspace;
else
Error("invalid colorspace type on -colorspace",
***************
*** 365,375 ****
if (i == argc)
Error("missing type on -compress",(char *) NULL);
option=argv[i];
! Latin1Lower(option);
! if (strncmp("runlengthencoded",option,1) == 0)
compression=RunlengthEncodedCompression;
else
! if (strncmp("qencoded",option,1) == 0)
compression=QEncodedCompression;
else
Error("invalid compression type on -compress",option);
--- 364,373 ----
if (i == argc)
Error("missing type on -compress",(char *) NULL);
option=argv[i];
! if (strncasecmp("runlengthencoded",option,1) == 0)
compression=RunlengthEncodedCompression;
else
! if (strncasecmp("qencoded",option,1) == 0)
compression=QEncodedCompression;
else
Error("invalid compression type on -compress",option);
--
cristy@dupont.com
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads