Home | History | Annotate | Download | only in MagickWand
      1 /*
      2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
      3 %                                                                             %
      4 %                                                                             %
      5 %                                                                             %
      6 %        DDDD   EEEEE  PPPP   RRRR   EEEEE   CCCC   AAA   TTTTT  EEEEE        %
      7 %        D   D  E      P   P  R   R  E      C      A   A    T    E            %
      8 %        D   D  EEE    PPPPP  RRRR   EEE    C      AAAAA    T    EEE          %
      9 %        D   D  E      P      R R    E      C      A   A    T    E            %
     10 %        DDDD   EEEEE  P      R  R   EEEEE   CCCC  A   A    T    EEEEE        %
     11 %                                                                             %
     12 %                                                                             %
     13 %                       MagickWand Deprecated Methods                         %
     14 %                                                                             %
     15 %                              Software Design                                %
     16 %                                   Cristy                                    %
     17 %                                October 2002                                 %
     18 %                                                                             %
     19 %                                                                             %
     20 %  Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization      %
     21 %  dedicated to making software imaging solutions freely available.           %
     22 %                                                                             %
     23 %  You may not use this file except in compliance with the License.  You may  %
     24 %  obtain a copy of the License at                                            %
     25 %                                                                             %
     26 %    https://imagemagick.org/script/license.php                               %
     27 %                                                                             %
     28 %  Unless required by applicable law or agreed to in writing, software        %
     29 %  distributed under the License is distributed on an "AS IS" BASIS,          %
     30 %  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   %
     31 %  See the License for the specific language governing permissions and        %
     32 %  limitations under the License.                                             %
     33 %                                                                             %
     34 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     35 %
     36 %
     37 %
     38 */
     39 
     40 /*
     42   Include declarations.
     43 */
     44 #include "MagickWand/studio.h"
     45 #include "MagickWand/MagickWand.h"
     46 #include "MagickWand/magick-wand-private.h"
     47 #include "MagickWand/wand.h"
     48 #include "MagickCore/monitor-private.h"
     49 #include "MagickCore/thread-private.h"
     50 
     51 #if !defined(MAGICKCORE_EXCLUDE_DEPRECATED)
     53 
     54 /*
     56 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     57 %                                                                             %
     58 %                                                                             %
     59 %                                                                             %
     60 %   M a g i c k G e t I m a g e A l p h a C o l o r                           %
     61 %                                                                             %
     62 %                                                                             %
     63 %                                                                             %
     64 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     65 %
     66 %  MagickGetImageAlphaColor() returns the image alpha color.
     67 %
     68 %  The format of the MagickGetImageAlphaColor method is:
     69 %
     70 %      MagickBooleanType MagickGetImageAlphaColor(MagickWand *wand,
     71 %        PixelWand *alpha_color)
     72 %
     73 %  A description of each parameter follows:
     74 %
     75 %    o wand: the magick wand.
     76 %
     77 %    o alpha_color: return the alpha color.
     78 %
     79 */
     80 WandExport MagickBooleanType MagickGetImageAlphaColor(MagickWand *wand,
     81   PixelWand *alpha_color)
     82 {
     83   assert(wand != (MagickWand *)NULL);
     84   assert(wand->signature == MagickWandSignature);
     85   if (wand->debug != MagickFalse)
     86     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
     87   if (wand->images == (Image *)NULL)
     88     ThrowWandException(WandError, "ContainsNoImages", wand->name);
     89   PixelSetPixelColor(alpha_color,&wand->images->matte_color);
     90   return(MagickTrue);
     91 }
     92 
     93 /*
     95 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     96 %                                                                             %
     97 %                                                                             %
     98 %                                                                             %
     99 %   M a g i c k S e t I m a g e A l p h a C o l o r                           %
    100 %                                                                             %
    101 %                                                                             %
    102 %                                                                             %
    103 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    104 %
    105 %  MagickSetImageAlphaColor() sets the image alpha color.
    106 %
    107 %  The format of the MagickSetImageAlphaColor method is:
    108 %
    109 %      MagickBooleanType MagickSetImageAlphaColor(MagickWand *wand,
    110 %        const PixelWand *matte)
    111 %
    112 %  A description of each parameter follows:
    113 %
    114 %    o wand: the magick wand.
    115 %
    116 %    o matte: the alpha pixel wand.
    117 %
    118 */
    119 WandExport MagickBooleanType MagickSetImageAlphaColor(MagickWand *wand,
    120   const PixelWand *alpha)
    121 {
    122   assert(wand != (MagickWand *)NULL);
    123   assert(wand->signature == MagickWandSignature);
    124   if (wand->debug != MagickFalse)
    125     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
    126   if (wand->images == (Image *)NULL)
    127     ThrowWandException(WandError,"ContainsNoImages",wand->name);
    128   PixelGetQuantumPacket(alpha,&wand->images->matte_color);
    129   return(MagickTrue);
    130 }
    131 #endif
    132