rmagick4j 0.3.4-java → 0.3.9-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/History.txt +84 -0
- data/LICENSE.txt +31 -0
- data/README.txt +25 -0
- data/Rakefile +65 -0
- data/lib/magick4j.jar +0 -0
- data/lib/{RMagick.rb → rmagick.rb} +574 -405
- data/lib/rmagick4j/constants.rb +34 -0
- data/lib/rmagick4j/draw.rb +124 -0
- data/lib/rmagick4j/enum.rb +120 -0
- data/lib/rmagick4j/gradient_fill.rb +14 -0
- data/lib/rmagick4j/image.rb +351 -0
- data/lib/rmagick4j/image_list.rb +25 -0
- data/lib/rmagick4j/pixel.rb +170 -0
- data/lib/rmagick4j/rmagick4j.rb +15 -430
- data/lib/rmagick4j/texture_fill.rb +14 -0
- data/lib/rmagick4j/type_metric.rb +8 -0
- data/lib/rmagick4j/version.rb +5 -0
- data/lib/rvg/clippath.rb +2 -2
- data/lib/rvg/container.rb +2 -2
- data/lib/rvg/describable.rb +2 -2
- data/lib/rvg/embellishable.rb +2 -2
- data/lib/rvg/misc.rb +3 -3
- data/lib/rvg/paint.rb +7 -2
- data/lib/rvg/pathdata.rb +2 -2
- data/lib/rvg/rvg.rb +3 -3
- data/lib/rvg/stretchable.rb +15 -3
- data/lib/rvg/stylable.rb +2 -2
- data/lib/rvg/text.rb +2 -2
- data/lib/rvg/transformable.rb +2 -2
- data/lib/rvg/units.rb +2 -2
- data/test/RMagickTestSuite.rb +129 -0
- data/test/eyetests/bullseye.rb +151 -0
- data/test/eyetests/doc.rb +79 -0
- data/test/eyetests/tests/draw_arc_basic.rb +16 -0
- data/test/eyetests/tests/draw_circle_affine.rb +19 -0
- data/test/eyetests/tests/draw_circle_basic.rb +16 -0
- data/test/eyetests/tests/draw_clip_path.rb +44 -0
- data/test/eyetests/tests/draw_ellipse_affine.rb +19 -0
- data/test/eyetests/tests/draw_ellipse_basic.rb +16 -0
- data/test/eyetests/tests/draw_line_affine.rb +24 -0
- data/test/eyetests/tests/draw_line_basic.rb +21 -0
- data/test/eyetests/tests/draw_multiline_type_metrics.rb +42 -0
- data/test/eyetests/tests/draw_pattern_1.rb +35 -0
- data/test/eyetests/tests/draw_polygon_affine.rb +22 -0
- data/test/eyetests/tests/draw_polygon_basic.rb +19 -0
- data/test/eyetests/tests/draw_polyline_affine.rb +19 -0
- data/test/eyetests/tests/draw_polyline_basic.rb +18 -0
- data/test/eyetests/tests/draw_pop_push.rb +16 -0
- data/test/eyetests/tests/draw_pop_push_translate.rb +22 -0
- data/test/eyetests/tests/draw_rectangle_affine.rb +16 -0
- data/test/eyetests/tests/draw_rectangle_basic.rb +16 -0
- data/test/eyetests/tests/draw_rectangle_narrow.rb +18 -0
- data/test/eyetests/tests/draw_rmagick_test_01.rb +35 -0
- data/test/eyetests/tests/draw_rmagick_test_02.rb +40 -0
- data/test/eyetests/tests/draw_rmagick_test_03.rb +17 -0
- data/test/eyetests/tests/draw_rmagick_test_04.rb +21 -0
- data/test/eyetests/tests/draw_rotate_01.rb +33 -0
- data/test/eyetests/tests/draw_roundrectangle_affine.rb +19 -0
- data/test/eyetests/tests/draw_roundrectangle_basic.rb +16 -0
- data/test/eyetests/tests/draw_scale_01.rb +33 -0
- data/test/eyetests/tests/draw_skewx_01.rb +34 -0
- data/test/eyetests/tests/draw_skewy_01.rb +33 -0
- data/test/eyetests/tests/draw_stroke_miterlimit.rb +21 -0
- data/test/eyetests/tests/effect_blur.rb +9 -0
- data/test/eyetests/tests/effect_charcoal.rb +9 -0
- data/test/eyetests/tests/effect_edge.rb +9 -0
- data/test/eyetests/tests/effect_implode.rb +9 -0
- data/test/eyetests/tests/effect_negate.rb +9 -0
- data/test/eyetests/tests/effect_negate_true.rb +9 -0
- data/test/eyetests/tests/effect_normalize.rb +9 -0
- data/test/eyetests/tests/effect_shade.rb +9 -0
- data/test/eyetests/tests/effect_solarize.rb +10 -0
- data/test/eyetests/tests/effect_wave.rb +9 -0
- data/test/eyetests/tests/gradient_fill_horizontal_diagonal_fill.rb +9 -0
- data/test/eyetests/tests/gradient_fill_horizontal_fill.rb +9 -0
- data/test/eyetests/tests/gradient_fill_point_fill.rb +9 -0
- data/test/eyetests/tests/gradient_fill_vertical_diagonal_fill.rb +9 -0
- data/test/eyetests/tests/gradient_fill_vertical_fill.rb +9 -0
- data/test/eyetests/tests/gruff_accumulator_bar.rb +29 -0
- data/test/eyetests/tests/gruff_area_1.rb +16 -0
- data/test/eyetests/tests/gruff_area_2.rb +27 -0
- data/test/eyetests/tests/gruff_bar_1.rb +29 -0
- data/test/eyetests/tests/gruff_bar_2.rb +19 -0
- data/test/eyetests/tests/gruff_dot_1.rb +19 -0
- data/test/eyetests/tests/gruff_line_1.rb +13 -0
- data/test/eyetests/tests/gruff_line_2.rb +20 -0
- data/test/eyetests/tests/gruff_net_1.rb +16 -0
- data/test/eyetests/tests/gruff_net_2.rb +16 -0
- data/test/eyetests/tests/gruff_pie_1.rb +21 -0
- data/test/eyetests/tests/gruff_pie_2.rb +22 -0
- data/test/eyetests/tests/gruff_scene_1.rb +14 -0
- data/test/eyetests/tests/gruff_scene_2.rb +14 -0
- data/test/eyetests/tests/gruff_sidebar.rb +32 -0
- data/test/eyetests/tests/gruff_sidestacked_bar_1.rb +26 -0
- data/test/eyetests/tests/gruff_sidestacked_bar_2.rb +26 -0
- data/test/eyetests/tests/gruff_spider_1.rb +22 -0
- data/test/eyetests/tests/gruff_spider_2.rb +15 -0
- data/test/eyetests/tests/gruff_stacked_area_1.rb +23 -0
- data/test/eyetests/tests/gruff_stacked_bar_1.rb +23 -0
- data/test/eyetests/tests/gruff_stacked_bar_2.rb +26 -0
- data/test/eyetests/tests/hatch_fill.rb +9 -0
- data/test/eyetests/tests/image_list_flatten_images.rb +15 -0
- data/test/eyetests/tests/new_image.rb +31 -0
- data/test/eyetests/tests/path_a_command_01.rb +16 -0
- data/test/eyetests/tests/path_a_command_02.rb +19 -0
- data/test/eyetests/tests/path_c_command_01.rb +16 -0
- data/test/eyetests/tests/path_c_command_02.rb +16 -0
- data/test/eyetests/tests/path_complex_01.rb +16 -0
- data/test/eyetests/tests/path_espiral_01.rb +29 -0
- data/test/eyetests/tests/path_h_command_01.rb +16 -0
- data/test/eyetests/tests/path_h_command_02.rb +16 -0
- data/test/eyetests/tests/path_l_command_01.rb +16 -0
- data/test/eyetests/tests/path_l_command_02.rb +16 -0
- data/test/eyetests/tests/path_m_command_01.rb +16 -0
- data/test/eyetests/tests/path_m_command_02.rb +16 -0
- data/test/eyetests/tests/path_m_command_03.rb +16 -0
- data/test/eyetests/tests/path_q_command_01.rb +16 -0
- data/test/eyetests/tests/path_q_command_02.rb +16 -0
- data/test/eyetests/tests/path_q_command_03.rb +25 -0
- data/test/eyetests/tests/path_s_command_01.rb +16 -0
- data/test/eyetests/tests/path_s_command_02.rb +16 -0
- data/test/eyetests/tests/path_star_01.rb +19 -0
- data/test/eyetests/tests/path_t_command_01.rb +16 -0
- data/test/eyetests/tests/path_t_command_02.rb +16 -0
- data/test/eyetests/tests/path_v_command_01.rb +16 -0
- data/test/eyetests/tests/path_v_command_02.rb +16 -0
- data/test/eyetests/tests/store_pixel_smiley.rb +123 -0
- data/test/eyetests/tests/texture_fill.rb +11 -0
- data/test/gruff_tests/test/gruff_test_case.rb +123 -0
- data/test/gruff_tests/test/monkey_gruff.rb +7 -0
- data/test/gruff_tests/test/test_accumulator_bar.rb +50 -0
- data/test/gruff_tests/test/test_area.rb +134 -0
- data/test/gruff_tests/test/test_bar.rb +295 -0
- data/test/gruff_tests/test/test_base.rb +8 -0
- data/test/gruff_tests/test/test_bullet.rb +26 -0
- data/test/gruff_tests/test/test_dot.rb +273 -0
- data/test/gruff_tests/test/test_legend.rb +68 -0
- data/test/gruff_tests/test/test_line.rb +554 -0
- data/test/gruff_tests/test/test_mini_bar.rb +33 -0
- data/test/gruff_tests/test/test_mini_pie.rb +20 -0
- data/test/gruff_tests/test/test_mini_side_bar.rb +37 -0
- data/test/gruff_tests/test/test_net.rb +230 -0
- data/test/gruff_tests/test/test_photo.rb +41 -0
- data/test/gruff_tests/test/test_pie.rb +154 -0
- data/test/gruff_tests/test/test_scene.rb +100 -0
- data/test/gruff_tests/test/test_side_bar.rb +12 -0
- data/test/gruff_tests/test/test_sidestacked_bar.rb +89 -0
- data/test/gruff_tests/test/test_spider.rb +216 -0
- data/test/gruff_tests/test/test_stacked_area.rb +52 -0
- data/test/gruff_tests/test/test_stacked_bar.rb +52 -0
- data/test/images/clown.jpg +0 -0
- data/test/images/texture.jpg +0 -0
- data/test/implemented_methods.rb +18 -0
- data/test/spec/draw_spec.rb +43 -0
- data/test/spec/features/step_definitions/geometry_steps.rb +22 -0
- data/test/spec/features/step_definitions/image_filling_steps.rb +49 -0
- data/test/spec/features/support/env.rb +3 -0
- data/test/spec/image_constants.rb +76 -0
- data/test/spec/image_spec.rb +83 -0
- data/test/spec/pixel_spec.rb +89 -0
- metadata +333 -45
- data/lib/RMagick.jar +0 -0
- data/lib/jhlabs-filters.jar +0 -0
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'gruff'
|
3
|
+
require File.join(File.dirname(__FILE__), 'new_image.rb')
|
4
|
+
|
5
|
+
|
6
|
+
@datasets = [
|
7
|
+
[:Jimmy, [25, 36, 86, 39]],
|
8
|
+
[:Charles, [80, 54, 67, 54]],
|
9
|
+
[:Julie, [22, 29, 35, 38]],
|
10
|
+
#[:Jane, [95, 95, 95, 90, 85, 80, 88, 100]],
|
11
|
+
#[:Philip, [90, 34, 23, 12, 78, 89, 98, 88]],
|
12
|
+
#["Arthur", [5, 10, 13, 11, 6, 16, 22, 32]],
|
13
|
+
]
|
14
|
+
|
15
|
+
g = Gruff::SideStackedBar.new
|
16
|
+
g.title = "Stacked Bar Long Label"
|
17
|
+
g.labels = {
|
18
|
+
0 => 'September',
|
19
|
+
1 => 'Oct',
|
20
|
+
2 => 'Nov',
|
21
|
+
3 => 'Dec',
|
22
|
+
}
|
23
|
+
@datasets.each do |data|
|
24
|
+
g.data(data[0], data[1])
|
25
|
+
end
|
26
|
+
g.write 'gruff_sidestacked_bar_2.jpg'
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'gruff'
|
3
|
+
require File.join(File.dirname(__FILE__), 'new_image.rb')
|
4
|
+
|
5
|
+
|
6
|
+
@datasets = [
|
7
|
+
[:Strength, [10]],
|
8
|
+
[:Dexterity, [16]],
|
9
|
+
[:Constitution, [12]],
|
10
|
+
[:Intelligence, [12]],
|
11
|
+
[:Wisdom, [10]],
|
12
|
+
["Charisma", [16]],
|
13
|
+
]
|
14
|
+
|
15
|
+
g = Gruff::Spider.new(20)
|
16
|
+
g.title = "Spider Graph Test"
|
17
|
+
@datasets.each do |data|
|
18
|
+
g.data(data[0], data[1])
|
19
|
+
end
|
20
|
+
|
21
|
+
# Default theme
|
22
|
+
g.write("gruff_spider_1.jpg")
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'gruff'
|
3
|
+
require File.join(File.dirname(__FILE__), 'new_image.rb')
|
4
|
+
|
5
|
+
|
6
|
+
g = Gruff::Spider.new(2)
|
7
|
+
g.title = "Pie Graph Two One Zero"
|
8
|
+
|
9
|
+
g.data(:Bert, [0])
|
10
|
+
g.data(:Adam, [1])
|
11
|
+
g.data(:Sam, [2])
|
12
|
+
|
13
|
+
g.theme_37signals
|
14
|
+
|
15
|
+
g.write("gruff_spider_2.jpg")
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'gruff'
|
3
|
+
require File.join(File.dirname(__FILE__), 'new_image.rb')
|
4
|
+
|
5
|
+
@datasets = [
|
6
|
+
[:Jimmy, [25, 36, 86, 39]],
|
7
|
+
[:Charles, [80, 54, 67, 54]],
|
8
|
+
[:Julie, [22, 29, 35, 38]],
|
9
|
+
]
|
10
|
+
|
11
|
+
g = Gruff::StackedArea.new
|
12
|
+
|
13
|
+
g.labels = {
|
14
|
+
0 => '5/6',
|
15
|
+
1 => '5/15',
|
16
|
+
2 => '5/24',
|
17
|
+
3 => '5/30'
|
18
|
+
}
|
19
|
+
|
20
|
+
@datasets.each do |data|
|
21
|
+
g.data(data[0], data[1])
|
22
|
+
end
|
23
|
+
g.write "gruff_stacked_area_1.jpg"
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'gruff'
|
3
|
+
require File.join(File.dirname(__FILE__), 'new_image.rb')
|
4
|
+
|
5
|
+
|
6
|
+
@datasets = [
|
7
|
+
[:Jimmy, [25, 36, 86, 39]],
|
8
|
+
[:Charles, [80, 54, 67, 54]],
|
9
|
+
[:Julie, [22, 29, 35, 38]],
|
10
|
+
]
|
11
|
+
|
12
|
+
g = Gruff::StackedBar.new
|
13
|
+
g.title = "Visual Stacked Bar Graph Test"
|
14
|
+
g.labels = {
|
15
|
+
0 => '5/6',
|
16
|
+
1 => '5/15',
|
17
|
+
2 => '5/24',
|
18
|
+
3 => '5/30',
|
19
|
+
}
|
20
|
+
@datasets.each do |data|
|
21
|
+
g.data(data[0], data[1])
|
22
|
+
end
|
23
|
+
g.write 'gruff_stacked_bar_1.jpg'
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'gruff'
|
3
|
+
require File.join(File.dirname(__FILE__), 'new_image.rb')
|
4
|
+
|
5
|
+
|
6
|
+
@datasets = [
|
7
|
+
[:Jimmy, [25, 36, 86, 39]],
|
8
|
+
[:Charles, [80, 54, 67, 54]],
|
9
|
+
[:Julie, [22, 29, 35, 38]],
|
10
|
+
]
|
11
|
+
|
12
|
+
g = Gruff::StackedBar.new(400)
|
13
|
+
g.title = "Visual Stacked Bar Graph Test"
|
14
|
+
g.labels = {
|
15
|
+
0 => '5/6',
|
16
|
+
1 => '5/15',
|
17
|
+
2 => '5/24',
|
18
|
+
3 => '5/30',
|
19
|
+
}
|
20
|
+
@datasets.each do |data|
|
21
|
+
g.data(data[0], data[1])
|
22
|
+
end
|
23
|
+
|
24
|
+
g.theme_rails_keynote
|
25
|
+
|
26
|
+
g.write 'gruff_stacked_bar_2.jpg'
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), 'new_image.rb')
|
2
|
+
|
3
|
+
include Magick
|
4
|
+
|
5
|
+
a = Image.new 200, 200, HatchFill.new('transparent', 'orange')
|
6
|
+
b = Image.new 100, 100, HatchFill.new('transparent', 'green', 7)
|
7
|
+
c = Image.new 300, 300, GradientFill.new(150, 150, 150, 150, 'orange', 'black')
|
8
|
+
|
9
|
+
list = ImageList.new
|
10
|
+
|
11
|
+
list << c
|
12
|
+
list << b
|
13
|
+
list << a
|
14
|
+
|
15
|
+
list.flatten_images.write('image_list_flatten_images.jpg')
|
@@ -0,0 +1,31 @@
|
|
1
|
+
if PLATFORM == 'java'
|
2
|
+
require File.join(File.dirname(__FILE__), '..', '..', '..','lib','RMagick')
|
3
|
+
else
|
4
|
+
require "rubygems"
|
5
|
+
require "RMagick"
|
6
|
+
end
|
7
|
+
|
8
|
+
class Float
|
9
|
+
|
10
|
+
def to_threshold
|
11
|
+
self/255 * Magick::QuantumRange
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
class Magick::Image
|
16
|
+
alias_method :old_write, :write
|
17
|
+
|
18
|
+
def self.load(filename, &add)
|
19
|
+
file = File.join(File.expand_path(File.dirname(__FILE__)), '..', '..', 'images', filename)
|
20
|
+
self.read file, &add
|
21
|
+
end
|
22
|
+
|
23
|
+
def write(filename)
|
24
|
+
engine = (PLATFORM == 'java' ? 'jruby' : 'mri')
|
25
|
+
new_filename = filename.sub(/(\.[^\.]*)$/, '.' + engine + '\1')
|
26
|
+
change_geometry('300x300') do |columns, rows, image|
|
27
|
+
image.resize!(columns, rows)
|
28
|
+
end
|
29
|
+
old_write File.join(ARGV[0],new_filename)
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), 'new_image.rb')
|
2
|
+
|
3
|
+
include Magick
|
4
|
+
|
5
|
+
draw = Draw.new
|
6
|
+
|
7
|
+
draw.fill 'red'
|
8
|
+
draw.stroke 'blue'
|
9
|
+
draw.stroke_width(5)
|
10
|
+
draw.path 'M150,150 h-140 a140,100 45 1,0 140,-140'
|
11
|
+
|
12
|
+
b = Image.new(300, 300, HatchFill.new('white', 'black'))
|
13
|
+
|
14
|
+
draw.draw(b)
|
15
|
+
|
16
|
+
b.write('path_a_command_01.jpg')
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), 'new_image.rb')
|
2
|
+
|
3
|
+
include Magick
|
4
|
+
|
5
|
+
draw = Draw.new
|
6
|
+
|
7
|
+
draw.fill 'red'
|
8
|
+
draw.stroke 'blue'
|
9
|
+
draw.stroke_width(5)
|
10
|
+
draw.path 'M0,250 l 50,-25
|
11
|
+
a25,50 -30 0,1 50,-25 l 50,-25
|
12
|
+
a25,75 -30 0,1 50,-25 l 50,-25
|
13
|
+
a25,100 -30 0,1 50,-25 l 50,-25'
|
14
|
+
|
15
|
+
b = Image.new(300, 300, HatchFill.new('white', 'black'))
|
16
|
+
|
17
|
+
draw.draw(b)
|
18
|
+
|
19
|
+
b.write('path_a_command_02.jpg')
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), 'new_image.rb')
|
2
|
+
|
3
|
+
include Magick
|
4
|
+
|
5
|
+
draw = Draw.new
|
6
|
+
|
7
|
+
draw.fill 'red'
|
8
|
+
draw.stroke 'blue'
|
9
|
+
draw.stroke_width(5)
|
10
|
+
draw.path 'M100,200 C100,100 250,100 250,200'
|
11
|
+
|
12
|
+
b = Image.new(300, 300, HatchFill.new('white', 'black'))
|
13
|
+
|
14
|
+
draw.draw(b)
|
15
|
+
|
16
|
+
b.write('path_c_command_01.jpg')
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), 'new_image.rb')
|
2
|
+
|
3
|
+
include Magick
|
4
|
+
|
5
|
+
draw = Draw.new
|
6
|
+
|
7
|
+
draw.fill 'red'
|
8
|
+
draw.stroke 'blue'
|
9
|
+
draw.stroke_width(5)
|
10
|
+
draw.path 'M50,150 c0,-150 200,150 200,0'
|
11
|
+
|
12
|
+
b = Image.new(300, 300, HatchFill.new('white', 'black'))
|
13
|
+
|
14
|
+
draw.draw(b)
|
15
|
+
|
16
|
+
b.write('path_c_command_02.jpg')
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), 'new_image.rb')
|
2
|
+
|
3
|
+
include Magick
|
4
|
+
|
5
|
+
draw = Draw.new
|
6
|
+
|
7
|
+
draw.fill 'GREENYELLOW'
|
8
|
+
draw.stroke 'DarkBlue'
|
9
|
+
draw.stroke_width(5)
|
10
|
+
draw.path 'M150 150 200 200v25C225 225 250 250 200 250S150 275 200 275H100Z'
|
11
|
+
|
12
|
+
b = Image.new(300, 300, HatchFill.new('white', 'black'))
|
13
|
+
|
14
|
+
draw.draw(b)
|
15
|
+
|
16
|
+
b.write('path_complex_01.jpg')
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), 'new_image.rb')
|
2
|
+
|
3
|
+
include Magick
|
4
|
+
|
5
|
+
draw = Draw.new
|
6
|
+
|
7
|
+
draw.fill 'red'
|
8
|
+
draw.fill_rule 'nonzero'
|
9
|
+
draw.stroke 'blue'
|
10
|
+
draw.stroke_width(5)
|
11
|
+
draw.path 'M153 334
|
12
|
+
C153 334 151 334 151 334
|
13
|
+
C151 339 153 344 156 344
|
14
|
+
C164 344 171 339 171 334
|
15
|
+
C171 322 164 314 156 314
|
16
|
+
C142 314 131 322 131 334
|
17
|
+
C131 350 142 364 156 364
|
18
|
+
C175 364 191 350 191 334
|
19
|
+
C191 311 175 294 156 294
|
20
|
+
C131 294 111 311 111 334
|
21
|
+
C111 361 131 384 156 384
|
22
|
+
C186 384 211 361 211 334
|
23
|
+
C211 300 186 274 156 274'
|
24
|
+
|
25
|
+
b = Image.new(500, 500, HatchFill.new('white', 'black'))
|
26
|
+
|
27
|
+
draw.draw(b)
|
28
|
+
|
29
|
+
b.write('path_espiral_01.jpg')
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), 'new_image.rb')
|
2
|
+
|
3
|
+
include Magick
|
4
|
+
|
5
|
+
draw = Draw.new
|
6
|
+
|
7
|
+
draw.fill 'red'
|
8
|
+
draw.stroke 'blue'
|
9
|
+
draw.stroke_width(5)
|
10
|
+
draw.path 'M50 50 L100 100 0 100M190 190H290V290h-100 100'
|
11
|
+
|
12
|
+
b = Image.new(300, 300, HatchFill.new('white', 'black'))
|
13
|
+
|
14
|
+
draw.draw(b)
|
15
|
+
|
16
|
+
b.write('path_h_command_01.jpg')
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), 'new_image.rb')
|
2
|
+
|
3
|
+
include Magick
|
4
|
+
|
5
|
+
draw = Draw.new
|
6
|
+
|
7
|
+
draw.fill 'red'
|
8
|
+
draw.stroke 'blue'
|
9
|
+
draw.stroke_width(5)
|
10
|
+
draw.path 'M50,50 L100,100 0,100M190,190h100v100h-100v-100'
|
11
|
+
|
12
|
+
b = Image.new(300, 300, HatchFill.new('white', 'black'))
|
13
|
+
|
14
|
+
draw.draw(b)
|
15
|
+
|
16
|
+
b.write('path_h_command_02.jpg')
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), 'new_image.rb')
|
2
|
+
|
3
|
+
include Magick
|
4
|
+
|
5
|
+
draw = Draw.new
|
6
|
+
|
7
|
+
draw.fill 'red'
|
8
|
+
draw.stroke 'blue'
|
9
|
+
draw.stroke_width(5)
|
10
|
+
draw.path 'M50,50 L100,100 0,100M190,190L290,190L290,290 190,290'
|
11
|
+
|
12
|
+
b = Image.new(300, 300, HatchFill.new('white', 'black'))
|
13
|
+
|
14
|
+
draw.draw(b)
|
15
|
+
|
16
|
+
b.write('path_l_command_01.jpg')
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), 'new_image.rb')
|
2
|
+
|
3
|
+
include Magick
|
4
|
+
|
5
|
+
draw = Draw.new
|
6
|
+
|
7
|
+
draw.fill 'red'
|
8
|
+
draw.stroke 'blue'
|
9
|
+
draw.stroke_width(5)
|
10
|
+
draw.path 'M50 50 L100 100 0 100M190 190l100 0 0 100 -100 0'
|
11
|
+
|
12
|
+
b = Image.new(300, 300, HatchFill.new('white', 'black'))
|
13
|
+
|
14
|
+
draw.draw(b)
|
15
|
+
|
16
|
+
b.write('path_l_command_02.jpg')
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), 'new_image.rb')
|
2
|
+
|
3
|
+
include Magick
|
4
|
+
|
5
|
+
draw = Draw.new
|
6
|
+
|
7
|
+
draw.fill 'red'
|
8
|
+
draw.stroke 'blue'
|
9
|
+
draw.stroke_width(5)
|
10
|
+
draw.path 'M150 150 200 200 100 200'
|
11
|
+
|
12
|
+
b = Image.new(300, 300, HatchFill.new('white', 'black'))
|
13
|
+
|
14
|
+
draw.draw(b)
|
15
|
+
|
16
|
+
b.write('path_m_command_01.jpg')
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), 'new_image.rb')
|
2
|
+
|
3
|
+
include Magick
|
4
|
+
|
5
|
+
draw = Draw.new
|
6
|
+
|
7
|
+
draw.fill 'red'
|
8
|
+
draw.stroke 'blue'
|
9
|
+
draw.stroke_width(5)
|
10
|
+
draw.path 'M50 50 100 100 0 100M190 190 290 190 290 290 190 290'
|
11
|
+
|
12
|
+
b = Image.new(300, 300, HatchFill.new('white', 'black'))
|
13
|
+
|
14
|
+
draw.draw(b)
|
15
|
+
|
16
|
+
b.write('path_m_command_02.jpg')
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), 'new_image.rb')
|
2
|
+
|
3
|
+
include Magick
|
4
|
+
|
5
|
+
draw = Draw.new
|
6
|
+
|
7
|
+
draw.fill 'red'
|
8
|
+
draw.stroke 'blue'
|
9
|
+
draw.stroke_width(5)
|
10
|
+
draw.path 'M50 50 100 100 0 100m190 90 100 0 0 100 -100 0'
|
11
|
+
|
12
|
+
b = Image.new(300, 300, HatchFill.new('white', 'black'))
|
13
|
+
|
14
|
+
draw.draw(b)
|
15
|
+
|
16
|
+
b.write('path_m_command_03.jpg')
|