rmagick 2.11.1 → 2.12.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 +7 -0
- data/README.html +7 -7
- data/build_tarball.rake +1 -1
- data/doc/comtasks.html +2 -2
- data/doc/constants.html +2 -2
- data/doc/draw.html +58 -7
- data/doc/ex/crop.rb +3 -3
- data/doc/ilist.html +2 -2
- data/doc/image1.html +70 -6
- data/doc/image2.html +77 -3
- data/doc/image3.html +6 -3
- data/doc/imageattrs.html +2 -2
- data/doc/imusage.html +2 -2
- data/doc/index.html +3 -3
- data/doc/info.html +2 -2
- data/doc/magick.html +2 -2
- data/doc/optequiv.html +47 -6
- data/doc/rvg.html +2 -2
- data/doc/rvgclip.html +2 -2
- data/doc/rvggroup.html +2 -2
- data/doc/rvgimage.html +2 -2
- data/doc/rvgpattern.html +2 -2
- data/doc/rvgshape.html +2 -2
- data/doc/rvgstyle.html +2 -2
- data/doc/rvgtext.html +2 -2
- data/doc/rvgtspan.html +2 -2
- data/doc/rvgtut.html +2 -2
- data/doc/rvguse.html +2 -2
- data/doc/rvgxform.html +2 -2
- data/doc/struct.html +2 -2
- data/doc/usage.html +24 -9
- data/ext/RMagick/MANIFEST +1 -1
- data/ext/RMagick/extconf.rb +9 -1
- data/ext/RMagick/rmagick.h +6 -1
- data/ext/RMagick/rmdraw.c +25 -1
- data/ext/RMagick/rmilist.c +8 -2
- data/ext/RMagick/rmimage.c +129 -3
- data/ext/RMagick/rmmain.c +20 -2
- data/ext/RMagick/rmutil.c +1 -11
- data/lib/RMagick.rb +25 -11
- data/rmagick.gemspec +3 -3
- metadata +4 -4
data/doc/struct.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
<meta name="generator" content=
|
7
7
|
"HTML Tidy for Linux/x86 (vers 6 November 2007), see www.w3.org" />
|
8
8
|
|
9
|
-
<title>RMagick 2.
|
9
|
+
<title>RMagick 2.12.0: Miscellaneous classes</title>
|
10
10
|
<meta http-equiv="Content-Type" content=
|
11
11
|
"text/html; charset=us-ascii" />
|
12
12
|
<meta name="GENERATOR" content="Quanta Plus" />
|
@@ -27,7 +27,7 @@
|
|
27
27
|
</head>
|
28
28
|
|
29
29
|
<body>
|
30
|
-
<h6 id="header">RMagick 2.
|
30
|
+
<h6 id="header">RMagick 2.12.0 User's Guide and Reference</h6>
|
31
31
|
|
32
32
|
<div class="nav">
|
33
33
|
« <a href="draw.html">Prev</a> | <a href=
|
data/doc/usage.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
<meta name="generator" content=
|
7
7
|
"HTML Tidy for Linux/x86 (vers 7 December 2008), see www.w3.org" />
|
8
8
|
|
9
|
-
<title>RMagick 2.
|
9
|
+
<title>RMagick 2.12.0: How to use RMagick</title>
|
10
10
|
<meta http-equiv="Content-Type" content=
|
11
11
|
"text/html; charset=us-ascii" />
|
12
12
|
<meta name="GENERATOR" content="Quanta Plus" />
|
@@ -90,7 +90,7 @@
|
|
90
90
|
</head>
|
91
91
|
|
92
92
|
<body>
|
93
|
-
<h6 id="header">RMagick 2.
|
93
|
+
<h6 id="header">RMagick 2.12.0 User's Guide and Reference</h6>
|
94
94
|
|
95
95
|
<div class="nav">
|
96
96
|
« <a href="index.html">Prev</a> | <a href=
|
@@ -1024,12 +1024,26 @@ exit
|
|
1024
1024
|
|
1025
1025
|
<dd>Apply a histogram equalization to the image</dd>
|
1026
1026
|
|
1027
|
-
<dt><a href=
|
1027
|
+
<dt><a href=
|
1028
|
+
"image2.html#function_channel">function_channel</a></dt>
|
1029
|
+
|
1030
|
+
<dd>Apply a function to selected channel values</dd>
|
1031
|
+
|
1032
|
+
<dt class="ilist"><a href="ilist.html#fx">fx</a></dt>
|
1033
|
+
|
1034
|
+
<dd class="ilist">Apply a mathematical expression to an
|
1035
|
+
image</dd>
|
1036
|
+
|
1037
|
+
<dt><a href=
|
1038
|
+
"image1.html#auto_gamma_channel">auto_gamma_channel</a>,
|
1039
|
+
<a href="image2.html#gamma_correct">gamma_correct</a>,
|
1028
1040
|
<a href="image2.html#gamma_channel">gamma_channel</a></dt>
|
1029
1041
|
|
1030
1042
|
<dd>Gamma correct the image</dd>
|
1031
1043
|
|
1032
|
-
<dt><a href=
|
1044
|
+
<dt><a href=
|
1045
|
+
"image1.html#auto_level_channel">auto_level_channel</a>,
|
1046
|
+
<a href="image2.html#level">level,</a> <a href=
|
1033
1047
|
"image2.html#level_channel">level_channel</a>, <a href=
|
1034
1048
|
"image2.html#level_colors">level_colors</a>, <a href=
|
1035
1049
|
"image2.html#levelize_channel">levelize_channel</a></dt>
|
@@ -1063,6 +1077,12 @@ exit
|
|
1063
1077
|
|
1064
1078
|
<dd>Enhance the contrast of the image</dd>
|
1065
1079
|
|
1080
|
+
<dt><a href=
|
1081
|
+
"image3.html#quantum_operator">quantum_operator</a></dt>
|
1082
|
+
|
1083
|
+
<dd>Performs an integer arithmetic operation on selected
|
1084
|
+
channels values</dd>
|
1085
|
+
|
1066
1086
|
<dt><a href="image3.html#reduce_noise">reduce_noise</a></dt>
|
1067
1087
|
|
1068
1088
|
<dd>Smooth the contours of an image while still preserving
|
@@ -1139,11 +1159,6 @@ exit
|
|
1139
1159
|
|
1140
1160
|
<dd>Apply a custom convolution kernel to the image</dd>
|
1141
1161
|
|
1142
|
-
<dt class="ilist"><a href="ilist.html#fx">fx</a></dt>
|
1143
|
-
|
1144
|
-
<dd class="ilist">apply a mathematical expression to an
|
1145
|
-
image</dd>
|
1146
|
-
|
1147
1162
|
<dt><a href="image3.html#segment">segment</a></dt>
|
1148
1163
|
|
1149
1164
|
<dd>Segment an image by analyzing the histograms of the color
|
data/ext/RMagick/MANIFEST
CHANGED
data/ext/RMagick/extconf.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require "mkmf"
|
2
2
|
require "date"
|
3
3
|
|
4
|
-
RMAGICK_VERS = "2.
|
4
|
+
RMAGICK_VERS = "2.12.0"
|
5
5
|
MIN_RUBY_VERS = "1.8.5"
|
6
6
|
MIN_RUBY_VERS_NO = MIN_RUBY_VERS.tr(".","").to_i
|
7
7
|
MIN_IM_VERS = "6.3.5"
|
@@ -194,16 +194,20 @@ have_func("snprintf", headers)
|
|
194
194
|
["AcquireImage", # 6.4.1
|
195
195
|
"AffinityImage", # 6.4.3-6
|
196
196
|
"AffinityImages", # 6.4.3-6
|
197
|
+
"AutoGammaImageChannel", # 6.5.5-1
|
198
|
+
"AutoLevelImageChannel", # 6.5.5-1
|
197
199
|
"BlueShiftImage", # 6.5.4-3
|
198
200
|
"DeskewImage", # 6.4.2-5
|
199
201
|
"EncipherImage", # 6.3.8-6
|
200
202
|
"EqualizeImageChannel", # 6.3.6-9
|
201
203
|
"FloodfillPaintImage", # 6.3.7
|
204
|
+
"FunctionImageChannel", # 6.4.8-8
|
202
205
|
"GetAuthenticIndexQueue", # 6.4.5-6
|
203
206
|
"GetAuthenticPixels", # 6.4.5-6
|
204
207
|
"GetImageAlphaChannel", # 6.3.9-2
|
205
208
|
"GetVirtualPixels", # 6.4.5-6
|
206
209
|
"LevelImageColors", # 6.4.2
|
210
|
+
"LevelColorsImageChannel", # 6.5.6-4
|
207
211
|
"LevelizeImageChannel", # 6.4.2
|
208
212
|
"LiquidRescaleImage", # 6.3.8-2
|
209
213
|
"OpaquePaintImageChannel", # 6.3.7-10
|
@@ -252,8 +256,10 @@ end
|
|
252
256
|
|
253
257
|
have_struct_member("Image", "type", headers) # ???
|
254
258
|
have_struct_member("DrawInfo", "kerning", headers) # 6.4.7-8
|
259
|
+
have_struct_member("DrawInfo", "interline_spacing", headers) # 6.5.5-8
|
255
260
|
have_struct_member("DrawInfo", "interword_spacing", headers) # 6.4.8-0
|
256
261
|
have_type("DitherMethod", headers) # 6.4.2
|
262
|
+
have_type("MagickFunction", headers) # 6.4.8-8
|
257
263
|
have_type("ImageLayerMethod", headers) # 6.3.6 replaces MagickLayerMethod
|
258
264
|
have_type("long double", headers)
|
259
265
|
#have_type("unsigned long long", headers)
|
@@ -314,6 +320,8 @@ have_enum_values("MagickEvaluateOperator", ["PowEvaluateOperator", # 6
|
|
314
320
|
"SineEvaluateOperator", # 6.4.8-5
|
315
321
|
"AddModulusEvaluateOperator"], # 6.4.8-5
|
316
322
|
headers)
|
323
|
+
have_enum_values("MagickFunction", ["ArcsinFunction", # 6.5.2-8
|
324
|
+
"ArctanFunction"], headers) # 6.5.2-8
|
317
325
|
have_enum_values("ImageLayerMethod", ["FlattenLayer", # 6.3.6-2
|
318
326
|
"MergeLayer", # 6.3.6
|
319
327
|
"MosaicLayer", # 6.3.6-2
|
data/ext/RMagick/rmagick.h
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
/* $Id: rmagick.h,v 1.
|
1
|
+
/* $Id: rmagick.h,v 1.278 2009/09/15 22:09:44 rmagick Exp $ */
|
2
2
|
/*=============================================================================
|
3
3
|
| Copyright (C) 2009 by Timothy P. Hunter
|
4
4
|
| Name: rmagick.h
|
@@ -363,6 +363,7 @@ EXTERN VALUE Class_ImageType;
|
|
363
363
|
EXTERN VALUE Class_InterlaceType;
|
364
364
|
EXTERN VALUE Class_InterpolatePixelMethod;
|
365
365
|
EXTERN VALUE CLASS_LAYERMETHODTYPE;
|
366
|
+
EXTERN VALUE Class_MagickFunction;
|
366
367
|
EXTERN VALUE Class_NoiseType;
|
367
368
|
EXTERN VALUE Class_OrientationType;
|
368
369
|
EXTERN VALUE Class_PaintMethod;
|
@@ -632,6 +633,7 @@ ATTR_WRITER(Draw, font_stretch)
|
|
632
633
|
ATTR_WRITER(Draw, font_style)
|
633
634
|
ATTR_WRITER(Draw, font_weight)
|
634
635
|
ATTR_WRITER(Draw, gravity)
|
636
|
+
ATTR_WRITER(Draw, interline_spacing)
|
635
637
|
ATTR_WRITER(Draw, interword_spacing)
|
636
638
|
ATTR_WRITER(Draw, kerning)
|
637
639
|
ATTR_WRITER(Draw, pointsize)
|
@@ -867,6 +869,8 @@ extern VALUE Image_alpha(int, VALUE *, VALUE);
|
|
867
869
|
extern VALUE Image_alpha_q(VALUE);
|
868
870
|
extern VALUE Image_aref(VALUE, VALUE);
|
869
871
|
extern VALUE Image_aset(VALUE, VALUE, VALUE);
|
872
|
+
extern VALUE Image_auto_gamma_channel(int, VALUE *, VALUE);
|
873
|
+
extern VALUE Image_auto_level_channel(int, VALUE *, VALUE);
|
870
874
|
extern VALUE Image_auto_orient(VALUE);
|
871
875
|
extern VALUE Image_auto_orient_bang(VALUE);
|
872
876
|
extern VALUE Image_properties(VALUE);
|
@@ -951,6 +955,7 @@ extern VALUE Image_flop(VALUE);
|
|
951
955
|
extern VALUE Image_flop_bang(VALUE);
|
952
956
|
extern VALUE Image_frame(int, VALUE *, VALUE);
|
953
957
|
extern VALUE Image_from_blob(VALUE, VALUE);
|
958
|
+
extern VALUE Image_function_channel(int, VALUE *, VALUE);
|
954
959
|
extern VALUE Image_gamma_channel(int, VALUE *, VALUE);
|
955
960
|
extern VALUE Image_gamma_correct(int, VALUE *, VALUE);
|
956
961
|
extern VALUE Image_gaussian_blur(int, VALUE *, VALUE);
|
data/ext/RMagick/rmdraw.c
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
/* $Id: rmdraw.c,v 1.
|
1
|
+
/* $Id: rmdraw.c,v 1.82 2009/09/11 22:29:30 rmagick Exp $ */
|
2
2
|
/*============================================================================\
|
3
3
|
| Copyright (C) 2009 by Timothy P. Hunter
|
4
4
|
| Name: rmdraw.c
|
@@ -322,6 +322,30 @@ Draw_kerning_eq(VALUE self, VALUE kerning)
|
|
322
322
|
}
|
323
323
|
|
324
324
|
|
325
|
+
/*
|
326
|
+
Method: Draw#interline_spacing
|
327
|
+
Purpose: space between two liness
|
328
|
+
Notes: new for 6.5.5-8
|
329
|
+
*/
|
330
|
+
VALUE
|
331
|
+
Draw_interline_spacing_eq(VALUE self, VALUE spacing)
|
332
|
+
{
|
333
|
+
#if defined(HAVE_ST_INTERLINE_SPACING)
|
334
|
+
Draw *draw;
|
335
|
+
|
336
|
+
rb_check_frozen(self);
|
337
|
+
Data_Get_Struct(self, Draw, draw);
|
338
|
+
draw->info->interline_spacing = NUM2DBL(spacing);
|
339
|
+
return self;
|
340
|
+
#else
|
341
|
+
rm_not_implemented();
|
342
|
+
return (VALUE)0;
|
343
|
+
self = self;
|
344
|
+
spacing = spacing;
|
345
|
+
#endif
|
346
|
+
}
|
347
|
+
|
348
|
+
|
325
349
|
/*
|
326
350
|
Method: Draw#interword_spacing
|
327
351
|
Purpose: space between two words
|
data/ext/RMagick/rmilist.c
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
/* $Id: rmilist.c,v 1.
|
1
|
+
/* $Id: rmilist.c,v 1.93 2009/09/26 22:31:10 rmagick Exp $ */
|
2
2
|
/*============================================================================\
|
3
3
|
| Copyright (C) 2009 by Timothy P. Hunter
|
4
4
|
| Name: rmilist.c
|
@@ -510,6 +510,7 @@ ImageList_optimize_layers(VALUE self, VALUE method)
|
|
510
510
|
Image *images, *new_images, *new_images2;
|
511
511
|
LAYERMETHODTYPE mthd;
|
512
512
|
ExceptionInfo exception;
|
513
|
+
QuantizeInfo quantize_info;
|
513
514
|
|
514
515
|
new_images2 = NULL; // defeat "unused variable" message
|
515
516
|
|
@@ -561,7 +562,12 @@ ImageList_optimize_layers(VALUE self, VALUE method)
|
|
561
562
|
OptimizeImageTransparency(new_images, &exception);
|
562
563
|
rm_check_exception(&exception, new_images, DestroyOnError);
|
563
564
|
// mogrify supports -dither here. We don't.
|
565
|
+
#if defined(HAVE_REMAPIMAGE)
|
566
|
+
GetQuantizeInfo(&quantize_info);
|
567
|
+
(void) RemapImages(&quantize_info, new_images, NULL);
|
568
|
+
#else
|
564
569
|
(void) MapImages(new_images, NULL, 0);
|
570
|
+
#endif
|
565
571
|
break;
|
566
572
|
case OptimizePlusLayer:
|
567
573
|
new_images = OptimizePlusImageLayers(images, &exception);
|
@@ -867,7 +873,7 @@ ImageList_remap(int argc, VALUE *argv, VALUE self)
|
|
867
873
|
|
868
874
|
images = images_from_imagelist(self);
|
869
875
|
|
870
|
-
#if defined(
|
876
|
+
#if defined(HAVE_REMAPIMAGE)
|
871
877
|
(void) RemapImages(&quantize_info, images, remap_image);
|
872
878
|
#else
|
873
879
|
(void) AffinityImages(&quantize_info, images, remap_image);
|
data/ext/RMagick/rmimage.c
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
/* $Id: rmimage.c,v 1.
|
1
|
+
/* $Id: rmimage.c,v 1.356 2009/09/26 22:30:26 rmagick Exp $ */
|
2
2
|
/*============================================================================\
|
3
3
|
| Copyright (C) 2009 by Timothy P. Hunter
|
4
4
|
| Name: rmimage.c
|
@@ -707,6 +707,57 @@ crisscross(int bang, VALUE self, Image *fp(const Image *, ExceptionInfo *))
|
|
707
707
|
}
|
708
708
|
|
709
709
|
|
710
|
+
|
711
|
+
static VALUE
|
712
|
+
auto_channel(int argc, VALUE *argv, VALUE self, MagickBooleanType (*fp)(Image *, const ChannelType))
|
713
|
+
{
|
714
|
+
Image *image, *new_image;
|
715
|
+
ChannelType channels;
|
716
|
+
|
717
|
+
image = rm_check_destroyed(self);
|
718
|
+
channels = extract_channels(&argc, argv);
|
719
|
+
|
720
|
+
if (argc > 0)
|
721
|
+
{
|
722
|
+
raise_ChannelType_error(argv[argc-1]);
|
723
|
+
}
|
724
|
+
|
725
|
+
new_image = rm_clone_image(image);
|
726
|
+
(void) (fp)(new_image, channels);
|
727
|
+
rm_check_image_exception(new_image, DestroyOnError);
|
728
|
+
|
729
|
+
return rm_image_new(new_image);
|
730
|
+
}
|
731
|
+
|
732
|
+
|
733
|
+
VALUE
|
734
|
+
Image_auto_gamma_channel(int argc, VALUE *argv, VALUE self)
|
735
|
+
{
|
736
|
+
#if defined(HAVE_AUTOGAMMAIMAGECHANNEL)
|
737
|
+
return auto_channel(argc, argv, self, AutoGammaImageChannel);
|
738
|
+
#else
|
739
|
+
rm_not_implemented();
|
740
|
+
argc = argc;
|
741
|
+
argv = argv;
|
742
|
+
self = self;
|
743
|
+
#endif
|
744
|
+
}
|
745
|
+
|
746
|
+
|
747
|
+
VALUE
|
748
|
+
Image_auto_level_channel(int argc, VALUE *argv, VALUE self)
|
749
|
+
{
|
750
|
+
#if defined(HAVE_AUTOLEVELIMAGECHANNEL)
|
751
|
+
return auto_channel(argc, argv, self, AutoLevelImageChannel);
|
752
|
+
#else
|
753
|
+
rm_not_implemented();
|
754
|
+
argc = argc;
|
755
|
+
argv = argv;
|
756
|
+
self = self;
|
757
|
+
#endif
|
758
|
+
}
|
759
|
+
|
760
|
+
|
710
761
|
/*
|
711
762
|
Method: Image#auto_orient
|
712
763
|
Purpose: Implement mogrify's -auto_orient option
|
@@ -5075,6 +5126,77 @@ Image_from_blob(VALUE class, VALUE blob_arg)
|
|
5075
5126
|
}
|
5076
5127
|
|
5077
5128
|
|
5129
|
+
/*
|
5130
|
+
* Method: Image#function_channel(function, args[, channel...])
|
5131
|
+
*/
|
5132
|
+
VALUE
|
5133
|
+
Image_function_channel(int argc, VALUE *argv, VALUE self)
|
5134
|
+
{
|
5135
|
+
Image *image, *new_image;
|
5136
|
+
MagickFunction function;
|
5137
|
+
unsigned long n, nparms;
|
5138
|
+
volatile double *parameters;
|
5139
|
+
double *parms;
|
5140
|
+
ChannelType channels;
|
5141
|
+
ExceptionInfo exception;
|
5142
|
+
|
5143
|
+
image = rm_check_destroyed(self);
|
5144
|
+
channels = extract_channels(&argc, argv);
|
5145
|
+
|
5146
|
+
// The number of parameters depends on the function.
|
5147
|
+
if (argc == 0)
|
5148
|
+
{
|
5149
|
+
rb_raise(rb_eArgError, "no function specified");
|
5150
|
+
}
|
5151
|
+
|
5152
|
+
VALUE_TO_ENUM(argv[0], function, MagickFunction);
|
5153
|
+
argc -= 1;
|
5154
|
+
argv += 1;
|
5155
|
+
|
5156
|
+
switch (function)
|
5157
|
+
{
|
5158
|
+
case PolynomialFunction:
|
5159
|
+
if (argc == 0)
|
5160
|
+
{
|
5161
|
+
rb_raise(rb_eArgError, "PolynomialFunction requires at least one argument.");
|
5162
|
+
}
|
5163
|
+
break;
|
5164
|
+
case SinusoidFunction:
|
5165
|
+
#if defined(HAVE_ENUM_ARCSINFUNCTION)
|
5166
|
+
case ArcsinFunction:
|
5167
|
+
#endif
|
5168
|
+
#if defined(HAVE_ENUM_ARCTANFUNCTION)
|
5169
|
+
case ArctanFunction:
|
5170
|
+
#endif
|
5171
|
+
if (argc < 1 || argc > 4)
|
5172
|
+
{
|
5173
|
+
rb_raise(rb_eArgError, "wrong number of arguments (%d for 1 to 4)", argc);
|
5174
|
+
}
|
5175
|
+
break;
|
5176
|
+
default:
|
5177
|
+
rb_raise(rb_eArgError, "undefined function");
|
5178
|
+
break;
|
5179
|
+
}
|
5180
|
+
|
5181
|
+
nparms = argc;
|
5182
|
+
parameters = parms = ALLOC_N(double, nparms);
|
5183
|
+
|
5184
|
+
for (n = 0; n < nparms; n++)
|
5185
|
+
{
|
5186
|
+
parms[n] = NUM2DBL(argv[n]);
|
5187
|
+
}
|
5188
|
+
|
5189
|
+
GetExceptionInfo(&exception);
|
5190
|
+
new_image = rm_clone_image(image);
|
5191
|
+
(void) FunctionImageChannel(new_image, channels, function, nparms, parms, &exception);
|
5192
|
+
(void) xfree(parms);
|
5193
|
+
rm_check_exception(&exception, new_image, DestroyOnError);
|
5194
|
+
DestroyExceptionInfo(&exception);
|
5195
|
+
|
5196
|
+
return rm_image_new(new_image);
|
5197
|
+
}
|
5198
|
+
|
5199
|
+
|
5078
5200
|
DEF_ATTR_READER(Image, fuzz, dbl)
|
5079
5201
|
|
5080
5202
|
|
@@ -5902,7 +6024,7 @@ Image_level_channel(int argc, VALUE *argv, VALUE self)
|
|
5902
6024
|
VALUE
|
5903
6025
|
Image_level_colors(int argc, VALUE *argv, VALUE self)
|
5904
6026
|
{
|
5905
|
-
#if defined(HAVE_LEVELIMAGECOLORS)
|
6027
|
+
#if defined(HAVE_LEVELIMAGECOLORS) || defined(HAVE_LEVELCOLORSIMAGECHANNEL)
|
5906
6028
|
Image *image, *new_image;
|
5907
6029
|
MagickPixelPacket black_color, white_color;
|
5908
6030
|
ChannelType channels;
|
@@ -5955,7 +6077,11 @@ Image_level_colors(int argc, VALUE *argv, VALUE self)
|
|
5955
6077
|
|
5956
6078
|
new_image = rm_clone_image(image);
|
5957
6079
|
|
6080
|
+
#if defined(HAVE_LEVELCOLORSIMAGECHANNEL) // new in 6.5.6-4
|
6081
|
+
status = LevelColorsImageChannel(new_image, channels, &black_color, &white_color, invert);
|
6082
|
+
#else
|
5958
6083
|
status = LevelImageColors(new_image, channels, &black_color, &white_color, invert);
|
6084
|
+
#endif
|
5959
6085
|
rm_check_image_exception(new_image, DestroyOnError);
|
5960
6086
|
if (!status)
|
5961
6087
|
{
|
@@ -10007,7 +10133,7 @@ Image_threshold(VALUE self, VALUE threshold)
|
|
10007
10133
|
image = rm_check_destroyed(self);
|
10008
10134
|
new_image = rm_clone_image(image);
|
10009
10135
|
|
10010
|
-
(void)
|
10136
|
+
(void) BilevelImageChannel(new_image, DefaultChannels, NUM2DBL(threshold));
|
10011
10137
|
rm_check_image_exception(new_image, DestroyOnError);
|
10012
10138
|
|
10013
10139
|
return rm_image_new(new_image);
|
data/ext/RMagick/rmmain.c
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
/* $Id: rmmain.c,v 1.
|
1
|
+
/* $Id: rmmain.c,v 1.302 2009/09/15 22:09:44 rmagick Exp $ */
|
2
2
|
/*============================================================================\
|
3
3
|
| Copyright (C) 2009 by Timothy P. Hunter
|
4
4
|
| Name: rmmain.c
|
@@ -258,6 +258,8 @@ Init_RMagick2(void)
|
|
258
258
|
rb_define_method(Class_Image, "alpha?", Image_alpha_q, 0);
|
259
259
|
rb_define_method(Class_Image, "[]", Image_aref, 1);
|
260
260
|
rb_define_method(Class_Image, "[]=", Image_aset, 2);
|
261
|
+
rb_define_method(Class_Image, "auto_gamma_channel", Image_auto_gamma_channel, -1);
|
262
|
+
rb_define_method(Class_Image, "auto_level_channel", Image_auto_level_channel, -1);
|
261
263
|
rb_define_method(Class_Image, "auto_orient", Image_auto_orient, 0);
|
262
264
|
rb_define_method(Class_Image, "auto_orient!", Image_auto_orient_bang, 0);
|
263
265
|
rb_define_method(Class_Image, "properties", Image_properties, 0);
|
@@ -341,6 +343,7 @@ Init_RMagick2(void)
|
|
341
343
|
rb_define_method(Class_Image, "flop", Image_flop, 0);
|
342
344
|
rb_define_method(Class_Image, "flop!", Image_flop_bang, 0);
|
343
345
|
rb_define_method(Class_Image, "frame", Image_frame, -1);
|
346
|
+
rb_define_method(Class_Image, "function_channel", Image_function_channel, -1);
|
344
347
|
rb_define_method(Class_Image, "gamma_channel", Image_gamma_channel, -1);
|
345
348
|
rb_define_method(Class_Image, "gamma_correct", Image_gamma_correct, -1);
|
346
349
|
rb_define_method(Class_Image, "gaussian_blur", Image_gaussian_blur, -1);
|
@@ -505,6 +508,7 @@ Init_RMagick2(void)
|
|
505
508
|
DCL_ATTR_WRITER(Draw, font_style)
|
506
509
|
DCL_ATTR_WRITER(Draw, font_weight)
|
507
510
|
DCL_ATTR_WRITER(Draw, gravity)
|
511
|
+
DCL_ATTR_WRITER(Draw, interline_spacing)
|
508
512
|
DCL_ATTR_WRITER(Draw, interword_spacing)
|
509
513
|
DCL_ATTR_WRITER(Draw, kerning)
|
510
514
|
DCL_ATTR_WRITER(Draw, pointsize)
|
@@ -1221,6 +1225,20 @@ Init_RMagick2(void)
|
|
1221
1225
|
#endif
|
1222
1226
|
END_ENUM
|
1223
1227
|
|
1228
|
+
#if defined(HAVE_TYPE_MAGICKFUNCTION)
|
1229
|
+
DEF_ENUM(MagickFunction)
|
1230
|
+
ENUMERATOR(UndefinedFunction)
|
1231
|
+
ENUMERATOR(PolynomialFunction)
|
1232
|
+
ENUMERATOR(SinusoidFunction)
|
1233
|
+
#if defined(HAVE_ENUM_ARCSINFUNCTION)
|
1234
|
+
ENUMERATOR(ArcsinFunction)
|
1235
|
+
#endif
|
1236
|
+
#if defined(HAVE_ENUM_ARCTANFUNCTION)
|
1237
|
+
ENUMERATOR(ArctanFunction)
|
1238
|
+
#endif
|
1239
|
+
END_ENUM
|
1240
|
+
#endif
|
1241
|
+
|
1224
1242
|
#if defined(HAVE_TYPE_IMAGELAYERMETHOD)
|
1225
1243
|
DEF_ENUM(ImageLayerMethod)
|
1226
1244
|
#else
|
@@ -1638,7 +1656,7 @@ version_constants(void)
|
|
1638
1656
|
rb_define_const(Module_Magick, "Version", str);
|
1639
1657
|
|
1640
1658
|
sprintf(long_version,
|
1641
|
-
"This is %s ($Date: 2009/09/
|
1659
|
+
"This is %s ($Date: 2009/09/15 22:09:44 $) Copyright (C) 2009 by Timothy P. Hunter\n"
|
1642
1660
|
"Built with %s\n"
|
1643
1661
|
"Built for %s\n"
|
1644
1662
|
"Web page: http://rmagick.rubyforge.org\n"
|