62
62
#include "magick/enhance.h"
63
63
#include "magick/exception.h"
64
64
#include "magick/exception-private.h"
65
#include "magick/fx.h"
66
65
#include "magick/geometry.h"
67
66
#include "magick/identify.h"
68
67
#include "magick/image.h"
73
72
#include "magick/magick.h"
74
73
#include "magick/monitor.h"
75
74
#include "magick/monitor-private.h"
76
#include "magick/morphology.h"
77
75
#include "magick/paint.h"
78
76
#include "magick/pixel.h"
79
77
#include "magick/pixel-private.h"
110
108
% AcquireCacheViewIndexes() returns the indexes associated with the specified
113
% Deprecated, replace with:
115
% GetCacheViewVirtualIndexQueue(cache_view);
117
111
% The format of the AcquireCacheViewIndexes method is:
119
113
% const IndexPacket *AcquireCacheViewIndexes(const CacheView *cache_view)
144
138
% as defined by the geometry parameters. A pointer to the pixels is returned
145
139
% if the pixels are transferred, otherwise a NULL is returned.
147
% Deprecated, replace with:
149
% GetCacheViewVirtualPixels(cache_view,x,y,columns,rows,exception);
151
141
% The format of the AcquireCacheViewPixels method is:
153
143
% const PixelPacket *AcquireCacheViewPixels(const CacheView *cache_view,
154
% const ssize_t x,const ssize_t y,const size_t columns,
155
% const size_t rows,ExceptionInfo *exception)
144
% const long x,const long y,const unsigned long columns,
145
% const unsigned long rows,ExceptionInfo *exception)
157
147
% A description of each parameter follows:
167
157
MagickExport const PixelPacket *AcquireCacheViewPixels(
168
const CacheView *cache_view,const ssize_t x,const ssize_t y,
169
const size_t columns,const size_t rows,ExceptionInfo *exception)
158
const CacheView *cache_view,const long x,const long y,
159
const unsigned long columns,const unsigned long rows,ExceptionInfo *exception)
171
161
return(GetCacheViewVirtualPixels(cache_view,x,y,columns,rows,exception));
202
192
% thread-safe. In a threaded environment, use GetCacheViewVirtualPixels() or
203
193
% GetCacheViewAuthenticPixels() instead.
205
% Deprecated, replace with:
207
% GetVirtualPixels(image,x,y,columns,rows,exception);
209
195
% The format of the AcquireImagePixels() method is:
211
% const PixelPacket *AcquireImagePixels(const Image *image,const ssize_t x,
212
% const ssize_t y,const size_t columns,const size_t rows,
197
% const PixelPacket *AcquireImagePixels(const Image *image,const long x,
198
% const long y,const unsigned long columns,const unsigned long rows,
213
199
% ExceptionInfo *exception)
215
201
% A description of each parameter follows:
225
211
MagickExport const PixelPacket *AcquireImagePixels(const Image *image,
226
const ssize_t x,const ssize_t y,const size_t columns,
227
const size_t rows,ExceptionInfo *exception)
212
const long x,const long y,const unsigned long columns,
213
const unsigned long rows,ExceptionInfo *exception)
229
215
return(GetVirtualPixels(image,x,y,columns,rows,exception));
241
227
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
243
229
% AcquireIndexes() returns the black channel or the colormap indexes
244
% associated with the last call to QueueAuthenticPixels() or
245
% GetVirtualPixels(). NULL is returned if the black channel or colormap
246
% indexes are not available.
248
% Deprecated, replace with:
250
% GetVirtualIndexQueue(image);
230
% associated with the last call to QueueAuthenticPixels() or GetVirtualPixels().
231
% NULL is returned if the black channel or colormap indexes are not available.
252
233
% The format of the AcquireIndexes() method is:
315
296
% location. The image background color is returned if an error occurs. If
316
297
% you plan to modify the pixel, use GetOneCacheViewAuthenticPixel() instead.
318
% Deprecated, replace with:
320
% GetOneCacheViewVirtualPixel(cache_view,x,y,pixel,exception);
322
299
% The format of the AcquireOneCacheViewPixel method is:
324
301
% MagickBooleanType AcquireOneCacheViewPixel(const CacheView *cache_view,
325
% const ssize_t x,const ssize_t y,PixelPacket *pixel,ExceptionInfo *exception)
302
% const long x,const long y,PixelPacket *pixel,ExceptionInfo *exception)
327
304
% A description of each parameter follows:
338
315
MagickExport MagickBooleanType AcquireOneCacheViewPixel(
339
const CacheView *cache_view,const ssize_t x,const ssize_t y,PixelPacket *pixel,
316
const CacheView *cache_view,const long x,const long y,PixelPacket *pixel,
340
317
ExceptionInfo *exception)
342
319
return(GetOneCacheViewVirtualPixel(cache_view,x,y,pixel,exception));
357
334
% (x,y) location. The image background color is returned if an error occurs.
358
335
% If you plan to modify the pixel, use GetOneCacheViewAuthenticPixel() instead.
360
% Deprecated, replace with:
362
% GetOneCacheViewVirtualMethodPixel(cache_view,virtual_pixel_method,
363
% x,y,pixel,exception);
365
337
% The format of the AcquireOneCacheViewPixel method is:
367
339
% MagickBooleanType AcquireOneCacheViewVirtualPixel(
368
340
% const CacheView *cache_view,
369
% const VirtualPixelMethod virtual_pixel_method,const ssize_t x,
370
% const ssize_t y,PixelPacket *pixel,ExceptionInfo *exception)
341
% const VirtualPixelMethod virtual_pixel_method,const long x,
342
% const long y,PixelPacket *pixel,ExceptionInfo *exception)
372
344
% A description of each parameter follows:
385
357
MagickExport MagickBooleanType AcquireOneCacheViewVirtualPixel(
386
358
const CacheView *cache_view,const VirtualPixelMethod virtual_pixel_method,
387
const ssize_t x,const ssize_t y,PixelPacket *pixel,ExceptionInfo *exception)
359
const long x,const long y,PixelPacket *pixel,ExceptionInfo *exception)
389
361
MagickBooleanType
409
381
% location. The image background color is returned if an error occurs. If
410
382
% you plan to modify the pixel, use GetOnePixel() instead.
412
% Deprecated, replace with:
414
% MagickPixelPacket pixel;
415
% GetOneVirtualMagickPixel(image,x,y,&pixel,exception);
417
384
% The format of the AcquireOneMagickPixel() method is:
419
% MagickPixelPacket AcquireOneMagickPixel(const Image image,const ssize_t x,
420
% const ssize_t y,ExceptionInfo exception)
386
% MagickPixelPacket AcquireOneMagickPixel(const Image image,const long x,
387
% const long y,ExceptionInfo exception)
422
389
% A description of each parameter follows:
431
398
MagickExport MagickPixelPacket AcquireOneMagickPixel(const Image *image,
432
const ssize_t x,const ssize_t y,ExceptionInfo *exception)
399
const long x,const long y,ExceptionInfo *exception)
434
401
MagickPixelPacket
453
420
% The image background color is returned if an error occurs. If you plan to
454
421
% modify the pixel, use GetOnePixel() instead.
456
% Deprecated, replace with:
459
% GetOneVirtualPixel(image,x,y,&pixel,exception);
461
423
% The format of the AcquireOnePixel() method is:
463
% PixelPacket AcquireOnePixel(const Image image,const ssize_t x,
464
% const ssize_t y,ExceptionInfo exception)
425
% PixelPacket AcquireOnePixel(const Image image,const long x,
426
% const long y,ExceptionInfo exception)
466
428
% A description of each parameter follows:
472
434
% o exception: return any errors or warnings in this structure.
475
MagickExport PixelPacket AcquireOnePixel(const Image *image,const ssize_t x,
476
const ssize_t y,ExceptionInfo *exception)
437
MagickExport PixelPacket AcquireOnePixel(const Image *image,const long x,
438
const long y,ExceptionInfo *exception)
498
460
% is returned if an error occurs. If you plan to modify the pixel, use
499
461
% GetOnePixel() instead.
501
% Deprecated, replace with:
504
% GetOneVirtualMethodPixel(image,virtual_pixel_method,x,y,&pixel,exception);
506
463
% The format of the AcquireOneVirtualPixel() method is:
508
465
% PixelPacket AcquireOneVirtualPixel(const Image image,
509
% const VirtualPixelMethod virtual_pixel_method,const ssize_t x,
510
% const ssize_t y,ExceptionInfo exception)
466
% const VirtualPixelMethod virtual_pixel_method,const long x,
467
% const long y,ExceptionInfo exception)
512
469
% A description of each parameter follows:
523
480
MagickExport PixelPacket AcquireOneVirtualPixel(const Image *image,
524
const VirtualPixelMethod virtual_pixel_method,const ssize_t x,const ssize_t y,
481
const VirtualPixelMethod virtual_pixel_method,const long x,const long y,
525
482
ExceptionInfo *exception)
546
503
% AcquirePixels() returns the pixels associated with the last call to
547
504
% QueueAuthenticPixels() or GetVirtualPixels().
549
% Deprecated, replace with:
551
% GetVirtualPixelQueue(image);
553
506
% The format of the AcquirePixels() method is:
555
508
% const PixelPacket *AcquirePixels(const Image image)
578
531
% AffinityImage() replaces the colors of an image with the closest color from
579
532
% a reference image.
581
% Deprecated, replace with:
583
% RemapImage(quantize_info,image,affinity_image);
585
534
% The format of the AffinityImage method is:
587
536
% MagickBooleanType AffinityImage(const QuantizeInfo *quantize_info,
616
565
% AffinityImages() replaces the colors of a sequence of images with the
617
566
% closest color from a reference image.
619
% Deprecated, replace with:
621
% RemapImages(quantize_info,images,affinity_image);
623
568
% The format of the AffinityImage method is:
625
570
% MagickBooleanType AffinityImages(const QuantizeInfo *quantize_info,
654
599
% AllocateImage() returns a pointer to an image structure initialized to
655
600
% default values.
657
% Deprecated, replace with:
659
% AcquireImage(image_info);
661
602
% The format of the AllocateImage method is:
663
604
% Image *AllocateImage(const ImageInfo *image_info)
690
631
% it is replaced. AllocateImageColormap() returns MagickTrue if successful,
691
632
% otherwise MagickFalse if there is not enough memory.
693
% Deprecated, replace with:
695
% AcquireImageColormap(image,colors);
697
634
% The format of the AllocateImageColormap method is:
699
636
% MagickBooleanType AllocateImageColormap(Image *image,
700
% const size_t colors)
637
% const unsigned long colors)
702
639
% A description of each parameter follows:
727
664
% default values. The next member of image points to the newly allocated
728
665
% image. If there is a memory shortage, next is assigned NULL.
730
% Deprecated, replace with:
732
% AcquireNextImage(image_info,image);
734
667
% The format of the AllocateNextImage method is:
736
669
% void AllocateNextImage(const ImageInfo *image_info,Image *image)
809
742
% image averaged. On failure, a NULL image is returned and exception
810
743
% describes the reason for the failure.
812
% Deprecated, replace with:
814
% EvaluateImages(images,MeanEvaluateOperator,exception);
816
745
% The format of the AverageImages method is:
818
747
% Image *AverageImages(Image *images,ExceptionInfo *exception)
843
772
% Extract a channel from the image. A channel is a particular color component
844
773
% of each pixel in the image.
846
% Deprecated, replace with:
848
% SeparateImageChannel(image,channel);
850
775
% The format of the ChannelImage method is:
852
777
% unsigned int ChannelImage(Image *image,const ChannelType channel)
938
863
% ClipPathImage() sets the image clip mask based any clipping path information
941
% Deprecated, replace with:
943
% ClipImagePath(image,pathname,inside);
945
866
% The format of the ClipImage method is:
947
868
% MagickBooleanType ClipPathImage(Image *image,const char *pathname,
978
899
% CloneImageAttributes() clones one or more image attributes.
980
% Deprecated, replace with:
982
% CloneImageProperties(image,clone_image);
984
901
% The format of the CloneImageAttributes method is:
986
903
% MagickBooleanType CloneImageAttributes(Image *image,
1071
988
% CloseCacheView() closes the specified view returned by a previous call to
1072
989
% OpenCacheView().
1074
% Deprecated, replace with:
1076
% DestroyCacheView(view_info);
1078
991
% The format of the CloseCacheView method is:
1080
993
% CacheView *CloseCacheView(CacheView *view_info)
1117
1030
% MagickBooleanType ColorFloodfillImage(Image *image,
1118
1031
% const DrawInfo *draw_info,const PixelPacket target,
1119
% const ssize_t x_offset,const ssize_t y_offset,const PaintMethod method)
1032
% const long x_offset,const long y_offset,const PaintMethod method)
1121
1034
% A description of each parameter follows:
1139
1052
ThrowBinaryException(DrawError,"SegmentStackOverflow",image->filename) \
1142
if ((((up)+(delta)) >= 0) && (((up)+(delta)) < (ssize_t) image->rows)) \
1055
if ((((up)+(delta)) >= 0) && (((up)+(delta)) < (long) image->rows)) \
1144
1057
s->x1=(double) (left); \
1145
1058
s->y1=(double) (up); \
1153
1066
MagickExport MagickBooleanType ColorFloodfillImage(Image *image,
1154
const DrawInfo *draw_info,const PixelPacket target,const ssize_t x_offset,
1155
const ssize_t y_offset,const PaintMethod method)
1067
const DrawInfo *draw_info,const PixelPacket target,const long x_offset,
1068
const long y_offset,const PaintMethod method)
1158
1071
*floodplane_image;
1186
1099
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
1187
1100
assert(draw_info != (DrawInfo *) NULL);
1188
1101
assert(draw_info->signature == MagickSignature);
1189
if ((x_offset < 0) || (x_offset >= (ssize_t) image->columns))
1102
if ((x_offset < 0) || (x_offset >= (long) image->columns))
1190
1103
return(MagickFalse);
1191
if ((y_offset < 0) || (y_offset >= (ssize_t) image->rows))
1104
if ((y_offset < 0) || (y_offset >= (long) image->rows))
1192
1105
return(MagickFalse);
1193
1106
if (SetImageStorageClass(image,DirectClass) == MagickFalse)
1194
1107
return(MagickFalse);
1234
1147
Pop segment off stack.
1239
offset=(ssize_t) s->y2;
1240
y=(ssize_t) s->y1+offset;
1152
offset=(long) s->y2;
1153
y=(long) s->y1+offset;
1242
1155
Recolor neighboring pixels.
1244
p=GetVirtualPixels(image,0,y,(size_t) (x1+1),1,&image->exception);
1245
q=GetAuthenticPixels(floodplane_image,0,y,(size_t) (x1+1),1,
1157
p=GetVirtualPixels(image,0,y,(unsigned long) (x1+1),1,&image->exception);
1158
q=GetAuthenticPixels(floodplane_image,0,y,(unsigned long) (x1+1),1,
1246
1159
&image->exception);
1247
1160
if ((p == (const PixelPacket *) NULL) || (q == (PixelPacket *) NULL))
1279
1192
if (skip == MagickFalse)
1281
if (x < (ssize_t) image->columns)
1194
if (x < (long) image->columns)
1283
1196
p=GetVirtualPixels(image,x,y,image->columns-x,1,
1284
1197
&image->exception);
1287
1200
if ((p == (const PixelPacket *) NULL) ||
1288
1201
(q == (PixelPacket *) NULL))
1290
for ( ; x < (ssize_t) image->columns; x++)
1203
for ( ; x < (long) image->columns; x++)
1292
1205
if (q->opacity == (Quantum) TransparentOpacity)
1317
p=GetVirtualPixels(image,x,y,(size_t) (x2-x+1),1,
1230
p=GetVirtualPixels(image,x,y,(unsigned long) (x2-x+1),1,
1318
1231
&image->exception);
1319
q=GetAuthenticPixels(floodplane_image,x,y,(size_t) (x2-x+1),1,
1232
q=GetAuthenticPixels(floodplane_image,x,y,(unsigned long) (x2-x+1),1,
1320
1233
&image->exception);
1321
1234
if ((p == (const PixelPacket *) NULL) || (q == (PixelPacket *) NULL))
1358
1271
q=GetAuthenticPixels(image,0,y,image->columns,1,&image->exception);
1359
1272
if ((p == (const PixelPacket *) NULL) || (q == (PixelPacket *) NULL))
1361
for (x=0; x < (ssize_t) image->columns; x++)
1274
for (x=0; x < (long) image->columns; x++)
1363
1276
if (p->opacity != OpaqueOpacity)
1375
1288
segment_stack=(SegmentInfo *) RelinquishMagickMemory(segment_stack);
1376
1289
floodplane_image=DestroyImage(floodplane_image);
1377
return(y == (ssize_t) image->rows ? MagickTrue : MagickFalse);
1290
return(y == (long) image->rows ? MagickTrue : MagickFalse);
1391
1304
% DeleteImageAttribute() deletes an attribute from the image.
1393
% Deprecated, replace with:
1395
% DeleteImageProperty(image,key);
1397
1306
% The format of the DeleteImageAttribute method is:
1399
1308
% MagickBooleanType DeleteImageAttribute(Image *image,const char *key)
1427
1336
% The format of the DeleteImageList method is:
1429
% unsigned int DeleteImageList(Image *images,const ssize_t offset)
1338
% unsigned int DeleteImageList(Image *images,const long offset)
1431
1340
% A description of each parameter follows:
1435
1344
% o offset: the position within the list.
1438
MagickExport unsigned int DeleteImageList(Image *images,const ssize_t offset)
1347
MagickExport unsigned int DeleteImageList(Image *images,const long offset)
1443
1352
if (images->debug != MagickFalse)
1469
1378
% It returns MagickTrue if the entry is deleted otherwise MagickFalse if no
1470
1379
% entry is found in the registry that matches the id.
1472
% Deprecated, replace with:
1474
% char key[MaxTextExtent];
1475
% FormatMagickString(key,MaxTextExtent,"%ld\n",id);
1476
% DeleteImageRegistry(key);
1478
1381
% The format of the DeleteMagickRegistry method is:
1480
% MagickBooleanType DeleteMagickRegistry(const ssize_t id)
1383
% MagickBooleanType DeleteMagickRegistry(const long id)
1482
1385
% A description of each parameter follows:
1484
1387
% o id: the registry id.
1487
MagickExport MagickBooleanType DeleteMagickRegistry(const ssize_t id)
1390
MagickExport MagickBooleanType DeleteMagickRegistry(const long id)
1490
1393
key[MaxTextExtent];
1492
(void) FormatMagickString(key,MaxTextExtent,"%.20g\n",(double) id);
1395
(void) FormatMagickString(key,MaxTextExtent,"%ld\n",id);
1493
1396
return(DeleteImageRegistry(key));
1507
1410
% DestroyMagickRegistry() deallocates memory associated the magick registry.
1509
% Deprecated, replace with:
1511
% RegistryComponentTerminus();
1513
1412
% The format of the DestroyMagickRegistry method is:
1515
1414
% void DestroyMagickRegistry(void)
1534
1433
% DescribeImage() describes an image by printing its attributes to the file.
1535
1434
% Attributes include the image width, height, size, and others.
1537
% Deprecated, replace with:
1539
% IdentifyImage(image,file,verbose);
1541
1436
% The format of the DescribeImage method is:
1543
1438
% MagickBooleanType DescribeImage(Image *image,FILE *file,
1607
1502
% DestroyImages() destroys an image list.
1609
% Deprecated, replace with:
1611
% DestroyImageList(image);
1613
1504
% The format of the DestroyImages method is:
1615
1506
% void DestroyImages(Image *image)
1669
1556
% DispatchImage() extracts pixel data from an image and returns it to you.
1670
1557
% The method returns MagickFalse on success otherwise MagickTrue if an error is
1671
% encountered. The data is returned as char, short int, int, ssize_t, float,
1558
% encountered. The data is returned as char, short int, int, long, float,
1672
1559
% or double in the order specified by map.
1674
1561
% Suppose you want to extract the first scanline of a 640x480 image as
1677
1564
% DispatchImage(image,0,0,640,1,"RGB",CharPixel,pixels,exception);
1679
% Deprecated, replace with:
1681
% ExportImagePixels(image,x_offset,y_offset,columns,rows,map,type,pixels,
1684
1566
% The format of the DispatchImage method is:
1686
% unsigned int DispatchImage(const Image *image,const ssize_t x_offset,
1687
% const ssize_t y_offset,const size_t columns,
1688
% const size_t rows,const char *map,const StorageType type,
1568
% unsigned int DispatchImage(const Image *image,const long x_offset,
1569
% const long y_offset,const unsigned long columns,
1570
% const unsigned long rows,const char *map,const StorageType type,
1689
1571
% void *pixels,ExceptionInfo *exception)
1691
1573
% A description of each parameter follows:
1712
1594
% o exception: return any errors or warnings in this structure.
1715
MagickExport unsigned int DispatchImage(const Image *image,const ssize_t x_offset,
1716
const ssize_t y_offset,const size_t columns,const size_t rows,
1597
MagickExport unsigned int DispatchImage(const Image *image,const long x_offset,
1598
const long y_offset,const unsigned long columns,const unsigned long rows,
1717
1599
const char *map,const StorageType type,void *pixels,ExceptionInfo *exception)
1743
1625
% The format of the ExtractSubimageFromImageImage method is:
1745
% Image *ExtractSubimageFromImage(const Image *image,
1746
% const Image *reference,ExceptionInfo *exception)
1627
% Image *ExtractSubimageFromImage(const Image *image,const Image *reference,
1628
% ExceptionInfo *exception)
1748
1630
% A description of each parameter follows:
1758
1640
static double GetSimilarityMetric(const Image *image,const Image *reference,
1759
const ssize_t x_offset,const ssize_t y_offset,const double similarity_threshold,
1641
const long x_offset,const long y_offset,const double similarity_threshold,
1760
1642
ExceptionInfo *exception)
1764
1646
*reference_view;
1785
1667
image_view=AcquireCacheView(image);
1786
1668
reference_view=AcquireCacheView(reference);
1787
for (y=0; y < (ssize_t) reference->rows; y++)
1669
for (y=0; y < (long) reference->rows; y++)
1789
1671
register const IndexPacket
1806
1688
indexes=GetCacheViewVirtualIndexQueue(image_view);
1807
1689
reference_indexes=GetCacheViewVirtualIndexQueue(reference_view);
1808
for (x=0; x < (ssize_t) reference->columns; x++)
1690
for (x=0; x < (long) reference->columns; x++)
1862
1744
#if defined(MAGICKCORE_OPENMP_SUPPORT)
1863
1745
#pragma omp parallel for schedule(dynamic,4)
1865
for (y=0; y < (ssize_t) (image->rows-reference->rows); y++)
1747
for (y=0; y < (long) (image->rows-reference->rows); y++)
1873
for (x=0; x < (ssize_t) (image->columns-reference->columns); x++)
1755
for (x=0; x < (long) (image->columns-reference->columns); x++)
1875
1757
similarity=GetSimilarityMetric(image,reference,x,y,similarity_threshold,
1904
1786
% FlattenImages() Obsolete Function: Use MergeImageLayers() instead.
1906
% Deprecated, replace with:
1908
% MergeImageLayers(image,FlattenLayer,exception);
1910
1788
% The format of the FlattenImage method is:
1912
1790
% Image *FlattenImage(Image *image,ExceptionInfo *exception)
2149
2027
% method is used by MatteFloodFill() and other algorithms which compare
2150
2028
% two opacity values.
2152
% Deprecated, replace with:
2154
% IsOpacitySimilar(image,p,q);
2156
2030
% The format of the FuzzyOpacityCompare method is:
2158
2032
% void FuzzyOpacityCompare(const Image *image,const PixelPacket *p,
2230
2104
blob=FileToBlob(path,~0,length,exception);
2233
#if defined(MAGICKCORE_WINDOWS_SUPPORT) && !(defined(MAGICKCORE_CONFIGURE_PATH) || defined(MAGICKCORE_SHARE_CONFIGURE_PATH))
2107
#if defined(__WINDOWS__) && !(defined(MAGICKCORE_CONFIGURE_PATH) || defined(MAGICKCORE_SHARE_CONFIGURE_PATH))
2234
2108
if (blob == (void *) NULL)
2314
2188
if ((blob == (void *) NULL) && (IsPathAccessible(path) != MagickFalse))
2315
2189
blob=FileToBlob(path,~0,length,exception);
2316
#if defined(MAGICKCORE_WINDOWS_SUPPORT)
2190
#if defined(__WINDOWS__)
2318
2192
Search Windows registry.
2342
2216
% defined by the geometry parameters. A pointer to the pixels is returned if
2343
2217
% the pixels are transferred, otherwise a NULL is returned.
2345
% Deprecated, replace with:
2347
% GetCacheViewAuthenticPixels(cache_view,x,y,columns,rows,
2348
% GetCacheViewException(cache_view));
2350
2219
% The format of the GetCacheView method is:
2352
% PixelPacket *GetCacheView(CacheView *cache_view,const ssize_t x,
2353
% const ssize_t y,const size_t columns,const size_t rows)
2221
% PixelPacket *GetCacheView(CacheView *cache_view,const long x,
2222
% const long y,const unsigned long columns,const unsigned long rows)
2355
2224
% A description of each parameter follows:
2363
MagickExport PixelPacket *GetCacheView(CacheView *cache_view,const ssize_t x,
2364
const ssize_t y,const size_t columns,const size_t rows)
2232
MagickExport PixelPacket *GetCacheView(CacheView *cache_view,const long x,
2233
const long y,const unsigned long columns,const unsigned long rows)
2385
2254
% GetCacheViewIndexes() returns the indexes associated with the specified
2388
% Deprecated, replace with:
2390
% GetCacheViewAuthenticIndexQueue(cache_view);
2392
2257
% The format of the GetCacheViewIndexes method is:
2394
2259
% IndexPacket *GetCacheViewIndexes(CacheView *cache_view)
2418
2283
% defined by the geometry parameters. A pointer to the pixels is returned if
2419
2284
% the pixels are transferred, otherwise a NULL is returned.
2421
% Deprecated, replace with:
2423
% GetCacheViewAuthenticPixels(cache_view,x,y,columns,rows,
2424
% GetCacheViewException(cache_view));
2426
2286
% The format of the GetCacheViewPixels method is:
2428
% PixelPacket *GetCacheViewPixels(CacheView *cache_view,const ssize_t x,
2429
% const ssize_t y,const size_t columns,const size_t rows)
2288
% PixelPacket *GetCacheViewPixels(CacheView *cache_view,const long x,
2289
% const long y,const unsigned long columns,const unsigned long rows)
2431
2291
% A description of each parameter follows:
2439
MagickExport PixelPacket *GetCacheViewPixels(CacheView *cache_view,const ssize_t x,
2440
const ssize_t y,const size_t columns,const size_t rows)
2299
MagickExport PixelPacket *GetCacheViewPixels(CacheView *cache_view,const long x,
2300
const long y,const unsigned long columns,const unsigned long rows)
2537
2397
% GetImageClippingPathAttribute() searches the list of image attributes and
2538
2398
% returns a pointer to a clipping path if it exists otherwise NULL.
2540
% Deprecated, replace with:
2542
% GetImageAttribute(image,"8BIM:1999,2998");
2544
2400
% The format of the GetImageClippingPathAttribute method is:
2546
2402
% const ImageAttribute *GetImageClippingPathAttribute(Image *image)
2572
2428
% GetImageFromMagickRegistry() gets an image from the registry as defined by
2573
2429
% its name. If the image is not found, a NULL image is returned.
2575
% Deprecated, replace with:
2577
% GetImageRegistry(ImageRegistryType,name,exception);
2579
2431
% The format of the GetImageFromMagickRegistry method is:
2581
% Image *GetImageFromMagickRegistry(const char *name,ssize_t *id,
2433
% Image *GetImageFromMagickRegistry(const char *name,long *id,
2582
2434
% ExceptionInfo *exception)
2584
2436
% A description of each parameter follows:
2590
2442
% o exception: return any errors or warnings in this structure.
2593
MagickExport Image *GetImageFromMagickRegistry(const char *name,ssize_t *id,
2445
MagickExport Image *GetImageFromMagickRegistry(const char *name,long *id,
2594
2446
ExceptionInfo *exception)
2614
2466
% The format of the GetMagickRegistry method is:
2616
% const void *GetMagickRegistry(const ssize_t id,RegistryType *type,
2468
% const void *GetMagickRegistry(const long id,RegistryType *type,
2617
2469
% size_t *length,ExceptionInfo *exception)
2619
2471
% A description of each parameter follows:
2627
2479
% o exception: return any errors or warnings in this structure.
2630
MagickExport void *GetMagickRegistry(const ssize_t id,RegistryType *type,
2482
MagickExport void *GetMagickRegistry(const long id,RegistryType *type,
2631
2483
size_t *length,ExceptionInfo *exception)
2639
2491
*type=UndefinedRegistryType;
2641
(void) FormatMagickString(key,MaxTextExtent,"%.20g\n",(double) id);
2493
(void) FormatMagickString(key,MaxTextExtent,"%ld\n",id);
2642
2494
blob=(void *) GetImageRegistry(ImageRegistryType,key,exception);
2643
2495
if (blob != (void *) NULL)
2662
2514
% GetImageGeometry() returns a region as defined by the geometry string with
2663
2515
% respect to the image and its gravity.
2665
% Deprecated, replace with:
2667
% if (size_to_fit != MagickFalse)
2668
% ParseRegionGeometry(image,geometry,region_info,&image->exception); else
2669
% ParsePageGeometry(image,geometry,region_info,&image->exception);
2671
2517
% The format of the GetImageGeometry method is:
2673
2519
% int GetImageGeometry(Image *image,const char *geometry,
2711
2557
% GetImageList() returns an image at the specified position in the list.
2713
% Deprecated, replace with:
2715
% CloneImage(GetImageFromList(images,(ssize_t) offset),0,0,MagickTrue,
2718
2559
% The format of the GetImageList method is:
2720
% Image *GetImageList(const Image *images,const ssize_t offset,
2561
% Image *GetImageList(const Image *images,const long offset,
2721
2562
% ExceptionInfo *exception)
2723
2564
% A description of each parameter follows:
2729
2570
% o exception: return any errors or warnings in this structure.
2732
MagickExport Image *GetImageList(const Image *images,const ssize_t offset,
2573
MagickExport Image *GetImageList(const Image *images,const long offset,
2733
2574
ExceptionInfo *exception)
2738
2579
if (images->debug != MagickFalse)
2739
2580
(void) LogMagickEvent(DeprecateEvent,GetMagickModule(),"last use: v5.5.2");
2740
image=CloneImage(GetImageFromList(images,(ssize_t) offset),0,0,MagickTrue,
2581
image=CloneImage(GetImageFromList(images,(long) offset),0,0,MagickTrue,
2756
2597
% GetImageListIndex() returns the position in the list of the specified
2759
% Deprecated, replace with:
2761
% GetImageIndexInList(images);
2763
2600
% The format of the GetImageListIndex method is:
2765
% ssize_t GetImageListIndex(const Image *images)
2602
% long GetImageListIndex(const Image *images)
2767
2604
% A description of each parameter follows:
2769
2606
% o images: the image list.
2772
MagickExport ssize_t GetImageListIndex(const Image *images)
2609
MagickExport long GetImageListIndex(const Image *images)
2774
2611
if (images->debug != MagickFalse)
2775
2612
(void) LogMagickEvent(DeprecateEvent,GetMagickModule(),"last use: v5.5.2");
2790
2627
% GetImageListSize() returns the number of images in the list.
2792
% Deprecated, replace with:
2794
% GetImageListLength(images);
2796
2629
% The format of the GetImageListSize method is:
2798
% size_t GetImageListSize(const Image *images)
2631
% unsigned long GetImageListSize(const Image *images)
2800
2633
% A description of each parameter follows:
2802
2635
% o images: the image list.
2805
MagickExport size_t GetImageListSize(const Image *images)
2638
MagickExport unsigned long GetImageListSize(const Image *images)
2807
2640
if (images->debug != MagickFalse)
2808
2641
(void) LogMagickEvent(DeprecateEvent,GetMagickModule(),"last use: v5.5.2");
2839
2672
% array has been updated, the changes must be saved back to the underlying
2840
2673
% image using SyncAuthenticPixels() or they may be lost.
2842
% Deprecated, replace with:
2844
% GetAuthenticPixels(image,x,y,columns,rows,&image->exception);
2846
2675
% The format of the GetImagePixels() method is:
2848
% PixelPacket *GetImagePixels(Image *image,const ssize_t x,const ssize_t y,
2849
% const size_t columns,const size_t rows)
2677
% PixelPacket *GetImagePixels(Image *image,const long x,const long y,
2678
% const unsigned long columns,const unsigned long rows)
2851
2680
% A description of each parameter follows:
2859
MagickExport PixelPacket *GetImagePixels(Image *image,const ssize_t x,const ssize_t y,
2860
const size_t columns,const size_t rows)
2688
MagickExport PixelPacket *GetImagePixels(Image *image,const long x,const long y,
2689
const unsigned long columns,const unsigned long rows)
2862
2691
return(GetAuthenticPixels(image,x,y,columns,rows,&image->exception));
2877
2706
% with the last call to QueueAuthenticPixels() or GetVirtualPixels(). NULL is
2878
2707
% returned if the black channel or colormap indexes are not available.
2880
% Deprecated, replace with:
2882
% GetAuthenticIndexQueue(image);
2884
2709
% The format of the GetIndexes() method is:
2886
2711
% IndexPacket *GetIndexes(const Image *image)
2913
2738
% geometry is modified as determined by the meta characters: %, !, <, >,
2916
% Deprecated, replace with:
2918
% ParseMetaGeometry(geometry,x,y,width,height);
2920
2741
% The format of the GetMagickGeometry method is:
2922
% unsigned int GetMagickGeometry(const char *geometry,ssize_t *x,ssize_t *y,
2923
% size_t *width,size_t *height)
2743
% unsigned int GetMagickGeometry(const char *geometry,long *x,long *y,
2744
% unsigned long *width,unsigned long *height)
2925
2746
% A description of each parameter follows:
2934
2755
% as determined by the geometry specification is returned here.
2937
MagickExport unsigned int GetMagickGeometry(const char *geometry,ssize_t *x,
2938
ssize_t *y,size_t *width,size_t *height)
2758
MagickExport unsigned int GetMagickGeometry(const char *geometry,long *x,
2759
long *y,unsigned long *width,unsigned long *height)
2940
2761
(void) LogMagickEvent(DeprecateEvent,GetMagickModule(),"last use: v5.5.3");
2941
2762
return(ParseMetaGeometry(geometry,x,y,width,height));
2955
2776
% GetNextImage() returns the next image in a list.
2957
% Deprecated, replace with:
2959
% GetNextImageInList(images);
2961
2778
% The format of the GetNextImage method is:
2963
2780
% Image *GetNextImage(const Image *images)
2988
2805
% GetNextImageAttribute() gets the next image attribute.
2990
% Deprecated, replace with:
2992
% const char *property;
2993
% property=GetNextImageProperty(image);
2994
% if (property != (const char *) NULL)
2995
% GetImageAttribute(image,property);
2997
2807
% The format of the GetNextImageAttribute method is:
2999
2809
% const ImageAttribute *GetNextImageAttribute(const Image *image)
3028
2838
% GetNumberScenes() returns the number of images in the list.
3030
% Deprecated, replace with:
3032
% GetImageListLength(image);
3034
2840
% The format of the GetNumberScenes method is:
3036
2842
% unsigned int GetNumberScenes(const Image *images)
3061
2867
% GetOnePixel() returns a single pixel at the specified (x,y) location.
3062
2868
% The image background color is returned if an error occurs.
3064
% Deprecated, replace with:
3066
% GetOneAuthenticPixel(image,x,y,&pixel,&image->exception);
3068
2870
% The format of the GetOnePixel() method is:
3070
% PixelPacket GetOnePixel(const Image image,const ssize_t x,const ssize_t y)
2872
% PixelPacket GetOnePixel(const Image image,const long x,const long y)
3072
2874
% A description of each parameter follows:
3076
2878
% o x,y: These values define the location of the pixel to return.
3079
MagickExport PixelPacket GetOnePixel(Image *image,const ssize_t x,const ssize_t y)
2881
MagickExport PixelPacket GetOnePixel(Image *image,const long x,const long y)
3099
2901
% GetPixels() returns the pixels associated with the last call to
3100
2902
% QueueAuthenticPixels() or GetAuthenticPixels().
3102
% Deprecated, replace with:
3104
% GetAuthenticPixelQueue(image);
3106
2904
% The format of the GetPixels() method is:
3108
2906
% PixelPacket *GetPixels(const Image image)
3134
2932
% GetPreviousImage() returns the previous image in a list.
3136
% Deprecated, replace with:
3138
% GetPreviousImageInList(images));
3140
2934
% The format of the GetPreviousImage method is:
3142
2936
% Image *GetPreviousImage(const Image *images)
3272
3066
% InitializeMagick() initializes the ImageMagick environment.
3274
% Deprecated, replace with:
3276
% MagickCoreGenesis(path,MagickFalse);
3278
3068
% The format of the InitializeMagick function is:
3280
3070
% InitializeMagick(const char *path)
3394
3184
return(delta->x*x+delta->y*y+(1.0-delta->x-delta->y)*p);
3397
static inline ssize_t NearestNeighbor(MagickRealType x)
3187
static inline long NearestNeighbor(MagickRealType x)
3400
return((ssize_t) (x+0.5));
3401
return((ssize_t) (x-0.5));
3190
return((long) (x+0.5));
3191
return((long) (x-0.5));
3404
3194
MagickExport MagickPixelPacket InterpolatePixelColor(const Image *image,
3435
p=GetCacheViewVirtualPixels(image_view,(ssize_t) floor(x)-1,(ssize_t) floor(y)-
3225
p=GetCacheViewVirtualPixels(image_view,(long) floor(x)-1,(long) floor(y)-
3436
3226
1,4,4,exception);
3437
3227
if (p == (const PixelPacket *) NULL)
3478
p=GetCacheViewVirtualPixels(image_view,(ssize_t) floor(x)-1,(ssize_t) floor(y)-
3268
p=GetCacheViewVirtualPixels(image_view,(long) floor(x)-1,(long) floor(y)-
3479
3269
1,4,4,exception);
3480
3270
if (p == (const PixelPacket *) NULL)
3519
p=GetCacheViewVirtualPixels(image_view,(ssize_t) floor(x),(ssize_t) floor(y),2,
3309
p=GetCacheViewVirtualPixels(image_view,(long) floor(x),(long) floor(y),2,
3521
3311
if (p == (const PixelPacket *) NULL)
3575
3365
geometry.width=4L;
3576
3366
geometry.height=4L;
3577
geometry.x=(ssize_t) floor(x)-1L;
3578
geometry.y=(ssize_t) floor(y)-1L;
3367
geometry.x=(long) floor(x)-1L;
3368
geometry.y=(long) floor(y)-1L;
3579
3369
excerpt_image=ExcerptImage(image,&geometry,exception);
3580
3370
if (excerpt_image == (Image *) NULL)
3601
3391
MagickPixelPacket
3604
p=GetCacheViewVirtualPixels(image_view,(ssize_t) floor(x),(ssize_t) floor(y),1,
3394
p=GetCacheViewVirtualPixels(image_view,(long) floor(x),(long) floor(y),1,
3606
3396
if (p == (const PixelPacket *) NULL)
3626
p=GetCacheViewVirtualPixels(image_view,(ssize_t) floor(x),(ssize_t) floor(y),
3416
p=GetCacheViewVirtualPixels(image_view,(long) floor(x),(long) floor(y),
3627
3417
2,2,exception);
3628
3418
if (p == (const PixelPacket *) NULL)
3777
p=GetCacheViewVirtualPixels(image_view,(ssize_t) floor(x)-1,(ssize_t) floor(y)-
3567
p=GetCacheViewVirtualPixels(image_view,(long) floor(x)-1,(long) floor(y)-
3778
3568
1,4,4,exception);
3779
3569
if (p == (const PixelPacket *) NULL)
3793
3583
if (image->matte != MagickFalse)
3795
alpha[n]=QuantumScale*((MagickRealType)
3796
GetAlphaPixelComponent(p));
3585
alpha[n]=QuantumScale*((MagickRealType) GetAlphaPixelComponent(p));
3797
3586
pixels[n].red*=alpha[n];
3798
3587
pixels[n].green*=alpha[n];
3799
3588
pixels[n].blue*=alpha[n];
3834
3623
% InterpretImageAttributes() replaces any embedded formatting characters with
3835
3624
% the appropriate image attribute and returns the translated text.
3837
% Deprecated, replace with:
3839
% InterpretImageProperties(image_info,image,embed_text);
3841
3626
% The format of the InterpretImageAttributes method is:
3843
3628
% char *InterpretImageAttributes(const ImageInfo *image_info,Image *image,
3922
3707
% appropriatally. This effectivally maps a greyscale gradient into the given
3923
3708
% color gradient.
3925
% Deprecated, replace with:
3927
% LevelColorsImageChannel(image,channel,black_color,white_color,invert);
3929
3710
% The format of the LevelImageColors method is:
3931
3712
% MagickBooleanType LevelImageColors(Image *image,const ChannelType channel,
3999
3780
% LiberateSemaphoreInfo() relinquishes a semaphore.
4001
% Deprecated, replace with:
4003
% UnlockSemaphoreInfo(*semaphore_info);
4005
3782
% The format of the LiberateSemaphoreInfo method is:
4007
3784
% LiberateSemaphoreInfo(void **semaphore_info)
4031
3808
% MagickIncarnate() initializes the ImageMagick environment.
4033
% Deprecated, replace with:
4035
% MagickCoreGenesis(path,MagickFalse);
4037
3810
% The format of the MagickIncarnate function is:
4039
3812
% MagickIncarnate(const char *path)
4117
3890
% MapImage() replaces the colors of an image with the closest color from a
4118
3891
% reference image.
4120
% Deprecated, replace with:
4122
% QuantizeInfo quantize_info;
4123
% GetQuantizeInfo(&quantize_info);
4124
% quantize_info.dither=dither;
4125
% RemapImage(&quantize_info,image,map_image);
4127
3893
% The format of the MapImage method is:
4129
3895
% MagickBooleanType MapImage(Image *image,const Image *map_image,
4174
3940
% MapImages() replaces the colors of a sequence of images with the closest
4175
3941
% color from a reference image.
4177
% Deprecated, replace with:
4179
% QuantizeInfo quantize_info;
4180
% GetQuantizeInfo(&quantize_info);
4181
% quantize_info.dither=dither;
4182
% RemapImages(&quantize_info,images,map_image);
4184
3943
% The format of the MapImage method is:
4186
3945
% MagickBooleanType MapImages(Image *images,Image *map_image,
4238
3997
% The format of the MatteFloodfillImage method is:
4240
3999
% MagickBooleanType MatteFloodfillImage(Image *image,
4241
% const PixelPacket target,const Quantum opacity,const ssize_t x_offset,
4242
% const ssize_t y_offset,const PaintMethod method)
4000
% const PixelPacket target,const Quantum opacity,const long x_offset,
4001
% const long y_offset,const PaintMethod method)
4244
4003
% A description of each parameter follows:
4258
4017
MagickExport MagickBooleanType MatteFloodfillImage(Image *image,
4259
const PixelPacket target,const Quantum opacity,const ssize_t x_offset,
4260
const ssize_t y_offset,const PaintMethod method)
4018
const PixelPacket target,const Quantum opacity,const long x_offset,
4019
const long y_offset,const PaintMethod method)
4263
4022
*floodplane_image;
4286
4045
assert(image->signature == MagickSignature);
4287
4046
if (image->debug != MagickFalse)
4288
4047
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
4289
if ((x_offset < 0) || (x_offset >= (ssize_t) image->columns))
4048
if ((x_offset < 0) || (x_offset >= (long) image->columns))
4290
4049
return(MagickFalse);
4291
if ((y_offset < 0) || (y_offset >= (ssize_t) image->rows))
4050
if ((y_offset < 0) || (y_offset >= (long) image->rows))
4292
4051
return(MagickFalse);
4293
4052
if (SetImageStorageClass(image,DirectClass) == MagickFalse)
4294
4053
return(MagickFalse);
4334
4093
Pop segment off stack.
4339
offset=(ssize_t) s->y2;
4340
y=(ssize_t) s->y1+offset;
4098
offset=(long) s->y2;
4099
y=(long) s->y1+offset;
4342
4101
Recolor neighboring pixels.
4344
p=GetVirtualPixels(image,0,y,(size_t) (x1+1),1,&image->exception);
4345
q=GetAuthenticPixels(floodplane_image,0,y,(size_t) (x1+1),1,
4103
p=GetVirtualPixels(image,0,y,(unsigned long) (x1+1),1,&image->exception);
4104
q=GetAuthenticPixels(floodplane_image,0,y,(unsigned long) (x1+1),1,
4346
4105
&image->exception);
4347
4106
if ((p == (const PixelPacket *) NULL) || (q == (PixelPacket *) NULL))
4379
4138
if (skip == MagickFalse)
4381
if (x < (ssize_t) image->columns)
4140
if (x < (long) image->columns)
4383
4142
p=GetVirtualPixels(image,x,y,image->columns-x,1,
4384
4143
&image->exception);
4387
4146
if ((p == (const PixelPacket *) NULL) ||
4388
4147
(q == (PixelPacket *) NULL))
4390
for ( ; x < (ssize_t) image->columns; x++)
4149
for ( ; x < (long) image->columns; x++)
4392
4151
if (q->opacity == (Quantum) TransparentOpacity)
4417
p=GetVirtualPixels(image,x,y,(size_t) (x2-x+1),1,
4176
p=GetVirtualPixels(image,x,y,(unsigned long) (x2-x+1),1,
4418
4177
&image->exception);
4419
q=GetAuthenticPixels(floodplane_image,x,y,(size_t) (x2-x+1),1,
4178
q=GetAuthenticPixels(floodplane_image,x,y,(unsigned long) (x2-x+1),1,
4420
4179
&image->exception);
4421
4180
if ((p == (const PixelPacket *) NULL) || (q == (PixelPacket *) NULL))
4458
4217
q=GetAuthenticPixels(image,0,y,image->columns,1,&image->exception);
4459
4218
if ((p == (const PixelPacket *) NULL) || (q == (PixelPacket *) NULL))
4461
for (x=0; x < (ssize_t) image->columns; x++)
4220
for (x=0; x < (long) image->columns; x++)
4463
4222
if (p->opacity != OpaqueOpacity)
4464
4223
q->opacity=opacity;
4471
4230
segment_stack=(SegmentInfo *) RelinquishMagickMemory(segment_stack);
4472
4231
floodplane_image=DestroyImage(floodplane_image);
4473
return(y == (ssize_t) image->rows ? MagickTrue : MagickFalse);
4232
return(y == (long) image->rows ? MagickTrue : MagickFalse);
4487
4246
% MaximumImages() returns the maximum intensity of an image sequence.
4489
% Deprecated, replace with:
4491
% EvaluateImages(images,MinEvaluateOperator,exception);
4493
4248
% The format of the MaxImages method is:
4495
4250
% Image *MaximumImages(Image *images,ExceptionInfo *exception)
4520
4275
% MinimumImages() returns the minimum intensity of an image sequence.
4522
% Deprecated, replace with:
4524
% EvaluateImages(images,MinEvaluateOperator,exception);
4526
4277
% The format of the MinimumImages method is:
4528
4279
% Image *MinimumImages(Image *images,ExceptionInfo *exception)
4553
4304
% MosaicImages() Obsolete Function: Use MergeImageLayers() instead.
4555
% Deprecated, replace with:
4557
% MergeImageLayers(image,MosaicLayer,exception);
4559
4306
% The format of the MosaicImage method is:
4561
4308
% Image *MosaicImages(const Image *image,ExceptionInfo *exception)
4647
4394
q=GetAuthenticPixels(image,0,y,image->columns,1,&image->exception);
4648
4395
if (q == (PixelPacket *) NULL)
4650
for (x=0; x < (ssize_t) image->columns; x++)
4397
for (x=0; x < (long) image->columns; x++)
4652
4399
if (IsColorSimilar(image,q,&target) != MagickFalse)
4656
4403
if (SyncAuthenticPixels(image,&image->exception) == MagickFalse)
4658
proceed=SetImageProgress(image,OpaqueImageTag,(MagickOffsetType) y,
4405
proceed=SetImageProgress(image,OpaqueImageTag,y,image->rows);
4660
4406
if (proceed == MagickFalse)
4668
4414
Make PseudoClass image opaque.
4670
for (i=0; i < (ssize_t) image->colors; i++)
4416
for (i=0; i < (long) image->colors; i++)
4672
4418
if (IsColorSimilar(image,&image->colormap[i],&target) != MagickFalse)
4673
4419
image->colormap[i]=fill;
4675
4421
if (fill.opacity != OpaqueOpacity)
4677
for (y=0; y < (ssize_t) image->rows; y++)
4423
for (y=0; y < (long) image->rows; y++)
4682
4428
register PixelPacket
4685
4431
q=GetAuthenticPixels(image,0,y,image->columns,1,&image->exception);
4686
4432
if (q == (PixelPacket *) NULL)
4688
for (x=0; x < (ssize_t) image->columns; x++)
4434
for (x=0; x < (long) image->columns; x++)
4690
4436
if (IsColorSimilar(image,q,&target) != MagickFalse)
4691
4437
q->opacity=fill.opacity;
4718
4464
% OpenCacheView() opens a view into the pixel cache, using the
4719
4465
% VirtualPixelMethod that is defined within the given image itself.
4721
% Deprecated, replace with:
4723
% AcquireCacheView(image);
4725
4467
% The format of the OpenCacheView method is:
4727
4469
% CacheView *OpenCacheView(const Image *image)
4759
4501
% color red at intensities of 100 and 102 respectively are now
4760
4502
% interpreted as the same color for the purposes of the floodfill.
4762
% Deprecated, replace with:
4764
% FloodfillPaintImage(image,channel,draw_info,target,x,y,
4765
% method == FloodfillMethod ? MagickFalse : MagickTrue);
4767
4504
% The format of the PaintFloodfillImage method is:
4769
4506
% MagickBooleanType PaintFloodfillImage(Image *image,
4770
% const ChannelType channel,const MagickPixelPacket target,const ssize_t x,
4771
% const ssize_t y,const DrawInfo *draw_info,const PaintMethod method)
4507
% const ChannelType channel,const MagickPixelPacket target,const long x,
4508
% const long y,const DrawInfo *draw_info,const PaintMethod method)
4773
4510
% A description of each parameter follows:
4788
4525
MagickExport MagickBooleanType PaintFloodfillImage(Image *image,
4789
const ChannelType channel,const MagickPixelPacket *target,const ssize_t x,
4790
const ssize_t y,const DrawInfo *draw_info,const PaintMethod method)
4526
const ChannelType channel,const MagickPixelPacket *target,const long x,
4527
const long y,const DrawInfo *draw_info,const PaintMethod method)
4792
4529
MagickBooleanType
4815
4552
% For example, set fuzz to 10 and the color red at intensities of 100 and
4816
4553
% 102 respectively are now interpreted as the same color.
4818
% Deprecated, replace with:
4820
% OpaquePaintImageChannel(image,DefaultChannels,target,fill,MagickFalse);
4821
% OpaquePaintImageChannel(image,channel,target,fill,MagickFalse);
4823
4555
% The format of the PaintOpaqueImage method is:
4825
4557
% MagickBooleanType PaintOpaqueImage(Image *image,
4877
4609
% For example, set fuzz to 10 and the color red at intensities of 100 and
4878
4610
% 102 respectively are now interpreted as the same color.
4880
% Deprecated, replace with:
4882
% TransparentPaintImage(image,target,opacity,MagickFalse);
4884
4612
% The format of the PaintTransparentImage method is:
4886
4614
% MagickBooleanType PaintTransparentImage(Image *image,
4916
4644
% geometry is modified as determined by the meta characters: %, !, <,
4919
% Deprecated, replace with:
4921
% ParseMetaGeometry(geometry,x,y,width,height);
4923
4647
% The format of the ParseImageGeometry method is:
4925
% int ParseImageGeometry(char *geometry,ssize_t *x,ssize_t *y,
4926
% size_t *width,size_t *height)
4649
% int ParseImageGeometry(char *geometry,long *x,long *y,
4650
% unsigned long *width,unsigned long *height)
4928
4652
% A description of each parameter follows:
4940
4664
% as determined by the geometry specification is returned here.
4943
MagickExport int ParseImageGeometry(const char *geometry,ssize_t *x,ssize_t *y,
4944
size_t *width,size_t *height)
4667
MagickExport int ParseImageGeometry(const char *geometry,long *x,long *y,
4668
unsigned long *width,unsigned long *height)
4946
4670
(void) LogMagickEvent(DeprecateEvent,GetMagickModule(),"last use: v5.5.1");
4947
4671
return((int) ParseMetaGeometry(geometry,x,y,width,height));
4961
4685
% ParseSizeGeometry() returns a region as defined by the geometry string with
4962
4686
% respect to the image dimensions and aspect ratio.
4964
% Deprecated, replace with:
4966
% ParseMetaGeometry(geometry,®ion_info->x,®ion_info->y,
4967
% ®ion_info->width,®ion_info->height);
4969
4688
% The format of the ParseSizeGeometry method is:
4971
4690
% MagickStatusType ParseSizeGeometry(const Image *image,
5005
4724
% PopImageList() removes the last image in the list.
5007
% Deprecated, replace with:
5009
% RemoveLastImageFromList(images);
5011
4726
% The format of the PopImageList method is:
5013
4728
% Image *PopImageList(Image **images)
5085
4800
% PostscriptGeometry() replaces any page mneumonic with the equivalent size in
5088
% Deprecated, replace with:
5090
% GetPageGeometry(page);
5092
4803
% The format of the PostscriptGeometry method is:
5094
4805
% char *PostscriptGeometry(const char *page)
5120
4831
% PushImageList() adds an image to the end of the list.
5122
% Deprecated, replace with:
5124
% AppendImageToList(images,CloneImageList(image,exception));
5126
4833
% The format of the PushImageList method is:
5128
4835
% unsigned int PushImageList(Image *images,const Image *image,
5224
4931
% distance measure is normalized to a range between 0 and 1. It is
5225
4932
% independent of the range of red, green, and blue values in your image.
5227
% Deprecated, replace with:
5229
% GetImageQuantizeError(image);
5231
4935
% The format of the QuantizationError method is:
5331
5035
lower_threshold=0;
5332
5036
upper_threshold=0;
5333
count=(ssize_t) sscanf(thresholds,"%lf[/x%%]%lf",&lower_threshold,
5037
count=sscanf(thresholds,"%lf[/x%%]%lf",&lower_threshold,
5334
5038
&upper_threshold);
5335
5039
if (strchr(thresholds,'%') != (char *) NULL)
5352
5056
ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed",
5353
5057
image->filename);
5354
5058
random_info=AcquireRandomInfo();
5355
for (y=0; y < (ssize_t) image->rows; y++)
5059
for (y=0; y < (long) image->rows; y++)
5360
5064
register IndexPacket
5371
5075
LocaleCompare(channel,"intensity") == 0)
5373
5077
indexes=GetAuthenticIndexQueue(image);
5374
for (x=0; x < (ssize_t) image->columns; x++)
5078
for (x=0; x < (long) image->columns; x++)
5397
5101
threshold ? 0 : QuantumRange);
5398
5102
index=(IndexPacket) (intensity <= threshold ? 0 : 1);
5399
5103
*indexes++=index;
5400
q->red=q->green=q->blue=image->colormap[(ssize_t) index].red;
5104
q->red=q->green=q->blue=image->colormap[(long) index].red;
5406
5110
LocaleCompare(channel,"matte") == 0)
5408
5112
if (image->matte != MagickFalse)
5409
for (x=0; x < (ssize_t) image->columns; x++)
5113
for (x=0; x < (long) image->columns; x++)
5411
5115
if (order == 1)
5496
% R e c o l o r I m a g e %
5500
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5502
% RecolorImage() apply color transformation to an image. The method permits
5503
% saturation changes, hue rotation, luminance to alpha, and various other
5504
% effects. Although variable-sized transformation matrices can be used,
5505
% typically one uses a 5x5 matrix for an RGBA image and a 6x6 for CMYKA
5506
% (or RGBA with offsets). The matrix is similar to those used by Adobe Flash
5507
% except offsets are in column 6 rather than 5 (in support of CMYKA images)
5508
% and offsets are normalized (divide Flash offset by 255).
5510
% The format of the RecolorImage method is:
5512
% Image *RecolorImage(const Image *image,const size_t order,
5513
% const double *color_matrix,ExceptionInfo *exception)
5515
% A description of each parameter follows:
5517
% o image: the image.
5519
% o order: the number of columns and rows in the recolor matrix.
5521
% o color_matrix: An array of double representing the recolor matrix.
5523
% o exception: return any errors or warnings in this structure.
5526
MagickExport Image *RecolorImage(const Image *image,const size_t order,
5527
const double *color_matrix,ExceptionInfo *exception)
5535
kernel_info=AcquireKernelInfo("1");
5536
if (kernel_info == (KernelInfo *) NULL)
5537
return((Image *) NULL);
5538
kernel_info->width=order;
5539
kernel_info->height=order;
5540
kernel_info->values=(double *) color_matrix;
5541
recolor_image=ColorMatrixImage(image,kernel_info,exception);
5542
kernel_info->values=(double *) NULL;
5543
kernel_info=DestroyKernelInfo(kernel_info);
5544
return(recolor_image);
5548
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5552
5200
% R e s e t I m a g e A t t r i b u t e I t e r a t o r %
5559
5207
% in conjunction with GetNextImageAttribute() to iterate over all the values
5560
5208
% associated with an image.
5562
% Deprecated, replace with:
5564
% ResetImagePropertyIterator(image);
5566
5210
% The format of the ResetImageAttributeIterator method is:
5568
5212
% ResetImageAttributeIterator(const ImageInfo *image)
5592
5236
% defined by the geometry parameters. A pointer to the pixels is returned
5593
5237
% if the pixels are transferred, otherwise a NULL is returned.
5595
% Deprecated, replace with:
5597
% QueueCacheViewAuthenticPixels(cache_view,x,y,columns,rows,
5598
% GetCacheViewException(cache_view));
5600
5239
% The format of the SetCacheViewPixels method is:
5602
% PixelPacket *SetCacheViewPixels(CacheView *cache_view,const ssize_t x,
5603
% const ssize_t y,const size_t columns,const size_t rows)
5241
% PixelPacket *SetCacheViewPixels(CacheView *cache_view,const long x,
5242
% const long y,const unsigned long columns,const unsigned long rows)
5605
5244
% A description of each parameter follows:
5613
MagickExport PixelPacket *SetCacheViewPixels(CacheView *cache_view,const ssize_t x,
5614
const ssize_t y,const size_t columns,const size_t rows)
5252
MagickExport PixelPacket *SetCacheViewPixels(CacheView *cache_view,const long x,
5253
const long y,const unsigned long columns,const unsigned long rows)
5649
MagickExport void SetCacheThreshold(const size_t size)
5288
MagickExport void SetCacheThreshold(const unsigned long size)
5651
5290
(void) LogMagickEvent(DeprecateEvent,GetMagickModule(),"last use: v5.5.1");
5652
5291
(void) SetMagickResourceLimit(MemoryResource,size*1024*1024);
5755
5394
q=QueueAuthenticPixels(image,0,y,image->columns,1,&image->exception);
5756
5395
if (q == (PixelPacket *) NULL)
5758
for (x=0; x < (ssize_t) image->columns; x++)
5397
for (x=0; x < (long) image->columns; x++)
5759
5398
*q++=background_color;
5760
5399
indexes=GetAuthenticIndexQueue(image);
5761
for (x=0; x < (ssize_t) image->columns; x++)
5400
for (x=0; x < (long) image->columns; x++)
5762
5401
indexes[x]=(IndexPacket) 0;
5763
5402
if (SyncAuthenticPixels(image,&image->exception) == MagickFalse)
5779
5418
q=QueueAuthenticPixels(image,0,y,image->columns,1,&image->exception);
5780
5419
if (q == (PixelPacket *) NULL)
5782
for (x=0; x < (ssize_t) image->columns; x++)
5421
for (x=0; x < (long) image->columns; x++)
5783
5422
*q++=background_color;
5784
5423
if (SyncAuthenticPixels(image,&image->exception) == MagickFalse)
5801
5440
% attribute value. If it is not found in the list, the attribute name
5802
5441
% and value is added to the list.
5804
% Deprecated, replace with:
5806
% SetImageProperty(image,key,value);
5808
5443
% The format of the SetImageAttribute method is:
5810
5445
% MagickBooleanType SetImageAttribute(Image *image,const char *key,
5842
5477
% The format of the SetImageList method is:
5844
5479
% unsigned int SetImageList(Image *images,const Image *image,
5845
% const ssize_t offset,ExceptionInfo *exception)
5480
% const long offset,ExceptionInfo *exception)
5847
5482
% A description of each parameter follows:
5858
5493
MagickExport unsigned int SetImageList(Image **images,const Image *image,
5859
const ssize_t offset,ExceptionInfo *exception)
5494
const long offset,ExceptionInfo *exception)
5867
5502
(void) LogMagickEvent(DeprecateEvent,GetMagickModule(),"last use: v5.5.2");
5918
5553
% array has been updated, the changes must be saved back to the underlying
5919
5554
% image using SyncAuthenticPixels() or they may be lost.
5921
% Deprecated, replace with:
5923
% QueueAuthenticPixels(image,x,y,columns,rows,&image->exception);
5925
5556
% The format of the SetImagePixels() method is:
5927
% PixelPacket *SetImagePixels(Image *image,const ssize_t x,const ssize_t y,
5928
% const size_t columns,const size_t rows)
5558
% PixelPacket *SetImagePixels(Image *image,const long x,const long y,
5559
% const unsigned long columns,const unsigned long rows)
5930
5561
% A description of each parameter follows:
5941
MagickExport PixelPacket *SetImagePixels(Image *image,const ssize_t x,const ssize_t y,
5942
const size_t columns,const size_t rows)
5572
MagickExport PixelPacket *SetImagePixels(Image *image,const long x,const long y,
5573
const unsigned long columns,const unsigned long rows)
5944
5575
return(QueueAuthenticPixels(image,x,y,columns,rows,&image->exception));
5961
5592
% The format of the SetMagickRegistry method is:
5963
% ssize_t SetMagickRegistry(const RegistryType type,const void *blob,
5594
% long SetMagickRegistry(const RegistryType type,const void *blob,
5964
5595
% const size_t length,ExceptionInfo *exception)
5966
5597
% A description of each parameter follows:
5975
5606
% o exception: return any errors or warnings in this structure.
5978
MagickExport ssize_t SetMagickRegistry(const RegistryType type,const void *blob,
5609
MagickExport long SetMagickRegistry(const RegistryType type,const void *blob,
5979
5610
const size_t magick_unused(length),ExceptionInfo *exception)
5984
5615
MagickBooleanType
5990
(void) FormatMagickString(key,MaxTextExtent,"%.20g\n",(double) id);
5621
(void) FormatMagickString(key,MaxTextExtent,"%ld\n",id);
5991
5622
status=SetImageRegistry(type,key,blob,exception);
5992
5623
if (status == MagickFalse)
6047
5678
% ShiftImageList() removes an image from the beginning of the list.
6049
% Deprecated, replace with:
6051
% RemoveFirstImageFromList(images);
6053
5680
% The format of the ShiftImageList method is:
6055
5682
% Image *ShiftImageList(Image **images)
6079
5706
% SizeBlob() returns the current length of the image file or blob.
6081
% Deprecated, replace with:
6083
% GetBlobSize(image);
6085
5708
% The format of the SizeBlob method is:
6087
5710
% off_t SizeBlob(Image *image)
6118
5741
% The format of the SpliceImageList method is:
6120
% Image *SpliceImageList(Image *images,const ssize_t offset,
6121
% const size_t length,const Image *splices,
5743
% Image *SpliceImageList(Image *images,const long offset,
5744
% const unsigned long length,const Image *splices,
6122
5745
% ExceptionInfo *exception)
6124
5747
% A description of each parameter follows:
6134
5757
% o exception: return any errors or warnings in this structure.
6137
MagickExport Image *SpliceImageList(Image *images,const ssize_t offset,
6138
const size_t length,const Image *splices,ExceptionInfo *exception)
5760
MagickExport Image *SpliceImageList(Image *images,const long offset,
5761
const unsigned long length,const Image *splices,ExceptionInfo *exception)
6146
5769
if (images->debug != MagickFalse)
6223
5846
% cache. It returns MagickTrue if the pixel region is synced, otherwise
6226
% Deprecated, replace with:
6228
% SyncCacheViewAuthenticPixels(cache_view,GetCacheViewException(cache_view));
6230
5849
% The format of the SyncCacheView method is:
6232
5851
% MagickBooleanType SyncCacheView(CacheView *cache_view)
6261
5880
% or disk cache. It returns MagickTrue if the pixel region is flushed,
6262
5881
% otherwise MagickFalse.
6264
% Deprecated, replace with:
6266
% SyncCacheViewAuthenticPixels(cache_view,GetCacheViewException(cache_view));
6268
5883
% The format of the SyncCacheViewPixels method is:
6270
5885
% MagickBooleanType SyncCacheViewPixels(CacheView *cache_view)
6301
5916
% The method returns MagickTrue if the pixel region is synced, otherwise
6304
% Deprecated, replace with:
6306
% SyncAuthenticPixels(image,&image->exception);
6308
5919
% The format of the SyncImagePixels() method is:
6310
5921
% MagickBooleanType SyncImagePixels(Image *image)
6397
6008
if (!AcquireImageColormap(image,2))
6398
6009
ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed",
6399
6010
"UnableToThresholdImage");
6400
for (y=0; y < (ssize_t) image->rows; y++)
6011
for (y=0; y < (long) image->rows; y++)
6402
6013
register IndexPacket
6403
6014
*restrict indexes;
6408
6019
register PixelPacket
6412
6023
if (q == (PixelPacket *) NULL)
6414
6025
indexes=GetAuthenticIndexQueue(image);
6415
for (x=0; x < (ssize_t) image->columns; x++)
6026
for (x=0; x < (long) image->columns; x++)
6417
6028
index=(IndexPacket) ((MagickRealType)
6418
6029
PixelIntensityToQuantum(q) <= threshold ? 0 : 1);
6419
6030
indexes[x]=index;
6420
q->red=image->colormap[(ssize_t) index].red;
6421
q->green=image->colormap[(ssize_t) index].green;
6422
q->blue=image->colormap[(ssize_t) index].blue;
6031
q->red=image->colormap[(long) index].red;
6032
q->green=image->colormap[(long) index].green;
6033
q->blue=image->colormap[(long) index].blue;
6425
6036
if (!SyncAuthenticPixels(image,&image->exception))
6513
6124
if (pixel.red == 0)
6514
6125
(void) GetImageDynamicThreshold(image,2.0,2.0,&pixel,&image->exception);
6516
for (y=0; y < (ssize_t) image->rows; y++)
6127
for (y=0; y < (long) image->rows; y++)
6518
6129
register IndexPacket
6519
6130
*restrict indexes;
6524
6135
register PixelPacket
6530
6141
indexes=GetAuthenticIndexQueue(image);
6531
6142
if (IsMagickGray(&pixel) != MagickFalse)
6532
for (x=0; x < (ssize_t) image->columns; x++)
6143
for (x=0; x < (long) image->columns; x++)
6534
6145
index=(IndexPacket) ((MagickRealType)
6535
6146
PixelIntensityToQuantum(q) <= pixel.red ? 0 : 1);
6536
6147
indexes[x]=index;
6537
q->red=image->colormap[(ssize_t) index].red;
6538
q->green=image->colormap[(ssize_t) index].green;
6539
q->blue=image->colormap[(ssize_t) index].blue;
6148
q->red=image->colormap[(long) index].red;
6149
q->green=image->colormap[(long) index].green;
6150
q->blue=image->colormap[(long) index].blue;
6543
for (x=0; x < (ssize_t) image->columns; x++)
6154
for (x=0; x < (long) image->columns; x++)
6545
6156
q->red=(Quantum) ((MagickRealType)
6546
6157
q->red <= pixel.red ? 0 : QuantumRange);
6576
6187
% weights are rescaled to normalize the range of the transformed values to
6577
6188
% be [0..QuantumRange].
6579
% Deprecated, replace with:
6581
% TransformImageColorspace(image,colorspace);
6583
6190
% The format of the TransformColorspace method is:
6585
6192
% unsigned int (void) TransformColorspace(Image *image,
6692
6299
% TranslateText() replaces any embedded formatting characters with the
6693
6300
% appropriate image attribute and returns the translated text.
6695
% Deprecated, replace with:
6697
% InterpretImageProperties(image_info,image,embed_text);
6699
6302
% The format of the TranslateText method is:
6701
6304
% char *TranslateText(const ImageInfo *image_info,Image *image,
6776
6379
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
6777
6380
if (image->matte == MagickFalse)
6778
6381
(void) SetImageAlphaChannel(image,OpaqueAlphaChannel);
6779
for (y=0; y < (ssize_t) image->rows; y++)
6382
for (y=0; y < (long) image->rows; y++)
6784
6387
register PixelPacket
6787
6390
q=GetAuthenticPixels(image,0,y,image->columns,1,&image->exception);
6788
6391
if (q == (PixelPacket *) NULL)
6790
for (x=0; x < (ssize_t) image->columns; x++)
6393
for (x=0; x < (long) image->columns; x++)
6792
6395
if (IsColorSimilar(image,q,&target) != MagickFalse)
6793
6396
q->opacity=opacity;
6796
6399
if (SyncAuthenticPixels(image,&image->exception) == MagickFalse)
6798
proceed=SetImageProgress(image,TransparentImageTag,(MagickOffsetType) y,
6401
proceed=SetImageProgress(image,TransparentImageTag,y,image->rows);
6800
6402
if (proceed == MagickFalse)
6817
6419
% UnshiftImageList() adds the image to the beginning of the list.
6819
% Deprecated, replace with:
6821
% PrependImageToList(images,CloneImageList(image,exception));
6823
6421
% The format of the UnshiftImageList method is:
6825
6423
% unsigned int UnshiftImageList(Image *images,const Image *image,
6857
6455
% not range from 0 to the number of colors in the colormap an exception
6858
6456
% issued and 0 is returned.
6860
% Deprecated, replace with:
6862
% ConstrainColormapIndex(image,index);
6864
6458
% The format of the ValidateColormapIndex method is:
6866
6460
% IndexPacket ValidateColormapIndex(Image *image,const unsigned int index)
6875
6469
% o index: This integer is the colormap index.
6878
6473
MagickExport IndexPacket ValidateColormapIndex(Image *image,
6474
const unsigned long index)
6881
6476
if (image->debug != MagickFalse)
6882
6477
(void) LogMagickEvent(DeprecateEvent,GetMagickModule(),"last use: v5.4.4");