00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
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
00073
00074
static MonitorHandler
00075 monitor_handler = (
MonitorHandler) NULL;
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
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
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
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
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
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
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
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
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260
00261
00262
00263
00264
00265
00266
00267
00268
00269
00270
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
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
00309
00310
00311
00312
00313
00314
00315
00316
00317
00318
00319
00320
00321
00322
00323
00324
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
00353
00354
00355
00356
00357
00358
00359
00360
00361
00362
00363
00364
00365
00366
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
00383
00384
00385
00386
00387
00388
00389
00390
00391
00392
00393
00394
00395
00396
00397
00398
00399
00400
00401
00402
00403
00404
00405
00406
00407
00408
00409
00410
00411
00412
00413
00414
00415
00416
00417
00418
00419
00420
00421
00422
00423
00424
00425
00426
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
00450
00451
00452
00453
00454
00455
00456
00457
00458
00459
00460
00461
00462
00463
00464
00465
00466
00467
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
00492
00493
00494
00495
00496
00497
00498
00499
00500
00501
00502
00503
00504
00505
00506
00507
00508
00509
00510
00511
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
00548
00549
00550
00551
00552
00553
00554
00555
00556
00557
00558
00559
00560
00561
00562
00563
00564
00565
00566
00567
00568
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
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
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
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
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
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
00675
00676
if ((blob == (
void *) NULL) && (
IsAccessible(path) !=
MagickFalse))
00677 blob=
FileToBlob(path,length,exception);
00678
#if defined(__WINDOWS__)
00679
00680
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
00698
00699
00700
00701
00702
00703
00704
00705
00706
00707
00708
00709
00710
00711
00712
00713
00714
00715
00716
00717
00718
00719
00720
00721
00722
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
00742
00743
00744
00745
00746
00747
00748
00749
00750
00751
00752
00753
00754
00755
00756
00757
00758
00759
00760
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
00782
00783
00784
00785
00786
00787
00788
00789
00790
00791
00792
00793
00794
00795
00796
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
00813
00814
00815
00816
00817
00818
00819
00820
00821
00822
00823
00824
00825
00826
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
00843
00844
00845
00846
00847
00848
00849
00850
00851
00852
00853
00854
00855
00856
00857
00858
00859
00860
00861
00862
00863
00864
00865
00866
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
00883
00884
00885
00886
00887
00888
00889
00890
00891
00892
00893
00894
00895
00896
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
00913
00914
00915
00916
00917
00918
00919
00920
00921
00922
00923
00924
00925
00926
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
00943
00944
00945
00946
00947
00948
00949
00950
00951
00952
00953
00954
00955
00956
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
00973
00974
00975
00976
00977
00978
00979
00980
00981
00982
00983
00984
00985
00986
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
01005
01006
01007
01008
01009
01010
01011
01012
01013
01014
01015
01016
01017
01018
01019
01020
01021
01022
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
01046
01047
01048
01049
01050
01051
01052
01053
01054
01055
01056
01057
01058
01059
01060
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
01080
01081
01082
01083
01084
01085
01086
01087
01088
01089
01090
01091
01092
01093
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
01109
01110
01111
01112
01113
01114
01115
01116
01117
01118
01119
01120
01121
01122
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
01139
01140
01141
01142
01143
01144
01145
01146
01147
01148
01149
01150
01151
01152
01153
01154
01155
01156
01157
01158
01159
01160
01161
01162
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
01191
01192
01193
01194
01195
01196
01197
01198
01199
01200
01201
01202
01203
01204
01205
01206
01207
01208
01209
01210
01211
01212
01213
01214
01215
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
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
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
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
01321
01322
01323
01324
01325
01326
01327
01328
01329
01330
01331
01332
01333
01334
01335
01336
01337
01338
01339
01340
01341
01342
01343
01344
01345
01346
01347
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
01364
01365
01366
01367
01368
01369
01370
01371
01372
01373
01374
01375
01376
01377
01378
01379
01380
01381 MagickExport Image *