MagickWand  6.7.5
magick-property.c
Go to the documentation of this file.
00001 /*
00002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00003 %                                                                             %
00004 %                                                                             %
00005 %                                                                             %
00006 %                 M   M   AAA    GGGG  IIIII   CCCC  K   K                    %
00007 %                 MM MM  A   A  G        I    C      K  K                     %
00008 %                 M M M  AAAAA  G GGG    I    C      KKK                      %
00009 %                 M   M  A   A  G   G    I    C      K  K                     %
00010 %                 M   M  A   A   GGGG  IIIII   CCCC  K   K                    %
00011 %                                                                             %
00012 %           PPPP    RRRR     OOO   PPPP   EEEEE  RRRR   TTTTT  Y   Y          %
00013 %           P   P   R   R   O   O  P   P  E      R   R    T     Y Y           %
00014 %           PPPP    RRRR    O   O  PPPP   EEE    RRRR     T      Y            %
00015 %           P       R R     O   O  P      E      R R      T      Y            %
00016 %           P       R  R     OOO   P      EEEEE  R  R     T      Y            %
00017 %                                                                             %
00018 %                                                                             %
00019 %            Set or Get MagickWand Properties, Options, or Profiles           %
00020 %                                                                             %
00021 %                               Software Design                               %
00022 %                                 John Cristy                                 %
00023 %                                 August 2003                                 %
00024 %                                                                             %
00025 %                                                                             %
00026 %  Copyright 1999-2012 ImageMagick Studio LLC, a non-profit organization      %
00027 %  dedicated to making software imaging solutions freely available.           %
00028 %                                                                             %
00029 %  You may not use this file except in compliance with the License.  You may  %
00030 %  obtain a copy of the License at                                            %
00031 %                                                                             %
00032 %    http://www.imagemagick.org/script/license.php                            %
00033 %                                                                             %
00034 %  Unless required by applicable law or agreed to in writing, software        %
00035 %  distributed under the License is distributed on an "AS IS" BASIS,          %
00036 %  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   %
00037 %  See the License for the specific language governing permissions and        %
00038 %  limitations under the License.                                             %
00039 %                                                                             %
00040 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00041 %
00042 %
00043 %
00044 */
00045 
00046 /*
00047   Include declarations.
00048 */
00049 #include "MagickWand/studio.h"
00050 #include "MagickWand/MagickWand.h"
00051 #include "MagickWand/magick-wand-private.h"
00052 #include "MagickWand/wand.h"
00053 #include "MagickCore/string-private.h"
00054 
00055 /*
00056   Define declarations.
00057 */
00058 #define ThrowWandException(severity,tag,context) \
00059 { \
00060   (void) ThrowMagickException(wand->exception,GetMagickModule(),severity, \
00061     tag,"`%s'",context); \
00062   return(MagickFalse); \
00063 }
00064 
00065 /*
00066 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00067 %                                                                             %
00068 %                                                                             %
00069 %                                                                             %
00070 %   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                         %
00071 %                                                                             %
00072 %                                                                             %
00073 %                                                                             %
00074 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00075 %
00076 %  MagickDeleteImageArtifact() deletes a wand artifact.
00077 %
00078 %  The format of the MagickDeleteImageArtifact method is:
00079 %
00080 %      MagickBooleanType MagickDeleteImageArtifact(MagickWand *wand,
00081 %        const char *artifact)
00082 %
00083 %  A description of each parameter follows:
00084 %
00085 %    o image: the image.
00086 %
00087 %    o artifact: the image artifact.
00088 %
00089 */
00090 WandExport MagickBooleanType MagickDeleteImageArtifact(MagickWand *wand,
00091   const char *artifact)
00092 {
00093   assert(wand != (MagickWand *) NULL);
00094   assert(wand->signature == WandSignature);
00095   if (wand->debug != MagickFalse)
00096     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00097   if (wand->images == (Image *) NULL)
00098     {
00099       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
00100         "ContainsNoImages","`%s'",wand->name);
00101       return(MagickFalse);
00102     }
00103   return(DeleteImageArtifact(wand->images,artifact));
00104 }
00105 
00106 /*
00107 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00108 %                                                                             %
00109 %                                                                             %
00110 %                                                                             %
00111 %   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                         %
00112 %                                                                             %
00113 %                                                                             %
00114 %                                                                             %
00115 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00116 %
00117 %  MagickDeleteImageProperty() deletes a wand property.
00118 %
00119 %  The format of the MagickDeleteImageProperty method is:
00120 %
00121 %      MagickBooleanType MagickDeleteImageProperty(MagickWand *wand,
00122 %        const char *property)
00123 %
00124 %  A description of each parameter follows:
00125 %
00126 %    o image: the image.
00127 %
00128 %    o property: the image property.
00129 %
00130 */
00131 WandExport MagickBooleanType MagickDeleteImageProperty(MagickWand *wand,
00132   const char *property)
00133 {
00134   assert(wand != (MagickWand *) NULL);
00135   assert(wand->signature == WandSignature);
00136   if (wand->debug != MagickFalse)
00137     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00138   if (wand->images == (Image *) NULL)
00139     {
00140       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
00141         "ContainsNoImages","`%s'",wand->name);
00142       return(MagickFalse);
00143     }
00144   return(DeleteImageProperty(wand->images,property));
00145 }
00146 
00147 /*
00148 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00149 %                                                                             %
00150 %                                                                             %
00151 %                                                                             %
00152 %   M a g i c k D e l e t e O p t i o n                                       %
00153 %                                                                             %
00154 %                                                                             %
00155 %                                                                             %
00156 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00157 %
00158 %  MagickDeleteOption() deletes a wand option.
00159 %
00160 %  The format of the MagickDeleteOption method is:
00161 %
00162 %      MagickBooleanType MagickDeleteOption(MagickWand *wand,
00163 %        const char *option)
00164 %
00165 %  A description of each parameter follows:
00166 %
00167 %    o image: the image.
00168 %
00169 %    o option: the image option.
00170 %
00171 */
00172 WandExport MagickBooleanType MagickDeleteOption(MagickWand *wand,
00173   const char *option)
00174 {
00175   assert(wand != (MagickWand *) NULL);
00176   assert(wand->signature == WandSignature);
00177   if (wand->debug != MagickFalse)
00178     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00179   return(DeleteImageOption(wand->image_info,option));
00180 }
00181 
00182 /*
00183 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00184 %                                                                             %
00185 %                                                                             %
00186 %                                                                             %
00187 %   M a g i c k G e t A n t i a l i a s                                       %
00188 %                                                                             %
00189 %                                                                             %
00190 %                                                                             %
00191 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00192 %
00193 %  MagickGetAntialias() returns the antialias property associated with the
00194 %  wand.
00195 %
00196 %  The format of the MagickGetAntialias method is:
00197 %
00198 %      MagickBooleanType MagickGetAntialias(const MagickWand *wand)
00199 %
00200 %  A description of each parameter follows:
00201 %
00202 %    o wand: the magick wand.
00203 %
00204 */
00205 WandExport MagickBooleanType MagickGetAntialias(const MagickWand *wand)
00206 {
00207   assert(wand != (const MagickWand *) NULL);
00208   assert(wand->signature == WandSignature);
00209   if (wand->debug != MagickFalse)
00210     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00211   return(wand->image_info->antialias);
00212 }
00213 
00214 /*
00215 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00216 %                                                                             %
00217 %                                                                             %
00218 %                                                                             %
00219 %   M a g i c k G e t B a c k g r o u n d C o l o r                           %
00220 %                                                                             %
00221 %                                                                             %
00222 %                                                                             %
00223 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00224 %
00225 %  MagickGetBackgroundColor() returns the wand background color.
00226 %
00227 %  The format of the MagickGetBackgroundColor method is:
00228 %
00229 %      PixelWand *MagickGetBackgroundColor(MagickWand *wand)
00230 %
00231 %  A description of each parameter follows:
00232 %
00233 %    o wand: the magick wand.
00234 %
00235 */
00236 WandExport PixelWand *MagickGetBackgroundColor(MagickWand *wand)
00237 {
00238   PixelWand
00239     *background_color;
00240 
00241   assert(wand != (MagickWand *) NULL);
00242   assert(wand->signature == WandSignature);
00243   if (wand->debug != MagickFalse)
00244     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00245   background_color=NewPixelWand();
00246   PixelSetPixelColor(background_color,&wand->image_info->background_color);
00247   return(background_color);
00248 }
00249 
00250 /*
00251 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00252 %                                                                             %
00253 %                                                                             %
00254 %                                                                             %
00255 %   M a g i c k G e t C o l o r s p a c e                                     %
00256 %                                                                             %
00257 %                                                                             %
00258 %                                                                             %
00259 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00260 %
00261 %  MagickGetColorspace() gets the wand colorspace type.
00262 %
00263 %  The format of the MagickGetColorspace method is:
00264 %
00265 %      ColorspaceType MagickGetColorspace(MagickWand *wand)
00266 %
00267 %  A description of each parameter follows:
00268 %
00269 %    o wand: the magick wand.
00270 %
00271 */
00272 WandExport ColorspaceType MagickGetColorspace(MagickWand *wand)
00273 {
00274   assert(wand != (MagickWand *) NULL);
00275   assert(wand->signature == WandSignature);
00276   if (wand->debug != MagickFalse)
00277     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00278   return(wand->image_info->colorspace);
00279 }
00280 
00281 /*
00282 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00283 %                                                                             %
00284 %                                                                             %
00285 %                                                                             %
00286 %   M a g i c k G e t C o m p r e s s i o n                                   %
00287 %                                                                             %
00288 %                                                                             %
00289 %                                                                             %
00290 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00291 %
00292 %  MagickGetCompression() gets the wand compression type.
00293 %
00294 %  The format of the MagickGetCompression method is:
00295 %
00296 %      CompressionType MagickGetCompression(MagickWand *wand)
00297 %
00298 %  A description of each parameter follows:
00299 %
00300 %    o wand: the magick wand.
00301 %
00302 */
00303 WandExport CompressionType MagickGetCompression(MagickWand *wand)
00304 {
00305   assert(wand != (MagickWand *) NULL);
00306   assert(wand->signature == WandSignature);
00307   if (wand->debug != MagickFalse)
00308     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00309   return(wand->image_info->compression);
00310 }
00311 
00312 /*
00313 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00314 %                                                                             %
00315 %                                                                             %
00316 %                                                                             %
00317 %   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                     %
00318 %                                                                             %
00319 %                                                                             %
00320 %                                                                             %
00321 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00322 %
00323 %  MagickGetCompressionQuality() gets the wand compression quality.
00324 %
00325 %  The format of the MagickGetCompressionQuality method is:
00326 %
00327 %      size_t MagickGetCompressionQuality(MagickWand *wand)
00328 %
00329 %  A description of each parameter follows:
00330 %
00331 %    o wand: the magick wand.
00332 %
00333 */
00334 WandExport size_t MagickGetCompressionQuality(MagickWand *wand)
00335 {
00336   assert(wand != (MagickWand *) NULL);
00337   assert(wand->signature == WandSignature);
00338   if (wand->debug != MagickFalse)
00339     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00340   return(wand->image_info->quality);
00341 }
00342 
00343 /*
00344 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00345 %                                                                             %
00346 %                                                                             %
00347 %                                                                             %
00348 %   M a g i c k G e t C o p y r i g h t                                       %
00349 %                                                                             %
00350 %                                                                             %
00351 %                                                                             %
00352 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00353 %
00354 %  MagickGetCopyright() returns the ImageMagick API copyright as a string
00355 %  constant.
00356 %
00357 %  The format of the MagickGetCopyright method is:
00358 %
00359 %      const char *MagickGetCopyright(void)
00360 %
00361 */
00362 WandExport const char *MagickGetCopyright(void)
00363 {
00364   return(GetMagickCopyright());
00365 }
00366 
00367 /*
00368 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00369 %                                                                             %
00370 %                                                                             %
00371 %                                                                             %
00372 %   M a g i c k G e t F i l e n a m e                                         %
00373 %                                                                             %
00374 %                                                                             %
00375 %                                                                             %
00376 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00377 %
00378 %  MagickGetFilename() returns the filename associated with an image sequence.
00379 %
00380 %  The format of the MagickGetFilename method is:
00381 %
00382 %      const char *MagickGetFilename(const MagickWand *wand)
00383 %
00384 %  A description of each parameter follows:
00385 %
00386 %    o wand: the magick wand.
00387 %
00388 */
00389 WandExport char *MagickGetFilename(const MagickWand *wand)
00390 {
00391   assert(wand != (const MagickWand *) NULL);
00392   assert(wand->signature == WandSignature);
00393   if (wand->debug != MagickFalse)
00394     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00395   return(AcquireString(wand->image_info->filename));
00396 }
00397 
00398 /*
00399 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00400 %                                                                             %
00401 %                                                                             %
00402 %                                                                             %
00403 %   M a g i c k G e t F o n t                                                 %
00404 %                                                                             %
00405 %                                                                             %
00406 %                                                                             %
00407 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00408 %
00409 %  MagickGetFont() returns the font associated with the MagickWand.
00410 %
00411 %  The format of the MagickGetFont method is:
00412 %
00413 %      char *MagickGetFont(MagickWand *wand)
00414 %
00415 %  A description of each parameter follows:
00416 %
00417 %    o wand: the magick wand.
00418 %
00419 */
00420 WandExport char *MagickGetFont(MagickWand *wand)
00421 {
00422   assert(wand != (MagickWand *) NULL);
00423   assert(wand->signature == WandSignature);
00424   if (wand->debug != MagickFalse)
00425     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00426   if (wand->image_info->font == (char *) NULL)
00427     return((char *) NULL);
00428   return(AcquireString(wand->image_info->font));
00429 }
00430 
00431 /*
00432 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00433 %                                                                             %
00434 %                                                                             %
00435 %                                                                             %
00436 %   M a g i c k G e t F o r m a t                                             %
00437 %                                                                             %
00438 %                                                                             %
00439 %                                                                             %
00440 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00441 %
00442 %  MagickGetFormat() returns the format of the magick wand.
00443 %
00444 %  The format of the MagickGetFormat method is:
00445 %
00446 %      const char MagickGetFormat(MagickWand *wand)
00447 %
00448 %  A description of each parameter follows:
00449 %
00450 %    o wand: the magick wand.
00451 %
00452 */
00453 WandExport char *MagickGetFormat(MagickWand *wand)
00454 {
00455   assert(wand != (MagickWand *) NULL);
00456   assert(wand->signature == WandSignature);
00457   if (wand->debug != MagickFalse)
00458     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00459   return(AcquireString(wand->image_info->magick));
00460 }
00461 
00462 /*
00463 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00464 %                                                                             %
00465 %                                                                             %
00466 %                                                                             %
00467 %   M a g i c k G e t G r a v i t y                                           %
00468 %                                                                             %
00469 %                                                                             %
00470 %                                                                             %
00471 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00472 %
00473 %  MagickGetGravity() gets the wand gravity.
00474 %
00475 %  The format of the MagickGetGravity method is:
00476 %
00477 %      GravityType MagickGetGravity(MagickWand *wand)
00478 %
00479 %  A description of each parameter follows:
00480 %
00481 %    o wand: the magick wand.
00482 %
00483 */
00484 WandExport GravityType MagickGetGravity(MagickWand *wand)
00485 {
00486   const char
00487     *option;
00488 
00489   GravityType
00490     type;
00491 
00492   assert(wand != (MagickWand *) NULL);
00493   assert(wand->signature == WandSignature);
00494   if (wand->debug != MagickFalse)
00495     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00496   option=GetImageOption(wand->image_info,"gravity");
00497   if (option == (const char *) NULL)
00498     return(UndefinedGravity);
00499   type=(GravityType) ParseCommandOption(MagickGravityOptions,MagickFalse,option);
00500   return(type);
00501 }
00502 
00503 /*
00504 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00505 %                                                                             %
00506 %                                                                             %
00507 %                                                                             %
00508 %   M a g i c k G e t H o m e U R L                                           %
00509 %                                                                             %
00510 %                                                                             %
00511 %                                                                             %
00512 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00513 %
00514 %  MagickGetHomeURL() returns the ImageMagick home URL.
00515 %
00516 %  The format of the MagickGetHomeURL method is:
00517 %
00518 %      char *MagickGetHomeURL(void)
00519 %
00520 */
00521 WandExport char *MagickGetHomeURL(void)
00522 {
00523   return(GetMagickHomeURL());
00524 }
00525 
00526 /*
00527 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00528 %                                                                             %
00529 %                                                                             %
00530 %                                                                             %
00531 %   M a g i c k G e t I m a g e A r t i f a c t                               %
00532 %                                                                             %
00533 %                                                                             %
00534 %                                                                             %
00535 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00536 %
00537 %  MagickGetImageArtifact() returns a value associated with the specified
00538 %  artifact.  Use MagickRelinquishMemory() to free the value when you are
00539 %  finished with it.
00540 %
00541 %  The format of the MagickGetImageArtifact method is:
00542 %
00543 %      char *MagickGetImageArtifact(MagickWand *wand,const char *artifact)
00544 %
00545 %  A description of each parameter follows:
00546 %
00547 %    o wand: the magick wand.
00548 %
00549 %    o artifact: the artifact.
00550 %
00551 */
00552 WandExport char *MagickGetImageArtifact(MagickWand *wand,const char *artifact)
00553 {
00554   const char
00555     *value;
00556 
00557   assert(wand != (MagickWand *) NULL);
00558   assert(wand->signature == WandSignature);
00559   if (wand->debug != MagickFalse)
00560     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00561   if (wand->images == (Image *) NULL)
00562     {
00563       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
00564         "ContainsNoImages","`%s'",wand->name);
00565       return((char *) NULL);
00566     }
00567   value=GetImageArtifact(wand->images,artifact);
00568   if (value == (const char *) NULL)
00569     return((char *) NULL);
00570   return(ConstantString(value));
00571 }
00572 
00573 /*
00574 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00575 %                                                                             %
00576 %                                                                             %
00577 %                                                                             %
00578 %   M a g i c k G e t I m a g e P r o p e r t i e s                           %
00579 %                                                                             %
00580 %                                                                             %
00581 %                                                                             %
00582 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00583 %
00584 %  MagickGetImageArtifacts() returns all the artifact names that match the
00585 %  specified pattern associated with a wand.  Use MagickGetImageProperty() to
00586 %  return the value of a particular artifact.  Use MagickRelinquishMemory() to
00587 %  free the value when you are finished with it.
00588 %
00589 %  The format of the MagickGetImageArtifacts method is:
00590 %
00591 %      char *MagickGetImageArtifacts(MagickWand *wand,
00592 %        const char *pattern,size_t *number_artifacts)
00593 %
00594 %  A description of each parameter follows:
00595 %
00596 %    o wand: the magick wand.
00597 %
00598 %    o pattern: Specifies a pointer to a text string containing a pattern.
00599 %
00600 %    o number_artifacts: the number artifacts associated with this wand.
00601 %
00602 */
00603 WandExport char **MagickGetImageArtifacts(MagickWand *wand,
00604   const char *pattern,size_t *number_artifacts)
00605 {
00606   char
00607     **artifacts;
00608 
00609   const char
00610     *artifact;
00611 
00612   register ssize_t
00613     i;
00614 
00615   size_t
00616     length;
00617 
00618   assert(wand != (MagickWand *) NULL);
00619   assert(wand->signature == WandSignature);
00620   if (wand->debug != MagickFalse)
00621     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00622   if (wand->images == (Image *) NULL)
00623     {
00624       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
00625         "ContainsNoImages","`%s'",wand->name);
00626       return((char **) NULL);
00627     }
00628   (void) GetImageProperty(wand->images,"exif:*",wand->exception);
00629   length=1024;
00630   artifacts=(char **) AcquireQuantumMemory(length,sizeof(*artifacts));
00631   if (artifacts == (char **) NULL)
00632     return((char **) NULL);
00633   ResetImagePropertyIterator(wand->images);
00634   artifact=GetNextImageProperty(wand->images);
00635   for (i=0; artifact != (const char *) NULL; )
00636   {
00637     if ((*artifact != '[') &&
00638         (GlobExpression(artifact,pattern,MagickFalse) != MagickFalse))
00639       {
00640         if ((i+1) >= (ssize_t) length)
00641           {
00642             length<<=1;
00643             artifacts=(char **) ResizeQuantumMemory(artifacts,length,
00644               sizeof(*artifacts));
00645             if (artifacts == (char **) NULL)
00646               {
00647                 (void) ThrowMagickException(wand->exception,GetMagickModule(),
00648                   ResourceLimitError,"MemoryAllocationFailed","`%s'",
00649                   wand->name);
00650                 return((char **) NULL);
00651               }
00652           }
00653         artifacts[i]=ConstantString(artifact);
00654         i++;
00655       }
00656     artifact=GetNextImageProperty(wand->images);
00657   }
00658   artifacts[i]=(char *) NULL;
00659   *number_artifacts=(size_t) i;
00660   return(artifacts);
00661 }
00662 
00663 /*
00664 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00665 %                                                                             %
00666 %                                                                             %
00667 %                                                                             %
00668 %   M a g i c k G e t I m a g e P r o f i l e                                 %
00669 %                                                                             %
00670 %                                                                             %
00671 %                                                                             %
00672 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00673 %
00674 %  MagickGetImageProfile() returns the named image profile.
00675 %
00676 %  The format of the MagickGetImageProfile method is:
00677 %
00678 %      unsigned char *MagickGetImageProfile(MagickWand *wand,const char *name,
00679 %        size_t *length)
00680 %
00681 %  A description of each parameter follows:
00682 %
00683 %    o wand: the magick wand.
00684 %
00685 %    o name: Name of profile to return: ICC, IPTC, or generic profile.
00686 %
00687 %    o length: the length of the profile.
00688 %
00689 */
00690 WandExport unsigned char *MagickGetImageProfile(MagickWand *wand,
00691   const char *name,size_t *length)
00692 {
00693   const StringInfo
00694     *profile;
00695 
00696   unsigned char
00697     *datum;
00698 
00699   assert(wand != (MagickWand *) NULL);
00700   assert(wand->signature == WandSignature);
00701   if (wand->debug != MagickFalse)
00702     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00703   if (wand->images == (Image *) NULL)
00704     {
00705       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
00706         "ContainsNoImages","`%s'",wand->name);
00707       return((unsigned char *) NULL);
00708     }
00709   *length=0;
00710   if (wand->images->profiles == (SplayTreeInfo *) NULL)
00711     return((unsigned char *) NULL);
00712   profile=GetImageProfile(wand->images,name);
00713   if (profile == (StringInfo *) NULL)
00714     return((unsigned char *) NULL);
00715   datum=(unsigned char *) AcquireQuantumMemory(GetStringInfoLength(profile),
00716     sizeof(*datum));
00717   if (datum == (unsigned char *) NULL)
00718     return((unsigned char *) NULL);
00719   (void) CopyMagickMemory(datum,GetStringInfoDatum(profile),
00720     GetStringInfoLength(profile));
00721   *length=(size_t) GetStringInfoLength(profile);
00722   return(datum);
00723 }
00724 
00725 /*
00726 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00727 %                                                                             %
00728 %                                                                             %
00729 %                                                                             %
00730 %   M a g i c k G e t I m a g e P r o f i l e s                               %
00731 %                                                                             %
00732 %                                                                             %
00733 %                                                                             %
00734 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00735 %
00736 %  MagickGetImageProfiles() returns all the profile names that match the
00737 %  specified pattern associated with a wand.  Use MagickGetImageProfile() to
00738 %  return the value of a particular property.  Use MagickRelinquishMemory() to
00739 %  free the value when you are finished with it.
00740 %
00741 %  The format of the MagickGetImageProfiles method is:
00742 %
00743 %      char *MagickGetImageProfiles(MagickWand *wand,
00744 %        size_t *number_profiles)
00745 %
00746 %  A description of each parameter follows:
00747 %
00748 %    o wand: the magick wand.
00749 %
00750 %    o pattern: Specifies a pointer to a text string containing a pattern.
00751 %
00752 %    o number_profiles: the number profiles associated with this wand.
00753 %
00754 */
00755 WandExport char **MagickGetImageProfiles(MagickWand *wand,const char *pattern,
00756   size_t *number_profiles)
00757 {
00758   char
00759     **profiles;
00760 
00761   const char
00762     *property;
00763 
00764   register ssize_t
00765     i;
00766 
00767   size_t
00768     length;
00769 
00770   assert(wand != (MagickWand *) NULL);
00771   assert(wand->signature == WandSignature);
00772   if (wand->debug != MagickFalse)
00773     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00774   if (wand->images == (Image *) NULL)
00775     {
00776       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
00777         "ContainsNoImages","`%s'",wand->name);
00778       return((char **) NULL);
00779     }
00780   (void) GetImageProfile(wand->images,"exif:*");
00781   length=1024;
00782   profiles=(char **) AcquireQuantumMemory(length,sizeof(*profiles));
00783   if (profiles == (char **) NULL)
00784     return((char **) NULL);
00785   ResetImageProfileIterator(wand->images);
00786   property=GetNextImageProfile(wand->images);
00787   for (i=0; property != (const char *) NULL; )
00788   {
00789     if ((*property != '[') &&
00790         (GlobExpression(property,pattern,MagickFalse) != MagickFalse))
00791       {
00792         if ((i+1) >= (ssize_t) length)
00793           {
00794             length<<=1;
00795             profiles=(char **) ResizeQuantumMemory(profiles,length,
00796               sizeof(*profiles));
00797             if (profiles == (char **) NULL)
00798               {
00799                 (void) ThrowMagickException(wand->exception,GetMagickModule(),
00800                   ResourceLimitError,"MemoryAllocationFailed","`%s'",
00801                   wand->name);
00802                 return((char **) NULL);
00803               }
00804           }
00805         profiles[i]=ConstantString(property);
00806         i++;
00807       }
00808     property=GetNextImageProfile(wand->images);
00809   }
00810   profiles[i]=(char *) NULL;
00811   *number_profiles=(size_t) i;
00812   return(profiles);
00813 }
00814 
00815 /*
00816 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00817 %                                                                             %
00818 %                                                                             %
00819 %                                                                             %
00820 %   M a g i c k G e t I m a g e P r o p e r t y                               %
00821 %                                                                             %
00822 %                                                                             %
00823 %                                                                             %
00824 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00825 %
00826 %  MagickGetImageProperty() returns a value associated with the specified
00827 %  property.  Use MagickRelinquishMemory() to free the value when you are
00828 %  finished with it.
00829 %
00830 %  The format of the MagickGetImageProperty method is:
00831 %
00832 %      char *MagickGetImageProperty(MagickWand *wand,const char *property)
00833 %
00834 %  A description of each parameter follows:
00835 %
00836 %    o wand: the magick wand.
00837 %
00838 %    o property: the property.
00839 %
00840 */
00841 WandExport char *MagickGetImageProperty(MagickWand *wand,const char *property)
00842 {
00843   const char
00844     *value;
00845 
00846   assert(wand != (MagickWand *) NULL);
00847   assert(wand->signature == WandSignature);
00848   if (wand->debug != MagickFalse)
00849     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00850   if (wand->images == (Image *) NULL)
00851     {
00852       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
00853         "ContainsNoImages","`%s'",wand->name);
00854       return((char *) NULL);
00855     }
00856   value=GetImageProperty(wand->images,property,wand->exception);
00857   if (value == (const char *) NULL)
00858     return((char *) NULL);
00859   return(ConstantString(value));
00860 }
00861 
00862 /*
00863 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00864 %                                                                             %
00865 %                                                                             %
00866 %                                                                             %
00867 %   M a g i c k G e t I m a g e P r o p e r t i e s                           %
00868 %                                                                             %
00869 %                                                                             %
00870 %                                                                             %
00871 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00872 %
00873 %  MagickGetImageProperties() returns all the property names that match the
00874 %  specified pattern associated with a wand.  Use MagickGetImageProperty() to
00875 %  return the value of a particular property.  Use MagickRelinquishMemory() to
00876 %  free the value when you are finished with it.
00877 %
00878 %  The format of the MagickGetImageProperties method is:
00879 %
00880 %      char *MagickGetImageProperties(MagickWand *wand,
00881 %        const char *pattern,size_t *number_properties)
00882 %
00883 %  A description of each parameter follows:
00884 %
00885 %    o wand: the magick wand.
00886 %
00887 %    o pattern: Specifies a pointer to a text string containing a pattern.
00888 %
00889 %    o number_properties: the number properties associated with this wand.
00890 %
00891 */
00892 WandExport char **MagickGetImageProperties(MagickWand *wand,
00893   const char *pattern,size_t *number_properties)
00894 {
00895   char
00896     **properties;
00897 
00898   const char
00899     *property;
00900 
00901   register ssize_t
00902     i;
00903 
00904   size_t
00905     length;
00906 
00907   assert(wand != (MagickWand *) NULL);
00908   assert(wand->signature == WandSignature);
00909   if (wand->debug != MagickFalse)
00910     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00911   if (wand->images == (Image *) NULL)
00912     {
00913       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
00914         "ContainsNoImages","`%s'",wand->name);
00915       return((char **) NULL);
00916     }
00917   (void) GetImageProperty(wand->images,"exif:*",wand->exception);
00918   length=1024;
00919   properties=(char **) AcquireQuantumMemory(length,sizeof(*properties));
00920   if (properties == (char **) NULL)
00921     return((char **) NULL);
00922   ResetImagePropertyIterator(wand->images);
00923   property=GetNextImageProperty(wand->images);
00924   for (i=0; property != (const char *) NULL; )
00925   {
00926     if ((*property != '[') &&
00927         (GlobExpression(property,pattern,MagickFalse) != MagickFalse))
00928       {
00929         if ((i+1) >= (ssize_t) length)
00930           {
00931             length<<=1;
00932             properties=(char **) ResizeQuantumMemory(properties,length,
00933               sizeof(*properties));
00934             if (properties == (char **) NULL)
00935               {
00936                 (void) ThrowMagickException(wand->exception,GetMagickModule(),
00937                   ResourceLimitError,"MemoryAllocationFailed","`%s'",
00938                   wand->name);
00939                 return((char **) NULL);
00940               }
00941           }
00942         properties[i]=ConstantString(property);
00943         i++;
00944       }
00945     property=GetNextImageProperty(wand->images);
00946   }
00947   properties[i]=(char *) NULL;
00948   *number_properties=(size_t) i;
00949   return(properties);
00950 }
00951 
00952 /*
00953 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00954 %                                                                             %
00955 %                                                                             %
00956 %                                                                             %
00957 %   M a g i c k G e t I n t e r l a c e S c h e m e                           %
00958 %                                                                             %
00959 %                                                                             %
00960 %                                                                             %
00961 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00962 %
00963 %  MagickGetInterlaceScheme() gets the wand interlace scheme.
00964 %
00965 %  The format of the MagickGetInterlaceScheme method is:
00966 %
00967 %      InterlaceType MagickGetInterlaceScheme(MagickWand *wand)
00968 %
00969 %  A description of each parameter follows:
00970 %
00971 %    o wand: the magick wand.
00972 %
00973 */
00974 WandExport InterlaceType MagickGetInterlaceScheme(MagickWand *wand)
00975 {
00976   assert(wand != (MagickWand *) NULL);
00977   assert(wand->signature == WandSignature);
00978   if (wand->debug != MagickFalse)
00979     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00980   return(wand->image_info->interlace);
00981 }
00982 
00983 /*
00984 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00985 %                                                                             %
00986 %                                                                             %
00987 %                                                                             %
00988 %   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                       %
00989 %                                                                             %
00990 %                                                                             %
00991 %                                                                             %
00992 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00993 %
00994 %  MagickGetInterpolateMethod() gets the wand compression.
00995 %
00996 %  The format of the MagickGetInterpolateMethod method is:
00997 %
00998 %      PixelInterpolateMethod MagickGetInterpolateMethod(MagickWand *wand)
00999 %
01000 %  A description of each parameter follows:
01001 %
01002 %    o wand: the magick wand.
01003 %
01004 */
01005 WandExport PixelInterpolateMethod MagickGetInterpolateMethod(MagickWand *wand)
01006 {
01007   const char
01008     *option;
01009 
01010   PixelInterpolateMethod
01011     method;
01012 
01013   assert(wand != (MagickWand *) NULL);
01014   assert(wand->signature == WandSignature);
01015   if (wand->debug != MagickFalse)
01016     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01017   option=GetImageOption(wand->image_info,"interpolate");
01018   if (option == (const char *) NULL)
01019     return(UndefinedInterpolatePixel);
01020   method=(PixelInterpolateMethod) ParseCommandOption(MagickInterpolateOptions,
01021     MagickFalse,option);
01022   return(method);
01023 }
01024 
01025 /*
01026 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01027 %                                                                             %
01028 %                                                                             %
01029 %                                                                             %
01030 %   M a g i c k G e t O p t i o n                                             %
01031 %                                                                             %
01032 %                                                                             %
01033 %                                                                             %
01034 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01035 %
01036 %  MagickGetOption() returns a value associated with a wand and the specified
01037 %  key.  Use MagickRelinquishMemory() to free the value when you are finished
01038 %  with it.
01039 %
01040 %  The format of the MagickGetOption method is:
01041 %
01042 %      char *MagickGetOption(MagickWand *wand,const char *key)
01043 %
01044 %  A description of each parameter follows:
01045 %
01046 %    o wand: the magick wand.
01047 %
01048 %    o key: the key.
01049 %
01050 */
01051 WandExport char *MagickGetOption(MagickWand *wand,const char *key)
01052 {
01053   const char
01054     *option;
01055 
01056   assert(wand != (MagickWand *) NULL);
01057   assert(wand->signature == WandSignature);
01058   if (wand->debug != MagickFalse)
01059     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01060   option=GetImageOption(wand->image_info,key);
01061   return(ConstantString(option));
01062 }
01063 
01064 /*
01065 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01066 %                                                                             %
01067 %                                                                             %
01068 %                                                                             %
01069 %   M a g i c k G e t O p t i o n                                             %
01070 %                                                                             %
01071 %                                                                             %
01072 %                                                                             %
01073 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01074 %
01075 %  MagickGetOptions() returns all the option names that match the specified
01076 %  pattern associated with a wand.  Use MagickGetOption() to return the value
01077 %  of a particular option.  Use MagickRelinquishMemory() to free the value
01078 %  when you are finished with it.
01079 %
01080 %  The format of the MagickGetOptions method is:
01081 %
01082 %      char *MagickGetOptions(MagickWand *wand,size_t *number_options)
01083 %
01084 %  A description of each parameter follows:
01085 %
01086 %    o wand: the magick wand.
01087 %
01088 %    o pattern: Specifies a pointer to a text string containing a pattern.
01089 %
01090 %    o number_options: the number options associated with this wand.
01091 %
01092 */
01093 WandExport char **MagickGetOptions(MagickWand *wand,const char *pattern,
01094   size_t *number_options)
01095 {
01096   char
01097     **options;
01098 
01099   const char
01100     *option;
01101 
01102   register ssize_t
01103     i;
01104 
01105   size_t
01106     length;
01107 
01108   assert(wand != (MagickWand *) NULL);
01109   assert(wand->signature == WandSignature);
01110   if (wand->debug != MagickFalse)
01111     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01112   if (wand->images == (Image *) NULL)
01113     {
01114       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
01115         "ContainsNoImages","`%s'",wand->name);
01116       return((char **) NULL);
01117     }
01118   length=1024;
01119   options=(char **) AcquireQuantumMemory(length,sizeof(*options));
01120   if (options == (char **) NULL)
01121     return((char **) NULL);
01122   ResetImageOptionIterator(wand->image_info);
01123   option=GetNextImageOption(wand->image_info);
01124   for (i=0; option != (const char *) NULL; )
01125   {
01126     if ((*option != '[') &&
01127         (GlobExpression(option,pattern,MagickFalse) != MagickFalse))
01128       {
01129         if ((i+1) >= (ssize_t) length)
01130           {
01131             length<<=1;
01132             options=(char **) ResizeQuantumMemory(options,length,
01133               sizeof(*options));
01134             if (options == (char **) NULL)
01135               {
01136                 (void) ThrowMagickException(wand->exception,GetMagickModule(),
01137                   ResourceLimitError,"MemoryAllocationFailed","`%s'",
01138                   wand->name);
01139                 return((char **) NULL);
01140               }
01141           }
01142         options[i]=ConstantString(option);
01143         i++;
01144       }
01145     option=GetNextImageOption(wand->image_info);
01146   }
01147   options[i]=(char *) NULL;
01148   *number_options=(size_t) i;
01149   return(options);
01150 }
01151 
01152 /*
01153 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01154 %                                                                             %
01155 %                                                                             %
01156 %                                                                             %
01157 %   M a g i c k G e t O r i e n t a t i o n                                   %
01158 %                                                                             %
01159 %                                                                             %
01160 %                                                                             %
01161 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01162 %
01163 %  MagickGetOrientation() gets the wand orientation type.
01164 %
01165 %  The format of the MagickGetOrientation method is:
01166 %
01167 %      OrientationType MagickGetOrientation(MagickWand *wand)
01168 %
01169 %  A description of each parameter follows:
01170 %
01171 %    o wand: the magick wand.
01172 %
01173 */
01174 WandExport OrientationType MagickGetOrientation(MagickWand *wand)
01175 {
01176   assert(wand != (MagickWand *) NULL);
01177   assert(wand->signature == WandSignature);
01178   if (wand->debug != MagickFalse)
01179     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01180   return(wand->image_info->orientation);
01181 }
01182 
01183 /*
01184 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01185 %                                                                             %
01186 %                                                                             %
01187 %                                                                             %
01188 %   M a g i c k G e t P a c k a g e N a m e                                   %
01189 %                                                                             %
01190 %                                                                             %
01191 %                                                                             %
01192 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01193 %
01194 %  MagickGetPackageName() returns the ImageMagick package name as a string
01195 %  constant.
01196 %
01197 %  The format of the MagickGetPackageName method is:
01198 %
01199 %      const char *MagickGetPackageName(void)
01200 %
01201 %
01202 */
01203 WandExport const char *MagickGetPackageName(void)
01204 {
01205   return(GetMagickPackageName());
01206 }
01207 
01208 /*
01209 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01210 %                                                                             %
01211 %                                                                             %
01212 %                                                                             %
01213 %   M a g i c k G e t P a g e                                                 %
01214 %                                                                             %
01215 %                                                                             %
01216 %                                                                             %
01217 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01218 %
01219 %  MagickGetPage() returns the page geometry associated with the magick wand.
01220 %
01221 %  The format of the MagickGetPage method is:
01222 %
01223 %      MagickBooleanType MagickGetPage(const MagickWand *wand,
01224 %        size_t *width,size_t *height,ssize_t *x,ssize_t *y)
01225 %
01226 %  A description of each parameter follows:
01227 %
01228 %    o wand: the magick wand.
01229 %
01230 %    o width: the page width.
01231 %
01232 %    o height: page height.
01233 %
01234 %    o x: the page x-offset.
01235 %
01236 %    o y: the page y-offset.
01237 %
01238 */
01239 WandExport MagickBooleanType MagickGetPage(const MagickWand *wand,
01240   size_t *width,size_t *height,ssize_t *x,ssize_t *y)
01241 {
01242   RectangleInfo
01243     geometry;
01244 
01245   assert(wand != (const MagickWand *) NULL);
01246   assert(wand->signature == WandSignature);
01247   if (wand->debug != MagickFalse)
01248     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01249   (void) ResetMagickMemory(&geometry,0,sizeof(geometry));
01250   (void) ParseAbsoluteGeometry(wand->image_info->page,&geometry);
01251   *width=geometry.width;
01252   *height=geometry.height;
01253   *x=geometry.x;
01254   *y=geometry.y;
01255   return(MagickTrue);
01256 }
01257 
01258 /*
01259 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01260 %                                                                             %
01261 %                                                                             %
01262 %                                                                             %
01263 %   M a g i c k G e t P o i n t s i z e                                       %
01264 %                                                                             %
01265 %                                                                             %
01266 %                                                                             %
01267 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01268 %
01269 %  MagickGetPointsize() returns the font pointsize associated with the
01270 %  MagickWand.
01271 %
01272 %  The format of the MagickGetPointsize method is:
01273 %
01274 %      double MagickGetPointsize(MagickWand *wand)
01275 %
01276 %  A description of each parameter follows:
01277 %
01278 %    o wand: the magick wand.
01279 %
01280 */
01281 WandExport double MagickGetPointsize(MagickWand *wand)
01282 {
01283   assert(wand != (MagickWand *) NULL);
01284   assert(wand->signature == WandSignature);
01285   if (wand->debug != MagickFalse)
01286     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01287   return(wand->image_info->pointsize);
01288 }
01289 
01290 /*
01291 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01292 %                                                                             %
01293 %                                                                             %
01294 %                                                                             %
01295 %   M a g i c k G e t Q u a n t u m D e p t h                                 %
01296 %                                                                             %
01297 %                                                                             %
01298 %                                                                             %
01299 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01300 %
01301 %  MagickGetQuantumDepth() returns the ImageMagick quantum depth as a string
01302 %  constant.
01303 %
01304 %  The format of the MagickGetQuantumDepth method is:
01305 %
01306 %      const char *MagickGetQuantumDepth(size_t *depth)
01307 %
01308 %  A description of each parameter follows:
01309 %
01310 %    o depth: the quantum depth is returned as a number.
01311 %
01312 */
01313 WandExport const char *MagickGetQuantumDepth(size_t *depth)
01314 {
01315   return(GetMagickQuantumDepth(depth));
01316 }
01317 
01318 /*
01319 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01320 %                                                                             %
01321 %                                                                             %
01322 %                                                                             %
01323 %   M a g i c k G e t Q u a n t u m R a n g e                                 %
01324 %                                                                             %
01325 %                                                                             %
01326 %                                                                             %
01327 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01328 %
01329 %  MagickGetQuantumRange() returns the ImageMagick quantum range as a string
01330 %  constant.
01331 %
01332 %  The format of the MagickGetQuantumRange method is:
01333 %
01334 %      const char *MagickGetQuantumRange(size_t *range)
01335 %
01336 %  A description of each parameter follows:
01337 %
01338 %    o range: the quantum range is returned as a number.
01339 %
01340 */
01341 WandExport const char *MagickGetQuantumRange(size_t *range)
01342 {
01343   return(GetMagickQuantumRange(range));
01344 }
01345 
01346 /*
01347 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01348 %                                                                             %
01349 %                                                                             %
01350 %                                                                             %
01351 %   M a g i c k G e t R e l e a s e D a t e                                   %
01352 %                                                                             %
01353 %                                                                             %
01354 %                                                                             %
01355 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01356 %
01357 %  MagickGetReleaseDate() returns the ImageMagick release date as a string
01358 %  constant.
01359 %
01360 %  The format of the MagickGetReleaseDate method is:
01361 %
01362 %      const char *MagickGetReleaseDate(void)
01363 %
01364 */
01365 WandExport const char *MagickGetReleaseDate(void)
01366 {
01367   return(GetMagickReleaseDate());
01368 }
01369 
01370 /*
01371 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01372 %                                                                             %
01373 %                                                                             %
01374 %                                                                             %
01375 %   M a g i c k G e t R e s o l u t i o n                                     %
01376 %                                                                             %
01377 %                                                                             %
01378 %                                                                             %
01379 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01380 %
01381 %  MagickGetResolution() gets the image X and Y resolution.
01382 %
01383 %  The format of the MagickGetResolution method is:
01384 %
01385 %      MagickBooleanType MagickGetResolution(const MagickWand *wand,double *x,
01386 %        double *y)
01387 %
01388 %  A description of each parameter follows:
01389 %
01390 %    o wand: the magick wand.
01391 %
01392 %    o x: the x-resolution.
01393 %
01394 %    o y: the y-resolution.
01395 %
01396 */
01397 WandExport MagickBooleanType MagickGetResolution(const MagickWand *wand,
01398   double *x,double *y)
01399 {
01400   assert(wand != (MagickWand *) NULL);
01401   assert(wand->signature == WandSignature);
01402   if (wand->debug != MagickFalse)
01403     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01404   *x=72.0;
01405   *y=72.0;
01406   if (wand->image_info->density != (char *) NULL)
01407     {
01408       GeometryInfo
01409         geometry_info;
01410 
01411       MagickStatusType
01412         flags;
01413 
01414       flags=ParseGeometry(wand->image_info->density,&geometry_info);
01415       *x=geometry_info.rho;
01416       *y=geometry_info.sigma;
01417       if ((flags & SigmaValue) == MagickFalse)
01418         *y=(*x);
01419     }
01420   return(MagickTrue);
01421 }
01422 
01423 /*
01424 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01425 %                                                                             %
01426 %                                                                             %
01427 %                                                                             %
01428 %   M a g i c k G e t R e s o u r c e                                         %
01429 %                                                                             %
01430 %                                                                             %
01431 %                                                                             %
01432 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01433 %
01434 %  MagickGetResource() returns the specified resource in megabytes.
01435 %
01436 %  The format of the MagickGetResource method is:
01437 %
01438 %      MagickSizeType MagickGetResource(const ResourceType type)
01439 %
01440 %  A description of each parameter follows:
01441 %
01442 %    o wand: the magick wand.
01443 %
01444 */
01445 WandExport MagickSizeType MagickGetResource(const ResourceType type)
01446 {
01447   return(GetMagickResource(type));
01448 }
01449 
01450 /*
01451 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01452 %                                                                             %
01453 %                                                                             %
01454 %                                                                             %
01455 %   M a g i c k G e t R e s o u r c e L i m i t                               %
01456 %                                                                             %
01457 %                                                                             %
01458 %                                                                             %
01459 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01460 %
01461 %  MagickGetResourceLimit() returns the specified resource limit in megabytes.
01462 %
01463 %  The format of the MagickGetResourceLimit method is:
01464 %
01465 %      MagickSizeType MagickGetResourceLimit(const ResourceType type)
01466 %
01467 %  A description of each parameter follows:
01468 %
01469 %    o wand: the magick wand.
01470 %
01471 */
01472 WandExport MagickSizeType MagickGetResourceLimit(const ResourceType type)
01473 {
01474   return(GetMagickResourceLimit(type));
01475 }
01476 
01477 /*
01478 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01479 %                                                                             %
01480 %                                                                             %
01481 %                                                                             %
01482 %   M a g i c k G e t S a m p l i n g F a c t o r s                           %
01483 %                                                                             %
01484 %                                                                             %
01485 %                                                                             %
01486 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01487 %
01488 %  MagickGetSamplingFactors() gets the horizontal and vertical sampling factor.
01489 %
01490 %  The format of the MagickGetSamplingFactors method is:
01491 %
01492 %      double *MagickGetSamplingFactor(MagickWand *wand,
01493 %        size_t *number_factors)
01494 %
01495 %  A description of each parameter follows:
01496 %
01497 %    o wand: the magick wand.
01498 %
01499 %    o number_factors: the number of factors in the returned array.
01500 %
01501 */
01502 WandExport double *MagickGetSamplingFactors(MagickWand *wand,
01503   size_t *number_factors)
01504 {
01505   double
01506     *sampling_factors;
01507 
01508   register const char
01509     *p;
01510 
01511   register ssize_t
01512     i;
01513 
01514   assert(wand != (MagickWand *) NULL);
01515   assert(wand->signature == WandSignature);
01516   if (wand->debug != MagickFalse)
01517     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01518   *number_factors=0;
01519   sampling_factors=(double *) NULL;
01520   if (wand->image_info->sampling_factor == (char *) NULL)
01521     return(sampling_factors);
01522   i=0;
01523   for (p=wand->image_info->sampling_factor; p != (char *) NULL; p=strchr(p,','))
01524   {
01525     while (((int) *p != 0) && ((isspace((int) ((unsigned char) *p)) != 0) ||
01526            (*p == ',')))
01527       p++;
01528     i++;
01529   }
01530   sampling_factors=(double *) AcquireQuantumMemory((size_t) i,
01531     sizeof(*sampling_factors));
01532   if (sampling_factors == (double *) NULL)
01533     ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed",
01534       wand->image_info->filename);
01535   i=0;
01536   for (p=wand->image_info->sampling_factor; p != (char *) NULL; p=strchr(p,','))
01537   {
01538     while (((int) *p != 0) && ((isspace((int) ((unsigned char) *p)) != 0) ||
01539            (*p == ',')))
01540       p++;
01541     sampling_factors[i]=StringToDouble(p,(char **) NULL);
01542     i++;
01543   }
01544   *number_factors=(size_t) i;
01545   return(sampling_factors);
01546 }
01547 
01548 /*
01549 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01550 %                                                                             %
01551 %                                                                             %
01552 %                                                                             %
01553 %   M a g i c k G e t S i z e                                                 %
01554 %                                                                             %
01555 %                                                                             %
01556 %                                                                             %
01557 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01558 %
01559 %  MagickGetSize() returns the size associated with the magick wand.
01560 %
01561 %  The format of the MagickGetSize method is:
01562 %
01563 %      MagickBooleanType MagickGetSize(const MagickWand *wand,
01564 %        size_t *columns,size_t *rows)
01565 %
01566 %  A description of each parameter follows:
01567 %
01568 %    o wand: the magick wand.
01569 %
01570 %    o columns: the width in pixels.
01571 %
01572 %    o height: the height in pixels.
01573 %
01574 */
01575 WandExport MagickBooleanType MagickGetSize(const MagickWand *wand,
01576   size_t *columns,size_t *rows)
01577 {
01578   RectangleInfo
01579     geometry;
01580 
01581   assert(wand != (const MagickWand *) NULL);
01582   assert(wand->signature == WandSignature);
01583   if (wand->debug != MagickFalse)
01584     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01585   (void) ResetMagickMemory(&geometry,0,sizeof(geometry));
01586   (void) ParseAbsoluteGeometry(wand->image_info->size,&geometry);
01587   *columns=geometry.width;
01588   *rows=geometry.height;
01589   return(MagickTrue);
01590 }
01591 
01592 /*
01593 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01594 %                                                                             %
01595 %                                                                             %
01596 %                                                                             %
01597 %   M a g i c k G e t S i z e O f f s e t                                     %
01598 %                                                                             %
01599 %                                                                             %
01600 %                                                                             %
01601 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01602 %
01603 %  MagickGetSizeOffset() returns the size offset associated with the magick
01604 %  wand.
01605 %
01606 %  The format of the MagickGetSizeOffset method is:
01607 %
01608 %      MagickBooleanType MagickGetSizeOffset(const MagickWand *wand,
01609 %        ssize_t *offset)
01610 %
01611 %  A description of each parameter follows:
01612 %
01613 %    o wand: the magick wand.
01614 %
01615 %    o offset: the image offset.
01616 %
01617 */
01618 WandExport MagickBooleanType MagickGetSizeOffset(const MagickWand *wand,
01619   ssize_t *offset)
01620 {
01621   RectangleInfo
01622     geometry;
01623 
01624   assert(wand != (const MagickWand *) NULL);
01625   assert(wand->signature == WandSignature);
01626   if (wand->debug != MagickFalse)
01627     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01628   (void) ResetMagickMemory(&geometry,0,sizeof(geometry));
01629   (void) ParseAbsoluteGeometry(wand->image_info->size,&geometry);
01630   *offset=geometry.x;
01631   return(MagickTrue);
01632 }
01633 
01634 /*
01635 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01636 %                                                                             %
01637 %                                                                             %
01638 %                                                                             %
01639 %   M a g i c k G e t T y p e                                                 %
01640 %                                                                             %
01641 %                                                                             %
01642 %                                                                             %
01643 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01644 %
01645 %  MagickGetType() returns the wand type.
01646 %
01647 %  The format of the MagickGetType method is:
01648 %
01649 %      ImageType MagickGetType(MagickWand *wand)
01650 %
01651 %  A description of each parameter follows:
01652 %
01653 %    o wand: the magick wand.
01654 %
01655 */
01656 WandExport ImageType MagickGetType(MagickWand *wand)
01657 {
01658   assert(wand != (MagickWand *) NULL);
01659   assert(wand->signature == WandSignature);
01660   if (wand->debug != MagickFalse)
01661     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01662   return(wand->image_info->type);
01663 }
01664 
01665 /*
01666 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01667 %                                                                             %
01668 %                                                                             %
01669 %                                                                             %
01670 %   M a g i c k G e t V e r s i o n                                           %
01671 %                                                                             %
01672 %                                                                             %
01673 %                                                                             %
01674 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01675 %
01676 %  MagickGetVersion() returns the ImageMagick API version as a string constant
01677 %  and as a number.
01678 %
01679 %  The format of the MagickGetVersion method is:
01680 %
01681 %      const char *MagickGetVersion(size_t *version)
01682 %
01683 %  A description of each parameter follows:
01684 %
01685 %    o version: the ImageMagick version is returned as a number.
01686 %
01687 */
01688 WandExport const char *MagickGetVersion(size_t *version)
01689 {
01690   return(GetMagickVersion(version));
01691 }
01692 
01693 /*
01694 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01695 %                                                                             %
01696 %                                                                             %
01697 %                                                                             %
01698 %   M a g i c k P r o f i l e I m a g e                                       %
01699 %                                                                             %
01700 %                                                                             %
01701 %                                                                             %
01702 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01703 %
01704 %  MagickProfileImage() adds or removes a ICC, IPTC, or generic profile
01705 %  from an image.  If the profile is NULL, it is removed from the image
01706 %  otherwise added.  Use a name of '*' and a profile of NULL to remove all
01707 %  profiles from the image.
01708 %
01709 %  The format of the MagickProfileImage method is:
01710 %
01711 %      MagickBooleanType MagickProfileImage(MagickWand *wand,const char *name,
01712 %        const void *profile,const size_t length)
01713 %
01714 %  A description of each parameter follows:
01715 %
01716 %    o wand: the magick wand.
01717 %
01718 %    o name: Name of profile to add or remove: ICC, IPTC, or generic profile.
01719 %
01720 %    o profile: the profile.
01721 %
01722 %    o length: the length of the profile.
01723 %
01724 */
01725 WandExport MagickBooleanType MagickProfileImage(MagickWand *wand,
01726   const char *name,const void *profile,const size_t length)
01727 {
01728   assert(wand != (MagickWand *) NULL);
01729   assert(wand->signature == WandSignature);
01730   if (wand->debug != MagickFalse)
01731     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01732   if (wand->images == (Image *) NULL)
01733     ThrowWandException(WandError,"ContainsNoImages",wand->name);
01734   return(ProfileImage(wand->images,name,profile,length,wand->exception));
01735 }
01736 
01737 /*
01738 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01739 %                                                                             %
01740 %                                                                             %
01741 %                                                                             %
01742 %   M a g i c k R e m o v e I m a g e P r o f i l e                           %
01743 %                                                                             %
01744 %                                                                             %
01745 %                                                                             %
01746 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01747 %
01748 %  MagickRemoveImageProfile() removes the named image profile and returns it.
01749 %
01750 %  The format of the MagickRemoveImageProfile method is:
01751 %
01752 %      unsigned char *MagickRemoveImageProfile(MagickWand *wand,
01753 %        const char *name,size_t *length)
01754 %
01755 %  A description of each parameter follows:
01756 %
01757 %    o wand: the magick wand.
01758 %
01759 %    o name: Name of profile to return: ICC, IPTC, or generic profile.
01760 %
01761 %    o length: the length of the profile.
01762 %
01763 */
01764 WandExport unsigned char *MagickRemoveImageProfile(MagickWand *wand,
01765   const char *name,size_t *length)
01766 {
01767   StringInfo
01768     *profile;
01769 
01770   unsigned char
01771     *datum;
01772 
01773   assert(wand != (MagickWand *) NULL);
01774   assert(wand->signature == WandSignature);
01775   if (wand->debug != MagickFalse)
01776     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01777   if (wand->images == (Image *) NULL)
01778     {
01779       (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
01780         "ContainsNoImages","`%s'",wand->name);
01781       return((unsigned char *) NULL);
01782     }
01783   *length=0;
01784   profile=RemoveImageProfile(wand->images,name);
01785   if (profile == (StringInfo *) NULL)
01786     return((unsigned char *) NULL);
01787   datum=(unsigned char *) AcquireQuantumMemory(GetStringInfoLength(profile),
01788     sizeof(*datum));
01789   if (datum == (unsigned char *) NULL)
01790     return((unsigned char *) NULL);
01791   (void) CopyMagickMemory(datum,GetStringInfoDatum(profile),
01792     GetStringInfoLength(profile));
01793   *length=GetStringInfoLength(profile);
01794   profile=DestroyStringInfo(profile);
01795   return(datum);
01796 }
01797 
01798 /*
01799 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01800 %                                                                             %
01801 %                                                                             %
01802 %                                                                             %
01803 %   M a g i c k S e t A n t i a l i a s                                       %
01804 %                                                                             %
01805 %                                                                             %
01806 %                                                                             %
01807 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01808 %
01809 %  MagickSetAntialias() sets the antialias propery of the wand.
01810 %
01811 %  The format of the MagickSetAntialias method is:
01812 %
01813 %      MagickBooleanType MagickSetAntialias(MagickWand *wand,
01814 %        const MagickBooleanType antialias)
01815 %
01816 %  A description of each parameter follows:
01817 %
01818 %    o wand: the magick wand.
01819 %
01820 %    o antialias: the antialias property.
01821 %
01822 */
01823 WandExport MagickBooleanType MagickSetAntialias(MagickWand *wand,
01824   const MagickBooleanType antialias)
01825 {
01826   assert(wand != (MagickWand *) NULL);
01827   assert(wand->signature == WandSignature);
01828   if (wand->debug != MagickFalse)
01829     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01830   wand->image_info->antialias=antialias;
01831   return(MagickTrue);
01832 }
01833 
01834 /*
01835 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01836 %                                                                             %
01837 %                                                                             %
01838 %                                                                             %
01839 %   M a g i c k S e t B a c k g r o u n d C o l o r                           %
01840 %                                                                             %
01841 %                                                                             %
01842 %                                                                             %
01843 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01844 %
01845 %  MagickSetBackgroundColor() sets the wand background color.
01846 %
01847 %  The format of the MagickSetBackgroundColor method is:
01848 %
01849 %      MagickBooleanType MagickSetBackgroundColor(MagickWand *wand,
01850 %        const PixelWand *background)
01851 %
01852 %  A description of each parameter follows:
01853 %
01854 %    o wand: the magick wand.
01855 %
01856 %    o background: the background pixel wand.
01857 %
01858 */
01859 WandExport MagickBooleanType MagickSetBackgroundColor(MagickWand *wand,
01860   const PixelWand *background)
01861 {
01862   assert(wand != (MagickWand *) NULL);
01863   assert(wand->signature == WandSignature);
01864   if (wand->debug != MagickFalse)
01865     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01866   PixelGetQuantumPacket(background,&wand->image_info->background_color);
01867   return(MagickTrue);
01868 }
01869 
01870 /*
01871 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01872 %                                                                             %
01873 %                                                                             %
01874 %                                                                             %
01875 %   M a g i c k S e t C o l o r s p a c e                                     %
01876 %                                                                             %
01877 %                                                                             %
01878 %                                                                             %
01879 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01880 %
01881 %  MagickSetColorspace() sets the wand colorspace type.
01882 %
01883 %  The format of the MagickSetColorspace method is:
01884 %
01885 %      MagickBooleanType MagickSetColorspace(MagickWand *wand,
01886 %        const ColorspaceType colorspace)
01887 %
01888 %  A description of each parameter follows:
01889 %
01890 %    o wand: the magick wand.
01891 %
01892 %    o colorspace: the wand colorspace.
01893 %
01894 */
01895 WandExport MagickBooleanType MagickSetColorspace(MagickWand *wand,
01896   const ColorspaceType colorspace)
01897 {
01898   assert(wand != (MagickWand *) NULL);
01899   assert(wand->signature == WandSignature);
01900   if (wand->debug != MagickFalse)
01901     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01902   wand->image_info->colorspace=colorspace;
01903   return(MagickTrue);
01904 }
01905 
01906 /*
01907 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01908 %                                                                             %
01909 %                                                                             %
01910 %                                                                             %
01911 %   M a g i c k S e t C o m p r e s s i o n                                   %
01912 %                                                                             %
01913 %                                                                             %
01914 %                                                                             %
01915 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01916 %
01917 %  MagickSetCompression() sets the wand compression type.
01918 %
01919 %  The format of the MagickSetCompression method is:
01920 %
01921 %      MagickBooleanType MagickSetCompression(MagickWand *wand,
01922 %        const CompressionType compression)
01923 %
01924 %  A description of each parameter follows:
01925 %
01926 %    o wand: the magick wand.
01927 %
01928 %    o compression: the wand compression.
01929 %
01930 */
01931 WandExport MagickBooleanType MagickSetCompression(MagickWand *wand,
01932   const CompressionType compression)
01933 {
01934   assert(wand != (MagickWand *) NULL);
01935   assert(wand->signature == WandSignature);
01936   if (wand->debug != MagickFalse)
01937     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01938   wand->image_info->compression=compression;
01939   return(MagickTrue);
01940 }
01941 
01942 /*
01943 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01944 %                                                                             %
01945 %                                                                             %
01946 %                                                                             %
01947 %   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                     %
01948 %                                                                             %
01949 %                                                                             %
01950 %                                                                             %
01951 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01952 %
01953 %  MagickSetCompressionQuality() sets the wand compression quality.
01954 %
01955 %  The format of the MagickSetCompressionQuality method is:
01956 %
01957 %      MagickBooleanType MagickSetCompressionQuality(MagickWand *wand,
01958 %        const size_t quality)
01959 %
01960 %  A description of each parameter follows:
01961 %
01962 %    o wand: the magick wand.
01963 %
01964 %    o quality: the wand compression quality.
01965 %
01966 */
01967 WandExport MagickBooleanType MagickSetCompressionQuality(MagickWand *wand,
01968   const size_t quality)
01969 {
01970   assert(wand != (MagickWand *) NULL);
01971   assert(wand->signature == WandSignature);
01972   if (wand->debug != MagickFalse)
01973     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01974   wand->image_info->quality=quality;
01975   return(MagickTrue);
01976 }
01977 
01978 /*
01979 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01980 %                                                                             %
01981 %                                                                             %
01982 %                                                                             %
01983 %   M a g i c k S e t D e p t h                                               %
01984 %                                                                             %
01985 %                                                                             %
01986 %                                                                             %
01987 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01988 %
01989 %  MagickSetDepth() sets the wand pixel depth.
01990 %
01991 %  The format of the MagickSetDepth method is:
01992 %
01993 %      MagickBooleanType MagickSetDepth(MagickWand *wand,
01994 %        const size_t depth)
01995 %
01996 %  A description of each parameter follows:
01997 %
01998 %    o wand: the magick wand.
01999 %
02000 %    o depth: the wand pixel depth.
02001 %
02002 */
02003 WandExport MagickBooleanType MagickSetDepth(MagickWand *wand,
02004   const size_t depth)
02005 {
02006   assert(wand != (MagickWand *) NULL);
02007   assert(wand->signature == WandSignature);
02008   if (wand->debug != MagickFalse)
02009     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02010   wand->image_info->depth=depth;
02011   return(MagickTrue);
02012 }
02013 
02014 /*
02015 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02016 %                                                                             %
02017 %                                                                             %
02018 %                                                                             %
02019 %   M a g i c k S e t E x t r a c t                                           %
02020 %                                                                             %
02021 %                                                                             %
02022 %                                                                             %
02023 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02024 %
02025 %  MagickSetExtract() sets the extract geometry before you read or write an
02026 %  image file.  Use it for inline cropping (e.g. 200x200+0+0) or resizing
02027 %  (e.g.200x200).
02028 %
02029 %  The format of the MagickSetExtract method is:
02030 %
02031 %      MagickBooleanType MagickSetExtract(MagickWand *wand,
02032 %        const char *geometry)
02033 %
02034 %  A description of each parameter follows:
02035 %
02036 %    o wand: the magick wand.
02037 %
02038 %    o geometry: the extract geometry.
02039 %
02040 */
02041 WandExport MagickBooleanType MagickSetExtract(MagickWand *wand,
02042   const char *geometry)
02043 {
02044   assert(wand != (MagickWand *) NULL);
02045   assert(wand->signature == WandSignature);
02046   if (wand->debug != MagickFalse)
02047     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02048   if (geometry != (const char *) NULL)
02049     (void) CopyMagickString(wand->image_info->extract,geometry,MaxTextExtent);
02050   return(MagickTrue);
02051 }
02052 
02053 /*
02054 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02055 %                                                                             %
02056 %                                                                             %
02057 %                                                                             %
02058 %   M a g i c k S e t F i l e n a m e                                         %
02059 %                                                                             %
02060 %                                                                             %
02061 %                                                                             %
02062 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02063 %
02064 %  MagickSetFilename() sets the filename before you read or write an image file.
02065 %
02066 %  The format of the MagickSetFilename method is:
02067 %
02068 %      MagickBooleanType MagickSetFilename(MagickWand *wand,
02069 %        const char *filename)
02070 %
02071 %  A description of each parameter follows:
02072 %
02073 %    o wand: the magick wand.
02074 %
02075 %    o filename: the image filename.
02076 %
02077 */
02078 WandExport MagickBooleanType MagickSetFilename(MagickWand *wand,
02079   const char *filename)
02080 {
02081   assert(wand != (MagickWand *) NULL);
02082   assert(wand->signature == WandSignature);
02083   if (wand->debug != MagickFalse)
02084     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02085   if (filename != (const char *) NULL)
02086     (void) CopyMagickString(wand->image_info->filename,filename,MaxTextExtent);
02087   return(MagickTrue);
02088 }
02089 
02090 /*
02091 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02092 %                                                                             %
02093 %                                                                             %
02094 %                                                                             %
02095 %   M a g i c k S e t F o n t                                                 %
02096 %                                                                             %
02097 %                                                                             %
02098 %                                                                             %
02099 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02100 %
02101 %  MagickSetFont() sets the font associated with the MagickWand.
02102 %
02103 %  The format of the MagickSetFont method is:
02104 %
02105 %      MagickBooleanType MagickSetFont(MagickWand *wand, const char *font)
02106 %
02107 %  A description of each parameter follows:
02108 %
02109 %    o wand: the magick wand.
02110 %
02111 %    o font: the font
02112 %
02113 */
02114 WandExport MagickBooleanType MagickSetFont(MagickWand *wand,const char *font)
02115 {
02116   if ((font == (const char *) NULL) || (*font == '\0'))
02117     return(MagickFalse);
02118   assert(wand != (MagickWand *) NULL);
02119   assert(wand->signature == WandSignature);
02120   if (wand->debug != MagickFalse)
02121     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02122   (void) CloneString(&wand->image_info->font,font);
02123   return(MagickTrue);
02124 }
02125 
02126 /*
02127 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02128 %                                                                             %
02129 %                                                                             %
02130 %                                                                             %
02131 %   M a g i c k S e t F o r m a t                                             %
02132 %                                                                             %
02133 %                                                                             %
02134 %                                                                             %
02135 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02136 %
02137 %  MagickSetFormat() sets the format of the magick wand.
02138 %
02139 %  The format of the MagickSetFormat method is:
02140 %
02141 %      MagickBooleanType MagickSetFormat(MagickWand *wand,const char *format)
02142 %
02143 %  A description of each parameter follows:
02144 %
02145 %    o wand: the magick wand.
02146 %
02147 %    o format: the image format.
02148 %
02149 */
02150 WandExport MagickBooleanType MagickSetFormat(MagickWand *wand,
02151   const char *format)
02152 {
02153   const MagickInfo
02154     *magick_info;
02155 
02156   assert(wand != (MagickWand *) NULL);
02157   assert(wand->signature == WandSignature);
02158   if (wand->debug != MagickFalse)
02159     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02160   if ((format == (char *) NULL) || (*format == '\0'))
02161     {
02162       *wand->image_info->magick='\0';
02163       return(MagickTrue);
02164     }
02165   magick_info=GetMagickInfo(format,wand->exception);
02166   if (magick_info == (const MagickInfo *) NULL)
02167     return(MagickFalse);
02168   ClearMagickException(wand->exception);
02169   (void) CopyMagickString(wand->image_info->magick,format,MaxTextExtent);
02170   return(MagickTrue);
02171 }
02172 
02173 /*
02174 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02175 %                                                                             %
02176 %                                                                             %
02177 %                                                                             %
02178 %   M a g i c k S e t G r a v i t y                                           %
02179 %                                                                             %
02180 %                                                                             %
02181 %                                                                             %
02182 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02183 %
02184 %  MagickSetGravity() sets the gravity type.
02185 %
02186 %  The format of the MagickSetGravity type is:
02187 %
02188 %      MagickBooleanType MagickSetGravity(MagickWand *wand,
02189 %        const GravityType type)
02190 %
02191 %  A description of each parameter follows:
02192 %
02193 %    o wand: the magick wand.
02194 %
02195 %    o type: the gravity type.
02196 %
02197 */
02198 WandExport MagickBooleanType MagickSetGravity(MagickWand *wand,
02199   const GravityType type)
02200 {
02201   MagickBooleanType
02202     status;
02203 
02204   assert(wand != (MagickWand *) NULL);
02205   assert(wand->signature == WandSignature);
02206   if (wand->debug != MagickFalse)
02207     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02208   status=SetImageOption(wand->image_info,"gravity",CommandOptionToMnemonic(
02209     MagickGravityOptions,(ssize_t) type));
02210   return(status);
02211 }
02212 
02213 /*
02214 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02215 %                                                                             %
02216 %                                                                             %
02217 %                                                                             %
02218 %   M a g i c k S e t I m a g e A r t i f r c t                               %
02219 %                                                                             %
02220 %                                                                             %
02221 %                                                                             %
02222 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02223 %
02224 %  MagickSetImageArtifact() associates a artifact with an image.
02225 %
02226 %  The format of the MagickSetImageArtifact method is:
02227 %
02228 %      MagickBooleanType MagickSetImageArtifact(MagickWand *wand,
02229 %        const char *artifact,const char *value)
02230 %
02231 %  A description of each parameter follows:
02232 %
02233 %    o wand: the magick wand.
02234 %
02235 %    o artifact: the artifact.
02236 %
02237 %    o value: the value.
02238 %
02239 */
02240 WandExport MagickBooleanType MagickSetImageArtifact(MagickWand *wand,
02241   const char *artifact,const char *value)
02242 {
02243   assert(wand != (MagickWand *) NULL);
02244   assert(wand->signature == WandSignature);
02245   if (wand->debug != MagickFalse)
02246     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02247   if (wand->images == (Image *) NULL)
02248     ThrowWandException(WandError,"ContainsNoImages",wand->name);
02249   return(SetImageArtifact(wand->images,artifact,value));
02250 }
02251 
02252 /*
02253 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02254 %                                                                             %
02255 %                                                                             %
02256 %                                                                             %
02257 %   M a g i c k S e t P r o f i l e I m a g e                                 %
02258 %                                                                             %
02259 %                                                                             %
02260 %                                                                             %
02261 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02262 %
02263 %  MagickSetImageProfile() adds a named profile to the magick wand.  If a
02264 %  profile with the same name already exists, it is replaced.  This method
02265 %  differs from the MagickProfileImage() method in that it does not apply any
02266 %  CMS color profiles.
02267 %
02268 %  The format of the MagickSetImageProfile method is:
02269 %
02270 %      MagickBooleanType MagickSetImageProfile(MagickWand *wand,
02271 %        const char *name,const void *profile,const size_t length)
02272 %
02273 %  A description of each parameter follows:
02274 %
02275 %    o wand: the magick wand.
02276 %
02277 %    o name: Name of profile to add or remove: ICC, IPTC, or generic profile.
02278 %
02279 %    o profile: the profile.
02280 %
02281 %    o length: the length of the profile.
02282 %
02283 */
02284 WandExport MagickBooleanType MagickSetImageProfile(MagickWand *wand,
02285   const char *name,const void *profile,const size_t length)
02286 {
02287   MagickBooleanType
02288     status;
02289 
02290   StringInfo
02291     *profile_info;
02292 
02293   assert(wand != (MagickWand *) NULL);
02294   assert(wand->signature == WandSignature);
02295   if (wand->debug != MagickFalse)
02296     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02297   if (wand->images == (Image *) NULL)
02298     ThrowWandException(WandError,"ContainsNoImages",wand->name);
02299   profile_info=AcquireStringInfo((size_t) length);
02300   SetStringInfoDatum(profile_info,(unsigned char *) profile);
02301   status=SetImageProfile(wand->images,name,profile_info,wand->exception);
02302   profile_info=DestroyStringInfo(profile_info);
02303   return(status);
02304 }
02305 
02306 /*
02307 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02308 %                                                                             %
02309 %                                                                             %
02310 %                                                                             %
02311 %   M a g i c k S e t I m a g e P r o p e r t y                               %
02312 %                                                                             %
02313 %                                                                             %
02314 %                                                                             %
02315 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02316 %
02317 %  MagickSetImageProperty() associates a property with an image.
02318 %
02319 %  The format of the MagickSetImageProperty method is:
02320 %
02321 %      MagickBooleanType MagickSetImageProperty(MagickWand *wand,
02322 %        const char *property,const char *value)
02323 %
02324 %  A description of each parameter follows:
02325 %
02326 %    o wand: the magick wand.
02327 %
02328 %    o property: the property.
02329 %
02330 %    o value: the value.
02331 %
02332 */
02333 WandExport MagickBooleanType MagickSetImageProperty(MagickWand *wand,
02334   const char *property,const char *value)
02335 {
02336   MagickBooleanType
02337     status;
02338 
02339   assert(wand != (MagickWand *) NULL);
02340   assert(wand->signature == WandSignature);
02341   if (wand->debug != MagickFalse)
02342     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02343   if (wand->images == (Image *) NULL)
02344     ThrowWandException(WandError,"ContainsNoImages",wand->name);
02345   status=SetImageProperty(wand->images,property,value,wand->exception);
02346   return(status);
02347 }
02348 
02349 /*
02350 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02351 %                                                                             %
02352 %                                                                             %
02353 %                                                                             %
02354 %   M a g i c k S e t I n t e r l a c e S c h e m e                           %
02355 %                                                                             %
02356 %                                                                             %
02357 %                                                                             %
02358 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02359 %
02360 %  MagickSetInterlaceScheme() sets the image compression.
02361 %
02362 %  The format of the MagickSetInterlaceScheme method is:
02363 %
02364 %      MagickBooleanType MagickSetInterlaceScheme(MagickWand *wand,
02365 %        const InterlaceType interlace_scheme)
02366 %
02367 %  A description of each parameter follows:
02368 %
02369 %    o wand: the magick wand.
02370 %
02371 %    o interlace_scheme: the image interlace scheme: NoInterlace, LineInterlace,
02372 %      PlaneInterlace, PartitionInterlace.
02373 %
02374 */
02375 WandExport MagickBooleanType MagickSetInterlaceScheme(MagickWand *wand,
02376   const InterlaceType interlace_scheme)
02377 {
02378   assert(wand != (MagickWand *) NULL);
02379   assert(wand->signature == WandSignature);
02380   if (wand->debug != MagickFalse)
02381     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02382   wand->image_info->interlace=interlace_scheme;
02383   return(MagickTrue);
02384 }
02385 
02386 /*
02387 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02388 %                                                                             %
02389 %                                                                             %
02390 %                                                                             %
02391 %   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                       %
02392 %                                                                             %
02393 %                                                                             %
02394 %                                                                             %
02395 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02396 %
02397 %  MagickSetInterpolateMethod() sets the interpolate pixel method.
02398 %
02399 %  The format of the MagickSetInterpolateMethod method is:
02400 %
02401 %      MagickBooleanType MagickSetInterpolateMethod(MagickWand *wand,
02402 %        const InterpolateMethodPixel method)
02403 %
02404 %  A description of each parameter follows:
02405 %
02406 %    o wand: the magick wand.
02407 %
02408 %    o method: the interpolate pixel method.
02409 %
02410 */
02411 WandExport MagickBooleanType MagickSetInterpolateMethod(MagickWand *wand,
02412   const PixelInterpolateMethod method)
02413 {
02414   MagickBooleanType
02415     status;
02416 
02417   assert(wand != (MagickWand *) NULL);
02418   assert(wand->signature == WandSignature);
02419   if (wand->debug != MagickFalse)
02420     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02421   status=SetImageOption(wand->image_info,"interpolate",
02422     CommandOptionToMnemonic(MagickInterpolateOptions,(ssize_t) method));
02423   return(status);
02424 }
02425 
02426 /*
02427 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02428 %                                                                             %
02429 %                                                                             %
02430 %                                                                             %
02431 %   M a g i c k S e t O p t i o n                                             %
02432 %                                                                             %
02433 %                                                                             %
02434 %                                                                             %
02435 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02436 %
02437 %  MagickSetOption() associates one or options with the wand (.e.g
02438 %  MagickSetOption(wand,"jpeg:perserve","yes")).
02439 %
02440 %  The format of the MagickSetOption method is:
02441 %
02442 %      MagickBooleanType MagickSetOption(MagickWand *wand,const char *key,
02443 %        const char *value)
02444 %
02445 %  A description of each parameter follows:
02446 %
02447 %    o wand: the magick wand.
02448 %
02449 %    o key:  The key.
02450 %
02451 %    o value:  The value.
02452 %
02453 */
02454 WandExport MagickBooleanType MagickSetOption(MagickWand *wand,const char *key,
02455   const char *value)
02456 {
02457   assert(wand != (MagickWand *) NULL);
02458   assert(wand->signature == WandSignature);
02459   if (wand->debug != MagickFalse)
02460     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02461   return(SetImageOption(wand->image_info,key,value));
02462 }
02463 
02464 /*
02465 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02466 %                                                                             %
02467 %                                                                             %
02468 %                                                                             %
02469 %   M a g i c k S e t O r i e n t a t i o n                                   %
02470 %                                                                             %
02471 %                                                                             %
02472 %                                                                             %
02473 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02474 %
02475 %  MagickSetOrientation() sets the wand orientation type.
02476 %
02477 %  The format of the MagickSetOrientation method is:
02478 %
02479 %      MagickBooleanType MagickSetOrientation(MagickWand *wand,
02480 %        const OrientationType orientation)
02481 %
02482 %  A description of each parameter follows:
02483 %
02484 %    o wand: the magick wand.
02485 %
02486 %    o orientation: the wand orientation.
02487 %
02488 */
02489 WandExport MagickBooleanType MagickSetOrientation(MagickWand *wand,
02490   const OrientationType orientation)
02491 {
02492   assert(wand != (MagickWand *) NULL);
02493   assert(wand->signature == WandSignature);
02494   if (wand->debug != MagickFalse)
02495     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02496   wand->image_info->orientation=orientation;
02497   return(MagickTrue);
02498 }
02499 
02500 /*
02501 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02502 %                                                                             %
02503 %                                                                             %
02504 %                                                                             %
02505 %   M a g i c k S e t P a g e                                                 %
02506 %                                                                             %
02507 %                                                                             %
02508 %                                                                             %
02509 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02510 %
02511 %  MagickSetPage() sets the page geometry of the magick wand.
02512 %
02513 %  The format of the MagickSetPage method is:
02514 %
02515 %      MagickBooleanType MagickSetPage(MagickWand *wand,
02516 %        const size_t width,const size_t height,const ssize_t x,
02517 %        const ssize_t y)
02518 %
02519 %  A description of each parameter follows:
02520 %
02521 %    o wand: the magick wand.
02522 %
02523 %    o width: the page width.
02524 %
02525 %    o height: the page height.
02526 %
02527 %    o x: the page x-offset.
02528 %
02529 %    o y: the page y-offset.
02530 %
02531 */
02532 WandExport MagickBooleanType MagickSetPage(MagickWand *wand,
02533   const size_t width,const size_t height,const ssize_t x,
02534   const ssize_t y)
02535 {
02536   char
02537     geometry[MaxTextExtent];
02538 
02539   assert(wand != (MagickWand *) NULL);
02540   assert(wand->signature == WandSignature);
02541   if (wand->debug != MagickFalse)
02542     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02543   (void) FormatLocaleString(geometry,MaxTextExtent,"%.20gx%.20g%+.20g%+.20g",
02544     (double) width,(double) height,(double) x,(double) y);
02545   (void) CloneString(&wand->image_info->page,geometry);
02546   return(MagickTrue);
02547 }
02548 
02549 /*
02550 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02551 %                                                                             %
02552 %                                                                             %
02553 %                                                                             %
02554 %   M a g i c k S e t P a s s p h r a s e                                     %
02555 %                                                                             %
02556 %                                                                             %
02557 %                                                                             %
02558 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02559 %
02560 %  MagickSetPassphrase() sets the passphrase.
02561 %
02562 %  The format of the MagickSetPassphrase method is:
02563 %
02564 %      MagickBooleanType MagickSetPassphrase(MagickWand *wand,
02565 %        const char *passphrase)
02566 %
02567 %  A description of each parameter follows:
02568 %
02569 %    o wand: the magick wand.
02570 %
02571 %    o passphrase: the passphrase.
02572 %
02573 */
02574 WandExport MagickBooleanType MagickSetPassphrase(MagickWand *wand,
02575   const char *passphrase)
02576 {
02577   assert(wand != (MagickWand *) NULL);
02578   assert(wand->signature == WandSignature);
02579   if (wand->debug != MagickFalse)
02580     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02581   (void) SetImageOption(wand->image_info,"authenticate",passphrase);
02582   return(MagickTrue);
02583 }
02584 
02585 /*
02586 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02587 %                                                                             %
02588 %                                                                             %
02589 %                                                                             %
02590 %   M a g i c k S e t P o i n t s i z e                                       %
02591 %                                                                             %
02592 %                                                                             %
02593 %                                                                             %
02594 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02595 %
02596 %  MagickSetPointsize() sets the font pointsize associated with the MagickWand.
02597 %
02598 %  The format of the MagickSetPointsize method is:
02599 %
02600 %      MagickBooleanType MagickSetPointsize(MagickWand *wand,
02601 %        const double pointsize)
02602 %
02603 %  A description of each parameter follows:
02604 %
02605 %    o wand: the magick wand.
02606 %
02607 %    o pointsize: the size of the font
02608 %
02609 */
02610 WandExport MagickBooleanType MagickSetPointsize(MagickWand *wand,
02611   const double pointsize)
02612 {
02613   assert(wand != (MagickWand *) NULL);
02614   assert(wand->signature == WandSignature);
02615   if (wand->debug != MagickFalse)
02616     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02617   wand->image_info->pointsize=pointsize;
02618   return(MagickTrue);
02619 }
02620 
02621 /*
02622 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02623 %                                                                             %
02624 %                                                                             %
02625 %                                                                             %
02626 %   M a g i c k S e t P r o g r e s s M o n i t o r                           %
02627 %                                                                             %
02628 %                                                                             %
02629 %                                                                             %
02630 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02631 %
02632 %  MagickSetProgressMonitor() sets the wand progress monitor to the specified
02633 %  method and returns the previous progress monitor if any.  The progress
02634 %  monitor method looks like this:
02635 %
02636 %    MagickBooleanType MagickProgressMonitor(const char *text,
02637 %      const MagickOffsetType offset,const MagickSizeType span,
02638 %      void *client_data)
02639 %
02640 %  If the progress monitor returns MagickFalse, the current operation is
02641 %  interrupted.
02642 %
02643 %  The format of the MagickSetProgressMonitor method is:
02644 %
02645 %      MagickProgressMonitor MagickSetProgressMonitor(MagickWand *wand
02646 %        const MagickProgressMonitor progress_monitor,void *client_data)
02647 %
02648 %  A description of each parameter follows:
02649 %
02650 %    o wand: the magick wand.
02651 %
02652 %    o progress_monitor: Specifies a pointer to a method to monitor progress
02653 %      of an image operation.
02654 %
02655 %    o client_data: Specifies a pointer to any client data.
02656 %
02657 */
02658 WandExport MagickProgressMonitor MagickSetProgressMonitor(MagickWand *wand,
02659   const MagickProgressMonitor progress_monitor,void *client_data)
02660 {
02661   MagickProgressMonitor
02662     previous_monitor;
02663 
02664   assert(wand != (MagickWand *) NULL);
02665   assert(wand->signature == WandSignature);
02666   if (wand->debug != MagickFalse)
02667     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02668   previous_monitor=SetImageInfoProgressMonitor(wand->image_info,
02669     progress_monitor,client_data);
02670   return(previous_monitor);
02671 }
02672 
02673 /*
02674 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02675 %                                                                             %
02676 %                                                                             %
02677 %                                                                             %
02678 %   M a g i c k S e t R e s o u r c e L i m i t                               %
02679 %                                                                             %
02680 %                                                                             %
02681 %                                                                             %
02682 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02683 %
02684 %  MagickSetResourceLimit() sets the limit for a particular resource in
02685 %  megabytes.
02686 %
02687 %  The format of the MagickSetResourceLimit method is:
02688 %
02689 %      MagickBooleanType MagickSetResourceLimit(const ResourceType type,
02690 %        const MagickSizeType limit)
02691 %
02692 %  A description of each parameter follows:
02693 %
02694 %    o type: the type of resource: AreaResource, MemoryResource, MapResource,
02695 %      DiskResource, FileResource.
02696 %
02697 %    o The maximum limit for the resource.
02698 %
02699 */
02700 WandExport MagickBooleanType MagickSetResourceLimit(const ResourceType type,
02701   const MagickSizeType limit)
02702 {
02703   return(SetMagickResourceLimit(type,limit));
02704 }
02705 
02706 /*
02707 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02708 %                                                                             %
02709 %                                                                             %
02710 %                                                                             %
02711 %   M a g i c k S e t R e s o l u t i o n                                     %
02712 %                                                                             %
02713 %                                                                             %
02714 %                                                                             %
02715 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02716 %
02717 %  MagickSetResolution() sets the image resolution.
02718 %
02719 %  The format of the MagickSetResolution method is:
02720 %
02721 %      MagickBooleanType MagickSetResolution(MagickWand *wand,
02722 %        const double x_resolution,const doubtl y_resolution)
02723 %
02724 %  A description of each parameter follows:
02725 %
02726 %    o wand: the magick wand.
02727 %
02728 %    o x_resolution: the image x resolution.
02729 %
02730 %    o y_resolution: the image y resolution.
02731 %
02732 */
02733 WandExport MagickBooleanType MagickSetResolution(MagickWand *wand,
02734   const double x_resolution,const double y_resolution)
02735 {
02736   char
02737     density[MaxTextExtent];
02738 
02739   assert(wand != (MagickWand *) NULL);
02740   assert(wand->signature == WandSignature);
02741   if (wand->debug != MagickFalse)
02742     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02743   (void) FormatLocaleString(density,MaxTextExtent,"%gx%g",x_resolution,
02744     y_resolution);
02745   (void) CloneString(&wand->image_info->density,density);
02746   return(MagickTrue);
02747 }
02748 
02749 /*
02750 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02751 %                                                                             %
02752 %                                                                             %
02753 %                                                                             %
02754 %   M a g i c k S e t S a m p l i n g F a c t o r s                           %
02755 %                                                                             %
02756 %                                                                             %
02757 %                                                                             %
02758 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02759 %
02760 %  MagickSetSamplingFactors() sets the image sampling factors.
02761 %
02762 %  The format of the MagickSetSamplingFactors method is:
02763 %
02764 %      MagickBooleanType MagickSetSamplingFactors(MagickWand *wand,
02765 %        const size_t number_factors,const double *sampling_factors)
02766 %
02767 %  A description of each parameter follows:
02768 %
02769 %    o wand: the magick wand.
02770 %
02771 %    o number_factoes: the number of factors.
02772 %
02773 %    o sampling_factors: An array of doubles representing the sampling factor
02774 %      for each color component (in RGB order).
02775 %
02776 */
02777 WandExport MagickBooleanType MagickSetSamplingFactors(MagickWand *wand,
02778   const size_t number_factors,const double *sampling_factors)
02779 {
02780   char
02781     sampling_factor[MaxTextExtent];
02782 
02783   register ssize_t
02784     i;
02785 
02786   assert(wand != (MagickWand *) NULL);
02787   assert(wand->signature == WandSignature);
02788   if (wand->debug != MagickFalse)
02789     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02790   if (wand->image_info->sampling_factor != (char *) NULL)
02791     wand->image_info->sampling_factor=(char *)
02792       RelinquishMagickMemory(wand->image_info->sampling_factor);
02793   if (number_factors == 0)
02794     return(MagickTrue);
02795   for (i=0; i < (ssize_t) (number_factors-1); i++)
02796   {
02797     (void) FormatLocaleString(sampling_factor,MaxTextExtent,"%g,",
02798       sampling_factors[i]);
02799     (void) ConcatenateString(&wand->image_info->sampling_factor,
02800       sampling_factor);
02801   }
02802   (void) FormatLocaleString(sampling_factor,MaxTextExtent,"%g",
02803     sampling_factors[i]);
02804   (void) ConcatenateString(&wand->image_info->sampling_factor,sampling_factor);
02805   return(MagickTrue);
02806 }
02807 
02808 /*
02809 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02810 %                                                                             %
02811 %                                                                             %
02812 %                                                                             %
02813 %   M a g i c k S e t S i z e                                                 %
02814 %                                                                             %
02815 %                                                                             %
02816 %                                                                             %
02817 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02818 %
02819 %  MagickSetSize() sets the size of the magick wand.  Set it before you
02820 %  read a raw image format such as RGB, GRAY, or CMYK.
02821 %
02822 %  The format of the MagickSetSize method is:
02823 %
02824 %      MagickBooleanType MagickSetSize(MagickWand *wand,
02825 %        const size_t columns,const size_t rows)
02826 %
02827 %  A description of each parameter follows:
02828 %
02829 %    o wand: the magick wand.
02830 %
02831 %    o columns: the width in pixels.
02832 %
02833 %    o rows: the rows in pixels.
02834 %
02835 */
02836 WandExport MagickBooleanType MagickSetSize(MagickWand *wand,
02837   const size_t columns,const size_t rows)
02838 {
02839   char
02840     geometry[MaxTextExtent];
02841 
02842   assert(wand != (MagickWand *) NULL);
02843   assert(wand->signature == WandSignature);
02844   if (wand->debug != MagickFalse)
02845     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02846   (void) FormatLocaleString(geometry,MaxTextExtent,"%.20gx%.20g",(double)
02847     columns,(double) rows);
02848   (void) CloneString(&wand->image_info->size,geometry);
02849   return(MagickTrue);
02850 }
02851 
02852 /*
02853 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02854 %                                                                             %
02855 %                                                                             %
02856 %                                                                             %
02857 %   M a g i c k S e t S i z e O f f s e t                                     %
02858 %                                                                             %
02859 %                                                                             %
02860 %                                                                             %
02861 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02862 %
02863 %  MagickSetSizeOffset() sets the size and offset of the magick wand.  Set it
02864 %  before you read a raw image format such as RGB, GRAY, or CMYK.
02865 %
02866 %  The format of the MagickSetSizeOffset method is:
02867 %
02868 %      MagickBooleanType MagickSetSizeOffset(MagickWand *wand,
02869 %        const size_t columns,const size_t rows,
02870 %        const ssize_t offset)
02871 %
02872 %  A description of each parameter follows:
02873 %
02874 %    o wand: the magick wand.
02875 %
02876 %    o columns: the image width in pixels.
02877 %
02878 %    o rows: the image rows in pixels.
02879 %
02880 %    o offset: the image offset.
02881 %
02882 */
02883 WandExport MagickBooleanType MagickSetSizeOffset(MagickWand *wand,
02884   const size_t columns,const size_t rows,const ssize_t offset)
02885 {
02886   char
02887     geometry[MaxTextExtent];
02888 
02889   assert(wand != (MagickWand *) NULL);
02890   assert(wand->signature == WandSignature);
02891   if (wand->debug != MagickFalse)
02892     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02893   (void) FormatLocaleString(geometry,MaxTextExtent,"%.20gx%.20g%+.20g",
02894     (double) columns,(double) rows,(double) offset);
02895   (void) CloneString(&wand->image_info->size,geometry);
02896   return(MagickTrue);
02897 }
02898 
02899 /*
02900 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02901 %                                                                             %
02902 %                                                                             %
02903 %                                                                             %
02904 %   M a g i c k S e t T y p e                                                 %
02905 %                                                                             %
02906 %                                                                             %
02907 %                                                                             %
02908 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
02909 %
02910 %  MagickSetType() sets the image type attribute.
02911 %
02912 %  The format of the MagickSetType method is:
02913 %
02914 %      MagickBooleanType MagickSetType(MagickWand *wand,
02915 %        const ImageType image_type)
02916 %
02917 %  A description of each parameter follows:
02918 %
02919 %    o wand: the magick wand.
02920 %
02921 %    o image_type: the image type:   UndefinedType, BilevelType, GrayscaleType,
02922 %      GrayscaleMatteType, PaletteType, PaletteMatteType, TrueColorType,
02923 %      TrueColorMatteType, ColorSeparationType, ColorSeparationMatteType,
02924 %      or OptimizeType.
02925 %
02926 */
02927 WandExport MagickBooleanType MagickSetType(MagickWand *wand,
02928   const ImageType image_type)
02929 {
02930   assert(wand != (MagickWand *) NULL);
02931   assert(wand->signature == WandSignature);
02932   if (wand->debug != MagickFalse)
02933     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
02934   wand->image_info->type=image_type;
02935   return(MagickTrue);
02936 }