deprecate.c

Go to the documentation of this file.
00001 /*
00002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00003 %                                                                             %
00004 %                                                                             %
00005 %                                                                             %
00006 %        DDDD   EEEEE  PPPP   RRRR   EEEEE   CCCC   AAA   TTTTT  EEEEE        %
00007 %        D   D  E      P   P  R   R  E      C      A   A    T    E            %
00008 %        D   D  EEE    PPPPP  RRRR   EEE    C      AAAAA    T    EEE          %
00009 %        D   D  E      P      R R    E      C      A   A    T    E            %
00010 %        DDDD   EEEEE  P      R  R   EEEEE   CCCC  A   A    T    EEEEE        %
00011 %                                                                             %
00012 %                                                                             %
00013 %                       MagickWand Deprecated Methods                         %
00014 %                                                                             %
00015 %                              Software Design                                %
00016 %                                John Cristy                                  %
00017 %                                October 2002                                 %
00018 %                                                                             %
00019 %                                                                             %
00020 %  Copyright 1999-2009 ImageMagick Studio LLC, a non-profit organization      %
00021 %  dedicated to making software imaging solutions freely available.           %
00022 %                                                                             %
00023 %  You may not use this file except in compliance with the License.  You may  %
00024 %  obtain a copy of the License at                                            %
00025 %                                                                             %
00026 %    http://www.imagemagick.org/script/license.php                            %
00027 %                                                                             %
00028 %  Unless required by applicable law or agreed to in writing, software        %
00029 %  distributed under the License is distributed on an "AS IS" BASIS,          %
00030 %  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   %
00031 %  See the License for the specific language governing permissions and        %
00032 %  limitations under the License.                                             %
00033 %                                                                             %
00034 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00035 %
00036 %
00037 %
00038 */
00039 
00040 /*
00041   Include declarations.
00042 */
00043 #include "wand/studio.h"
00044 #include "wand/MagickWand.h"
00045 #include "wand/magick-wand-private.h"
00046 #include "wand/wand.h"
00047 
00048 /*
00049   Define declarations.
00050 */
00051 #define ThrowWandException(severity,tag,context) \
00052 { \
00053   (void) ThrowMagickException(wand->exception,GetMagickModule(),severity, \
00054     tag,"`%s'",context); \
00055   return(MagickFalse); \
00056 }
00057 
00058 #if !defined(MAGICKCORE_EXCLUDE_DEPRECATED)
00059 
00060 /*
00061 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00062 %                                                                             %
00063 %                                                                             %
00064 %                                                                             %
00065 %   M a g i c k C l i p P a t h I m a g e                                     %
00066 %                                                                             %
00067 %                                                                             %
00068 %                                                                             %
00069 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00070 %
00071 %  MagickClipPathImage() clips along the named paths from the 8BIM profile, if
00072 %  present. Later operations take effect inside the path.  Id may be a number
00073 %  if preceded with #, to work on a numbered path, e.g., "#1" to use the first
00074 %  path.
00075 %
00076 %  The format of the MagickClipPathImage method is:
00077 %
00078 %      MagickBooleanType MagickClipPathImage(MagickWand *wand,
00079 %        const char *pathname,const MagickBooleanType inside)
00080 %
00081 %  A description of each parameter follows:
00082 %
00083 %    o wand: the magick wand.
00084 %
00085 %    o pathname: name of clipping path resource. If name is preceded by #, use
00086 %      clipping path numbered by name.
00087 %
00088 %    o inside: if non-zero, later operations take effect inside clipping path.
00089 %      Otherwise later operations take effect outside clipping path.
00090 %
00091 */
00092 WandExport MagickBooleanType MagickClipPathImage(MagickWand *wand,
00093   const char *pathname,const MagickBooleanType inside)
00094 {
00095   return(MagickClipImagePath(wand,pathname,inside));
00096 }
00097 /*
00098 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00099 %                                                                             %
00100 %                                                                             %
00101 %                                                                             %
00102 %   D r a w G e t F i l l A l p h a                                           %
00103 %                                                                             %
00104 %                                                                             %
00105 %                                                                             %
00106 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00107 %
00108 %  DrawGetFillAlpha() returns the alpha used when drawing using the fill
00109 %  color or fill texture.  Fully opaque is 1.0.
00110 %
00111 %  The format of the DrawGetFillAlpha method is:
00112 %
00113 %      double DrawGetFillAlpha(const DrawingWand *wand)
00114 %
00115 %  A description of each parameter follows:
00116 %
00117 %    o wand: the drawing wand.
00118 %
00119 */
00120 WandExport double DrawGetFillAlpha(const DrawingWand *wand)
00121 {
00122   return(DrawGetFillOpacity(wand));
00123 }
00124 
00125 /*
00126 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00127 %                                                                             %
00128 %                                                                             %
00129 %                                                                             %
00130 %   D r a w G e t S t r o k e A l p h a                                       %
00131 %                                                                             %
00132 %                                                                             %
00133 %                                                                             %
00134 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00135 %
00136 %  DrawGetStrokeAlpha() returns the alpha of stroked object outlines.
00137 %
00138 %  The format of the DrawGetStrokeAlpha method is:
00139 %
00140 %      double DrawGetStrokeAlpha(const DrawingWand *wand)
00141 %
00142 %  A description of each parameter follows:
00143 %
00144 %    o wand: the drawing wand.
00145 */
00146 WandExport double DrawGetStrokeAlpha(const DrawingWand *wand)
00147 {
00148   return(DrawGetStrokeOpacity(wand));
00149 }
00150 
00151 /*
00152 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00153 %                                                                             %
00154 %                                                                             %
00155 %                                                                             %
00156 %   D r a w P e e k G r a p h i c W a n d                                     %
00157 %                                                                             %
00158 %                                                                             %
00159 %                                                                             %
00160 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00161 %
00162 %  DrawPeekGraphicWand() returns the current drawing wand.
00163 %
00164 %  The format of the PeekDrawingWand method is:
00165 %
00166 %      DrawInfo *DrawPeekGraphicWand(const DrawingWand *wand)
00167 %
00168 %  A description of each parameter follows:
00169 %
00170 %    o wand: the drawing wand.
00171 %
00172 */
00173 WandExport DrawInfo *DrawPeekGraphicWand(const DrawingWand *wand)
00174 {
00175   return(PeekDrawingWand(wand));
00176 }
00177 
00178 /*
00179 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00180 %                                                                             %
00181 %                                                                             %
00182 %                                                                             %
00183 %   D r a w P o p G r a p h i c C o n t e x t                                 %
00184 %                                                                             %
00185 %                                                                             %
00186 %                                                                             %
00187 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00188 %
00189 %  DrawPopGraphicContext() destroys the current drawing wand and returns to the
00190 %  previously pushed drawing wand. Multiple drawing wands may exist. It is an
00191 %  error to attempt to pop more drawing wands than have been pushed, and it is
00192 %  proper form to pop all drawing wands which have been pushed.
00193 %
00194 %  The format of the DrawPopGraphicContext method is:
00195 %
00196 %      MagickBooleanType DrawPopGraphicContext(DrawingWand *wand)
00197 %
00198 %  A description of each parameter follows:
00199 %
00200 %    o wand: the drawing wand.
00201 %
00202 */
00203 WandExport void DrawPopGraphicContext(DrawingWand *wand)
00204 {
00205   (void) PopDrawingWand(wand);
00206 }
00207 
00208 /*
00209 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00210 %                                                                             %
00211 %                                                                             %
00212 %                                                                             %
00213 %   D r a w P u s h G r a p h i c C o n t e x t                               %
00214 %                                                                             %
00215 %                                                                             %
00216 %                                                                             %
00217 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00218 %
00219 %  DrawPushGraphicContext() clones the current drawing wand to create a new
00220 %  drawing wand.  The original drawing wand(s) may be returned to by
00221 %  invoking PopDrawingWand().  The drawing wands are stored on a drawing wand
00222 %  stack.  For every Pop there must have already been an equivalent Push.
00223 %
00224 %  The format of the DrawPushGraphicContext method is:
00225 %
00226 %      MagickBooleanType DrawPushGraphicContext(DrawingWand *wand)
00227 %
00228 %  A description of each parameter follows:
00229 %
00230 %    o wand: the drawing wand.
00231 %
00232 */
00233 WandExport void DrawPushGraphicContext(DrawingWand *wand)
00234 {
00235   (void) PushDrawingWand(wand);
00236 }
00237 
00238 /*
00239 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00240 %                                                                             %
00241 %                                                                             %
00242 %                                                                             %
00243 %   D r a w S e t F i l l A l p h a                                           %
00244 %                                                                             %
00245 %                                                                             %
00246 %                                                                             %
00247 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00248 %
00249 %  DrawSetFillAlpha() sets the alpha to use when drawing using the fill
00250 %  color or fill texture.  Fully opaque is 1.0.
00251 %
00252 %  The format of the DrawSetFillAlpha method is:
00253 %
00254 %      void DrawSetFillAlpha(DrawingWand *wand,const double fill_alpha)
00255 %
00256 %  A description of each parameter follows:
00257 %
00258 %    o wand: the drawing wand.
00259 %
00260 %    o fill_alpha: fill alpha
00261 %
00262 */
00263 WandExport void DrawSetFillAlpha(DrawingWand *wand,const double fill_alpha)
00264 {
00265   DrawSetFillOpacity(wand,fill_alpha);
00266 }
00267 
00268 /*
00269 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00270 %                                                                             %
00271 %                                                                             %
00272 %                                                                             %
00273 %   D r a w S e t S t r o k e A l p h a                                       %
00274 %                                                                             %
00275 %                                                                             %
00276 %                                                                             %
00277 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00278 %
00279 %  DrawSetStrokeAlpha() specifies the alpha of stroked object outlines.
00280 %
00281 %  The format of the DrawSetStrokeAlpha method is:
00282 %
00283 %      void DrawSetStrokeAlpha(DrawingWand *wand,const double stroke_alpha)
00284 %
00285 %  A description of each parameter follows:
00286 %
00287 %    o wand: the drawing wand.
00288 %
00289 %    o stroke_alpha: stroke alpha.  The value 1.0 is opaque.
00290 %
00291 */
00292 WandExport void DrawSetStrokeAlpha(DrawingWand *wand,const double stroke_alpha)
00293 {
00294   DrawSetStrokeOpacity(wand,stroke_alpha);
00295 }
00296 
00297 /*
00298 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00299 %                                                                             %
00300 %                                                                             %
00301 %                                                                             %
00302 %   M a g i c k C o l o r F l o o d f i l l I m a g e                         %
00303 %                                                                             %
00304 %                                                                             %
00305 %                                                                             %
00306 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00307 %
00308 %  MagickColorFloodfillImage() changes the color value of any pixel that matches
00309 %  target and is an immediate neighbor.  If the method FillToBorderMethod is
00310 %  specified, the color value is changed for any neighbor pixel that does not
00311 %  match the bordercolor member of image.
00312 %
00313 %  The format of the MagickColorFloodfillImage method is:
00314 %
00315 %      MagickBooleanType MagickColorFloodfillImage(MagickWand *wand,
00316 %        const PixelWand *fill,const double fuzz,const PixelWand *bordercolor,
00317 %        const long x,const long y)
00318 %
00319 %  A description of each parameter follows:
00320 %
00321 %    o wand: the magick wand.
00322 %
00323 %    o fill: the floodfill color pixel wand.
00324 %
00325 %    o fuzz: By default target must match a particular pixel color
00326 %      exactly.  However, in many cases two colors may differ by a small amount.
00327 %      The fuzz member of image defines how much tolerance is acceptable to
00328 %      consider two colors as the same.  For example, set fuzz to 10 and the
00329 %      color red at intensities of 100 and 102 respectively are now interpreted
00330 %      as the same color for the purposes of the floodfill.
00331 %
00332 %    o bordercolor: the border color pixel wand.
00333 %
00334 %    o x,y: the starting location of the operation.
00335 %
00336 */
00337 WandExport MagickBooleanType MagickColorFloodfillImage(MagickWand *wand,
00338   const PixelWand *fill,const double fuzz,const PixelWand *bordercolor,
00339   const long x,const long y)
00340 {
00341   DrawInfo
00342     *draw_info;
00343 
00344   MagickBooleanType
00345     status;
00346 
00347   PixelPacket
00348     target;
00349 
00350   assert(wand != (MagickWand *) NULL);
00351   assert(wand->signature == WandSignature);
00352   if (wand->debug != MagickFalse)
00353     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00354   if (wand->images == (Image *) NULL)
00355     ThrowWandException(WandError,"ContainsNoImages",wand->name);
00356   draw_info=CloneDrawInfo(wand->image_info,(DrawInfo *) NULL);
00357   PixelGetQuantumColor(fill,&draw_info->fill);
00358   (void) GetOneVirtualPixel(wand->images,x % wand->images->columns,
00359     y % wand->images->rows,&target,wand->exception);
00360   if (bordercolor != (PixelWand *) NULL)
00361     PixelGetQuantumColor(bordercolor,&target);
00362   wand->images->fuzz=fuzz;
00363   status=ColorFloodfillImage(wand->images,draw_info,target,x,y,
00364     bordercolor != (PixelWand *) NULL ? FillToBorderMethod : FloodfillMethod);
00365   if (status == MagickFalse)
00366     InheritException(wand->exception,&wand->images->exception);
00367   draw_info=DestroyDrawInfo(draw_info);
00368   return(status);
00369 }
00370 
00371 /*
00372 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00373 %                                                                             %
00374 %                                                                             %
00375 %                                                                             %
00376 %   M a g i c k D e s c r i b e I m a g e                                     %
00377 %                                                                             %
00378 %                                                                             %
00379 %                                                                             %
00380 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00381 %
00382 %  MagickDescribeImage() identifies an image by printing its attributes to the
00383 %  file.  Attributes include the image width, height, size, and others.
00384 %
00385 %  The format of the MagickDescribeImage method is:
00386 %
00387 %      const char *MagickDescribeImage(MagickWand *wand)
00388 %
00389 %  A description of each parameter follows:
00390 %
00391 %    o wand: the magick wand.
00392 %
00393 */
00394 WandExport char *MagickDescribeImage(MagickWand *wand)
00395 {
00396   return(MagickIdentifyImage(wand));
00397 }
00398 
00399 /*
00400 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00401 %                                                                             %
00402 %                                                                             %
00403 %                                                                             %
00404 %   M a g i c k F l a t t e n I m a g e s                                     %
00405 %                                                                             %
00406 %                                                                             %
00407 %                                                                             %
00408 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00409 %
00410 %  MagickFlattenImages() merges a sequence of images.  This useful for
00411 %  combining Photoshop layers into a single image.
00412 %
00413 %  The format of the MagickFlattenImages method is:
00414 %
00415 %      MagickWand *MagickFlattenImages(MagickWand *wand)
00416 %
00417 %  A description of each parameter follows:
00418 %
00419 %    o wand: the magick wand.
00420 %
00421 */
00422 
00423 static MagickWand *CloneMagickWandFromImages(const MagickWand *wand,
00424   Image *images)
00425 {
00426   MagickWand
00427     *clone_wand;
00428 
00429   assert(wand != (MagickWand *) NULL);
00430   assert(wand->signature == WandSignature);
00431   if (wand->debug != MagickFalse)
00432     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00433   clone_wand=(MagickWand *) AcquireMagickMemory(sizeof(*clone_wand));
00434   if (clone_wand == (MagickWand *) NULL)
00435     ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed",
00436       images->filename);
00437   (void) ResetMagickMemory(clone_wand,0,sizeof(*clone_wand));
00438   clone_wand->id=AcquireWandId();
00439   (void) FormatMagickString(clone_wand->name,MaxTextExtent,"%s-%lu",
00440     MagickWandId,clone_wand->id);
00441   clone_wand->exception=AcquireExceptionInfo();
00442   InheritException(clone_wand->exception,wand->exception);
00443   clone_wand->image_info=CloneImageInfo(wand->image_info);
00444   clone_wand->quantize_info=CloneQuantizeInfo(wand->quantize_info);
00445   clone_wand->images=images;
00446   clone_wand->debug=IsEventLogging();
00447   if (clone_wand->debug != MagickFalse)
00448     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",clone_wand->name);
00449   clone_wand->signature=WandSignature;
00450   return(clone_wand);
00451 }
00452 
00453 WandExport MagickWand *MagickFlattenImages(MagickWand *wand)
00454 {
00455   Image
00456     *flatten_image;
00457 
00458   assert(wand != (MagickWand *) NULL);
00459   assert(wand->signature == WandSignature);
00460   if (wand->debug != MagickFalse)
00461     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00462   if (wand->images == (Image *) NULL)
00463     return((MagickWand *) NULL);
00464   flatten_image=FlattenImages(wand->images,wand->exception);
00465   if (flatten_image == (Image *) NULL)
00466     return((MagickWand *) NULL);
00467   return(CloneMagickWandFromImages(wand,flatten_image));
00468 }
00469 
00470 /*
00471 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00472 %                                                                             %
00473 %                                                                             %
00474 %                                                                             %
00475 %   M a g i c k G e t I m a g e A t t r i b u t e                             %
00476 %                                                                             %
00477 %                                                                             %
00478 %                                                                             %
00479 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00480 %
00481 %  MagickGetImageAttribute() returns a value associated with the specified
00482 %  property.  Use MagickRelinquishMemory() to free the value when you are
00483 %  finished with it.
00484 %
00485 %  The format of the MagickGetImageAttribute method is:
00486 %
00487 %      char *MagickGetImageAttribute(MagickWand *wand,const char *property)
00488 %
00489 %  A description of each parameter follows:
00490 %
00491 %    o wand: the magick wand.
00492 %
00493 %    o property: the property.
00494 %
00495 */
00496 WandExport char *MagickGetImageAttribute(MagickWand *wand,const char *property)
00497 {
00498   return(MagickGetImageProperty(wand,property));
00499 }
00500 
00501 /*
00502 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00503 %                                                                             %
00504 %                                                                             %
00505 %                                                                             %
00506 +   M a g i c k G e t I m a g e I n d e x                                     %
00507 %                                                                             %
00508 %                                                                             %
00509 %                                                                             %
00510 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00511 %
00512 %  MagickGetImageIndex() returns the index of the current image.
00513 %
00514 %  The format of the MagickGetImageIndex method is:
00515 %
00516 %      long MagickGetImageIndex(MagickWand *wand)
00517 %
00518 %  A description of each parameter follows:
00519 %
00520 %    o wand: the magick wand.
00521 %
00522 */
00523 WandExport long MagickGetImageIndex(MagickWand *wand)
00524 {
00525   return(MagickGetIteratorIndex(wand));
00526 }
00527 
00528 /*
00529 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00530 %                                                                             %
00531 %                                                                             %
00532 %                                                                             %
00533 +   M a g i c k G e t I m a g e C h a n n e l E x t r e m a                   %
00534 %                                                                             %
00535 %                                                                             %
00536 %                                                                             %
00537 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00538 %
00539 %  MagickGetImageChannelExtrema() gets the extrema for one or more image
00540 %  channels.
00541 %
00542 %  The format of the MagickGetImageChannelExtrema method is:
00543 %
00544 %      MagickBooleanType MagickGetImageChannelExtrema(MagickWand *wand,
00545 %        const ChannelType channel,unsigned long *minima,unsigned long *maxima)
00546 %
00547 %  A description of each parameter follows:
00548 %
00549 %    o wand: the magick wand.
00550 %
00551 %    o channel: the image channel(s).
00552 %
00553 %    o minima:  The minimum pixel value for the specified channel(s).
00554 %
00555 %    o maxima:  The maximum pixel value for the specified channel(s).
00556 %
00557 */
00558 WandExport MagickBooleanType MagickGetImageChannelExtrema(MagickWand *wand,
00559   const ChannelType channel,unsigned long *minima,unsigned long *maxima)
00560 {
00561   MagickBooleanType
00562     status;
00563 
00564   assert(wand != (MagickWand *) NULL);
00565   assert(wand->signature == WandSignature);
00566   if (wand->debug != MagickFalse)
00567     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00568   if (wand->images == (Image *) NULL)
00569     ThrowWandException(WandError,"ContainsNoImages",wand->name);
00570   status=GetImageChannelExtrema(wand->images,channel,minima,maxima,
00571     wand->exception);
00572   return(status);
00573 }
00574 
00575 /*
00576 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00577 %                                                                             %
00578 %                                                                             %
00579 %                                                                             %
00580 +   M a g i c k G e t I m a g e E x t r e m a                                 %
00581 %                                                                             %
00582 %                                                                             %
00583 %                                                                             %
00584 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00585 %
00586 %  MagickGetImageExtrema() gets the extrema for the image.
00587 %
00588 %  The format of the MagickGetImageExtrema method is:
00589 %
00590 %      MagickBooleanType MagickGetImageExtrema(MagickWand *wand,
00591 %        unsigned long *minima,unsigned long *maxima)
00592 %
00593 %  A description of each parameter follows:
00594 %
00595 %    o wand: the magick wand.
00596 %
00597 %    o minima:  The minimum pixel value for the specified channel(s).
00598 %
00599 %    o maxima:  The maximum pixel value for the specified channel(s).
00600 %
00601 */
00602 WandExport MagickBooleanType MagickGetImageExtrema(MagickWand *wand,
00603   unsigned long *minima,unsigned long *maxima)
00604 {
00605   MagickBooleanType
00606     status;
00607 
00608   assert(wand != (MagickWand *) NULL);
00609   assert(wand->signature == WandSignature);
00610   if (wand->debug != MagickFalse)
00611     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00612   if (wand->images == (Image *) NULL)
00613     ThrowWandException(WandError,"ContainsNoImages",wand->name);
00614   status=GetImageExtrema(wand->images,minima,maxima,wand->exception);
00615   return(status);
00616 }
00617 
00618 /*
00619 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00620 %                                                                             %
00621 %                                                                             %
00622 %                                                                             %
00623 %   M a g i c k G e t I m a g e M a t t e                                     %
00624 %                                                                             %
00625 %                                                                             %
00626 %                                                                             %
00627 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00628 %
00629 %  MagickGetImageMatte() returns MagickTrue if the image has a matte channel
00630 %  otherwise MagickFalse.
00631 %
00632 %  The format of the MagickGetImageMatte method is:
00633 %
00634 %      unsigned long MagickGetImageMatte(MagickWand *wand)
00635 %
00636 %  A description of each parameter follows:
00637 %
00638 %    o wand: the magick wand.
00639 %
00640 */
00641 WandExport MagickBooleanType MagickGetImageMatte(MagickWand *wand)
00642 {
00643   assert(wand != (MagickWand *) NULL);
00644   assert(wand->signature == WandSignature);
00645   if (wand->debug != MagickFalse)
00646     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00647   if (wand->images == (Image *) NULL)
00648     ThrowWandException(WandError,"ContainsNoImages",wand->name);
00649   return(wand->images->matte);
00650 }
00651 
00652 /*
00653 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00654 %                                                                             %
00655 %                                                                             %
00656 %                                                                             %
00657 %   M a g i c k G e t I m a g e P i x e l s                                   %
00658 %                                                                             %
00659 %                                                                             %
00660 %                                                                             %
00661 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00662 %
00663 %  MagickGetImagePixels() extracts pixel data from an image and returns it to
00664 %  you.  The method returns MagickTrue on success otherwise MagickFalse if an
00665 %  error is encountered.  The data is returned as char, short int, int, long,
00666 %  float, or double in the order specified by map.
00667 %
00668 %  Suppose you want to extract the first scanline of a 640x480 image as
00669 %  character data in red-green-blue order:
00670 %
00671 %      MagickGetImagePixels(wand,0,0,640,1,"RGB",CharPixel,pixels);
00672 %
00673 %  The format of the MagickGetImagePixels method is:
00674 %
00675 %      MagickBooleanType MagickGetImagePixels(MagickWand *wand,
00676 %        const long x,const long y,const unsigned long columns,
00677 %        const unsigned long rows,const char *map,const StorageType storage,
00678 %        void *pixels)
00679 %
00680 %  A description of each parameter follows:
00681 %
00682 %    o wand: the magick wand.
00683 %
00684 %    o x, y, columns, rows:  These values define the perimeter
00685 %      of a region of pixels you want to extract.
00686 %
00687 %    o map:  This string reflects the expected ordering of the pixel array.
00688 %      It can be any combination or order of R = red, G = green, B = blue,
00689 %      A = alpha (0 is transparent), O = opacity (0 is opaque), C = cyan,
00690 %      Y = yellow, M = magenta, K = black, I = intensity (for grayscale),
00691 %      P = pad.
00692 %
00693 %    o storage: Define the data type of the pixels.  Float and double types are
00694 %      expected to be normalized [0..1] otherwise [0..QuantumRange].  Choose from
00695 %      these types: CharPixel, DoublePixel, FloatPixel, IntegerPixel,
00696 %      LongPixel, QuantumPixel, or ShortPixel.
00697 %
00698 %    o pixels: This array of values contain the pixel components as defined by
00699 %      map and type.  You must preallocate this array where the expected
00700 %      length varies depending on the values of width, height, map, and type.
00701 %
00702 */
00703 WandExport MagickBooleanType MagickGetImagePixels(MagickWand *wand,
00704   const long x,const long y,const unsigned long columns,
00705   const unsigned long rows,const char *map,const StorageType storage,
00706   void *pixels)
00707 {
00708   return(MagickExportImagePixels(wand,x,y,columns,rows,map,storage,pixels));
00709 }
00710 
00711 /*
00712 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00713 %                                                                             %
00714 %                                                                             %
00715 %                                                                             %
00716 %   M a g i c k G e t I m a g e S i z e                                       %
00717 %                                                                             %
00718 %                                                                             %
00719 %                                                                             %
00720 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00721 %
00722 %  MagickGetImageSize() returns the image length in bytes.
00723 %
00724 %  The format of the MagickGetImageSize method is:
00725 %
00726 %      MagickBooleanType MagickGetImageSize(MagickWand *wand,
00727 %        MagickSizeType *length)
00728 %
00729 %  A description of each parameter follows:
00730 %
00731 %    o wand: the magick wand.
00732 %
00733 %    o length: the image length in bytes.
00734 %
00735 */
00736 WandExport MagickSizeType MagickGetImageSize(MagickWand *wand)
00737 {
00738   assert(wand != (MagickWand *) NULL);
00739   assert(wand->signature == WandSignature);
00740   if (wand->debug != MagickFalse)
00741     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00742   if (wand->images == (Image *) NULL)
00743     ThrowWandException(WandError,"ContainsNoImages",wand->name);
00744   return(GetBlobSize(wand->images));
00745 }
00746 
00747 /*
00748 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00749 %                                                                             %
00750 %                                                                             %
00751 %                                                                             %
00752 %   M a g i c k M a p I m a g e                                               %
00753 %                                                                             %
00754 %                                                                             %
00755 %                                                                             %
00756 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00757 %
00758 %  MagickMapImage() replaces the colors of an image with the closest color
00759 %  from a reference image.
00760 %
00761 %  The format of the MagickMapImage method is:
00762 %
00763 %      MagickBooleanType MagickMapImage(MagickWand *wand,
00764 %        const MagickWand *map_wand,const MagickBooleanType dither)
00765 %
00766 %  A description of each parameter follows:
00767 %
00768 %    o wand: the magick wand.
00769 %
00770 %    o map: the map wand.
00771 %
00772 %    o dither: Set this integer value to something other than zero to dither
00773 %      the mapped image.
00774 %
00775 */
00776 WandExport MagickBooleanType MagickMapImage(MagickWand *wand,
00777   const MagickWand *map_wand,const MagickBooleanType dither)
00778 {
00779   MagickBooleanType
00780     status;
00781 
00782   assert(wand != (MagickWand *) NULL);
00783   assert(wand->signature == WandSignature);
00784   if (wand->debug != MagickFalse)
00785     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00786   if ((wand->images == (Image *) NULL) || (map_wand->images == (Image *) NULL))
00787     ThrowWandException(WandError,"ContainsNoImages",wand->name);
00788   status=MapImage(wand->images,map_wand->images,dither);
00789   if (status == MagickFalse)
00790     InheritException(wand->exception,&wand->images->exception);
00791   return(status);
00792 }
00793 
00794 /*
00795 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00796 %                                                                             %
00797 %                                                                             %
00798 %                                                                             %
00799 %   M a g i c k M a t t e F l o o d f i l l I m a g e                         %
00800 %                                                                             %
00801 %                                                                             %
00802 %                                                                             %
00803 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00804 %
00805 %  MagickMatteFloodfillImage() changes the transparency value of any pixel that
00806 %  matches target and is an immediate neighbor.  If the method
00807 %  FillToBorderMethod is specified, the transparency value is changed for any
00808 %  neighbor pixel that does not match the bordercolor member of image.
00809 %
00810 %  The format of the MagickMatteFloodfillImage method is:
00811 %
00812 %      MagickBooleanType MagickMatteFloodfillImage(MagickWand *wand,
00813 %        const double alpha,const double fuzz,const PixelWand *bordercolor,
00814 %        const long x,const long y)
00815 %
00816 %  A description of each parameter follows:
00817 %
00818 %    o wand: the magick wand.
00819 %
00820 %    o alpha: the level of transparency: 1.0 is fully opaque and 0.0 is fully
00821 %      transparent.
00822 %
00823 %    o fuzz: By default target must match a particular pixel color
00824 %      exactly.  However, in many cases two colors may differ by a small amount.
00825 %      The fuzz member of image defines how much tolerance is acceptable to
00826 %      consider two colors as the same.  For example, set fuzz to 10 and the
00827 %      color red at intensities of 100 and 102 respectively are now interpreted
00828 %      as the same color for the purposes of the floodfill.
00829 %
00830 %    o bordercolor: the border color pixel wand.
00831 %
00832 %    o x,y: the starting location of the operation.
00833 %
00834 */
00835 WandExport MagickBooleanType MagickMatteFloodfillImage(MagickWand *wand,
00836   const double alpha,const double fuzz,const PixelWand *bordercolor,
00837   const long x,const long y)
00838 {
00839   DrawInfo
00840     *draw_info;
00841 
00842   MagickBooleanType
00843     status;
00844 
00845   PixelPacket
00846     target;
00847 
00848   assert(wand != (MagickWand *) NULL);
00849   assert(wand->signature == WandSignature);
00850   if (wand->debug != MagickFalse)
00851     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00852   if (wand->images == (Image *) NULL)
00853     ThrowWandException(WandError,"ContainsNoImages",wand->name);
00854   draw_info=CloneDrawInfo(wand->image_info,(DrawInfo *) NULL);
00855   (void) GetOneVirtualPixel(wand->images,x % wand->images->columns,
00856     y % wand->images->rows,&target,wand->exception);
00857   if (bordercolor != (PixelWand *) NULL)
00858     PixelGetQuantumColor(bordercolor,&target);
00859   wand->images->fuzz=fuzz;
00860   status=MatteFloodfillImage(wand->images,target,RoundToQuantum(
00861     (MagickRealType) QuantumRange-QuantumRange*alpha),x,y,bordercolor !=
00862     (PixelWand *) NULL ? FillToBorderMethod : FloodfillMethod);
00863   if (status == MagickFalse)
00864     InheritException(wand->exception,&wand->images->exception);
00865   draw_info=DestroyDrawInfo(draw_info);
00866   return(status);
00867 }
00868 
00869 /*
00870 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00871 %                                                                             %
00872 %                                                                             %
00873 %                                                                             %
00874 %   M a g i c k M o s a i c I m a g e s                                       %
00875 %                                                                             %
00876 %                                                                             %
00877 %                                                                             %
00878 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00879 %
00880 %  MagickMosaicImages() inlays an image sequence to form a single coherent
00881 %  picture.  It returns a wand with each image in the sequence composited at
00882 %  the location defined by the page offset of the image.
00883 %
00884 %  The format of the MagickMosaicImages method is:
00885 %
00886 %      MagickWand *MagickMosaicImages(MagickWand *wand)
00887 %
00888 %  A description of each parameter follows:
00889 %
00890 %    o wand: the magick wand.
00891 %
00892 */
00893 WandExport MagickWand *MagickMosaicImages(MagickWand *wand)
00894 {
00895   Image
00896     *mosaic_image;
00897 
00898   assert(wand != (MagickWand *) NULL);
00899   assert(wand->signature == WandSignature);
00900   if (wand->debug != MagickFalse)
00901     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
00902   if (wand->images == (Image *) NULL)
00903     return((MagickWand *) NULL);
00904   mosaic_image=MosaicImages(wand->images,wand->exception);
00905   if (mosaic_image == (Image *) NULL)
00906     return((MagickWand *) NULL);
00907   return(CloneMagickWandFromImages(wand,mosaic_image));
00908 }
00909 
00910 /*
00911 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00912 %                                                                             %
00913 %                                                                             %
00914 %                                                                             %
00915 %   M a g i c k O p a q u e I m a g e                                         %
00916 %                                                                             %
00917 %                                                                             %
00918 %                                                                             %
00919 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00920 %
00921 %  MagickOpaqueImage() changes any pixel that matches color with the color
00922 %  defined by fill.
00923 %
00924 %  The format of the MagickOpaqueImage method is:
00925 %
00926 %      MagickBooleanType MagickOpaqueImage(MagickWand *wand,
00927 %        const PixelWand *target,const PixelWand *fill,const double fuzz)
00928 %
00929 %  A description of each parameter follows:
00930 %
00931 %    o wand: the magick wand.
00932 %
00933 %    o channel: the channel(s).
00934 %
00935 %    o target: Change this target color to the fill color within the image.
00936 %
00937 %    o fill: the fill pixel wand.
00938 %
00939 %    o fuzz: By default target must match a particular pixel color
00940 %      exactly.  However, in many cases two colors may differ by a small amount.
00941 %      The fuzz member of image defines how much tolerance is acceptable to
00942 %      consider two colors as the same.  For example, set fuzz to 10 and the
00943 %      color red at intensities of 100 and 102 respectively are now interpreted
00944 %      as the same color for the purposes of the floodfill.
00945 %
00946 */
00947 WandExport MagickBooleanType MagickOpaqueImage(MagickWand *wand,
00948   const PixelWand *target,const PixelWand *fill,const double fuzz)
00949 {
00950   return(MagickPaintOpaqueImage(wand,target,fill,fuzz));
00951 }
00952 
00953 /*
00954 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00955 %                                                                             %
00956 %                                                                             %
00957 %                                                                             %
00958 %   M a g i c k P a i n t F l o o d f i l l I m a g e                         %
00959 %                                                                             %
00960 %                                                                             %
00961 %                                                                             %
00962 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00963 %
00964 %  MagickPaintFloodfillImage() changes the color value of any pixel that matches
00965 %  target and is an immediate neighbor.  If the method FillToBorderMethod is
00966 %  specified, the color value is changed for any neighbor pixel that does not
00967 %  match the bordercolor member of image.
00968 %
00969 %  The format of the MagickPaintFloodfillImage method is:
00970 %
00971 %      MagickBooleanType MagickPaintFloodfillImage(MagickWand *wand,
00972 %        const ChannelType channel,const PixelWand *fill,const double fuzz,
00973 %        const PixelWand *bordercolor,const long x,const long y)
00974 %
00975 %  A description of each parameter follows:
00976 %
00977 %    o wand: the magick wand.
00978 %
00979 %    o channel: the channel(s).
00980 %
00981 %    o fill: the floodfill color pixel wand.
00982 %
00983 %    o fuzz: By default target must match a particular pixel color
00984 %      exactly.  However, in many cases two colors may differ by a small amount.
00985 %      The fuzz member of image defines how much tolerance is acceptable to
00986 %      consider two colors as the same.  For example, set fuzz to 10 and the
00987 %      color red at intensities of 100 and 102 respectively are now interpreted
00988 %      as the same color for the purposes of the floodfill.
00989 %
00990 %    o bordercolor: the border color pixel wand.
00991 %
00992 %    o x,y: the starting location of the operation.
00993 %
00994 */
00995 WandExport MagickBooleanType MagickPaintFloodfillImage(MagickWand *wand,
00996   const ChannelType channel,const PixelWand *fill,const double fuzz,
00997   const PixelWand *bordercolor,const long x,const long y)
00998 {
00999   MagickBooleanType
01000     status;
01001 
01002   status=MagickFloodfillPaintImage(wand,channel,fill,fuzz,bordercolor,x,y,
01003     MagickFalse);
01004   return(status);
01005 }
01006 
01007 /*
01008 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01009 %                                                                             %
01010 %                                                                             %
01011 %                                                                             %
01012 %   M a g i c k P a i n t O p a q u e I m a g e                               %
01013 %                                                                             %
01014 %                                                                             %
01015 %                                                                             %
01016 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01017 %
01018 %  MagickPaintOpaqueImage() changes any pixel that matches color with the color
01019 %  defined by fill.
01020 %
01021 %  The format of the MagickPaintOpaqueImage method is:
01022 %
01023 %      MagickBooleanType MagickPaintOpaqueImage(MagickWand *wand,
01024 %        const PixelWand *target,const PixelWand *fill,const double fuzz)
01025 %      MagickBooleanType MagickPaintOpaqueImageChannel(MagickWand *wand,
01026 %        const ChannelType channel,const PixelWand *target,
01027 %        const PixelWand *fill,const double fuzz)
01028 %
01029 %  A description of each parameter follows:
01030 %
01031 %    o wand: the magick wand.
01032 %
01033 %    o channel: the channel(s).
01034 %
01035 %    o target: Change this target color to the fill color within the image.
01036 %
01037 %    o fill: the fill pixel wand.
01038 %
01039 %    o fuzz: By default target must match a particular pixel color
01040 %      exactly.  However, in many cases two colors may differ by a small amount.
01041 %      The fuzz member of image defines how much tolerance is acceptable to
01042 %      consider two colors as the same.  For example, set fuzz to 10 and the
01043 %      color red at intensities of 100 and 102 respectively are now interpreted
01044 %      as the same color for the purposes of the floodfill.
01045 %
01046 */
01047 
01048 WandExport MagickBooleanType MagickPaintOpaqueImage(MagickWand *wand,
01049   const PixelWand *target,const PixelWand *fill,const double fuzz)
01050 {
01051   return(MagickPaintOpaqueImageChannel(wand,DefaultChannels,target,fill,fuzz));
01052 }
01053 
01054 WandExport MagickBooleanType MagickPaintOpaqueImageChannel(MagickWand *wand,
01055   const ChannelType channel,const PixelWand *target,const PixelWand *fill,
01056   const double fuzz)
01057 {
01058   MagickBooleanType
01059     status;
01060 
01061   status=MagickOpaquePaintImageChannel(wand,channel,target,fill,fuzz,
01062     MagickFalse);
01063   return(status);
01064 }
01065 
01066 /*
01067 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01068 %                                                                             %
01069 %                                                                             %
01070 %                                                                             %
01071 %   M a g i c k P a i n t T r a n s p a r e n t I m a g e                     %
01072 %                                                                             %
01073 %                                                                             %
01074 %                                                                             %
01075 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01076 %
01077 %  MagickPaintTransparentImage() changes any pixel that matches color with the
01078 %  color defined by fill.
01079 %
01080 %  The format of the MagickPaintTransparentImage method is:
01081 %
01082 %      MagickBooleanType MagickPaintTransparentImage(MagickWand *wand,
01083 %        const PixelWand *target,const double alpha,const double fuzz)
01084 %
01085 %  A description of each parameter follows:
01086 %
01087 %    o wand: the magick wand.
01088 %
01089 %    o target: Change this target color to specified opacity value within
01090 %      the image.
01091 %
01092 %    o alpha: the level of transparency: 1.0 is fully opaque and 0.0 is fully
01093 %      transparent.
01094 %
01095 %    o fuzz: By default target must match a particular pixel color
01096 %      exactly.  However, in many cases two colors may differ by a small amount.
01097 %      The fuzz member of image defines how much tolerance is acceptable to
01098 %      consider two colors as the same.  For example, set fuzz to 10 and the
01099 %      color red at intensities of 100 and 102 respectively are now interpreted
01100 %      as the same color for the purposes of the floodfill.
01101 %
01102 */
01103 WandExport MagickBooleanType MagickPaintTransparentImage(MagickWand *wand,
01104   const PixelWand *target,const double alpha,const double fuzz)
01105 {
01106   return(MagickTransparentPaintImage(wand,target,alpha,fuzz,MagickFalse));
01107 }
01108 
01109 /*
01110 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01111 %                                                                             %
01112 %                                                                             %
01113 %                                                                             %
01114 %   M a g i c k S e t I m a g e A t t r i b u t e                             %
01115 %                                                                             %
01116 %                                                                             %
01117 %                                                                             %
01118 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01119 %
01120 %  MagickSetImageAttribute() associates a property with an image.
01121 %
01122 %  The format of the MagickSetImageAttribute method is:
01123 %
01124 %      MagickBooleanType MagickSetImageAttribute(MagickWand *wand,
01125 %        const char *property,const char *value)
01126 %
01127 %  A description of each parameter follows:
01128 %
01129 %    o wand: the magick wand.
01130 %
01131 %    o property: the property.
01132 %
01133 %    o value: the value.
01134 %
01135 */
01136 WandExport MagickBooleanType MagickSetImageAttribute(MagickWand *wand,
01137   const char *property,const char *value)
01138 {
01139   return(SetImageProperty(wand->images,property,value));
01140 }
01141 
01142 /*
01143 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01144 %                                                                             %
01145 %                                                                             %
01146 %                                                                             %
01147 %   M a g i c k S e t I m a g e I n d e x                                     %
01148 %                                                                             %
01149 %                                                                             %
01150 %                                                                             %
01151 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01152 %
01153 %  MagickSetImageIndex() set the current image to the position of the list
01154 %  specified with the index parameter.
01155 %
01156 %  The format of the MagickSetImageIndex method is:
01157 %
01158 %      MagickBooleanType MagickSetImageIndex(MagickWand *wand,const long index)
01159 %
01160 %  A description of each parameter follows:
01161 %
01162 %    o wand: the magick wand.
01163 %
01164 %    o index: the scene number.
01165 %
01166 */
01167 WandExport MagickBooleanType MagickSetImageIndex(MagickWand *wand,
01168   const long index)
01169 {
01170   return(MagickSetIteratorIndex(wand,index));
01171 }
01172 
01173 /*
01174 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01175 %                                                                             %
01176 %                                                                             %
01177 %                                                                             %
01178 +   M a g i c k S e t I m a g e O p t i o n                                   %
01179 %                                                                             %
01180 %                                                                             %
01181 %                                                                             %
01182 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01183 %
01184 %  MagickSetImageOption() associates one or options with a particular image
01185 %  format (.e.g MagickSetImageOption(wand,"jpeg","perserve","yes").
01186 %
01187 %  The format of the MagickSetImageOption method is:
01188 %
01189 %      MagickBooleanType MagickSetImageOption(MagickWand *wand,
01190 %        const char *format,const char *key,const char *value)
01191 %
01192 %  A description of each parameter follows:
01193 %
01194 %    o wand: the magick wand.
01195 %
01196 %    o format: the image format.
01197 %
01198 %    o key:  The key.
01199 %
01200 %    o value:  The value.
01201 %
01202 */
01203 WandExport MagickBooleanType MagickSetImageOption(MagickWand *wand,
01204   const char *format,const char *key,const char *value)
01205 {
01206   char
01207     option[MaxTextExtent];
01208 
01209   assert(wand != (MagickWand *) NULL);
01210   assert(wand->signature == WandSignature);
01211   if (wand->debug != MagickFalse)
01212     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
01213   (void) FormatMagickString(option,MaxTextExtent,"%s:%s=%s",format,key,value);
01214   return(DefineImageOption(wand->image_info,option));
01215 }
01216 
01217 /*
01218 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01219 %                                                                             %
01220 %                                                                             %
01221 %                                                                             %
01222 %   M a g i c k T r a n s p a r e n t I m a g e                               %
01223 %                                                                             %
01224 %                                                                             %
01225 %                                                                             %
01226 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01227 %
01228 %  MagickTransparentImage() changes any pixel that matches color with the
01229 %  color defined by fill.
01230 %
01231 %  The format of the MagickTransparentImage method is:
01232 %
01233 %      MagickBooleanType MagickTransparentImage(MagickWand *wand,
01234 %        const PixelWand *target,const double alpha,const double fuzz)
01235 %
01236 %  A description of each parameter follows:
01237 %
01238 %    o wand: the magick wand.
01239 %
01240 %    o target: Change this target color to specified opacity value within
01241 %      the image.
01242 %
01243 %    o alpha: the level of transparency: 1.0 is fully opaque and 0.0 is fully
01244 %      transparent.
01245 %
01246 %    o fuzz: By default target must match a particular pixel color
01247 %      exactly.  However, in many cases two colors may differ by a small amount.
01248 %      The fuzz member of image defines how much tolerance is acceptable to
01249 %      consider two colors as the same.  For example, set fuzz to 10 and the
01250 %      color red at intensities of 100 and 102 respectively are now interpreted
01251 %      as the same color for the purposes of the floodfill.
01252 %
01253 */
01254 WandExport MagickBooleanType MagickTransparentImage(MagickWand *wand,
01255   const PixelWand *target,const double alpha,const double fuzz)
01256 {
01257   return(MagickPaintTransparentImage(wand,target,alpha,fuzz));
01258 }
01259 
01260 /*
01261 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01262 %                                                                             %
01263 %                                                                             %
01264 %                                                                             %
01265 %   M a g i c k R e g i o n O f I n t e r e s t I m a g e                     %
01266 %                                                                             %
01267 %                                                                             %
01268 %                                                                             %
01269 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01270 %
01271 %  MagickRegionOfInterestImage() extracts a region of the image and returns it
01272 %  as a new wand.
01273 %
01274 %  The format of the MagickRegionOfInterestImage method is:
01275 %
01276 %      MagickWand *MagickRegionOfInterestImage(MagickWand *wand,
01277 %        const unsigned long width,const unsigned long height,const long x,
01278 %        const long y)
01279 %
01280 %  A description of each parameter follows:
01281 %
01282 %    o wand: the magick wand.
01283 %
01284 %    o width: the region width.
01285 %
01286 %    o height: the region height.
01287 %
01288 %    o x: the region x offset.
01289 %
01290 %    o y: the region y offset.
01291 %
01292 */
01293 WandExport MagickWand *MagickRegionOfInterestImage(MagickWand *wand,
01294   const unsigned long width,const unsigned long height,const long x,
01295   const long y)
01296 {
01297   return(MagickGetImageRegion(wand,width,height,x,y));
01298 }
01299 
01300 /*
01301 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01302 %                                                                             %
01303 %                                                                             %
01304 %                                                                             %
01305 %   M a g i c k S e t I m a g e P i x e l s                                   %
01306 %                                                                             %
01307 %                                                                             %
01308 %                                                                             %
01309 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01310 %
01311 %  MagickSetImagePixels() accepts pixel datand stores it in the image at the
01312 %  location you specify.  The method returns MagickFalse on success otherwise
01313 %  MagickTrue if an error is encountered.  The pixel data can be either char,
01314 %  short int, int, long, float, or double in the order specified by map.
01315 %
01316 %  Suppose your want to upload the first scanline of a 640x480 image from
01317 %  character data in red-green-blue order:
01318 %
01319 %      MagickSetImagePixels(wand,0,0,640,1,"RGB",CharPixel,pixels);
01320 %
01321 %  The format of the MagickSetImagePixels method is:
01322 %
01323 %      MagickBooleanType MagickSetImagePixels(MagickWand *wand,
01324 %        const long x,const long y,const unsigned long columns,
01325 %        const unsigned long rows,const char *map,const StorageType storage,
01326 %        const void *pixels)
01327 %
01328 %  A description of each parameter follows:
01329 %
01330 %    o wand: the magick wand.
01331 %
01332 %    o x, y, columns, rows:  These values define the perimeter of a region
01333 %      of pixels you want to define.
01334 %
01335 %    o map:  This string reflects the expected ordering of the pixel array.
01336 %      It can be any combination or order of R = red, G = green, B = blue,
01337 %      A = alpha (0 is transparent), O = opacity (0 is opaque), C = cyan,
01338 %      Y = yellow, M = magenta, K = black, I = intensity (for grayscale),
01339 %      P = pad.
01340 %
01341 %    o storage: Define the data type of the pixels.  Float and double types are
01342 %      expected to be normalized [0..1] otherwise [0..QuantumRange].  Choose from
01343 %      these types: CharPixel, ShortPixel, IntegerPixel, LongPixel, FloatPixel,
01344 %      or DoublePixel.
01345 %
01346 %    o pixels: This array of values contain the pixel components as defined by
01347 %      map and type.  You must preallocate this array where the expected
01348 %      length varies depending on the values of width, height, map, and type.
01349 %
01350 */
01351 WandExport MagickBooleanType MagickSetImagePixels(MagickWand *wand,
01352   const long x,const long y,const unsigned long columns,
01353   const unsigned long rows,const char *map,const StorageType storage,
01354   const void *pixels)
01355 {
01356   return(MagickImportImagePixels(wand,x,y,columns,rows,map,storage,pixels));
01357 }
01358 
01359 /*
01360 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01361 %                                                                             %
01362 %                                                                             %
01363 %                                                                             %
01364 %   M a g i c k W r i t e I m a g e B l o b                                   %
01365 %                                                                             %
01366 %                                                                             %
01367 %                                                                             %
01368 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01369 %
01370 %  MagickWriteImageBlob() implements direct to memory image formats.  It
01371 %  returns the image as a blob and its length.   Use MagickSetFormat() to
01372 %  set the format of the returned blob (GIF, JPEG,  PNG, etc.).
01373 %
01374 %  Use MagickRelinquishMemory() to free the blob when you are done with it.
01375 %
01376 %  The format of the MagickWriteImageBlob method is:
01377 %
01378 %      unsigned char *MagickWriteImageBlob(MagickWand *wand,size_t *length)
01379 %
01380 %  A description of each parameter follows:
01381 %
01382 %    o wand: the magick wand.
01383 %
01384 %    o length: the length of the blob.
01385 %
01386 */
01387 WandExport unsigned char *MagickWriteImageBlob(MagickWand *wand,size_t *length)
01388 {
01389   return(MagickGetImageBlob(wand,length));
01390 }
01391 
01392 /*
01393 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01394 %                                                                             %
01395 %                                                                             %
01396 %                                                                             %
01397 %   P i x e l G e t N e x t R o w                                             %
01398 %                                                                             %
01399 %                                                                             %
01400 %                                                                             %
01401 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01402 %
01403 %  PixelGetNextRow() returns the next row as an array of pixel wands from the
01404 %  pixel iterator.
01405 %
01406 %  The format of the PixelGetNextRow method is:
01407 %
01408 %      PixelWand **PixelGetNextRow(PixelIterator *iterator,
01409 %        unsigned long *number_wands)
01410 %
01411 %  A description of each parameter follows:
01412 %
01413 %    o iterator: the pixel iterator.
01414 %
01415 %    o number_wands: the number of pixel wands.
01416 %
01417 */
01418 WandExport PixelWand **PixelGetNextRow(PixelIterator *iterator)
01419 {
01420   unsigned long
01421     number_wands;
01422 
01423   return(PixelGetNextIteratorRow(iterator,&number_wands));
01424 }
01425 
01426 /*
01427 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01428 %                                                                             %
01429 %                                                                             %
01430 %                                                                             %
01431 %   P i x e l I t e r a t o r G e t E x c e p t i o n                         %
01432 %                                                                             %
01433 %                                                                             %
01434 %                                                                             %
01435 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
01436 %
01437 %  PixelIteratorGetException() returns the severity, reason, and description of
01438 %  any error that occurs when using other methods in this API.
01439 %
01440 %  The format of the PixelIteratorGetException method is:
01441 %
01442 %      char *PixelIteratorGetException(const Pixeliterator *iterator,
01443 %        ExceptionType *severity)
01444 %
01445 %  A description of each parameter follows:
01446 %
01447 %    o iterator: the pixel iterator.
01448 %
01449 %    o severity: the severity of the error is returned here.
01450 %
01451 */
01452 WandExport char *PixelIteratorGetException(const PixelIterator *iterator,
01453   ExceptionType *severity)
01454 {
01455   return(PixelGetIteratorException(iterator,severity));
01456 }
01457 #endif

Generated on 19 Nov 2009 for MagickWand by  doxygen 1.6.1