From beb4c2b6fc958ce24feb400366624b3f1979759b Mon Sep 17 00:00:00 2001 From: Cristy Date: Tue, 26 Dec 2017 19:43:17 -0500 Subject: [PATCH] Introducing the linear-gray colorspace --- MagickCore/accelerate-kernels-private.h | 7 ++++--- MagickCore/accelerate.c | 6 +++--- MagickCore/attribute.c | 8 ++++---- MagickCore/channel.c | 8 ++++---- MagickCore/color.c | 10 +++++----- MagickCore/colorspace-private.h | 6 +++--- MagickCore/colorspace.c | 18 +++++++++--------- MagickCore/colorspace.h | 2 +- MagickCore/delegate.c | 2 +- MagickCore/effect.c | 4 ++-- MagickCore/enhance.c | 10 +++++----- MagickCore/feature.c | 2 +- MagickCore/identify.c | 14 +++++++------- MagickCore/image.c | 2 +- MagickCore/matrix.c | 2 +- MagickCore/option.c | 2 +- MagickCore/paint.c | 2 +- MagickCore/pixel.c | 8 ++++---- MagickCore/profile.c | 8 ++++---- MagickCore/property.c | 2 +- MagickCore/quantize.c | 10 +++++----- MagickWand/animate.c | 2 +- MagickWand/compare.c | 4 ++-- MagickWand/display.c | 2 +- MagickWand/import.c | 2 +- MagickWand/magick-image.c | 4 ++-- MagickWand/operation.c | 2 +- coders/art.c | 2 +- coders/dcm.c | 2 +- coders/djvu.c | 2 +- coders/dpx.c | 2 +- coders/fits.c | 2 +- coders/gif.c | 2 +- coders/gray.c | 4 ++-- coders/ipl.c | 2 +- coders/jp2.c | 4 ++-- coders/jpeg.c | 6 +++--- coders/json.c | 14 +++++++------- coders/mask.c | 2 +- coders/mat.c | 4 ++-- coders/palm.c | 2 +- coders/pgx.c | 2 +- coders/png.c | 4 ++-- coders/pnm.c | 18 +++++++++--------- coders/psd.c | 2 +- coders/tiff.c | 2 +- coders/tile.c | 4 ++-- coders/txt.c | 6 +++--- coders/vicar.c | 2 +- coders/vips.c | 4 ++-- coders/xcf.c | 4 ++-- 51 files changed, 124 insertions(+), 123 deletions(-) diff --git a/MagickCore/accelerate-kernels-private.h b/MagickCore/accelerate-kernels-private.h index 9d785f4bb..ac81323cb 100644 --- a/MagickCore/accelerate-kernels-private.h +++ b/MagickCore/accelerate-kernels-private.h @@ -59,7 +59,7 @@ const char *accelerateKernels = { UndefinedColorspace, RGBColorspace, /* Linear RGB colorspace */ - sGRAYColorspace, /* greyscale (linear) image (faked 1 channel) */ + GRAYColorspace, /* greyscale (non-linear) image (faked 1 channel) */ TransparentColorspace, OHTAColorspace, LabColorspace, @@ -90,7 +90,8 @@ const char *accelerateKernels = HSIColorspace, HSVColorspace, /* alias for HSB */ HCLpColorspace, - YDbDrColorspace + YDbDrColorspace, + LinearGrayColorspace /* greyscale (linear) image (faked 1 channel) */ } ColorspaceType; ) @@ -483,7 +484,7 @@ OPENCL_ENDIF() { float intensity; - if (colorspace == sGRAYColorspace) + if (colorspace == GRAYColorspace) return red; switch (method) diff --git a/MagickCore/accelerate.c b/MagickCore/accelerate.c index 86c9e1673..6bcb5a84f 100644 --- a/MagickCore/accelerate.c +++ b/MagickCore/accelerate.c @@ -114,8 +114,8 @@ static MagickBooleanType checkAccelerateCondition(const Image* image) /* check if the image's colorspace is supported */ if (image->colorspace != RGBColorspace && image->colorspace != sRGBColorspace && - image->colorspace != GRAYColorspace && - image->colorspace != sGRAYColorspace) + image->colorspace != LinearGRAYColorspace && + image->colorspace != GRAYColorspace) return(MagickFalse); /* check if the virtual pixel method is compatible with the OpenCL implementation */ @@ -1020,7 +1020,7 @@ static MagickBooleanType ComputeContrastStretchImage(Image *image, /* if (IsGrayImage(image,exception) != MagickFalse) - (void) SetImageColorspace(image,sGRAYColorspace); + (void) SetImageColorspace(image,GRAYColorspace); */ status=MagickTrue; diff --git a/MagickCore/attribute.c b/MagickCore/attribute.c index 59a143e07..878e94b71 100644 --- a/MagickCore/attribute.c +++ b/MagickCore/attribute.c @@ -1256,11 +1256,11 @@ MagickExport MagickBooleanType SetImageType(Image *image,const ImageType type, { case BilevelType: { - status=TransformImageColorspace(image,sGRAYColorspace,exception); + status=TransformImageColorspace(image,GRAYColorspace,exception); (void) NormalizeImage(image,exception); quantize_info=AcquireQuantizeInfo(image_info); quantize_info->number_colors=2; - quantize_info->colorspace=sGRAYColorspace; + quantize_info->colorspace=GRAYColorspace; status=QuantizeImage(quantize_info,image,exception); quantize_info=DestroyQuantizeInfo(quantize_info); image->alpha_trait=UndefinedPixelTrait; @@ -1268,13 +1268,13 @@ MagickExport MagickBooleanType SetImageType(Image *image,const ImageType type, } case GrayscaleType: { - status=TransformImageColorspace(image,sGRAYColorspace,exception); + status=TransformImageColorspace(image,GRAYColorspace,exception); image->alpha_trait=UndefinedPixelTrait; break; } case GrayscaleAlphaType: { - status=TransformImageColorspace(image,sGRAYColorspace,exception); + status=TransformImageColorspace(image,GRAYColorspace,exception); if (image->alpha_trait == UndefinedPixelTrait) (void) SetImageAlphaChannel(image,OpaqueAlphaChannel,exception); break; diff --git a/MagickCore/channel.c b/MagickCore/channel.c index 03d3f04b4..690acebb6 100644 --- a/MagickCore/channel.c +++ b/MagickCore/channel.c @@ -284,7 +284,7 @@ MagickExport Image *ChannelFxImage(const Image *image,const char *expression, if ((channel_op == ExtractChannelOp) && (channels == 1)) { (void) SetPixelMetaChannels(destination_image,0,exception); - (void) SetImageColorspace(destination_image,sGRAYColorspace, + (void) SetImageColorspace(destination_image,GRAYColorspace, exception); } canvas=CloneImage(source_image,0,0,MagickTrue,exception); @@ -444,7 +444,7 @@ MagickExport Image *ChannelFxImage(const Image *image,const char *expression, if ((channel_op == ExtractChannelOp) && (channels == 1)) { (void) SetPixelMetaChannels(destination_image,0,exception); - (void) SetImageColorspace(destination_image,sGRAYColorspace,exception); + (void) SetImageColorspace(destination_image,GRAYColorspace,exception); } return(GetFirstImageInList(destination_image)); } @@ -532,8 +532,8 @@ MagickExport Image *CombineImages(const Image *image, combine_image->alpha_trait=BlendPixelTrait; break; } + case LinearGRAYColorspace: case GRAYColorspace: - case sGRAYColorspace: { if (GetImageListLength(image) > 1) combine_image->alpha_trait=BlendPixelTrait; @@ -733,7 +733,7 @@ MagickExport Image *SeparateImage(const Image *image, return((Image *) NULL); } separate_image->alpha_trait=UndefinedPixelTrait; - (void) SetImageColorspace(separate_image,sGRAYColorspace,exception); + (void) SetImageColorspace(separate_image,GRAYColorspace,exception); separate_image->gamma=image->gamma; /* Separate image. diff --git a/MagickCore/color.c b/MagickCore/color.c index eeac2447c..6b47030c4 100644 --- a/MagickCore/color.c +++ b/MagickCore/color.c @@ -1589,8 +1589,8 @@ MagickExport void GetColorTuple(const PixelInfo *pixel, if (color.alpha_trait != UndefinedPixelTrait) (void) ConcatenateMagickString(tuple,"a",MagickPathExtent); (void) ConcatenateMagickString(tuple,"(",MagickPathExtent); - if ((color.colorspace == GRAYColorspace) || - (color.colorspace == sGRAYColorspace)) + if ((color.colorspace == LinearGRAYColorspace) || + (color.colorspace == GRAYColorspace)) ConcatenateColorComponent(&color,GrayPixelChannel,SVGCompliance,tuple); else { @@ -2456,7 +2456,7 @@ MagickExport MagickBooleanType QueryColorCompliance(const char *name, } if (LocaleCompare(colorspace,"gray") == 0) { - color->colorspace=GRAYColorspace; + color->colorspace=LinearGRAYColorspace; color->green=color->red; color->blue=color->red; if (((flags & SigmaValue) != 0) && @@ -2465,7 +2465,7 @@ MagickExport MagickBooleanType QueryColorCompliance(const char *name, geometry_info.sigma); if (icc_color == MagickFalse) { - color->colorspace=sGRAYColorspace; + color->colorspace=GRAYColorspace; color->depth=8; } } @@ -2530,7 +2530,7 @@ MagickExport MagickBooleanType QueryColorCompliance(const char *name, color->colorspace=sRGBColorspace; if ((LocaleNCompare(name,"gray",4) == 0) || (LocaleNCompare(name,"grey",4) == 0)) - color->colorspace=sGRAYColorspace; + color->colorspace=GRAYColorspace; color->depth=8; color->alpha_trait=p->color.alpha != OpaqueAlpha ? BlendPixelTrait : UndefinedPixelTrait; diff --git a/MagickCore/colorspace-private.h b/MagickCore/colorspace-private.h index b2e875c13..d80547091 100644 --- a/MagickCore/colorspace-private.h +++ b/MagickCore/colorspace-private.h @@ -96,7 +96,7 @@ static inline MagickBooleanType IsCMYKColorspace( static inline MagickBooleanType IsGrayColorspace( const ColorspaceType colorspace) { - if ((colorspace == GRAYColorspace) || (colorspace == sGRAYColorspace)) + if ((colorspace == LinearGRAYColorspace) || (colorspace == GRAYColorspace)) return(MagickTrue); return(MagickFalse); } @@ -120,8 +120,8 @@ static inline MagickBooleanType IssRGBCompatibleColorspace( const ColorspaceType colorspace) { if ((colorspace == sRGBColorspace) || (colorspace == RGBColorspace) || - (colorspace == scRGBColorspace) || (colorspace == sGRAYColorspace) || - (colorspace == GRAYColorspace)) + (colorspace == scRGBColorspace) || (colorspace == GRAYColorspace) || + (colorspace == LinearGRAYColorspace)) return(MagickTrue); return(MagickFalse); } diff --git a/MagickCore/colorspace.c b/MagickCore/colorspace.c index 77e508a5f..e7d64f5b8 100644 --- a/MagickCore/colorspace.c +++ b/MagickCore/colorspace.c @@ -98,7 +98,7 @@ static MagickBooleanType %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % GetImageColorspaceType() returns the potential type of image: -% sRGBColorspaceType, RGBColorspaceType, sGRAYColorspaceType, etc. +% sRGBColorspaceType, RGBColorspaceType, GRAYColorspaceType, etc. % % To ensure the image type matches its potential, use SetImageColorspaceType(): % @@ -134,7 +134,7 @@ MagickExport ColorspaceType GetImageColorspaceType(const Image *image, type=IdentifyImageType(image,exception); if ((type == BilevelType) || (type == GrayscaleType) || (type == GrayscaleAlphaType)) - colorspace=sGRAYColorspace; + colorspace=GRAYColorspace; return(colorspace); } @@ -379,8 +379,8 @@ static MagickBooleanType sRGBTransformImage(Image *image, return(MagickFalse); return(status); } + case LinearGRAYColorspace: case GRAYColorspace: - case sGRAYColorspace: { /* Transform image from sRGB to GRAY. @@ -1155,7 +1155,7 @@ MagickExport MagickBooleanType SetImageColorspace(Image *image, type=image->type; if (IsGrayColorspace(colorspace) != MagickFalse) { - if (colorspace == GRAYColorspace) + if (colorspace == LinearGRAYColorspace) image->gamma=1.000; type=GrayscaleType; } @@ -1234,7 +1234,7 @@ MagickExport MagickBooleanType SetImageGray(Image *image, type=IdentifyImageGray(image,exception); if (type == UndefinedType) return(MagickFalse); - image->colorspace=sGRAYColorspace; + image->colorspace=GRAYColorspace; if (SyncImagePixelCache((Image *) image,exception) == MagickFalse) return(MagickFalse); image->type=type; @@ -1287,7 +1287,7 @@ MagickExport MagickBooleanType SetImageMonochrome(Image *image, return(MagickFalse); if (IdentifyImageMonochrome(image,exception) == MagickFalse) return(MagickFalse); - image->colorspace=sGRAYColorspace; + image->colorspace=GRAYColorspace; if (SyncImagePixelCache((Image *) image,exception) == MagickFalse) return(MagickFalse); image->type=BilevelType; @@ -1336,9 +1336,9 @@ MagickExport MagickBooleanType TransformImageColorspace(Image *image, return(SetImageColorspace(image,colorspace,exception)); (void) DeleteImageProfile(image,"icc"); (void) DeleteImageProfile(image,"icm"); - if (colorspace == GRAYColorspace) + if (colorspace == LinearGRAYColorspace) return(GrayscaleImage(image,Rec709LuminancePixelIntensityMethod,exception)); - if (colorspace == sGRAYColorspace) + if (colorspace == GRAYColorspace) return(GrayscaleImage(image,Rec709LumaPixelIntensityMethod,exception)); if (colorspace == UndefinedColorspace) return(SetImageColorspace(image,colorspace,exception)); @@ -1847,8 +1847,8 @@ static MagickBooleanType TransformsRGBImage(Image *image, return(MagickFalse); return(status); } + case LinearGRAYColorspace: case GRAYColorspace: - case sGRAYColorspace: { /* Transform linear GRAY to sRGB colorspace. diff --git a/MagickCore/colorspace.h b/MagickCore/colorspace.h index 3bf3de0e3..0f3fec98c 100644 --- a/MagickCore/colorspace.h +++ b/MagickCore/colorspace.h @@ -57,7 +57,7 @@ typedef enum YIQColorspace, YPbPrColorspace, YUVColorspace, - sGRAYColorspace + LinearGRAYColorspace } ColorspaceType; extern MagickExport ColorspaceType diff --git a/MagickCore/delegate.c b/MagickCore/delegate.c index f4ef6011b..f1bd613e2 100644 --- a/MagickCore/delegate.c +++ b/MagickCore/delegate.c @@ -640,7 +640,7 @@ static char *GetMagickPropertyLetter(ImageInfo *image_info,Image *image, WarnNoImageReturn("\"%%%c\"",letter); colorspace=image->colorspace; if (SetImageGray(image,exception) != MagickFalse) - colorspace=sGRAYColorspace; /* FUTURE: this is IMv6 not IMv7 */ + colorspace=GRAYColorspace; /* FUTURE: this is IMv6 not IMv7 */ (void) FormatLocaleString(value,MagickPathExtent,"%s %s %s", CommandOptionToMnemonic(MagickClassOptions,(ssize_t) image->storage_class),CommandOptionToMnemonic(MagickColorspaceOptions, diff --git a/MagickCore/effect.c b/MagickCore/effect.c index ba870dc03..0b004020e 100644 --- a/MagickCore/effect.c +++ b/MagickCore/effect.c @@ -2433,7 +2433,7 @@ MagickExport Image *PreviewImage(const Image *image,const PreviewType preview, break; colors<<=1; quantize_info.number_colors=colors; - quantize_info.colorspace=sGRAYColorspace; + quantize_info.colorspace=GRAYColorspace; (void) QuantizeImage(&quantize_info,preview_image,exception); (void) FormatLocaleString(label,MagickPathExtent, "-colorspace gray -colors %.20g",(double) colors); @@ -3169,7 +3169,7 @@ MagickExport Image *SelectiveBlurImage(const Image *image,const double radius, kernel=(MagickRealType *) RelinquishAlignedMemory(kernel); return((Image *) NULL); } - status=TransformImageColorspace(luminance_image,sGRAYColorspace,exception); + status=TransformImageColorspace(luminance_image,GRAYColorspace,exception); if (status == MagickFalse) { luminance_image=DestroyImage(luminance_image); diff --git a/MagickCore/enhance.c b/MagickCore/enhance.c index 4feec90b2..8a33cc7c8 100644 --- a/MagickCore/enhance.c +++ b/MagickCore/enhance.c @@ -1049,7 +1049,7 @@ MagickExport MagickBooleanType ContrastStretchImage(Image *image, if (image->debug != MagickFalse) (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename); if (SetImageGray(image,exception) != MagickFalse) - (void) SetImageColorspace(image,sGRAYColorspace,exception); + (void) SetImageColorspace(image,GRAYColorspace,exception); black=(double *) AcquireQuantumMemory(MaxPixelChannels,sizeof(*black)); white=(double *) AcquireQuantumMemory(MaxPixelChannels,sizeof(*white)); histogram=(double *) AcquireQuantumMemory(MaxMap+1UL,MaxPixelChannels* @@ -1992,8 +1992,8 @@ MagickExport MagickBooleanType GrayscaleImage(Image *image, image->type=GrayscaleType; if ((method == Rec601LuminancePixelIntensityMethod) || (method == Rec709LuminancePixelIntensityMethod)) - return(SetImageColorspace(image,GRAYColorspace,exception)); - return(SetImageColorspace(image,sGRAYColorspace,exception)); + return(SetImageColorspace(image,LinearGRAYColorspace,exception)); + return(SetImageColorspace(image,GRAYColorspace,exception)); } #endif /* @@ -2139,8 +2139,8 @@ MagickExport MagickBooleanType GrayscaleImage(Image *image, image->type=GrayscaleType; if ((method == Rec601LuminancePixelIntensityMethod) || (method == Rec709LuminancePixelIntensityMethod)) - return(SetImageColorspace(image,GRAYColorspace,exception)); - return(SetImageColorspace(image,sGRAYColorspace,exception)); + return(SetImageColorspace(image,LinearGRAYColorspace,exception)); + return(SetImageColorspace(image,GRAYColorspace,exception)); } /* diff --git a/MagickCore/feature.c b/MagickCore/feature.c index 3bac61af2..6dda2b89c 100644 --- a/MagickCore/feature.c +++ b/MagickCore/feature.c @@ -291,7 +291,7 @@ MagickExport Image *CannyEdgeImage(const Image *image,const double radius, kernel_info=DestroyKernelInfo(kernel_info); if (edge_image == (Image *) NULL) return((Image *) NULL); - if (TransformImageColorspace(edge_image,sGRAYColorspace,exception) == MagickFalse) + if (TransformImageColorspace(edge_image,GRAYColorspace,exception) == MagickFalse) { edge_image=DestroyImage(edge_image); return((Image *) NULL); diff --git a/MagickCore/identify.c b/MagickCore/identify.c index 7eaa54a10..2b10e863f 100644 --- a/MagickCore/identify.c +++ b/MagickCore/identify.c @@ -581,8 +581,8 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file, statistic_type,max_locations,channel_statistics); break; } + case LinearGRAYColorspace: case GRAYColorspace: - case sGRAYColorspace: { (void) PrintChannelLocations(file,image,GrayPixelChannel,"Gray", statistic_type,max_locations,channel_statistics); @@ -795,8 +795,8 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file, channel_statistics[BlackPixelChannel].depth); break; } + case LinearGRAYColorspace: case GRAYColorspace: - case sGRAYColorspace: { (void) FormatLocaleFile(file," Gray: %.20g-bit\n",(double) channel_statistics[GrayPixelChannel].depth); @@ -848,8 +848,8 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file, scale,channel_statistics); break; } + case LinearGRAYColorspace: case GRAYColorspace: - case sGRAYColorspace: { (void) PrintChannelStatistics(file,GrayPixelChannel,"Gray",1.0/ scale,channel_statistics); @@ -873,7 +873,7 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file, if (image->alpha_trait != UndefinedPixelTrait) (void) PrintChannelStatistics(file,AlphaPixelChannel,"Alpha",1.0/ scale,channel_statistics); - if ((colorspace != GRAYColorspace) && (colorspace != sGRAYColorspace)) + if ((colorspace != LinearGRAYColorspace) && (colorspace != GRAYColorspace)) { (void) FormatLocaleFile(file," Image statistics:\n"); (void) PrintChannelStatistics(file,CompositePixelChannel,"Overall", @@ -911,7 +911,7 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file, channel_moments); break; } - case sGRAYColorspace: + case GRAYColorspace: { (void) PrintChannelMoments(file,GrayPixelChannel,"Gray",scale, channel_moments); @@ -935,7 +935,7 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file, if (image->alpha_trait != UndefinedPixelTrait) (void) PrintChannelMoments(file,AlphaPixelChannel,"Alpha",scale, channel_moments); - if (colorspace != sGRAYColorspace) + if (colorspace != GRAYColorspace) { (void) FormatLocaleFile(file," Image moments:\n"); (void) PrintChannelMoments(file,CompositePixelChannel,"Overall",scale, @@ -979,7 +979,7 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file, channel_features); break; } - case sGRAYColorspace: + case GRAYColorspace: { (void) PrintChannelFeatures(file,GrayPixelChannel,"Gray", channel_features); diff --git a/MagickCore/image.c b/MagickCore/image.c index 89708d73e..39ad1b495 100644 --- a/MagickCore/image.c +++ b/MagickCore/image.c @@ -1463,7 +1463,7 @@ MagickExport Image *GetImageMask(const Image *image,const PixelMask type, return((Image *) NULL); status=MagickTrue; mask_image->alpha_trait=UndefinedPixelTrait; - (void) SetImageColorspace(mask_image,sGRAYColorspace,exception); + (void) SetImageColorspace(mask_image,GRAYColorspace,exception); mask_image->read_mask=MagickFalse; image_view=AcquireVirtualCacheView(image,exception); mask_view=AcquireAuthenticCacheView(mask_image,exception); diff --git a/MagickCore/matrix.c b/MagickCore/matrix.c index 116f81cb2..74b9f33b0 100644 --- a/MagickCore/matrix.c +++ b/MagickCore/matrix.c @@ -934,7 +934,7 @@ MagickExport Image *MatrixToImage(const MatrixInfo *matrix_info, image=AcquireImage((ImageInfo *) NULL,exception); image->columns=matrix_info->columns; image->rows=matrix_info->rows; - image->colorspace=sGRAYColorspace; + image->colorspace=GRAYColorspace; status=MagickTrue; image_view=AcquireAuthenticCacheView(image,exception); #if defined(MAGICKCORE_OPENMP_SUPPORT) diff --git a/MagickCore/option.c b/MagickCore/option.c index 94d2b7765..7485f8638 100644 --- a/MagickCore/option.c +++ b/MagickCore/option.c @@ -472,6 +472,7 @@ static const OptionInfo { "LCH", LCHColorspace, UndefinedOptionFlag, MagickFalse }, { "LCHab", LCHabColorspace, UndefinedOptionFlag, MagickFalse }, { "LCHuv", LCHuvColorspace, UndefinedOptionFlag, MagickFalse }, + { "LinearGray", LinearGRAYColorspace, UndefinedOptionFlag, MagickFalse }, { "LMS", LMSColorspace, UndefinedOptionFlag, MagickFalse }, { "Log", LogColorspace, UndefinedOptionFlag, MagickFalse }, { "Luv", LuvColorspace, UndefinedOptionFlag, MagickFalse }, @@ -480,7 +481,6 @@ static const OptionInfo { "Rec709YCbCr", Rec709YCbCrColorspace, UndefinedOptionFlag, MagickFalse }, { "RGB", RGBColorspace, UndefinedOptionFlag, MagickFalse }, { "scRGB", scRGBColorspace, UndefinedOptionFlag, MagickFalse }, - { "sGray", sGRAYColorspace, UndefinedOptionFlag, MagickFalse }, { "sRGB", sRGBColorspace, UndefinedOptionFlag, MagickFalse }, { "Transparent", TransparentColorspace, UndefinedOptionFlag, MagickFalse }, { "xyY", xyYColorspace, UndefinedOptionFlag, MagickFalse }, diff --git a/MagickCore/paint.c b/MagickCore/paint.c index 3557f9b99..05928fd0c 100644 --- a/MagickCore/paint.c +++ b/MagickCore/paint.c @@ -191,7 +191,7 @@ MagickExport MagickBooleanType FloodfillPaintImage(Image *image, if (floodplane_image == (Image *) NULL) return(MagickFalse); floodplane_image->alpha_trait=UndefinedPixelTrait; - floodplane_image->colorspace=sGRAYColorspace; + floodplane_image->colorspace=GRAYColorspace; (void) QueryColorCompliance("#000",AllCompliance, &floodplane_image->background_color,exception); (void) SetImageBackgroundColor(floodplane_image,exception); diff --git a/MagickCore/pixel.c b/MagickCore/pixel.c index d76a8dba1..d1f4979ff 100644 --- a/MagickCore/pixel.c +++ b/MagickCore/pixel.c @@ -4207,7 +4207,7 @@ MagickExport MagickBooleanType ImportImagePixels(Image *image,const ssize_t x, case 'i': { quantum_map[i]=IndexQuantum; - (void) SetImageColorspace(image,sGRAYColorspace,exception); + (void) SetImageColorspace(image,GRAYColorspace,exception); break; } case 'm': @@ -4350,8 +4350,8 @@ MagickExport void InitializePixelChannelMap(Image *image) if (image->alpha_trait != UndefinedPixelTrait) trait=(PixelTrait) (trait | BlendPixelTrait); n=0; - if ((image->colorspace == GRAYColorspace) || - (image->colorspace == sGRAYColorspace)) + if ((image->colorspace == LinearGRAYColorspace) || + (image->colorspace == GRAYColorspace)) { SetPixelChannelAttributes(image,BluePixelChannel,trait,n); SetPixelChannelAttributes(image,GreenPixelChannel,trait,n); @@ -6200,7 +6200,7 @@ static void LogPixelChannels(const Image *image) name="red"; if (image->colorspace == CMYKColorspace) name="cyan"; - if (image->colorspace == sGRAYColorspace) + if (image->colorspace == GRAYColorspace) name="gray"; break; } diff --git a/MagickCore/profile.c b/MagickCore/profile.c index 42f3b6bc4..cdfc41b1d 100644 --- a/MagickCore/profile.c +++ b/MagickCore/profile.c @@ -927,7 +927,7 @@ MagickExport MagickBooleanType ProfileImage(Image *image,const char *name, } case cmsSigGrayData: { - source_colorspace=sGRAYColorspace; + source_colorspace=GRAYColorspace; source_type=(cmsUInt32Number) TYPE_GRAY_DBL; source_channels=1; break; @@ -983,7 +983,7 @@ MagickExport MagickBooleanType ProfileImage(Image *image,const char *name, } case cmsSigGrayData: { - target_colorspace=sGRAYColorspace; + target_colorspace=GRAYColorspace; target_type=(cmsUInt32Number) TYPE_GRAY_DBL; target_channels=1; break; @@ -1011,8 +1011,8 @@ MagickExport MagickBooleanType ProfileImage(Image *image,const char *name, (target_colorspace == UndefinedColorspace)) ThrowProfileException(ImageError,"ColorspaceColorProfileMismatch", name); - if (((source_colorspace == GRAYColorspace) || - (source_colorspace == sGRAYColorspace)) && + if (((source_colorspace == LinearGRAYColorspace) || + (source_colorspace == GRAYColorspace)) && (SetImageGray(image,exception) == MagickFalse)) ThrowProfileException(ImageError,"ColorspaceColorProfileMismatch", name); diff --git a/MagickCore/property.c b/MagickCore/property.c index 079e952d5..b1fcd649e 100644 --- a/MagickCore/property.c +++ b/MagickCore/property.c @@ -2512,7 +2512,7 @@ static const char *GetMagickPropertyLetter(ImageInfo *image_info, WarnNoImageReturn("\"%%%c\"",letter); colorspace=image->colorspace; if (SetImageGray(image,exception) != MagickFalse) - colorspace=sGRAYColorspace; /* FUTURE: this is IMv6 not IMv7 */ + colorspace=GRAYColorspace; /* FUTURE: this is IMv6 not IMv7 */ (void) FormatLocaleString(value,MagickPathExtent,"%s %s %s", CommandOptionToMnemonic(MagickClassOptions,(ssize_t) image->storage_class),CommandOptionToMnemonic(MagickColorspaceOptions, diff --git a/MagickCore/quantize.c b/MagickCore/quantize.c index bb21f870b..ff974c719 100644 --- a/MagickCore/quantize.c +++ b/MagickCore/quantize.c @@ -643,8 +643,8 @@ static MagickBooleanType AssignImageColors(Image *image,CubeInfo *cube_info, if (cube_info->quantize_info->measure_error != MagickFalse) (void) GetImageQuantizeError(image,exception); if ((cube_info->quantize_info->number_colors == 2) && - ((cube_info->quantize_info->colorspace == GRAYColorspace) || - (cube_info->quantize_info->colorspace == sGRAYColorspace))) + ((cube_info->quantize_info->colorspace == LinearGRAYColorspace) || + (cube_info->quantize_info->colorspace == GRAYColorspace))) { double intensity; @@ -743,8 +743,8 @@ static inline void SetAssociatedAlpha(const Image *image,CubeInfo *cube_info) associate_alpha=image->alpha_trait == BlendPixelTrait ? MagickTrue : MagickFalse; if ((cube_info->quantize_info->number_colors == 2) && - ((cube_info->quantize_info->colorspace == GRAYColorspace) || - (cube_info->quantize_info->colorspace == sGRAYColorspace))) + ((cube_info->quantize_info->colorspace == LinearGRAYColorspace) || + (cube_info->quantize_info->colorspace == GRAYColorspace))) associate_alpha=MagickFalse; cube_info->associate_alpha=associate_alpha; } @@ -3317,7 +3317,7 @@ static MagickBooleanType SetGrayscaleImage(Image *image, assert(image != (Image *) NULL); assert(image->signature == MagickCoreSignature); if (image->type != GrayscaleType) - (void) TransformImageColorspace(image,sGRAYColorspace,exception); + (void) TransformImageColorspace(image,GRAYColorspace,exception); colormap_index=(ssize_t *) AcquireQuantumMemory(MaxColormapSize, sizeof(*colormap_index)); if (colormap_index == (ssize_t *) NULL) diff --git a/MagickWand/animate.c b/MagickWand/animate.c index dd6ab545d..6758f04db 100644 --- a/MagickWand/animate.c +++ b/MagickWand/animate.c @@ -1072,7 +1072,7 @@ WandExport MagickBooleanType AnimateImageCommand(ImageInfo *image_info, if (*option == '+') break; quantize_info->number_colors=2; - quantize_info->colorspace=sGRAYColorspace; + quantize_info->colorspace=GRAYColorspace; break; } ThrowAnimateException(OptionError,"UnrecognizedOption",option); diff --git a/MagickWand/compare.c b/MagickWand/compare.c index 6920f998f..03e9f5150 100644 --- a/MagickWand/compare.c +++ b/MagickWand/compare.c @@ -1337,8 +1337,8 @@ WandExport MagickBooleanType CompareImagesCommand(ImageInfo *image_info, channel_distortion[AlphaPixelChannel]); break; } + case LinearGRAYColorspace: case GRAYColorspace: - case sGRAYColorspace: { (void) FormatLocaleFile(stderr," gray: %g (%g)\n", QuantumRange*channel_distortion[GrayPixelChannel], @@ -1393,8 +1393,8 @@ WandExport MagickBooleanType CompareImagesCommand(ImageInfo *image_info, channel_distortion[AlphaPixelChannel]); break; } + case LinearGRAYColorspace: case GRAYColorspace: - case sGRAYColorspace: { (void) FormatLocaleFile(stderr," gray: %g\n", channel_distortion[GrayPixelChannel]); diff --git a/MagickWand/display.c b/MagickWand/display.c index 69f7a602b..784446397 100644 --- a/MagickWand/display.c +++ b/MagickWand/display.c @@ -1405,7 +1405,7 @@ WandExport MagickBooleanType DisplayImageCommand(ImageInfo *image_info, if (*option == '+') break; quantize_info->number_colors=2; - quantize_info->colorspace=sGRAYColorspace; + quantize_info->colorspace=GRAYColorspace; break; } ThrowDisplayException(OptionError,"UnrecognizedOption",option); diff --git a/MagickWand/import.c b/MagickWand/import.c index cdd782132..be13c14a1 100644 --- a/MagickWand/import.c +++ b/MagickWand/import.c @@ -979,7 +979,7 @@ WandExport MagickBooleanType ImportImageCommand(ImageInfo *image_info, if (*option == '+') break; quantize_info->number_colors=2; - quantize_info->colorspace=sGRAYColorspace; + quantize_info->colorspace=GRAYColorspace; break; } ThrowImportException(OptionError,"UnrecognizedOption",option); diff --git a/MagickWand/magick-image.c b/MagickWand/magick-image.c index aa5990b83..7f5d2318b 100644 --- a/MagickWand/magick-image.c +++ b/MagickWand/magick-image.c @@ -9338,7 +9338,7 @@ WandExport MagickBooleanType MagickSetImageColormapColor(MagickWand *wand, % o wand: the magick wand. % % o colorspace: the image colorspace: UndefinedColorspace, RGBColorspace, -% sGRAYColorspace, TransparentColorspace, OHTAColorspace, XYZColorspace, +% GRAYColorspace, TransparentColorspace, OHTAColorspace, XYZColorspace, % YCbCrColorspace, YCCColorspace, YIQColorspace, YPbPrColorspace, % YPbPrColorspace, YUVColorspace, CMYKColorspace, sRGBColorspace, % HSLColorspace, or HWBColorspace. @@ -11870,7 +11870,7 @@ WandExport MagickBooleanType MagickTintImage(MagickWand *wand, % o wand: the magick wand. % % o colorspace: the image colorspace: UndefinedColorspace, -% sRGBColorspace, RGBColorspace, sGRAYColorspace, +% sRGBColorspace, RGBColorspace, GRAYColorspace, % OHTAColorspace, XYZColorspace, YCbCrColorspace, % YCCColorspace, YIQColorspace, YPbPrColorspace, % YPbPrColorspace, YUVColorspace, CMYKColorspace, diff --git a/MagickWand/operation.c b/MagickWand/operation.c index f0273d1c8..76748d703 100644 --- a/MagickWand/operation.c +++ b/MagickWand/operation.c @@ -2029,7 +2029,7 @@ static MagickBooleanType CLISimpleOperatorImage(MagickCLI *cli_wand, /* clean up and set the write mask */ mask_view=DestroyCacheView(mask_view); mask_image->alpha_trait=BlendPixelTrait; - (void) SetImageColorspace(_image,sGRAYColorspace,_exception); + (void) SetImageColorspace(_image,GRAYColorspace,_exception); (void) SetImageMask(_image,ReadPixelMask,mask_image,_exception); mask_image=DestroyImage(mask_image); break; diff --git a/coders/art.c b/coders/art.c index fbd2c86de..3feb99396 100644 --- a/coders/art.c +++ b/coders/art.c @@ -152,7 +152,7 @@ static Image *ReadARTImage(const ImageInfo *image_info,ExceptionInfo *exception) /* Convert bi-level image to pixel packets. */ - SetImageColorspace(image,sGRAYColorspace,exception); + SetImageColorspace(image,GRAYColorspace,exception); quantum_info=AcquireQuantumInfo(image_info,image); if (quantum_info == (QuantumInfo *) NULL) ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); diff --git a/coders/dcm.c b/coders/dcm.c index 15ce5b2f2..94e8e6a8b 100644 --- a/coders/dcm.c +++ b/coders/dcm.c @@ -4091,7 +4091,7 @@ static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception) } } if (SetImageGray(image,exception) != MagickFalse) - (void) SetImageColorspace(image,sGRAYColorspace,exception); + (void) SetImageColorspace(image,GRAYColorspace,exception); if (EOFBlob(image) != MagickFalse) { ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile", diff --git a/coders/djvu.c b/coders/djvu.c index 07286be88..66197793f 100644 --- a/coders/djvu.c +++ b/coders/djvu.c @@ -645,7 +645,7 @@ static Image *ReadOneDJVUImage(LoadContext* lc,const int pagenum, /* mmc: bitonal should be palettized, and compressed! */ if (type == DDJVU_PAGETYPE_BITONAL){ - image->colorspace = sGRAYColorspace; + image->colorspace = GRAYColorspace; image->storage_class = PseudoClass; image->depth = 8UL; /* i only support that? */ image->colors= 2; diff --git a/coders/dpx.c b/coders/dpx.c index 8d6a49a4f..d3e7745c6 100644 --- a/coders/dpx.c +++ b/coders/dpx.c @@ -1203,7 +1203,7 @@ static Image *ReadDPXImage(const ImageInfo *image_info,ExceptionInfo *exception) } case LumaComponentType: { - SetImageColorspace(image,sGRAYColorspace,exception); + SetImageColorspace(image,GRAYColorspace,exception); break; } default: diff --git a/coders/fits.c b/coders/fits.c index aa6d14c7d..4e74c980b 100644 --- a/coders/fits.c +++ b/coders/fits.c @@ -432,7 +432,7 @@ static Image *ReadFITSImage(const ImageInfo *image_info, /* Initialize image structure. */ - (void) SetImageColorspace(image,sGRAYColorspace,exception); + (void) SetImageColorspace(image,GRAYColorspace,exception); if ((fits_info.min_data == 0.0) && (fits_info.max_data == 0.0)) { if ((fits_info.bits_per_pixel == -32) || diff --git a/coders/gif.c b/coders/gif.c index ac2575cfd..0ee58a1b4 100644 --- a/coders/gif.c +++ b/coders/gif.c @@ -1347,7 +1347,7 @@ static Image *ReadGIFImage(const ImageInfo *image_info,ExceptionInfo *exception) if (IsPixelInfoGray(image->colormap+i) == MagickFalse) break; (void) SetImageColorspace(image,i == (ssize_t) image->colors ? - sGRAYColorspace : RGBColorspace,exception); + GRAYColorspace : RGBColorspace,exception); } if ((image_info->ping != MagickFalse) && (image_info->number_scenes != 0)) if (image->scene >= (image_info->scene+image_info->number_scenes-1)) diff --git a/coders/gray.c b/coders/gray.c index f0e57d254..48f3745c4 100644 --- a/coders/gray.c +++ b/coders/gray.c @@ -154,7 +154,7 @@ static Image *ReadGRAYImage(const ImageInfo *image_info, /* Create virtual canvas to support cropping (i.e. image.gray[100x100+10+20]). */ - (void) SetImageColorspace(image,sGRAYColorspace,exception); + (void) SetImageColorspace(image,GRAYColorspace,exception); canvas_image=CloneImage(image,image->extract_info.width,1,MagickFalse, exception); (void) SetImageVirtualPixelMethod(canvas_image,BlackVirtualPixelMethod, @@ -195,7 +195,7 @@ static Image *ReadGRAYImage(const ImageInfo *image_info, status=SetImageExtent(image,image->columns,image->rows,exception); if (status == MagickFalse) break; - if (SetImageColorspace(image,sGRAYColorspace,exception) == MagickFalse) + if (SetImageColorspace(image,GRAYColorspace,exception) == MagickFalse) break; if (scene == 0) { diff --git a/coders/ipl.c b/coders/ipl.c index 8ef7e2b61..21b899d63 100644 --- a/coders/ipl.c +++ b/coders/ipl.c @@ -249,7 +249,7 @@ static Image *ReadIPLImage(const ImageInfo *image_info,ExceptionInfo *exception) ThrowReaderException(CorruptImageError,"ImproperImageHeader"); ipl_info.colors=ReadBlobLong(image); if(ipl_info.colors == 3){ SetImageColorspace(image,sRGBColorspace,exception);} - else { image->colorspace = sGRAYColorspace; } + else { image->colorspace = GRAYColorspace; } ipl_info.z=ReadBlobLong(image); ipl_info.time=ReadBlobLong(image); diff --git a/coders/jp2.c b/coders/jp2.c index c4d2558ad..1673656de 100644 --- a/coders/jp2.c +++ b/coders/jp2.c @@ -409,11 +409,11 @@ static Image *ReadJP2Image(const ImageInfo *image_info,ExceptionInfo *exception) return(DestroyImageList(image)); image->compression=JPEG2000Compression; if (jp2_image->numcomps == 1) - SetImageColorspace(image,sGRAYColorspace,exception); + SetImageColorspace(image,GRAYColorspace,exception); else if (jp2_image->color_space == 2) { - SetImageColorspace(image,sGRAYColorspace,exception); + SetImageColorspace(image,GRAYColorspace,exception); if (jp2_image->numcomps > 1) image->alpha_trait=BlendPixelTrait; } diff --git a/coders/jpeg.c b/coders/jpeg.c index 0b300042b..4ada27ab6 100644 --- a/coders/jpeg.c +++ b/coders/jpeg.c @@ -1279,7 +1279,7 @@ static Image *ReadJPEGImage(const ImageInfo *image_info, } case JCS_GRAYSCALE: { - (void) SetImageColorspace(image,sGRAYColorspace,exception); + (void) SetImageColorspace(image,GRAYColorspace,exception); break; } case JCS_YCbCr: @@ -2252,8 +2252,8 @@ static MagickBooleanType WriteJPEGImage(const ImageInfo *image_info, jpeg_info.in_color_space=JCS_YCbCr; break; } + case LinearGRAYColorspace: case GRAYColorspace: - case sGRAYColorspace: { if (image_info->type == TrueColorType) break; @@ -2657,7 +2657,7 @@ static MagickBooleanType WriteJPEGImage(const ImageInfo *image_info, jpeg_info.comp_info[3].v_samp_factor); break; } - case sGRAYColorspace: + case GRAYColorspace: { (void) LogMagickEvent(CoderEvent,GetMagickModule(), "Colorspace: GRAY"); diff --git a/coders/json.c b/coders/json.c index 916af8b93..0b6737535 100644 --- a/coders/json.c +++ b/coders/json.c @@ -1091,8 +1091,8 @@ static MagickBooleanType EncodeImageAttributes(Image *image,FILE *file, type,max_locations,MagickFalse,channel_statistics); break; } + case LinearGRAYColorspace: case GRAYColorspace: - case sGRAYColorspace: { (void) PrintChannelLocations(file,image,GrayPixelChannel,"Gray", type,max_locations,MagickFalse,channel_statistics); @@ -1166,8 +1166,8 @@ static MagickBooleanType EncodeImageAttributes(Image *image,FILE *file, channel_statistics[BlackChannel].depth); break; } + case LinearGRAYColorspace: case GRAYColorspace: - case sGRAYColorspace: { (void) FormatLocaleFile(file," \"gray\": %.20g\n",(double) channel_statistics[GrayChannel].depth); @@ -1183,8 +1183,8 @@ static MagickBooleanType EncodeImageAttributes(Image *image,FILE *file, { (void) FormatLocaleFile(file," \"pixels\": %.20g,\n", channel_statistics[CompositePixelChannel].area); - if ((image->colorspace != GRAYColorspace) && - (image->colorspace != sGRAYColorspace)) + if ((image->colorspace != LinearGRAYColorspace) && + (image->colorspace != GRAYColorspace)) { (void) FormatLocaleFile(file," \"imageStatistics\": {\n"); (void) PrintChannelStatistics(file,(PixelChannel) MaxPixelChannels, @@ -1220,8 +1220,8 @@ static MagickBooleanType EncodeImageAttributes(Image *image,FILE *file, scale,MagickFalse,channel_statistics); break; } + case LinearGRAYColorspace: case GRAYColorspace: - case sGRAYColorspace: { (void) PrintChannelStatistics(file,GrayPixelChannel,"Gray",1.0/scale, MagickFalse,channel_statistics); @@ -1263,8 +1263,8 @@ static MagickBooleanType EncodeImageAttributes(Image *image,FILE *file, MagickFalse,channel_moments); break; } + case LinearGRAYColorspace: case GRAYColorspace: - case sGRAYColorspace: { (void) PrintChannelMoments(file,GrayPixelChannel,"Gray",MagickFalse, channel_moments); @@ -1314,8 +1314,8 @@ static MagickBooleanType EncodeImageAttributes(Image *image,FILE *file, MagickFalse,channel_features); break; } + case LinearGRAYColorspace: case GRAYColorspace: - case sGRAYColorspace: { (void) PrintChannelFeatures(file,GrayPixelChannel,"Gray",MagickFalse, channel_features); diff --git a/coders/mask.c b/coders/mask.c index c0233c151..bec8811d5 100644 --- a/coders/mask.c +++ b/coders/mask.c @@ -237,7 +237,7 @@ static Image *MaskImage(const Image *image,ExceptionInfo *exception) return((Image *) NULL); } mask_image->alpha_trait=UndefinedPixelTrait; - (void) SetImageColorspace(mask_image,sGRAYColorspace,exception); + (void) SetImageColorspace(mask_image,GRAYColorspace,exception); /* Mask image. */ diff --git a/coders/mat.c b/coders/mat.c index 347dc0101..815cd4b10 100644 --- a/coders/mat.c +++ b/coders/mat.c @@ -686,7 +686,7 @@ static Image *ReadMATImageV4(const ImageInfo *image_info,Image *image, } image->columns=(size_t) HDR.nRows; image->rows=(size_t) HDR.nCols; - SetImageColorspace(image,sGRAYColorspace,exception); + SetImageColorspace(image,GRAYColorspace,exception); if (image_info->ping != MagickFalse) { Swap(image->columns,image->rows); @@ -1163,7 +1163,7 @@ RestoreMSCWarning ((MATLAB_HDR.StructureFlag & FLAG_COMPLEX) == 0)) { image->type=GrayscaleType; - SetImageColorspace(image,sGRAYColorspace,exception); + SetImageColorspace(image,GRAYColorspace,exception); } diff --git a/coders/palm.c b/coders/palm.c index bad62caf1..120c6dd23 100644 --- a/coders/palm.c +++ b/coders/palm.c @@ -770,7 +770,7 @@ static MagickBooleanType WritePALMImage(const ImageInfo *image_info, (void) TransformImageColorspace(image,image->colorspace,exception); if (bits_per_pixel < 8) { - (void) TransformImageColorspace(image,sGRAYColorspace,exception); + (void) TransformImageColorspace(image,GRAYColorspace,exception); (void) SetImageType(image,PaletteType,exception); (void) SortColormapByIntensity(image,exception); } diff --git a/coders/pgx.c b/coders/pgx.c index 77749c3cb..81165a637 100644 --- a/coders/pgx.c +++ b/coders/pgx.c @@ -200,7 +200,7 @@ static Image *ReadPGXImage(const ImageInfo *image_info,ExceptionInfo *exception) /* Convert PGX image. */ - (void) SetImageColorspace(image,sGRAYColorspace,exception); + (void) SetImageColorspace(image,GRAYColorspace,exception); quantum_info=AcquireQuantumInfo(image_info,image); if (quantum_info == (QuantumInfo *) NULL) ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); diff --git a/coders/png.c b/coders/png.c index 135ec87cb..c5851348e 100644 --- a/coders/png.c +++ b/coders/png.c @@ -3165,7 +3165,7 @@ static Image *ReadOnePNGImage(MngInfo *mng_info, * image->colorspace to GRAY, and reset image->chromaticity. */ image->intensity = Rec709LuminancePixelIntensityMethod; - SetImageColorspace(image,GRAYColorspace,exception); + SetImageColorspace(image,LinearGRAYColorspace,exception); } else { @@ -3174,7 +3174,7 @@ static Image *ReadOnePNGImage(MngInfo *mng_info, ChromaticityInfo save_chromaticity = image->chromaticity; - SetImageColorspace(image,sGRAYColorspace,exception); + SetImageColorspace(image,GRAYColorspace,exception); image->rendering_intent = save_rendering_intent; image->chromaticity = save_chromaticity; } diff --git a/coders/pnm.c b/coders/pnm.c index a297b8086..7e2e45c74 100644 --- a/coders/pnm.c +++ b/coders/pnm.c @@ -375,23 +375,23 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception) { if (LocaleCompare(value,"BLACKANDWHITE") == 0) { - (void) SetImageColorspace(image,sGRAYColorspace,exception); + (void) SetImageColorspace(image,GRAYColorspace,exception); quantum_type=GrayQuantum; } if (LocaleCompare(value,"BLACKANDWHITE_ALPHA") == 0) { - (void) SetImageColorspace(image,sGRAYColorspace,exception); + (void) SetImageColorspace(image,GRAYColorspace,exception); image->alpha_trait=BlendPixelTrait; quantum_type=GrayAlphaQuantum; } if (LocaleCompare(value,"GRAYSCALE") == 0) { quantum_type=GrayQuantum; - (void) SetImageColorspace(image,sGRAYColorspace,exception); + (void) SetImageColorspace(image,GRAYColorspace,exception); } if (LocaleCompare(value,"GRAYSCALE_ALPHA") == 0) { - (void) SetImageColorspace(image,sGRAYColorspace,exception); + (void) SetImageColorspace(image,GRAYColorspace,exception); image->alpha_trait=BlendPixelTrait; quantum_type=GrayAlphaQuantum; } @@ -440,7 +440,7 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception) /* Convert PBM image to pixel packets. */ - (void) SetImageColorspace(image,sGRAYColorspace,exception); + (void) SetImageColorspace(image,GRAYColorspace,exception); for (y=0; y < (ssize_t) image->rows; y++) { register ssize_t @@ -483,7 +483,7 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception) /* Convert PGM image to pixel packets. */ - (void) SetImageColorspace(image,sGRAYColorspace,exception); + (void) SetImageColorspace(image,GRAYColorspace,exception); for (y=0; y < (ssize_t) image->rows; y++) { register ssize_t @@ -569,7 +569,7 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception) /* Convert PBM raw image to pixel packets. */ - (void) SetImageColorspace(image,sGRAYColorspace,exception); + (void) SetImageColorspace(image,GRAYColorspace,exception); quantum_type=GrayQuantum; if (image->storage_class == PseudoClass) quantum_type=IndexQuantum; @@ -632,7 +632,7 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception) /* Convert PGM raw image to pixel packets. */ - (void) SetImageColorspace(image,sGRAYColorspace,exception); + (void) SetImageColorspace(image,GRAYColorspace,exception); quantum_type=GrayQuantum; if (image->depth <= 8) extent=image->columns; @@ -1247,7 +1247,7 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception) Convert PFM raster image to pixel packets. */ if (format == 'f') - (void) SetImageColorspace(image,sGRAYColorspace,exception); + (void) SetImageColorspace(image,GRAYColorspace,exception); quantum_type=format == 'f' ? GrayQuantum : RGBQuantum; image->endian=quantum_scale < 0.0 ? LSBEndian : MSBEndian; image->depth=32; diff --git a/coders/psd.c b/coders/psd.c index b63144d3b..aaae14291 100644 --- a/coders/psd.c +++ b/coders/psd.c @@ -2084,7 +2084,7 @@ static Image *ReadPSDImage(const ImageInfo *image_info,ExceptionInfo *exception) (void) LogMagickEvent(CoderEvent,GetMagickModule(), " Image colormap allocated"); } - SetImageColorspace(image,sGRAYColorspace,exception); + SetImageColorspace(image,GRAYColorspace,exception); if (psd_info.channels > 1) SetImageAlphaChannel(image,ActivateAlphaChannel,exception); } diff --git a/coders/tiff.c b/coders/tiff.c index a37d3a862..6f663f45e 100644 --- a/coders/tiff.c +++ b/coders/tiff.c @@ -1476,7 +1476,7 @@ RestoreMSCWarning #endif if ((photometric == PHOTOMETRIC_MINISBLACK) || (photometric == PHOTOMETRIC_MINISWHITE)) - SetImageColorspace(image,sGRAYColorspace,exception); + SetImageColorspace(image,GRAYColorspace,exception); if (photometric == PHOTOMETRIC_SEPARATED) SetImageColorspace(image,CMYKColorspace,exception); if (photometric == PHOTOMETRIC_CIELAB) diff --git a/coders/tile.c b/coders/tile.c index 5fbf76f91..eed05d998 100644 --- a/coders/tile.c +++ b/coders/tile.c @@ -133,8 +133,8 @@ static Image *ReadTILEImage(const ImageInfo *image_info, } (void) TextureImage(image,tile_image,exception); tile_image=DestroyImage(tile_image); - if ((image->colorspace == GRAYColorspace) || - (image->colorspace == sGRAYColorspace)) + if ((image->colorspace == LinearGRAYColorspace) || + (image->colorspace == GRAYColorspace)) image->type=GrayscaleType; return(GetFirstImageInList(image)); } diff --git a/coders/txt.c b/coders/txt.c index 90cbd2c60..34989ca3b 100644 --- a/coders/txt.c +++ b/coders/txt.c @@ -488,8 +488,8 @@ static Image *ReadTXTImage(const ImageInfo *image_info,ExceptionInfo *exception) break; switch (image->colorspace) { + case LinearGRAYColorspace: case GRAYColorspace: - case sGRAYColorspace: { if (image->alpha_trait != UndefinedPixelTrait) { @@ -796,8 +796,8 @@ static MagickBooleanType WriteTXTImage(const ImageInfo *image_info,Image *image, (double) x,(double) y); (void) WriteBlobString(image,buffer); (void) CopyMagickString(tuple,"(",MagickPathExtent); - if ((pixel.colorspace == GRAYColorspace) || - (pixel.colorspace == sGRAYColorspace)) + if ((pixel.colorspace == LinearGRAYColorspace) || + (pixel.colorspace == GRAYColorspace)) ConcatenateColorComponent(&pixel,GrayPixelChannel,compliance,tuple); else { diff --git a/coders/vicar.c b/coders/vicar.c index eae7200d9..57136e02a 100644 --- a/coders/vicar.c +++ b/coders/vicar.c @@ -294,7 +294,7 @@ static Image *ReadVICARImage(const ImageInfo *image_info, /* Read VICAR pixels. */ - (void) SetImageColorspace(image,sGRAYColorspace,exception); + (void) SetImageColorspace(image,GRAYColorspace,exception); quantum_type=GrayQuantum; quantum_info=AcquireQuantumInfo(image_info,image); if (quantum_info == (QuantumInfo *) NULL) diff --git a/coders/vips.c b/coders/vips.c index a473d2f4f..847987058 100644 --- a/coders/vips.c +++ b/coders/vips.c @@ -453,7 +453,7 @@ static Image *ReadVIPSImage(const ImageInfo *image_info, break; case VIPSTypeB_W: case VIPSTypeGREY16: - SetImageColorspace(image,sGRAYColorspace,exception); + SetImageColorspace(image,GRAYColorspace,exception); if (channels == 2) image->alpha_trait=BlendPixelTrait; break; @@ -672,7 +672,7 @@ static MagickBooleanType WriteVIPSImage(const ImageInfo *image_info, case CMYKColorspace: (void) WriteBlobLong(image,VIPSTypeCMYK); break; - case sGRAYColorspace: + case GRAYColorspace: if (image->depth == 16) (void) WriteBlobLong(image, VIPSTypeGREY16); else diff --git a/coders/xcf.c b/coders/xcf.c index 2419bfb3d..6dd43348d 100644 --- a/coders/xcf.c +++ b/coders/xcf.c @@ -1089,7 +1089,7 @@ static Image *ReadXCFImage(const ImageInfo *image_info,ExceptionInfo *exception) SetImageColorspace(image,sRGBColorspace,exception); else if (image_type == GIMP_GRAY) - SetImageColorspace(image,sGRAYColorspace,exception); + SetImageColorspace(image,GRAYColorspace,exception); else if (image_type == GIMP_INDEXED) ThrowReaderException(CoderError,"ColormapTypeNotSupported"); @@ -1378,7 +1378,7 @@ static Image *ReadXCFImage(const ImageInfo *image_info,ExceptionInfo *exception) if ( image_type == GIMP_GRAY ) { QuantizeInfo qi; GetQuantizeInfo(&qi); - qi.colorspace = sGRAYColorspace; + qi.colorspace = GRAYColorspace; QuantizeImage( &qi, layer_info[j].image ); } } -- 2.40.0