Home | History | Annotate | Download | only in MagickWand
      1 /*
      2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
      3 %                                                                             %
      4 %                                                                             %
      5 %                                                                             %
      6 %                 M   M   AAA    GGGG  IIIII   CCCC  K   K                    %
      7 %                 MM MM  A   A  G        I    C      K  K                     %
      8 %                 M M M  AAAAA  G GGG    I    C      KKK                      %
      9 %                 M   M  A   A  G   G    I    C      K  K                     %
     10 %                 M   M  A   A   GGGG  IIIII   CCCC  K   K                    %
     11 %                                                                             %
     12 %           PPPP    RRRR     OOO   PPPP   EEEEE  RRRR   TTTTT  Y   Y          %
     13 %           P   P   R   R   O   O  P   P  E      R   R    T     Y Y           %
     14 %           PPPP    RRRR    O   O  PPPP   EEE    RRRR     T      Y            %
     15 %           P       R R     O   O  P      E      R R      T      Y            %
     16 %           P       R  R     OOO   P      EEEEE  R  R     T      Y            %
     17 %                                                                             %
     18 %                                                                             %
     19 %            Set or Get MagickWand Properties, Options, or Profiles           %
     20 %                                                                             %
     21 %                               Software Design                               %
     22 %                                    Cristy                                   %
     23 %                                 August 2003                                 %
     24 %                                                                             %
     25 %                                                                             %
     26 %  Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization      %
     27 %  dedicated to making software imaging solutions freely available.           %
     28 %                                                                             %
     29 %  You may not use this file except in compliance with the License.  You may  %
     30 %  obtain a copy of the License at                                            %
     31 %                                                                             %
     32 %    https://imagemagick.org/script/license.php                               %
     33 %                                                                             %
     34 %  Unless required by applicable law or agreed to in writing, software        %
     35 %  distributed under the License is distributed on an "AS IS" BASIS,          %
     36 %  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   %
     37 %  See the License for the specific language governing permissions and        %
     38 %  limitations under the License.                                             %
     39 %                                                                             %
     40 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     41 %
     42 %
     43 %
     44 */
     45 
     46 /*
     48   Include declarations.
     49 */
     50 #include "MagickWand/studio.h"
     51 #include "MagickWand/MagickWand.h"
     52 #include "MagickWand/magick-wand-private.h"
     53 #include "MagickWand/wand.h"
     54 #include "MagickCore/string-private.h"
     55 
     56 /*
     58 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     59 %                                                                             %
     60 %                                                                             %
     61 %                                                                             %
     62 %   M a g i c k D e l e t e I m a g e A r t i f a c t                         %
     63 %                                                                             %
     64 %                                                                             %
     65 %                                                                             %
     66 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     67 %
     68 %  MagickDeleteImageArtifact() deletes a wand artifact.
     69 %
     70 %  The format of the MagickDeleteImageArtifact method is:
     71 %
     72 %      MagickBooleanType MagickDeleteImageArtifact(MagickWand *wand,
     73 %        const char *artifact)
     74 %
     75 %  A description of each parameter follows:
     76 %
     77 %    o image: the image.
     78 %
     79 %    o artifact: the image artifact.
     80 %
     81 */
     82 WandExport MagickBooleanType MagickDeleteImageArtifact(MagickWand *wand,
     83   const char *artifact)
     84 {
     85   assert(wand != (MagickWand *) NULL);
     86   assert(wand->signature == MagickWandSignature);
     87   if (wand->debug != MagickFalse)
     88     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
     89 
     90   if (wand->images == (Image *) NULL)
     91     {
     92       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
     93         "ContainsNoImages","`%s'",wand->name);
     94       return(MagickFalse);
     95     }
     96   return(DeleteImageArtifact(wand->images,artifact));
     97 }
     98 
     99 /*
    101 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    102 %                                                                             %
    103 %                                                                             %
    104 %                                                                             %
    105 %   M a g i c k D e l e t e I m a g e P r o p e r t y                         %
    106 %                                                                             %
    107 %                                                                             %
    108 %                                                                             %
    109 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    110 %
    111 %  MagickDeleteImageProperty() deletes a wand property.
    112 %
    113 %  The format of the MagickDeleteImageProperty method is:
    114 %
    115 %      MagickBooleanType MagickDeleteImageProperty(MagickWand *wand,
    116 %        const char *property)
    117 %
    118 %  A description of each parameter follows:
    119 %
    120 %    o image: the image.
    121 %
    122 %    o property: the image property.
    123 %
    124 */
    125 WandExport MagickBooleanType MagickDeleteImageProperty(MagickWand *wand,
    126   const char *property)
    127 {
    128   assert(wand != (MagickWand *) NULL);
    129   assert(wand->signature == MagickWandSignature);
    130   if (wand->debug != MagickFalse)
    131     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
    132 
    133   if (wand->images == (Image *) NULL)
    134     {
    135       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
    136         "ContainsNoImages","`%s'",wand->name);
    137       return(MagickFalse);
    138     }
    139   return(DeleteImageProperty(wand->images,property));
    140 }
    141 
    142 /*
    144 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    145 %                                                                             %
    146 %                                                                             %
    147 %                                                                             %
    148 %   M a g i c k D e l e t e O p t i o n                                       %
    149 %                                                                             %
    150 %                                                                             %
    151 %                                                                             %
    152 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    153 %
    154 %  MagickDeleteOption() deletes a wand option.
    155 %
    156 %  The format of the MagickDeleteOption method is:
    157 %
    158 %      MagickBooleanType MagickDeleteOption(MagickWand *wand,
    159 %        const char *option)
    160 %
    161 %  A description of each parameter follows:
    162 %
    163 %    o image: the image.
    164 %
    165 %    o option: the image option.
    166 %
    167 */
    168 WandExport MagickBooleanType MagickDeleteOption(MagickWand *wand,
    169   const char *option)
    170 {
    171   assert(wand != (MagickWand *) NULL);
    172   assert(wand->signature == MagickWandSignature);
    173   if (wand->debug != MagickFalse)
    174     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
    175 
    176   return(DeleteImageOption(wand->image_info,option));
    177 }
    178 
    179 /*
    181 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    182 %                                                                             %
    183 %                                                                             %
    184 %                                                                             %
    185 %   M a g i c k G e t A n t i a l i a s                                       %
    186 %                                                                             %
    187 %                                                                             %
    188 %                                                                             %
    189 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    190 %
    191 %  MagickGetAntialias() returns the antialias property associated with the
    192 %  wand.
    193 %
    194 %  The format of the MagickGetAntialias method is:
    195 %
    196 %      MagickBooleanType MagickGetAntialias(const MagickWand *wand)
    197 %
    198 %  A description of each parameter follows:
    199 %
    200 %    o wand: the magick wand.
    201 %
    202 */
    203 WandExport MagickBooleanType MagickGetAntialias(const MagickWand *wand)
    204 {
    205   assert(wand != (const MagickWand *) NULL);
    206   assert(wand->signature == MagickWandSignature);
    207   if (wand->debug != MagickFalse)
    208     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
    209 
    210   return(wand->image_info->antialias);
    211 }
    212 
    213 /*
    215 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    216 %                                                                             %
    217 %                                                                             %
    218 %                                                                             %
    219 %   M a g i c k G e t B a c k g r o u n d C o l o r                           %
    220 %                                                                             %
    221 %                                                                             %
    222 %                                                                             %
    223 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    224 %
    225 %  MagickGetBackgroundColor() returns the wand background color.
    226 %
    227 %  The format of the MagickGetBackgroundColor method is:
    228 %
    229 %      PixelWand *MagickGetBackgroundColor(MagickWand *wand)
    230 %
    231 %  A description of each parameter follows:
    232 %
    233 %    o wand: the magick wand.
    234 %
    235 */
    236 WandExport PixelWand *MagickGetBackgroundColor(MagickWand *wand)
    237 {
    238   PixelWand
    239     *background_color;
    240 
    241   assert(wand != (MagickWand *) NULL);
    242   assert(wand->signature == MagickWandSignature);
    243   if (wand->debug != MagickFalse)
    244     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
    245 
    246   background_color=NewPixelWand();
    247   PixelSetPixelColor(background_color,&wand->image_info->background_color);
    248   return(background_color);
    249 }
    250 
    251 /*
    253 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    254 %                                                                             %
    255 %                                                                             %
    256 %                                                                             %
    257 %   M a g i c k G e t C o l o r s p a c e                                     %
    258 %                                                                             %
    259 %                                                                             %
    260 %                                                                             %
    261 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    262 %
    263 %  MagickGetColorspace() gets the wand colorspace type.
    264 %
    265 %  The format of the MagickGetColorspace method is:
    266 %
    267 %      ColorspaceType MagickGetColorspace(MagickWand *wand)
    268 %
    269 %  A description of each parameter follows:
    270 %
    271 %    o wand: the magick wand.
    272 %
    273 */
    274 WandExport ColorspaceType MagickGetColorspace(MagickWand *wand)
    275 {
    276   assert(wand != (MagickWand *) NULL);
    277   assert(wand->signature == MagickWandSignature);
    278   if (wand->debug != MagickFalse)
    279     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
    280 
    281   return(wand->image_info->colorspace);
    282 }
    283 
    284 /*
    286 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    287 %                                                                             %
    288 %                                                                             %
    289 %                                                                             %
    290 %   M a g i c k G e t C o m p r e s s i o n                                   %
    291 %                                                                             %
    292 %                                                                             %
    293 %                                                                             %
    294 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    295 %
    296 %  MagickGetCompression() gets the wand compression type.
    297 %
    298 %  The format of the MagickGetCompression method is:
    299 %
    300 %      CompressionType MagickGetCompression(MagickWand *wand)
    301 %
    302 %  A description of each parameter follows:
    303 %
    304 %    o wand: the magick wand.
    305 %
    306 */
    307 WandExport CompressionType MagickGetCompression(MagickWand *wand)
    308 {
    309   assert(wand != (MagickWand *) NULL);
    310   assert(wand->signature == MagickWandSignature);
    311   if (wand->debug != MagickFalse)
    312     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
    313 
    314   return(wand->image_info->compression);
    315 }
    316 
    317 /*
    319 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    320 %                                                                             %
    321 %                                                                             %
    322 %                                                                             %
    323 %   M a g i c k G e t C o m p r e s s i o n Q u a l i t y                     %
    324 %                                                                             %
    325 %                                                                             %
    326 %                                                                             %
    327 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    328 %
    329 %  MagickGetCompressionQuality() gets the wand compression quality.
    330 %
    331 %  The format of the MagickGetCompressionQuality method is:
    332 %
    333 %      size_t MagickGetCompressionQuality(MagickWand *wand)
    334 %
    335 %  A description of each parameter follows:
    336 %
    337 %    o wand: the magick wand.
    338 %
    339 */
    340 WandExport size_t MagickGetCompressionQuality(MagickWand *wand)
    341 {
    342   assert(wand != (MagickWand *) NULL);
    343   assert(wand->signature == MagickWandSignature);
    344   if (wand->debug != MagickFalse)
    345     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
    346 
    347   return(wand->image_info->quality);
    348 }
    349 
    350 /*
    352 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    353 %                                                                             %
    354 %                                                                             %
    355 %                                                                             %
    356 %   M a g i c k G e t C o p y r i g h t                                       %
    357 %                                                                             %
    358 %                                                                             %
    359 %                                                                             %
    360 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    361 %
    362 %  MagickGetCopyright() returns the ImageMagick API copyright as a string
    363 %  constant.
    364 %
    365 %  The format of the MagickGetCopyright method is:
    366 %
    367 %      const char *MagickGetCopyright(void)
    368 %
    369 */
    370 WandExport const char *MagickGetCopyright(void)
    371 {
    372   return(GetMagickCopyright());
    373 }
    374 
    375 /*
    377 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    378 %                                                                             %
    379 %                                                                             %
    380 %                                                                             %
    381 %   M a g i c k G e t F i l e n a m e                                         %
    382 %                                                                             %
    383 %                                                                             %
    384 %                                                                             %
    385 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    386 %
    387 %  MagickGetFilename() returns the filename associated with an image sequence.
    388 %
    389 %  The format of the MagickGetFilename method is:
    390 %
    391 %      const char *MagickGetFilename(const MagickWand *wand)
    392 %
    393 %  A description of each parameter follows:
    394 %
    395 %    o wand: the magick wand.
    396 %
    397 */
    398 WandExport char *MagickGetFilename(const MagickWand *wand)
    399 {
    400   assert(wand != (const MagickWand *) NULL);
    401   assert(wand->signature == MagickWandSignature);
    402   if (wand->debug != MagickFalse)
    403     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
    404 
    405   return(AcquireString(wand->image_info->filename));
    406 }
    407 
    408 /*
    410 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    411 %                                                                             %
    412 %                                                                             %
    413 %                                                                             %
    414 %   M a g i c k G e t F o n t                                                 %
    415 %                                                                             %
    416 %                                                                             %
    417 %                                                                             %
    418 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    419 %
    420 %  MagickGetFont() returns the font associated with the MagickWand.
    421 %
    422 %  The format of the MagickGetFont method is:
    423 %
    424 %      char *MagickGetFont(MagickWand *wand)
    425 %
    426 %  A description of each parameter follows:
    427 %
    428 %    o wand: the magick wand.
    429 %
    430 */
    431 WandExport char *MagickGetFont(MagickWand *wand)
    432 {
    433   assert(wand != (MagickWand *) NULL);
    434   assert(wand->signature == MagickWandSignature);
    435   if (wand->debug != MagickFalse)
    436     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
    437 
    438   if (wand->image_info->font == (char *) NULL)
    439     return((char *) NULL);
    440   return(AcquireString(wand->image_info->font));
    441 }
    442 
    443 /*
    445 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    446 %                                                                             %
    447 %                                                                             %
    448 %                                                                             %
    449 %   M a g i c k G e t F o r m a t                                             %
    450 %                                                                             %
    451 %                                                                             %
    452 %                                                                             %
    453 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    454 %
    455 %  MagickGetFormat() returns the format of the magick wand.
    456 %
    457 %  The format of the MagickGetFormat method is:
    458 %
    459 %      const char MagickGetFormat(MagickWand *wand)
    460 %
    461 %  A description of each parameter follows:
    462 %
    463 %    o wand: the magick wand.
    464 %
    465 */
    466 WandExport char *MagickGetFormat(MagickWand *wand)
    467 {
    468   assert(wand != (MagickWand *) NULL);
    469   assert(wand->signature == MagickWandSignature);
    470   if (wand->debug != MagickFalse)
    471     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
    472 
    473   return(AcquireString(wand->image_info->magick));
    474 }
    475 
    476 /*
    478 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    479 %                                                                             %
    480 %                                                                             %
    481 %                                                                             %
    482 %   M a g i c k G e t G r a v i t y                                           %
    483 %                                                                             %
    484 %                                                                             %
    485 %                                                                             %
    486 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    487 %
    488 %  MagickGetGravity() gets the wand gravity.
    489 %
    490 %  The format of the MagickGetGravity method is:
    491 %
    492 %      GravityType MagickGetGravity(MagickWand *wand)
    493 %
    494 %  A description of each parameter follows:
    495 %
    496 %    o wand: the magick wand.
    497 %
    498 */
    499 WandExport GravityType MagickGetGravity(MagickWand *wand)
    500 {
    501   const char
    502     *option;
    503 
    504   GravityType
    505     type;
    506 
    507   assert(wand != (MagickWand *) NULL);
    508   assert(wand->signature == MagickWandSignature);
    509   if (wand->debug != MagickFalse)
    510     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
    511 
    512   option=GetImageOption(wand->image_info,"gravity");
    513   if (option == (const char *) NULL)
    514     return(UndefinedGravity);
    515   type=(GravityType) ParseCommandOption(MagickGravityOptions,MagickFalse,option);
    516   return(type);
    517 }
    518 
    519 /*
    521 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    522 %                                                                             %
    523 %                                                                             %
    524 %                                                                             %
    525 %   M a g i c k G e t H o m e U R L                                           %
    526 %                                                                             %
    527 %                                                                             %
    528 %                                                                             %
    529 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    530 %
    531 %  MagickGetHomeURL() returns the ImageMagick home URL.
    532 %
    533 %  The format of the MagickGetHomeURL method is:
    534 %
    535 %      char *MagickGetHomeURL(void)
    536 %
    537 */
    538 WandExport char *MagickGetHomeURL(void)
    539 {
    540   return(GetMagickHomeURL());
    541 }
    542 
    543 /*
    545 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    546 %                                                                             %
    547 %                                                                             %
    548 %                                                                             %
    549 %   M a g i c k G e t I m a g e A r t i f a c t                               %
    550 %                                                                             %
    551 %                                                                             %
    552 %                                                                             %
    553 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    554 %
    555 %  MagickGetImageArtifact() returns a value associated with the specified
    556 %  artifact.  Use MagickRelinquishMemory() to free the value when you are
    557 %  finished with it.
    558 %
    559 %  The format of the MagickGetImageArtifact method is:
    560 %
    561 %      char *MagickGetImageArtifact(MagickWand *wand,const char *artifact)
    562 %
    563 %  A description of each parameter follows:
    564 %
    565 %    o wand: the magick wand.
    566 %
    567 %    o artifact: the artifact.
    568 %
    569 */
    570 WandExport char *MagickGetImageArtifact(MagickWand *wand,const char *artifact)
    571 {
    572   const char
    573     *value;
    574 
    575   assert(wand != (MagickWand *) NULL);
    576   assert(wand->signature == MagickWandSignature);
    577   if (wand->debug != MagickFalse)
    578     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
    579 
    580   if (wand->images == (Image *) NULL)
    581     {
    582       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
    583         "ContainsNoImages","`%s'",wand->name);
    584       return((char *) NULL);
    585     }
    586   value=GetImageArtifact(wand->images,artifact);
    587   if (value == (const char *) NULL)
    588     return((char *) NULL);
    589   return(ConstantString(value));
    590 }
    591 
    592 /*
    594 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    595 %                                                                             %
    596 %                                                                             %
    597 %                                                                             %
    598 %   M a g i c k G e t I m a g e P r o p e r t i e s                           %
    599 %                                                                             %
    600 %                                                                             %
    601 %                                                                             %
    602 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    603 %
    604 %  MagickGetImageArtifacts() returns all the artifact names that match the
    605 %  specified pattern associated with a wand.  Use MagickGetImageProperty() to
    606 %  return the value of a particular artifact.  Use MagickRelinquishMemory() to
    607 %  free the value when you are finished with it.
    608 %
    609 %  The format of the MagickGetImageArtifacts method is:
    610 %
    611 %      char *MagickGetImageArtifacts(MagickWand *wand,
    612 %        const char *pattern,size_t *number_artifacts)
    613 %
    614 %  A description of each parameter follows:
    615 %
    616 %    o wand: the magick wand.
    617 %
    618 %    o pattern: Specifies a pointer to a text string containing a pattern.
    619 %
    620 %    o number_artifacts: the number artifacts associated with this wand.
    621 %
    622 */
    623 WandExport char **MagickGetImageArtifacts(MagickWand *wand,
    624   const char *pattern,size_t *number_artifacts)
    625 {
    626   char
    627     **artifacts;
    628 
    629   const char
    630     *artifact;
    631 
    632   register ssize_t
    633     i;
    634 
    635   size_t
    636     length;
    637 
    638   assert(wand != (MagickWand *) NULL);
    639   assert(wand->signature == MagickWandSignature);
    640   if (wand->debug != MagickFalse)
    641     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
    642 
    643   if (wand->images == (Image *) NULL)
    644     {
    645       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
    646         "ContainsNoImages","`%s'",wand->name);
    647       return((char **) NULL);
    648     }
    649   (void) GetImageProperty(wand->images,"exif:*",wand->exception);
    650   length=1024;
    651   artifacts=(char **) AcquireQuantumMemory(length,sizeof(*artifacts));
    652   if (artifacts == (char **) NULL)
    653     return((char **) NULL);
    654   ResetImagePropertyIterator(wand->images);
    655   artifact=GetNextImageProperty(wand->images);
    656   for (i=0; artifact != (const char *) NULL; )
    657   {
    658     if ((*artifact != '[') &&
    659         (GlobExpression(artifact,pattern,MagickFalse) != MagickFalse))
    660       {
    661         if ((i+1) >= (ssize_t) length)
    662           {
    663             length<<=1;
    664             artifacts=(char **) ResizeQuantumMemory(artifacts,length,
    665               sizeof(*artifacts));
    666             if (artifacts == (char **) NULL)
    667               {
    668                 (void) ThrowMagickException(wand->exception,GetMagickModule(),
    669                   ResourceLimitError,"MemoryAllocationFailed","`%s'",
    670                   wand->name);
    671                 return((char **) NULL);
    672               }
    673           }
    674         artifacts[i]=ConstantString(artifact);
    675         i++;
    676       }
    677     artifact=GetNextImageProperty(wand->images);
    678   }
    679   artifacts[i]=(char *) NULL;
    680   *number_artifacts=(size_t) i;
    681   return(artifacts);
    682 }
    683 
    684 /*
    686 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    687 %                                                                             %
    688 %                                                                             %
    689 %                                                                             %
    690 %   M a g i c k G e t I m a g e P r o f i l e                                 %
    691 %                                                                             %
    692 %                                                                             %
    693 %                                                                             %
    694 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    695 %
    696 %  MagickGetImageProfile() returns the named image profile.
    697 %
    698 %  The format of the MagickGetImageProfile method is:
    699 %
    700 %      unsigned char *MagickGetImageProfile(MagickWand *wand,const char *name,
    701 %        size_t *length)
    702 %
    703 %  A description of each parameter follows:
    704 %
    705 %    o wand: the magick wand.
    706 %
    707 %    o name: Name of profile to return: ICC, IPTC, or generic profile.
    708 %
    709 %    o length: the length of the profile.
    710 %
    711 */
    712 WandExport unsigned char *MagickGetImageProfile(MagickWand *wand,
    713   const char *name,size_t *length)
    714 {
    715   const StringInfo
    716     *profile;
    717 
    718   unsigned char
    719     *datum;
    720 
    721   assert(wand != (MagickWand *) NULL);
    722   assert(wand->signature == MagickWandSignature);
    723   if (wand->debug != MagickFalse)
    724     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
    725 
    726   if (wand->images == (Image *) NULL)
    727     {
    728       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
    729         "ContainsNoImages","`%s'",wand->name);
    730       return((unsigned char *) NULL);
    731     }
    732   *length=0;
    733   if (wand->images->profiles == (SplayTreeInfo *) NULL)
    734     return((unsigned char *) NULL);
    735   profile=GetImageProfile(wand->images,name);
    736   if (profile == (StringInfo *) NULL)
    737     return((unsigned char *) NULL);
    738   datum=(unsigned char *) AcquireQuantumMemory(GetStringInfoLength(profile),
    739     sizeof(*datum));
    740   if (datum == (unsigned char *) NULL)
    741     return((unsigned char *) NULL);
    742   (void) memcpy(datum,GetStringInfoDatum(profile),
    743     GetStringInfoLength(profile));
    744   *length=(size_t) GetStringInfoLength(profile);
    745   return(datum);
    746 }
    747 
    748 /*
    750 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    751 %                                                                             %
    752 %                                                                             %
    753 %                                                                             %
    754 %   M a g i c k G e t I m a g e P r o f i l e s                               %
    755 %                                                                             %
    756 %                                                                             %
    757 %                                                                             %
    758 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    759 %
    760 %  MagickGetImageProfiles() returns all the profile names that match the
    761 %  specified pattern associated with a wand.  Use MagickGetImageProfile() to
    762 %  return the value of a particular property.  Use MagickRelinquishMemory() to
    763 %  free the value when you are finished with it.
    764 %
    765 %  The format of the MagickGetImageProfiles method is:
    766 %
    767 %      char *MagickGetImageProfiles(MagickWand *wand,const char *pattern,
    768 %        size_t *number_profiles)
    769 %
    770 %  A description of each parameter follows:
    771 %
    772 %    o wand: the magick wand.
    773 %
    774 %    o pattern: Specifies a pointer to a text string containing a pattern.
    775 %
    776 %    o number_profiles: the number profiles associated with this wand.
    777 %
    778 */
    779 WandExport char **MagickGetImageProfiles(MagickWand *wand,const char *pattern,
    780   size_t *number_profiles)
    781 {
    782   char
    783     **profiles;
    784 
    785   const char
    786     *property;
    787 
    788   register ssize_t
    789     i;
    790 
    791   size_t
    792     length;
    793 
    794   assert(wand != (MagickWand *) NULL);
    795   assert(wand->signature == MagickWandSignature);
    796   if (wand->debug != MagickFalse)
    797     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
    798 
    799   if (wand->images == (Image *) NULL)
    800     {
    801       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
    802         "ContainsNoImages","`%s'",wand->name);
    803       return((char **) NULL);
    804     }
    805   (void) GetImageProfile(wand->images,"exif:*");
    806   length=1024;
    807   profiles=(char **) AcquireQuantumMemory(length,sizeof(*profiles));
    808   if (profiles == (char **) NULL)
    809     return((char **) NULL);
    810   ResetImageProfileIterator(wand->images);
    811   property=GetNextImageProfile(wand->images);
    812   for (i=0; property != (const char *) NULL; )
    813   {
    814     if ((*property != '[') &&
    815         (GlobExpression(property,pattern,MagickFalse) != MagickFalse))
    816       {
    817         if ((i+1) >= (ssize_t) length)
    818           {
    819             length<<=1;
    820             profiles=(char **) ResizeQuantumMemory(profiles,length,
    821               sizeof(*profiles));
    822             if (profiles == (char **) NULL)
    823               {
    824                 (void) ThrowMagickException(wand->exception,GetMagickModule(),
    825                   ResourceLimitError,"MemoryAllocationFailed","`%s'",
    826                   wand->name);
    827                 return((char **) NULL);
    828               }
    829           }
    830         profiles[i]=ConstantString(property);
    831         i++;
    832       }
    833     property=GetNextImageProfile(wand->images);
    834   }
    835   profiles[i]=(char *) NULL;
    836   *number_profiles=(size_t) i;
    837   return(profiles);
    838 }
    839 
    840 /*
    842 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    843 %                                                                             %
    844 %                                                                             %
    845 %                                                                             %
    846 %   M a g i c k G e t I m a g e P r o p e r t y                               %
    847 %                                                                             %
    848 %                                                                             %
    849 %                                                                             %
    850 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    851 %
    852 %  MagickGetImageProperty() returns a value associated with the specified
    853 %  property.  Use MagickRelinquishMemory() to free the value when you are
    854 %  finished with it.
    855 %
    856 %  The format of the MagickGetImageProperty method is:
    857 %
    858 %      char *MagickGetImageProperty(MagickWand *wand,const char *property)
    859 %
    860 %  A description of each parameter follows:
    861 %
    862 %    o wand: the magick wand.
    863 %
    864 %    o property: the property.
    865 %
    866 */
    867 WandExport char *MagickGetImageProperty(MagickWand *wand,const char *property)
    868 {
    869   const char
    870     *value;
    871 
    872   assert(wand != (MagickWand *) NULL);
    873   assert(wand->signature == MagickWandSignature);
    874   if (wand->debug != MagickFalse)
    875     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
    876 
    877   if (wand->images == (Image *) NULL)
    878     {
    879       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
    880         "ContainsNoImages","`%s'",wand->name);
    881       return((char *) NULL);
    882     }
    883   value=GetImageProperty(wand->images,property,wand->exception);
    884   if (value == (const char *) NULL)
    885     return((char *) NULL);
    886   return(ConstantString(value));
    887 }
    888 
    889 /*
    891 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    892 %                                                                             %
    893 %                                                                             %
    894 %                                                                             %
    895 %   M a g i c k G e t I m a g e P r o p e r t i e s                           %
    896 %                                                                             %
    897 %                                                                             %
    898 %                                                                             %
    899 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    900 %
    901 %  MagickGetImageProperties() returns all the property names that match the
    902 %  specified pattern associated with a wand.  Use MagickGetImageProperty() to
    903 %  return the value of a particular property.  Use MagickRelinquishMemory() to
    904 %  free the value when you are finished with it.
    905 %
    906 %  The format of the MagickGetImageProperties method is:
    907 %
    908 %      char *MagickGetImageProperties(MagickWand *wand,
    909 %        const char *pattern,size_t *number_properties)
    910 %
    911 %  A description of each parameter follows:
    912 %
    913 %    o wand: the magick wand.
    914 %
    915 %    o pattern: Specifies a pointer to a text string containing a pattern.
    916 %
    917 %    o number_properties: the number properties associated with this wand.
    918 %
    919 */
    920 WandExport char **MagickGetImageProperties(MagickWand *wand,
    921   const char *pattern,size_t *number_properties)
    922 {
    923   char
    924     **properties;
    925 
    926   const char
    927     *property;
    928 
    929   register ssize_t
    930     i;
    931 
    932   size_t
    933     length;
    934 
    935   assert(wand != (MagickWand *) NULL);
    936   assert(wand->signature == MagickWandSignature);
    937   if (wand->debug != MagickFalse)
    938     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
    939 
    940   if (wand->images == (Image *) NULL)
    941     {
    942       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
    943         "ContainsNoImages","`%s'",wand->name);
    944       return((char **) NULL);
    945     }
    946   (void) GetImageProperty(wand->images,"exif:*",wand->exception);
    947   length=1024;
    948   properties=(char **) AcquireQuantumMemory(length,sizeof(*properties));
    949   if (properties == (char **) NULL)
    950     return((char **) NULL);
    951   ResetImagePropertyIterator(wand->images);
    952   property=GetNextImageProperty(wand->images);
    953   for (i=0; property != (const char *) NULL; )
    954   {
    955     if ((*property != '[') &&
    956         (GlobExpression(property,pattern,MagickFalse) != MagickFalse))
    957       {
    958         if ((i+1) >= (ssize_t) length)
    959           {
    960             length<<=1;
    961             properties=(char **) ResizeQuantumMemory(properties,length,
    962               sizeof(*properties));
    963             if (properties == (char **) NULL)
    964               {
    965                 (void) ThrowMagickException(wand->exception,GetMagickModule(),
    966                   ResourceLimitError,"MemoryAllocationFailed","`%s'",
    967                   wand->name);
    968                 return((char **) NULL);
    969               }
    970           }
    971         properties[i]=ConstantString(property);
    972         i++;
    973       }
    974     property=GetNextImageProperty(wand->images);
    975   }
    976   properties[i]=(char *) NULL;
    977   *number_properties=(size_t) i;
    978   return(properties);
    979 }
    980 
    981 /*
    983 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    984 %                                                                             %
    985 %                                                                             %
    986 %                                                                             %
    987 %   M a g i c k G e t I n t e r l a c e S c h e m e                           %
    988 %                                                                             %
    989 %                                                                             %
    990 %                                                                             %
    991 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    992 %
    993 %  MagickGetInterlaceScheme() gets the wand interlace scheme.
    994 %
    995 %  The format of the MagickGetInterlaceScheme method is:
    996 %
    997 %      InterlaceType MagickGetInterlaceScheme(MagickWand *wand)
    998 %
    999 %  A description of each parameter follows:
   1000 %
   1001 %    o wand: the magick wand.
   1002 %
   1003 */
   1004 WandExport InterlaceType MagickGetInterlaceScheme(MagickWand *wand)
   1005 {
   1006   assert(wand != (MagickWand *) NULL);
   1007   assert(wand->signature == MagickWandSignature);
   1008   if (wand->debug != MagickFalse)
   1009     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
   1010 
   1011   return(wand->image_info->interlace);
   1012 }
   1013 
   1014 /*
   1016 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   1017 %                                                                             %
   1018 %                                                                             %
   1019 %                                                                             %
   1020 %   M a g i c k G e t I n t e r p o l a t e M e t h o d                       %
   1021 %                                                                             %
   1022 %                                                                             %
   1023 %                                                                             %
   1024 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   1025 %
   1026 %  MagickGetInterpolateMethod() gets the wand compression.
   1027 %
   1028 %  The format of the MagickGetInterpolateMethod method is:
   1029 %
   1030 %      PixelInterpolateMethod MagickGetInterpolateMethod(MagickWand *wand)
   1031 %
   1032 %  A description of each parameter follows:
   1033 %
   1034 %    o wand: the magick wand.
   1035 %
   1036 */
   1037 WandExport PixelInterpolateMethod MagickGetInterpolateMethod(MagickWand *wand)
   1038 {
   1039   const char
   1040     *option;
   1041 
   1042   PixelInterpolateMethod
   1043     method;
   1044 
   1045   assert(wand != (MagickWand *) NULL);
   1046   assert(wand->signature == MagickWandSignature);
   1047   if (wand->debug != MagickFalse)
   1048     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
   1049 
   1050   option=GetImageOption(wand->image_info,"interpolate");
   1051   if (option == (const char *) NULL)
   1052     return(UndefinedInterpolatePixel);
   1053   method=(PixelInterpolateMethod) ParseCommandOption(MagickInterpolateOptions,
   1054     MagickFalse,option);
   1055   return(method);
   1056 }
   1057 
   1058 /*
   1060 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   1061 %                                                                             %
   1062 %                                                                             %
   1063 %                                                                             %
   1064 %   M a g i c k G e t O p t i o n                                             %
   1065 %                                                                             %
   1066 %                                                                             %
   1067 %                                                                             %
   1068 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   1069 %
   1070 %  MagickGetOption() returns a value associated with a wand and the specified
   1071 %  key.  Use MagickRelinquishMemory() to free the value when you are finished
   1072 %  with it.
   1073 %
   1074 %  The format of the MagickGetOption method is:
   1075 %
   1076 %      char *MagickGetOption(MagickWand *wand,const char *key)
   1077 %
   1078 %  A description of each parameter follows:
   1079 %
   1080 %    o wand: the magick wand.
   1081 %
   1082 %    o key: the key.
   1083 %
   1084 */
   1085 WandExport char *MagickGetOption(MagickWand *wand,const char *key)
   1086 {
   1087   const char
   1088     *option;
   1089 
   1090   assert(wand != (MagickWand *) NULL);
   1091   assert(wand->signature == MagickWandSignature);
   1092   if (wand->debug != MagickFalse)
   1093     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
   1094 
   1095   option=GetImageOption(wand->image_info,key);
   1096   return(ConstantString(option));
   1097 }
   1098 
   1099 /*
   1101 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   1102 %                                                                             %
   1103 %                                                                             %
   1104 %                                                                             %
   1105 %   M a g i c k G e t O p t i o n s                                           %
   1106 %                                                                             %
   1107 %                                                                             %
   1108 %                                                                             %
   1109 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   1110 %
   1111 %  MagickGetOptions() returns all the option names that match the specified
   1112 %  pattern associated with a wand.  Use MagickGetOption() to return the value
   1113 %  of a particular option.  Use MagickRelinquishMemory() to free the value
   1114 %  when you are finished with it.
   1115 %
   1116 %  The format of the MagickGetOptions method is:
   1117 %
   1118 %      char *MagickGetOptions(MagickWand *wand,const char *pattern,
   1119 %        size_t *number_options)
   1120 %
   1121 %  A description of each parameter follows:
   1122 %
   1123 %    o wand: the magick wand.
   1124 %
   1125 %    o pattern: Specifies a pointer to a text string containing a pattern.
   1126 %
   1127 %    o number_options: the number options associated with this wand.
   1128 %
   1129 */
   1130 WandExport char **MagickGetOptions(MagickWand *wand,const char *pattern,
   1131   size_t *number_options)
   1132 {
   1133   char
   1134     **options;
   1135 
   1136   const char
   1137     *option;
   1138 
   1139   register ssize_t
   1140     i;
   1141 
   1142   size_t
   1143     length;
   1144 
   1145   assert(wand != (MagickWand *) NULL);
   1146   assert(wand->signature == MagickWandSignature);
   1147   if (wand->debug != MagickFalse)
   1148     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
   1149 
   1150   if (wand->images == (Image *) NULL)
   1151     {
   1152       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
   1153         "ContainsNoImages","`%s'",wand->name);
   1154       return((char **) NULL);
   1155     }
   1156   length=1024;
   1157   options=(char **) AcquireQuantumMemory(length,sizeof(*options));
   1158   if (options == (char **) NULL)
   1159     return((char **) NULL);
   1160   ResetImageOptionIterator(wand->image_info);
   1161   option=GetNextImageOption(wand->image_info);
   1162   for (i=0; option != (const char *) NULL; )
   1163   {
   1164     if ((*option != '[') &&
   1165         (GlobExpression(option,pattern,MagickFalse) != MagickFalse))
   1166       {
   1167         if ((i+1) >= (ssize_t) length)
   1168           {
   1169             length<<=1;
   1170             options=(char **) ResizeQuantumMemory(options,length,
   1171               sizeof(*options));
   1172             if (options == (char **) NULL)
   1173               {
   1174                 (void) ThrowMagickException(wand->exception,GetMagickModule(),
   1175                   ResourceLimitError,"MemoryAllocationFailed","`%s'",
   1176                   wand->name);
   1177                 return((char **) NULL);
   1178               }
   1179           }
   1180         options[i]=ConstantString(option);
   1181         i++;
   1182       }
   1183     option=GetNextImageOption(wand->image_info);
   1184   }
   1185   options[i]=(char *) NULL;
   1186   *number_options=(size_t) i;
   1187   return(options);
   1188 }
   1189 
   1190 /*
   1192 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   1193 %                                                                             %
   1194 %                                                                             %
   1195 %                                                                             %
   1196 %   M a g i c k G e t O r i e n t a t i o n                                   %
   1197 %                                                                             %
   1198 %                                                                             %
   1199 %                                                                             %
   1200 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   1201 %
   1202 %  MagickGetOrientation() gets the wand orientation type.
   1203 %
   1204 %  The format of the MagickGetOrientation method is:
   1205 %
   1206 %      OrientationType MagickGetOrientation(MagickWand *wand)
   1207 %
   1208 %  A description of each parameter follows:
   1209 %
   1210 %    o wand: the magick wand.
   1211 %
   1212 */
   1213 WandExport OrientationType MagickGetOrientation(MagickWand *wand)
   1214 {
   1215   assert(wand != (MagickWand *) NULL);
   1216   assert(wand->signature == MagickWandSignature);
   1217   if (wand->debug != MagickFalse)
   1218     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
   1219 
   1220   return(wand->image_info->orientation);
   1221 }
   1222 
   1223 /*
   1225 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   1226 %                                                                             %
   1227 %                                                                             %
   1228 %                                                                             %
   1229 %   M a g i c k G e t P a c k a g e N a m e                                   %
   1230 %                                                                             %
   1231 %                                                                             %
   1232 %                                                                             %
   1233 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   1234 %
   1235 %  MagickGetPackageName() returns the ImageMagick package name as a string
   1236 %  constant.
   1237 %
   1238 %  The format of the MagickGetPackageName method is:
   1239 %
   1240 %      const char *MagickGetPackageName(void)
   1241 %
   1242 %
   1243 */
   1244 WandExport const char *MagickGetPackageName(void)
   1245 {
   1246   return(GetMagickPackageName());
   1247 }
   1248 
   1249 /*
   1251 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   1252 %                                                                             %
   1253 %                                                                             %
   1254 %                                                                             %
   1255 %   M a g i c k G e t P a g e                                                 %
   1256 %                                                                             %
   1257 %                                                                             %
   1258 %                                                                             %
   1259 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   1260 %
   1261 %  MagickGetPage() returns the page geometry associated with the magick wand.
   1262 %
   1263 %  The format of the MagickGetPage method is:
   1264 %
   1265 %      MagickBooleanType MagickGetPage(const MagickWand *wand,
   1266 %        size_t *width,size_t *height,ssize_t *x,ssize_t *y)
   1267 %
   1268 %  A description of each parameter follows:
   1269 %
   1270 %    o wand: the magick wand.
   1271 %
   1272 %    o width: the page width.
   1273 %
   1274 %    o height: page height.
   1275 %
   1276 %    o x: the page x-offset.
   1277 %
   1278 %    o y: the page y-offset.
   1279 %
   1280 */
   1281 WandExport MagickBooleanType MagickGetPage(const MagickWand *wand,
   1282   size_t *width,size_t *height,ssize_t *x,ssize_t *y)
   1283 {
   1284   RectangleInfo
   1285     geometry;
   1286 
   1287   assert(wand != (const MagickWand *) NULL);
   1288   assert(wand->signature == MagickWandSignature);
   1289   if (wand->debug != MagickFalse)
   1290     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
   1291 
   1292   (void) memset(&geometry,0,sizeof(geometry));
   1293   (void) ParseAbsoluteGeometry(wand->image_info->page,&geometry);
   1294   *width=geometry.width;
   1295   *height=geometry.height;
   1296   *x=geometry.x;
   1297   *y=geometry.y;
   1298   return(MagickTrue);
   1299 }
   1300 
   1301 /*
   1303 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   1304 %                                                                             %
   1305 %                                                                             %
   1306 %                                                                             %
   1307 %   M a g i c k G e t P o i n t s i z e                                       %
   1308 %                                                                             %
   1309 %                                                                             %
   1310 %                                                                             %
   1311 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   1312 %
   1313 %  MagickGetPointsize() returns the font pointsize associated with the
   1314 %  MagickWand.
   1315 %
   1316 %  The format of the MagickGetPointsize method is:
   1317 %
   1318 %      double MagickGetPointsize(MagickWand *wand)
   1319 %
   1320 %  A description of each parameter follows:
   1321 %
   1322 %    o wand: the magick wand.
   1323 %
   1324 */
   1325 WandExport double MagickGetPointsize(MagickWand *wand)
   1326 {
   1327   assert(wand != (MagickWand *) NULL);
   1328   assert(wand->signature == MagickWandSignature);
   1329   if (wand->debug != MagickFalse)
   1330     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
   1331 
   1332   return(wand->image_info->pointsize);
   1333 }
   1334 
   1335 /*
   1337 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   1338 %                                                                             %
   1339 %                                                                             %
   1340 %                                                                             %
   1341 %   M a g i c k G e t Q u a n t u m D e p t h                                 %
   1342 %                                                                             %
   1343 %                                                                             %
   1344 %                                                                             %
   1345 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   1346 %
   1347 %  MagickGetQuantumDepth() returns the ImageMagick quantum depth as a string
   1348 %  constant.
   1349 %
   1350 %  The format of the MagickGetQuantumDepth method is:
   1351 %
   1352 %      const char *MagickGetQuantumDepth(size_t *depth)
   1353 %
   1354 %  A description of each parameter follows:
   1355 %
   1356 %    o depth: the quantum depth is returned as a number.
   1357 %
   1358 */
   1359 WandExport const char *MagickGetQuantumDepth(size_t *depth)
   1360 {
   1361   return(GetMagickQuantumDepth(depth));
   1362 }
   1363 
   1364 /*
   1366 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   1367 %                                                                             %
   1368 %                                                                             %
   1369 %                                                                             %
   1370 %   M a g i c k G e t Q u a n t u m R a n g e                                 %
   1371 %                                                                             %
   1372 %                                                                             %
   1373 %                                                                             %
   1374 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   1375 %
   1376 %  MagickGetQuantumRange() returns the ImageMagick quantum range as a string
   1377 %  constant.
   1378 %
   1379 %  The format of the MagickGetQuantumRange method is:
   1380 %
   1381 %      const char *MagickGetQuantumRange(size_t *range)
   1382 %
   1383 %  A description of each parameter follows:
   1384 %
   1385 %    o range: the quantum range is returned as a number.
   1386 %
   1387 */
   1388 WandExport const char *MagickGetQuantumRange(size_t *range)
   1389 {
   1390   return(GetMagickQuantumRange(range));
   1391 }
   1392 
   1393 /*
   1395 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   1396 %                                                                             %
   1397 %                                                                             %
   1398 %                                                                             %
   1399 %   M a g i c k G e t R e l e a s e D a t e                                   %
   1400 %                                                                             %
   1401 %                                                                             %
   1402 %                                                                             %
   1403 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   1404 %
   1405 %  MagickGetReleaseDate() returns the ImageMagick release date as a string
   1406 %  constant.
   1407 %
   1408 %  The format of the MagickGetReleaseDate method is:
   1409 %
   1410 %      const char *MagickGetReleaseDate(void)
   1411 %
   1412 */
   1413 WandExport const char *MagickGetReleaseDate(void)
   1414 {
   1415   return(GetMagickReleaseDate());
   1416 }
   1417 
   1418 /*
   1420 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   1421 %                                                                             %
   1422 %                                                                             %
   1423 %                                                                             %
   1424 %   M a g i c k G e t R e s o l u t i o n                                     %
   1425 %                                                                             %
   1426 %                                                                             %
   1427 %                                                                             %
   1428 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   1429 %
   1430 %  MagickGetResolution() gets the image X and Y resolution.
   1431 %
   1432 %  The format of the MagickGetResolution method is:
   1433 %
   1434 %      MagickBooleanType MagickGetResolution(const MagickWand *wand,double *x,
   1435 %        double *y)
   1436 %
   1437 %  A description of each parameter follows:
   1438 %
   1439 %    o wand: the magick wand.
   1440 %
   1441 %    o x: the x-resolution.
   1442 %
   1443 %    o y: the y-resolution.
   1444 %
   1445 */
   1446 WandExport MagickBooleanType MagickGetResolution(const MagickWand *wand,
   1447   double *x,double *y)
   1448 {
   1449   assert(wand != (MagickWand *) NULL);
   1450   assert(wand->signature == MagickWandSignature);
   1451   if (wand->debug != MagickFalse)
   1452     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
   1453 
   1454   *x=72.0;
   1455   *y=72.0;
   1456   if (wand->image_info->density != (char *) NULL)
   1457     {
   1458       GeometryInfo
   1459         geometry_info;
   1460 
   1461       MagickStatusType
   1462         flags;
   1463 
   1464       flags=ParseGeometry(wand->image_info->density,&geometry_info);
   1465       *x=geometry_info.rho;
   1466       *y=geometry_info.sigma;
   1467       if ((flags & SigmaValue) == 0)
   1468         *y=(*x);
   1469     }
   1470   return(MagickTrue);
   1471 }
   1472 
   1473 /*
   1475 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   1476 %                                                                             %
   1477 %                                                                             %
   1478 %                                                                             %
   1479 %   M a g i c k G e t R e s o u r c e                                         %
   1480 %                                                                             %
   1481 %                                                                             %
   1482 %                                                                             %
   1483 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   1484 %
   1485 %  MagickGetResource() returns the specified resource in megabytes.
   1486 %
   1487 %  The format of the MagickGetResource method is:
   1488 %
   1489 %      MagickSizeType MagickGetResource(const ResourceType type)
   1490 %
   1491 %  A description of each parameter follows:
   1492 %
   1493 %    o wand: the magick wand.
   1494 %
   1495 */
   1496 WandExport MagickSizeType MagickGetResource(const ResourceType type)
   1497 {
   1498   return(GetMagickResource(type));
   1499 }
   1500 
   1501 /*
   1503 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   1504 %                                                                             %
   1505 %                                                                             %
   1506 %                                                                             %
   1507 %   M a g i c k G e t R e s o u r c e L i m i t                               %
   1508 %                                                                             %
   1509 %                                                                             %
   1510 %                                                                             %
   1511 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   1512 %
   1513 %  MagickGetResourceLimit() returns the specified resource limit in megabytes.
   1514 %
   1515 %  The format of the MagickGetResourceLimit method is:
   1516 %
   1517 %      MagickSizeType MagickGetResourceLimit(const ResourceType type)
   1518 %
   1519 %  A description of each parameter follows:
   1520 %
   1521 %    o wand: the magick wand.
   1522 %
   1523 */
   1524 WandExport MagickSizeType MagickGetResourceLimit(const ResourceType type)
   1525 {
   1526   return(GetMagickResourceLimit(type));
   1527 }
   1528 
   1529 /*
   1531 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   1532 %                                                                             %
   1533 %                                                                             %
   1534 %                                                                             %
   1535 %   M a g i c k G e t S a m p l i n g F a c t o r s                           %
   1536 %                                                                             %
   1537 %                                                                             %
   1538 %                                                                             %
   1539 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   1540 %
   1541 %  MagickGetSamplingFactors() gets the horizontal and vertical sampling factor.
   1542 %
   1543 %  The format of the MagickGetSamplingFactors method is:
   1544 %
   1545 %      double *MagickGetSamplingFactor(MagickWand *wand,
   1546 %        size_t *number_factors)
   1547 %
   1548 %  A description of each parameter follows:
   1549 %
   1550 %    o wand: the magick wand.
   1551 %
   1552 %    o number_factors: the number of factors in the returned array.
   1553 %
   1554 */
   1555 WandExport double *MagickGetSamplingFactors(MagickWand *wand,
   1556   size_t *number_factors)
   1557 {
   1558   double
   1559     *sampling_factors;
   1560 
   1561   register const char
   1562     *p;
   1563 
   1564   register ssize_t
   1565     i;
   1566 
   1567   assert(wand != (MagickWand *) NULL);
   1568   assert(wand->signature == MagickWandSignature);
   1569   if (wand->debug != MagickFalse)
   1570     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
   1571 
   1572   *number_factors=0;
   1573   sampling_factors=(double *) NULL;
   1574   if (wand->image_info->sampling_factor == (char *) NULL)
   1575     return(sampling_factors);
   1576   i=0;
   1577   for (p=wand->image_info->sampling_factor; p != (char *) NULL; p=strchr(p,','))
   1578   {
   1579     while (((int) *p != 0) && ((isspace((int) ((unsigned char) *p)) != 0) ||
   1580            (*p == ',')))
   1581       p++;
   1582     i++;
   1583   }
   1584   sampling_factors=(double *) AcquireQuantumMemory((size_t) i+1,
   1585     sizeof(*sampling_factors));
   1586   if (sampling_factors == (double *) NULL)
   1587     ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed",
   1588       wand->image_info->filename);
   1589   i=0;
   1590   for (p=wand->image_info->sampling_factor; p != (char *) NULL; p=strchr(p,','))
   1591   {
   1592     while (((int) *p != 0) && ((isspace((int) ((unsigned char) *p)) != 0) ||
   1593            (*p == ',')))
   1594       p++;
   1595     sampling_factors[i]=StringToDouble(p,(char **) NULL);
   1596     i++;
   1597   }
   1598   *number_factors=(size_t) i;
   1599   return(sampling_factors);
   1600 }
   1601 
   1602 /*
   1604 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   1605 %                                                                             %
   1606 %                                                                             %
   1607 %                                                                             %
   1608 %   M a g i c k G e t S i z e                                                 %
   1609 %                                                                             %
   1610 %                                                                             %
   1611 %                                                                             %
   1612 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   1613 %
   1614 %  MagickGetSize() returns the size associated with the magick wand.
   1615 %
   1616 %  The format of the MagickGetSize method is:
   1617 %
   1618 %      MagickBooleanType MagickGetSize(const MagickWand *wand,
   1619 %        size_t *columns,size_t *rows)
   1620 %
   1621 %  A description of each parameter follows:
   1622 %
   1623 %    o wand: the magick wand.
   1624 %
   1625 %    o columns: the width in pixels.
   1626 %
   1627 %    o height: the height in pixels.
   1628 %
   1629 */
   1630 WandExport MagickBooleanType MagickGetSize(const MagickWand *wand,
   1631   size_t *columns,size_t *rows)
   1632 {
   1633   RectangleInfo
   1634     geometry;
   1635 
   1636   assert(wand != (const MagickWand *) NULL);
   1637   assert(wand->signature == MagickWandSignature);
   1638   if (wand->debug != MagickFalse)
   1639     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
   1640 
   1641   (void) memset(&geometry,0,sizeof(geometry));
   1642   (void) ParseAbsoluteGeometry(wand->image_info->size,&geometry);
   1643   *columns=geometry.width;
   1644   *rows=geometry.height;
   1645   return(MagickTrue);
   1646 }
   1647 
   1648 /*
   1650 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   1651 %                                                                             %
   1652 %                                                                             %
   1653 %                                                                             %
   1654 %   M a g i c k G e t S i z e O f f s e t                                     %
   1655 %                                                                             %
   1656 %                                                                             %
   1657 %                                                                             %
   1658 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   1659 %
   1660 %  MagickGetSizeOffset() returns the size offset associated with the magick
   1661 %  wand.
   1662 %
   1663 %  The format of the MagickGetSizeOffset method is:
   1664 %
   1665 %      MagickBooleanType MagickGetSizeOffset(const MagickWand *wand,
   1666 %        ssize_t *offset)
   1667 %
   1668 %  A description of each parameter follows:
   1669 %
   1670 %    o wand: the magick wand.
   1671 %
   1672 %    o offset: the image offset.
   1673 %
   1674 */
   1675 WandExport MagickBooleanType MagickGetSizeOffset(const MagickWand *wand,
   1676   ssize_t *offset)
   1677 {
   1678   RectangleInfo
   1679     geometry;
   1680 
   1681   assert(wand != (const MagickWand *) NULL);
   1682   assert(wand->signature == MagickWandSignature);
   1683   if (wand->debug != MagickFalse)
   1684     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
   1685 
   1686   (void) memset(&geometry,0,sizeof(geometry));
   1687   (void) ParseAbsoluteGeometry(wand->image_info->size,&geometry);
   1688   *offset=geometry.x;
   1689   return(MagickTrue);
   1690 }
   1691 
   1692 /*
   1694 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   1695 %                                                                             %
   1696 %                                                                             %
   1697 %                                                                             %
   1698 %   M a g i c k G e t T y p e                                                 %
   1699 %                                                                             %
   1700 %                                                                             %
   1701 %                                                                             %
   1702 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   1703 %
   1704 %  MagickGetType() returns the wand type.
   1705 %
   1706 %  The format of the MagickGetType method is:
   1707 %
   1708 %      ImageType MagickGetType(MagickWand *wand)
   1709 %
   1710 %  A description of each parameter follows:
   1711 %
   1712 %    o wand: the magick wand.
   1713 %
   1714 */
   1715 WandExport ImageType MagickGetType(MagickWand *wand)
   1716 {
   1717   assert(wand != (MagickWand *) NULL);
   1718   assert(wand->signature == MagickWandSignature);
   1719   if (wand->debug != MagickFalse)
   1720     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
   1721 
   1722   return(wand->image_info->type);
   1723 }
   1724 
   1725 /*
   1727 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   1728 %                                                                             %
   1729 %                                                                             %
   1730 %                                                                             %
   1731 %   M a g i c k G e t V e r s i o n                                           %
   1732 %                                                                             %
   1733 %                                                                             %
   1734 %                                                                             %
   1735 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   1736 %
   1737 %  MagickGetVersion() returns the ImageMagick API version as a string constant
   1738 %  and as a number.
   1739 %
   1740 %  The format of the MagickGetVersion method is:
   1741 %
   1742 %      const char *MagickGetVersion(size_t *version)
   1743 %
   1744 %  A description of each parameter follows:
   1745 %
   1746 %    o version: the ImageMagick version is returned as a number.
   1747 %
   1748 */
   1749 WandExport const char *MagickGetVersion(size_t *version)
   1750 {
   1751   return(GetMagickVersion(version));
   1752 }
   1753 
   1754 /*
   1756 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   1757 %                                                                             %
   1758 %                                                                             %
   1759 %                                                                             %
   1760 %   M a g i c k P r o f i l e I m a g e                                       %
   1761 %                                                                             %
   1762 %                                                                             %
   1763 %                                                                             %
   1764 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   1765 %
   1766 %  MagickProfileImage() adds or removes a ICC, IPTC, or generic profile
   1767 %  from an image.  If the profile is NULL, it is removed from the image
   1768 %  otherwise added.  Use a name of '*' and a profile of NULL to remove all
   1769 %  profiles from the image.
   1770 %
   1771 %  The format of the MagickProfileImage method is:
   1772 %
   1773 %      MagickBooleanType MagickProfileImage(MagickWand *wand,const char *name,
   1774 %        const void *profile,const size_t length)
   1775 %
   1776 %  A description of each parameter follows:
   1777 %
   1778 %    o wand: the magick wand.
   1779 %
   1780 %    o name: Name of profile to add or remove: ICC, IPTC, or generic profile.
   1781 %
   1782 %    o profile: the profile.
   1783 %
   1784 %    o length: the length of the profile.
   1785 %
   1786 */
   1787 WandExport MagickBooleanType MagickProfileImage(MagickWand *wand,
   1788   const char *name,const void *profile,const size_t length)
   1789 {
   1790   assert(wand != (MagickWand *) NULL);
   1791   assert(wand->signature == MagickWandSignature);
   1792   if (wand->debug != MagickFalse)
   1793     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
   1794 
   1795   if (wand->images == (Image *) NULL)
   1796     ThrowWandException(WandError,"ContainsNoImages",wand->name);
   1797   return(ProfileImage(wand->images,name,profile,length,wand->exception));
   1798 }
   1799 
   1800 /*
   1802 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   1803 %                                                                             %
   1804 %                                                                             %
   1805 %                                                                             %
   1806 %   M a g i c k R e m o v e I m a g e P r o f i l e                           %
   1807 %                                                                             %
   1808 %                                                                             %
   1809 %                                                                             %
   1810 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   1811 %
   1812 %  MagickRemoveImageProfile() removes the named image profile and returns it.
   1813 %
   1814 %  The format of the MagickRemoveImageProfile method is:
   1815 %
   1816 %      unsigned char *MagickRemoveImageProfile(MagickWand *wand,
   1817 %        const char *name,size_t *length)
   1818 %
   1819 %  A description of each parameter follows:
   1820 %
   1821 %    o wand: the magick wand.
   1822 %
   1823 %    o name: Name of profile to return: ICC, IPTC, or generic profile.
   1824 %
   1825 %    o length: the length of the profile.
   1826 %
   1827 */
   1828 WandExport unsigned char *MagickRemoveImageProfile(MagickWand *wand,
   1829   const char *name,size_t *length)
   1830 {
   1831   StringInfo
   1832     *profile;
   1833 
   1834   unsigned char
   1835     *datum;
   1836 
   1837   assert(wand != (MagickWand *) NULL);
   1838   assert(wand->signature == MagickWandSignature);
   1839   if (wand->debug != MagickFalse)
   1840     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
   1841 
   1842   if (wand->images == (Image *) NULL)
   1843     {
   1844       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
   1845         "ContainsNoImages","`%s'",wand->name);
   1846       return((unsigned char *) NULL);
   1847     }
   1848   *length=0;
   1849   profile=RemoveImageProfile(wand->images,name);
   1850   if (profile == (StringInfo *) NULL)
   1851     return((unsigned char *) NULL);
   1852   datum=(unsigned char *) AcquireQuantumMemory(GetStringInfoLength(profile),
   1853     sizeof(*datum));
   1854   if (datum == (unsigned char *) NULL)
   1855     return((unsigned char *) NULL);
   1856   (void) memcpy(datum,GetStringInfoDatum(profile),
   1857     GetStringInfoLength(profile));
   1858   *length=GetStringInfoLength(profile);
   1859   profile=DestroyStringInfo(profile);
   1860   return(datum);
   1861 }
   1862 
   1863 /*
   1865 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   1866 %                                                                             %
   1867 %                                                                             %
   1868 %                                                                             %
   1869 %   M a g i c k S e t A n t i a l i a s                                       %
   1870 %                                                                             %
   1871 %                                                                             %
   1872 %                                                                             %
   1873 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   1874 %
   1875 %  MagickSetAntialias() sets the antialias propery of the wand.
   1876 %
   1877 %  The format of the MagickSetAntialias method is:
   1878 %
   1879 %      MagickBooleanType MagickSetAntialias(MagickWand *wand,
   1880 %        const MagickBooleanType antialias)
   1881 %
   1882 %  A description of each parameter follows:
   1883 %
   1884 %    o wand: the magick wand.
   1885 %
   1886 %    o antialias: the antialias property.
   1887 %
   1888 */
   1889 WandExport MagickBooleanType MagickSetAntialias(MagickWand *wand,
   1890   const MagickBooleanType antialias)
   1891 {
   1892   assert(wand != (MagickWand *) NULL);
   1893   assert(wand->signature == MagickWandSignature);
   1894   if (wand->debug != MagickFalse)
   1895     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
   1896 
   1897   wand->image_info->antialias=antialias;
   1898   return(MagickTrue);
   1899 }
   1900 
   1901 /*
   1903 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   1904 %                                                                             %
   1905 %                                                                             %
   1906 %                                                                             %
   1907 %   M a g i c k S e t B a c k g r o u n d C o l o r                           %
   1908 %                                                                             %
   1909 %                                                                             %
   1910 %                                                                             %
   1911 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   1912 %
   1913 %  MagickSetBackgroundColor() sets the wand background color.
   1914 %
   1915 %  The format of the MagickSetBackgroundColor method is:
   1916 %
   1917 %      MagickBooleanType MagickSetBackgroundColor(MagickWand *wand,
   1918 %        const PixelWand *background)
   1919 %
   1920 %  A description of each parameter follows:
   1921 %
   1922 %    o wand: the magick wand.
   1923 %
   1924 %    o background: the background pixel wand.
   1925 %
   1926 */
   1927 WandExport MagickBooleanType MagickSetBackgroundColor(MagickWand *wand,
   1928   const PixelWand *background)
   1929 {
   1930   assert(wand != (MagickWand *) NULL);
   1931   assert(wand->signature == MagickWandSignature);
   1932   if (wand->debug != MagickFalse)
   1933     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
   1934 
   1935   PixelGetQuantumPacket(background,&wand->image_info->background_color);
   1936   return(MagickTrue);
   1937 }
   1938 
   1939 /*
   1941 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   1942 %                                                                             %
   1943 %                                                                             %
   1944 %                                                                             %
   1945 %   M a g i c k S e t C o l o r s p a c e                                     %
   1946 %                                                                             %
   1947 %                                                                             %
   1948 %                                                                             %
   1949 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   1950 %
   1951 %  MagickSetColorspace() sets the wand colorspace type.
   1952 %
   1953 %  The format of the MagickSetColorspace method is:
   1954 %
   1955 %      MagickBooleanType MagickSetColorspace(MagickWand *wand,
   1956 %        const ColorspaceType colorspace)
   1957 %
   1958 %  A description of each parameter follows:
   1959 %
   1960 %    o wand: the magick wand.
   1961 %
   1962 %    o colorspace: the wand colorspace.
   1963 %
   1964 */
   1965 WandExport MagickBooleanType MagickSetColorspace(MagickWand *wand,
   1966   const ColorspaceType colorspace)
   1967 {
   1968   assert(wand != (MagickWand *) NULL);
   1969   assert(wand->signature == MagickWandSignature);
   1970   if (wand->debug != MagickFalse)
   1971     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
   1972 
   1973   wand->image_info->colorspace=colorspace;
   1974   return(MagickTrue);
   1975 }
   1976 
   1977 /*
   1979 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   1980 %                                                                             %
   1981 %                                                                             %
   1982 %                                                                             %
   1983 %   M a g i c k S e t C o m p r e s s i o n                                   %
   1984 %                                                                             %
   1985 %                                                                             %
   1986 %                                                                             %
   1987 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   1988 %
   1989 %  MagickSetCompression() sets the wand compression type.
   1990 %
   1991 %  The format of the MagickSetCompression method is:
   1992 %
   1993 %      MagickBooleanType MagickSetCompression(MagickWand *wand,
   1994 %        const CompressionType compression)
   1995 %
   1996 %  A description of each parameter follows:
   1997 %
   1998 %    o wand: the magick wand.
   1999 %
   2000 %    o compression: the wand compression.
   2001 %
   2002 */
   2003 WandExport MagickBooleanType MagickSetCompression(MagickWand *wand,
   2004   const CompressionType compression)
   2005 {
   2006   assert(wand != (MagickWand *) NULL);
   2007   assert(wand->signature == MagickWandSignature);
   2008   if (wand->debug != MagickFalse)
   2009     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
   2010 
   2011   wand->image_info->compression=compression;
   2012   return(MagickTrue);
   2013 }
   2014 
   2015 /*
   2017 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   2018 %                                                                             %
   2019 %                                                                             %
   2020 %                                                                             %
   2021 %   M a g i c k S e t C o m p r e s s i o n Q u a l i t y                     %
   2022 %                                                                             %
   2023 %                                                                             %
   2024 %                                                                             %
   2025 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   2026 %
   2027 %  MagickSetCompressionQuality() sets the wand compression quality.
   2028 %
   2029 %  The format of the MagickSetCompressionQuality method is:
   2030 %
   2031 %      MagickBooleanType MagickSetCompressionQuality(MagickWand *wand,
   2032 %        const size_t quality)
   2033 %
   2034 %  A description of each parameter follows:
   2035 %
   2036 %    o wand: the magick wand.
   2037 %
   2038 %    o quality: the wand compression quality.
   2039 %
   2040 */
   2041 WandExport MagickBooleanType MagickSetCompressionQuality(MagickWand *wand,
   2042   const size_t quality)
   2043 {
   2044   assert(wand != (MagickWand *) NULL);
   2045   assert(wand->signature == MagickWandSignature);
   2046   if (wand->debug != MagickFalse)
   2047     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
   2048 
   2049   wand->image_info->quality=quality;
   2050   return(MagickTrue);
   2051 }
   2052 
   2053 /*
   2055 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   2056 %                                                                             %
   2057 %                                                                             %
   2058 %                                                                             %
   2059 %   M a g i c k S e t D e p t h                                               %
   2060 %                                                                             %
   2061 %                                                                             %
   2062 %                                                                             %
   2063 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   2064 %
   2065 %  MagickSetDepth() sets the wand pixel depth.
   2066 %
   2067 %  The format of the MagickSetDepth method is:
   2068 %
   2069 %      MagickBooleanType MagickSetDepth(MagickWand *wand,
   2070 %        const size_t depth)
   2071 %
   2072 %  A description of each parameter follows:
   2073 %
   2074 %    o wand: the magick wand.
   2075 %
   2076 %    o depth: the wand pixel depth.
   2077 %
   2078 */
   2079 WandExport MagickBooleanType MagickSetDepth(MagickWand *wand,
   2080   const size_t depth)
   2081 {
   2082   assert(wand != (MagickWand *) NULL);
   2083   assert(wand->signature == MagickWandSignature);
   2084   if (wand->debug != MagickFalse)
   2085     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
   2086 
   2087   wand->image_info->depth=depth;
   2088   return(MagickTrue);
   2089 }
   2090 
   2091 /*
   2093 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   2094 %                                                                             %
   2095 %                                                                             %
   2096 %                                                                             %
   2097 %   M a g i c k S e t E x t r a c t                                           %
   2098 %                                                                             %
   2099 %                                                                             %
   2100 %                                                                             %
   2101 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   2102 %
   2103 %  MagickSetExtract() sets the extract geometry before you read or write an
   2104 %  image file.  Use it for inline cropping (e.g. 200x200+0+0) or resizing
   2105 %  (e.g.200x200).
   2106 %
   2107 %  The format of the MagickSetExtract method is:
   2108 %
   2109 %      MagickBooleanType MagickSetExtract(MagickWand *wand,
   2110 %        const char *geometry)
   2111 %
   2112 %  A description of each parameter follows:
   2113 %
   2114 %    o wand: the magick wand.
   2115 %
   2116 %    o geometry: the extract geometry.
   2117 %
   2118 */
   2119 WandExport MagickBooleanType MagickSetExtract(MagickWand *wand,
   2120   const char *geometry)
   2121 {
   2122   assert(wand != (MagickWand *) NULL);
   2123   assert(wand->signature == MagickWandSignature);
   2124   if (wand->debug != MagickFalse)
   2125     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
   2126   if (wand->image_info->extract != (char *) NULL)
   2127     wand->image_info->extract=DestroyString(wand->image_info->extract);
   2128   if (geometry != (const char *) NULL)
   2129     (void) CloneString(&wand->image_info->extract,geometry);
   2130   return(MagickTrue);
   2131 }
   2132 
   2133 /*
   2135 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   2136 %                                                                             %
   2137 %                                                                             %
   2138 %                                                                             %
   2139 %   M a g i c k S e t F i l e n a m e                                         %
   2140 %                                                                             %
   2141 %                                                                             %
   2142 %                                                                             %
   2143 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   2144 %
   2145 %  MagickSetFilename() sets the filename before you read or write an image file.
   2146 %
   2147 %  The format of the MagickSetFilename method is:
   2148 %
   2149 %      MagickBooleanType MagickSetFilename(MagickWand *wand,
   2150 %        const char *filename)
   2151 %
   2152 %  A description of each parameter follows:
   2153 %
   2154 %    o wand: the magick wand.
   2155 %
   2156 %    o filename: the image filename.
   2157 %
   2158 */
   2159 WandExport MagickBooleanType MagickSetFilename(MagickWand *wand,
   2160   const char *filename)
   2161 {
   2162   assert(wand != (MagickWand *) NULL);
   2163   assert(wand->signature == MagickWandSignature);
   2164   if (wand->debug != MagickFalse)
   2165     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
   2166 
   2167   if (filename != (const char *) NULL)
   2168     (void) CopyMagickString(wand->image_info->filename,filename,MagickPathExtent);
   2169   return(MagickTrue);
   2170 }
   2171 
   2172 /*
   2174 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   2175 %                                                                             %
   2176 %                                                                             %
   2177 %                                                                             %
   2178 %   M a g i c k S e t F o n t                                                 %
   2179 %                                                                             %
   2180 %                                                                             %
   2181 %                                                                             %
   2182 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   2183 %
   2184 %  MagickSetFont() sets the font associated with the MagickWand.
   2185 %
   2186 %  The format of the MagickSetFont method is:
   2187 %
   2188 %      MagickBooleanType MagickSetFont(MagickWand *wand, const char *font)
   2189 %
   2190 %  A description of each parameter follows:
   2191 %
   2192 %    o wand: the magick wand.
   2193 %
   2194 %    o font: the font
   2195 %
   2196 */
   2197 WandExport MagickBooleanType MagickSetFont(MagickWand *wand,const char *font)
   2198 {
   2199   if ((font == (const char *) NULL) || (*font == '\0'))
   2200     return(MagickFalse);
   2201   assert(wand != (MagickWand *) NULL);
   2202   assert(wand->signature == MagickWandSignature);
   2203   if (wand->debug != MagickFalse)
   2204     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
   2205 
   2206   (void) CloneString(&wand->image_info->font,font);
   2207   return(MagickTrue);
   2208 }
   2209 
   2210 /*
   2212 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   2213 %                                                                             %
   2214 %                                                                             %
   2215 %                                                                             %
   2216 %   M a g i c k S e t F o r m a t                                             %
   2217 %                                                                             %
   2218 %                                                                             %
   2219 %                                                                             %
   2220 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   2221 %
   2222 %  MagickSetFormat() sets the format of the magick wand.
   2223 %
   2224 %  The format of the MagickSetFormat method is:
   2225 %
   2226 %      MagickBooleanType MagickSetFormat(MagickWand *wand,const char *format)
   2227 %
   2228 %  A description of each parameter follows:
   2229 %
   2230 %    o wand: the magick wand.
   2231 %
   2232 %    o format: the image format.
   2233 %
   2234 */
   2235 WandExport MagickBooleanType MagickSetFormat(MagickWand *wand,
   2236   const char *format)
   2237 {
   2238   const MagickInfo
   2239     *magick_info;
   2240 
   2241   assert(wand != (MagickWand *) NULL);
   2242   assert(wand->signature == MagickWandSignature);
   2243   if (wand->debug != MagickFalse)
   2244     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
   2245 
   2246   if ((format == (char *) NULL) || (*format == '\0'))
   2247     {
   2248       *wand->image_info->magick='\0';
   2249       return(MagickTrue);
   2250     }
   2251   magick_info=GetMagickInfo(format,wand->exception);
   2252   if (magick_info == (const MagickInfo *) NULL)
   2253     return(MagickFalse);
   2254   ClearMagickException(wand->exception);
   2255   (void) CopyMagickString(wand->image_info->magick,format,MagickPathExtent);
   2256   return(MagickTrue);
   2257 }
   2258 
   2259 /*
   2261 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   2262 %                                                                             %
   2263 %                                                                             %
   2264 %                                                                             %
   2265 %   M a g i c k S e t G r a v i t y                                           %
   2266 %                                                                             %
   2267 %                                                                             %
   2268 %                                                                             %
   2269 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   2270 %
   2271 %  MagickSetGravity() sets the gravity type.
   2272 %
   2273 %  The format of the MagickSetGravity type is:
   2274 %
   2275 %      MagickBooleanType MagickSetGravity(MagickWand *wand,
   2276 %        const GravityType type)
   2277 %
   2278 %  A description of each parameter follows:
   2279 %
   2280 %    o wand: the magick wand.
   2281 %
   2282 %    o type: the gravity type.
   2283 %
   2284 */
   2285 WandExport MagickBooleanType MagickSetGravity(MagickWand *wand,
   2286   const GravityType type)
   2287 {
   2288   MagickBooleanType
   2289     status;
   2290 
   2291   assert(wand != (MagickWand *) NULL);
   2292   assert(wand->signature == MagickWandSignature);
   2293   if (wand->debug != MagickFalse)
   2294     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
   2295 
   2296   status=SetImageOption(wand->image_info,"gravity",CommandOptionToMnemonic(
   2297     MagickGravityOptions,(ssize_t) type));
   2298   return(status);
   2299 }
   2300 
   2301 /*
   2303 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   2304 %                                                                             %
   2305 %                                                                             %
   2306 %                                                                             %
   2307 %   M a g i c k S e t I m a g e A r t i f r c t                               %
   2308 %                                                                             %
   2309 %                                                                             %
   2310 %                                                                             %
   2311 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   2312 %
   2313 %  MagickSetImageArtifact() associates a artifact with an image.
   2314 %
   2315 %  The format of the MagickSetImageArtifact method is:
   2316 %
   2317 %      MagickBooleanType MagickSetImageArtifact(MagickWand *wand,
   2318 %        const char *artifact,const char *value)
   2319 %
   2320 %  A description of each parameter follows:
   2321 %
   2322 %    o wand: the magick wand.
   2323 %
   2324 %    o artifact: the artifact.
   2325 %
   2326 %    o value: the value.
   2327 %
   2328 */
   2329 WandExport MagickBooleanType MagickSetImageArtifact(MagickWand *wand,
   2330   const char *artifact,const char *value)
   2331 {
   2332   assert(wand != (MagickWand *) NULL);
   2333   assert(wand->signature == MagickWandSignature);
   2334   if (wand->debug != MagickFalse)
   2335     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
   2336 
   2337   if (wand->images == (Image *) NULL)
   2338     ThrowWandException(WandError,"ContainsNoImages",wand->name);
   2339   return(SetImageArtifact(wand->images,artifact,value));
   2340 }
   2341 
   2342 /*
   2344 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   2345 %                                                                             %
   2346 %                                                                             %
   2347 %                                                                             %
   2348 %   M a g i c k S e t P r o f i l e I m a g e                                 %
   2349 %                                                                             %
   2350 %                                                                             %
   2351 %                                                                             %
   2352 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   2353 %
   2354 %  MagickSetImageProfile() adds a named profile to the magick wand.  If a
   2355 %  profile with the same name already exists, it is replaced.  This method
   2356 %  differs from the MagickProfileImage() method in that it does not apply any
   2357 %  CMS color profiles.
   2358 %
   2359 %  The format of the MagickSetImageProfile method is:
   2360 %
   2361 %      MagickBooleanType MagickSetImageProfile(MagickWand *wand,
   2362 %        const char *name,const void *profile,const size_t length)
   2363 %
   2364 %  A description of each parameter follows:
   2365 %
   2366 %    o wand: the magick wand.
   2367 %
   2368 %    o name: Name of profile to add or remove: ICC, IPTC, or generic profile.
   2369 %
   2370 %    o profile: the profile.
   2371 %
   2372 %    o length: the length of the profile.
   2373 %
   2374 */
   2375 WandExport MagickBooleanType MagickSetImageProfile(MagickWand *wand,
   2376   const char *name,const void *profile,const size_t length)
   2377 {
   2378   MagickBooleanType
   2379     status;
   2380 
   2381   StringInfo
   2382     *profile_info;
   2383 
   2384   assert(wand != (MagickWand *) NULL);
   2385   assert(wand->signature == MagickWandSignature);
   2386   if (wand->debug != MagickFalse)
   2387     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
   2388 
   2389   if (wand->images == (Image *) NULL)
   2390     ThrowWandException(WandError,"ContainsNoImages",wand->name);
   2391   profile_info=AcquireStringInfo((size_t) length);
   2392   SetStringInfoDatum(profile_info,(unsigned char *) profile);
   2393   status=SetImageProfile(wand->images,name,profile_info,wand->exception);
   2394   profile_info=DestroyStringInfo(profile_info);
   2395   return(status);
   2396 }
   2397 
   2398 /*
   2400 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   2401 %                                                                             %
   2402 %                                                                             %
   2403 %                                                                             %
   2404 %   M a g i c k S e t I m a g e P r o p e r t y                               %
   2405 %                                                                             %
   2406 %                                                                             %
   2407 %                                                                             %
   2408 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   2409 %
   2410 %  MagickSetImageProperty() associates a property with an image.
   2411 %
   2412 %  The format of the MagickSetImageProperty method is:
   2413 %
   2414 %      MagickBooleanType MagickSetImageProperty(MagickWand *wand,
   2415 %        const char *property,const char *value)
   2416 %
   2417 %  A description of each parameter follows:
   2418 %
   2419 %    o wand: the magick wand.
   2420 %
   2421 %    o property: the property.
   2422 %
   2423 %    o value: the value.
   2424 %
   2425 */
   2426 WandExport MagickBooleanType MagickSetImageProperty(MagickWand *wand,
   2427   const char *property,const char *value)
   2428 {
   2429   MagickBooleanType
   2430     status;
   2431 
   2432   assert(wand != (MagickWand *) NULL);
   2433   assert(wand->signature == MagickWandSignature);
   2434   if (wand->debug != MagickFalse)
   2435     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
   2436 
   2437   if (wand->images == (Image *) NULL)
   2438     ThrowWandException(WandError,"ContainsNoImages",wand->name);
   2439   status=SetImageProperty(wand->images,property,value,wand->exception);
   2440   return(status);
   2441 }
   2442 
   2443 /*
   2445 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   2446 %                                                                             %
   2447 %                                                                             %
   2448 %                                                                             %
   2449 %   M a g i c k S e t I n t e r l a c e S c h e m e                           %
   2450 %                                                                             %
   2451 %                                                                             %
   2452 %                                                                             %
   2453 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   2454 %
   2455 %  MagickSetInterlaceScheme() sets the image compression.
   2456 %
   2457 %  The format of the MagickSetInterlaceScheme method is:
   2458 %
   2459 %      MagickBooleanType MagickSetInterlaceScheme(MagickWand *wand,
   2460 %        const InterlaceType interlace_scheme)
   2461 %
   2462 %  A description of each parameter follows:
   2463 %
   2464 %    o wand: the magick wand.
   2465 %
   2466 %    o interlace_scheme: the image interlace scheme: NoInterlace, LineInterlace,
   2467 %      PlaneInterlace, PartitionInterlace.
   2468 %
   2469 */
   2470 WandExport MagickBooleanType MagickSetInterlaceScheme(MagickWand *wand,
   2471   const InterlaceType interlace_scheme)
   2472 {
   2473   assert(wand != (MagickWand *) NULL);
   2474   assert(wand->signature == MagickWandSignature);
   2475   if (wand->debug != MagickFalse)
   2476     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
   2477 
   2478   wand->image_info->interlace=interlace_scheme;
   2479   return(MagickTrue);
   2480 }
   2481 
   2482 /*
   2484 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   2485 %                                                                             %
   2486 %                                                                             %
   2487 %                                                                             %
   2488 %   M a g i c k S e t I n t e r p o l a t e M e t h o d                       %
   2489 %                                                                             %
   2490 %                                                                             %
   2491 %                                                                             %
   2492 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   2493 %
   2494 %  MagickSetInterpolateMethod() sets the interpolate pixel method.
   2495 %
   2496 %  The format of the MagickSetInterpolateMethod method is:
   2497 %
   2498 %      MagickBooleanType MagickSetInterpolateMethod(MagickWand *wand,
   2499 %        const InterpolateMethodPixel method)
   2500 %
   2501 %  A description of each parameter follows:
   2502 %
   2503 %    o wand: the magick wand.
   2504 %
   2505 %    o method: the interpolate pixel method.
   2506 %
   2507 */
   2508 WandExport MagickBooleanType MagickSetInterpolateMethod(MagickWand *wand,
   2509   const PixelInterpolateMethod method)
   2510 {
   2511   MagickBooleanType
   2512     status;
   2513 
   2514   assert(wand != (MagickWand *) NULL);
   2515   assert(wand->signature == MagickWandSignature);
   2516   if (wand->debug != MagickFalse)
   2517     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
   2518 
   2519   status=SetImageOption(wand->image_info,"interpolate",
   2520     CommandOptionToMnemonic(MagickInterpolateOptions,(ssize_t) method));
   2521   return(status);
   2522 }
   2523 
   2524 /*
   2526 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   2527 %                                                                             %
   2528 %                                                                             %
   2529 %                                                                             %
   2530 %   M a g i c k S e t O p t i o n                                             %
   2531 %                                                                             %
   2532 %                                                                             %
   2533 %                                                                             %
   2534 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   2535 %
   2536 %  MagickSetOption() associates one or options with the wand (.e.g
   2537 %  MagickSetOption(wand,"jpeg:perserve","yes")).
   2538 %
   2539 %  The format of the MagickSetOption method is:
   2540 %
   2541 %      MagickBooleanType MagickSetOption(MagickWand *wand,const char *key,
   2542 %        const char *value)
   2543 %
   2544 %  A description of each parameter follows:
   2545 %
   2546 %    o wand: the magick wand.
   2547 %
   2548 %    o key:  The key.
   2549 %
   2550 %    o value:  The value.
   2551 %
   2552 */
   2553 WandExport MagickBooleanType MagickSetOption(MagickWand *wand,const char *key,
   2554   const char *value)
   2555 {
   2556   assert(wand != (MagickWand *) NULL);
   2557   assert(wand->signature == MagickWandSignature);
   2558   if (wand->debug != MagickFalse)
   2559     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
   2560 
   2561   return(SetImageOption(wand->image_info,key,value));
   2562 }
   2563 
   2564 /*
   2566 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   2567 %                                                                             %
   2568 %                                                                             %
   2569 %                                                                             %
   2570 %   M a g i c k S e t O r i e n t a t i o n                                   %
   2571 %                                                                             %
   2572 %                                                                             %
   2573 %                                                                             %
   2574 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   2575 %
   2576 %  MagickSetOrientation() sets the wand orientation type.
   2577 %
   2578 %  The format of the MagickSetOrientation method is:
   2579 %
   2580 %      MagickBooleanType MagickSetOrientation(MagickWand *wand,
   2581 %        const OrientationType orientation)
   2582 %
   2583 %  A description of each parameter follows:
   2584 %
   2585 %    o wand: the magick wand.
   2586 %
   2587 %    o orientation: the wand orientation.
   2588 %
   2589 */
   2590 WandExport MagickBooleanType MagickSetOrientation(MagickWand *wand,
   2591   const OrientationType orientation)
   2592 {
   2593   assert(wand != (MagickWand *) NULL);
   2594   assert(wand->signature == MagickWandSignature);
   2595   if (wand->debug != MagickFalse)
   2596     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
   2597 
   2598   wand->image_info->orientation=orientation;
   2599   return(MagickTrue);
   2600 }
   2601 
   2602 /*
   2604 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   2605 %                                                                             %
   2606 %                                                                             %
   2607 %                                                                             %
   2608 %   M a g i c k S e t P a g e                                                 %
   2609 %                                                                             %
   2610 %                                                                             %
   2611 %                                                                             %
   2612 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   2613 %
   2614 %  MagickSetPage() sets the page geometry of the magick wand.
   2615 %
   2616 %  The format of the MagickSetPage method is:
   2617 %
   2618 %      MagickBooleanType MagickSetPage(MagickWand *wand,
   2619 %        const size_t width,const size_t height,const ssize_t x,
   2620 %        const ssize_t y)
   2621 %
   2622 %  A description of each parameter follows:
   2623 %
   2624 %    o wand: the magick wand.
   2625 %
   2626 %    o width: the page width.
   2627 %
   2628 %    o height: the page height.
   2629 %
   2630 %    o x: the page x-offset.
   2631 %
   2632 %    o y: the page y-offset.
   2633 %
   2634 */
   2635 WandExport MagickBooleanType MagickSetPage(MagickWand *wand,
   2636   const size_t width,const size_t height,const ssize_t x,
   2637   const ssize_t y)
   2638 {
   2639   char
   2640     geometry[MagickPathExtent];
   2641 
   2642   assert(wand != (MagickWand *) NULL);
   2643   assert(wand->signature == MagickWandSignature);
   2644   if (wand->debug != MagickFalse)
   2645     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
   2646 
   2647   (void) FormatLocaleString(geometry,MagickPathExtent,"%.20gx%.20g%+.20g%+.20g",
   2648     (double) width,(double) height,(double) x,(double) y);
   2649   (void) CloneString(&wand->image_info->page,geometry);
   2650   return(MagickTrue);
   2651 }
   2652 
   2653 /*
   2655 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   2656 %                                                                             %
   2657 %                                                                             %
   2658 %                                                                             %
   2659 %   M a g i c k S e t P a s s p h r a s e                                     %
   2660 %                                                                             %
   2661 %                                                                             %
   2662 %                                                                             %
   2663 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   2664 %
   2665 %  MagickSetPassphrase() sets the passphrase.
   2666 %
   2667 %  The format of the MagickSetPassphrase method is:
   2668 %
   2669 %      MagickBooleanType MagickSetPassphrase(MagickWand *wand,
   2670 %        const char *passphrase)
   2671 %
   2672 %  A description of each parameter follows:
   2673 %
   2674 %    o wand: the magick wand.
   2675 %
   2676 %    o passphrase: the passphrase.
   2677 %
   2678 */
   2679 WandExport MagickBooleanType MagickSetPassphrase(MagickWand *wand,
   2680   const char *passphrase)
   2681 {
   2682   assert(wand != (MagickWand *) NULL);
   2683   assert(wand->signature == MagickWandSignature);
   2684   if (wand->debug != MagickFalse)
   2685     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
   2686 
   2687   (void) SetImageOption(wand->image_info,"authenticate",passphrase);
   2688   return(MagickTrue);
   2689 }
   2690 
   2691 /*
   2693 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   2694 %                                                                             %
   2695 %                                                                             %
   2696 %                                                                             %
   2697 %   M a g i c k S e t P o i n t s i z e                                       %
   2698 %                                                                             %
   2699 %                                                                             %
   2700 %                                                                             %
   2701 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   2702 %
   2703 %  MagickSetPointsize() sets the font pointsize associated with the MagickWand.
   2704 %
   2705 %  The format of the MagickSetPointsize method is:
   2706 %
   2707 %      MagickBooleanType MagickSetPointsize(MagickWand *wand,
   2708 %        const double pointsize)
   2709 %
   2710 %  A description of each parameter follows:
   2711 %
   2712 %    o wand: the magick wand.
   2713 %
   2714 %    o pointsize: the size of the font
   2715 %
   2716 */
   2717 WandExport MagickBooleanType MagickSetPointsize(MagickWand *wand,
   2718   const double pointsize)
   2719 {
   2720   assert(wand != (MagickWand *) NULL);
   2721   assert(wand->signature == MagickWandSignature);
   2722   if (wand->debug != MagickFalse)
   2723     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
   2724 
   2725   wand->image_info->pointsize=pointsize;
   2726   return(MagickTrue);
   2727 }
   2728 
   2729 /*
   2731 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   2732 %                                                                             %
   2733 %                                                                             %
   2734 %                                                                             %
   2735 %   M a g i c k S e t P r o g r e s s M o n i t o r                           %
   2736 %                                                                             %
   2737 %                                                                             %
   2738 %                                                                             %
   2739 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   2740 %
   2741 %  MagickSetProgressMonitor() sets the wand progress monitor to the specified
   2742 %  method and returns the previous progress monitor if any.  The progress
   2743 %  monitor method looks like this:
   2744 %
   2745 %    MagickBooleanType MagickProgressMonitor(const char *text,
   2746 %      const MagickOffsetType offset,const MagickSizeType span,
   2747 %      void *client_data)
   2748 %
   2749 %  If the progress monitor returns MagickFalse, the current operation is
   2750 %  interrupted.
   2751 %
   2752 %  The format of the MagickSetProgressMonitor method is:
   2753 %
   2754 %      MagickProgressMonitor MagickSetProgressMonitor(MagickWand *wand
   2755 %        const MagickProgressMonitor progress_monitor,void *client_data)
   2756 %
   2757 %  A description of each parameter follows:
   2758 %
   2759 %    o wand: the magick wand.
   2760 %
   2761 %    o progress_monitor: Specifies a pointer to a method to monitor progress
   2762 %      of an image operation.
   2763 %
   2764 %    o client_data: Specifies a pointer to any client data.
   2765 %
   2766 */
   2767 WandExport MagickProgressMonitor MagickSetProgressMonitor(MagickWand *wand,
   2768   const MagickProgressMonitor progress_monitor,void *client_data)
   2769 {
   2770   MagickProgressMonitor
   2771     previous_monitor;
   2772 
   2773   assert(wand != (MagickWand *) NULL);
   2774   assert(wand->signature == MagickWandSignature);
   2775   if (wand->debug != MagickFalse)
   2776     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
   2777 
   2778   previous_monitor=SetImageInfoProgressMonitor(wand->image_info,
   2779     progress_monitor,client_data);
   2780   return(previous_monitor);
   2781 }
   2782 
   2783 /*
   2785 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   2786 %                                                                             %
   2787 %                                                                             %
   2788 %                                                                             %
   2789 %   M a g i c k S e t R e s o u r c e L i m i t                               %
   2790 %                                                                             %
   2791 %                                                                             %
   2792 %                                                                             %
   2793 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   2794 %
   2795 %  MagickSetResourceLimit() sets the limit for a particular resource in
   2796 %  megabytes.
   2797 %
   2798 %  The format of the MagickSetResourceLimit method is:
   2799 %
   2800 %      MagickBooleanType MagickSetResourceLimit(const ResourceType type,
   2801 %        const MagickSizeType limit)
   2802 %
   2803 %  A description of each parameter follows:
   2804 %
   2805 %    o type: the type of resource: AreaResource, MemoryResource, MapResource,
   2806 %      DiskResource, FileResource.
   2807 %
   2808 %    o The maximum limit for the resource.
   2809 %
   2810 */
   2811 WandExport MagickBooleanType MagickSetResourceLimit(const ResourceType type,
   2812   const MagickSizeType limit)
   2813 {
   2814   return(SetMagickResourceLimit(type,limit));
   2815 }
   2816 
   2817 /*
   2819 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   2820 %                                                                             %
   2821 %                                                                             %
   2822 %                                                                             %
   2823 %   M a g i c k S e t R e s o l u t i o n                                     %
   2824 %                                                                             %
   2825 %                                                                             %
   2826 %                                                                             %
   2827 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   2828 %
   2829 %  MagickSetResolution() sets the image resolution.
   2830 %
   2831 %  The format of the MagickSetResolution method is:
   2832 %
   2833 %      MagickBooleanType MagickSetResolution(MagickWand *wand,
   2834 %        const double x_resolution,const double y_resolution)
   2835 %
   2836 %  A description of each parameter follows:
   2837 %
   2838 %    o wand: the magick wand.
   2839 %
   2840 %    o x_resolution: the image x resolution.
   2841 %
   2842 %    o y_resolution: the image y resolution.
   2843 %
   2844 */
   2845 WandExport MagickBooleanType MagickSetResolution(MagickWand *wand,
   2846   const double x_resolution,const double y_resolution)
   2847 {
   2848   char
   2849     density[MagickPathExtent];
   2850 
   2851   assert(wand != (MagickWand *) NULL);
   2852   assert(wand->signature == MagickWandSignature);
   2853   if (wand->debug != MagickFalse)
   2854     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
   2855 
   2856   (void) FormatLocaleString(density,MagickPathExtent,"%gx%g",x_resolution,
   2857     y_resolution);
   2858   (void) CloneString(&wand->image_info->density,density);
   2859   return(MagickTrue);
   2860 }
   2861 
   2862 /*
   2864 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   2865 %                                                                             %
   2866 %                                                                             %
   2867 %                                                                             %
   2868 %   M a g i c k S e t S a m p l i n g F a c t o r s                           %
   2869 %                                                                             %
   2870 %                                                                             %
   2871 %                                                                             %
   2872 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   2873 %
   2874 %  MagickSetSamplingFactors() sets the image sampling factors.
   2875 %
   2876 %  The format of the MagickSetSamplingFactors method is:
   2877 %
   2878 %      MagickBooleanType MagickSetSamplingFactors(MagickWand *wand,
   2879 %        const size_t number_factors,const double *sampling_factors)
   2880 %
   2881 %  A description of each parameter follows:
   2882 %
   2883 %    o wand: the magick wand.
   2884 %
   2885 %    o number_factoes: the number of factors.
   2886 %
   2887 %    o sampling_factors: An array of doubles representing the sampling factor
   2888 %      for each color component (in RGB order).
   2889 %
   2890 */
   2891 WandExport MagickBooleanType MagickSetSamplingFactors(MagickWand *wand,
   2892   const size_t number_factors,const double *sampling_factors)
   2893 {
   2894   char
   2895     sampling_factor[MagickPathExtent];
   2896 
   2897   register ssize_t
   2898     i;
   2899 
   2900   assert(wand != (MagickWand *) NULL);
   2901   assert(wand->signature == MagickWandSignature);
   2902   if (wand->debug != MagickFalse)
   2903     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
   2904 
   2905   if (wand->image_info->sampling_factor != (char *) NULL)
   2906     wand->image_info->sampling_factor=(char *)
   2907       RelinquishMagickMemory(wand->image_info->sampling_factor);
   2908   if (number_factors == 0)
   2909     return(MagickTrue);
   2910   for (i=0; i < (ssize_t) (number_factors-1); i++)
   2911   {
   2912     (void) FormatLocaleString(sampling_factor,MagickPathExtent,"%g,",
   2913       sampling_factors[i]);
   2914     (void) ConcatenateString(&wand->image_info->sampling_factor,
   2915       sampling_factor);
   2916   }
   2917   (void) FormatLocaleString(sampling_factor,MagickPathExtent,"%g",
   2918     sampling_factors[i]);
   2919   (void) ConcatenateString(&wand->image_info->sampling_factor,sampling_factor);
   2920   return(MagickTrue);
   2921 }
   2922 
   2923 /*
   2925 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   2926 %                                                                             %
   2927 %                                                                             %
   2928 %                                                                             %
   2929 %   M a g i c k S e t S e c u r i t y P o l i c y                             %
   2930 %                                                                             %
   2931 %                                                                             %
   2932 %                                                                             %
   2933 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   2934 %
   2935 %  MagickSetSecurityPolicy() sets the ImageMagick security policy.  It returns
   2936 %  MagickFalse if the policy is already set or if the policy does not parse.
   2937 %
   2938 %  The format of the MagickSetAntialias method is:
   2939 %
   2940 %      MagickBooleanType MagickSetAntialias(MagickWand *wand,
   2941 %        const char *policy)
   2942 %
   2943 %  A description of each parameter follows:
   2944 %
   2945 %    o wand: the magick wand.
   2946 %
   2947 %    o policy: the security policy in the XML format.
   2948 %
   2949 */
   2950 WandExport MagickBooleanType MagickSetSecurityPolicy(MagickWand *wand,
   2951   const char *policy)
   2952 {
   2953   assert(wand != (MagickWand *) NULL);
   2954   assert(wand->signature == MagickWandSignature);
   2955   if (wand->debug != MagickFalse)
   2956     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
   2957 
   2958   return(SetMagickSecurityPolicy(policy,wand->exception));
   2959 }
   2960 
   2961 /*
   2963 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   2964 %                                                                             %
   2965 %                                                                             %
   2966 %                                                                             %
   2967 %   M a g i c k S e t S i z e                                                 %
   2968 %                                                                             %
   2969 %                                                                             %
   2970 %                                                                             %
   2971 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   2972 %
   2973 %  MagickSetSize() sets the size of the magick wand.  Set it before you
   2974 %  read a raw image format such as RGB, GRAY, or CMYK.
   2975 %
   2976 %  The format of the MagickSetSize method is:
   2977 %
   2978 %      MagickBooleanType MagickSetSize(MagickWand *wand,
   2979 %        const size_t columns,const size_t rows)
   2980 %
   2981 %  A description of each parameter follows:
   2982 %
   2983 %    o wand: the magick wand.
   2984 %
   2985 %    o columns: the width in pixels.
   2986 %
   2987 %    o rows: the rows in pixels.
   2988 %
   2989 */
   2990 WandExport MagickBooleanType MagickSetSize(MagickWand *wand,
   2991   const size_t columns,const size_t rows)
   2992 {
   2993   char
   2994     geometry[MagickPathExtent];
   2995 
   2996   assert(wand != (MagickWand *) NULL);
   2997   assert(wand->signature == MagickWandSignature);
   2998   if (wand->debug != MagickFalse)
   2999     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
   3000 
   3001   (void) FormatLocaleString(geometry,MagickPathExtent,"%.20gx%.20g",(double)
   3002     columns,(double) rows);
   3003   (void) CloneString(&wand->image_info->size,geometry);
   3004   return(MagickTrue);
   3005 }
   3006 
   3007 /*
   3009 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   3010 %                                                                             %
   3011 %                                                                             %
   3012 %                                                                             %
   3013 %   M a g i c k S e t S i z e O f f s e t                                     %
   3014 %                                                                             %
   3015 %                                                                             %
   3016 %                                                                             %
   3017 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   3018 %
   3019 %  MagickSetSizeOffset() sets the size and offset of the magick wand.  Set it
   3020 %  before you read a raw image format such as RGB, GRAY, or CMYK.
   3021 %
   3022 %  The format of the MagickSetSizeOffset method is:
   3023 %
   3024 %      MagickBooleanType MagickSetSizeOffset(MagickWand *wand,
   3025 %        const size_t columns,const size_t rows,
   3026 %        const ssize_t offset)
   3027 %
   3028 %  A description of each parameter follows:
   3029 %
   3030 %    o wand: the magick wand.
   3031 %
   3032 %    o columns: the image width in pixels.
   3033 %
   3034 %    o rows: the image rows in pixels.
   3035 %
   3036 %    o offset: the image offset.
   3037 %
   3038 */
   3039 WandExport MagickBooleanType MagickSetSizeOffset(MagickWand *wand,
   3040   const size_t columns,const size_t rows,const ssize_t offset)
   3041 {
   3042   char
   3043     geometry[MagickPathExtent];
   3044 
   3045   assert(wand != (MagickWand *) NULL);
   3046   assert(wand->signature == MagickWandSignature);
   3047   if (wand->debug != MagickFalse)
   3048     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
   3049 
   3050   (void) FormatLocaleString(geometry,MagickPathExtent,"%.20gx%.20g%+.20g",
   3051     (double) columns,(double) rows,(double) offset);
   3052   (void) CloneString(&wand->image_info->size,geometry);
   3053   return(MagickTrue);
   3054 }
   3055 
   3056 /*
   3058 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   3059 %                                                                             %
   3060 %                                                                             %
   3061 %                                                                             %
   3062 %   M a g i c k S e t T y p e                                                 %
   3063 %                                                                             %
   3064 %                                                                             %
   3065 %                                                                             %
   3066 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   3067 %
   3068 %  MagickSetType() sets the image type attribute.
   3069 %
   3070 %  The format of the MagickSetType method is:
   3071 %
   3072 %      MagickBooleanType MagickSetType(MagickWand *wand,
   3073 %        const ImageType image_type)
   3074 %
   3075 %  A description of each parameter follows:
   3076 %
   3077 %    o wand: the magick wand.
   3078 %
   3079 %    o image_type: the image type:   UndefinedType, BilevelType, GrayscaleType,
   3080 %      GrayscaleAlphaType, PaletteType, PaletteAlphaType, TrueColorType,
   3081 %      TrueColorAlphaType, ColorSeparationType, ColorSeparationAlphaType,
   3082 %      or OptimizeType.
   3083 %
   3084 */
   3085 WandExport MagickBooleanType MagickSetType(MagickWand *wand,
   3086   const ImageType image_type)
   3087 {
   3088   assert(wand != (MagickWand *) NULL);
   3089   assert(wand->signature == MagickWandSignature);
   3090   if (wand->debug != MagickFalse)
   3091     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
   3092 
   3093   wand->image_info->type=image_type;
   3094   return(MagickTrue);
   3095 }
   3096