rmagick 1.13.0 → 1.14.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rmagick might be problematic. Click here for more details.
- data/ChangeLog +34 -0
- data/README.html +12 -29
- data/README.txt +10 -26
- data/configure +768 -73
- data/configure.ac +29 -26
- data/doc/comtasks.html +3 -4
- data/doc/constants.html +85 -67
- data/doc/draw.html +22 -0
- data/doc/ex/dissolve.rb +13 -0
- data/doc/ex/edge.rb +1 -1
- data/doc/ex/mask.rb +37 -0
- data/doc/ex/sketch.rb +25 -0
- data/doc/ex/watermark.rb +23 -0
- data/doc/ilist.html +11 -13
- data/doc/image1.html +601 -52
- data/doc/image2.html +637 -28
- data/doc/image3.html +339 -54
- data/doc/imageattrs.html +211 -41
- data/doc/imusage.html +41 -2
- data/doc/index.html +8 -6
- data/doc/info.html +57 -42
- data/doc/optequiv.html +1919 -0
- data/doc/rvg.html +45 -42
- data/doc/scripts/doc.js +14 -1
- data/doc/scripts/stripeTables.js +23 -0
- data/doc/usage.html +66 -15
- data/{doc/ex → examples}/demo.rb +0 -0
- data/examples/find_similar_region.rb +34 -0
- data/examples/import_export.rb +1 -1
- data/examples/pattern_fill.rb +2 -2
- data/examples/rotating_text.rb +2 -4
- data/examples/thumbnail.rb +1 -1
- data/ext/RMagick/MANIFEST +9 -4
- data/ext/RMagick/extconf.rb.in +1 -1
- data/ext/RMagick/rmagick.h +47 -10
- data/ext/RMagick/rmagick_config.h.in +24 -0
- data/ext/RMagick/rmdraw.c +32 -7
- data/ext/RMagick/rmilist.c +55 -37
- data/ext/RMagick/rmimage.c +1588 -447
- data/ext/RMagick/rminfo.c +94 -3
- data/ext/RMagick/rmmain.c +68 -7
- data/ext/RMagick/rmutil.c +67 -9
- data/lib/RMagick.rb +190 -53
- data/lib/rvg/stretchable.rb +17 -13
- data/rmagick.gemspec +1 -1
- metadata +11 -6
- data/doc/ex/level_channel.rb +0 -33
- data/doc/ex/opaque.rb +0 -14
data/ext/RMagick/extconf.rb.in
CHANGED
data/ext/RMagick/rmagick.h
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
/* $Id: rmagick.h,v 1.
|
1
|
+
/* $Id: rmagick.h,v 1.138 2006/09/27 21:26:35 rmagick Exp $ */
|
2
2
|
/*=============================================================================
|
3
3
|
| Copyright (C) 2006 by Timothy P. Hunter
|
4
4
|
| Name: rmagick.h
|
@@ -74,6 +74,9 @@
|
|
74
74
|
#undef DegreesToRadians // defined in ImageMagick.h in 6.0.2
|
75
75
|
#define DegreesToRadians(x) ((x)*3.14159265358979323846/180.0)
|
76
76
|
|
77
|
+
#define PIXEL_INTENSITY(q) \
|
78
|
+
((Quantum)(0.299*(q)->red + 0.587*(q)->green + 0.114*(q)->blue + 0.5))
|
79
|
+
|
77
80
|
#define LMAX(a,b) ((((long)(a))>((long)(b)))?((long)(a)):((long)(b)))
|
78
81
|
#define FMAX(a,b) ((((double)(a))>((double)(b)))?((double)(a)):((double)(b)))
|
79
82
|
#define FMIN(a,b) ((((double)(a))<=((double)(b)))?((double)(a)):((double)(b)))
|
@@ -163,6 +166,8 @@ typedef enum _QuantumExpressionOperator
|
|
163
166
|
AndQuantumOperator,
|
164
167
|
DivideQuantumOperator,
|
165
168
|
LShiftQuantumOperator,
|
169
|
+
MaxQuantumOperator,
|
170
|
+
MinQuantumOperator,
|
166
171
|
MultiplyQuantumOperator,
|
167
172
|
OrQuantumOperator,
|
168
173
|
RShiftQuantumOperator,
|
@@ -289,6 +294,9 @@ EXTERN VALUE Class_FilterTypes;
|
|
289
294
|
EXTERN VALUE Class_GravityType;
|
290
295
|
EXTERN VALUE Class_ImageType;
|
291
296
|
EXTERN VALUE Class_InterlaceType;
|
297
|
+
#if defined(HAVE_INTERPOLATEPIXELCOLOR)
|
298
|
+
EXTERN VALUE Class_InterpolatePixelMethod;
|
299
|
+
#endif
|
292
300
|
#if defined(HAVE_COMPAREIMAGELAYERS)
|
293
301
|
EXTERN VALUE Class_MagickLayerMethod;
|
294
302
|
#endif
|
@@ -545,6 +553,7 @@ ATTR_WRITER(Draw, rotation)
|
|
545
553
|
ATTR_WRITER(Draw, stroke)
|
546
554
|
ATTR_WRITER(Draw, stroke_width)
|
547
555
|
ATTR_WRITER(Draw, text_antialias)
|
556
|
+
ATTR_WRITER(Draw, tile)
|
548
557
|
ATTR_WRITER(Draw, undercolor)
|
549
558
|
extern VALUE Draw_annotate(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE);
|
550
559
|
extern VALUE Draw_clone(VALUE);
|
@@ -601,7 +610,7 @@ extern VALUE ImageList_coalesce(VALUE);
|
|
601
610
|
extern VALUE ImageList_deconstruct(VALUE);
|
602
611
|
extern VALUE ImageList_display(VALUE);
|
603
612
|
extern VALUE ImageList_flatten_images(VALUE);
|
604
|
-
extern VALUE ImageList_map(
|
613
|
+
extern VALUE ImageList_map(int, VALUE *, VALUE);
|
605
614
|
extern VALUE ImageList_montage(VALUE);
|
606
615
|
extern VALUE ImageList_morph(VALUE, VALUE);
|
607
616
|
extern VALUE ImageList_mosaic(VALUE);
|
@@ -657,6 +666,7 @@ ATTR_ACCESSOR(Info, scene)
|
|
657
666
|
ATTR_ACCESSOR(Info, server_name)
|
658
667
|
ATTR_ACCESSOR(Info, subimage)
|
659
668
|
ATTR_ACCESSOR(Info, subrange)
|
669
|
+
ATTR_WRITER(Info, texture)
|
660
670
|
ATTR_ACCESSOR(Info, tile)
|
661
671
|
ATTR_ACCESSOR(Info, size)
|
662
672
|
ATTR_ACCESSOR(Info, units)
|
@@ -672,6 +682,7 @@ extern VALUE Info_new(VALUE);
|
|
672
682
|
extern VALUE Info_define(int, VALUE *, VALUE);
|
673
683
|
extern VALUE Info_aset(VALUE, VALUE, VALUE, VALUE);
|
674
684
|
extern VALUE Info_aref(VALUE, VALUE, VALUE);
|
685
|
+
extern VALUE Info_channel(int, VALUE *, VALUE);
|
675
686
|
extern VALUE Info_undefine(VALUE, VALUE, VALUE);
|
676
687
|
extern VALUE Info_initialize(VALUE);
|
677
688
|
extern VALUE rm_info_new(void);
|
@@ -682,12 +693,13 @@ ATTR_ACCESSOR(Image, background_color)
|
|
682
693
|
ATTR_READER(Image, base_columns)
|
683
694
|
ATTR_READER(Image, base_filename)
|
684
695
|
ATTR_READER(Image, base_rows)
|
696
|
+
ATTR_ACCESSOR(Image, bias)
|
697
|
+
ATTR_ACCESSOR(Image, black_point_compensation)
|
685
698
|
ATTR_ACCESSOR(Image, blur)
|
686
699
|
ATTR_ACCESSOR(Image, border_color)
|
687
700
|
ATTR_READER(Image, bounding_box)
|
688
701
|
ATTR_ACCESSOR(Image, chromaticity)
|
689
702
|
ATTR_ACCESSOR(Image, class_type)
|
690
|
-
ATTR_WRITER(Image, clip_mask)
|
691
703
|
ATTR_ACCESSOR(Image, color_profile)
|
692
704
|
ATTR_READER(Image, colors)
|
693
705
|
ATTR_ACCESSOR(Image, colorspace)
|
@@ -712,6 +724,7 @@ ATTR_ACCESSOR(Image, image_type)
|
|
712
724
|
ATTR_ACCESSOR(Image, interlace)
|
713
725
|
ATTR_ACCESSOR(Image, iptc_profile)
|
714
726
|
ATTR_ACCESSOR(Image, iterations)
|
727
|
+
ATTR_ACCESSOR(Image, mask)
|
715
728
|
ATTR_ACCESSOR(Image, matte)
|
716
729
|
ATTR_ACCESSOR(Image, matte_color)
|
717
730
|
ATTR_READER(Image, mean_error_per_pixel)
|
@@ -725,6 +738,7 @@ ATTR_ACCESSOR(Image, offset)
|
|
725
738
|
ATTR_WRITER(Image, opacity)
|
726
739
|
ATTR_ACCESSOR(Image, orientation)
|
727
740
|
ATTR_ACCESSOR(Image, page)
|
741
|
+
ATTR_ACCESSOR(Image, pixel_interpolation_method)
|
728
742
|
ATTR_READER(Image, quality)
|
729
743
|
ATTR_READER(Image, quantum_depth)
|
730
744
|
ATTR_ACCESSOR(Image, rendering_intent)
|
@@ -734,11 +748,15 @@ ATTR_ACCESSOR(Image, start_loop)
|
|
734
748
|
ATTR_ACCESSOR(Image, ticks_per_second)
|
735
749
|
ATTR_ACCESSOR(Image, tile_info)
|
736
750
|
ATTR_READER(Image, total_colors)
|
751
|
+
ATTR_ACCESSOR(Image, transparent_color)
|
737
752
|
ATTR_ACCESSOR(Image, units)
|
738
753
|
ATTR_ACCESSOR(Image, virtual_pixel_method)
|
739
754
|
ATTR_ACCESSOR(Image, x_resolution)
|
740
755
|
ATTR_ACCESSOR(Image, y_resolution)
|
741
756
|
|
757
|
+
extern ChannelType extract_channels(int *, VALUE *);
|
758
|
+
extern void raise_ChannelType_error(VALUE);
|
759
|
+
|
742
760
|
#if defined(HAVE_RB_DEFINE_ALLOC_FUNC)
|
743
761
|
extern VALUE Image_alloc(VALUE);
|
744
762
|
extern VALUE Image_initialize(int, VALUE *, VALUE);
|
@@ -747,11 +765,15 @@ extern VALUE Image_new(int, VALUE *, VALUE);
|
|
747
765
|
extern VALUE Image_initialize(VALUE, VALUE, VALUE, VALUE, VALUE);
|
748
766
|
#endif
|
749
767
|
|
768
|
+
extern VALUE Image_adaptive_blur(int, VALUE *, VALUE);
|
769
|
+
extern VALUE Image_adaptive_blur_channel(int, VALUE *, VALUE);
|
770
|
+
extern VALUE Image_adaptive_resize(int, VALUE *, VALUE);
|
750
771
|
extern VALUE Image_adaptive_sharpen(int, VALUE *, VALUE);
|
751
772
|
extern VALUE Image_adaptive_sharpen_channel(int, VALUE *, VALUE);
|
752
773
|
extern VALUE Image_adaptive_threshold(int, VALUE *, VALUE);
|
753
774
|
extern VALUE Image_add_noise(VALUE, VALUE);
|
754
775
|
extern VALUE Image_add_noise_channel(int, VALUE *, VALUE);
|
776
|
+
extern VALUE Image_add_profile(VALUE, VALUE);
|
755
777
|
extern VALUE Image_affine_transform(VALUE, VALUE);
|
756
778
|
extern VALUE Image_aref(VALUE, VALUE);
|
757
779
|
extern VALUE Image_aset(VALUE, VALUE, VALUE);
|
@@ -760,6 +782,7 @@ extern VALUE Image_auto_orient_bang(VALUE);
|
|
760
782
|
extern VALUE Image_properties(VALUE);
|
761
783
|
extern VALUE Image_bilevel_channel(int, VALUE *, VALUE);
|
762
784
|
extern VALUE Image_black_threshold(int, VALUE *, VALUE);
|
785
|
+
extern VALUE Image_blend(int, VALUE *, VALUE);
|
763
786
|
extern VALUE Image_blur_image(int, VALUE *, VALUE);
|
764
787
|
extern VALUE Image_blur_channel(int, VALUE *, VALUE);
|
765
788
|
extern VALUE Image_border(VALUE, VALUE, VALUE, VALUE);
|
@@ -795,10 +818,13 @@ extern VALUE Image_copy(VALUE);
|
|
795
818
|
extern VALUE Image_crop(int, VALUE *, VALUE);
|
796
819
|
extern VALUE Image_crop_bang(int, VALUE *, VALUE);
|
797
820
|
extern VALUE Image_cycle_colormap(VALUE, VALUE);
|
821
|
+
extern VALUE Image_delete_profile(VALUE, VALUE);
|
798
822
|
extern VALUE Image_despeckle(VALUE);
|
799
823
|
extern VALUE Image_difference(VALUE, VALUE);
|
800
824
|
extern VALUE Image_dispatch(int, VALUE *, VALUE);
|
825
|
+
extern VALUE Image_displace(int, VALUE *, VALUE);
|
801
826
|
extern VALUE Image_display(VALUE);
|
827
|
+
extern VALUE Image_dissolve(int, VALUE *, VALUE);
|
802
828
|
extern VALUE Image_distortion_channel(int, VALUE *, VALUE);
|
803
829
|
extern VALUE Image__dump(VALUE, VALUE);
|
804
830
|
extern VALUE Image_dup(VALUE);
|
@@ -810,6 +836,7 @@ extern VALUE Image_equalize(VALUE);
|
|
810
836
|
extern VALUE Image_erase_bang(VALUE);
|
811
837
|
extern VALUE Image_export_pixels(int, VALUE *, VALUE);
|
812
838
|
extern VALUE Image_export_pixels_to_str(int, VALUE *, VALUE);
|
839
|
+
extern VALUE Image_find_similar_region(int, VALUE *, VALUE);
|
813
840
|
extern VALUE Image_flip(VALUE);
|
814
841
|
extern VALUE Image_flip_bang(VALUE);
|
815
842
|
extern VALUE Image_flop(VALUE);
|
@@ -839,7 +866,7 @@ extern VALUE Image_minify(VALUE);
|
|
839
866
|
extern VALUE Image_minify_bang(VALUE);
|
840
867
|
extern VALUE Image_modulate(int, VALUE *, VALUE);
|
841
868
|
extern VALUE Image_monochrome_q(VALUE);
|
842
|
-
extern VALUE Image_motion_blur(
|
869
|
+
extern VALUE Image_motion_blur(int, VALUE *, VALUE);
|
843
870
|
extern VALUE Image_negate(int, VALUE *, VALUE);
|
844
871
|
extern VALUE Image_negate_channel(int, VALUE *, VALUE);
|
845
872
|
extern VALUE Image_normalize(VALUE);
|
@@ -869,8 +896,8 @@ extern VALUE Image_reduce_noise(VALUE, VALUE);
|
|
869
896
|
extern VALUE Image_resize(int, VALUE *, VALUE);
|
870
897
|
extern VALUE Image_resize_bang(int, VALUE *, VALUE);
|
871
898
|
extern VALUE Image_roll(VALUE, VALUE, VALUE);
|
872
|
-
extern VALUE Image_rotate(
|
873
|
-
extern VALUE Image_rotate_bang(
|
899
|
+
extern VALUE Image_rotate(int, VALUE *, VALUE);
|
900
|
+
extern VALUE Image_rotate_bang(int, VALUE *, VALUE);
|
874
901
|
extern VALUE Image_sample(int, VALUE *, VALUE);
|
875
902
|
extern VALUE Image_sample_bang(int, VALUE *, VALUE);
|
876
903
|
extern VALUE Image_scale(int, VALUE *, VALUE);
|
@@ -887,6 +914,7 @@ extern VALUE Image_shave_bang(VALUE, VALUE, VALUE);
|
|
887
914
|
extern VALUE Image_shear(VALUE, VALUE, VALUE);
|
888
915
|
extern VALUE Image_sigmoidal_contrast_channel(int, VALUE *, VALUE);
|
889
916
|
extern VALUE Image_signature(VALUE);
|
917
|
+
extern VALUE Image_sketch(int, VALUE *, VALUE);
|
890
918
|
extern VALUE Image_solarize(int, VALUE *, VALUE);
|
891
919
|
extern VALUE Image_spaceship(VALUE, VALUE);
|
892
920
|
extern VALUE Image_splice(int, VALUE *, VALUE);
|
@@ -911,9 +939,11 @@ extern VALUE Image_transverse(VALUE);
|
|
911
939
|
extern VALUE Image_transverse_bang(VALUE);
|
912
940
|
extern VALUE Image_trim(VALUE);
|
913
941
|
extern VALUE Image_trim_bang(VALUE);
|
942
|
+
extern VALUE Image_unique_colors(VALUE);
|
914
943
|
extern VALUE Image_unsharp_mask(int, VALUE *, VALUE);
|
915
944
|
extern VALUE Image_unsharp_mask_channel(int, VALUE *, VALUE);
|
916
945
|
extern VALUE Image_vignette(int, VALUE *, VALUE);
|
946
|
+
extern VALUE Image_watermark(int, VALUE *, VALUE);
|
917
947
|
extern VALUE Image_wave(int, VALUE *, VALUE);
|
918
948
|
extern VALUE Image_white_threshold(int, VALUE *, VALUE);
|
919
949
|
extern VALUE Image_write(VALUE, VALUE);
|
@@ -991,6 +1021,9 @@ extern VALUE Pixel_to_s(VALUE);
|
|
991
1021
|
extern VALUE PixelPacket_to_Color_Name(Image *, PixelPacket *);
|
992
1022
|
extern VALUE PixelPacket_to_Color_Name_Info(Info *, PixelPacket *);
|
993
1023
|
extern VALUE Pixel_from_PixelPacket(PixelPacket *);
|
1024
|
+
#if defined(HAVE_MAGICKPIXELPACKET)
|
1025
|
+
extern VALUE Pixel_from_MagickPixelPacket(MagickPixelPacket *);
|
1026
|
+
#endif
|
994
1027
|
|
995
1028
|
extern void Point_to_PointInfo(PointInfo *, VALUE);
|
996
1029
|
extern VALUE PointInfo_to_Point(PointInfo *);
|
@@ -1005,6 +1038,12 @@ extern VALUE Segment_from_SegmentInfo(SegmentInfo *);
|
|
1005
1038
|
extern void AffineMatrix_to_AffineMatrix(AffineMatrix *, VALUE);
|
1006
1039
|
extern void ChromaticityInfo_to_ChromaticityInfo(ChromaticityInfo *, VALUE);
|
1007
1040
|
extern void Color_to_ColorInfo(ColorInfo *, VALUE);
|
1041
|
+
#if defined(HAVE_INTERPOLATEPIXELCOLOR)
|
1042
|
+
extern VALUE InterpolatePixelMethod_new(InterpolatePixelMethod);
|
1043
|
+
#endif
|
1044
|
+
#if defined(HAVE_IMAGE_ORIENTATION)
|
1045
|
+
extern VALUE OrientationType_new(OrientationType);
|
1046
|
+
#endif
|
1008
1047
|
extern void PrimaryInfo_to_PrimaryInfo(PrimaryInfo *, VALUE);
|
1009
1048
|
extern void Rectangle_to_RectangleInfo(RectangleInfo *, VALUE);
|
1010
1049
|
extern void Segment_to_SegmentInfo(SegmentInfo *, VALUE);
|
@@ -1016,11 +1055,8 @@ extern VALUE TypeMetric_from_TypeMetric(TypeMetric *);
|
|
1016
1055
|
#if defined(HAVE_GETIMAGESTATISTICS)
|
1017
1056
|
extern VALUE Statistics_new(ImageStatistics *);
|
1018
1057
|
#endif
|
1019
|
-
#if defined(HAVE_IMAGE_ORIENTATION)
|
1020
|
-
extern VALUE OrientationType_new(OrientationType);
|
1021
|
-
#endif
|
1022
1058
|
extern const char *StorageType_name(StorageType);
|
1023
|
-
extern VALUE
|
1059
|
+
extern VALUE VirtualPixelMethod_new(VirtualPixelMethod);
|
1024
1060
|
|
1025
1061
|
#if defined(HAVE_RB_DEFINE_ALLOC_FUNC)
|
1026
1062
|
extern VALUE Enum_alloc(VALUE);
|
@@ -1060,6 +1096,7 @@ extern void rm_not_implemented(void);
|
|
1060
1096
|
extern void rm_attr_write(VALUE, VALUE);
|
1061
1097
|
extern void rm_get_geometry(VALUE, long *, long *, unsigned long *, unsigned long *, int *);
|
1062
1098
|
extern void rm_split(Image *);
|
1099
|
+
extern void rm_magick_error(const char *, const char *);
|
1063
1100
|
|
1064
1101
|
typedef enum
|
1065
1102
|
{
|
@@ -1,6 +1,10 @@
|
|
1
1
|
#undef GRAPHICSMAGICK
|
2
2
|
/* Introduced in IM 6.0.0, GM 1.1 */
|
3
3
|
#undef HAVE_ACQUIREMAGICKMEMORY
|
4
|
+
/* Introduced in IM 6.2.8-5 */
|
5
|
+
#undef HAVE_ADAPTIVEBLURIMAGECHANNEL
|
6
|
+
/* Introduced in IM 6.2.9 */
|
7
|
+
#undef HAVE_ADAPTIVERESIZEIMAGE
|
4
8
|
/* Introduced in IM 6.2.7 */
|
5
9
|
#undef HAVE_ADAPTIVESHARPENIMAGE
|
6
10
|
/* Introduced in IM 6.0.0 */
|
@@ -71,6 +75,8 @@
|
|
71
75
|
#undef HAVE_GETIMAGECHANNELMEAN
|
72
76
|
/* Introduced in IM 6.2.0 */
|
73
77
|
#undef HAVE_GETIMAGECHANNELDISTORTION
|
78
|
+
/* Not available in GM */
|
79
|
+
#undef HAVE_GETIMAGECLIPMASK
|
74
80
|
/* Introduced in IM 6.0.0, GM 1.1 */
|
75
81
|
#undef HAVE_GETIMAGEHISTOGRAM
|
76
82
|
/* Introduced in IM 6.1.5 */
|
@@ -109,6 +115,8 @@
|
|
109
115
|
/* Introduced in IM 6.0.0 - Not available in GM */
|
110
116
|
#undef HAVE_INHERITEXCEPTION
|
111
117
|
#undef HAVE_INDEXCHANNEL
|
118
|
+
/* Introduced in IM 6.2.0 */
|
119
|
+
#undef HAVE_IMAGE_BIAS
|
112
120
|
/* Introduced in IM 5.5.6 - Not available in GM */
|
113
121
|
#undef HAVE_IMAGE_EXTRACT_INFO
|
114
122
|
/* Introduced in IM 6.0.0 */
|
@@ -118,13 +126,21 @@
|
|
118
126
|
#undef HAVE_IMAGEINFO_ORIENTATION
|
119
127
|
/* Introduced in IM 6.2.4 */
|
120
128
|
#undef HAVE_IMAGE_TICKS_PER_SECOND
|
129
|
+
/* Introduced in IM 6.2.9 */
|
130
|
+
#undef HAVE_IMAGE_TRANSPARENT_COLOR
|
131
|
+
/* Introduced in IM 6.2.0? */
|
132
|
+
#undef HAVE_IMAGEINFO_CHANNEL
|
121
133
|
/* Introduced in IM 5.5.7, GM 1.1 */
|
122
134
|
#undef HAVE_IMPORTIMAGEPIXELS
|
135
|
+
/* Introduced in IM 6.2.9 */
|
136
|
+
#undef HAVE_INTERPOLATEPIXELCOLOR
|
123
137
|
/* Introduced in IM 6.2.6-1 */
|
124
138
|
#undef HAVE_INTERPRETIMAGEATTRIBUTES
|
125
139
|
#undef HAVE_INTTYPES_H
|
126
140
|
/* Introduced in IM 6.2.5 */
|
127
141
|
#undef HAVE_ISCOLORSIMILAR
|
142
|
+
/* Introduced in IM 6.2.8 */
|
143
|
+
#undef HAVE_ISIMAGESIMILAR
|
128
144
|
/* Introduced in IM 6.2.2 */
|
129
145
|
#undef HAVE_JPEG2000COMPRESSION
|
130
146
|
/* Introduced in GM 1.2 */
|
@@ -138,8 +154,12 @@
|
|
138
154
|
#undef HAVE_MAGICK_UINT64_T
|
139
155
|
/* Introduced in IM 6.0.0 */
|
140
156
|
#undef HAVE_MAGICKOFFSETTYPE
|
157
|
+
/* Only in ImageMagick */
|
158
|
+
#undef HAVE_MAGICKPIXELPACKET
|
141
159
|
/* Introduced in IM 6.0.0, GM 1.1 */
|
142
160
|
#undef HAVE_MAGICKSIZETYPE
|
161
|
+
/* Introduced in IM 6.2.0 */
|
162
|
+
#undef HAVE_MAXEVALUATEOPERATOR
|
143
163
|
#undef HAVE_MEMORY_H
|
144
164
|
/* Introduced in IM 6.0.0, GM 1.1 */
|
145
165
|
#undef HAVE_NEGATEIMAGECHANNEL
|
@@ -191,6 +211,8 @@
|
|
191
211
|
#undef HAVE_SHARPENIMAGECHANNEL
|
192
212
|
/* Introduced in IM 6.2.1 */
|
193
213
|
#undef HAVE_SIGMOIDALCONTRASTIMAGECHANNEL
|
214
|
+
/* Introduced in IM 6.2.8 */
|
215
|
+
#undef HAVE_SKETCHIMAGE
|
194
216
|
#undef HAVE_SNPRINTF
|
195
217
|
#undef HAVE_SPLICEIMAGE
|
196
218
|
#undef HAVE_STDINT_H
|
@@ -210,6 +232,8 @@
|
|
210
232
|
#undef HAVE_TRANSVERSEIMAGE
|
211
233
|
/* Introduced in IM 6.0.0 */
|
212
234
|
#undef HAVE_UNDEFINEDGRAVITY
|
235
|
+
/* Introduced in IM 6.2.9 */
|
236
|
+
#undef HAVE_UNIQUEIMAGECOLORS
|
213
237
|
#undef HAVE_UNISTD_H
|
214
238
|
/* Introduced in IM 6.1.0 */
|
215
239
|
#undef HAVE_UNSHARPMASKIMAGECHANNEL
|
data/ext/RMagick/rmdraw.c
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
/* $Id: rmdraw.c,v 1.
|
1
|
+
/* $Id: rmdraw.c,v 1.34 2006/09/01 19:19:20 rmagick Exp $ */
|
2
2
|
/*============================================================================\
|
3
3
|
| Copyright (C) 2006 by Timothy P. Hunter
|
4
4
|
| Name: rmdraw.c
|
@@ -373,6 +373,36 @@ Draw_text_antialias_eq(VALUE self, VALUE text_antialias)
|
|
373
373
|
return self;
|
374
374
|
}
|
375
375
|
|
376
|
+
/*
|
377
|
+
Method: Draw#tile=
|
378
|
+
Purpose: tile attribute writer
|
379
|
+
*/
|
380
|
+
VALUE
|
381
|
+
Draw_tile_eq(VALUE self, VALUE image)
|
382
|
+
{
|
383
|
+
Draw *draw;
|
384
|
+
Image *tile;
|
385
|
+
|
386
|
+
rm_check_frozen(self);
|
387
|
+
Data_Get_Struct(self, Draw, draw);
|
388
|
+
|
389
|
+
if (draw->info->fill_pattern)
|
390
|
+
{
|
391
|
+
DestroyImage(draw->info->fill_pattern);
|
392
|
+
draw->info->fill_pattern = NULL;
|
393
|
+
}
|
394
|
+
|
395
|
+
if (image == Qnil)
|
396
|
+
{
|
397
|
+
return self;
|
398
|
+
}
|
399
|
+
|
400
|
+
Data_Get_Struct(ImageList_cur_image(image), Image, tile);
|
401
|
+
draw->info->fill_pattern = rm_clone_image(tile);
|
402
|
+
|
403
|
+
return self;
|
404
|
+
}
|
405
|
+
|
376
406
|
/*
|
377
407
|
Method: Draw#undercolor=
|
378
408
|
Purpose: undercolor attribute writer
|
@@ -445,13 +475,8 @@ VALUE Draw_annotate(
|
|
445
475
|
x = NUM2LONG(x_arg);
|
446
476
|
y = NUM2LONG(y_arg);
|
447
477
|
|
448
|
-
|
449
|
-
if (width == 0 || height == 0)
|
478
|
+
if (width == 0 && height == 0)
|
450
479
|
{
|
451
|
-
if (width != 0 || height != 0)
|
452
|
-
{
|
453
|
-
rb_raise(rb_eArgError, "invalid geometry %lux%lu%+ld%+ld", width, height, x, y);
|
454
|
-
}
|
455
480
|
sprintf(geometry_str, "%+ld%+ld", x, y);
|
456
481
|
}
|
457
482
|
|
data/ext/RMagick/rmilist.c
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
/* $Id: rmilist.c,v 1.
|
1
|
+
/* $Id: rmilist.c,v 1.43 2006/08/29 22:33:25 rmagick Exp $ */
|
2
2
|
/*============================================================================\
|
3
3
|
| Copyright (C) 2006 by Timothy P. Hunter
|
4
4
|
| Name: rmilist.c
|
@@ -23,13 +23,14 @@ ImageList_animate(int argc, VALUE *argv, VALUE self)
|
|
23
23
|
Info *info;
|
24
24
|
volatile VALUE info_obj;
|
25
25
|
|
26
|
-
// Convert the images array to an images sequence.
|
27
|
-
images = rm_images_from_imagelist(self);
|
28
|
-
|
29
26
|
if (argc > 1)
|
30
27
|
{
|
31
28
|
rb_raise(rb_eArgError, "wrong number of arguments (%d for 0 or 1)", argc);
|
32
29
|
}
|
30
|
+
|
31
|
+
// Convert the images array to an images sequence.
|
32
|
+
images = rm_images_from_imagelist(self);
|
33
|
+
|
33
34
|
if (argc == 1)
|
34
35
|
{
|
35
36
|
Image *img;
|
@@ -174,13 +175,13 @@ ImageList_display(VALUE self)
|
|
174
175
|
Info *info;
|
175
176
|
volatile VALUE info_obj;
|
176
177
|
|
177
|
-
// Convert the images array to an images sequence.
|
178
|
-
images = rm_images_from_imagelist(self);
|
179
|
-
|
180
178
|
// Create a new Info object to use with this call
|
181
179
|
info_obj = rm_info_new();
|
182
180
|
Data_Get_Struct(info_obj, Info, info);
|
183
181
|
|
182
|
+
// Convert the images array to an images sequence.
|
183
|
+
images = rm_images_from_imagelist(self);
|
184
|
+
|
184
185
|
(void) DisplayImages(info, images);
|
185
186
|
rm_split(images);
|
186
187
|
rm_check_image_exception(images, RetainOnError);
|
@@ -215,21 +216,31 @@ ImageList_flatten_images(VALUE self)
|
|
215
216
|
|
216
217
|
|
217
218
|
/*
|
218
|
-
Method: ImageList#map
|
219
|
+
Method: ImageList#map(reference, dither=false)
|
219
220
|
Purpose: Call MapImages
|
220
221
|
Returns: a new ImageList with mapped images. @scene is set to self.scene
|
221
222
|
*/
|
222
223
|
VALUE
|
223
|
-
ImageList_map(
|
224
|
+
ImageList_map(int argc, VALUE *argv, VALUE self)
|
224
225
|
{
|
225
226
|
Image *images, *new_images = NULL;
|
226
227
|
Image *map;
|
227
|
-
unsigned int dither;
|
228
|
-
volatile VALUE
|
228
|
+
unsigned int dither = False;
|
229
|
+
volatile VALUE scene, new_imagelist;
|
229
230
|
ExceptionInfo exception;
|
230
231
|
|
231
|
-
|
232
|
-
|
232
|
+
switch (argc)
|
233
|
+
{
|
234
|
+
case 2:
|
235
|
+
dither = RTEST(argv[1]);
|
236
|
+
case 1:
|
237
|
+
Data_Get_Struct(ImageList_cur_image(argv[0]), Image, map);
|
238
|
+
break;
|
239
|
+
default:
|
240
|
+
rb_raise(rb_eArgError, "wrong number of arguments (%d for 1 or 2)", argc);
|
241
|
+
break;
|
242
|
+
}
|
243
|
+
|
233
244
|
|
234
245
|
if (rm_imagelist_length(self) == 0)
|
235
246
|
{
|
@@ -248,7 +259,6 @@ ImageList_map(VALUE self, VALUE map_image, VALUE dither_arg)
|
|
248
259
|
rm_ensure_result(new_images);
|
249
260
|
|
250
261
|
// Call ImageMagick
|
251
|
-
dither = !(dither_arg == Qfalse || dither_arg == Qnil);
|
252
262
|
(void) MapImages(new_images, map, dither);
|
253
263
|
rm_check_image_exception(new_images, DestroyOnError);
|
254
264
|
|
@@ -337,8 +347,8 @@ ImageList_morph(VALUE self, VALUE nimages)
|
|
337
347
|
rb_raise(rb_eArgError, "number of intervening images must be > 0");
|
338
348
|
}
|
339
349
|
|
340
|
-
images = rm_images_from_imagelist(self);
|
341
350
|
GetExceptionInfo(&exception);
|
351
|
+
images = rm_images_from_imagelist(self);
|
342
352
|
new_images = MorphImages(images, (unsigned long)number_images, &exception);
|
343
353
|
rm_split(images);
|
344
354
|
rm_check_exception(&exception, new_images, DestroyOnError);
|
@@ -360,8 +370,8 @@ ImageList_mosaic(VALUE self)
|
|
360
370
|
Image *images, *new_image;
|
361
371
|
ExceptionInfo exception;
|
362
372
|
|
363
|
-
images = rm_images_from_imagelist(self);
|
364
373
|
GetExceptionInfo(&exception);
|
374
|
+
images = rm_images_from_imagelist(self);
|
365
375
|
new_image = MosaicImages(images, &exception);
|
366
376
|
rm_split(images);
|
367
377
|
rm_check_exception(&exception, new_image, DestroyOnError);
|
@@ -386,29 +396,34 @@ ImageList_optimize_layers(VALUE self, VALUE method)
|
|
386
396
|
MagickLayerMethod mthd;
|
387
397
|
ExceptionInfo exception;
|
388
398
|
|
389
|
-
images = rm_images_from_imagelist(self);
|
390
399
|
GetExceptionInfo(&exception);
|
391
400
|
VALUE_TO_ENUM(method, mthd, MagickLayerMethod);
|
401
|
+
images = rm_images_from_imagelist(self);
|
392
402
|
|
393
403
|
switch (mthd)
|
394
404
|
{
|
395
405
|
#if defined(HAVE_COALESCELAYER)
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
406
|
+
case CoalesceLayer:
|
407
|
+
new_images = CoalesceImages(images, &exception);
|
408
|
+
break;
|
409
|
+
case DisposeLayer:
|
410
|
+
new_images = DisposeImages(images, &exception);
|
411
|
+
break;
|
402
412
|
#endif
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
413
|
+
case OptimizeLayer:
|
414
|
+
new_images = OptimizeImageLayers(images, &exception);
|
415
|
+
break;
|
416
|
+
case OptimizePlusLayer:
|
417
|
+
new_images = OptimizePlusImageLayers(images, &exception);
|
418
|
+
break;
|
419
|
+
case CompareAnyLayer:
|
420
|
+
case CompareClearLayer:
|
421
|
+
case CompareOverlayLayer:
|
422
|
+
new_images = CompareImageLayers(images, mthd, &exception);
|
423
|
+
break;
|
424
|
+
default:
|
425
|
+
rb_raise(rb_eArgError, "undefined layer method");
|
426
|
+
break;
|
412
427
|
}
|
413
428
|
|
414
429
|
rm_split(images);
|
@@ -631,7 +646,7 @@ ImageList_to_blob(VALUE self)
|
|
631
646
|
|
632
647
|
GetExceptionInfo(&exception);
|
633
648
|
(void) SetImageInfo(info, True, &exception);
|
634
|
-
|
649
|
+
rm_check_exception(&exception, images, RetainOnError);
|
635
650
|
|
636
651
|
if (*info->magick != '\0')
|
637
652
|
{
|
@@ -707,9 +722,6 @@ ImageList_write(VALUE self, VALUE file)
|
|
707
722
|
Data_Get_Struct(info_obj, Info, info);
|
708
723
|
|
709
724
|
|
710
|
-
// Convert the images array to an images sequence.
|
711
|
-
images = rm_images_from_imagelist(self);
|
712
|
-
|
713
725
|
if (TYPE(file) == T_FILE)
|
714
726
|
{
|
715
727
|
OpenFile *fptr;
|
@@ -731,6 +743,9 @@ ImageList_write(VALUE self, VALUE file)
|
|
731
743
|
SetImageInfoFile(info, NULL);
|
732
744
|
}
|
733
745
|
|
746
|
+
// Convert the images array to an images sequence.
|
747
|
+
images = rm_images_from_imagelist(self);
|
748
|
+
|
734
749
|
// Copy the filename into each images. Set a scene number to be used if
|
735
750
|
// writing multiple files. (Ref: ImageMagick's utilities/convert.c
|
736
751
|
for (scene = 0, img = images; img; img = GetNextImageInList(img))
|
@@ -741,10 +756,13 @@ ImageList_write(VALUE self, VALUE file)
|
|
741
756
|
|
742
757
|
GetExceptionInfo(&exception);
|
743
758
|
(void) SetImageInfo(info, True, &exception);
|
759
|
+
rm_check_exception(&exception, images, RetainOnError);
|
760
|
+
DestroyExceptionInfo(&exception);
|
744
761
|
|
745
762
|
// Find out if the format supports multi-images files.
|
763
|
+
GetExceptionInfo(&exception);
|
746
764
|
m = GetMagickInfo(info->magick, &exception);
|
747
|
-
|
765
|
+
rm_check_exception(&exception, images, RetainOnError);
|
748
766
|
DestroyExceptionInfo(&exception);
|
749
767
|
|
750
768
|
// Tell WriteImage if we want a multi-images file.
|