From: cristy Date: Sun, 18 Mar 2012 21:17:23 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~6021 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=322d07da43d795a7c3b9a2d068d9a9005591cbe4;p=imagemagick --- diff --git a/MagickCore/channel.c b/MagickCore/channel.c index 9f4dda7dd..f8cf6a35d 100644 --- a/MagickCore/channel.c +++ b/MagickCore/channel.c @@ -350,10 +350,16 @@ MagickExport Image *ChannelFxImage(const Image *image,const char *expression, (LocaleCompare(token,"magenta") == 0) || (LocaleCompare(token,"y") == 0) || (LocaleCompare(token,"yellow") == 0)) - SetImageColorspace(destination_image,CMYKColorspace,exception); + (void) SetImageColorspace(destination_image,CMYKColorspace,exception); if ((LocaleCompare(token,"Cb") == 0) || (LocaleCompare(token,"Cr") == 0)) - SetImageColorspace(destination_image,YCbCrColorspace,exception); + (void) SetImageColorspace(destination_image,YCbCrColorspace, + exception); + if (LocaleCompare(token,"alpha") == 0) + (void) SetImageAlpha(destination_image,OpaqueAlpha,exception); + if (i >= GetPixelChannels(destination_image)) + SetPixelMetaChannels(destination_image,i- + GetPixelChannels(destination_image)+1,exception); GetMagickToken(p,&p,token); break; } diff --git a/MagickCore/pixel-accessor.h b/MagickCore/pixel-accessor.h index 4e64e45f8..bab1ef04b 100644 --- a/MagickCore/pixel-accessor.h +++ b/MagickCore/pixel-accessor.h @@ -23,6 +23,7 @@ extern "C" { #endif #include +#include #include #include #include @@ -650,12 +651,6 @@ static inline void SetPixelMask(const Image *restrict image, pixel[image->channel_map[MaskPixelChannel].offset]=mask; } -static inline void SetPixelMetaChannels(Image *image, - const size_t number_meta_channels) -{ - image->number_meta_channels=number_meta_channels; -} - static inline void SetPixelMetacontentExtent(Image *image,const size_t extent) { image->metacontent_extent=extent; diff --git a/MagickCore/pixel.c b/MagickCore/pixel.c index 73a5f903c..2f38dea1c 100644 --- a/MagickCore/pixel.c +++ b/MagickCore/pixel.c @@ -42,6 +42,7 @@ #include "MagickCore/property.h" #include "MagickCore/blob.h" #include "MagickCore/blob-private.h" +#include "MagickCore/cache-private.h" #include "MagickCore/color-private.h" #include "MagickCore/draw.h" #include "MagickCore/exception.h" @@ -5711,3 +5712,37 @@ MagickExport ChannelType SetPixelChannelMask(Image *image, SetPixelChannelMapMask(image,channel_mask); return(mask); } + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % +% S e t P i x e l M e t a C h a n n e l s % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% SetPixelMetaChannels() sets the image meta channels. +% +% The format of the SetPixelMetaChannels method is: +% +% MagickBooleanType SetPixelMetaChannels(Image *image, +% const size_t number_meta_channels,ExceptionInfo *exception) +% +% A description of each parameter follows: +% +% o image: the image. +% +% o number_meta_channels: the number of meta channels. +% +% o exception: return any errors or warnings in this structure. +% +*/ +MagickExport MagickBooleanType SetPixelMetaChannels(Image *image, + const size_t number_meta_channels,ExceptionInfo *exception) +{ + image->number_meta_channels=number_meta_channels; + return(SyncImagePixelCache(image,exception)); +} diff --git a/MagickCore/pixel.h b/MagickCore/pixel.h index 031d89ab2..4a960cc64 100644 --- a/MagickCore/pixel.h +++ b/MagickCore/pixel.h @@ -184,7 +184,8 @@ extern MagickExport MagickBooleanType ExceptionInfo *), IsFuzzyEquivalencePixel(const Image *,const Quantum *,const Image *, const Quantum *), - IsFuzzyEquivalencePixelInfo(const PixelInfo *,const PixelInfo *); + IsFuzzyEquivalencePixelInfo(const PixelInfo *,const PixelInfo *), + SetPixelMetaChannels(Image *,const size_t,ExceptionInfo *); extern MagickExport PixelChannelMap *AcquirePixelChannelMap(void),