rmagick 4.1.0.rc2 → 4.2.1
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/ISSUE_TEMPLATE.md +17 -0
- data/.github/workflows/ci.yml +108 -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 +96 -0
- data/CODE_OF_CONDUCT.md +122 -7
- data/CONTRIBUTING.md +14 -10
- data/README.md +324 -0
- data/Rakefile +16 -22
- data/before_install_linux.sh +22 -32
- data/before_install_osx.sh +57 -2
- data/ext/RMagick/extconf.rb +108 -95
- data/ext/RMagick/rmagick.c +77 -104
- data/ext/RMagick/rmagick.h +77 -70
- data/ext/RMagick/rmdraw.c +289 -446
- data/ext/RMagick/rmenum.c +96 -113
- data/ext/RMagick/rmfill.c +49 -77
- data/ext/RMagick/rmilist.c +144 -244
- data/ext/RMagick/rmimage.c +3407 -4166
- data/ext/RMagick/rminfo.c +540 -738
- data/ext/RMagick/rmkinfo.c +21 -87
- data/ext/RMagick/rmmain.c +419 -246
- 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 +151 -228
- 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 +8 -6
- metadata +46 -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
|
-
*
|
475
|
-
*
|
476
|
-
* Ruby usage:
|
477
|
-
* - @verbatim ImageList#montage <{parm block}> @endverbatim
|
424
|
+
* Tile one or more thumbnails across an image canvas.
|
478
425
|
*
|
479
|
-
*
|
480
|
-
* - Creates Montage object, yields to block if present in Montage object's
|
481
|
-
* scope.
|
426
|
+
* @overload montage
|
482
427
|
*
|
483
|
-
* @
|
484
|
-
*
|
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,15 @@ 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
|
+
if (rb_proc_arity(rb_block_proc()) == 0)
|
450
|
+
{
|
451
|
+
rb_warn("passing a block without an image argument is deprecated");
|
452
|
+
rb_obj_instance_eval(0, NULL, montage_obj);
|
453
|
+
}
|
454
|
+
else
|
455
|
+
{
|
456
|
+
rb_yield(montage_obj);
|
457
|
+
}
|
501
458
|
}
|
502
459
|
|
503
460
|
Data_Get_Struct(montage_obj, Montage, montage);
|
@@ -522,9 +479,7 @@ ImageList_montage(VALUE self)
|
|
522
479
|
new_images = MontageImages(images, montage->info, exception);
|
523
480
|
rm_split(images);
|
524
481
|
rm_check_exception(exception, new_images, DestroyOnError);
|
525
|
-
|
526
|
-
|
527
|
-
rm_ensure_result(new_images);
|
482
|
+
DestroyExceptionInfo(exception);
|
528
483
|
|
529
484
|
RB_GC_GUARD(montage_obj);
|
530
485
|
|
@@ -534,17 +489,11 @@ ImageList_montage(VALUE self)
|
|
534
489
|
|
535
490
|
/**
|
536
491
|
* Requires a minimum of two images. The first image is transformed into the
|
537
|
-
* second by a number of intervening images as specified by "
|
538
|
-
*
|
539
|
-
* Ruby usage:
|
540
|
-
* - @verbatim ImageList#morph(number_images) @endverbatim
|
541
|
-
*
|
542
|
-
* Notes:
|
543
|
-
* - Sets \@scenes to 0
|
492
|
+
* second by a number of intervening images as specified by "nimages".
|
544
493
|
*
|
545
|
-
* @
|
546
|
-
* @param nimages the number of images
|
547
|
-
* @return a new image list with the images array set to the morph sequence.
|
494
|
+
* @note Sets +@scenes+ to 0
|
495
|
+
* @param nimages [Numeric] the number of images
|
496
|
+
* @return [Magick::ImageList] a new image list with the images array set to the morph sequence.
|
548
497
|
*/
|
549
498
|
VALUE
|
550
499
|
ImageList_morph(VALUE self, VALUE nimages)
|
@@ -566,9 +515,7 @@ ImageList_morph(VALUE self, VALUE nimages)
|
|
566
515
|
new_images = MorphImages(images, (unsigned long)number_images, exception);
|
567
516
|
rm_split(images);
|
568
517
|
rm_check_exception(exception, new_images, DestroyOnError);
|
569
|
-
|
570
|
-
|
571
|
-
rm_ensure_result(new_images);
|
518
|
+
DestroyExceptionInfo(exception);
|
572
519
|
|
573
520
|
return rm_imagelist_from_images(new_images);
|
574
521
|
}
|
@@ -577,11 +524,7 @@ ImageList_morph(VALUE self, VALUE nimages)
|
|
577
524
|
/**
|
578
525
|
* Merge all the images into a single image.
|
579
526
|
*
|
580
|
-
*
|
581
|
-
* - @verbatim ImageList#mosaic @endverbatim
|
582
|
-
*
|
583
|
-
* @param self this object
|
584
|
-
* @return the new image
|
527
|
+
* @return [Magick::Image] the new image
|
585
528
|
*/
|
586
529
|
VALUE
|
587
530
|
ImageList_mosaic(VALUE self)
|
@@ -596,23 +539,18 @@ ImageList_mosaic(VALUE self)
|
|
596
539
|
|
597
540
|
rm_split(images);
|
598
541
|
rm_check_exception(exception, new_image, DestroyOnError);
|
599
|
-
|
600
|
-
|
601
|
-
rm_ensure_result(new_image);
|
542
|
+
DestroyExceptionInfo(exception);
|
602
543
|
|
603
544
|
return rm_image_new(new_image);
|
604
545
|
}
|
605
546
|
|
606
547
|
|
607
548
|
/**
|
608
|
-
*
|
549
|
+
* Optimizes or compares the images in the list.
|
550
|
+
* Equivalent to the -layers option in ImageMagick's mogrify command.
|
609
551
|
*
|
610
|
-
*
|
611
|
-
*
|
612
|
-
*
|
613
|
-
* @param self this object
|
614
|
-
* @param method the method to use
|
615
|
-
* @return a new imagelist
|
552
|
+
* @param method [Magick::LayerMethod] the method to use
|
553
|
+
* @return [Magick::ImageList] a new imagelist
|
616
554
|
*/
|
617
555
|
VALUE
|
618
556
|
ImageList_optimize_layers(VALUE self, VALUE method)
|
@@ -650,7 +588,7 @@ ImageList_optimize_layers(VALUE self, VALUE method)
|
|
650
588
|
break;
|
651
589
|
case CompositeLayer:
|
652
590
|
rm_split(images);
|
653
|
-
|
591
|
+
DestroyExceptionInfo(exception);
|
654
592
|
rb_raise(rb_eNotImpError, "Magick::CompositeLayer is not supported. Use the composite_layers method instead.");
|
655
593
|
break;
|
656
594
|
// In 6.3.4-ish, OptimizeImageLayer replaced OptimizeLayer
|
@@ -671,9 +609,9 @@ ImageList_optimize_layers(VALUE self, VALUE method)
|
|
671
609
|
// mogrify supports -dither here. We don't.
|
672
610
|
GetQuantizeInfo(&quantize_info);
|
673
611
|
#if defined(IMAGEMAGICK_7)
|
674
|
-
|
612
|
+
RemapImages(&quantize_info, new_images, NULL, exception);
|
675
613
|
#else
|
676
|
-
|
614
|
+
RemapImages(&quantize_info, new_images, NULL);
|
677
615
|
#endif
|
678
616
|
break;
|
679
617
|
case OptimizePlusLayer:
|
@@ -702,16 +640,14 @@ ImageList_optimize_layers(VALUE self, VALUE method)
|
|
702
640
|
break;
|
703
641
|
default:
|
704
642
|
rm_split(images);
|
705
|
-
|
643
|
+
DestroyExceptionInfo(exception);
|
706
644
|
rb_raise(rb_eArgError, "undefined layer method");
|
707
645
|
break;
|
708
646
|
}
|
709
647
|
|
710
648
|
rm_split(images);
|
711
649
|
rm_check_exception(exception, new_images, DestroyOnError);
|
712
|
-
|
713
|
-
|
714
|
-
rm_ensure_result(new_images);
|
650
|
+
DestroyExceptionInfo(exception);
|
715
651
|
|
716
652
|
return rm_imagelist_from_images(new_images);
|
717
653
|
}
|
@@ -750,22 +686,20 @@ VALUE
|
|
750
686
|
rm_imagelist_from_images(Image *images)
|
751
687
|
{
|
752
688
|
VALUE new_imagelist;
|
753
|
-
Image *image;
|
754
689
|
|
755
|
-
|
756
|
-
{
|
757
|
-
rb_bug("rm_imagelist_from_images called with NULL argument");
|
758
|
-
}
|
690
|
+
rm_ensure_result(images);
|
759
691
|
|
760
692
|
new_imagelist = ImageList_new();
|
761
693
|
|
762
694
|
while (images)
|
763
695
|
{
|
696
|
+
Image *image;
|
697
|
+
|
764
698
|
image = RemoveFirstImageFromList(&images);
|
765
699
|
imagelist_push(new_imagelist, rm_image_new(image));
|
766
700
|
}
|
767
701
|
|
768
|
-
|
702
|
+
rb_iv_set(new_imagelist, "@scene", INT2FIX(0));
|
769
703
|
|
770
704
|
RB_GC_GUARD(new_imagelist);
|
771
705
|
|
@@ -803,6 +737,9 @@ images_from_imagelist(VALUE imagelist)
|
|
803
737
|
if (head == image || GetPreviousImageInList(image) != NULL)
|
804
738
|
{
|
805
739
|
image = rm_clone_image(image);
|
740
|
+
|
741
|
+
// Wrap raw ImageMagick object by Ruby object to destroy using Ruby's GC.
|
742
|
+
rm_image_new(image);
|
806
743
|
}
|
807
744
|
AppendImageToList(&head, image);
|
808
745
|
}
|
@@ -814,24 +751,6 @@ images_from_imagelist(VALUE imagelist)
|
|
814
751
|
}
|
815
752
|
|
816
753
|
|
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
754
|
/**
|
836
755
|
* return the # of images in an imagelist.
|
837
756
|
*
|
@@ -890,7 +809,7 @@ static void
|
|
890
809
|
imagelist_push(VALUE imagelist, VALUE image)
|
891
810
|
{
|
892
811
|
rb_check_frozen(imagelist);
|
893
|
-
|
812
|
+
rb_funcall(imagelist, rm_ID_push, 1, image);
|
894
813
|
}
|
895
814
|
|
896
815
|
|
@@ -905,7 +824,7 @@ imagelist_push(VALUE imagelist, VALUE image)
|
|
905
824
|
static Image *
|
906
825
|
clone_imagelist(Image *images)
|
907
826
|
{
|
908
|
-
Image *new_imagelist = NULL, *image
|
827
|
+
Image *new_imagelist = NULL, *image;
|
909
828
|
ExceptionInfo *exception;
|
910
829
|
|
911
830
|
exception = AcquireExceptionInfo();
|
@@ -913,40 +832,31 @@ clone_imagelist(Image *images)
|
|
913
832
|
image = GetFirstImageInList(images);
|
914
833
|
while (image)
|
915
834
|
{
|
835
|
+
Image *clone;
|
836
|
+
|
916
837
|
clone = CloneImage(image, 0, 0, MagickTrue, exception);
|
917
838
|
rm_check_exception(exception, new_imagelist, DestroyOnError);
|
918
839
|
AppendImageToList(&new_imagelist, clone);
|
919
840
|
image = GetNextImageInList(image);
|
920
841
|
}
|
921
842
|
|
922
|
-
|
843
|
+
DestroyExceptionInfo(exception);
|
923
844
|
return new_imagelist;
|
924
845
|
}
|
925
846
|
|
926
847
|
|
927
848
|
/**
|
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
|
849
|
+
* Analyzes the colors within a set of reference images and chooses a fixed number of colors to represent the set.
|
850
|
+
* The goal of the algorithm is to minimize the difference between the input and output images while minimizing the processing time.
|
851
|
+
*
|
852
|
+
* @overload quantize(number_colors = 256, colorspace = Magick::RGBColorsapce, dither = true, tree_depth = 0, measure_error = false)
|
853
|
+
* @param number_colors [Numeric] the maximum number of colors to use in the output images.
|
854
|
+
* @param colorspace [Magick::ColorspaceType] the colorspace to quantize in.
|
855
|
+
* @param dither [Magick::DitherMethod, Boolean] a DitherMethod value or true if you want apply dither.
|
856
|
+
* @param tree_depth [Numeric] specify the tree depth to use while quantizing.
|
857
|
+
* @param measure_error [Boolean] calculate quantization errors when quantizing the image.
|
858
|
+
* @return [Magick::ImageList] a new ImageList with quantized images
|
859
|
+
* @note Sets +@scene+ to the same value as +self.scene+
|
950
860
|
*/
|
951
861
|
VALUE
|
952
862
|
ImageList_quantize(int argc, VALUE *argv, VALUE self)
|
@@ -971,6 +881,10 @@ ImageList_quantize(int argc, VALUE *argv, VALUE self)
|
|
971
881
|
{
|
972
882
|
VALUE_TO_ENUM(argv[2], quantize_info.dither_method, DitherMethod);
|
973
883
|
}
|
884
|
+
else
|
885
|
+
{
|
886
|
+
quantize_info.dither_method = RTEST(argv[2]) ? UndefinedDitherMethod : NoDitherMethod;
|
887
|
+
}
|
974
888
|
#else
|
975
889
|
if (rb_obj_is_kind_of(argv[2], Class_DitherMethod))
|
976
890
|
{
|
@@ -1004,12 +918,12 @@ ImageList_quantize(int argc, VALUE *argv, VALUE self)
|
|
1004
918
|
rm_ensure_result(new_images);
|
1005
919
|
|
1006
920
|
#if defined(IMAGEMAGICK_7)
|
1007
|
-
|
921
|
+
QuantizeImages(&quantize_info, new_images, exception);
|
1008
922
|
#else
|
1009
|
-
|
923
|
+
QuantizeImages(&quantize_info, new_images);
|
1010
924
|
#endif
|
1011
925
|
rm_check_exception(exception, new_images, DestroyOnError);
|
1012
|
-
|
926
|
+
DestroyExceptionInfo(exception);
|
1013
927
|
|
1014
928
|
// Create new ImageList object, convert mapped image sequence to images,
|
1015
929
|
// append to images array.
|
@@ -1021,7 +935,7 @@ ImageList_quantize(int argc, VALUE *argv, VALUE self)
|
|
1021
935
|
|
1022
936
|
// Set @scene in new ImageList object to same value as in self.
|
1023
937
|
scene = rb_iv_get(self, "@scene");
|
1024
|
-
|
938
|
+
rb_iv_set(new_imagelist, "@scene", scene);
|
1025
939
|
|
1026
940
|
RB_GC_GUARD(new_imagelist);
|
1027
941
|
RB_GC_GUARD(scene);
|
@@ -1031,22 +945,14 @@ ImageList_quantize(int argc, VALUE *argv, VALUE self)
|
|
1031
945
|
|
1032
946
|
|
1033
947
|
/**
|
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
|
948
|
+
* Reduce the colors used in the image list to the set of colors in +remap_image+.
|
949
|
+
*
|
950
|
+
* @overload remap(remap_image = nil, dither_method = Magick::RiemersmaDitherMethod)
|
951
|
+
* @param remap_image [Magick::Image, Magick::ImageList] Either an imagelist or an image. If an
|
952
|
+
* imagelist, uses the current image.
|
953
|
+
* @param dither_method [Magick::DitherMethod] a DitherMethod value.
|
954
|
+
* @return [Magick::ImageList] self
|
955
|
+
* @note Modifies images in-place.
|
1050
956
|
*/
|
1051
957
|
VALUE
|
1052
958
|
ImageList_remap(int argc, VALUE *argv, VALUE self)
|
@@ -1082,11 +988,12 @@ ImageList_remap(int argc, VALUE *argv, VALUE self)
|
|
1082
988
|
|
1083
989
|
#if defined(IMAGEMAGICK_7)
|
1084
990
|
exception = AcquireExceptionInfo();
|
1085
|
-
|
991
|
+
RemapImages(&quantize_info, images, remap_image, exception);
|
1086
992
|
rm_split(images);
|
1087
|
-
CHECK_EXCEPTION()
|
1088
|
-
|
993
|
+
CHECK_EXCEPTION();
|
994
|
+
DestroyExceptionInfo(exception);
|
1089
995
|
#else
|
996
|
+
RemapImages(&quantize_info, images, remap_image);
|
1090
997
|
rm_split(images);
|
1091
998
|
rm_check_image_exception(images, RetainOnError);
|
1092
999
|
#endif
|
@@ -1098,15 +1005,13 @@ ImageList_remap(int argc, VALUE *argv, VALUE self)
|
|
1098
1005
|
/**
|
1099
1006
|
* Return the imagelist as a blob (a String).
|
1100
1007
|
*
|
1101
|
-
*
|
1102
|
-
* - @verbatim ImageList#to_blob @endverbatim
|
1008
|
+
* @overload to_blob
|
1103
1009
|
*
|
1104
|
-
*
|
1105
|
-
*
|
1106
|
-
*
|
1010
|
+
* @overload to_blob
|
1011
|
+
* Runs an info parm block if present - the user can specify the image format and depth
|
1012
|
+
* @yield []
|
1107
1013
|
*
|
1108
|
-
* @
|
1109
|
-
* @return the blob
|
1014
|
+
* @return [String] the blob
|
1110
1015
|
*/
|
1111
1016
|
VALUE
|
1112
1017
|
ImageList_to_blob(VALUE self)
|
@@ -1126,7 +1031,7 @@ ImageList_to_blob(VALUE self)
|
|
1126
1031
|
images = images_from_imagelist(self);
|
1127
1032
|
|
1128
1033
|
exception = AcquireExceptionInfo();
|
1129
|
-
|
1034
|
+
SetImageInfo(info, MagickTrue, exception);
|
1130
1035
|
rm_check_exception(exception, images, RetainOnError);
|
1131
1036
|
|
1132
1037
|
if (*info->magick != '\0')
|
@@ -1134,7 +1039,7 @@ ImageList_to_blob(VALUE self)
|
|
1134
1039
|
Image *img;
|
1135
1040
|
for (img = images; img; img = GetNextImageInList(img))
|
1136
1041
|
{
|
1137
|
-
|
1042
|
+
strlcpy(img->magick, info->magick, sizeof(img->magick));
|
1138
1043
|
}
|
1139
1044
|
}
|
1140
1045
|
|
@@ -1155,8 +1060,8 @@ ImageList_to_blob(VALUE self)
|
|
1155
1060
|
length = 0;
|
1156
1061
|
}
|
1157
1062
|
rm_split(images);
|
1158
|
-
CHECK_EXCEPTION()
|
1159
|
-
|
1063
|
+
CHECK_EXCEPTION();
|
1064
|
+
DestroyExceptionInfo(exception);
|
1160
1065
|
|
1161
1066
|
|
1162
1067
|
if (length == 0 || !blob)
|
@@ -1180,12 +1085,7 @@ ImageList_to_blob(VALUE self)
|
|
1180
1085
|
* the images will be written as a single multi-image file. Otherwise each image
|
1181
1086
|
* will be written to a separate file.
|
1182
1087
|
*
|
1183
|
-
*
|
1184
|
-
* - @verbatim ImageList#write(file) @endverbatim
|
1185
|
-
*
|
1186
|
-
* @param self this object
|
1187
|
-
* @param file the file
|
1188
|
-
* @return self
|
1088
|
+
* @param file [File, String] the file
|
1189
1089
|
*/
|
1190
1090
|
VALUE
|
1191
1091
|
ImageList_write(VALUE self, VALUE file)
|
@@ -1228,18 +1128,18 @@ ImageList_write(VALUE self, VALUE file)
|
|
1228
1128
|
for (scene = 0, img = images; img; img = GetNextImageInList(img))
|
1229
1129
|
{
|
1230
1130
|
img->scene = scene++;
|
1231
|
-
|
1131
|
+
strlcpy(img->filename, info->filename, sizeof(img->filename));
|
1232
1132
|
}
|
1233
1133
|
|
1234
1134
|
// Find out if the format supports multi-images files.
|
1235
1135
|
exception = AcquireExceptionInfo();
|
1236
|
-
|
1136
|
+
SetImageInfo(info, MagickTrue, exception);
|
1237
1137
|
rm_check_exception(exception, images, RetainOnError);
|
1238
1138
|
|
1239
1139
|
m = GetMagickInfo(info->magick, exception);
|
1240
1140
|
rm_check_exception(exception, images, RetainOnError);
|
1241
1141
|
#if defined(IMAGEMAGICK_6)
|
1242
|
-
|
1142
|
+
DestroyExceptionInfo(exception);
|
1243
1143
|
#endif
|
1244
1144
|
|
1245
1145
|
// Tell WriteImage if we want a multi-images file.
|
@@ -1252,10 +1152,10 @@ ImageList_write(VALUE self, VALUE file)
|
|
1252
1152
|
{
|
1253
1153
|
rm_sync_image_options(img, info);
|
1254
1154
|
#if defined(IMAGEMAGICK_7)
|
1255
|
-
|
1155
|
+
WriteImage(info, img, exception);
|
1256
1156
|
rm_check_exception(exception, img, RetainOnError);
|
1257
1157
|
#else
|
1258
|
-
|
1158
|
+
WriteImage(info, img);
|
1259
1159
|
// images will be split before raising an exception
|
1260
1160
|
rm_check_image_exception(images, RetainOnError);
|
1261
1161
|
#endif
|
@@ -1266,7 +1166,7 @@ ImageList_write(VALUE self, VALUE file)
|
|
1266
1166
|
}
|
1267
1167
|
|
1268
1168
|
#if defined(IMAGEMAGICK_7)
|
1269
|
-
|
1169
|
+
DestroyExceptionInfo(exception);
|
1270
1170
|
#endif
|
1271
1171
|
|
1272
1172
|
rm_split(images);
|