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/rmilist.c
CHANGED
@@ -16,7 +16,6 @@ static Image *clone_imagelist(Image *);
|
|
16
16
|
static Image *images_from_imagelist(VALUE);
|
17
17
|
static long imagelist_length(VALUE);
|
18
18
|
static long check_imagelist_length(VALUE);
|
19
|
-
static VALUE imagelist_scene_eq(VALUE, VALUE);
|
20
19
|
static void imagelist_push(VALUE, VALUE);
|
21
20
|
static VALUE ImageList_new(void);
|
22
21
|
|
@@ -26,17 +25,15 @@ static VALUE ImageList_new(void);
|
|
26
25
|
|
27
26
|
/**
|
28
27
|
* Repeatedly display the images in the images array to an XWindow screen. The
|
29
|
-
*
|
28
|
+
* +delay+ argument is the number of 1/100ths of a second (0 to 65535) to delay
|
30
29
|
* between images.
|
31
30
|
*
|
32
|
-
*
|
33
|
-
* - @verbatim ImageList#animate @endverbatim
|
34
|
-
* - @verbatim ImageList#animate(delay) @endverbatim
|
31
|
+
* @overload animate
|
35
32
|
*
|
36
|
-
* @
|
37
|
-
*
|
38
|
-
*
|
39
|
-
* @return self
|
33
|
+
* @overload animate(delay)
|
34
|
+
* @param delay [Numeric] the length of time between each image in an animation
|
35
|
+
*
|
36
|
+
* @return [Magick::ImageList] self
|
40
37
|
*/
|
41
38
|
|
42
39
|
VALUE
|
@@ -78,12 +75,12 @@ ImageList_animate(int argc, VALUE *argv, VALUE self)
|
|
78
75
|
Data_Get_Struct(info_obj, Info, info);
|
79
76
|
#if defined(IMAGEMAGICK_7)
|
80
77
|
exception = AcquireExceptionInfo();
|
81
|
-
|
78
|
+
AnimateImages(info, images, exception);
|
82
79
|
rm_split(images);
|
83
|
-
CHECK_EXCEPTION()
|
84
|
-
|
80
|
+
CHECK_EXCEPTION();
|
81
|
+
DestroyExceptionInfo(exception);
|
85
82
|
#else
|
86
|
-
|
83
|
+
AnimateImages(info, images);
|
87
84
|
rm_split(images);
|
88
85
|
rm_check_image_exception(images, RetainOnError);
|
89
86
|
#endif
|
@@ -95,14 +92,10 @@ ImageList_animate(int argc, VALUE *argv, VALUE self)
|
|
95
92
|
|
96
93
|
|
97
94
|
/**
|
98
|
-
* Append all the images
|
99
|
-
*
|
100
|
-
* Ruby usage:
|
101
|
-
* - @verbatim ImageList#append(stack) @endverbatim
|
95
|
+
* Append all the images
|
102
96
|
*
|
103
|
-
* @param
|
104
|
-
* @
|
105
|
-
* @return a Frame object for the result
|
97
|
+
* @param stack_arg [Magick::ImageList] the stack of images
|
98
|
+
* @return [Magick::Image] a frame object for the result
|
106
99
|
*/
|
107
100
|
VALUE
|
108
101
|
ImageList_append(VALUE self, VALUE stack_arg)
|
@@ -122,22 +115,16 @@ ImageList_append(VALUE self, VALUE stack_arg)
|
|
122
115
|
new_image = AppendImages(images, stack, exception);
|
123
116
|
rm_split(images);
|
124
117
|
rm_check_exception(exception, new_image, DestroyOnError);
|
125
|
-
|
126
|
-
|
127
|
-
rm_ensure_result(new_image);
|
118
|
+
DestroyExceptionInfo(exception);
|
128
119
|
|
129
120
|
return rm_image_new(new_image);
|
130
121
|
}
|
131
122
|
|
132
123
|
|
133
124
|
/**
|
134
|
-
* Average all images together
|
135
|
-
*
|
136
|
-
* Ruby usage:
|
137
|
-
* - @verbatim ImageList#average @endverbatim
|
125
|
+
* Average all images together
|
138
126
|
*
|
139
|
-
* @
|
140
|
-
* @return a Frame object for the averaged image
|
127
|
+
* @return [Magick::Image] a frame object for the averaged image
|
141
128
|
*/
|
142
129
|
VALUE
|
143
130
|
ImageList_average(VALUE self)
|
@@ -153,26 +140,19 @@ ImageList_average(VALUE self)
|
|
153
140
|
|
154
141
|
rm_split(images);
|
155
142
|
rm_check_exception(exception, new_image, DestroyOnError);
|
156
|
-
|
157
|
-
|
158
|
-
rm_ensure_result(new_image);
|
143
|
+
DestroyExceptionInfo(exception);
|
159
144
|
|
160
145
|
return rm_image_new(new_image);
|
161
146
|
}
|
162
147
|
|
163
148
|
|
164
149
|
/**
|
165
|
-
*
|
166
|
-
*
|
167
|
-
* Ruby usage:
|
168
|
-
* - @verbatim ImageList#coalesce @endverbatim
|
150
|
+
* Composites a set of images while respecting any page offsets and disposal methods.
|
169
151
|
*
|
170
|
-
*
|
171
|
-
* - Respects the delay, matte, and start_loop fields in each image.
|
152
|
+
* - Respects the delay, matte, and start_loop fields in each image.
|
172
153
|
*
|
173
|
-
* @
|
174
|
-
*
|
175
|
-
* images array
|
154
|
+
* @return [Magick::ImageList] a new image with the coalesced image sequence return stored in the
|
155
|
+
* images array
|
176
156
|
*/
|
177
157
|
VALUE
|
178
158
|
ImageList_coalesce(VALUE self)
|
@@ -187,9 +167,7 @@ ImageList_coalesce(VALUE self)
|
|
187
167
|
new_images = CoalesceImages(images, exception);
|
188
168
|
rm_split(images);
|
189
169
|
rm_check_exception(exception, new_images, DestroyOnError);
|
190
|
-
|
191
|
-
|
192
|
-
rm_ensure_result(new_images);
|
170
|
+
DestroyExceptionInfo(exception);
|
193
171
|
|
194
172
|
return rm_imagelist_from_images(new_images);
|
195
173
|
}
|
@@ -198,24 +176,20 @@ ImageList_coalesce(VALUE self)
|
|
198
176
|
/**
|
199
177
|
* Combines the images using the specified colorspace.
|
200
178
|
*
|
201
|
-
*
|
202
|
-
* - @verbatim new_image = ImageList#combine @endverbatim
|
203
|
-
* - @verbatim new_image = ImageList#combine(colorspace) @endverbatim
|
179
|
+
* @overload combine
|
204
180
|
*
|
205
|
-
*
|
206
|
-
*
|
181
|
+
* @overload combine(colorspace)
|
182
|
+
* @param colorspace [Magick::ColorspaceType] the colorspace
|
207
183
|
*
|
208
|
-
* @
|
209
|
-
* @param argv array of input arguments
|
210
|
-
* @param self this object
|
211
|
-
* @return a new image
|
184
|
+
* @return [Magick::Image] a new image
|
212
185
|
*/
|
213
186
|
VALUE ImageList_combine(int argc, VALUE *argv, VALUE self)
|
214
187
|
{
|
215
188
|
#if defined(IMAGEMAGICK_6)
|
216
189
|
ChannelType channel;
|
190
|
+
ColorspaceType old_colorspace;
|
217
191
|
#endif
|
218
|
-
ColorspaceType colorspace
|
192
|
+
ColorspaceType colorspace;
|
219
193
|
long len;
|
220
194
|
Image *images, *new_image;
|
221
195
|
ExceptionInfo *exception;
|
@@ -288,29 +262,24 @@ VALUE ImageList_combine(int argc, VALUE *argv, VALUE self)
|
|
288
262
|
images->colorspace = old_colorspace;
|
289
263
|
#endif
|
290
264
|
rm_check_exception(exception, new_image, DestroyOnError);
|
291
|
-
|
292
|
-
|
293
|
-
rm_ensure_result(new_image);
|
265
|
+
DestroyExceptionInfo(exception);
|
294
266
|
|
295
267
|
return rm_image_new(new_image);
|
296
268
|
}
|
297
269
|
|
298
270
|
|
299
271
|
/**
|
300
|
-
*
|
272
|
+
* An image from source images is composited over an image from receiver's list until one list is finished.
|
301
273
|
*
|
302
|
-
*
|
303
|
-
*
|
304
|
-
* - @verbatim ImageList#composite_layers(images,operator) @endverbatim
|
274
|
+
* @overload composite_layers(images)
|
275
|
+
* @param images [Magick::ImageList] the source images
|
305
276
|
*
|
306
|
-
*
|
307
|
-
* - Default operator is OverCompositeOp
|
277
|
+
* @overload composite_layers(images, operator)
|
278
|
+
* - Default operator is {Magick::OverCompositeOp}
|
279
|
+
* @param images [Magick::ImageList] the source images
|
280
|
+
* @param operator [Magick::CompositeOperator] the operator
|
308
281
|
*
|
309
|
-
* @
|
310
|
-
* @param argv array of input arguments
|
311
|
-
* @param self this object
|
312
|
-
* @return a new imagelist
|
313
|
-
* @see mogrify.c in ImageMagick
|
282
|
+
* @return [Magick::ImageList] a new imagelist
|
314
283
|
*/
|
315
284
|
VALUE
|
316
285
|
ImageList_composite_layers(int argc, VALUE *argv, VALUE self)
|
@@ -340,20 +309,20 @@ ImageList_composite_layers(int argc, VALUE *argv, VALUE self)
|
|
340
309
|
|
341
310
|
source = images_from_imagelist(source_images);
|
342
311
|
|
343
|
-
SetGeometry(new_images
|
344
|
-
|
312
|
+
SetGeometry(new_images, &geometry);
|
313
|
+
ParseAbsoluteGeometry(new_images->geometry, &geometry);
|
345
314
|
|
346
315
|
geometry.width = source->page.width != 0 ? source->page.width : source->columns;
|
347
316
|
geometry.height = source->page.height != 0 ? source->page.height : source->rows;
|
348
|
-
GravityAdjustGeometry(new_images->page.width != 0 ? new_images->page.width : new_images->columns
|
349
|
-
|
350
|
-
|
317
|
+
GravityAdjustGeometry(new_images->page.width != 0 ? new_images->page.width : new_images->columns,
|
318
|
+
new_images->page.height != 0 ? new_images->page.height : new_images->rows,
|
319
|
+
new_images->gravity, &geometry);
|
351
320
|
|
352
321
|
exception = AcquireExceptionInfo();
|
353
322
|
CompositeLayers(new_images, operator, source, geometry.x, geometry.y, exception);
|
354
323
|
rm_split(source);
|
355
324
|
rm_check_exception(exception, new_images, DestroyOnError);
|
356
|
-
|
325
|
+
DestroyExceptionInfo(exception);
|
357
326
|
|
358
327
|
RB_GC_GUARD(source_images);
|
359
328
|
|
@@ -365,11 +334,7 @@ ImageList_composite_layers(int argc, VALUE *argv, VALUE self)
|
|
365
334
|
* Compare each image with the next in a sequence and returns the maximum
|
366
335
|
* bounding region of any pixel differences it discovers.
|
367
336
|
*
|
368
|
-
*
|
369
|
-
* - @verbatim ImageList#deconstruct @endverbatim
|
370
|
-
*
|
371
|
-
* @param self this object
|
372
|
-
* @return a new imagelist
|
337
|
+
* @return [Magick::ImageList] a new imagelist
|
373
338
|
*/
|
374
339
|
VALUE
|
375
340
|
ImageList_deconstruct(VALUE self)
|
@@ -386,9 +351,7 @@ ImageList_deconstruct(VALUE self)
|
|
386
351
|
#endif
|
387
352
|
rm_split(images);
|
388
353
|
rm_check_exception(exception, new_images, DestroyOnError);
|
389
|
-
|
390
|
-
|
391
|
-
rm_ensure_result(new_images);
|
354
|
+
DestroyExceptionInfo(exception);
|
392
355
|
|
393
356
|
return rm_imagelist_from_images(new_images);
|
394
357
|
}
|
@@ -397,11 +360,7 @@ ImageList_deconstruct(VALUE self)
|
|
397
360
|
/**
|
398
361
|
* Display all the images to an X window screen.
|
399
362
|
*
|
400
|
-
*
|
401
|
-
* - @verbatim ImageList#display @endverbatim
|
402
|
-
*
|
403
|
-
* @param self this object
|
404
|
-
* @return self
|
363
|
+
* @return [Magick::ImageList] self
|
405
364
|
*/
|
406
365
|
VALUE
|
407
366
|
ImageList_display(VALUE self)
|
@@ -421,12 +380,12 @@ ImageList_display(VALUE self)
|
|
421
380
|
images = images_from_imagelist(self);
|
422
381
|
#if defined(IMAGEMAGICK_7)
|
423
382
|
exception = AcquireExceptionInfo();
|
424
|
-
|
383
|
+
DisplayImages(info, images, exception);
|
425
384
|
rm_split(images);
|
426
385
|
CHECK_EXCEPTION();
|
427
|
-
|
386
|
+
DestroyExceptionInfo(exception);
|
428
387
|
#else
|
429
|
-
|
388
|
+
DisplayImages(info, images);
|
430
389
|
rm_split(images);
|
431
390
|
rm_check_image_exception(images, RetainOnError);
|
432
391
|
#endif
|
@@ -440,14 +399,7 @@ ImageList_display(VALUE self)
|
|
440
399
|
/**
|
441
400
|
* Merge all the images into a single image.
|
442
401
|
*
|
443
|
-
*
|
444
|
-
* - @verbatim ImageList#flatten_images @endverbatim
|
445
|
-
*
|
446
|
-
* Notes:
|
447
|
-
* - Can't use "flatten" because that's an Array method
|
448
|
-
*
|
449
|
-
* @param self this object
|
450
|
-
* @return the new image
|
402
|
+
* @return [Magick::ImageList] the new image
|
451
403
|
*/
|
452
404
|
VALUE
|
453
405
|
ImageList_flatten_images(VALUE self)
|
@@ -462,26 +414,23 @@ ImageList_flatten_images(VALUE self)
|
|
462
414
|
|
463
415
|
rm_split(images);
|
464
416
|
rm_check_exception(exception, new_image, DestroyOnError);
|
465
|
-
|
466
|
-
|
467
|
-
rm_ensure_result(new_image);
|
417
|
+
DestroyExceptionInfo(exception);
|
468
418
|
|
469
419
|
return rm_image_new(new_image);
|
470
420
|
}
|
471
421
|
|
472
422
|
|
473
423
|
/**
|
474
|
-
*
|
424
|
+
* Tile one or more thumbnails across an image canvas.
|
475
425
|
*
|
476
|
-
*
|
477
|
-
* - @verbatim ImageList#montage <{parm block}> @endverbatim
|
426
|
+
* @overload montage
|
478
427
|
*
|
479
|
-
*
|
480
|
-
*
|
481
|
-
*
|
482
|
-
*
|
483
|
-
*
|
484
|
-
* @return a new image list
|
428
|
+
* @overload montage
|
429
|
+
* Creates {Magick::ImageList::Montage} object, yields to block
|
430
|
+
* if present in {Magick::ImageList::Montage} object's scope.
|
431
|
+
* @yield []
|
432
|
+
*
|
433
|
+
* @return [Magick::ImageList] a new image list
|
485
434
|
*/
|
486
435
|
VALUE
|
487
436
|
ImageList_montage(VALUE self)
|
@@ -497,7 +446,7 @@ ImageList_montage(VALUE self)
|
|
497
446
|
{
|
498
447
|
// Run the block in the instance's context, allowing the app to modify the
|
499
448
|
// object's attributes.
|
500
|
-
|
449
|
+
rb_obj_instance_eval(0, NULL, montage_obj);
|
501
450
|
}
|
502
451
|
|
503
452
|
Data_Get_Struct(montage_obj, Montage, montage);
|
@@ -522,9 +471,7 @@ ImageList_montage(VALUE self)
|
|
522
471
|
new_images = MontageImages(images, montage->info, exception);
|
523
472
|
rm_split(images);
|
524
473
|
rm_check_exception(exception, new_images, DestroyOnError);
|
525
|
-
|
526
|
-
|
527
|
-
rm_ensure_result(new_images);
|
474
|
+
DestroyExceptionInfo(exception);
|
528
475
|
|
529
476
|
RB_GC_GUARD(montage_obj);
|
530
477
|
|
@@ -534,17 +481,11 @@ ImageList_montage(VALUE self)
|
|
534
481
|
|
535
482
|
/**
|
536
483
|
* Requires a minimum of two images. The first image is transformed into the
|
537
|
-
* second by a number of intervening images as specified by "
|
484
|
+
* second by a number of intervening images as specified by "nimages".
|
538
485
|
*
|
539
|
-
*
|
540
|
-
*
|
541
|
-
*
|
542
|
-
* Notes:
|
543
|
-
* - Sets \@scenes to 0
|
544
|
-
*
|
545
|
-
* @param self this object
|
546
|
-
* @param nimages the number of images
|
547
|
-
* @return a new image list with the images array set to the morph sequence.
|
486
|
+
* @note Sets +@scenes+ to 0
|
487
|
+
* @param nimages [Numeric] the number of images
|
488
|
+
* @return [Magick::ImageList] a new image list with the images array set to the morph sequence.
|
548
489
|
*/
|
549
490
|
VALUE
|
550
491
|
ImageList_morph(VALUE self, VALUE nimages)
|
@@ -566,9 +507,7 @@ ImageList_morph(VALUE self, VALUE nimages)
|
|
566
507
|
new_images = MorphImages(images, (unsigned long)number_images, exception);
|
567
508
|
rm_split(images);
|
568
509
|
rm_check_exception(exception, new_images, DestroyOnError);
|
569
|
-
|
570
|
-
|
571
|
-
rm_ensure_result(new_images);
|
510
|
+
DestroyExceptionInfo(exception);
|
572
511
|
|
573
512
|
return rm_imagelist_from_images(new_images);
|
574
513
|
}
|
@@ -577,11 +516,7 @@ ImageList_morph(VALUE self, VALUE nimages)
|
|
577
516
|
/**
|
578
517
|
* Merge all the images into a single image.
|
579
518
|
*
|
580
|
-
*
|
581
|
-
* - @verbatim ImageList#mosaic @endverbatim
|
582
|
-
*
|
583
|
-
* @param self this object
|
584
|
-
* @return the new image
|
519
|
+
* @return [Magick::Image] the new image
|
585
520
|
*/
|
586
521
|
VALUE
|
587
522
|
ImageList_mosaic(VALUE self)
|
@@ -596,23 +531,18 @@ ImageList_mosaic(VALUE self)
|
|
596
531
|
|
597
532
|
rm_split(images);
|
598
533
|
rm_check_exception(exception, new_image, DestroyOnError);
|
599
|
-
|
600
|
-
|
601
|
-
rm_ensure_result(new_image);
|
534
|
+
DestroyExceptionInfo(exception);
|
602
535
|
|
603
536
|
return rm_image_new(new_image);
|
604
537
|
}
|
605
538
|
|
606
539
|
|
607
540
|
/**
|
608
|
-
*
|
541
|
+
* Optimizes or compares the images in the list.
|
542
|
+
* Equivalent to the -layers option in ImageMagick's mogrify command.
|
609
543
|
*
|
610
|
-
*
|
611
|
-
*
|
612
|
-
*
|
613
|
-
* @param self this object
|
614
|
-
* @param method the method to use
|
615
|
-
* @return a new imagelist
|
544
|
+
* @param method [Magick::LayerMethod] the method to use
|
545
|
+
* @return [Magick::ImageList] a new imagelist
|
616
546
|
*/
|
617
547
|
VALUE
|
618
548
|
ImageList_optimize_layers(VALUE self, VALUE method)
|
@@ -650,7 +580,7 @@ ImageList_optimize_layers(VALUE self, VALUE method)
|
|
650
580
|
break;
|
651
581
|
case CompositeLayer:
|
652
582
|
rm_split(images);
|
653
|
-
|
583
|
+
DestroyExceptionInfo(exception);
|
654
584
|
rb_raise(rb_eNotImpError, "Magick::CompositeLayer is not supported. Use the composite_layers method instead.");
|
655
585
|
break;
|
656
586
|
// In 6.3.4-ish, OptimizeImageLayer replaced OptimizeLayer
|
@@ -671,9 +601,9 @@ ImageList_optimize_layers(VALUE self, VALUE method)
|
|
671
601
|
// mogrify supports -dither here. We don't.
|
672
602
|
GetQuantizeInfo(&quantize_info);
|
673
603
|
#if defined(IMAGEMAGICK_7)
|
674
|
-
|
604
|
+
RemapImages(&quantize_info, new_images, NULL, exception);
|
675
605
|
#else
|
676
|
-
|
606
|
+
RemapImages(&quantize_info, new_images, NULL);
|
677
607
|
#endif
|
678
608
|
break;
|
679
609
|
case OptimizePlusLayer:
|
@@ -702,16 +632,14 @@ ImageList_optimize_layers(VALUE self, VALUE method)
|
|
702
632
|
break;
|
703
633
|
default:
|
704
634
|
rm_split(images);
|
705
|
-
|
635
|
+
DestroyExceptionInfo(exception);
|
706
636
|
rb_raise(rb_eArgError, "undefined layer method");
|
707
637
|
break;
|
708
638
|
}
|
709
639
|
|
710
640
|
rm_split(images);
|
711
641
|
rm_check_exception(exception, new_images, DestroyOnError);
|
712
|
-
|
713
|
-
|
714
|
-
rm_ensure_result(new_images);
|
642
|
+
DestroyExceptionInfo(exception);
|
715
643
|
|
716
644
|
return rm_imagelist_from_images(new_images);
|
717
645
|
}
|
@@ -750,22 +678,20 @@ VALUE
|
|
750
678
|
rm_imagelist_from_images(Image *images)
|
751
679
|
{
|
752
680
|
VALUE new_imagelist;
|
753
|
-
Image *image;
|
754
681
|
|
755
|
-
|
756
|
-
{
|
757
|
-
rb_bug("rm_imagelist_from_images called with NULL argument");
|
758
|
-
}
|
682
|
+
rm_ensure_result(images);
|
759
683
|
|
760
684
|
new_imagelist = ImageList_new();
|
761
685
|
|
762
686
|
while (images)
|
763
687
|
{
|
688
|
+
Image *image;
|
689
|
+
|
764
690
|
image = RemoveFirstImageFromList(&images);
|
765
691
|
imagelist_push(new_imagelist, rm_image_new(image));
|
766
692
|
}
|
767
693
|
|
768
|
-
|
694
|
+
rb_iv_set(new_imagelist, "@scene", INT2FIX(0));
|
769
695
|
|
770
696
|
RB_GC_GUARD(new_imagelist);
|
771
697
|
|
@@ -803,6 +729,9 @@ images_from_imagelist(VALUE imagelist)
|
|
803
729
|
if (head == image || GetPreviousImageInList(image) != NULL)
|
804
730
|
{
|
805
731
|
image = rm_clone_image(image);
|
732
|
+
|
733
|
+
// Wrap raw ImageMagick object by Ruby object to destroy using Ruby's GC.
|
734
|
+
rm_image_new(image);
|
806
735
|
}
|
807
736
|
AppendImageToList(&head, image);
|
808
737
|
}
|
@@ -814,24 +743,6 @@ images_from_imagelist(VALUE imagelist)
|
|
814
743
|
}
|
815
744
|
|
816
745
|
|
817
|
-
/**
|
818
|
-
* \@scene attribute writer.
|
819
|
-
*
|
820
|
-
* No Ruby usage (internal function)
|
821
|
-
*
|
822
|
-
* @param imagelist the imagelist
|
823
|
-
* @param scene the scene
|
824
|
-
* @return the scene
|
825
|
-
*/
|
826
|
-
static VALUE
|
827
|
-
imagelist_scene_eq(VALUE imagelist, VALUE scene)
|
828
|
-
{
|
829
|
-
rb_check_frozen(imagelist);
|
830
|
-
(void) rb_iv_set(imagelist, "@scene", scene);
|
831
|
-
return scene;
|
832
|
-
}
|
833
|
-
|
834
|
-
|
835
746
|
/**
|
836
747
|
* return the # of images in an imagelist.
|
837
748
|
*
|
@@ -890,7 +801,7 @@ static void
|
|
890
801
|
imagelist_push(VALUE imagelist, VALUE image)
|
891
802
|
{
|
892
803
|
rb_check_frozen(imagelist);
|
893
|
-
|
804
|
+
rb_funcall(imagelist, rm_ID_push, 1, image);
|
894
805
|
}
|
895
806
|
|
896
807
|
|
@@ -905,7 +816,7 @@ imagelist_push(VALUE imagelist, VALUE image)
|
|
905
816
|
static Image *
|
906
817
|
clone_imagelist(Image *images)
|
907
818
|
{
|
908
|
-
Image *new_imagelist = NULL, *image
|
819
|
+
Image *new_imagelist = NULL, *image;
|
909
820
|
ExceptionInfo *exception;
|
910
821
|
|
911
822
|
exception = AcquireExceptionInfo();
|
@@ -913,40 +824,31 @@ clone_imagelist(Image *images)
|
|
913
824
|
image = GetFirstImageInList(images);
|
914
825
|
while (image)
|
915
826
|
{
|
827
|
+
Image *clone;
|
828
|
+
|
916
829
|
clone = CloneImage(image, 0, 0, MagickTrue, exception);
|
917
830
|
rm_check_exception(exception, new_imagelist, DestroyOnError);
|
918
831
|
AppendImageToList(&new_imagelist, clone);
|
919
832
|
image = GetNextImageInList(image);
|
920
833
|
}
|
921
834
|
|
922
|
-
|
835
|
+
DestroyExceptionInfo(exception);
|
923
836
|
return new_imagelist;
|
924
837
|
}
|
925
838
|
|
926
839
|
|
927
840
|
/**
|
928
|
-
*
|
929
|
-
*
|
930
|
-
*
|
931
|
-
*
|
932
|
-
*
|
933
|
-
*
|
934
|
-
*
|
935
|
-
*
|
936
|
-
*
|
937
|
-
*
|
938
|
-
*
|
939
|
-
* - Default number_colors is 256
|
940
|
-
* - Default coorspace is Magick::RGBColorsapce
|
941
|
-
* - Default dither is true
|
942
|
-
* - Default tree_depth is 0
|
943
|
-
* - Default measure_error is false
|
944
|
-
* - Sets \@scene to the same value as self.scene
|
945
|
-
*
|
946
|
-
* @param argc number of input arguments
|
947
|
-
* @param argv array of input arguments
|
948
|
-
* @param self this object
|
949
|
-
* @return a new ImageList with quantized images
|
841
|
+
* Analyzes the colors within a set of reference images and chooses a fixed number of colors to represent the set.
|
842
|
+
* The goal of the algorithm is to minimize the difference between the input and output images while minimizing the processing time.
|
843
|
+
*
|
844
|
+
* @overload quantize(number_colors = 256, colorspace = Magick::RGBColorsapce, dither = true, tree_depth = 0, measure_error = false)
|
845
|
+
* @param number_colors [Numeric] the maximum number of colors to use in the output images.
|
846
|
+
* @param colorspace [Magick::ColorspaceType] the colorspace to quantize in.
|
847
|
+
* @param dither [Magick::DitherMethod, Boolean] a DitherMethod value or true if you want apply dither.
|
848
|
+
* @param tree_depth [Numeric] specify the tree depth to use while quantizing.
|
849
|
+
* @param measure_error [Boolean] calculate quantization errors when quantizing the image.
|
850
|
+
* @return [Magick::ImageList] a new ImageList with quantized images
|
851
|
+
* @note Sets +@scene+ to the same value as +self.scene+
|
950
852
|
*/
|
951
853
|
VALUE
|
952
854
|
ImageList_quantize(int argc, VALUE *argv, VALUE self)
|
@@ -971,6 +873,10 @@ ImageList_quantize(int argc, VALUE *argv, VALUE self)
|
|
971
873
|
{
|
972
874
|
VALUE_TO_ENUM(argv[2], quantize_info.dither_method, DitherMethod);
|
973
875
|
}
|
876
|
+
else
|
877
|
+
{
|
878
|
+
quantize_info.dither_method = RTEST(argv[2]) ? UndefinedDitherMethod : NoDitherMethod;
|
879
|
+
}
|
974
880
|
#else
|
975
881
|
if (rb_obj_is_kind_of(argv[2], Class_DitherMethod))
|
976
882
|
{
|
@@ -1004,12 +910,12 @@ ImageList_quantize(int argc, VALUE *argv, VALUE self)
|
|
1004
910
|
rm_ensure_result(new_images);
|
1005
911
|
|
1006
912
|
#if defined(IMAGEMAGICK_7)
|
1007
|
-
|
913
|
+
QuantizeImages(&quantize_info, new_images, exception);
|
1008
914
|
#else
|
1009
|
-
|
915
|
+
QuantizeImages(&quantize_info, new_images);
|
1010
916
|
#endif
|
1011
917
|
rm_check_exception(exception, new_images, DestroyOnError);
|
1012
|
-
|
918
|
+
DestroyExceptionInfo(exception);
|
1013
919
|
|
1014
920
|
// Create new ImageList object, convert mapped image sequence to images,
|
1015
921
|
// append to images array.
|
@@ -1021,7 +927,7 @@ ImageList_quantize(int argc, VALUE *argv, VALUE self)
|
|
1021
927
|
|
1022
928
|
// Set @scene in new ImageList object to same value as in self.
|
1023
929
|
scene = rb_iv_get(self, "@scene");
|
1024
|
-
|
930
|
+
rb_iv_set(new_imagelist, "@scene", scene);
|
1025
931
|
|
1026
932
|
RB_GC_GUARD(new_imagelist);
|
1027
933
|
RB_GC_GUARD(scene);
|
@@ -1031,22 +937,14 @@ ImageList_quantize(int argc, VALUE *argv, VALUE self)
|
|
1031
937
|
|
1032
938
|
|
1033
939
|
/**
|
1034
|
-
*
|
1035
|
-
*
|
1036
|
-
*
|
1037
|
-
*
|
1038
|
-
*
|
1039
|
-
*
|
1040
|
-
*
|
1041
|
-
*
|
1042
|
-
* - Default remap_image is nil
|
1043
|
-
* - Default dither_method is RiemersmaDitherMethod
|
1044
|
-
* - Modifies images in-place.
|
1045
|
-
*
|
1046
|
-
* @param argc number of input arguments
|
1047
|
-
* @param argv array of input arguments
|
1048
|
-
* @param self this object
|
1049
|
-
* @see Image_remap
|
940
|
+
* Reduce the colors used in the image list to the set of colors in +remap_image+.
|
941
|
+
*
|
942
|
+
* @overload remap(remap_image = nil, dither_method = Magick::RiemersmaDitherMethod)
|
943
|
+
* @param remap_image [Magick::Image, Magick::ImageList] Either an imagelist or an image. If an
|
944
|
+
* imagelist, uses the current image.
|
945
|
+
* @param dither_method [Magick::DitherMethod] a DitherMethod value.
|
946
|
+
* @return [Magick::ImageList] self
|
947
|
+
* @note Modifies images in-place.
|
1050
948
|
*/
|
1051
949
|
VALUE
|
1052
950
|
ImageList_remap(int argc, VALUE *argv, VALUE self)
|
@@ -1082,11 +980,12 @@ ImageList_remap(int argc, VALUE *argv, VALUE self)
|
|
1082
980
|
|
1083
981
|
#if defined(IMAGEMAGICK_7)
|
1084
982
|
exception = AcquireExceptionInfo();
|
1085
|
-
|
983
|
+
RemapImages(&quantize_info, images, remap_image, exception);
|
1086
984
|
rm_split(images);
|
1087
|
-
CHECK_EXCEPTION()
|
1088
|
-
|
985
|
+
CHECK_EXCEPTION();
|
986
|
+
DestroyExceptionInfo(exception);
|
1089
987
|
#else
|
988
|
+
RemapImages(&quantize_info, images, remap_image);
|
1090
989
|
rm_split(images);
|
1091
990
|
rm_check_image_exception(images, RetainOnError);
|
1092
991
|
#endif
|
@@ -1098,15 +997,13 @@ ImageList_remap(int argc, VALUE *argv, VALUE self)
|
|
1098
997
|
/**
|
1099
998
|
* Return the imagelist as a blob (a String).
|
1100
999
|
*
|
1101
|
-
*
|
1102
|
-
* - @verbatim ImageList#to_blob @endverbatim
|
1000
|
+
* @overload to_blob
|
1103
1001
|
*
|
1104
|
-
*
|
1105
|
-
*
|
1106
|
-
*
|
1002
|
+
* @overload to_blob
|
1003
|
+
* Runs an info parm block if present - the user can specify the image format and depth
|
1004
|
+
* @yield []
|
1107
1005
|
*
|
1108
|
-
* @
|
1109
|
-
* @return the blob
|
1006
|
+
* @return [String] the blob
|
1110
1007
|
*/
|
1111
1008
|
VALUE
|
1112
1009
|
ImageList_to_blob(VALUE self)
|
@@ -1126,7 +1023,7 @@ ImageList_to_blob(VALUE self)
|
|
1126
1023
|
images = images_from_imagelist(self);
|
1127
1024
|
|
1128
1025
|
exception = AcquireExceptionInfo();
|
1129
|
-
|
1026
|
+
SetImageInfo(info, MagickTrue, exception);
|
1130
1027
|
rm_check_exception(exception, images, RetainOnError);
|
1131
1028
|
|
1132
1029
|
if (*info->magick != '\0')
|
@@ -1134,7 +1031,7 @@ ImageList_to_blob(VALUE self)
|
|
1134
1031
|
Image *img;
|
1135
1032
|
for (img = images; img; img = GetNextImageInList(img))
|
1136
1033
|
{
|
1137
|
-
|
1034
|
+
strlcpy(img->magick, info->magick, sizeof(img->magick));
|
1138
1035
|
}
|
1139
1036
|
}
|
1140
1037
|
|
@@ -1155,8 +1052,8 @@ ImageList_to_blob(VALUE self)
|
|
1155
1052
|
length = 0;
|
1156
1053
|
}
|
1157
1054
|
rm_split(images);
|
1158
|
-
CHECK_EXCEPTION()
|
1159
|
-
|
1055
|
+
CHECK_EXCEPTION();
|
1056
|
+
DestroyExceptionInfo(exception);
|
1160
1057
|
|
1161
1058
|
|
1162
1059
|
if (length == 0 || !blob)
|
@@ -1180,12 +1077,7 @@ ImageList_to_blob(VALUE self)
|
|
1180
1077
|
* the images will be written as a single multi-image file. Otherwise each image
|
1181
1078
|
* will be written to a separate file.
|
1182
1079
|
*
|
1183
|
-
*
|
1184
|
-
* - @verbatim ImageList#write(file) @endverbatim
|
1185
|
-
*
|
1186
|
-
* @param self this object
|
1187
|
-
* @param file the file
|
1188
|
-
* @return self
|
1080
|
+
* @param file [File, String] the file
|
1189
1081
|
*/
|
1190
1082
|
VALUE
|
1191
1083
|
ImageList_write(VALUE self, VALUE file)
|
@@ -1228,18 +1120,18 @@ ImageList_write(VALUE self, VALUE file)
|
|
1228
1120
|
for (scene = 0, img = images; img; img = GetNextImageInList(img))
|
1229
1121
|
{
|
1230
1122
|
img->scene = scene++;
|
1231
|
-
|
1123
|
+
strlcpy(img->filename, info->filename, sizeof(img->filename));
|
1232
1124
|
}
|
1233
1125
|
|
1234
1126
|
// Find out if the format supports multi-images files.
|
1235
1127
|
exception = AcquireExceptionInfo();
|
1236
|
-
|
1128
|
+
SetImageInfo(info, MagickTrue, exception);
|
1237
1129
|
rm_check_exception(exception, images, RetainOnError);
|
1238
1130
|
|
1239
1131
|
m = GetMagickInfo(info->magick, exception);
|
1240
1132
|
rm_check_exception(exception, images, RetainOnError);
|
1241
1133
|
#if defined(IMAGEMAGICK_6)
|
1242
|
-
|
1134
|
+
DestroyExceptionInfo(exception);
|
1243
1135
|
#endif
|
1244
1136
|
|
1245
1137
|
// Tell WriteImage if we want a multi-images file.
|
@@ -1252,10 +1144,10 @@ ImageList_write(VALUE self, VALUE file)
|
|
1252
1144
|
{
|
1253
1145
|
rm_sync_image_options(img, info);
|
1254
1146
|
#if defined(IMAGEMAGICK_7)
|
1255
|
-
|
1147
|
+
WriteImage(info, img, exception);
|
1256
1148
|
rm_check_exception(exception, img, RetainOnError);
|
1257
1149
|
#else
|
1258
|
-
|
1150
|
+
WriteImage(info, img);
|
1259
1151
|
// images will be split before raising an exception
|
1260
1152
|
rm_check_image_exception(images, RetainOnError);
|
1261
1153
|
#endif
|
@@ -1266,7 +1158,7 @@ ImageList_write(VALUE self, VALUE file)
|
|
1266
1158
|
}
|
1267
1159
|
|
1268
1160
|
#if defined(IMAGEMAGICK_7)
|
1269
|
-
|
1161
|
+
DestroyExceptionInfo(exception);
|
1270
1162
|
#endif
|
1271
1163
|
|
1272
1164
|
rm_split(images);
|