Powered by Pair ImageMagick logo
Image Magick
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages

ImageMagick-6.1.1/magick/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 % ImageMagick Deprecated Methods % 00014 % % 00015 % Software Design % 00016 % John Cristy % 00017 % October 2002 % 00018 % % 00019 % % 00020 % Copyright 1999-2004 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/www/Copyright.html % 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 "magick/studio.h" 00044 #include "magick/blob.h" 00045 #include "magick/blob_private.h" 00046 #include "magick/client.h" 00047 #include "magick/color.h" 00048 #include "magick/color_private.h" 00049 #include "magick/colorspace.h" 00050 #include "magick/constitute.h" 00051 #include "magick/deprecate.h" 00052 #include "magick/effect.h" 00053 #include "magick/error.h" 00054 #include "magick/error_private.h" 00055 #include "magick/geometry.h" 00056 #include "magick/list.h" 00057 #include "magick/log.h" 00058 #include "magick/memory_.h" 00059 #include "magick/magick.h" 00060 #include "magick/monitor.h" 00061 #include "magick/nt_feature.h" 00062 #include "magick/paint.h" 00063 #include "magick/quantize.h" 00064 #include "magick/random.h" 00065 #include "magick/resource_.h" 00066 #include "magick/semaphore.h" 00067 #include "magick/segment.h" 00068 #include "magick/string_.h" 00069 #include "magick/utility.h" 00070 00071 /* 00072 Global declarations. 00073 */ 00074 static MonitorHandler 00075 monitor_handler = (MonitorHandler) NULL; 00076 00077 /* 00078 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00079 % % 00080 % % 00081 % % 00082 % A c q u i r e M e m o r y % 00083 % % 00084 % % 00085 % % 00086 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00087 % 00088 % AcquireMemory() returns a pointer to a block of memory at least size bytes 00089 % suitably aligned for any use. 00090 % 00091 % The format of the AcquireMemory method is: 00092 % 00093 % void *AcquireMemory(const size_t size) 00094 % 00095 % A description of each parameter follows: 00096 % 00097 % o size: The size of the memory in bytes to allocate. 00098 % 00099 % 00100 */ 00101 MagickExport void *AcquireMemory(const size_t size) 00102 { 00103 void 00104 *allocation; 00105 00106 assert(size != 0); 00107 (void) LogMagickEvent(DeprecateEvent,GetMagickModule(),"last use: v5.5.7"); 00108 allocation=malloc(size); 00109 return(allocation); 00110 } 00111 00112 /* 00113 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00114 % % 00115 % % 00116 % % 00117 % A c q u i r e S t r i n g % 00118 % % 00119 % % 00120 % % 00121 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00122 % 00123 % AllocateString() allocates memory for a string and copies the source string 00124 % to that memory location (and returns it). 00125 % 00126 % The format of the AllocateString method is: 00127 % 00128 % char *AllocateString(const char *source) 00129 % 00130 % A description of each parameter follows: 00131 % 00132 % o source: A character string. 00133 % 00134 % 00135 */ 00136 MagickExport char *AllocateString(const char *source) 00137 { 00138 char 00139 *destination; 00140 00141 assert(source != (const char *) NULL); 00142 (void) LogMagickEvent(DeprecateEvent,GetMagickModule(),"last use: v5.5.7"); 00143 destination=(char *) AcquireMagickMemory(strlen(source)+MaxTextExtent+1); 00144 if (destination == (char *) NULL) 00145 ThrowMagickFatalException(ResourceLimitFatalError,"MemoryAllocationFailed", 00146 strerror(errno)); 00147 *destination='\0'; 00148 if (source != (char *) NULL) 00149 (void) strcpy(destination,source); 00150 return(destination); 00151 } 00152 00153 /* 00154 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00155 % % 00156 % % 00157 % C h a n n e l I m a g e % 00158 % % 00159 % % 00160 % % 00161 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00162 % 00163 % Extract a channel from the image. A channel is a particular color component 00164 % of each pixel in the image. 00165 % 00166 % The format of the ChannelImage method is: 00167 % 00168 % unsigned int ChannelImage(Image *image,const ChannelType channel) 00169 % 00170 % A description of each parameter follows: 00171 % 00172 % o image: The image. 00173 % 00174 % o channel: Identify which channel to extract: RedChannel, GreenChannel, 00175 % BlueChannel, OpacityChannel, CyanChannel, MagentaChannel, YellowChannel, 00176 % or BlackChannel. 00177 % 00178 % 00179 */ 00180 MagickExport unsigned int ChannelImage(Image *image,const ChannelType channel) 00181 { 00182 return(SeparateImageChannel(image,channel)); 00183 } 00184 00185 /* 00186 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00187 % % 00188 % % 00189 % C h a n n e l T h r e s h o l d I m a g e % 00190 % % 00191 % % 00192 % % 00193 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00194 % 00195 % ChannelThresholdImage() changes the value of individual pixels based on 00196 % the intensity of each pixel channel. The result is a high-contrast image. 00197 % 00198 % The format of the ChannelThresholdImage method is: 00199 % 00200 % unsigned int ChannelThresholdImage(Image *image,const char *level) 00201 % 00202 % A description of each parameter follows: 00203 % 00204 % o image: The image. 00205 % 00206 % o level: define the threshold values. 00207 % 00208 % 00209 */ 00210 MagickExport unsigned int ChannelThresholdImage(Image *image,const char *level) 00211 { 00212 MagickPixelPacket 00213 threshold; 00214 00215 GeometryInfo 00216 geometry_info; 00217 00218 unsigned int 00219 flags, 00220 status; 00221 00222 assert(image != (Image *) NULL); 00223 assert(image->signature == MagickSignature); 00224 if (image->debug != MagickFalse) 00225 (void) LogMagickEvent(TraceEvent,GetMagickModule(),image->filename); 00226 if (image->debug != MagickFalse) 00227 (void) LogMagickEvent(DeprecateEvent,GetMagickModule(),"last use: v5.5.7"); 00228 if (level == (char *) NULL) 00229 return(False); 00230 flags=ParseGeometry(level,&geometry_info); 00231 threshold.red=geometry_info.rho; 00232 threshold.green=geometry_info.sigma; 00233 if ((flags & SigmaValue) == 0) 00234 threshold.green=threshold.red; 00235 threshold.blue=geometry_info.xi; 00236 if ((flags & XiValue) == 0) 00237 threshold.blue=threshold.red; 00238 status=BilevelImageChannel(image,RedChannel,threshold.red); 00239 status|=BilevelImageChannel(image,GreenChannel,threshold.green); 00240 status|=BilevelImageChannel(image,BlueChannel,threshold.blue); 00241 return(status); 00242 } 00243 00244 /* 00245 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00246 % % 00247 % % 00248 % % 00249 % C l o n e M e m o r y % 00250 % % 00251 % % 00252 % % 00253 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00254 % 00255 % CloneMemory() copies size bytes from memory area source to the destination. 00256 % Copying between objects that overlap will take place correctly. It returns 00257 % destination. 00258 % 00259 % The format of the CloneMemory method is: 00260 % 00261 % void *CloneMemory(void *destination,const void *source, 00262 % const size_t size) 00263 % 00264 % A description of each parameter follows: 00265 % 00266 % o destination: The destination. 00267 % 00268 % o source: The source. 00269 % 00270 % o size: The size of the memory in bytes to allocate. 00271 % 00272 % 00273 */ 00274 MagickExport void *CloneMemory(void *destination,const void *source, 00275 const size_t size) 00276 { 00277 register const unsigned char 00278 *p; 00279 00280 register unsigned char 00281 *q; 00282 00283 register long 00284 i; 00285 00286 assert(destination != (void *) NULL); 00287 assert(source != (const void *) NULL); 00288 (void) LogMagickEvent(DeprecateEvent,GetMagickModule(),"last use: v5.5.7"); 00289 p=(const unsigned char *) source; 00290 q=(unsigned char *) destination; 00291 if ((p <= q) || ((p+size) >= q)) 00292 return(CopyMagickMemory(destination,source,size)); 00293 /* 00294 Overlap, copy backwards. 00295 */ 00296 p+=size; 00297 q+=size; 00298 for (i=(long) (size-1); i >= 0; i--) 00299 *--q=(*--p); 00300 return(destination); 00301 } 00302 00303 /* 00304 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00305 % % 00306 % % 00307 % % 00308 % D e l e t e I m a g e L i s t % 00309 % % 00310 % % 00311 % % 00312 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00313 % 00314 % DeleteImageList() deletes an image at the specified position in the list. 00315 % 00316 % The format of the DeleteImageList method is: 00317 % 00318 % unsigned int DeleteImageList(Image *images,const long offset) 00319 % 00320 % A description of each parameter follows: 00321 % 00322 % o images: The image list. 00323 % 00324 % o offset: The position within the list. 00325 % 00326 % 00327 */ 00328 MagickExport unsigned int DeleteImageList(Image *images,const long offset) 00329 { 00330 register long 00331 i; 00332 00333 if (images->debug != MagickFalse) 00334 (void) LogMagickEvent(DeprecateEvent,GetMagickModule(),"last use: v5.5.2"); 00335 while (images->previous != (Image *) NULL) 00336 images=images->previous; 00337 for (i=0; i < offset; i++) 00338 { 00339 if (images->next == (Image *) NULL) 00340 return(False); 00341 images=images->next; 00342 } 00343 DeleteImageFromList(&images); 00344 return(True); 00345 } 00346 00347 /* 00348 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00349 % % 00350 % % 00351 % % 00352 % D e s t r o y I m a g e s % 00353 % % 00354 % % 00355 % % 00356 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00357 % 00358 % DestroyImages() destroys an image list. 00359 % 00360 % The format of the DestroyImages method is: 00361 % 00362 % void DestroyImages(Image *image) 00363 % 00364 % A description of each parameter follows: 00365 % 00366 % o image: The image sequence. 00367 % 00368 % 00369 */ 00370 MagickExport void DestroyImages(Image *image) 00371 { 00372 if (image->debug != MagickFalse) 00373 (void) LogMagickEvent(DeprecateEvent,GetMagickModule(),"last use: v5.4.3"); 00374 DestroyImageList(image); 00375 } 00376 00377 /* 00378 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00379 % % 00380 % % 00381 % % 00382 % D i s p a t c h I m a g e % 00383 % % 00384 % % 00385 % % 00386 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00387 % 00388 % DispatchImage() extracts pixel data from an image and returns it to you. 00389 % The method returns MagickFalse on success otherwise True if an error is 00390 % encountered. The data is returned as char, short int, int, long, float, 00391 % or double in the order specified by map. 00392 % 00393 % Suppose you want to extract the first scanline of a 640x480 image as 00394 % character data in red-green-blue order: 00395 % 00396 % DispatchImage(image,0,0,640,1,"RGB",CharPixel,pixels,exception); 00397 % 00398 % The format of the DispatchImage method is: 00399 % 00400 % unsigned int DispatchImage(const Image *image,const long x_offset, 00401 % const long y_offset,const unsigned long columns, 00402 % const unsigned long rows,const char *map,const StorageType type, 00403 % void *pixels,ExceptionInfo *exception) 00404 % 00405 % A description of each parameter follows: 00406 % 00407 % o image: The image. 00408 % 00409 % o x_offset, y_offset, columns, rows: These values define the perimeter 00410 % of a region of pixels you want to extract. 00411 % 00412 % o map: This string reflects the expected ordering of the pixel array. 00413 % It can be any combination or order of R = red, G = green, B = blue, 00414 % A = alpha, C = cyan, Y = yellow, M = magenta, K = black, or 00415 % I = intensity (for grayscale). 00416 % 00417 % o type: Define the data type of the pixels. Float and double types are 00418 % normalized to [0..1] otherwise [0..MaxRGB]. Choose from these types: 00419 % CharPixel, ShortPixel, IntegerPixel, LongPixel, FloatPixel, or 00420 % DoublePixel. 00421 % 00422 % o pixels: This array of values contain the pixel components as defined by 00423 % map and type. You must preallocate this array where the expected 00424 % length varies depending on the values of width, height, map, and type. 00425 % 00426 % o exception: Return any errors or warnings in this structure. 00427 % 00428 % 00429 */ 00430 MagickExport unsigned int DispatchImage(const Image *image,const long x_offset, 00431 const long y_offset,const unsigned long columns,const unsigned long rows, 00432 const char *map,const StorageType type,void *pixels,ExceptionInfo *exception) 00433 { 00434 unsigned int 00435 status; 00436 00437 if (image->debug != MagickFalse) 00438 (void) LogMagickEvent(DeprecateEvent,GetMagickModule(),"last use: v5.5.6"); 00439 status=ExportImagePixels(image,x_offset,y_offset,columns,rows,map,type,pixels, 00440 exception); 00441 return(status); 00442 } 00443 00444 /* 00445 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00446 % % 00447 % % 00448 % % 00449 % F o r m a t S t r i n g % 00450 % % 00451 % % 00452 % % 00453 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00454 % 00455 % FormatString() prints formatted output of a variable argument list. 00456 % 00457 % The format of the FormatString method is: 00458 % 00459 % void FormatString(char *string,const char *format,...) 00460 % 00461 % A description of each parameter follows. 00462 % 00463 % o string: Method FormatString returns the formatted string in this 00464 % character buffer. 00465 % 00466 % o format: A string describing the format to use to write the remaining 00467 % arguments. 00468 % 00469 % 00470 */ 00471 MagickExport void FormatString(char *string,const char *format,...) 00472 { 00473 va_list 00474 operands; 00475 00476 (void) LogMagickEvent(DeprecateEvent,GetMagickModule(),"last use: v5.5.7"); 00477 va_start(operands,format); 00478 #if defined(HAVE_VSNPRINTF) 00479 (void) vsnprintf(string,MaxTextExtent,format,operands); 00480 #else 00481 (void) vsprintf(string,format,operands); 00482 #endif 00483 va_end(operands); 00484 } 00485 00486 /* 00487 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00488 % % 00489 % % 00490 % % 00491 + F u z z y C o l o r M a t c h % 00492 % % 00493 % % 00494 % % 00495 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00496 % 00497 % FuzzyColorMatch() returns true if two pixels are identical in color. 00498 % 00499 % The format of the ColorMatch method is: 00500 % 00501 % void FuzzyColorMatch(const PixelPacket *p,const PixelPacket *q, 00502 % const double fuzz) 00503 % 00504 % A description of each parameter follows: 00505 % 00506 % o p: Pixel p. 00507 % 00508 % o q: Pixel q. 00509 % 00510 % o distance: Define how much tolerance is acceptable to consider 00511 % two colors as the same. 00512 % 00513 % 00514 */ 00515 MagickExport unsigned int FuzzyColorMatch(const PixelPacket *p, 00516 const PixelPacket *q,const double fuzz) 00517 { 00518 MagickPixelPacket 00519 pixel; 00520 00521 register MagickRealType 00522 distance; 00523 00524 if ((fuzz == 0.0) && (p->red == q->red) && (p->green == q->green) && 00525 (p->blue == q->blue)) 00526 return(True); 00527 pixel.red=p->red-(MagickRealType) q->red; 00528 distance=pixel.red*pixel.red; 00529 if (distance > (fuzz*fuzz)) 00530 return(False); 00531 pixel.green=p->green-(MagickRealType) q->green; 00532 distance+=pixel.green*pixel.green; 00533 if (distance > (fuzz*fuzz)) 00534 return(False); 00535 pixel.blue=p->blue-(MagickRealType) q->blue; 00536 distance+=pixel.blue*pixel.blue; 00537 if (distance > (fuzz*fuzz)) 00538 return(False); 00539 return(True); 00540 } 00541 00542 /* 00543 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00544 % % 00545 % % 00546 % % 00547 % G e t C o n f i g u r e B l o b % 00548 % % 00549 % % 00550 % % 00551 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00552 % 00553 % GetConfigureBlob() returns the specified configure file as a blob. 00554 % 00555 % The format of the GetConfigureBlob method is: 00556 % 00557 % void *GetConfigureBlob(const char *filename,ExceptionInfo *exception) 00558 % 00559 % A description of each parameter follows: 00560 % 00561 % o filename: The configure file name. 00562 % 00563 % o path: return the full path information of the configure file. 00564 % 00565 % o length: This pointer to a size_t integer sets the initial length of the 00566 % blob. On return, it reflects the actual length of the blob. 00567 % 00568 % o exception: Return any errors or warnings in this structure. 00569 % 00570 % 00571 */ 00572 MagickExport void *GetConfigureBlob(const char *filename,char *path, 00573 size_t *length,ExceptionInfo *exception) 00574 { 00575 void 00576 *blob; 00577 00578 assert(filename != (const char *) NULL); 00579 (void) LogMagickEvent(TraceEvent,GetMagickModule(),filename); 00580 (void) LogMagickEvent(DeprecateEvent,GetMagickModule(),"last use: v5.5.7"); 00581 assert(path != (char *) NULL); 00582 assert(length != (size_t *) NULL); 00583 assert(exception != (ExceptionInfo *) NULL); 00584 blob=(void *) NULL; 00585 (void) CopyMagickString(path,filename,MaxTextExtent); 00586 #if defined(UseInstalledMagick) 00587 #if defined(MagickLibPath) 00588 if (blob == (void *) NULL) 00589 { 00590 /* 00591 Search hard coded paths. 00592 */ 00593 (void) FormatMagickString(path,MaxTextExtent,"%s%s",MagickLibPath, 00594 filename); 00595 if (IsAccessible(path) != MagickFalse) 00596 blob=FileToBlob(path,length,exception); 00597 } 00598 #endif 00599 #if defined(__WINDOWS__) && !(defined(MagickLibConfigPath) || defined(MagickShareConfigPath)) 00600 if (blob == (void *) NULL) 00601 { 00602 char 00603 *key_value; 00604 00605 /* 00606 Locate file via registry key. 00607 */ 00608 key_value=NTRegistryKeyLookup("ConfigurePath"); 00609 if (key_value != (char *) NULL) 00610 { 00611 (void) FormatMagickString(path,MaxTextExtent,"%s%s%s",key_value, 00612 DirectorySeparator,filename); 00613 if (IsAccessible(path) != MagickFalse) 00614 blob=FileToBlob(path,length,exception); 00615 } 00616 } 00617 #endif 00618 #else 00619 if (blob == (void *) NULL) 00620 { 00621 const char 00622 *p; 00623 00624 p=getenv("MAGICK_HOME"); 00625 if (p != (const char *) NULL) 00626 { 00627 /* 00628 Search MAGICK_HOME. 00629 */ 00630 #if !defined(POSIX) 00631 (void) FormatMagickString(path,MaxTextExtent,"%s%s%s",p, 00632 DirectorySeparator,filename); 00633 #else 00634 (void) FormatMagickString(path,MaxTextExtent,"%s/lib/%s/%s",p, 00635 MagickLibSubdir,filename); 00636 #endif 00637 if (IsAccessible(path) != MagickFalse) 00638 blob=FileToBlob(path,length,exception); 00639 } 00640 p=getenv("HOME"); 00641 if ((blob == (void *) NULL) && (p != (const char *) NULL)) 00642 { 00643 /* 00644 Search $HOME/.magick. 00645 */ 00646 (void) FormatMagickString(path,MaxTextExtent,"%s%s%s%s",p, 00647 *p == '/' ? "/.magick" : "",DirectorySeparator,filename); 00648 if (IsAccessible(path) != MagickFalse) 00649 blob=FileToBlob(path,length,exception); 00650 } 00651 } 00652 if ((blob == (void *) NULL) && (*GetClientPath() != '\0')) 00653 { 00654 #if !defined(POSIX) 00655 (void) FormatMagickString(path,MaxTextExtent,"%s%s%s",GetClientPath(), 00656 DirectorySeparator,filename); 00657 #else 00658 char 00659 prefix[MaxTextExtent]; 00660 00661 /* 00662 Search based on executable directory if directory is known. 00663 */ 00664 (void) CopyMagickString(prefix,GetClientPath(), 00665 MaxTextExtent); 00666 ChopPathComponents(prefix,1); 00667 (void) FormatMagickString(path,MaxTextExtent,"%s/lib/%s/%s",prefix, 00668 MagickLibSubdir,filename); 00669 #endif 00670 if (IsAccessible(path) != MagickFalse) 00671 blob=FileToBlob(path,length,exception); 00672 } 00673 /* 00674 Search current directory. 00675 */ 00676 if ((blob == (void *) NULL) && (IsAccessible(path) != MagickFalse)) 00677 blob=FileToBlob(path,length,exception); 00678 #if defined(__WINDOWS__) 00679 /* 00680 Search Windows registry. 00681 */ 00682 if (blob == (void *) NULL) 00683 blob=NTResourceToBlob(filename); 00684 #endif 00685 #endif 00686 if (blob == (void *) NULL) 00687 (void) ThrowMagickException(exception,GetMagickModule(),ConfigureWarning, 00688 "UnableToOpenConfigureFile",path); 00689 return(blob); 00690 } 00691 00692 /* 00693 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00694 % % 00695 % % 00696 % % 00697 % G e t I m a g e G e o m e t r y % 00698 % % 00699 % % 00700 % % 00701 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00702 % 00703 % GetImageGeometry() returns a region as defined by the geometry string with 00704 % respect to the image and its gravity. 00705 % 00706 % The format of the GetImageGeometry method is: 00707 % 00708 % int GetImageGeometry(Image *image,const char *geometry, 00709 % const unsigned int size_to_fit,RectangeInfo *region_info) 00710 % 00711 % A description of each parameter follows: 00712 % 00713 % o flags: Method GetImageGeometry returns a bitmask that indicates 00714 % which of the four values were located in the geometry string. 00715 % 00716 % o geometry: The geometry (e.g. 100x100+10+10). 00717 % 00718 % o size_to_fit: A value other than 0 means to scale the region so it 00719 % fits within the specified width and height. 00720 % 00721 % o region_info: The region as defined by the geometry string with 00722 % respect to the image and its gravity. 00723 % 00724 % 00725 */ 00726 MagickExport int GetImageGeometry(Image *image,const char *geometry, 00727 const unsigned int size_to_fit,RectangleInfo *region_info) 00728 { 00729 if (image->debug != MagickFalse) 00730 (void) LogMagickEvent(DeprecateEvent,GetMagickModule(),"last use: v5.5.4"); 00731 if (size_to_fit != MagickFalse) 00732 return((int) ParseSizeGeometry(image,geometry,region_info)); 00733 return((int) ParsePageGeometry(image,geometry,region_info)); 00734 } 00735 00736 /* 00737 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00738 % % 00739 % % 00740 % % 00741 % G e t I m a g e L i s t % 00742 % % 00743 % % 00744 % % 00745 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00746 % 00747 % GetImageList() returns an image at the specified position in the list. 00748 % 00749 % The format of the GetImageList method is: 00750 % 00751 % Image *GetImageList(const Image *images,const long offset, 00752 % ExceptionInfo *exception) 00753 % 00754 % A description of each parameter follows: 00755 % 00756 % o images: The image list. 00757 % 00758 % o offset: The position within the list. 00759 % 00760 % o exception: Return any errors or warnings in this structure. 00761 % 00762 % 00763 */ 00764 MagickExport Image *GetImageList(const Image *images,const long offset, 00765 ExceptionInfo *exception) 00766 { 00767 Image 00768 *image; 00769 00770 if (images->debug != MagickFalse) 00771 (void) LogMagickEvent(DeprecateEvent,GetMagickModule(),"last use: v5.5.2"); 00772 image=CloneImage(GetImageFromList(images,(long) offset),0,0,MagickTrue,exception); 00773 return(image); 00774 } 00775 00776 /* 00777 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00778 % % 00779 % % 00780 % % 00781 % G e t I m a g e L i s t I n d e x % 00782 % % 00783 % % 00784 % % 00785 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00786 % 00787 % GetImageListIndex() returns the position in the list of the specified 00788 % image. 00789 % 00790 % The format of the GetImageListIndex method is: 00791 % 00792 % long GetImageListIndex(const Image *images) 00793 % 00794 % A description of each parameter follows: 00795 % 00796 % o images: The image list. 00797 % 00798 % 00799 */ 00800 MagickExport long GetImageListIndex(const Image *images) 00801 { 00802 if (images->debug != MagickFalse) 00803 (void) LogMagickEvent(DeprecateEvent,GetMagickModule(),"last use: v5.5.2"); 00804 return(GetImageIndexInList(images)); 00805 } 00806 00807 /* 00808 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00809 % % 00810 % % 00811 % % 00812 % G e t I m a g e L i s t S i z e % 00813 % % 00814 % % 00815 % % 00816 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00817 % 00818 % GetImageListSize() returns the number of images in the list. 00819 % 00820 % The format of the GetImageListSize method is: 00821 % 00822 % unsigned long GetImageListSize(const Image *images) 00823 % 00824 % A description of each parameter follows: 00825 % 00826 % o images: The image list. 00827 % 00828 % 00829 */ 00830 MagickExport unsigned long GetImageListSize(const Image *images) 00831 { 00832 if (images->debug != MagickFalse) 00833 (void) LogMagickEvent(DeprecateEvent,GetMagickModule(),"last use: v5.5.2"); 00834 return(GetImageListLength(images)); 00835 } 00836 00837 /* 00838 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00839 % % 00840 % % 00841 % % 00842 + G e t M a g i c k G e o m e t r y % 00843 % % 00844 % % 00845 % % 00846 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00847 % 00848 % GetMagickGeometry() is similar to GetGeometry() except the returned 00849 % geometry is modified as determined by the meta characters: %, !, <, >, 00850 % and ~. 00851 % 00852 % The format of the GetMagickGeometry method is: 00853 % 00854 % unsigned int GetMagickGeometry(const char *geometry,long *x,long *y, 00855 % unsigned long *width,unsigned long *height) 00856 % 00857 % A description of each parameter follows: 00858 % 00859 % o geometry: Specifies a character string representing the geometry 00860 % specification. 00861 % 00862 % o x,y: A pointer to an integer. The x and y offset as determined by 00863 % the geometry specification is returned here. 00864 % 00865 % o width,height: A pointer to an unsigned integer. The width and height 00866 % as determined by the geometry specification is returned here. 00867 % 00868 % 00869 */ 00870 MagickExport unsigned int GetMagickGeometry(const char *geometry,long *x, 00871 long *y,unsigned long *width,unsigned long *height) 00872 { 00873 (void) LogMagickEvent(DeprecateEvent,GetMagickModule(),"last use: v5.5.3"); 00874 return(ParseMetaGeometry(geometry,x,y,width,height)); 00875 } 00876 00877 /* 00878 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00879 % % 00880 % % 00881 % % 00882 % G e t N e x t I m a g e % 00883 % % 00884 % % 00885 % % 00886 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00887 % 00888 % GetNextImage() returns the next image in a list. 00889 % 00890 % The format of the GetNextImage method is: 00891 % 00892 % Image *GetNextImage(const Image *images) 00893 % 00894 % A description of each parameter follows: 00895 % 00896 % o images: The image list. 00897 % 00898 % 00899 */ 00900 MagickExport Image *GetNextImage(const Image *images) 00901 { 00902 if (images->debug != MagickFalse) 00903 (void) LogMagickEvent(DeprecateEvent,GetMagickModule(),"last use: v5.5.2"); 00904 return(GetNextImageInList(images)); 00905 } 00906 00907 /* 00908 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00909 % % 00910 % % 00911 % % 00912 % G e t N u m b e r S c e n e s % 00913 % % 00914 % % 00915 % % 00916 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00917 % 00918 % GetNumberScenes() returns the number of images in the list. 00919 % 00920 % The format of the GetNumberScenes method is: 00921 % 00922 % unsigned int GetNumberScenes(const Image *images) 00923 % 00924 % A description of each parameter follows: 00925 % 00926 % o images: The image list. 00927 % 00928 % 00929 */ 00930 MagickExport unsigned int GetNumberScenes(const Image *image) 00931 { 00932 if (image->debug != MagickFalse) 00933 (void) LogMagickEvent(DeprecateEvent,GetMagickModule(),"last use: v5.5.2"); 00934 return((unsigned int) GetImageListLength(image)); 00935 } 00936 00937 /* 00938 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00939 % % 00940 % % 00941 % % 00942 % G e t P r e v i o u s I m a g e % 00943 % % 00944 % % 00945 % % 00946 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00947 % 00948 % GetPreviousImage() returns the previous image in a list. 00949 % 00950 % The format of the GetPreviousImage method is: 00951 % 00952 % Image *GetPreviousImage(const Image *images) 00953 % 00954 % A description of each parameter follows: 00955 % 00956 % o images: The image list. 00957 % 00958 % 00959 */ 00960 MagickExport Image *GetPreviousImage(const Image *images) 00961 { 00962 if (images->debug != MagickFalse) 00963 (void) LogMagickEvent(DeprecateEvent,GetMagickModule(),"last use: v5.5.2"); 00964 return(GetPreviousImageInList(images)); 00965 } 00966 00967 /* 00968 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00969 % % 00970 % % 00971 % % 00972 % I d e n t i t y A f f i n e % 00973 % % 00974 % % 00975 % % 00976 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00977 % 00978 % IdentityAffine() initializes the affine transform to the identity matrix. 00979 % 00980 % The format of the IdentityAffine method is: 00981 % 00982 % IdentityAffine(AffineMatrix *affine) 00983 % 00984 % A description of each parameter follows: 00985 % 00986 % o affine: A pointer the the affine transform of type AffineMatrix. 00987 % 00988 % 00989 */ 00990 MagickExport void IdentityAffine(AffineMatrix *affine) 00991 { 00992 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"..."); 00993 (void) LogMagickEvent(DeprecateEvent,GetMagickModule(),"last use: v5.5.7"); 00994 assert(affine != (AffineMatrix *) NULL); 00995 (void) ResetMagickMemory(affine,0,sizeof(AffineMatrix)); 00996 affine->sx=1.0; 00997 affine->sy=1.0; 00998 } 00999 01000 /* 01001 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 01002 % % 01003 % % 01004 + I s S u b i m a g e % 01005 % % 01006 % % 01007 % % 01008 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 01009 % 01010 % IsSubimage() returns MagickTrue if the geometry is a valid subimage specification 01011 % (e.g. [1], [1-9], [1,7,4]). 01012 % 01013 % The format of the IsSubimage method is: 01014 % 01015 % unsigned int IsSubimage(const char *geometry,const unsigned int pedantic) 01016 % 01017 % A description of each parameter follows: 01018 % 01019 % o geometry: This string is the geometry specification. 01020 % 01021 % o pedantic: A value other than 0 invokes a more restrictive set of 01022 % conditions for a valid specification (e.g. [1], [1-4], [4-1]). 01023 % 01024 % 01025 */ 01026 MagickExport unsigned int IsSubimage(const char *geometry, 01027 const unsigned int pedantic) 01028 { 01029 (void) LogMagickEvent(DeprecateEvent,GetMagickModule(),"last use: v5.5.7"); 01030 if (geometry == (const char *) NULL) 01031 return(False); 01032 if ((strchr(geometry,'x') != (char *) NULL) || 01033 (strchr(geometry,'X') != (char *) NULL)) 01034 return(False); 01035 if ((pedantic != MagickFalse) && (strchr(geometry,',') != (char *) NULL)) 01036 return(False); 01037 return(True); 01038 } 01039 01040 /* 01041 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 01042 % % 01043 % % 01044 % % 01045 % L i b e r a t e M e m o r y % 01046 % % 01047 % % 01048 % % 01049 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 01050 % 01051 % LiberateMemory() frees memory that has already been allocated, and NULL's 01052 % the pointer to it. 01053 % 01054 % The format of the LiberateMemory method is: 01055 % 01056 % void LiberateMemory(void **memory) 01057 % 01058 % A description of each parameter follows: 01059 % 01060 % o memory: A pointer to a block of memory to free for reuse. 01061 % 01062 % 01063 */ 01064 MagickExport void LiberateMemory(void **memory) 01065 { 01066 assert(memory != (void **) NULL); 01067 (void) LogMagickEvent(DeprecateEvent,GetMagickModule(),"last use: v5.5.7"); 01068 if (*memory == (void *) NULL) 01069 return; 01070 free(*memory); 01071 *memory=(void *) NULL; 01072 } 01073 01074 /* 01075 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 01076 % % 01077 % % 01078 % % 01079 % L i b e r a t e S e m a p h o r e I n f o % 01080 % % 01081 % % 01082 % % 01083 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 01084 % 01085 % LiberateSemaphoreInfo() relinquishes a semaphore. 01086 % 01087 % The format of the LiberateSemaphoreInfo method is: 01088 % 01089 % LiberateSemaphoreInfo(void **semaphore_info) 01090 % 01091 % A description of each parameter follows: 01092 % 01093 % o semaphore_info: Specifies a pointer to an SemaphoreInfo structure. 01094 % 01095 % 01096 */ 01097 MagickExport void LiberateSemaphoreInfo(void **semaphore_info) 01098 { 01099 (void) LogMagickEvent(DeprecateEvent,GetMagickModule(),"last use: v5.5.7"); 01100 RelinquishSemaphoreInfo(*semaphore_info); 01101 } 01102 01103 /* 01104 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 01105 % % 01106 % % 01107 % % 01108 % M a g i c k I n c a r n a t e % 01109 % % 01110 % % 01111 % % 01112 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 01113 % 01114 % MagickIncarnate() initializes the ImageMagick environment. 01115 % 01116 % The format of the MagickIncarnate function is: 01117 % 01118 % MagickIncarnate(const char *path) 01119 % 01120 % A description of each parameter follows: 01121 % 01122 % o path: The execution path of the current ImageMagick client. 01123 % 01124 % 01125 */ 01126 01127 MagickExport void MagickIncarnate(const char *path) 01128 { 01129 (void) LogMagickEvent(DeprecateEvent,GetMagickModule(),"last use: v5.5.1"); 01130 InitializeMagick(path); 01131 } 01132 01133 /* 01134 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 01135 % % 01136 % % 01137 % % 01138 % M a g i c k M o n i t o r % 01139 % % 01140 % % 01141 % % 01142 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 01143 % 01144 % MagickMonitor() calls the monitor handler method with a text string that 01145 % describes the task and a measure of completion. The method returns 01146 % MagickTrue on success otherwise MagickFalse if an error is encountered, e.g. 01147 % if there was a user interrupt. 01148 % 01149 % The format of the MagickMonitor method is: 01150 % 01151 % MagickBooleanType MagickMonitor(const char *text, 01152 % const MagickOffsetType offset,const MagickSizeType span, 01153 % void *client_data) 01154 % 01155 % A description of each parameter follows: 01156 % 01157 % o offset: The position relative to the span parameter which represents 01158 % how much progress has been made toward completing a task. 01159 % 01160 % o span: The span relative to completing a task. 01161 % 01162 % o client_data: The client data. 01163 % 01164 */ 01165 MagickExport MagickBooleanType MagickMonitor(const char *text, 01166 const MagickOffsetType offset,const MagickSizeType span, 01167 void *client_data) 01168 { 01169 ExceptionInfo 01170 exception; 01171 01172 MagickBooleanType 01173 status; 01174 01175 assert(text != (const char *) NULL); 01176 (void) LogMagickEvent(TraceEvent,GetMagickModule(),text); 01177 ProcessPendingEvents(text); 01178 status=MagickTrue; 01179 GetExceptionInfo(&exception); 01180 if (monitor_handler != (MonitorHandler) NULL) 01181 status=(*monitor_handler)(text,offset,span,&exception); 01182 DestroyExceptionInfo(&exception); 01183 return(status); 01184 } 01185 01186 /* 01187 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 01188 % % 01189 % % 01190 % O p a q u e I m a g e % 01191 % % 01192 % % 01193 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 01194 % 01195 % OpaqueImage() changes any pixel that matches color with the color 01196 % defined by fill. 01197 % 01198 % By default color must match a particular pixel color exactly. However, 01199 % in many cases two colors may differ by a small amount. Fuzz defines 01200 % how much tolerance is acceptable to consider two colors as the same. 01201 % For example, set fuzz to 10 and the color red at intensities of 100 and 01202 % 102 respectively are now interpreted as the same color. 01203 % 01204 % The format of the OpaqueImage method is: 01205 % 01206 % MagickBooleanType OpaqueImage(Image *image, 01207 % const PixelPacket *target,const PixelPacket fill) 01208 % 01209 % A description of each parameter follows: 01210 % 01211 % o image: The image. 01212 % 01213 % o target: The RGB value of the target color. 01214 % 01215 % o fill: The replacement color. 01216 % 01217 % 01218 */ 01219 MagickExport MagickBooleanType OpaqueImage(Image *image, 01220 const PixelPacket target,const PixelPacket fill) 01221 { 01222 #define OpaqueImageTag "Opaque/Image" 01223 01224 long 01225 y; 01226 01227 MagickBooleanType 01228 status; 01229 01230 register long 01231 x; 01232 01233 register PixelPacket 01234 *q; 01235 01236 register long 01237 i; 01238 01239 /* 01240 Make image color opaque. 01241 */ 01242 assert(image != (Image *) NULL); 01243 assert(image->signature == MagickSignature); 01244 (void) LogMagickEvent(DeprecateEvent,GetMagickModule(),"last use: v6.1.0"); 01245 if (image->debug != MagickFalse) 01246 (void) LogMagickEvent(TraceEvent,GetMagickModule(),image->filename); 01247 switch (image->storage_class) 01248 { 01249 case DirectClass: 01250 default: 01251 { 01252 /* 01253 Make DirectClass image opaque. 01254 */ 01255 for (y=0; y < (long) image->rows; y++) 01256 { 01257 q=GetImagePixels(image,0,y,image->columns,1); 01258 if (q == (PixelPacket *) NULL) 01259 break; 01260 for (x=0; x < (long) image->columns; x++) 01261 { 01262 if (FuzzyColorCompare(image,q,&target) != MagickFalse) 01263 *q=fill; 01264 q++; 01265 } 01266 if (SyncImagePixels(image) == MagickFalse) 01267 break; 01268 if ((image->progress_monitor != (MagickProgressMonitor) NULL) && 01269 (QuantumTick(y,image->rows) != MagickFalse)) 01270 { 01271 status=image->progress_monitor(OpaqueImageTag,y,image->rows, 01272 image->client_data); 01273 if (status == MagickFalse) 01274 break; 01275 } 01276 } 01277 break; 01278 } 01279 case PseudoClass: 01280 { 01281 /* 01282 Make PseudoClass image opaque. 01283 */ 01284 for (i=0; i < (long) image->colors; i++) 01285 { 01286 if (FuzzyColorCompare(image,&image->colormap[i],&target) != MagickFalse) 01287 image->colormap[i]=fill; 01288 } 01289 if (fill.opacity != OpaqueOpacity) 01290 { 01291 for (y=0; y < (long) image->rows; y++) 01292 { 01293 q=GetImagePixels(image,0,y,image->columns,1); 01294 if (q == (PixelPacket *) NULL) 01295 break; 01296 for (x=0; x < (long) image->columns; x++) 01297 { 01298 if (FuzzyColorCompare(image,q,&target) != MagickFalse) 01299 q->opacity=fill.opacity; 01300 q++; 01301 } 01302 if (SyncImagePixels(image) == MagickFalse) 01303 break; 01304 } 01305 } 01306 (void) SyncImage(image); 01307 break; 01308 } 01309 } 01310 if (fill.opacity != OpaqueOpacity) 01311 image->matte=MagickTrue; 01312 return(MagickTrue); 01313 } 01314 01315 /* 01316 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 01317 % % 01318 % % 01319 % % 01320 + P a r s e I m a g e G e o m e t r y % 01321 % % 01322 % % 01323 % % 01324 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 01325 % 01326 % ParseImageGeometry() is similar to GetGeometry() except the returned 01327 % geometry is modified as determined by the meta characters: %, !, <, 01328 % and >. 01329 % 01330 % The format of the ParseImageGeometry method is: 01331 % 01332 % int ParseImageGeometry(char *geometry,long *x,long *y, 01333 % unsigned long *width,unsigned long *height) 01334 % 01335 % A description of each parameter follows: 01336 % 01337 % o flags: Method ParseImageGeometry returns a bitmask that indicates 01338 % which of the four values were located in the geometry string. 01339 % 01340 % o image_geometry: Specifies a character string representing the geometry 01341 % specification. 01342 % 01343 % o x,y: A pointer to an integer. The x and y offset as determined by 01344 % the geometry specification is returned here. 01345 % 01346 % o width,height: A pointer to an unsigned integer. The width and height 01347 % as determined by the geometry specification is returned here. 01348 % 01349 % 01350 */ 01351 MagickExport int ParseImageGeometry(const char *geometry,long *x,long *y, 01352 unsigned long *width,unsigned long *height) 01353 { 01354 (void) LogMagickEvent(DeprecateEvent,GetMagickModule(),"last use: v5.5.1"); 01355 return((int) ParseMetaGeometry(geometry,x,y,width,height)); 01356 } 01357 01358 /* 01359 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 01360 % % 01361 % % 01362 % % 01363 % P o p I m a g e L i s t % 01364 % % 01365 % % 01366 % % 01367 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 01368 % 01369 % PopImageList() removes the last image in the list. 01370 % 01371 % The format of the PopImageList method is: 01372 % 01373 % Image *PopImageList(Image **images) 01374 % 01375 % A description of each parameter follows: 01376 % 01377 % o images: The image list. 01378 % 01379 % 01380 */ 01381 MagickExport Image *