rmagick 4.1.0.rc2 → 4.1.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.
- checksums.yaml +4 -4
- data/.codeclimate.yml +63 -0
- data/.editorconfig +3 -0
- data/.github/workflows/ci.yml +148 -0
- data/.gitignore +3 -1
- data/.rspec +1 -0
- data/.rubocop.yml +24 -0
- data/.rubocop_todo.yml +80 -270
- data/.yardopts +5 -0
- data/CHANGELOG.md +63 -0
- data/CONTRIBUTING.md +14 -10
- data/README.md +292 -0
- data/Rakefile +16 -22
- data/before_install_linux.sh +22 -32
- data/before_install_osx.sh +56 -2
- data/ext/RMagick/extconf.rb +100 -94
- data/ext/RMagick/rmagick.c +77 -104
- data/ext/RMagick/rmagick.h +74 -70
- data/ext/RMagick/rmdraw.c +261 -444
- data/ext/RMagick/rmenum.c +96 -113
- data/ext/RMagick/rmfill.c +46 -77
- data/ext/RMagick/rmilist.c +136 -244
- data/ext/RMagick/rmimage.c +3395 -4166
- data/ext/RMagick/rminfo.c +531 -737
- data/ext/RMagick/rmkinfo.c +21 -87
- data/ext/RMagick/rmmain.c +405 -245
- data/ext/RMagick/rmmontage.c +60 -126
- data/ext/RMagick/rmpixel.c +401 -345
- data/ext/RMagick/rmstruct.c +62 -88
- data/ext/RMagick/rmutil.c +112 -218
- data/lib/rmagick/version.rb +1 -1
- data/lib/rmagick_internal.rb +128 -77
- data/lib/rvg/clippath.rb +2 -1
- data/lib/rvg/container.rb +10 -5
- data/lib/rvg/describable.rb +1 -1
- data/lib/rvg/embellishable.rb +5 -4
- data/lib/rvg/misc.rb +15 -12
- data/lib/rvg/paint.rb +2 -1
- data/lib/rvg/pathdata.rb +12 -11
- data/lib/rvg/rvg.rb +8 -4
- data/lib/rvg/stylable.rb +9 -7
- data/lib/rvg/text.rb +11 -6
- data/lib/rvg/transformable.rb +3 -2
- data/lib/rvg/units.rb +1 -1
- data/rmagick.gemspec +7 -6
- metadata +31 -421
- data/.appveyor.yml +0 -57
- data/.circleci/config.yml +0 -56
- data/.ruby-version +0 -1
- data/.simplecov +0 -27
- data/.travis.yml +0 -64
- data/Doxyfile +0 -1514
- data/README.textile +0 -259
- data/benchmarks/memory/README.md +0 -50
- data/benchmarks/memory/image_new.rb +0 -8
- data/benchmarks/memory/rmagick.gnuplot +0 -16
- data/doc/.cvsignore +0 -1
- data/doc/comtasks.html +0 -287
- data/doc/constants.html +0 -1581
- data/doc/css/doc.css +0 -299
- data/doc/css/popup.css +0 -34
- data/doc/css/ref.css +0 -67
- data/doc/draw.html +0 -3272
- data/doc/ex/InitialCoords.rb +0 -22
- data/doc/ex/NewCoordSys.rb +0 -30
- data/doc/ex/OrigCoordSys.rb +0 -16
- data/doc/ex/PreserveAspectRatio.rb +0 -204
- data/doc/ex/RotateScale.rb +0 -36
- data/doc/ex/Skew.rb +0 -38
- data/doc/ex/Use01.rb +0 -15
- data/doc/ex/Use02.rb +0 -20
- data/doc/ex/Use03.rb +0 -16
- data/doc/ex/ViewBox.rb +0 -31
- data/doc/ex/adaptive_threshold.rb +0 -9
- data/doc/ex/add_noise.rb +0 -16
- data/doc/ex/affine.rb +0 -48
- data/doc/ex/affine_transform.rb +0 -20
- data/doc/ex/arc.rb +0 -49
- data/doc/ex/arcpath.rb +0 -32
- data/doc/ex/arcs01.rb +0 -28
- data/doc/ex/arcs02.rb +0 -59
- data/doc/ex/average.rb +0 -15
- data/doc/ex/axes.rb +0 -64
- data/doc/ex/baseline_shift01.rb +0 -17
- data/doc/ex/bilevel_channel.rb +0 -8
- data/doc/ex/blur_image.rb +0 -12
- data/doc/ex/border.rb +0 -10
- data/doc/ex/bounding_box.rb +0 -42
- data/doc/ex/cbezier1.rb +0 -41
- data/doc/ex/cbezier2.rb +0 -41
- data/doc/ex/cbezier3.rb +0 -41
- data/doc/ex/cbezier4.rb +0 -42
- data/doc/ex/cbezier5.rb +0 -42
- data/doc/ex/cbezier6.rb +0 -53
- data/doc/ex/channel.rb +0 -25
- data/doc/ex/charcoal.rb +0 -12
- data/doc/ex/chop.rb +0 -29
- data/doc/ex/circle.rb +0 -33
- data/doc/ex/circle01.rb +0 -16
- data/doc/ex/clip_path.rb +0 -60
- data/doc/ex/coalesce.rb +0 -57
- data/doc/ex/color_fill_to_border.rb +0 -29
- data/doc/ex/color_floodfill.rb +0 -28
- data/doc/ex/color_histogram.rb +0 -47
- data/doc/ex/color_reset.rb +0 -11
- data/doc/ex/colorize.rb +0 -16
- data/doc/ex/colors.rb +0 -64
- data/doc/ex/compose_mask.rb +0 -22
- data/doc/ex/composite.rb +0 -133
- data/doc/ex/composite_layers.rb +0 -52
- data/doc/ex/composite_tiled.rb +0 -21
- data/doc/ex/contrast.rb +0 -36
- data/doc/ex/crop.rb +0 -31
- data/doc/ex/crop_with_gravity.rb +0 -42
- data/doc/ex/cubic01.rb +0 -43
- data/doc/ex/cubic02.rb +0 -91
- data/doc/ex/cycle_colormap.rb +0 -21
- data/doc/ex/dissolve.rb +0 -12
- data/doc/ex/drawcomp.rb +0 -41
- data/doc/ex/drop_shadow.rb +0 -60
- data/doc/ex/edge.rb +0 -11
- data/doc/ex/ellipse.rb +0 -45
- data/doc/ex/ellipse01.rb +0 -21
- data/doc/ex/emboss.rb +0 -11
- data/doc/ex/enhance.rb +0 -28
- data/doc/ex/equalize.rb +0 -11
- data/doc/ex/evenodd.rb +0 -42
- data/doc/ex/fill_pattern.rb +0 -23
- data/doc/ex/flatten_images.rb +0 -36
- data/doc/ex/flip.rb +0 -11
- data/doc/ex/flop.rb +0 -11
- data/doc/ex/font_styles.rb +0 -32
- data/doc/ex/fonts.rb +0 -16
- data/doc/ex/frame.rb +0 -12
- data/doc/ex/gaussian_blur.rb +0 -11
- data/doc/ex/get_multiline_type_metrics.rb +0 -41
- data/doc/ex/get_pixels.rb +0 -45
- data/doc/ex/get_type_metrics.rb +0 -142
- data/doc/ex/gradientfill.rb +0 -27
- data/doc/ex/grav.rb +0 -45
- data/doc/ex/gravity.rb +0 -78
- data/doc/ex/group.rb +0 -26
- data/doc/ex/hatchfill.rb +0 -27
- data/doc/ex/image.rb +0 -44
- data/doc/ex/images/Apple.miff +0 -0
- data/doc/ex/images/Ballerina.jpg +0 -0
- data/doc/ex/images/Ballerina3.jpg +0 -0
- data/doc/ex/images/Button_0.gif +0 -0
- data/doc/ex/images/Button_1.gif +0 -0
- data/doc/ex/images/Button_2.gif +0 -0
- data/doc/ex/images/Button_3.gif +0 -0
- data/doc/ex/images/Button_4.gif +0 -0
- data/doc/ex/images/Button_5.gif +0 -0
- data/doc/ex/images/Button_6.gif +0 -0
- data/doc/ex/images/Button_7.gif +0 -0
- data/doc/ex/images/Button_8.gif +0 -0
- data/doc/ex/images/Button_9.gif +0 -0
- data/doc/ex/images/Button_A.gif +0 -0
- data/doc/ex/images/Button_B.gif +0 -0
- data/doc/ex/images/Button_C.gif +0 -0
- data/doc/ex/images/Button_D.gif +0 -0
- data/doc/ex/images/Button_E.gif +0 -0
- data/doc/ex/images/Button_F.gif +0 -0
- data/doc/ex/images/Button_G.gif +0 -0
- data/doc/ex/images/Button_H.gif +0 -0
- data/doc/ex/images/Button_I.gif +0 -0
- data/doc/ex/images/Button_J.gif +0 -0
- data/doc/ex/images/Button_K.gif +0 -0
- data/doc/ex/images/Button_L.gif +0 -0
- data/doc/ex/images/Button_M.gif +0 -0
- data/doc/ex/images/Button_N.gif +0 -0
- data/doc/ex/images/Button_O.gif +0 -0
- data/doc/ex/images/Button_P.gif +0 -0
- data/doc/ex/images/Button_Q.gif +0 -0
- data/doc/ex/images/Button_R.gif +0 -0
- data/doc/ex/images/Button_S.gif +0 -0
- data/doc/ex/images/Button_T.gif +0 -0
- data/doc/ex/images/Button_U.gif +0 -0
- data/doc/ex/images/Button_V.gif +0 -0
- data/doc/ex/images/Button_W.gif +0 -0
- data/doc/ex/images/Button_X.gif +0 -0
- data/doc/ex/images/Button_Y.gif +0 -0
- data/doc/ex/images/Button_Z.gif +0 -0
- data/doc/ex/images/Cheetah.jpg +0 -0
- data/doc/ex/images/Coffee.png +0 -0
- data/doc/ex/images/Flower_Hat.jpg +0 -0
- data/doc/ex/images/Gold_Statue.jpg +0 -0
- data/doc/ex/images/Hot_Air_Balloons.jpg +0 -0
- data/doc/ex/images/Hot_Air_Balloons_H.jpg +0 -0
- data/doc/ex/images/Leaf.miff +0 -0
- data/doc/ex/images/No.png +0 -0
- data/doc/ex/images/Polynesia.jpg +0 -0
- data/doc/ex/images/Red_Rocks.jpg +0 -0
- data/doc/ex/images/Rocks_On_Beach.miff +0 -0
- data/doc/ex/images/Shorts.jpg +0 -0
- data/doc/ex/images/Snake.png +0 -0
- data/doc/ex/images/Violin.jpg +0 -0
- data/doc/ex/images/Yellow_Rose.miff +0 -0
- data/doc/ex/images/big-duck.gif +0 -0
- data/doc/ex/images/duck.gif +0 -0
- data/doc/ex/images/duck0.gif +0 -0
- data/doc/ex/images/duck1.gif +0 -0
- data/doc/ex/images/duck10.gif +0 -0
- data/doc/ex/images/duck11.gif +0 -0
- data/doc/ex/images/duck12.gif +0 -0
- data/doc/ex/images/duck13.gif +0 -0
- data/doc/ex/images/duck14.gif +0 -0
- data/doc/ex/images/duck15.gif +0 -0
- data/doc/ex/images/duck2.gif +0 -0
- data/doc/ex/images/duck3.gif +0 -0
- data/doc/ex/images/duck4.gif +0 -0
- data/doc/ex/images/duck5.gif +0 -0
- data/doc/ex/images/duck6.gif +0 -0
- data/doc/ex/images/duck7.gif +0 -0
- data/doc/ex/images/duck8.gif +0 -0
- data/doc/ex/images/duck9.gif +0 -0
- data/doc/ex/images/graydient230x6.gif +0 -0
- data/doc/ex/images/image_with_profile.jpg +0 -0
- data/doc/ex/images/logo400x83.gif +0 -0
- data/doc/ex/images/model.miff +0 -0
- data/doc/ex/images/notimplemented.gif +0 -0
- data/doc/ex/images/smile.miff +0 -0
- data/doc/ex/images/spin.gif +0 -0
- data/doc/ex/implode.rb +0 -34
- data/doc/ex/level.rb +0 -11
- data/doc/ex/level_colors.rb +0 -11
- data/doc/ex/line.rb +0 -41
- data/doc/ex/line01.rb +0 -21
- data/doc/ex/mask.rb +0 -35
- data/doc/ex/matte_fill_to_border.rb +0 -39
- data/doc/ex/matte_floodfill.rb +0 -32
- data/doc/ex/matte_replace.rb +0 -39
- data/doc/ex/median_filter.rb +0 -28
- data/doc/ex/modulate.rb +0 -11
- data/doc/ex/mono.rb +0 -23
- data/doc/ex/morph.rb +0 -25
- data/doc/ex/mosaic.rb +0 -37
- data/doc/ex/motion_blur.rb +0 -11
- data/doc/ex/negate.rb +0 -11
- data/doc/ex/negate_channel.rb +0 -9
- data/doc/ex/nested_rvg.rb +0 -21
- data/doc/ex/nonzero.rb +0 -42
- data/doc/ex/normalize.rb +0 -11
- data/doc/ex/oil_paint.rb +0 -11
- data/doc/ex/opacity.rb +0 -37
- data/doc/ex/ordered_dither.rb +0 -11
- data/doc/ex/path.rb +0 -63
- data/doc/ex/pattern1.rb +0 -25
- data/doc/ex/pattern2.rb +0 -26
- data/doc/ex/polaroid.rb +0 -26
- data/doc/ex/polygon.rb +0 -23
- data/doc/ex/polygon01.rb +0 -21
- data/doc/ex/polyline.rb +0 -22
- data/doc/ex/polyline01.rb +0 -21
- data/doc/ex/posterize.rb +0 -8
- data/doc/ex/preview.rb +0 -8
- data/doc/ex/qbezierpath.rb +0 -52
- data/doc/ex/quad01.rb +0 -34
- data/doc/ex/quantize-m.rb +0 -25
- data/doc/ex/radial_blur.rb +0 -9
- data/doc/ex/raise.rb +0 -8
- data/doc/ex/random_threshold_channel.rb +0 -13
- data/doc/ex/rect01.rb +0 -14
- data/doc/ex/rect02.rb +0 -20
- data/doc/ex/rectangle.rb +0 -34
- data/doc/ex/reduce_noise.rb +0 -28
- data/doc/ex/remap.rb +0 -11
- data/doc/ex/remap_images.rb +0 -19
- data/doc/ex/resize_to_fill.rb +0 -8
- data/doc/ex/resize_to_fit.rb +0 -8
- data/doc/ex/roll.rb +0 -9
- data/doc/ex/rotate.rb +0 -44
- data/doc/ex/rotate_f.rb +0 -14
- data/doc/ex/roundrect.rb +0 -33
- data/doc/ex/rubyname.rb +0 -30
- data/doc/ex/rvg_clippath.rb +0 -12
- data/doc/ex/rvg_linecap.rb +0 -42
- data/doc/ex/rvg_linejoin.rb +0 -40
- data/doc/ex/rvg_opacity.rb +0 -18
- data/doc/ex/rvg_pattern.rb +0 -26
- data/doc/ex/rvg_stroke_dasharray.rb +0 -11
- data/doc/ex/segment.rb +0 -11
- data/doc/ex/sepiatone.rb +0 -7
- data/doc/ex/shade.rb +0 -11
- data/doc/ex/shadow.rb +0 -30
- data/doc/ex/shave.rb +0 -15
- data/doc/ex/shear.rb +0 -10
- data/doc/ex/sketch.rb +0 -17
- data/doc/ex/skewx.rb +0 -51
- data/doc/ex/skewy.rb +0 -47
- data/doc/ex/smile.rb +0 -126
- data/doc/ex/solarize.rb +0 -11
- data/doc/ex/sparse_color.rb +0 -55
- data/doc/ex/splice.rb +0 -8
- data/doc/ex/spread.rb +0 -11
- data/doc/ex/stegano.rb +0 -54
- data/doc/ex/stroke_dasharray.rb +0 -42
- data/doc/ex/stroke_fill.rb +0 -10
- data/doc/ex/stroke_linecap.rb +0 -44
- data/doc/ex/stroke_linejoin.rb +0 -48
- data/doc/ex/stroke_width.rb +0 -49
- data/doc/ex/swirl.rb +0 -17
- data/doc/ex/text.rb +0 -37
- data/doc/ex/text01.rb +0 -16
- data/doc/ex/text_align.rb +0 -36
- data/doc/ex/text_antialias.rb +0 -37
- data/doc/ex/text_styles.rb +0 -19
- data/doc/ex/text_undercolor.rb +0 -28
- data/doc/ex/texture_fill_to_border.rb +0 -34
- data/doc/ex/texture_floodfill.rb +0 -32
- data/doc/ex/texturefill.rb +0 -24
- data/doc/ex/threshold.rb +0 -13
- data/doc/ex/to_blob.rb +0 -13
- data/doc/ex/translate.rb +0 -39
- data/doc/ex/transparent.rb +0 -38
- data/doc/ex/transpose.rb +0 -9
- data/doc/ex/transverse.rb +0 -9
- data/doc/ex/tref01.rb +0 -24
- data/doc/ex/triangle01.rb +0 -15
- data/doc/ex/trim.rb +0 -23
- data/doc/ex/tspan01.rb +0 -17
- data/doc/ex/tspan02.rb +0 -17
- data/doc/ex/tspan03.rb +0 -19
- data/doc/ex/unsharp_mask.rb +0 -28
- data/doc/ex/viewex.rb +0 -33
- data/doc/ex/vignette.rb +0 -12
- data/doc/ex/watermark.rb +0 -27
- data/doc/ex/wave.rb +0 -9
- data/doc/ex/wet_floor.rb +0 -58
- data/doc/ex/writing_mode01.rb +0 -26
- data/doc/ex/writing_mode02.rb +0 -26
- data/doc/ilist.html +0 -2056
- data/doc/image1.html +0 -4680
- data/doc/image2.html +0 -3665
- data/doc/image3.html +0 -4522
- data/doc/imageattrs.html +0 -1638
- data/doc/imusage.html +0 -514
- data/doc/index.html +0 -416
- data/doc/info.html +0 -1499
- data/doc/magick.html +0 -570
- data/doc/optequiv.html +0 -2435
- data/doc/rvg.html +0 -975
- data/doc/rvgclip.html +0 -248
- data/doc/rvggroup.html +0 -305
- data/doc/rvgimage.html +0 -289
- data/doc/rvgpattern.html +0 -475
- data/doc/rvgshape.html +0 -406
- data/doc/rvgstyle.html +0 -270
- data/doc/rvgtext.html +0 -465
- data/doc/rvgtspan.html +0 -238
- data/doc/rvgtut.html +0 -530
- data/doc/rvguse.html +0 -145
- data/doc/rvgxform.html +0 -294
- data/doc/scripts/doc.js +0 -22
- data/doc/scripts/stripeTables.js +0 -23
- data/doc/struct.html +0 -1339
- data/doc/usage.html +0 -1621
- data/examples/constitute.rb +0 -7
- data/examples/crop_with_gravity.rb +0 -43
- data/examples/demo.rb +0 -323
- data/examples/describe.rb +0 -41
- data/examples/find_similar_region.rb +0 -34
- data/examples/histogram.rb +0 -312
- data/examples/identify.rb +0 -174
- data/examples/image_opacity.rb +0 -28
- data/examples/import_export.rb +0 -31
- data/examples/pattern_fill.rb +0 -37
- data/examples/rotating_text.rb +0 -45
- data/examples/spinner.rb +0 -49
- data/examples/thumbnail.rb +0 -64
- data/examples/vignette.rb +0 -78
- data/spec/rmagick/ImageList1_spec.rb +0 -24
- data/spec/rmagick/draw_spec.rb +0 -155
- data/spec/rmagick/image/blue_shift_spec.rb +0 -14
- data/spec/rmagick/image/channel_entropy_spec.rb +0 -9
- data/spec/rmagick/image/composite_spec.rb +0 -72
- data/spec/rmagick/image/constitute_spec.rb +0 -13
- data/spec/rmagick/image/dispatch_spec.rb +0 -16
- data/spec/rmagick/image/dissolve_spec.rb +0 -54
- data/spec/rmagick/image/from_blob_spec.rb +0 -12
- data/spec/rmagick/image/ping_spec.rb +0 -12
- data/spec/rmagick/image/properties_spec.rb +0 -27
- data/spec/rmagick/image/read_spec.rb +0 -28
- data/spec/spec_helper.rb +0 -9
- data/spec/support/issue_200/app.rb +0 -8
- data/test/Draw.rb +0 -351
- data/test/Enum.rb +0 -228
- data/test/Fill.rb +0 -93
- data/test/Image1.rb +0 -606
- data/test/Image2.rb +0 -1408
- data/test/Image3.rb +0 -1086
- data/test/ImageList1.rb +0 -858
- data/test/ImageList2.rb +0 -375
- data/test/Image_attributes.rb +0 -635
- data/test/Import_Export.rb +0 -111
- data/test/Info.rb +0 -436
- data/test/KernelInfo.rb +0 -59
- data/test/Magick.rb +0 -311
- data/test/Pixel.rb +0 -259
- data/test/PolaroidOptions.rb +0 -23
- data/test/Preview.rb +0 -26
- data/test/Struct.rb +0 -45
- data/test/appearance/Montage.rb +0 -26
- data/test/appearance/appearance_assertion.rb +0 -13
- data/test/appearance/expected/montage_border_color.jpg +0 -0
- data/test/cmyk.icm +0 -0
- data/test/lib/internal/Draw.rb +0 -811
- data/test/lib/internal/Geometry.rb +0 -98
- data/test/lib/internal/Magick.rb +0 -40
- data/test/srgb.icm +0 -0
- data/test/test_all_basic.rb +0 -49
- data/test/tmpnam_test.rb +0 -50
data/ext/RMagick/rmkinfo.c
CHANGED
@@ -28,10 +28,7 @@ rm_kernel_info_destroy(void *kernel)
|
|
28
28
|
/**
|
29
29
|
* Create a KernelInfo object.
|
30
30
|
*
|
31
|
-
*
|
32
|
-
*
|
33
|
-
* @param class the Ruby class to use
|
34
|
-
* @return a new KernelInfo object
|
31
|
+
* @return [Magick::KernelInfo] a new KernelInfo object
|
35
32
|
*/
|
36
33
|
VALUE
|
37
34
|
KernelInfo_alloc(VALUE class)
|
@@ -42,12 +39,8 @@ KernelInfo_alloc(VALUE class)
|
|
42
39
|
/**
|
43
40
|
* KernelInfo object constructor
|
44
41
|
*
|
45
|
-
*
|
46
|
-
*
|
47
|
-
*
|
48
|
-
* @param self this object
|
49
|
-
* @param kernel_string kernel info string representation to be parsed
|
50
|
-
* @return self
|
42
|
+
* @param kernel_string [String] kernel info string representation to be parsed
|
43
|
+
* @return [Magick::KernelInfo] self
|
51
44
|
*/
|
52
45
|
VALUE
|
53
46
|
KernelInfo_initialize(VALUE self, VALUE kernel_string)
|
@@ -66,7 +59,7 @@ KernelInfo_initialize(VALUE self, VALUE kernel_string)
|
|
66
59
|
{
|
67
60
|
if (kernel != (KernelInfo *) NULL)
|
68
61
|
{
|
69
|
-
|
62
|
+
DestroyKernelInfo(kernel);
|
70
63
|
}
|
71
64
|
rm_raise_exception(exception);
|
72
65
|
}
|
@@ -88,22 +81,17 @@ KernelInfo_initialize(VALUE self, VALUE kernel_string)
|
|
88
81
|
/**
|
89
82
|
* Adds a given amount of the 'Unity' Convolution Kernel to the given pre-scaled and normalized Kernel.
|
90
83
|
*
|
91
|
-
*
|
92
|
-
* - @verbatim KernelInfo#unity_add(scale) @endverbatim
|
93
|
-
*
|
94
|
-
* @param self this object
|
95
|
-
* @param scale scale to add
|
84
|
+
* @param scale [Numeric] scale to add
|
96
85
|
*/
|
97
|
-
|
98
|
-
/* UnityAddKernelInfo() was private function until IM 6.9 */
|
99
|
-
MagickExport void UnityAddKernelInfo(KernelInfo *kernel, const double scale);
|
100
|
-
|
101
86
|
VALUE
|
102
87
|
KernelInfo_unity_add(VALUE self, VALUE scale)
|
103
88
|
{
|
104
89
|
if (!FIXNUM_P(scale))
|
105
90
|
Check_Type(scale, T_FLOAT);
|
106
91
|
|
92
|
+
/* UnityAddKernelInfo() was private function until IM 6.9 */
|
93
|
+
MagickExport void UnityAddKernelInfo(KernelInfo *kernel, const double scale);
|
94
|
+
|
107
95
|
UnityAddKernelInfo((KernelInfo*)DATA_PTR(self), NUM2DBL(scale));
|
108
96
|
return Qnil;
|
109
97
|
}
|
@@ -113,18 +101,10 @@ KernelInfo_unity_add(VALUE self, VALUE scale)
|
|
113
101
|
* Scales the given kernel list by the given amount, with or without normalization
|
114
102
|
* of the sum of the kernel values (as per given flags).
|
115
103
|
*
|
116
|
-
*
|
117
|
-
*
|
118
|
-
*
|
119
|
-
* @param scale scale to use
|
120
|
-
* @param flags one of Magick::NormalizeValue, Magick::CorrelateNormalizeValue,
|
121
|
-
* and/or Magick::PercentValue
|
122
|
-
* @param self this object
|
104
|
+
* @param scale [Numeric] scale to use
|
105
|
+
* @param flags [Magick::GeometryFlags] one of Magick::NormalizeValue, Magick::CorrelateNormalizeValue,
|
106
|
+
* and/or Magick::PercentValue
|
123
107
|
*/
|
124
|
-
|
125
|
-
/* ScaleKernelInfo() was private function until IM 6.9 */
|
126
|
-
MagickExport void ScaleKernelInfo(KernelInfo *kernel, const double scaling_factor,const GeometryFlags normalize_flags);
|
127
|
-
|
128
108
|
VALUE
|
129
109
|
KernelInfo_scale(VALUE self, VALUE scale, VALUE flags)
|
130
110
|
{
|
@@ -138,19 +118,18 @@ KernelInfo_scale(VALUE self, VALUE scale, VALUE flags)
|
|
138
118
|
else
|
139
119
|
rb_raise(rb_eArgError, "expected Integer or Magick::GeometryFlags to specify flags");
|
140
120
|
|
121
|
+
/* ScaleKernelInfo() was private function until IM 6.9 */
|
122
|
+
MagickExport void ScaleKernelInfo(KernelInfo *kernel, const double scaling_factor, const GeometryFlags normalize_flags);
|
123
|
+
|
141
124
|
ScaleKernelInfo((KernelInfo*)DATA_PTR(self), NUM2DBL(scale), geoflags);
|
142
125
|
return Qnil;
|
143
126
|
}
|
144
127
|
|
145
128
|
/**
|
146
|
-
* Takes a geometry argument string, typically provided as a
|
129
|
+
* Takes a geometry argument string, typically provided as a +-set option:convolve:scale {geometry}+ user setting,
|
147
130
|
* and modifies the kernel according to the parsed arguments of that setting.
|
148
131
|
*
|
149
|
-
*
|
150
|
-
* - @verbatim KernelInfo#scale_geometry(geometry) @endverbatim
|
151
|
-
*
|
152
|
-
* @param geometry geometry string to parse and apply
|
153
|
-
* @param self this object
|
132
|
+
* @param geometry [String] geometry string to parse and apply
|
154
133
|
*/
|
155
134
|
VALUE
|
156
135
|
KernelInfo_scale_geometry(VALUE self, VALUE geometry)
|
@@ -163,11 +142,7 @@ KernelInfo_scale_geometry(VALUE self, VALUE geometry)
|
|
163
142
|
/**
|
164
143
|
* Creates a new clone of the object so that its can be modified without effecting the original.
|
165
144
|
*
|
166
|
-
*
|
167
|
-
* - @verbatim KernelInfo#clone @endverbatim
|
168
|
-
*
|
169
|
-
* @param self this object
|
170
|
-
* @return new KernelInfo instance
|
145
|
+
* @return [Magick::KernelInfo] new KernelInfo object
|
171
146
|
*/
|
172
147
|
VALUE
|
173
148
|
KernelInfo_clone(VALUE self)
|
@@ -181,50 +156,9 @@ KernelInfo_clone(VALUE self)
|
|
181
156
|
* kernels used for special purposes such as gaussian blurring, skeleton
|
182
157
|
* pruning, and edge distance determination.
|
183
158
|
*
|
184
|
-
*
|
185
|
-
*
|
186
|
-
*
|
187
|
-
* @parms kernel one of Magick::KernelInfoType enums:
|
188
|
-
* Magick::UndefinedKernel
|
189
|
-
* Magick::UnityKernel
|
190
|
-
* Magick::GaussianKernel
|
191
|
-
* Magick::DoGKernel
|
192
|
-
* Magick::LoGKernel
|
193
|
-
* Magick::BlurKernel
|
194
|
-
* Magick::CometKernel
|
195
|
-
* Magick::LaplacianKernel
|
196
|
-
* Magick::SobelKernel
|
197
|
-
* Magick::FreiChenKernel
|
198
|
-
* Magick::RobertsKernel
|
199
|
-
* Magick::PrewittKernel
|
200
|
-
* Magick::CompassKernel
|
201
|
-
* Magick::KirschKernel
|
202
|
-
* Magick::DiamondKernel
|
203
|
-
* Magick::SquareKernel
|
204
|
-
* Magick::RectangleKernel
|
205
|
-
* Magick::OctagonKernel
|
206
|
-
* Magick::DiskKernel
|
207
|
-
* Magick::PlusKernel
|
208
|
-
* Magick::CrossKernel
|
209
|
-
* Magick::RingKernel
|
210
|
-
* Magick::PeaksKernel
|
211
|
-
* Magick::EdgesKernel
|
212
|
-
* Magick::CornersKernel
|
213
|
-
* Magick::DiagonalsKernel
|
214
|
-
* Magick::LineEndsKernel
|
215
|
-
* Magick::LineJunctionsKernel
|
216
|
-
* Magick::RidgesKernel
|
217
|
-
* Magick::ConvexHullKernel
|
218
|
-
* Magick::ThinSEKernel
|
219
|
-
* Magick::SkeletonKernel
|
220
|
-
* Magick::ChebyshevKernel
|
221
|
-
* Magick::ManhattanKernel
|
222
|
-
* Magick::OctagonalKernel
|
223
|
-
* Magick::EuclideanKernel
|
224
|
-
* Magick::UserDefinedKernel
|
225
|
-
* Magick::BinomialKernel
|
226
|
-
* @param geometry geometry to pass to default kernel
|
227
|
-
* @return KernelInfo instance
|
159
|
+
* @param what [Magick::KernelInfoType] kernel one of Magick::KernelInfoType enums
|
160
|
+
* @param geometry [String] geometry to pass to default kernel
|
161
|
+
* @return [Magick::KernelInfo] a new KernelInfo object
|
228
162
|
*/
|
229
163
|
VALUE
|
230
164
|
KernelInfo_builtin(VALUE self, VALUE what, VALUE geometry)
|
@@ -247,7 +181,7 @@ KernelInfo_builtin(VALUE self, VALUE what, VALUE geometry)
|
|
247
181
|
{
|
248
182
|
if (kernel != (KernelInfo *) NULL)
|
249
183
|
{
|
250
|
-
|
184
|
+
DestroyKernelInfo(kernel);
|
251
185
|
}
|
252
186
|
rm_raise_exception(exception);
|
253
187
|
}
|
data/ext/RMagick/rmmain.c
CHANGED
@@ -14,6 +14,18 @@
|
|
14
14
|
#define MAIN // Define external variables
|
15
15
|
#include "rmagick.h"
|
16
16
|
|
17
|
+
#if defined(HAVE_SETMAGICKALIGNEDMEMORYMETHODS) && defined(HAVE_RB_GC_ADJUST_MEMORY_USAGE)
|
18
|
+
#if defined(HAVE_POSIX_MEMALIGN) || defined(HAVE__ALIGNED_MSIZE)
|
19
|
+
#define USE_RM_ALIGNED_MALLOC 1
|
20
|
+
|
21
|
+
#if defined(HAVE_MALLOC_USABLE_SIZE)
|
22
|
+
#include <malloc.h>
|
23
|
+
#elif defined(HAVE_MALLOC_SIZE)
|
24
|
+
#include <malloc/malloc.h>
|
25
|
+
#endif
|
26
|
+
#endif
|
27
|
+
#endif
|
28
|
+
|
17
29
|
/*----------------------------------------------------------------------------\
|
18
30
|
| External declarations
|
19
31
|
\----------------------------------------------------------------------------*/
|
@@ -98,6 +110,78 @@ static void rm_free(void *ptr)
|
|
98
110
|
}
|
99
111
|
|
100
112
|
|
113
|
+
|
114
|
+
#if USE_RM_ALIGNED_MALLOC
|
115
|
+
|
116
|
+
static size_t
|
117
|
+
rm_aligned_malloc_size(void *ptr)
|
118
|
+
{
|
119
|
+
#if defined(HAVE_MALLOC_USABLE_SIZE)
|
120
|
+
return malloc_usable_size(ptr);
|
121
|
+
#elif defined(HAVE_MALLOC_SIZE)
|
122
|
+
return malloc_size(ptr);
|
123
|
+
#elif defined(HAVE__ALIGNED_MSIZE)
|
124
|
+
// Refered to https://github.com/ImageMagick/ImageMagick/blob/master/MagickCore/memory-private.h
|
125
|
+
#define MAGICKCORE_SIZEOF_VOID_P 8
|
126
|
+
#define CACHE_LINE_SIZE (8 * MAGICKCORE_SIZEOF_VOID_P)
|
127
|
+
size_t _aligned_msize(void *memblock, size_t alignment, size_t offset);
|
128
|
+
return _aligned_msize(ptr, CACHE_LINE_SIZE, 0);
|
129
|
+
#endif
|
130
|
+
}
|
131
|
+
|
132
|
+
|
133
|
+
/**
|
134
|
+
* Allocate aligned memory.
|
135
|
+
*
|
136
|
+
* No Ruby usage (internal function)
|
137
|
+
*
|
138
|
+
* @param size the size of memory to allocate
|
139
|
+
* @return pointer to a block of memory
|
140
|
+
*/
|
141
|
+
static void *rm_aligned_malloc(size_t size, size_t alignment)
|
142
|
+
{
|
143
|
+
void *res;
|
144
|
+
size_t allocated_size;
|
145
|
+
|
146
|
+
#if defined(HAVE_POSIX_MEMALIGN)
|
147
|
+
if (posix_memalign(&res, alignment, size) != 0) {
|
148
|
+
return NULL;
|
149
|
+
}
|
150
|
+
#elif defined(HAVE__ALIGNED_MSIZE)
|
151
|
+
res = _aligned_malloc(size, alignment);
|
152
|
+
#endif
|
153
|
+
|
154
|
+
allocated_size = rm_aligned_malloc_size(res);
|
155
|
+
rb_gc_adjust_memory_usage(allocated_size);
|
156
|
+
return res;
|
157
|
+
}
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
/**
|
163
|
+
* Free aligned memory.
|
164
|
+
*
|
165
|
+
* No Ruby usage (internal function)
|
166
|
+
*
|
167
|
+
* @param ptr pointer to the existing block of memory
|
168
|
+
*/
|
169
|
+
static void rm_aligned_free(void *ptr)
|
170
|
+
{
|
171
|
+
size_t allocated_size = rm_aligned_malloc_size(ptr);
|
172
|
+
rb_gc_adjust_memory_usage(-allocated_size);
|
173
|
+
|
174
|
+
#if defined(HAVE_POSIX_MEMALIGN)
|
175
|
+
free(ptr);
|
176
|
+
#elif defined(HAVE__ALIGNED_MSIZE)
|
177
|
+
_aligned_free(ptr);
|
178
|
+
#endif
|
179
|
+
}
|
180
|
+
|
181
|
+
#endif
|
182
|
+
|
183
|
+
|
184
|
+
|
101
185
|
/**
|
102
186
|
* Use managed memory.
|
103
187
|
*
|
@@ -108,6 +192,9 @@ static inline void managed_memory_enable(VALUE enable)
|
|
108
192
|
if (enable)
|
109
193
|
{
|
110
194
|
SetMagickMemoryMethods(rm_malloc, rm_realloc, rm_free);
|
195
|
+
#if USE_RM_ALIGNED_MALLOC
|
196
|
+
SetMagickAlignedMemoryMethods(rm_aligned_malloc, rm_aligned_free);
|
197
|
+
#endif
|
111
198
|
}
|
112
199
|
rb_define_const(Module_Magick, "MANAGED_MEMORY", enable);
|
113
200
|
}
|
@@ -147,8 +234,6 @@ static void set_managed_memory(void)
|
|
147
234
|
void
|
148
235
|
Init_RMagick2(void)
|
149
236
|
{
|
150
|
-
VALUE observable;
|
151
|
-
|
152
237
|
Module_Magick = rb_define_module("Magick");
|
153
238
|
|
154
239
|
set_managed_memory();
|
@@ -167,24 +252,14 @@ Init_RMagick2(void)
|
|
167
252
|
rm_ID_cur_image = rb_intern("cur_image");
|
168
253
|
rm_ID_dup = rb_intern("dup");
|
169
254
|
rm_ID_fill = rb_intern("fill");
|
170
|
-
rm_ID_flag = rb_intern("flag");
|
171
|
-
rm_ID_from_s = rb_intern("from_s");
|
172
255
|
rm_ID_Geometry = rb_intern("Geometry");
|
173
|
-
rm_ID_GeometryValue = rb_intern("GeometryValue");
|
174
|
-
rm_ID_has_key_q = rb_intern("has_key?");
|
175
256
|
rm_ID_height = rb_intern("height");
|
176
257
|
rm_ID_initialize_copy = rb_intern("initialize_copy");
|
177
|
-
rm_ID_length = rb_intern("length");
|
178
258
|
rm_ID_notify_observers = rb_intern("notify_observers");
|
179
259
|
rm_ID_new = rb_intern("new");
|
180
260
|
rm_ID_push = rb_intern("push");
|
181
|
-
rm_ID_spaceship = rb_intern("<=>");
|
182
|
-
rm_ID_to_i = rb_intern("to_i");
|
183
|
-
rm_ID_to_s = rb_intern("to_s");
|
184
261
|
rm_ID_values = rb_intern("values");
|
185
262
|
rm_ID_width = rb_intern("width");
|
186
|
-
rm_ID_x = rb_intern("x");
|
187
|
-
rm_ID_y = rb_intern("y");
|
188
263
|
|
189
264
|
/*-----------------------------------------------------------------------*/
|
190
265
|
/* Module Magick methods */
|
@@ -218,67 +293,106 @@ Init_RMagick2(void)
|
|
218
293
|
rb_define_singleton_method(Class_Image, "read_inline", Image_read_inline, 1);
|
219
294
|
rb_define_singleton_method(Class_Image, "from_blob", Image_from_blob, 1);
|
220
295
|
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
296
|
+
// Define the attributes
|
297
|
+
rb_define_method(Class_Image, "background_color", Image_background_color, 0);
|
298
|
+
rb_define_method(Class_Image, "background_color=", Image_background_color_eq, 1);
|
299
|
+
rb_define_method(Class_Image, "base_columns", Image_base_columns, 0);
|
300
|
+
rb_define_method(Class_Image, "base_filename", Image_base_filename, 0);
|
301
|
+
rb_define_method(Class_Image, "base_rows", Image_base_rows, 0);
|
302
|
+
rb_define_method(Class_Image, "bias", Image_bias, 0);
|
303
|
+
rb_define_method(Class_Image, "bias=", Image_bias_eq, 1);
|
304
|
+
rb_define_method(Class_Image, "black_point_compensation", Image_black_point_compensation, 0);
|
305
|
+
rb_define_method(Class_Image, "black_point_compensation=", Image_black_point_compensation_eq, 1);
|
306
|
+
rb_define_method(Class_Image, "border_color", Image_border_color, 0);
|
307
|
+
rb_define_method(Class_Image, "border_color=", Image_border_color_eq, 1);
|
308
|
+
rb_define_method(Class_Image, "bounding_box", Image_bounding_box, 0);
|
309
|
+
rb_define_method(Class_Image, "chromaticity", Image_chromaticity, 0);
|
310
|
+
rb_define_method(Class_Image, "chromaticity=", Image_chromaticity_eq, 1);
|
311
|
+
rb_define_method(Class_Image, "color_profile", Image_color_profile, 0);
|
312
|
+
rb_define_method(Class_Image, "color_profile=", Image_color_profile_eq, 1);
|
313
|
+
rb_define_method(Class_Image, "colors", Image_colors, 0);
|
314
|
+
rb_define_method(Class_Image, "colorspace", Image_colorspace, 0);
|
315
|
+
rb_define_method(Class_Image, "colorspace=", Image_colorspace_eq, 1);
|
316
|
+
rb_define_method(Class_Image, "columns", Image_columns, 0);
|
317
|
+
rb_define_method(Class_Image, "compose", Image_compose, 0);
|
318
|
+
rb_define_method(Class_Image, "compose=", Image_compose_eq, 1);
|
319
|
+
rb_define_method(Class_Image, "compression", Image_compression, 0);
|
320
|
+
rb_define_method(Class_Image, "compression=", Image_compression_eq, 1);
|
321
|
+
rb_define_method(Class_Image, "delay", Image_delay, 0);
|
322
|
+
rb_define_method(Class_Image, "delay=", Image_delay_eq, 1);
|
323
|
+
rb_define_method(Class_Image, "density", Image_density, 0);
|
324
|
+
rb_define_method(Class_Image, "density=", Image_density_eq, 1);
|
325
|
+
rb_define_method(Class_Image, "depth", Image_depth, 0);
|
326
|
+
rb_define_method(Class_Image, "directory", Image_directory, 0);
|
327
|
+
rb_define_method(Class_Image, "dispose", Image_dispose, 0);
|
328
|
+
rb_define_method(Class_Image, "dispose=", Image_dispose_eq, 1);
|
329
|
+
rb_define_method(Class_Image, "endian", Image_endian, 0);
|
330
|
+
rb_define_method(Class_Image, "endian=", Image_endian_eq, 1);
|
331
|
+
rb_define_method(Class_Image, "extract_info", Image_extract_info, 0);
|
332
|
+
rb_define_method(Class_Image, "extract_info=", Image_extract_info_eq, 1);
|
333
|
+
rb_define_method(Class_Image, "filename", Image_filename, 0);
|
334
|
+
rb_define_method(Class_Image, "filesize", Image_filesize, 0);
|
335
|
+
rb_define_method(Class_Image, "filter", Image_filter, 0);
|
336
|
+
rb_define_method(Class_Image, "filter=", Image_filter_eq, 1);
|
337
|
+
rb_define_method(Class_Image, "format", Image_format, 0);
|
338
|
+
rb_define_method(Class_Image, "format=", Image_format_eq, 1);
|
339
|
+
rb_define_method(Class_Image, "fuzz", Image_fuzz, 0);
|
340
|
+
rb_define_method(Class_Image, "fuzz=", Image_fuzz_eq, 1);
|
341
|
+
rb_define_method(Class_Image, "gamma", Image_gamma, 0);
|
342
|
+
rb_define_method(Class_Image, "gamma=", Image_gamma_eq, 1);
|
343
|
+
rb_define_method(Class_Image, "geometry", Image_geometry, 0);
|
344
|
+
rb_define_method(Class_Image, "geometry=", Image_geometry_eq, 1);
|
345
|
+
rb_define_method(Class_Image, "gravity", Image_gravity, 0);
|
346
|
+
rb_define_method(Class_Image, "gravity=", Image_gravity_eq, 1);
|
347
|
+
rb_define_method(Class_Image, "image_type", Image_image_type, 0);
|
348
|
+
rb_define_method(Class_Image, "image_type=", Image_image_type_eq, 1);
|
349
|
+
rb_define_method(Class_Image, "interlace", Image_interlace, 0);
|
350
|
+
rb_define_method(Class_Image, "interlace=", Image_interlace_eq, 1);
|
351
|
+
rb_define_method(Class_Image, "iptc_profile", Image_iptc_profile, 0);
|
352
|
+
rb_define_method(Class_Image, "iptc_profile=", Image_iptc_profile_eq, 1);
|
353
|
+
rb_define_method(Class_Image, "iterations", Image_iterations, 0); // do not document! Only used by Image#iterations=
|
354
|
+
rb_define_method(Class_Image, "iterations=", Image_iterations_eq, 1); // do not document! Only used by Image#iterations=
|
355
|
+
rb_define_method(Class_Image, "matte_color", Image_matte_color, 0);
|
356
|
+
rb_define_method(Class_Image, "matte_color=", Image_matte_color_eq, 1);
|
357
|
+
rb_define_method(Class_Image, "mean_error_per_pixel", Image_mean_error_per_pixel, 0);
|
358
|
+
rb_define_method(Class_Image, "mime_type", Image_mime_type, 0);
|
359
|
+
rb_define_method(Class_Image, "monitor=", Image_monitor_eq, 1);
|
360
|
+
rb_define_method(Class_Image, "montage", Image_montage, 0);
|
361
|
+
rb_define_method(Class_Image, "normalized_mean_error", Image_normalized_mean_error, 0);
|
362
|
+
rb_define_method(Class_Image, "normalized_maximum_error", Image_normalized_maximum_error, 0);
|
363
|
+
rb_define_method(Class_Image, "number_colors", Image_number_colors, 0);
|
364
|
+
rb_define_method(Class_Image, "offset", Image_offset, 0);
|
365
|
+
rb_define_method(Class_Image, "offset=", Image_offset_eq, 1);
|
366
|
+
rb_define_method(Class_Image, "orientation", Image_orientation, 0);
|
367
|
+
rb_define_method(Class_Image, "orientation=", Image_orientation_eq, 1);
|
368
|
+
rb_define_method(Class_Image, "page", Image_page, 0);
|
369
|
+
rb_define_method(Class_Image, "page=", Image_page_eq, 1);
|
370
|
+
rb_define_method(Class_Image, "pixel_interpolation_method", Image_pixel_interpolation_method, 0);
|
371
|
+
rb_define_method(Class_Image, "pixel_interpolation_method=", Image_pixel_interpolation_method_eq, 1);
|
372
|
+
rb_define_method(Class_Image, "quality", Image_quality, 0);
|
373
|
+
rb_define_method(Class_Image, "quantum_depth", Image_quantum_depth, 0);
|
374
|
+
rb_define_method(Class_Image, "rendering_intent", Image_rendering_intent, 0);
|
375
|
+
rb_define_method(Class_Image, "rendering_intent=", Image_rendering_intent_eq, 1);
|
376
|
+
rb_define_method(Class_Image, "rows", Image_rows, 0);
|
377
|
+
rb_define_method(Class_Image, "scene", Image_scene, 0);
|
378
|
+
rb_define_method(Class_Image, "start_loop", Image_start_loop, 0);
|
379
|
+
rb_define_method(Class_Image, "start_loop=", Image_start_loop_eq, 1);
|
380
|
+
rb_define_method(Class_Image, "class_type", Image_class_type, 0);
|
381
|
+
rb_define_method(Class_Image, "class_type=", Image_class_type_eq, 1);
|
382
|
+
rb_define_method(Class_Image, "ticks_per_second", Image_ticks_per_second, 0);
|
383
|
+
rb_define_method(Class_Image, "ticks_per_second=", Image_ticks_per_second_eq, 1);
|
384
|
+
rb_define_method(Class_Image, "total_colors", Image_total_colors, 0);
|
385
|
+
rb_define_method(Class_Image, "total_ink_density", Image_total_ink_density, 0);
|
386
|
+
rb_define_method(Class_Image, "transparent_color", Image_transparent_color, 0);
|
387
|
+
rb_define_method(Class_Image, "transparent_color=", Image_transparent_color_eq, 1);
|
388
|
+
rb_define_method(Class_Image, "units", Image_units, 0);
|
389
|
+
rb_define_method(Class_Image, "units=", Image_units_eq, 1);
|
390
|
+
rb_define_method(Class_Image, "virtual_pixel_method", Image_virtual_pixel_method, 0);
|
391
|
+
rb_define_method(Class_Image, "virtual_pixel_method=", Image_virtual_pixel_method_eq, 1);
|
392
|
+
rb_define_method(Class_Image, "x_resolution", Image_x_resolution, 0);
|
393
|
+
rb_define_method(Class_Image, "x_resolution=", Image_x_resolution_eq, 1);
|
394
|
+
rb_define_method(Class_Image, "y_resolution", Image_y_resolution, 0);
|
395
|
+
rb_define_method(Class_Image, "y_resolution=", Image_y_resolution_eq, 1);
|
282
396
|
|
283
397
|
rb_define_method(Class_Image, "adaptive_blur", Image_adaptive_blur, -1);
|
284
398
|
rb_define_method(Class_Image, "adaptive_blur_channel", Image_adaptive_blur_channel, -1);
|
@@ -536,30 +650,31 @@ Init_RMagick2(void)
|
|
536
650
|
Class_Draw = rb_define_class_under(Module_Magick, "Draw", rb_cObject);
|
537
651
|
rb_define_alloc_func(Class_Draw, Draw_alloc);
|
538
652
|
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
653
|
+
// Define the attributes
|
654
|
+
rb_define_method(Class_Draw, "affine=", Draw_affine_eq, 1);
|
655
|
+
rb_define_method(Class_Draw, "align=", Draw_align_eq, 1);
|
656
|
+
rb_define_method(Class_Draw, "decorate=", Draw_decorate_eq, 1);
|
657
|
+
rb_define_method(Class_Draw, "density=", Draw_density_eq, 1);
|
658
|
+
rb_define_method(Class_Draw, "encoding=", Draw_encoding_eq, 1);
|
659
|
+
rb_define_method(Class_Draw, "fill=", Draw_fill_eq, 1);
|
660
|
+
rb_define_method(Class_Draw, "fill_pattern=", Draw_fill_pattern_eq, 1);
|
661
|
+
rb_define_method(Class_Draw, "font=", Draw_font_eq, 1);
|
662
|
+
rb_define_method(Class_Draw, "font_family=", Draw_font_family_eq, 1);
|
663
|
+
rb_define_method(Class_Draw, "font_stretch=", Draw_font_stretch_eq, 1);
|
664
|
+
rb_define_method(Class_Draw, "font_style=", Draw_font_style_eq, 1);
|
665
|
+
rb_define_method(Class_Draw, "font_weight=", Draw_font_weight_eq, 1);
|
666
|
+
rb_define_method(Class_Draw, "gravity=", Draw_gravity_eq, 1);
|
667
|
+
rb_define_method(Class_Draw, "interline_spacing=", Draw_interline_spacing_eq, 1);
|
668
|
+
rb_define_method(Class_Draw, "interword_spacing=", Draw_interword_spacing_eq, 1);
|
669
|
+
rb_define_method(Class_Draw, "kerning=", Draw_kerning_eq, 1);
|
670
|
+
rb_define_method(Class_Draw, "pointsize=", Draw_pointsize_eq, 1);
|
671
|
+
rb_define_method(Class_Draw, "rotation=", Draw_rotation_eq, 1);
|
672
|
+
rb_define_method(Class_Draw, "stroke=", Draw_stroke_eq, 1);
|
673
|
+
rb_define_method(Class_Draw, "stroke_pattern=", Draw_stroke_pattern_eq, 1);
|
674
|
+
rb_define_method(Class_Draw, "stroke_width=", Draw_stroke_width_eq, 1);
|
675
|
+
rb_define_method(Class_Draw, "text_antialias=", Draw_text_antialias_eq, 1);
|
676
|
+
rb_define_method(Class_Draw, "tile=", Draw_tile_eq, 1);
|
677
|
+
rb_define_method(Class_Draw, "undercolor=", Draw_undercolor_eq, 1);
|
563
678
|
|
564
679
|
rb_define_method(Class_Draw, "annotate", Draw_annotate, 6);
|
565
680
|
rb_define_method(Class_Draw, "clone", Draw_clone, 0);
|
@@ -587,27 +702,27 @@ Init_RMagick2(void)
|
|
587
702
|
|
588
703
|
rb_define_method(Class_DrawOptions, "initialize", DrawOptions_initialize, 0);
|
589
704
|
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
705
|
+
rb_define_method(Class_DrawOptions, "affine=", Draw_affine_eq, 1);
|
706
|
+
rb_define_method(Class_DrawOptions, "align=", Draw_align_eq, 1);
|
707
|
+
rb_define_method(Class_DrawOptions, "decorate=", Draw_decorate_eq, 1);
|
708
|
+
rb_define_method(Class_DrawOptions, "density=", Draw_density_eq, 1);
|
709
|
+
rb_define_method(Class_DrawOptions, "encoding=", Draw_encoding_eq, 1);
|
710
|
+
rb_define_method(Class_DrawOptions, "fill=", Draw_fill_eq, 1);
|
711
|
+
rb_define_method(Class_DrawOptions, "fill_pattern=", Draw_fill_pattern_eq, 1);
|
712
|
+
rb_define_method(Class_DrawOptions, "font=", Draw_font_eq, 1);
|
713
|
+
rb_define_method(Class_DrawOptions, "font_family=", Draw_font_family_eq, 1);
|
714
|
+
rb_define_method(Class_DrawOptions, "font_stretch=", Draw_font_stretch_eq, 1);
|
715
|
+
rb_define_method(Class_DrawOptions, "font_style=", Draw_font_style_eq, 1);
|
716
|
+
rb_define_method(Class_DrawOptions, "font_weight=", Draw_font_weight_eq, 1);
|
717
|
+
rb_define_method(Class_DrawOptions, "gravity=", Draw_gravity_eq, 1);
|
718
|
+
rb_define_method(Class_DrawOptions, "pointsize=", Draw_pointsize_eq, 1);
|
719
|
+
rb_define_method(Class_DrawOptions, "rotation=", Draw_rotation_eq, 1);
|
720
|
+
rb_define_method(Class_DrawOptions, "stroke=", Draw_stroke_eq, 1);
|
721
|
+
rb_define_method(Class_DrawOptions, "stroke_pattern=", Draw_stroke_pattern_eq, 1);
|
722
|
+
rb_define_method(Class_DrawOptions, "stroke_width=", Draw_stroke_width_eq, 1);
|
723
|
+
rb_define_method(Class_DrawOptions, "text_antialias=", Draw_text_antialias_eq, 1);
|
724
|
+
rb_define_method(Class_DrawOptions, "tile=", Draw_tile_eq, 1);
|
725
|
+
rb_define_method(Class_DrawOptions, "undercolor=", Draw_undercolor_eq, 1);
|
611
726
|
|
612
727
|
/*-----------------------------------------------------------------------*/
|
613
728
|
/* Class Magick::Pixel */
|
@@ -615,11 +730,6 @@ Init_RMagick2(void)
|
|
615
730
|
|
616
731
|
Class_Pixel = rb_define_class_under(Module_Magick, "Pixel", rb_cObject);
|
617
732
|
|
618
|
-
// include Observable in Pixel for Image::View class
|
619
|
-
(void) rb_require("observer");
|
620
|
-
observable = rb_const_get(rb_cObject, rb_intern("Observable"));
|
621
|
-
rb_include_module(Class_Pixel, observable);
|
622
|
-
|
623
733
|
// include Comparable
|
624
734
|
rb_include_module(Class_Pixel, rb_mComparable);
|
625
735
|
|
@@ -630,16 +740,24 @@ Init_RMagick2(void)
|
|
630
740
|
rb_define_singleton_method(Class_Pixel, "from_hsla", Pixel_from_hsla, -1);
|
631
741
|
|
632
742
|
// Define the RGBA attributes
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
743
|
+
rb_define_method(Class_Pixel, "red", Pixel_red, 0);
|
744
|
+
rb_define_method(Class_Pixel, "red=", Pixel_red_eq, 1);
|
745
|
+
rb_define_method(Class_Pixel, "green", Pixel_green, 0);
|
746
|
+
rb_define_method(Class_Pixel, "green=", Pixel_green_eq, 1);
|
747
|
+
rb_define_method(Class_Pixel, "blue", Pixel_blue, 0);
|
748
|
+
rb_define_method(Class_Pixel, "blue=", Pixel_blue_eq, 1);
|
749
|
+
rb_define_method(Class_Pixel, "alpha", Pixel_alpha, 0);
|
750
|
+
rb_define_method(Class_Pixel, "alpha=", Pixel_alpha_eq, 1);
|
637
751
|
|
638
752
|
// Define the CMYK attributes
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
753
|
+
rb_define_method(Class_Pixel, "cyan", Pixel_cyan, 0);
|
754
|
+
rb_define_method(Class_Pixel, "cyan=", Pixel_cyan_eq, 1);
|
755
|
+
rb_define_method(Class_Pixel, "magenta", Pixel_magenta, 0);
|
756
|
+
rb_define_method(Class_Pixel, "magenta=", Pixel_magenta_eq, 1);
|
757
|
+
rb_define_method(Class_Pixel, "yellow", Pixel_yellow, 0);
|
758
|
+
rb_define_method(Class_Pixel, "yellow=", Pixel_yellow_eq, 1);
|
759
|
+
rb_define_method(Class_Pixel, "black", Pixel_black, 0);
|
760
|
+
rb_define_method(Class_Pixel, "black=", Pixel_black_eq, 1);
|
643
761
|
|
644
762
|
|
645
763
|
// Define the instance methods
|
@@ -671,23 +789,23 @@ Init_RMagick2(void)
|
|
671
789
|
rb_define_method(Class_Montage, "freeze", rm_no_freeze, 0);
|
672
790
|
|
673
791
|
// These accessors supply optional arguments for Magick::ImageList::Montage.new
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
792
|
+
rb_define_method(Class_Montage, "background_color=", Montage_background_color_eq, 1);
|
793
|
+
rb_define_method(Class_Montage, "border_color=", Montage_border_color_eq, 1);
|
794
|
+
rb_define_method(Class_Montage, "border_width=", Montage_border_width_eq, 1);
|
795
|
+
rb_define_method(Class_Montage, "compose=", Montage_compose_eq, 1);
|
796
|
+
rb_define_method(Class_Montage, "filename=", Montage_filename_eq, 1);
|
797
|
+
rb_define_method(Class_Montage, "fill=", Montage_fill_eq, 1);
|
798
|
+
rb_define_method(Class_Montage, "font=", Montage_font_eq, 1);
|
799
|
+
rb_define_method(Class_Montage, "frame=", Montage_frame_eq, 1);
|
800
|
+
rb_define_method(Class_Montage, "geometry=", Montage_geometry_eq, 1);
|
801
|
+
rb_define_method(Class_Montage, "gravity=", Montage_gravity_eq, 1);
|
802
|
+
rb_define_method(Class_Montage, "matte_color=", Montage_matte_color_eq, 1);
|
803
|
+
rb_define_method(Class_Montage, "pointsize=", Montage_pointsize_eq, 1);
|
804
|
+
rb_define_method(Class_Montage, "shadow=", Montage_shadow_eq, 1);
|
805
|
+
rb_define_method(Class_Montage, "stroke=", Montage_stroke_eq, 1);
|
806
|
+
rb_define_method(Class_Montage, "texture=", Montage_texture_eq, 1);
|
807
|
+
rb_define_method(Class_Montage, "tile=", Montage_tile_eq, 1);
|
808
|
+
rb_define_method(Class_Montage, "title=", Montage_title_eq, 1);
|
691
809
|
|
692
810
|
/*-----------------------------------------------------------------------*/
|
693
811
|
/* Class Magick::Image::Info */
|
@@ -705,52 +823,97 @@ Init_RMagick2(void)
|
|
705
823
|
rb_define_method(Class_Info, "[]", Info_aref, -1);
|
706
824
|
rb_define_method(Class_Info, "undefine", Info_undefine, 2);
|
707
825
|
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
|
713
|
-
|
714
|
-
|
715
|
-
|
716
|
-
|
717
|
-
|
718
|
-
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
826
|
+
// Define the attributes
|
827
|
+
rb_define_method(Class_Info, "antialias", Info_antialias, 0);
|
828
|
+
rb_define_method(Class_Info, "antialias=", Info_antialias_eq, 1);
|
829
|
+
rb_define_method(Class_Info, "attenuate", Info_attenuate, 0);
|
830
|
+
rb_define_method(Class_Info, "attenuate=", Info_attenuate_eq, 1);
|
831
|
+
rb_define_method(Class_Info, "authenticate", Info_authenticate, 0);
|
832
|
+
rb_define_method(Class_Info, "authenticate=", Info_authenticate_eq, 1);
|
833
|
+
rb_define_method(Class_Info, "background_color", Info_background_color, 0);
|
834
|
+
rb_define_method(Class_Info, "background_color=", Info_background_color_eq, 1);
|
835
|
+
rb_define_method(Class_Info, "border_color", Info_border_color, 0);
|
836
|
+
rb_define_method(Class_Info, "border_color=", Info_border_color_eq, 1);
|
837
|
+
rb_define_method(Class_Info, "caption", Info_caption, 0);
|
838
|
+
rb_define_method(Class_Info, "caption=", Info_caption_eq, 1);
|
839
|
+
rb_define_method(Class_Info, "colorspace", Info_colorspace, 0);
|
840
|
+
rb_define_method(Class_Info, "colorspace=", Info_colorspace_eq, 1);
|
841
|
+
rb_define_method(Class_Info, "comment", Info_comment, 0);
|
842
|
+
rb_define_method(Class_Info, "comment=", Info_comment_eq, 1);
|
843
|
+
rb_define_method(Class_Info, "compression", Info_compression, 0);
|
844
|
+
rb_define_method(Class_Info, "compression=", Info_compression_eq, 1);
|
845
|
+
rb_define_method(Class_Info, "delay", Info_delay, 0);
|
846
|
+
rb_define_method(Class_Info, "delay=", Info_delay_eq, 1);
|
847
|
+
rb_define_method(Class_Info, "density", Info_density, 0);
|
848
|
+
rb_define_method(Class_Info, "density=", Info_density_eq, 1);
|
849
|
+
rb_define_method(Class_Info, "depth", Info_depth, 0);
|
850
|
+
rb_define_method(Class_Info, "depth=", Info_depth_eq, 1);
|
851
|
+
rb_define_method(Class_Info, "dispose", Info_dispose, 0);
|
852
|
+
rb_define_method(Class_Info, "dispose=", Info_dispose_eq, 1);
|
853
|
+
rb_define_method(Class_Info, "dither", Info_dither, 0);
|
854
|
+
rb_define_method(Class_Info, "dither=", Info_dither_eq, 1);
|
855
|
+
rb_define_method(Class_Info, "endian", Info_endian, 0);
|
856
|
+
rb_define_method(Class_Info, "endian=", Info_endian_eq, 1);
|
857
|
+
rb_define_method(Class_Info, "extract", Info_extract, 0);
|
858
|
+
rb_define_method(Class_Info, "extract=", Info_extract_eq, 1);
|
859
|
+
rb_define_method(Class_Info, "filename", Info_filename, 0);
|
860
|
+
rb_define_method(Class_Info, "filename=", Info_filename_eq, 1);
|
861
|
+
rb_define_method(Class_Info, "fill", Info_fill, 0);
|
862
|
+
rb_define_method(Class_Info, "fill=", Info_fill_eq, 1);
|
863
|
+
rb_define_method(Class_Info, "font", Info_font, 0);
|
864
|
+
rb_define_method(Class_Info, "font=", Info_font_eq, 1);
|
865
|
+
rb_define_method(Class_Info, "format", Info_format, 0);
|
866
|
+
rb_define_method(Class_Info, "format=", Info_format_eq, 1);
|
867
|
+
rb_define_method(Class_Info, "fuzz", Info_fuzz, 0);
|
868
|
+
rb_define_method(Class_Info, "fuzz=", Info_fuzz_eq, 1);
|
869
|
+
rb_define_method(Class_Info, "gravity", Info_gravity, 0);
|
870
|
+
rb_define_method(Class_Info, "gravity=", Info_gravity_eq, 1);
|
871
|
+
rb_define_method(Class_Info, "image_type", Info_image_type, 0);
|
872
|
+
rb_define_method(Class_Info, "image_type=", Info_image_type_eq, 1);
|
873
|
+
rb_define_method(Class_Info, "interlace", Info_interlace, 0);
|
874
|
+
rb_define_method(Class_Info, "interlace=", Info_interlace_eq, 1);
|
875
|
+
rb_define_method(Class_Info, "label", Info_label, 0);
|
876
|
+
rb_define_method(Class_Info, "label=", Info_label_eq, 1);
|
877
|
+
rb_define_method(Class_Info, "matte_color", Info_matte_color, 0);
|
878
|
+
rb_define_method(Class_Info, "matte_color=", Info_matte_color_eq, 1);
|
879
|
+
rb_define_method(Class_Info, "monitor=", Info_monitor_eq, 1);
|
880
|
+
rb_define_method(Class_Info, "monochrome", Info_monochrome, 0);
|
881
|
+
rb_define_method(Class_Info, "monochrome=", Info_monochrome_eq, 1);
|
882
|
+
rb_define_method(Class_Info, "number_scenes", Info_number_scenes, 0);
|
883
|
+
rb_define_method(Class_Info, "number_scenes=", Info_number_scenes_eq, 1);
|
884
|
+
rb_define_method(Class_Info, "orientation", Info_orientation, 0);
|
885
|
+
rb_define_method(Class_Info, "orientation=", Info_orientation_eq, 1);
|
886
|
+
rb_define_method(Class_Info, "origin", Info_origin, 0); // new in 6.3.1
|
887
|
+
rb_define_method(Class_Info, "origin=", Info_origin_eq, 1); // new in 6.3.1
|
888
|
+
rb_define_method(Class_Info, "page", Info_page, 0);
|
889
|
+
rb_define_method(Class_Info, "page=", Info_page_eq, 1);
|
890
|
+
rb_define_method(Class_Info, "pointsize", Info_pointsize, 0);
|
891
|
+
rb_define_method(Class_Info, "pointsize=", Info_pointsize_eq, 1);
|
892
|
+
rb_define_method(Class_Info, "quality", Info_quality, 0);
|
893
|
+
rb_define_method(Class_Info, "quality=", Info_quality_eq, 1);
|
894
|
+
rb_define_method(Class_Info, "sampling_factor", Info_sampling_factor, 0);
|
895
|
+
rb_define_method(Class_Info, "sampling_factor=", Info_sampling_factor_eq, 1);
|
896
|
+
rb_define_method(Class_Info, "scene", Info_scene, 0);
|
897
|
+
rb_define_method(Class_Info, "scene=", Info_scene_eq, 1);
|
898
|
+
rb_define_method(Class_Info, "server_name", Info_server_name, 0);
|
899
|
+
rb_define_method(Class_Info, "server_name=", Info_server_name_eq, 1);
|
900
|
+
rb_define_method(Class_Info, "size", Info_size, 0);
|
901
|
+
rb_define_method(Class_Info, "size=", Info_size_eq, 1);
|
902
|
+
rb_define_method(Class_Info, "stroke", Info_stroke, 0);
|
903
|
+
rb_define_method(Class_Info, "stroke=", Info_stroke_eq, 1);
|
904
|
+
rb_define_method(Class_Info, "stroke_width", Info_stroke_width, 0);
|
905
|
+
rb_define_method(Class_Info, "stroke_width=", Info_stroke_width_eq, 1);
|
906
|
+
rb_define_method(Class_Info, "texture=", Info_texture_eq, 1);
|
907
|
+
rb_define_method(Class_Info, "tile_offset", Info_tile_offset, 0);
|
908
|
+
rb_define_method(Class_Info, "tile_offset=", Info_tile_offset_eq, 1);
|
909
|
+
rb_define_method(Class_Info, "transparent_color", Info_transparent_color, 0);
|
910
|
+
rb_define_method(Class_Info, "transparent_color=", Info_transparent_color_eq, 1);
|
911
|
+
rb_define_method(Class_Info, "undercolor", Info_undercolor, 0);
|
912
|
+
rb_define_method(Class_Info, "undercolor=", Info_undercolor_eq, 1);
|
913
|
+
rb_define_method(Class_Info, "units", Info_units, 0);
|
914
|
+
rb_define_method(Class_Info, "units=", Info_units_eq, 1);
|
915
|
+
rb_define_method(Class_Info, "view", Info_view, 0);
|
916
|
+
rb_define_method(Class_Info, "view=", Info_view_eq, 1);
|
754
917
|
|
755
918
|
/*-----------------------------------------------------------------------*/
|
756
919
|
/* Class Magick::KernelInfo */
|
@@ -780,27 +943,29 @@ Init_RMagick2(void)
|
|
780
943
|
|
781
944
|
rb_define_method(Class_PolaroidOptions, "initialize", PolaroidOptions_initialize, 0);
|
782
945
|
|
783
|
-
|
784
|
-
|
946
|
+
// Define the attributes
|
947
|
+
rb_define_method(Class_PolaroidOptions, "shadow_color=", PolaroidOptions_shadow_color_eq, 1);
|
948
|
+
rb_define_method(Class_PolaroidOptions, "border_color=", PolaroidOptions_border_color_eq, 1);
|
949
|
+
|
785
950
|
// The other attribute writer methods are implemented by Draw's functions
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
|
790
|
-
|
791
|
-
|
792
|
-
|
793
|
-
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
|
951
|
+
rb_define_method(Class_PolaroidOptions, "align=", Draw_align_eq, 1);
|
952
|
+
rb_define_method(Class_PolaroidOptions, "decorate=", Draw_decorate_eq, 1);
|
953
|
+
rb_define_method(Class_PolaroidOptions, "density=", Draw_density_eq, 1);
|
954
|
+
rb_define_method(Class_PolaroidOptions, "encoding=", Draw_encoding_eq, 1);
|
955
|
+
rb_define_method(Class_PolaroidOptions, "fill=", Draw_fill_eq, 1);
|
956
|
+
rb_define_method(Class_PolaroidOptions, "fill_pattern=", Draw_fill_pattern_eq, 1);
|
957
|
+
rb_define_method(Class_PolaroidOptions, "font=", Draw_font_eq, 1);
|
958
|
+
rb_define_method(Class_PolaroidOptions, "font_family=", Draw_font_family_eq, 1);
|
959
|
+
rb_define_method(Class_PolaroidOptions, "font_stretch=", Draw_font_stretch_eq, 1);
|
960
|
+
rb_define_method(Class_PolaroidOptions, "font_style=", Draw_font_style_eq, 1);
|
961
|
+
rb_define_method(Class_PolaroidOptions, "font_weight=", Draw_font_weight_eq, 1);
|
962
|
+
rb_define_method(Class_PolaroidOptions, "gravity=", Draw_gravity_eq, 1);
|
963
|
+
rb_define_method(Class_PolaroidOptions, "pointsize=", Draw_pointsize_eq, 1);
|
964
|
+
rb_define_method(Class_PolaroidOptions, "stroke=", Draw_stroke_eq, 1);
|
965
|
+
rb_define_method(Class_PolaroidOptions, "stroke_pattern=", Draw_stroke_pattern_eq, 1);
|
966
|
+
rb_define_method(Class_PolaroidOptions, "stroke_width=", Draw_stroke_width_eq, 1);
|
967
|
+
rb_define_method(Class_PolaroidOptions, "text_antialias=", Draw_text_antialias_eq, 1);
|
968
|
+
rb_define_method(Class_PolaroidOptions, "undercolor=", Draw_undercolor_eq, 1);
|
804
969
|
|
805
970
|
|
806
971
|
/*-----------------------------------------------------------------------*/
|
@@ -1607,56 +1772,52 @@ Init_RMagick2(void)
|
|
1607
1772
|
// namespace. The only way to use these classes is via the Magick:: namespace.
|
1608
1773
|
|
1609
1774
|
// Magick::AffineMatrix
|
1610
|
-
Class_AffineMatrix =
|
1611
|
-
|
1775
|
+
Class_AffineMatrix = rb_struct_define_under(Module_Magick, "AffineMatrix",
|
1776
|
+
"sx", "rx", "ry", "sy", "tx", "ty", NULL);
|
1612
1777
|
|
1613
1778
|
// Magick::Primary
|
1614
|
-
Class_Primary =
|
1779
|
+
Class_Primary = rb_struct_define_under(Module_Magick, "Primary",
|
1780
|
+
"x", "y", "z", NULL);
|
1615
1781
|
rb_define_method(Class_Primary, "to_s", PrimaryInfo_to_s, 0);
|
1616
|
-
rb_define_const(Module_Magick, "Primary", Class_Primary);
|
1617
1782
|
|
1618
1783
|
// Magick::Chromaticity
|
1619
|
-
Class_Chromaticity =
|
1620
|
-
|
1621
|
-
|
1622
|
-
, "blue_primary"
|
1623
|
-
, "white_point"
|
1624
|
-
, NULL);
|
1784
|
+
Class_Chromaticity = rb_struct_define_under(Module_Magick, "Chromaticity",
|
1785
|
+
"red_primary", "green_primary",
|
1786
|
+
"blue_primary", "white_point", NULL);
|
1625
1787
|
rb_define_method(Class_Chromaticity, "to_s", ChromaticityInfo_to_s, 0);
|
1626
|
-
rb_define_const(Module_Magick, "Chromaticity", Class_Chromaticity);
|
1627
1788
|
|
1628
1789
|
// Magick::Color
|
1629
|
-
Class_Color =
|
1790
|
+
Class_Color = rb_struct_define_under(Module_Magick, "Color",
|
1791
|
+
"name", "compliance", "color", NULL);
|
1630
1792
|
rb_define_method(Class_Color, "to_s", Color_to_s, 0);
|
1631
|
-
rb_define_const(Module_Magick, "Color", Class_Color);
|
1632
1793
|
|
1633
1794
|
// Magick::Point
|
1634
|
-
Class_Point =
|
1635
|
-
|
1795
|
+
Class_Point = rb_struct_define_under(Module_Magick, "Point",
|
1796
|
+
"x", "y", NULL);
|
1636
1797
|
|
1637
1798
|
// Magick::Rectangle
|
1638
|
-
Class_Rectangle =
|
1799
|
+
Class_Rectangle = rb_struct_define_under(Module_Magick, "Rectangle",
|
1800
|
+
"width", "height", "x", "y", NULL);
|
1639
1801
|
rb_define_method(Class_Rectangle, "to_s", RectangleInfo_to_s, 0);
|
1640
|
-
rb_define_const(Module_Magick, "Rectangle", Class_Rectangle);
|
1641
1802
|
|
1642
1803
|
// Magick::Segment
|
1643
|
-
Class_Segment =
|
1804
|
+
Class_Segment = rb_struct_define_under(Module_Magick, "Segment",
|
1805
|
+
"x1", "y1", "x2", "y2", NULL);
|
1644
1806
|
rb_define_method(Class_Segment, "to_s", SegmentInfo_to_s, 0);
|
1645
|
-
rb_define_const(Module_Magick, "Segment", Class_Segment);
|
1646
1807
|
|
1647
1808
|
// Magick::Font
|
1648
|
-
Class_Font =
|
1649
|
-
|
1650
|
-
|
1809
|
+
Class_Font = rb_struct_define_under(Module_Magick, "Font",
|
1810
|
+
"name", "description",
|
1811
|
+
"family", "style", "stretch", "weight",
|
1812
|
+
"encoding", "foundry", "format", NULL);
|
1651
1813
|
rb_define_method(Class_Font, "to_s", Font_to_s, 0);
|
1652
|
-
rb_define_const(Module_Magick, "Font", Class_Font);
|
1653
1814
|
|
1654
1815
|
// Magick::TypeMetric
|
1655
|
-
Class_TypeMetric =
|
1656
|
-
|
1657
|
-
|
1816
|
+
Class_TypeMetric = rb_struct_define_under(Module_Magick, "TypeMetric",
|
1817
|
+
"pixels_per_em", "ascent", "descent",
|
1818
|
+
"width", "height", "max_advance", "bounds",
|
1819
|
+
"underline_position", "underline_thickness", NULL);
|
1658
1820
|
rb_define_method(Class_TypeMetric, "to_s", TypeMetric_to_s, 0);
|
1659
|
-
rb_define_const(Module_Magick, "TypeMetric", Class_TypeMetric);
|
1660
1821
|
|
1661
1822
|
|
1662
1823
|
/*-----------------------------------------------------------------------*/
|
@@ -1666,8 +1827,6 @@ Init_RMagick2(void)
|
|
1666
1827
|
SetFatalErrorHandler(rm_fatal_error_handler);
|
1667
1828
|
SetErrorHandler(rm_error_handler);
|
1668
1829
|
SetWarningHandler(rm_warning_handler);
|
1669
|
-
|
1670
|
-
RB_GC_GUARD(observable);
|
1671
1830
|
}
|
1672
1831
|
|
1673
1832
|
|
@@ -1688,7 +1847,6 @@ test_Magick_version(void)
|
|
1688
1847
|
{
|
1689
1848
|
size_t version_number;
|
1690
1849
|
const char *version_str;
|
1691
|
-
int x, n;
|
1692
1850
|
ID bypass = rb_intern("RMAGICK_BYPASS_VERSION_TEST");
|
1693
1851
|
|
1694
1852
|
if (RTEST(rb_const_defined(rb_cObject, bypass)) && RTEST(rb_const_get(rb_cObject, bypass)))
|
@@ -1699,6 +1857,8 @@ test_Magick_version(void)
|
|
1699
1857
|
version_str = GetMagickVersion(&version_number);
|
1700
1858
|
if (version_number != MagickLibVersion)
|
1701
1859
|
{
|
1860
|
+
int n, x;
|
1861
|
+
|
1702
1862
|
// Extract the string "ImageMagick X.Y.Z"
|
1703
1863
|
n = 0;
|
1704
1864
|
for (x = 0; version_str[x] != '\0'; x++)
|
@@ -1742,7 +1902,7 @@ version_constants(void)
|
|
1742
1902
|
rb_obj_freeze(str);
|
1743
1903
|
rb_define_const(Module_Magick, "Version", str);
|
1744
1904
|
|
1745
|
-
|
1905
|
+
snprintf(long_version, sizeof(long_version),
|
1746
1906
|
"This is %s ($Date: 2009/12/20 02:33:33 $) Copyright (C) 2009 by Timothy P. Hunter\n"
|
1747
1907
|
"Built with %s\n"
|
1748
1908
|
"Built for %s\n"
|