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-2008 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 M a p I m a g e % 00658 % % 00659 % % 00660 % % 00661 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00662 % 00663 % MagickMapImage() replaces the colors of an image with the closest color 00664 % from a reference image. 00665 % 00666 % The format of the MagickMapImage method is: 00667 % 00668 % MagickBooleanType MagickMapImage(MagickWand *wand, 00669 % const MagickWand *map_wand,const MagickBooleanType dither) 00670 % 00671 % A description of each parameter follows: 00672 % 00673 % o wand: the magick wand. 00674 % 00675 % o map: the map wand. 00676 % 00677 % o dither: Set this integer value to something other than zero to dither 00678 % the mapped image. 00679 % 00680 */ 00681 WandExport MagickBooleanType MagickMapImage(MagickWand *wand, 00682 const MagickWand *map_wand,const MagickBooleanType dither) 00683 { 00684 MagickBooleanType 00685 status; 00686 00687 assert(wand != (MagickWand *) NULL); 00688 assert(wand->signature == WandSignature); 00689 if (wand->debug != MagickFalse) 00690 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 00691 if ((wand->images == (Image *) NULL) || (map_wand->images == (Image *) NULL)) 00692 ThrowWandException(WandError,"ContainsNoImages",wand->name); 00693 status=MapImage(wand->images,map_wand->images,dither); 00694 if (status == MagickFalse) 00695 InheritException(wand->exception,&wand->images->exception); 00696 return(status); 00697 } 00698 00699 /* 00700 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00701 % % 00702 % % 00703 % % 00704 % 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 % 00705 % % 00706 % % 00707 % % 00708 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00709 % 00710 % MagickMatteFloodfillImage() changes the transparency value of any pixel that 00711 % matches target and is an immediate neighbor. If the method 00712 % FillToBorderMethod is specified, the transparency value is changed for any 00713 % neighbor pixel that does not match the bordercolor member of image. 00714 % 00715 % The format of the MagickMatteFloodfillImage method is: 00716 % 00717 % MagickBooleanType MagickMatteFloodfillImage(MagickWand *wand, 00718 % const double alpha,const double fuzz,const PixelWand *bordercolor, 00719 % const long x,const long y) 00720 % 00721 % A description of each parameter follows: 00722 % 00723 % o wand: the magick wand. 00724 % 00725 % o alpha: the level of transparency: 1.0 is fully opaque and 0.0 is fully 00726 % transparent. 00727 % 00728 % o fuzz: By default target must match a particular pixel color 00729 % exactly. However, in many cases two colors may differ by a small amount. 00730 % The fuzz member of image defines how much tolerance is acceptable to 00731 % consider two colors as the same. For example, set fuzz to 10 and the 00732 % color red at intensities of 100 and 102 respectively are now interpreted 00733 % as the same color for the purposes of the floodfill. 00734 % 00735 % o bordercolor: the border color pixel wand. 00736 % 00737 % o x,y: the starting location of the operation. 00738 % 00739 */ 00740 WandExport MagickBooleanType MagickMatteFloodfillImage(MagickWand *wand, 00741 const double alpha,const double fuzz,const PixelWand *bordercolor, 00742 const long x,const long y) 00743 { 00744 DrawInfo 00745 *draw_info; 00746 00747 MagickBooleanType 00748 status; 00749 00750 PixelPacket 00751 target; 00752 00753 assert(wand != (MagickWand *) NULL); 00754 assert(wand->signature == WandSignature); 00755 if (wand->debug != MagickFalse) 00756 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 00757 if (wand->images == (Image *) NULL) 00758 ThrowWandException(WandError,"ContainsNoImages",wand->name); 00759 draw_info=CloneDrawInfo(wand->image_info,(DrawInfo *) NULL); 00760 (void) GetOneVirtualPixel(wand->images,x % wand->images->columns, 00761 y % wand->images->rows,&target,wand->exception); 00762 if (bordercolor != (PixelWand *) NULL) 00763 PixelGetQuantumColor(bordercolor,&target); 00764 wand->images->fuzz=fuzz; 00765 status=MatteFloodfillImage(wand->images,target,RoundToQuantum( 00766 (MagickRealType) QuantumRange-QuantumRange*alpha),x,y,bordercolor != 00767 (PixelWand *) NULL ? FillToBorderMethod : FloodfillMethod); 00768 if (status == MagickFalse) 00769 InheritException(wand->exception,&wand->images->exception); 00770 draw_info=DestroyDrawInfo(draw_info); 00771 return(status); 00772 } 00773 00774 /* 00775 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00776 % % 00777 % % 00778 % % 00779 % M a g i c k M o s a i c I m a g e s % 00780 % % 00781 % % 00782 % % 00783 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00784 % 00785 % MagickMosaicImages() inlays an image sequence to form a single coherent 00786 % picture. It returns a wand with each image in the sequence composited at 00787 % the location defined by the page offset of the image. 00788 % 00789 % The format of the MagickMosaicImages method is: 00790 % 00791 % MagickWand *MagickMosaicImages(MagickWand *wand) 00792 % 00793 % A description of each parameter follows: 00794 % 00795 % o wand: the magick wand. 00796 % 00797 */ 00798 WandExport MagickWand *MagickMosaicImages(MagickWand *wand) 00799 { 00800 Image 00801 *mosaic_image; 00802 00803 assert(wand != (MagickWand *) NULL); 00804 assert(wand->signature == WandSignature); 00805 if (wand->debug != MagickFalse) 00806 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 00807 if (wand->images == (Image *) NULL) 00808 return((MagickWand *) NULL); 00809 mosaic_image=MosaicImages(wand->images,wand->exception); 00810 if (mosaic_image == (Image *) NULL) 00811 return((MagickWand *) NULL); 00812 return(CloneMagickWandFromImages(wand,mosaic_image)); 00813 } 00814 00815 /* 00816 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00817 % % 00818 % % 00819 % % 00820 % M a g i c k O p a q u e I m a g e % 00821 % % 00822 % % 00823 % % 00824 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00825 % 00826 % MagickOpaqueImage() changes any pixel that matches color with the color 00827 % defined by fill. 00828 % 00829 % The format of the MagickOpaqueImage method is: 00830 % 00831 % MagickBooleanType MagickOpaqueImage(MagickWand *wand, 00832 % const PixelWand *target,const PixelWand *fill,const double fuzz) 00833 % 00834 % A description of each parameter follows: 00835 % 00836 % o wand: the magick wand. 00837 % 00838 % o channel: the channel(s). 00839 % 00840 % o target: Change this target color to the fill color within the image. 00841 % 00842 % o fill: the fill pixel wand. 00843 % 00844 % o fuzz: By default target must match a particular pixel color 00845 % exactly. However, in many cases two colors may differ by a small amount. 00846 % The fuzz member of image defines how much tolerance is acceptable to 00847 % consider two colors as the same. For example, set fuzz to 10 and the 00848 % color red at intensities of 100 and 102 respectively are now interpreted 00849 % as the same color for the purposes of the floodfill. 00850 % 00851 */ 00852 WandExport MagickBooleanType MagickOpaqueImage(MagickWand *wand, 00853 const PixelWand *target,const PixelWand *fill,const double fuzz) 00854 { 00855 return(MagickPaintOpaqueImage(wand,target,fill,fuzz)); 00856 } 00857 00858 /* 00859 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00860 % % 00861 % % 00862 % % 00863 % 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 % 00864 % % 00865 % % 00866 % % 00867 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00868 % 00869 % MagickPaintFloodfillImage() changes the color value of any pixel that matches 00870 % target and is an immediate neighbor. If the method FillToBorderMethod is 00871 % specified, the color value is changed for any neighbor pixel that does not 00872 % match the bordercolor member of image. 00873 % 00874 % The format of the MagickPaintFloodfillImage method is: 00875 % 00876 % MagickBooleanType MagickPaintFloodfillImage(MagickWand *wand, 00877 % const ChannelType channel,const PixelWand *fill,const double fuzz, 00878 % const PixelWand *bordercolor,const long x,const long y) 00879 % 00880 % A description of each parameter follows: 00881 % 00882 % o wand: the magick wand. 00883 % 00884 % o channel: the channel(s). 00885 % 00886 % o fill: the floodfill color pixel wand. 00887 % 00888 % o fuzz: By default target must match a particular pixel color 00889 % exactly. However, in many cases two colors may differ by a small amount. 00890 % The fuzz member of image defines how much tolerance is acceptable to 00891 % consider two colors as the same. For example, set fuzz to 10 and the 00892 % color red at intensities of 100 and 102 respectively are now interpreted 00893 % as the same color for the purposes of the floodfill. 00894 % 00895 % o bordercolor: the border color pixel wand. 00896 % 00897 % o x,y: the starting location of the operation. 00898 % 00899 */ 00900 WandExport MagickBooleanType MagickPaintFloodfillImage(MagickWand *wand, 00901 const ChannelType channel,const PixelWand *fill,const double fuzz, 00902 const PixelWand *bordercolor,const long x,const long y) 00903 { 00904 MagickBooleanType 00905 status; 00906 00907 status=MagickFloodfillPaintImage(wand,channel,fill,fuzz,bordercolor,x,y, 00908 MagickFalse); 00909 return(status); 00910 } 00911 00912 /* 00913 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00914 % % 00915 % % 00916 % % 00917 % M a g i c k P a i n t O p a q u e I m a g e % 00918 % % 00919 % % 00920 % % 00921 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00922 % 00923 % MagickPaintOpaqueImage() changes any pixel that matches color with the color 00924 % defined by fill. 00925 % 00926 % The format of the MagickPaintOpaqueImage method is: 00927 % 00928 % MagickBooleanType MagickPaintOpaqueImage(MagickWand *wand, 00929 % const PixelWand *target,const PixelWand *fill,const double fuzz) 00930 % MagickBooleanType MagickPaintOpaqueImageChannel(MagickWand *wand, 00931 % const ChannelType channel,const PixelWand *target, 00932 % const PixelWand *fill,const double fuzz) 00933 % 00934 % A description of each parameter follows: 00935 % 00936 % o wand: the magick wand. 00937 % 00938 % o channel: the channel(s). 00939 % 00940 % o target: Change this target color to the fill color within the image. 00941 % 00942 % o fill: the fill pixel wand. 00943 % 00944 % o fuzz: By default target must match a particular pixel color 00945 % exactly. However, in many cases two colors may differ by a small amount. 00946 % The fuzz member of image defines how much tolerance is acceptable to 00947 % consider two colors as the same. For example, set fuzz to 10 and the 00948 % color red at intensities of 100 and 102 respectively are now interpreted 00949 % as the same color for the purposes of the floodfill. 00950 % 00951 */ 00952 00953 WandExport MagickBooleanType MagickPaintOpaqueImage(MagickWand *wand, 00954 const PixelWand *target,const PixelWand *fill,const double fuzz) 00955 { 00956 return(MagickPaintOpaqueImageChannel(wand,DefaultChannels,target,fill,fuzz)); 00957 } 00958 00959 WandExport MagickBooleanType MagickPaintOpaqueImageChannel(MagickWand *wand, 00960 const ChannelType channel,const PixelWand *target,const PixelWand *fill, 00961 const double fuzz) 00962 { 00963 MagickBooleanType 00964 status; 00965 00966 status=MagickOpaquePaintImageChannel(wand,channel,target,fill,fuzz, 00967 MagickFalse); 00968 return(status); 00969 } 00970 00971 /* 00972 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00973 % % 00974 % % 00975 % % 00976 % 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 % 00977 % % 00978 % % 00979 % % 00980 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00981 % 00982 % MagickPaintTransparentImage() changes any pixel that matches color with the 00983 % color defined by fill. 00984 % 00985 % The format of the MagickPaintTransparentImage method is: 00986 % 00987 % MagickBooleanType MagickPaintTransparentImage(MagickWand *wand, 00988 % const PixelWand *target,const double alpha,const double fuzz) 00989 % 00990 % A description of each parameter follows: 00991 % 00992 % o wand: the magick wand. 00993 % 00994 % o target: Change this target color to specified opacity value within 00995 % the image. 00996 % 00997 % o alpha: the level of transparency: 1.0 is fully opaque and 0.0 is fully 00998 % transparent. 00999 % 01000 % o fuzz: By default target must match a particular pixel color 01001 % exactly. However, in many cases two colors may differ by a small amount. 01002 % The fuzz member of image defines how much tolerance is acceptable to 01003 % consider two colors as the same. For example, set fuzz to 10 and the 01004 % color red at intensities of 100 and 102 respectively are now interpreted 01005 % as the same color for the purposes of the floodfill. 01006 % 01007 */ 01008 WandExport MagickBooleanType MagickPaintTransparentImage(MagickWand *wand, 01009 const PixelWand *target,const double alpha,const double fuzz) 01010 { 01011 return(MagickTransparentPaintImage(wand,target,alpha,fuzz,MagickFalse)); 01012 } 01013 01014 /* 01015 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 01016 % % 01017 % % 01018 % % 01019 % M a g i c k S e t I m a g e A t t r i b u t e % 01020 % % 01021 % % 01022 % % 01023 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 01024 % 01025 % MagickSetImageAttribute() associates a property with an image. 01026 % 01027 % The format of the MagickSetImageAttribute method is: 01028 % 01029 % MagickBooleanType MagickSetImageAttribute(MagickWand *wand, 01030 % const char *property,const char *value) 01031 % 01032 % A description of each parameter follows: 01033 % 01034 % o wand: the magick wand. 01035 % 01036 % o property: the property. 01037 % 01038 % o value: the value. 01039 % 01040 */ 01041 WandExport MagickBooleanType MagickSetImageAttribute(MagickWand *wand, 01042 const char *property,const char *value) 01043 { 01044 return(SetImageProperty(wand->images,property,value)); 01045 } 01046 01047 /* 01048 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 01049 % % 01050 % % 01051 % % 01052 % M a g i c k S e t I m a g e I n d e x % 01053 % % 01054 % % 01055 % % 01056 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 01057 % 01058 % MagickSetImageIndex() set the current image to the position of the list 01059 % specified with the index parameter. 01060 % 01061 % The format of the MagickSetImageIndex method is: 01062 % 01063 % MagickBooleanType MagickSetImageIndex(MagickWand *wand,const long index) 01064 % 01065 % A description of each parameter follows: 01066 % 01067 % o wand: the magick wand. 01068 % 01069 % o index: the scene number. 01070 % 01071 */ 01072 WandExport MagickBooleanType MagickSetImageIndex(MagickWand *wand, 01073 const long index) 01074 { 01075 return(MagickSetIteratorIndex(wand,index)); 01076 } 01077 01078 /* 01079 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 01080 % % 01081 % % 01082 % % 01083 + M a g i c k S e t I m a g e O p t i o n % 01084 % % 01085 % % 01086 % % 01087 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 01088 % 01089 % MagickSetImageOption() associates one or options with a particular image 01090 % format (.e.g MagickSetImageOption(wand,"jpeg","perserve","yes"). 01091 % 01092 % The format of the MagickSetImageOption method is: 01093 % 01094 % MagickBooleanType MagickSetImageOption(MagickWand *wand, 01095 % const char *format,const char *key,const char *value) 01096 % 01097 % A description of each parameter follows: 01098 % 01099 % o wand: the magick wand. 01100 % 01101 % o format: the image format. 01102 % 01103 % o key: The key. 01104 % 01105 % o value: The value. 01106 % 01107 */ 01108 WandExport MagickBooleanType MagickSetImageOption(MagickWand *wand, 01109 const char *format,const char *key,const char *value) 01110 { 01111 char 01112 option[MaxTextExtent]; 01113 01114 assert(wand != (MagickWand *) NULL); 01115 assert(wand->signature == WandSignature); 01116 if (wand->debug != MagickFalse) 01117 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); 01118 (void) FormatMagickString(option,MaxTextExtent,"%s:%s=%s",format,key,value); 01119 return(DefineImageOption(wand->image_info,option)); 01120 } 01121 01122 /* 01123 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 01124 % % 01125 % % 01126 % % 01127 % M a g i c k T r a n s p a r e n t I m a g e % 01128 % % 01129 % % 01130 % % 01131 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 01132 % 01133 % MagickTransparentImage() changes any pixel that matches color with the 01134 % color defined by fill. 01135 % 01136 % The format of the MagickTransparentImage method is: 01137 % 01138 % MagickBooleanType MagickTransparentImage(MagickWand