rmagick 3.2.0 → 4.3.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/.devcontainer/Dockerfile +14 -0
- data/.devcontainer/ImageMagick6/devcontainer.json +11 -0
- data/.devcontainer/devcontainer.json +11 -0
- data/.devcontainer/setup-repo.sh +10 -0
- data/.devcontainer/setup-user.sh +45 -0
- data/.editorconfig +3 -0
- data/.github/ISSUE_TEMPLATE.md +17 -0
- data/.github/workflows/ci.yml +79 -0
- data/.gitignore +3 -1
- data/.rspec +1 -0
- data/.rubocop.yml +24 -0
- data/.rubocop_todo.yml +151 -297
- data/.yardopts +5 -0
- data/CHANGELOG.md +233 -0
- data/CODE_OF_CONDUCT.md +122 -7
- data/CONTRIBUTING.md +14 -10
- data/README.md +326 -0
- data/Rakefile +16 -22
- data/before_install_linux.sh +22 -28
- data/before_install_osx.sh +57 -2
- data/ext/RMagick/extconf.rb +149 -105
- data/ext/RMagick/rmagick.c +77 -104
- data/ext/RMagick/rmagick.h +121 -103
- data/ext/RMagick/rmdraw.c +364 -436
- data/ext/RMagick/rmenum.c +106 -114
- data/ext/RMagick/rmfill.c +149 -70
- data/ext/RMagick/rmilist.c +225 -367
- data/ext/RMagick/rmimage.c +4751 -4405
- data/ext/RMagick/rminfo.c +574 -787
- data/ext/RMagick/rmkinfo.c +51 -121
- data/ext/RMagick/rmmain.c +454 -286
- data/ext/RMagick/rmmontage.c +64 -130
- data/ext/RMagick/rmpixel.c +488 -437
- data/ext/RMagick/rmstruct.c +83 -96
- data/ext/RMagick/rmutil.c +302 -214
- data/lib/rmagick/version.rb +1 -1
- data/lib/rmagick_internal.rb +138 -93
- 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 +12 -8
- 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 +10 -11
- metadata +52 -423
- data/.appveyor.yml +0 -45
- data/.circleci/config.yml +0 -56
- data/.ruby-version +0 -1
- data/.simplecov +0 -27
- data/.travis.yml +0 -62
- 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 -42
- 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/lib/obsolete.rb +0 -66
- 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/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 -10
- 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 -627
- data/test/Image2.rb +0 -1426
- data/test/Image3.rb +0 -1091
- data/test/ImageList1.rb +0 -858
- data/test/ImageList2.rb +0 -406
- data/test/Image_attributes.rb +0 -666
- data/test/Import_Export.rb +0 -115
- data/test/Info.rb +0 -444
- data/test/KernelInfo.rb +0 -67
- data/test/Magick.rb +0 -311
- data/test/Pixel.rb +0 -285
- 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/Obsolete.rb +0 -30
- data/test/lib/internal/Draw.rb +0 -823
- 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/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_H)
|
22
|
+
#include <malloc.h>
|
23
|
+
#elif defined(HAVE_MALLOC_MALLOC_H)
|
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();
|
@@ -157,6 +242,8 @@ Init_RMagick2(void)
|
|
157
242
|
|
158
243
|
test_Magick_version();
|
159
244
|
|
245
|
+
rm_main_thread_id = rm_current_thread_id();
|
246
|
+
|
160
247
|
/*-----------------------------------------------------------------------*/
|
161
248
|
/* Create IDs for frequently used methods, etc. */
|
162
249
|
/*-----------------------------------------------------------------------*/
|
@@ -167,24 +254,14 @@ Init_RMagick2(void)
|
|
167
254
|
rm_ID_cur_image = rb_intern("cur_image");
|
168
255
|
rm_ID_dup = rb_intern("dup");
|
169
256
|
rm_ID_fill = rb_intern("fill");
|
170
|
-
rm_ID_flag = rb_intern("flag");
|
171
|
-
rm_ID_from_s = rb_intern("from_s");
|
172
257
|
rm_ID_Geometry = rb_intern("Geometry");
|
173
|
-
rm_ID_GeometryValue = rb_intern("GeometryValue");
|
174
|
-
rm_ID_has_key_q = rb_intern("has_key?");
|
175
258
|
rm_ID_height = rb_intern("height");
|
176
259
|
rm_ID_initialize_copy = rb_intern("initialize_copy");
|
177
|
-
rm_ID_length = rb_intern("length");
|
178
260
|
rm_ID_notify_observers = rb_intern("notify_observers");
|
179
261
|
rm_ID_new = rb_intern("new");
|
180
262
|
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
263
|
rm_ID_values = rb_intern("values");
|
185
264
|
rm_ID_width = rb_intern("width");
|
186
|
-
rm_ID_x = rb_intern("x");
|
187
|
-
rm_ID_y = rb_intern("y");
|
188
265
|
|
189
266
|
/*-----------------------------------------------------------------------*/
|
190
267
|
/* Module Magick methods */
|
@@ -210,7 +287,6 @@ Init_RMagick2(void)
|
|
210
287
|
rb_define_alloc_func(Class_Image, Image_alloc);
|
211
288
|
rb_define_method(Class_Image, "initialize", Image_initialize, -1);
|
212
289
|
|
213
|
-
rb_define_singleton_method(Class_Image, "combine", Image_combine, -1);
|
214
290
|
rb_define_singleton_method(Class_Image, "constitute", Image_constitute, 4);
|
215
291
|
rb_define_singleton_method(Class_Image, "_load", Image__load, 1);
|
216
292
|
rb_define_singleton_method(Class_Image, "capture", Image_capture, -1);
|
@@ -219,72 +295,106 @@ Init_RMagick2(void)
|
|
219
295
|
rb_define_singleton_method(Class_Image, "read_inline", Image_read_inline, 1);
|
220
296
|
rb_define_singleton_method(Class_Image, "from_blob", Image_from_blob, 1);
|
221
297
|
|
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
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
298
|
+
// Define the attributes
|
299
|
+
rb_define_method(Class_Image, "background_color", Image_background_color, 0);
|
300
|
+
rb_define_method(Class_Image, "background_color=", Image_background_color_eq, 1);
|
301
|
+
rb_define_method(Class_Image, "base_columns", Image_base_columns, 0);
|
302
|
+
rb_define_method(Class_Image, "base_filename", Image_base_filename, 0);
|
303
|
+
rb_define_method(Class_Image, "base_rows", Image_base_rows, 0);
|
304
|
+
rb_define_method(Class_Image, "bias", Image_bias, 0);
|
305
|
+
rb_define_method(Class_Image, "bias=", Image_bias_eq, 1);
|
306
|
+
rb_define_method(Class_Image, "black_point_compensation", Image_black_point_compensation, 0);
|
307
|
+
rb_define_method(Class_Image, "black_point_compensation=", Image_black_point_compensation_eq, 1);
|
308
|
+
rb_define_method(Class_Image, "border_color", Image_border_color, 0);
|
309
|
+
rb_define_method(Class_Image, "border_color=", Image_border_color_eq, 1);
|
310
|
+
rb_define_method(Class_Image, "bounding_box", Image_bounding_box, 0);
|
311
|
+
rb_define_method(Class_Image, "chromaticity", Image_chromaticity, 0);
|
312
|
+
rb_define_method(Class_Image, "chromaticity=", Image_chromaticity_eq, 1);
|
313
|
+
rb_define_method(Class_Image, "color_profile", Image_color_profile, 0);
|
314
|
+
rb_define_method(Class_Image, "color_profile=", Image_color_profile_eq, 1);
|
315
|
+
rb_define_method(Class_Image, "colors", Image_colors, 0);
|
316
|
+
rb_define_method(Class_Image, "colorspace", Image_colorspace, 0);
|
317
|
+
rb_define_method(Class_Image, "colorspace=", Image_colorspace_eq, 1);
|
318
|
+
rb_define_method(Class_Image, "columns", Image_columns, 0);
|
319
|
+
rb_define_method(Class_Image, "compose", Image_compose, 0);
|
320
|
+
rb_define_method(Class_Image, "compose=", Image_compose_eq, 1);
|
321
|
+
rb_define_method(Class_Image, "compression", Image_compression, 0);
|
322
|
+
rb_define_method(Class_Image, "compression=", Image_compression_eq, 1);
|
323
|
+
rb_define_method(Class_Image, "delay", Image_delay, 0);
|
324
|
+
rb_define_method(Class_Image, "delay=", Image_delay_eq, 1);
|
325
|
+
rb_define_method(Class_Image, "density", Image_density, 0);
|
326
|
+
rb_define_method(Class_Image, "density=", Image_density_eq, 1);
|
327
|
+
rb_define_method(Class_Image, "depth", Image_depth, 0);
|
328
|
+
rb_define_method(Class_Image, "directory", Image_directory, 0);
|
329
|
+
rb_define_method(Class_Image, "dispose", Image_dispose, 0);
|
330
|
+
rb_define_method(Class_Image, "dispose=", Image_dispose_eq, 1);
|
331
|
+
rb_define_method(Class_Image, "endian", Image_endian, 0);
|
332
|
+
rb_define_method(Class_Image, "endian=", Image_endian_eq, 1);
|
333
|
+
rb_define_method(Class_Image, "extract_info", Image_extract_info, 0);
|
334
|
+
rb_define_method(Class_Image, "extract_info=", Image_extract_info_eq, 1);
|
335
|
+
rb_define_method(Class_Image, "filename", Image_filename, 0);
|
336
|
+
rb_define_method(Class_Image, "filesize", Image_filesize, 0);
|
337
|
+
rb_define_method(Class_Image, "filter", Image_filter, 0);
|
338
|
+
rb_define_method(Class_Image, "filter=", Image_filter_eq, 1);
|
339
|
+
rb_define_method(Class_Image, "format", Image_format, 0);
|
340
|
+
rb_define_method(Class_Image, "format=", Image_format_eq, 1);
|
341
|
+
rb_define_method(Class_Image, "fuzz", Image_fuzz, 0);
|
342
|
+
rb_define_method(Class_Image, "fuzz=", Image_fuzz_eq, 1);
|
343
|
+
rb_define_method(Class_Image, "gamma", Image_gamma, 0);
|
344
|
+
rb_define_method(Class_Image, "gamma=", Image_gamma_eq, 1);
|
345
|
+
rb_define_method(Class_Image, "geometry", Image_geometry, 0);
|
346
|
+
rb_define_method(Class_Image, "geometry=", Image_geometry_eq, 1);
|
347
|
+
rb_define_method(Class_Image, "gravity", Image_gravity, 0);
|
348
|
+
rb_define_method(Class_Image, "gravity=", Image_gravity_eq, 1);
|
349
|
+
rb_define_method(Class_Image, "image_type", Image_image_type, 0);
|
350
|
+
rb_define_method(Class_Image, "image_type=", Image_image_type_eq, 1);
|
351
|
+
rb_define_method(Class_Image, "interlace", Image_interlace, 0);
|
352
|
+
rb_define_method(Class_Image, "interlace=", Image_interlace_eq, 1);
|
353
|
+
rb_define_method(Class_Image, "iptc_profile", Image_iptc_profile, 0);
|
354
|
+
rb_define_method(Class_Image, "iptc_profile=", Image_iptc_profile_eq, 1);
|
355
|
+
rb_define_method(Class_Image, "iterations", Image_iterations, 0); // do not document! Only used by Image#iterations=
|
356
|
+
rb_define_method(Class_Image, "iterations=", Image_iterations_eq, 1); // do not document! Only used by Image#iterations=
|
357
|
+
rb_define_method(Class_Image, "matte_color", Image_matte_color, 0);
|
358
|
+
rb_define_method(Class_Image, "matte_color=", Image_matte_color_eq, 1);
|
359
|
+
rb_define_method(Class_Image, "mean_error_per_pixel", Image_mean_error_per_pixel, 0);
|
360
|
+
rb_define_method(Class_Image, "mime_type", Image_mime_type, 0);
|
361
|
+
rb_define_method(Class_Image, "monitor=", Image_monitor_eq, 1);
|
362
|
+
rb_define_method(Class_Image, "montage", Image_montage, 0);
|
363
|
+
rb_define_method(Class_Image, "normalized_mean_error", Image_normalized_mean_error, 0);
|
364
|
+
rb_define_method(Class_Image, "normalized_maximum_error", Image_normalized_maximum_error, 0);
|
365
|
+
rb_define_method(Class_Image, "number_colors", Image_number_colors, 0);
|
366
|
+
rb_define_method(Class_Image, "offset", Image_offset, 0);
|
367
|
+
rb_define_method(Class_Image, "offset=", Image_offset_eq, 1);
|
368
|
+
rb_define_method(Class_Image, "orientation", Image_orientation, 0);
|
369
|
+
rb_define_method(Class_Image, "orientation=", Image_orientation_eq, 1);
|
370
|
+
rb_define_method(Class_Image, "page", Image_page, 0);
|
371
|
+
rb_define_method(Class_Image, "page=", Image_page_eq, 1);
|
372
|
+
rb_define_method(Class_Image, "pixel_interpolation_method", Image_pixel_interpolation_method, 0);
|
373
|
+
rb_define_method(Class_Image, "pixel_interpolation_method=", Image_pixel_interpolation_method_eq, 1);
|
374
|
+
rb_define_method(Class_Image, "quality", Image_quality, 0);
|
375
|
+
rb_define_method(Class_Image, "quantum_depth", Image_quantum_depth, 0);
|
376
|
+
rb_define_method(Class_Image, "rendering_intent", Image_rendering_intent, 0);
|
377
|
+
rb_define_method(Class_Image, "rendering_intent=", Image_rendering_intent_eq, 1);
|
378
|
+
rb_define_method(Class_Image, "rows", Image_rows, 0);
|
379
|
+
rb_define_method(Class_Image, "scene", Image_scene, 0);
|
380
|
+
rb_define_method(Class_Image, "start_loop", Image_start_loop, 0);
|
381
|
+
rb_define_method(Class_Image, "start_loop=", Image_start_loop_eq, 1);
|
382
|
+
rb_define_method(Class_Image, "class_type", Image_class_type, 0);
|
383
|
+
rb_define_method(Class_Image, "class_type=", Image_class_type_eq, 1);
|
384
|
+
rb_define_method(Class_Image, "ticks_per_second", Image_ticks_per_second, 0);
|
385
|
+
rb_define_method(Class_Image, "ticks_per_second=", Image_ticks_per_second_eq, 1);
|
386
|
+
rb_define_method(Class_Image, "total_colors", Image_total_colors, 0);
|
387
|
+
rb_define_method(Class_Image, "total_ink_density", Image_total_ink_density, 0);
|
388
|
+
rb_define_method(Class_Image, "transparent_color", Image_transparent_color, 0);
|
389
|
+
rb_define_method(Class_Image, "transparent_color=", Image_transparent_color_eq, 1);
|
390
|
+
rb_define_method(Class_Image, "units", Image_units, 0);
|
391
|
+
rb_define_method(Class_Image, "units=", Image_units_eq, 1);
|
392
|
+
rb_define_method(Class_Image, "virtual_pixel_method", Image_virtual_pixel_method, 0);
|
393
|
+
rb_define_method(Class_Image, "virtual_pixel_method=", Image_virtual_pixel_method_eq, 1);
|
394
|
+
rb_define_method(Class_Image, "x_resolution", Image_x_resolution, 0);
|
395
|
+
rb_define_method(Class_Image, "x_resolution=", Image_x_resolution_eq, 1);
|
396
|
+
rb_define_method(Class_Image, "y_resolution", Image_y_resolution, 0);
|
397
|
+
rb_define_method(Class_Image, "y_resolution=", Image_y_resolution_eq, 1);
|
288
398
|
|
289
399
|
rb_define_method(Class_Image, "adaptive_blur", Image_adaptive_blur, -1);
|
290
400
|
rb_define_method(Class_Image, "adaptive_blur_channel", Image_adaptive_blur_channel, -1);
|
@@ -412,7 +522,6 @@ Init_RMagick2(void)
|
|
412
522
|
rb_define_method(Class_Image, "liquid_rescale", Image_liquid_rescale, -1);
|
413
523
|
rb_define_method(Class_Image, "magnify", Image_magnify, 0);
|
414
524
|
rb_define_method(Class_Image, "magnify!", Image_magnify_bang, 0);
|
415
|
-
rb_define_method(Class_Image, "map", Image_map, -1);
|
416
525
|
rb_define_method(Class_Image, "marshal_dump", Image_marshal_dump, 0);
|
417
526
|
rb_define_method(Class_Image, "marshal_load", Image_marshal_load, 1);
|
418
527
|
rb_define_method(Class_Image, "mask", Image_mask, -1);
|
@@ -484,7 +593,6 @@ Init_RMagick2(void)
|
|
484
593
|
rb_define_method(Class_Image, "strip!", Image_strip_bang, 0);
|
485
594
|
rb_define_method(Class_Image, "store_pixels", Image_store_pixels, 5);
|
486
595
|
rb_define_method(Class_Image, "swirl", Image_swirl, 1);
|
487
|
-
rb_define_method(Class_Image, "sync_profiles", Image_sync_profiles, 0);
|
488
596
|
rb_define_method(Class_Image, "texture_flood_fill", Image_texture_flood_fill, 5);
|
489
597
|
rb_define_method(Class_Image, "threshold", Image_threshold, 1);
|
490
598
|
rb_define_method(Class_Image, "thumbnail", Image_thumbnail, -1);
|
@@ -529,8 +637,6 @@ Init_RMagick2(void)
|
|
529
637
|
rb_define_method(Class_ImageList, "deconstruct", ImageList_deconstruct, 0);
|
530
638
|
rb_define_method(Class_ImageList, "display", ImageList_display, 0);
|
531
639
|
rb_define_method(Class_ImageList, "flatten_images", ImageList_flatten_images, 0);
|
532
|
-
rb_define_method(Class_ImageList, "fx", ImageList_fx, -1);
|
533
|
-
rb_define_method(Class_ImageList, "map", ImageList_map, -1);
|
534
640
|
rb_define_method(Class_ImageList, "montage", ImageList_montage, 0);
|
535
641
|
rb_define_method(Class_ImageList, "morph", ImageList_morph, 1);
|
536
642
|
rb_define_method(Class_ImageList, "mosaic", ImageList_mosaic, 0);
|
@@ -546,30 +652,31 @@ Init_RMagick2(void)
|
|
546
652
|
Class_Draw = rb_define_class_under(Module_Magick, "Draw", rb_cObject);
|
547
653
|
rb_define_alloc_func(Class_Draw, Draw_alloc);
|
548
654
|
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
655
|
+
// Define the attributes
|
656
|
+
rb_define_method(Class_Draw, "affine=", Draw_affine_eq, 1);
|
657
|
+
rb_define_method(Class_Draw, "align=", Draw_align_eq, 1);
|
658
|
+
rb_define_method(Class_Draw, "decorate=", Draw_decorate_eq, 1);
|
659
|
+
rb_define_method(Class_Draw, "density=", Draw_density_eq, 1);
|
660
|
+
rb_define_method(Class_Draw, "encoding=", Draw_encoding_eq, 1);
|
661
|
+
rb_define_method(Class_Draw, "fill=", Draw_fill_eq, 1);
|
662
|
+
rb_define_method(Class_Draw, "fill_pattern=", Draw_fill_pattern_eq, 1);
|
663
|
+
rb_define_method(Class_Draw, "font=", Draw_font_eq, 1);
|
664
|
+
rb_define_method(Class_Draw, "font_family=", Draw_font_family_eq, 1);
|
665
|
+
rb_define_method(Class_Draw, "font_stretch=", Draw_font_stretch_eq, 1);
|
666
|
+
rb_define_method(Class_Draw, "font_style=", Draw_font_style_eq, 1);
|
667
|
+
rb_define_method(Class_Draw, "font_weight=", Draw_font_weight_eq, 1);
|
668
|
+
rb_define_method(Class_Draw, "gravity=", Draw_gravity_eq, 1);
|
669
|
+
rb_define_method(Class_Draw, "interline_spacing=", Draw_interline_spacing_eq, 1);
|
670
|
+
rb_define_method(Class_Draw, "interword_spacing=", Draw_interword_spacing_eq, 1);
|
671
|
+
rb_define_method(Class_Draw, "kerning=", Draw_kerning_eq, 1);
|
672
|
+
rb_define_method(Class_Draw, "pointsize=", Draw_pointsize_eq, 1);
|
673
|
+
rb_define_method(Class_Draw, "rotation=", Draw_rotation_eq, 1);
|
674
|
+
rb_define_method(Class_Draw, "stroke=", Draw_stroke_eq, 1);
|
675
|
+
rb_define_method(Class_Draw, "stroke_pattern=", Draw_stroke_pattern_eq, 1);
|
676
|
+
rb_define_method(Class_Draw, "stroke_width=", Draw_stroke_width_eq, 1);
|
677
|
+
rb_define_method(Class_Draw, "text_antialias=", Draw_text_antialias_eq, 1);
|
678
|
+
rb_define_method(Class_Draw, "tile=", Draw_tile_eq, 1);
|
679
|
+
rb_define_method(Class_Draw, "undercolor=", Draw_undercolor_eq, 1);
|
573
680
|
|
574
681
|
rb_define_method(Class_Draw, "annotate", Draw_annotate, 6);
|
575
682
|
rb_define_method(Class_Draw, "clone", Draw_clone, 0);
|
@@ -597,27 +704,27 @@ Init_RMagick2(void)
|
|
597
704
|
|
598
705
|
rb_define_method(Class_DrawOptions, "initialize", DrawOptions_initialize, 0);
|
599
706
|
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
707
|
+
rb_define_method(Class_DrawOptions, "affine=", Draw_affine_eq, 1);
|
708
|
+
rb_define_method(Class_DrawOptions, "align=", Draw_align_eq, 1);
|
709
|
+
rb_define_method(Class_DrawOptions, "decorate=", Draw_decorate_eq, 1);
|
710
|
+
rb_define_method(Class_DrawOptions, "density=", Draw_density_eq, 1);
|
711
|
+
rb_define_method(Class_DrawOptions, "encoding=", Draw_encoding_eq, 1);
|
712
|
+
rb_define_method(Class_DrawOptions, "fill=", Draw_fill_eq, 1);
|
713
|
+
rb_define_method(Class_DrawOptions, "fill_pattern=", Draw_fill_pattern_eq, 1);
|
714
|
+
rb_define_method(Class_DrawOptions, "font=", Draw_font_eq, 1);
|
715
|
+
rb_define_method(Class_DrawOptions, "font_family=", Draw_font_family_eq, 1);
|
716
|
+
rb_define_method(Class_DrawOptions, "font_stretch=", Draw_font_stretch_eq, 1);
|
717
|
+
rb_define_method(Class_DrawOptions, "font_style=", Draw_font_style_eq, 1);
|
718
|
+
rb_define_method(Class_DrawOptions, "font_weight=", Draw_font_weight_eq, 1);
|
719
|
+
rb_define_method(Class_DrawOptions, "gravity=", Draw_gravity_eq, 1);
|
720
|
+
rb_define_method(Class_DrawOptions, "pointsize=", Draw_pointsize_eq, 1);
|
721
|
+
rb_define_method(Class_DrawOptions, "rotation=", Draw_rotation_eq, 1);
|
722
|
+
rb_define_method(Class_DrawOptions, "stroke=", Draw_stroke_eq, 1);
|
723
|
+
rb_define_method(Class_DrawOptions, "stroke_pattern=", Draw_stroke_pattern_eq, 1);
|
724
|
+
rb_define_method(Class_DrawOptions, "stroke_width=", Draw_stroke_width_eq, 1);
|
725
|
+
rb_define_method(Class_DrawOptions, "text_antialias=", Draw_text_antialias_eq, 1);
|
726
|
+
rb_define_method(Class_DrawOptions, "tile=", Draw_tile_eq, 1);
|
727
|
+
rb_define_method(Class_DrawOptions, "undercolor=", Draw_undercolor_eq, 1);
|
621
728
|
|
622
729
|
/*-----------------------------------------------------------------------*/
|
623
730
|
/* Class Magick::Pixel */
|
@@ -625,11 +732,6 @@ Init_RMagick2(void)
|
|
625
732
|
|
626
733
|
Class_Pixel = rb_define_class_under(Module_Magick, "Pixel", rb_cObject);
|
627
734
|
|
628
|
-
// include Observable in Pixel for Image::View class
|
629
|
-
(void) rb_require("observer");
|
630
|
-
observable = rb_const_get(rb_cObject, rb_intern("Observable"));
|
631
|
-
rb_include_module(Class_Pixel, observable);
|
632
|
-
|
633
735
|
// include Comparable
|
634
736
|
rb_include_module(Class_Pixel, rb_mComparable);
|
635
737
|
|
@@ -637,21 +739,27 @@ Init_RMagick2(void)
|
|
637
739
|
// and the deprecated "from_HSL".
|
638
740
|
rb_define_alloc_func(Class_Pixel, Pixel_alloc);
|
639
741
|
rb_define_singleton_method(Class_Pixel, "from_color", Pixel_from_color, 1);
|
640
|
-
rb_define_singleton_method(Class_Pixel, "from_HSL", Pixel_from_HSL, 1);
|
641
742
|
rb_define_singleton_method(Class_Pixel, "from_hsla", Pixel_from_hsla, -1);
|
642
743
|
|
643
744
|
// Define the RGBA attributes
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
745
|
+
rb_define_method(Class_Pixel, "red", Pixel_red, 0);
|
746
|
+
rb_define_method(Class_Pixel, "red=", Pixel_red_eq, 1);
|
747
|
+
rb_define_method(Class_Pixel, "green", Pixel_green, 0);
|
748
|
+
rb_define_method(Class_Pixel, "green=", Pixel_green_eq, 1);
|
749
|
+
rb_define_method(Class_Pixel, "blue", Pixel_blue, 0);
|
750
|
+
rb_define_method(Class_Pixel, "blue=", Pixel_blue_eq, 1);
|
751
|
+
rb_define_method(Class_Pixel, "alpha", Pixel_alpha, 0);
|
752
|
+
rb_define_method(Class_Pixel, "alpha=", Pixel_alpha_eq, 1);
|
649
753
|
|
650
754
|
// Define the CMYK attributes
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
755
|
+
rb_define_method(Class_Pixel, "cyan", Pixel_cyan, 0);
|
756
|
+
rb_define_method(Class_Pixel, "cyan=", Pixel_cyan_eq, 1);
|
757
|
+
rb_define_method(Class_Pixel, "magenta", Pixel_magenta, 0);
|
758
|
+
rb_define_method(Class_Pixel, "magenta=", Pixel_magenta_eq, 1);
|
759
|
+
rb_define_method(Class_Pixel, "yellow", Pixel_yellow, 0);
|
760
|
+
rb_define_method(Class_Pixel, "yellow=", Pixel_yellow_eq, 1);
|
761
|
+
rb_define_method(Class_Pixel, "black", Pixel_black, 0);
|
762
|
+
rb_define_method(Class_Pixel, "black=", Pixel_black_eq, 1);
|
655
763
|
|
656
764
|
|
657
765
|
// Define the instance methods
|
@@ -668,7 +776,6 @@ Init_RMagick2(void)
|
|
668
776
|
rb_define_method(Class_Pixel, "marshal_dump", Pixel_marshal_dump, 0);
|
669
777
|
rb_define_method(Class_Pixel, "marshal_load", Pixel_marshal_load, 1);
|
670
778
|
rb_define_method(Class_Pixel, "to_color", Pixel_to_color, -1);
|
671
|
-
rb_define_method(Class_Pixel, "to_HSL", Pixel_to_HSL, 0); // deprecated
|
672
779
|
rb_define_method(Class_Pixel, "to_hsla", Pixel_to_hsla, 0);
|
673
780
|
rb_define_method(Class_Pixel, "to_s", Pixel_to_s, 0);
|
674
781
|
|
@@ -684,23 +791,23 @@ Init_RMagick2(void)
|
|
684
791
|
rb_define_method(Class_Montage, "freeze", rm_no_freeze, 0);
|
685
792
|
|
686
793
|
// These accessors supply optional arguments for Magick::ImageList::Montage.new
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
794
|
+
rb_define_method(Class_Montage, "background_color=", Montage_background_color_eq, 1);
|
795
|
+
rb_define_method(Class_Montage, "border_color=", Montage_border_color_eq, 1);
|
796
|
+
rb_define_method(Class_Montage, "border_width=", Montage_border_width_eq, 1);
|
797
|
+
rb_define_method(Class_Montage, "compose=", Montage_compose_eq, 1);
|
798
|
+
rb_define_method(Class_Montage, "filename=", Montage_filename_eq, 1);
|
799
|
+
rb_define_method(Class_Montage, "fill=", Montage_fill_eq, 1);
|
800
|
+
rb_define_method(Class_Montage, "font=", Montage_font_eq, 1);
|
801
|
+
rb_define_method(Class_Montage, "frame=", Montage_frame_eq, 1);
|
802
|
+
rb_define_method(Class_Montage, "geometry=", Montage_geometry_eq, 1);
|
803
|
+
rb_define_method(Class_Montage, "gravity=", Montage_gravity_eq, 1);
|
804
|
+
rb_define_method(Class_Montage, "matte_color=", Montage_matte_color_eq, 1);
|
805
|
+
rb_define_method(Class_Montage, "pointsize=", Montage_pointsize_eq, 1);
|
806
|
+
rb_define_method(Class_Montage, "shadow=", Montage_shadow_eq, 1);
|
807
|
+
rb_define_method(Class_Montage, "stroke=", Montage_stroke_eq, 1);
|
808
|
+
rb_define_method(Class_Montage, "texture=", Montage_texture_eq, 1);
|
809
|
+
rb_define_method(Class_Montage, "tile=", Montage_tile_eq, 1);
|
810
|
+
rb_define_method(Class_Montage, "title=", Montage_title_eq, 1);
|
704
811
|
|
705
812
|
/*-----------------------------------------------------------------------*/
|
706
813
|
/* Class Magick::Image::Info */
|
@@ -718,53 +825,97 @@ Init_RMagick2(void)
|
|
718
825
|
rb_define_method(Class_Info, "[]", Info_aref, -1);
|
719
826
|
rb_define_method(Class_Info, "undefine", Info_undefine, 2);
|
720
827
|
|
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
|
-
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
|
761
|
-
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
|
766
|
-
|
767
|
-
|
828
|
+
// Define the attributes
|
829
|
+
rb_define_method(Class_Info, "antialias", Info_antialias, 0);
|
830
|
+
rb_define_method(Class_Info, "antialias=", Info_antialias_eq, 1);
|
831
|
+
rb_define_method(Class_Info, "attenuate", Info_attenuate, 0);
|
832
|
+
rb_define_method(Class_Info, "attenuate=", Info_attenuate_eq, 1);
|
833
|
+
rb_define_method(Class_Info, "authenticate", Info_authenticate, 0);
|
834
|
+
rb_define_method(Class_Info, "authenticate=", Info_authenticate_eq, 1);
|
835
|
+
rb_define_method(Class_Info, "background_color", Info_background_color, 0);
|
836
|
+
rb_define_method(Class_Info, "background_color=", Info_background_color_eq, 1);
|
837
|
+
rb_define_method(Class_Info, "border_color", Info_border_color, 0);
|
838
|
+
rb_define_method(Class_Info, "border_color=", Info_border_color_eq, 1);
|
839
|
+
rb_define_method(Class_Info, "caption", Info_caption, 0);
|
840
|
+
rb_define_method(Class_Info, "caption=", Info_caption_eq, 1);
|
841
|
+
rb_define_method(Class_Info, "colorspace", Info_colorspace, 0);
|
842
|
+
rb_define_method(Class_Info, "colorspace=", Info_colorspace_eq, 1);
|
843
|
+
rb_define_method(Class_Info, "comment", Info_comment, 0);
|
844
|
+
rb_define_method(Class_Info, "comment=", Info_comment_eq, 1);
|
845
|
+
rb_define_method(Class_Info, "compression", Info_compression, 0);
|
846
|
+
rb_define_method(Class_Info, "compression=", Info_compression_eq, 1);
|
847
|
+
rb_define_method(Class_Info, "delay", Info_delay, 0);
|
848
|
+
rb_define_method(Class_Info, "delay=", Info_delay_eq, 1);
|
849
|
+
rb_define_method(Class_Info, "density", Info_density, 0);
|
850
|
+
rb_define_method(Class_Info, "density=", Info_density_eq, 1);
|
851
|
+
rb_define_method(Class_Info, "depth", Info_depth, 0);
|
852
|
+
rb_define_method(Class_Info, "depth=", Info_depth_eq, 1);
|
853
|
+
rb_define_method(Class_Info, "dispose", Info_dispose, 0);
|
854
|
+
rb_define_method(Class_Info, "dispose=", Info_dispose_eq, 1);
|
855
|
+
rb_define_method(Class_Info, "dither", Info_dither, 0);
|
856
|
+
rb_define_method(Class_Info, "dither=", Info_dither_eq, 1);
|
857
|
+
rb_define_method(Class_Info, "endian", Info_endian, 0);
|
858
|
+
rb_define_method(Class_Info, "endian=", Info_endian_eq, 1);
|
859
|
+
rb_define_method(Class_Info, "extract", Info_extract, 0);
|
860
|
+
rb_define_method(Class_Info, "extract=", Info_extract_eq, 1);
|
861
|
+
rb_define_method(Class_Info, "filename", Info_filename, 0);
|
862
|
+
rb_define_method(Class_Info, "filename=", Info_filename_eq, 1);
|
863
|
+
rb_define_method(Class_Info, "fill", Info_fill, 0);
|
864
|
+
rb_define_method(Class_Info, "fill=", Info_fill_eq, 1);
|
865
|
+
rb_define_method(Class_Info, "font", Info_font, 0);
|
866
|
+
rb_define_method(Class_Info, "font=", Info_font_eq, 1);
|
867
|
+
rb_define_method(Class_Info, "format", Info_format, 0);
|
868
|
+
rb_define_method(Class_Info, "format=", Info_format_eq, 1);
|
869
|
+
rb_define_method(Class_Info, "fuzz", Info_fuzz, 0);
|
870
|
+
rb_define_method(Class_Info, "fuzz=", Info_fuzz_eq, 1);
|
871
|
+
rb_define_method(Class_Info, "gravity", Info_gravity, 0);
|
872
|
+
rb_define_method(Class_Info, "gravity=", Info_gravity_eq, 1);
|
873
|
+
rb_define_method(Class_Info, "image_type", Info_image_type, 0);
|
874
|
+
rb_define_method(Class_Info, "image_type=", Info_image_type_eq, 1);
|
875
|
+
rb_define_method(Class_Info, "interlace", Info_interlace, 0);
|
876
|
+
rb_define_method(Class_Info, "interlace=", Info_interlace_eq, 1);
|
877
|
+
rb_define_method(Class_Info, "label", Info_label, 0);
|
878
|
+
rb_define_method(Class_Info, "label=", Info_label_eq, 1);
|
879
|
+
rb_define_method(Class_Info, "matte_color", Info_matte_color, 0);
|
880
|
+
rb_define_method(Class_Info, "matte_color=", Info_matte_color_eq, 1);
|
881
|
+
rb_define_method(Class_Info, "monitor=", Info_monitor_eq, 1);
|
882
|
+
rb_define_method(Class_Info, "monochrome", Info_monochrome, 0);
|
883
|
+
rb_define_method(Class_Info, "monochrome=", Info_monochrome_eq, 1);
|
884
|
+
rb_define_method(Class_Info, "number_scenes", Info_number_scenes, 0);
|
885
|
+
rb_define_method(Class_Info, "number_scenes=", Info_number_scenes_eq, 1);
|
886
|
+
rb_define_method(Class_Info, "orientation", Info_orientation, 0);
|
887
|
+
rb_define_method(Class_Info, "orientation=", Info_orientation_eq, 1);
|
888
|
+
rb_define_method(Class_Info, "origin", Info_origin, 0); // new in 6.3.1
|
889
|
+
rb_define_method(Class_Info, "origin=", Info_origin_eq, 1); // new in 6.3.1
|
890
|
+
rb_define_method(Class_Info, "page", Info_page, 0);
|
891
|
+
rb_define_method(Class_Info, "page=", Info_page_eq, 1);
|
892
|
+
rb_define_method(Class_Info, "pointsize", Info_pointsize, 0);
|
893
|
+
rb_define_method(Class_Info, "pointsize=", Info_pointsize_eq, 1);
|
894
|
+
rb_define_method(Class_Info, "quality", Info_quality, 0);
|
895
|
+
rb_define_method(Class_Info, "quality=", Info_quality_eq, 1);
|
896
|
+
rb_define_method(Class_Info, "sampling_factor", Info_sampling_factor, 0);
|
897
|
+
rb_define_method(Class_Info, "sampling_factor=", Info_sampling_factor_eq, 1);
|
898
|
+
rb_define_method(Class_Info, "scene", Info_scene, 0);
|
899
|
+
rb_define_method(Class_Info, "scene=", Info_scene_eq, 1);
|
900
|
+
rb_define_method(Class_Info, "server_name", Info_server_name, 0);
|
901
|
+
rb_define_method(Class_Info, "server_name=", Info_server_name_eq, 1);
|
902
|
+
rb_define_method(Class_Info, "size", Info_size, 0);
|
903
|
+
rb_define_method(Class_Info, "size=", Info_size_eq, 1);
|
904
|
+
rb_define_method(Class_Info, "stroke", Info_stroke, 0);
|
905
|
+
rb_define_method(Class_Info, "stroke=", Info_stroke_eq, 1);
|
906
|
+
rb_define_method(Class_Info, "stroke_width", Info_stroke_width, 0);
|
907
|
+
rb_define_method(Class_Info, "stroke_width=", Info_stroke_width_eq, 1);
|
908
|
+
rb_define_method(Class_Info, "texture=", Info_texture_eq, 1);
|
909
|
+
rb_define_method(Class_Info, "tile_offset", Info_tile_offset, 0);
|
910
|
+
rb_define_method(Class_Info, "tile_offset=", Info_tile_offset_eq, 1);
|
911
|
+
rb_define_method(Class_Info, "transparent_color", Info_transparent_color, 0);
|
912
|
+
rb_define_method(Class_Info, "transparent_color=", Info_transparent_color_eq, 1);
|
913
|
+
rb_define_method(Class_Info, "undercolor", Info_undercolor, 0);
|
914
|
+
rb_define_method(Class_Info, "undercolor=", Info_undercolor_eq, 1);
|
915
|
+
rb_define_method(Class_Info, "units", Info_units, 0);
|
916
|
+
rb_define_method(Class_Info, "units=", Info_units_eq, 1);
|
917
|
+
rb_define_method(Class_Info, "view", Info_view, 0);
|
918
|
+
rb_define_method(Class_Info, "view=", Info_view_eq, 1);
|
768
919
|
|
769
920
|
/*-----------------------------------------------------------------------*/
|
770
921
|
/* Class Magick::KernelInfo */
|
@@ -775,9 +926,7 @@ Init_RMagick2(void)
|
|
775
926
|
rb_define_alloc_func(Class_KernelInfo, KernelInfo_alloc);
|
776
927
|
|
777
928
|
rb_define_method(Class_KernelInfo, "initialize", KernelInfo_initialize, 1);
|
778
|
-
rb_define_method(Class_KernelInfo, "zero_nans", KernelInfo_zero_nans, 0);
|
779
929
|
rb_define_method(Class_KernelInfo, "unity_add", KernelInfo_unity_add, 1);
|
780
|
-
rb_define_method(Class_KernelInfo, "show", KernelInfo_show, 0);
|
781
930
|
rb_define_method(Class_KernelInfo, "scale", KernelInfo_scale, 2);
|
782
931
|
rb_define_method(Class_KernelInfo, "scale_geometry", KernelInfo_scale_geometry, 1);
|
783
932
|
rb_define_method(Class_KernelInfo, "clone", KernelInfo_clone, 0);
|
@@ -796,27 +945,29 @@ Init_RMagick2(void)
|
|
796
945
|
|
797
946
|
rb_define_method(Class_PolaroidOptions, "initialize", PolaroidOptions_initialize, 0);
|
798
947
|
|
799
|
-
|
800
|
-
|
948
|
+
// Define the attributes
|
949
|
+
rb_define_method(Class_PolaroidOptions, "shadow_color=", PolaroidOptions_shadow_color_eq, 1);
|
950
|
+
rb_define_method(Class_PolaroidOptions, "border_color=", PolaroidOptions_border_color_eq, 1);
|
951
|
+
|
801
952
|
// The other attribute writer methods are implemented by Draw's functions
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
|
811
|
-
|
812
|
-
|
813
|
-
|
814
|
-
|
815
|
-
|
816
|
-
|
817
|
-
|
818
|
-
|
819
|
-
|
953
|
+
rb_define_method(Class_PolaroidOptions, "align=", Draw_align_eq, 1);
|
954
|
+
rb_define_method(Class_PolaroidOptions, "decorate=", Draw_decorate_eq, 1);
|
955
|
+
rb_define_method(Class_PolaroidOptions, "density=", Draw_density_eq, 1);
|
956
|
+
rb_define_method(Class_PolaroidOptions, "encoding=", Draw_encoding_eq, 1);
|
957
|
+
rb_define_method(Class_PolaroidOptions, "fill=", Draw_fill_eq, 1);
|
958
|
+
rb_define_method(Class_PolaroidOptions, "fill_pattern=", Draw_fill_pattern_eq, 1);
|
959
|
+
rb_define_method(Class_PolaroidOptions, "font=", Draw_font_eq, 1);
|
960
|
+
rb_define_method(Class_PolaroidOptions, "font_family=", Draw_font_family_eq, 1);
|
961
|
+
rb_define_method(Class_PolaroidOptions, "font_stretch=", Draw_font_stretch_eq, 1);
|
962
|
+
rb_define_method(Class_PolaroidOptions, "font_style=", Draw_font_style_eq, 1);
|
963
|
+
rb_define_method(Class_PolaroidOptions, "font_weight=", Draw_font_weight_eq, 1);
|
964
|
+
rb_define_method(Class_PolaroidOptions, "gravity=", Draw_gravity_eq, 1);
|
965
|
+
rb_define_method(Class_PolaroidOptions, "pointsize=", Draw_pointsize_eq, 1);
|
966
|
+
rb_define_method(Class_PolaroidOptions, "stroke=", Draw_stroke_eq, 1);
|
967
|
+
rb_define_method(Class_PolaroidOptions, "stroke_pattern=", Draw_stroke_pattern_eq, 1);
|
968
|
+
rb_define_method(Class_PolaroidOptions, "stroke_width=", Draw_stroke_width_eq, 1);
|
969
|
+
rb_define_method(Class_PolaroidOptions, "text_antialias=", Draw_text_antialias_eq, 1);
|
970
|
+
rb_define_method(Class_PolaroidOptions, "undercolor=", Draw_undercolor_eq, 1);
|
820
971
|
|
821
972
|
|
822
973
|
/*-----------------------------------------------------------------------*/
|
@@ -861,9 +1012,7 @@ Init_RMagick2(void)
|
|
861
1012
|
DEF_CONST(QuantumRange);
|
862
1013
|
DEF_CONST(MAGICKCORE_QUANTUM_DEPTH);
|
863
1014
|
DEF_CONSTV(OpaqueAlpha, QuantumRange);
|
864
|
-
DEF_CONST(OpaqueOpacity);
|
865
1015
|
DEF_CONSTV(TransparentAlpha, 0);
|
866
|
-
DEF_CONST(TransparentOpacity);
|
867
1016
|
|
868
1017
|
version_constants();
|
869
1018
|
features_constant();
|
@@ -898,7 +1047,6 @@ Init_RMagick2(void)
|
|
898
1047
|
ENUMERATOR(UndefinedAlphaChannel)
|
899
1048
|
ENUMERATOR(ActivateAlphaChannel)
|
900
1049
|
ENUMERATOR(DeactivateAlphaChannel)
|
901
|
-
ENUMERATOR(ResetAlphaChannel) /* deprecated */
|
902
1050
|
ENUMERATOR(SetAlphaChannel)
|
903
1051
|
ENUMERATOR(RemoveAlphaChannel)
|
904
1052
|
ENUMERATOR(CopyAlphaChannel)
|
@@ -907,7 +1055,6 @@ Init_RMagick2(void)
|
|
907
1055
|
ENUMERATOR(ShapeAlphaChannel)
|
908
1056
|
ENUMERATOR(TransparentAlphaChannel)
|
909
1057
|
ENUMERATOR(BackgroundAlphaChannel)
|
910
|
-
ENUMERATOR(FlattenAlphaChannel)
|
911
1058
|
#if defined(IMAGEMAGICK_GREATER_THAN_EQUAL_6_8_9)
|
912
1059
|
ENUMERATOR(AssociateAlphaChannel)
|
913
1060
|
ENUMERATOR(DisassociateAlphaChannel)
|
@@ -932,7 +1079,6 @@ Init_RMagick2(void)
|
|
932
1079
|
ENUMERATOR(YellowChannel)
|
933
1080
|
ENUMERATOR(OpacityChannel)
|
934
1081
|
ENUMERATOR(BlackChannel)
|
935
|
-
ENUMERATOR(MatteChannel)
|
936
1082
|
ENUMERATOR(IndexChannel)
|
937
1083
|
ENUMERATOR(GrayChannel)
|
938
1084
|
ENUMERATOR(AllChannels)
|
@@ -969,9 +1115,7 @@ Init_RMagick2(void)
|
|
969
1115
|
ENUMERATOR(HWBColorspace)
|
970
1116
|
ENUMERATOR(HSBColorspace)
|
971
1117
|
ENUMERATOR(LabColorspace)
|
972
|
-
ENUMERATOR(Rec601LumaColorspace)
|
973
1118
|
ENUMERATOR(Rec601YCbCrColorspace)
|
974
|
-
ENUMERATOR(Rec709LumaColorspace)
|
975
1119
|
ENUMERATOR(Rec709YCbCrColorspace)
|
976
1120
|
ENUMERATOR(LogColorspace)
|
977
1121
|
ENUMERATOR(CMYColorspace)
|
@@ -988,6 +1132,16 @@ Init_RMagick2(void)
|
|
988
1132
|
ENUMERATOR(HCLpColorspace)
|
989
1133
|
ENUMERATOR(YDbDrColorspace)
|
990
1134
|
ENUMERATORV(XyYColorspace, xyYColorspace)
|
1135
|
+
#endif
|
1136
|
+
#if defined(IMAGEMAGICK_7)
|
1137
|
+
#if defined(IMAGEMAGICK_GREATER_THAN_EQUAL_7_0_8)
|
1138
|
+
ENUMERATOR(LinearGRAYColorspace)
|
1139
|
+
#endif
|
1140
|
+
#if defined(IMAGEMAGICK_GREATER_THAN_EQUAL_7_0_10)
|
1141
|
+
ENUMERATOR(JzazbzColorspace)
|
1142
|
+
#endif
|
1143
|
+
#elif defined(IMAGEMAGICK_GREATER_THAN_EQUAL_6_9_10)
|
1144
|
+
ENUMERATOR(LinearGRAYColorspace)
|
991
1145
|
#endif
|
992
1146
|
END_ENUM
|
993
1147
|
|
@@ -1019,7 +1173,6 @@ Init_RMagick2(void)
|
|
1019
1173
|
ENUMERATOR(CopyCyanCompositeOp)
|
1020
1174
|
ENUMERATOR(CopyGreenCompositeOp)
|
1021
1175
|
ENUMERATOR(CopyMagentaCompositeOp)
|
1022
|
-
ENUMERATORV(CopyAlphaCompositeOp, CopyOpacityCompositeOp)
|
1023
1176
|
ENUMERATOR(CopyRedCompositeOp)
|
1024
1177
|
ENUMERATOR(CopyYellowCompositeOp)
|
1025
1178
|
ENUMERATOR(DarkenCompositeOp)
|
@@ -1037,9 +1190,6 @@ Init_RMagick2(void)
|
|
1037
1190
|
ENUMERATOR(DissolveCompositeOp)
|
1038
1191
|
ENUMERATOR(ExclusionCompositeOp)
|
1039
1192
|
ENUMERATOR(HardLightCompositeOp)
|
1040
|
-
#if defined(IMAGEMAGICK_GREATER_THAN_EQUAL_6_8_9)
|
1041
|
-
ENUMERATOR(HardMixCompositeOp)
|
1042
|
-
#endif
|
1043
1193
|
ENUMERATOR(HueCompositeOp)
|
1044
1194
|
ENUMERATOR(InCompositeOp)
|
1045
1195
|
ENUMERATOR(LightenCompositeOp)
|
@@ -1075,6 +1225,14 @@ Init_RMagick2(void)
|
|
1075
1225
|
ENUMERATOR(UndefinedCompositeOp)
|
1076
1226
|
ENUMERATOR(VividLightCompositeOp)
|
1077
1227
|
ENUMERATOR(XorCompositeOp)
|
1228
|
+
#if defined(IMAGEMAGICK_GREATER_THAN_EQUAL_6_8_9)
|
1229
|
+
ENUMERATOR(HardMixCompositeOp)
|
1230
|
+
#endif
|
1231
|
+
#if defined(IMAGEMAGICK_7)
|
1232
|
+
ENUMERATOR(CopyAlphaCompositeOp)
|
1233
|
+
#else
|
1234
|
+
ENUMERATORV(CopyAlphaCompositeOp, CopyOpacityCompositeOp)
|
1235
|
+
#endif
|
1078
1236
|
END_ENUM
|
1079
1237
|
|
1080
1238
|
// CompressionType constants
|
@@ -1207,7 +1365,6 @@ Init_RMagick2(void)
|
|
1207
1365
|
ENUMERATOR(SouthWestGravity)
|
1208
1366
|
ENUMERATOR(SouthGravity)
|
1209
1367
|
ENUMERATOR(SouthEastGravity)
|
1210
|
-
ENUMERATOR(StaticGravity)
|
1211
1368
|
END_ENUM
|
1212
1369
|
|
1213
1370
|
// ImageType constants
|
@@ -1215,15 +1372,23 @@ Init_RMagick2(void)
|
|
1215
1372
|
ENUMERATOR(UndefinedType)
|
1216
1373
|
ENUMERATOR(BilevelType)
|
1217
1374
|
ENUMERATOR(GrayscaleType)
|
1218
|
-
ENUMERATORV(GrayscaleAlphaType, GrayscaleMatteType)
|
1219
1375
|
ENUMERATOR(PaletteType)
|
1220
|
-
ENUMERATORV(PaletteAlphaType, PaletteMatteType)
|
1221
1376
|
ENUMERATOR(TrueColorType)
|
1222
|
-
ENUMERATORV(TrueColorAlphaType, TrueColorMatteType)
|
1223
1377
|
ENUMERATOR(ColorSeparationType)
|
1224
|
-
ENUMERATORV(ColorSeparationAlphaType, ColorSeparationMatteType)
|
1225
1378
|
ENUMERATOR(OptimizeType)
|
1379
|
+
#if defined(IMAGEMAGICK_7)
|
1380
|
+
ENUMERATOR(GrayscaleAlphaType)
|
1381
|
+
ENUMERATOR(PaletteAlphaType)
|
1382
|
+
ENUMERATOR(TrueColorAlphaType)
|
1383
|
+
ENUMERATOR(ColorSeparationAlphaType)
|
1384
|
+
ENUMERATOR(PaletteBilevelAlphaType)
|
1385
|
+
#else
|
1386
|
+
ENUMERATORV(GrayscaleAlphaType, GrayscaleMatteType)
|
1387
|
+
ENUMERATORV(PaletteAlphaType, PaletteMatteType)
|
1388
|
+
ENUMERATORV(TrueColorAlphaType, TrueColorMatteType)
|
1389
|
+
ENUMERATORV(ColorSeparationAlphaType, ColorSeparationMatteType)
|
1226
1390
|
ENUMERATORV(PaletteBilevelAlphaType, PaletteBilevelMatteType)
|
1391
|
+
#endif
|
1227
1392
|
END_ENUM
|
1228
1393
|
|
1229
1394
|
// InterlaceType constants
|
@@ -1267,18 +1432,24 @@ Init_RMagick2(void)
|
|
1267
1432
|
END_ENUM
|
1268
1433
|
|
1269
1434
|
DEF_ENUM(MetricType)
|
1270
|
-
ENUMERATORV(UndefinedErrorMetric, UndefinedMetric)
|
1271
1435
|
ENUMERATOR(AbsoluteErrorMetric)
|
1272
1436
|
ENUMERATOR(MeanAbsoluteErrorMetric)
|
1273
|
-
ENUMERATORV(MeanErrorPerPixelErrorMetric, MeanErrorPerPixelMetric)
|
1274
1437
|
ENUMERATOR(MeanSquaredErrorMetric)
|
1275
1438
|
ENUMERATOR(PeakAbsoluteErrorMetric)
|
1276
|
-
ENUMERATORV(PeakSignalToNoiseRatioErrorMetric, PeakSignalToNoiseRatioMetric)
|
1277
1439
|
ENUMERATOR(RootMeanSquaredErrorMetric)
|
1278
1440
|
ENUMERATOR(NormalizedCrossCorrelationErrorMetric)
|
1279
1441
|
ENUMERATOR(FuzzErrorMetric)
|
1280
1442
|
#if defined(IMAGEMAGICK_GREATER_THAN_EQUAL_6_8_9)
|
1281
1443
|
ENUMERATOR(PerceptualHashErrorMetric)
|
1444
|
+
#endif
|
1445
|
+
#if defined(IMAGEMAGICK_7)
|
1446
|
+
ENUMERATOR(UndefinedErrorMetric)
|
1447
|
+
ENUMERATOR(MeanErrorPerPixelErrorMetric)
|
1448
|
+
ENUMERATOR(PeakSignalToNoiseRatioErrorMetric)
|
1449
|
+
#else
|
1450
|
+
ENUMERATORV(UndefinedErrorMetric, UndefinedMetric)
|
1451
|
+
ENUMERATORV(MeanErrorPerPixelErrorMetric, MeanErrorPerPixelMetric)
|
1452
|
+
ENUMERATORV(PeakSignalToNoiseRatioErrorMetric, PeakSignalToNoiseRatioMetric)
|
1282
1453
|
#endif
|
1283
1454
|
END_ENUM
|
1284
1455
|
|
@@ -1319,12 +1490,14 @@ Init_RMagick2(void)
|
|
1319
1490
|
DEF_ENUM(PixelInterpolateMethod)
|
1320
1491
|
ENUMERATOR(UndefinedInterpolatePixel)
|
1321
1492
|
ENUMERATOR(AverageInterpolatePixel)
|
1322
|
-
ENUMERATOR(BicubicInterpolatePixel)
|
1323
1493
|
ENUMERATOR(BilinearInterpolatePixel)
|
1324
|
-
ENUMERATOR(FilterInterpolatePixel)
|
1325
1494
|
ENUMERATOR(IntegerInterpolatePixel)
|
1326
1495
|
ENUMERATOR(MeshInterpolatePixel)
|
1327
|
-
|
1496
|
+
#if defined(IMAGEMAGICK_7)
|
1497
|
+
ENUMERATOR(NearestInterpolatePixel)
|
1498
|
+
#else
|
1499
|
+
ENUMERATORV(NearestInterpolatePixel, NearestNeighborInterpolatePixel)
|
1500
|
+
#endif
|
1328
1501
|
ENUMERATOR(SplineInterpolatePixel)
|
1329
1502
|
ENUMERATOR(Average9InterpolatePixel)
|
1330
1503
|
ENUMERATOR(Average16InterpolatePixel)
|
@@ -1392,6 +1565,7 @@ Init_RMagick2(void)
|
|
1392
1565
|
ENUMERATOR(PoissonNoiseQuantumOperator)
|
1393
1566
|
ENUMERATOR(UniformNoiseQuantumOperator)
|
1394
1567
|
ENUMERATOR(CosineQuantumOperator)
|
1568
|
+
ENUMERATOR(SetQuantumOperator)
|
1395
1569
|
ENUMERATOR(SineQuantumOperator)
|
1396
1570
|
ENUMERATOR(AddModulusQuantumOperator)
|
1397
1571
|
ENUMERATOR(MeanQuantumOperator)
|
@@ -1444,7 +1618,6 @@ Init_RMagick2(void)
|
|
1444
1618
|
ENUMERATOR(CharPixel)
|
1445
1619
|
ENUMERATOR(DoublePixel)
|
1446
1620
|
ENUMERATOR(FloatPixel)
|
1447
|
-
ENUMERATOR(IntegerPixel)
|
1448
1621
|
ENUMERATOR(LongPixel)
|
1449
1622
|
ENUMERATOR(QuantumPixel)
|
1450
1623
|
ENUMERATOR(ShortPixel)
|
@@ -1482,7 +1655,6 @@ Init_RMagick2(void)
|
|
1482
1655
|
ENUMERATOR(BackgroundVirtualPixelMethod)
|
1483
1656
|
ENUMERATOR(DitherVirtualPixelMethod)
|
1484
1657
|
ENUMERATOR(RandomVirtualPixelMethod)
|
1485
|
-
ENUMERATOR(ConstantVirtualPixelMethod)
|
1486
1658
|
ENUMERATOR(MaskVirtualPixelMethod)
|
1487
1659
|
ENUMERATOR(BlackVirtualPixelMethod)
|
1488
1660
|
ENUMERATOR(GrayVirtualPixelMethod)
|
@@ -1612,56 +1784,52 @@ Init_RMagick2(void)
|
|
1612
1784
|
// namespace. The only way to use these classes is via the Magick:: namespace.
|
1613
1785
|
|
1614
1786
|
// Magick::AffineMatrix
|
1615
|
-
Class_AffineMatrix =
|
1616
|
-
|
1787
|
+
Class_AffineMatrix = rb_struct_define_under(Module_Magick, "AffineMatrix",
|
1788
|
+
"sx", "rx", "ry", "sy", "tx", "ty", NULL);
|
1617
1789
|
|
1618
1790
|
// Magick::Primary
|
1619
|
-
Class_Primary =
|
1791
|
+
Class_Primary = rb_struct_define_under(Module_Magick, "Primary",
|
1792
|
+
"x", "y", "z", NULL);
|
1620
1793
|
rb_define_method(Class_Primary, "to_s", PrimaryInfo_to_s, 0);
|
1621
|
-
rb_define_const(Module_Magick, "Primary", Class_Primary);
|
1622
1794
|
|
1623
1795
|
// Magick::Chromaticity
|
1624
|
-
Class_Chromaticity =
|
1625
|
-
|
1626
|
-
|
1627
|
-
, "blue_primary"
|
1628
|
-
, "white_point"
|
1629
|
-
, NULL);
|
1796
|
+
Class_Chromaticity = rb_struct_define_under(Module_Magick, "Chromaticity",
|
1797
|
+
"red_primary", "green_primary",
|
1798
|
+
"blue_primary", "white_point", NULL);
|
1630
1799
|
rb_define_method(Class_Chromaticity, "to_s", ChromaticityInfo_to_s, 0);
|
1631
|
-
rb_define_const(Module_Magick, "Chromaticity", Class_Chromaticity);
|
1632
1800
|
|
1633
1801
|
// Magick::Color
|
1634
|
-
Class_Color =
|
1802
|
+
Class_Color = rb_struct_define_under(Module_Magick, "Color",
|
1803
|
+
"name", "compliance", "color", NULL);
|
1635
1804
|
rb_define_method(Class_Color, "to_s", Color_to_s, 0);
|
1636
|
-
rb_define_const(Module_Magick, "Color", Class_Color);
|
1637
1805
|
|
1638
1806
|
// Magick::Point
|
1639
|
-
Class_Point =
|
1640
|
-
|
1807
|
+
Class_Point = rb_struct_define_under(Module_Magick, "Point",
|
1808
|
+
"x", "y", NULL);
|
1641
1809
|
|
1642
1810
|
// Magick::Rectangle
|
1643
|
-
Class_Rectangle =
|
1811
|
+
Class_Rectangle = rb_struct_define_under(Module_Magick, "Rectangle",
|
1812
|
+
"width", "height", "x", "y", NULL);
|
1644
1813
|
rb_define_method(Class_Rectangle, "to_s", RectangleInfo_to_s, 0);
|
1645
|
-
rb_define_const(Module_Magick, "Rectangle", Class_Rectangle);
|
1646
1814
|
|
1647
1815
|
// Magick::Segment
|
1648
|
-
Class_Segment =
|
1816
|
+
Class_Segment = rb_struct_define_under(Module_Magick, "Segment",
|
1817
|
+
"x1", "y1", "x2", "y2", NULL);
|
1649
1818
|
rb_define_method(Class_Segment, "to_s", SegmentInfo_to_s, 0);
|
1650
|
-
rb_define_const(Module_Magick, "Segment", Class_Segment);
|
1651
1819
|
|
1652
1820
|
// Magick::Font
|
1653
|
-
Class_Font =
|
1654
|
-
|
1655
|
-
|
1821
|
+
Class_Font = rb_struct_define_under(Module_Magick, "Font",
|
1822
|
+
"name", "description",
|
1823
|
+
"family", "style", "stretch", "weight",
|
1824
|
+
"encoding", "foundry", "format", NULL);
|
1656
1825
|
rb_define_method(Class_Font, "to_s", Font_to_s, 0);
|
1657
|
-
rb_define_const(Module_Magick, "Font", Class_Font);
|
1658
1826
|
|
1659
1827
|
// Magick::TypeMetric
|
1660
|
-
Class_TypeMetric =
|
1661
|
-
|
1662
|
-
|
1828
|
+
Class_TypeMetric = rb_struct_define_under(Module_Magick, "TypeMetric",
|
1829
|
+
"pixels_per_em", "ascent", "descent",
|
1830
|
+
"width", "height", "max_advance", "bounds",
|
1831
|
+
"underline_position", "underline_thickness", NULL);
|
1663
1832
|
rb_define_method(Class_TypeMetric, "to_s", TypeMetric_to_s, 0);
|
1664
|
-
rb_define_const(Module_Magick, "TypeMetric", Class_TypeMetric);
|
1665
1833
|
|
1666
1834
|
|
1667
1835
|
/*-----------------------------------------------------------------------*/
|
@@ -1671,8 +1839,6 @@ Init_RMagick2(void)
|
|
1671
1839
|
SetFatalErrorHandler(rm_fatal_error_handler);
|
1672
1840
|
SetErrorHandler(rm_error_handler);
|
1673
1841
|
SetWarningHandler(rm_warning_handler);
|
1674
|
-
|
1675
|
-
RB_GC_GUARD(observable);
|
1676
1842
|
}
|
1677
1843
|
|
1678
1844
|
|
@@ -1693,7 +1859,6 @@ test_Magick_version(void)
|
|
1693
1859
|
{
|
1694
1860
|
size_t version_number;
|
1695
1861
|
const char *version_str;
|
1696
|
-
int x, n;
|
1697
1862
|
ID bypass = rb_intern("RMAGICK_BYPASS_VERSION_TEST");
|
1698
1863
|
|
1699
1864
|
if (RTEST(rb_const_defined(rb_cObject, bypass)) && RTEST(rb_const_get(rb_cObject, bypass)))
|
@@ -1704,6 +1869,8 @@ test_Magick_version(void)
|
|
1704
1869
|
version_str = GetMagickVersion(&version_number);
|
1705
1870
|
if (version_number != MagickLibVersion)
|
1706
1871
|
{
|
1872
|
+
int n, x;
|
1873
|
+
|
1707
1874
|
// Extract the string "ImageMagick X.Y.Z"
|
1708
1875
|
n = 0;
|
1709
1876
|
for (x = 0; version_str[x] != '\0'; x++)
|
@@ -1715,7 +1882,8 @@ test_Magick_version(void)
|
|
1715
1882
|
}
|
1716
1883
|
|
1717
1884
|
rb_raise(rb_eRuntimeError,
|
1718
|
-
"This installation of RMagick was configured with %s %s but %.*s is in use.\n"
|
1885
|
+
"This installation of RMagick was configured with %s %s but %.*s is in use.\n"
|
1886
|
+
"Please re-install RMagick to correct the issue.\n",
|
1719
1887
|
MagickPackageName, MagickLibVersionText, x, version_str);
|
1720
1888
|
}
|
1721
1889
|
|
@@ -1747,7 +1915,7 @@ version_constants(void)
|
|
1747
1915
|
rb_obj_freeze(str);
|
1748
1916
|
rb_define_const(Module_Magick, "Version", str);
|
1749
1917
|
|
1750
|
-
|
1918
|
+
snprintf(long_version, sizeof(long_version),
|
1751
1919
|
"This is %s ($Date: 2009/12/20 02:33:33 $) Copyright (C) 2009 by Timothy P. Hunter\n"
|
1752
1920
|
"Built with %s\n"
|
1753
1921
|
"Built for %s\n"
|