]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Sun, 18 Mar 2012 21:17:23 +0000 (21:17 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Sun, 18 Mar 2012 21:17:23 +0000 (21:17 +0000)
MagickCore/channel.c
MagickCore/pixel-accessor.h
MagickCore/pixel.c
MagickCore/pixel.h

index 9f4dda7dd1935e4c60fcbdfa6c0f1cbe9d6cf229..f8cf6a35d64afca358695e5a8aa91e12558f6b4d 100644 (file)
@@ -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;
       }
index 4e64e45f82516244442ba8df4300415f40f8d0fe..bab1ef04b10f069d53ee257244186e2fde06aa92 100644 (file)
@@ -23,6 +23,7 @@ extern "C" {
 #endif
 
 #include <math.h>
+#include <MagickCore/cache.h>
 #include <MagickCore/cache-view.h>
 #include <MagickCore/color.h>
 #include <MagickCore/image.h>
@@ -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;
index 73a5f903cd365facbb080e6bf692d18d22198c08..2f38dea1c0cd10d54316f2dfa9dd6cf161e707fc 100644 (file)
@@ -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);
 }
+\f
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%                                                                             %
+%                                                                             %
+%                                                                             %
+%   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));
+}
index 031d89ab29cd8b02bce561869e527e88cda0b239..4a960cc6437d3eb963f140a297d7dd5810ab034e 100644 (file)
@@ -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),