texplay 0.2.4-x86-mswin32-60 → 0.2.5-x86-mswin32-60

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. data/CHANGELOG +94 -88
  2. data/README.markdown +35 -35
  3. data/Rakefile +66 -87
  4. data/examples/example_bezier.rb +1 -1
  5. data/examples/example_dup.rb +24 -1
  6. data/examples/example_lsystem.rb +59 -51
  7. data/examples/example_scale.rb +29 -0
  8. data/{src → ext/texplay}/actions.c +2 -2
  9. data/{src → ext/texplay}/actions.h +0 -0
  10. data/{src → ext/texplay}/bindings.c +0 -0
  11. data/{src → ext/texplay}/bindings.h +0 -0
  12. data/{src → ext/texplay}/cache.c +5 -2
  13. data/{src → ext/texplay}/cache.h +0 -0
  14. data/{src → ext/texplay}/compat.h +0 -0
  15. data/{src → ext/texplay}/extconf.rb +2 -2
  16. data/{src → ext/texplay}/gen_eval.c +0 -0
  17. data/{src → ext/texplay}/gen_eval.h +0 -0
  18. data/{src → ext/texplay}/object2module.c +0 -0
  19. data/{src → ext/texplay}/object2module.h +0 -0
  20. data/{src → ext/texplay}/texplay.c +1 -1
  21. data/{src → ext/texplay}/texplay.h +0 -0
  22. data/{src → ext/texplay}/utils.c +10 -7
  23. data/{src → ext/texplay}/utils.h +0 -0
  24. data/lib/{ctexplay.18.so → 1.8/texplay.so} +0 -0
  25. data/lib/{ctexplay.19.so → 1.9/texplay.so} +0 -0
  26. data/lib/texplay-contrib.rb +171 -149
  27. data/lib/texplay.rb +134 -134
  28. metadata +21 -36
  29. data/src/Makefile +0 -212
  30. data/src/TAGS +0 -286
  31. data/src/actions.obj +0 -0
  32. data/src/bindings.obj +0 -0
  33. data/src/cache.obj +0 -0
  34. data/src/ctexplay-i386-mswin32.def +0 -2
  35. data/src/ctexplay-i386-mswin32.exp +0 -0
  36. data/src/ctexplay-i386-mswin32.lib +0 -0
  37. data/src/ctexplay-i386-mswin32.pdb +0 -0
  38. data/src/ctexplay.so +0 -0
  39. data/src/gen_eval.obj +0 -0
  40. data/src/mkmf.log +0 -33
  41. data/src/object2module.obj +0 -0
  42. data/src/texplay.obj +0 -0
  43. data/src/utils.obj +0 -0
  44. data/src/vc60.pdb +0 -0
data/CHANGELOG CHANGED
@@ -1,88 +1,94 @@
1
- 15/9/09
2
- version 0.2.4
3
- * added lsystem
4
- * made lsystem both 1.9.1 and 1.8.6 compatible
5
-
6
- 11/9/09
7
- version 0.2.3
8
- * added Ruby 1.8.7 compatibility by modifying extconf.rb to define RUBY_19 macro
9
- * and modified compat.h to get rid of feature test (fails on 1.8.7)
10
-
11
- 8/9/09
12
- version 0.2.2
13
- * fixed color_control bug, action_struct->color was being overwritten (now using a temp).
14
- * fixed faulty error msg where max tex size was being displayed as 1024 but is actually 1022
15
- * added :start_angle parameter to ngon action
16
- * fixed example screen height from 769 to 768
17
- * arity of -1 and 0 now supported for color_control procs
18
- * fixed parameter checks for circle and ngon
19
- * updated documentation to reflect changes, and added details on caching
20
-
21
- 2/9/09
22
- version 0.2.1
23
- * releasing a gem for TexPlay
24
- * bumped version number so can add add gosu 0.7.14 dependency to github gem
25
- * hopefully gem works on both github and rubyforge
26
- 31/8/09
27
- version 0.2.0
28
- * added each iterator
29
- * added alternative to proc for :color_control proc (allowing static linear transforms to pixels)
30
- * no longer segfaulting on windows (no idea why not)
31
- * rewrote EmptyImageStub in ruby, using philomory's code. now alot faster.
32
- * implemented 'shadow' in terms of static :color_control pixel transform
33
- * added more example code demonstrating each iterator (example_each.rb) and new color_control behaviour
34
- i.e example_color_transform.rb
35
- * should be relatively stable now!
36
-
37
- 28/8/09
38
- version 0.1.9.1 (still BETA)
39
- * experimental features: Gosu::Image#dup and Gosu::Image#clone
40
- * also TexPlay::create_blank_image(window, width, height)
41
- * I noticed these features SEG FAULT on my setup in windows, so be warned
42
- * This is a BETA release
43
-
44
- 14/8/09
45
- version 0.1.9.0 (BETA)
46
- * major rewrite. TP now supports beziers, polylines, polygons, and more
47
- * also supports alpha_blending (though still tempermental)
48
- * This is a BETA release
49
-
50
- 1/7/09
51
- version 0.1.6.2
52
- * fixed another subtle bug in constrain_local_boundaries(). Function was
53
- unable to deal with drawing actions that were 100% outside the image
54
- boundaries.
55
-
56
- 28/6/09
57
- version 0.1.6
58
- * gen_eval now working as a replacement for instance_eval in the #paint block. Allows for more user-friendly interface.
59
- * #paint can now be called without a block; if invoked this way it executes any commands in the action queue, e.g
60
- @img.circle 20, 20, 40
61
- @img.pixel 30, 30
62
- @img.paint
63
- * above will function as if: @img.paint { circle 20, 20, 40; pixel 30, 30 }
64
- * collected 1.8.6/1.9.1 compatibility into compat.h
65
-
66
- 16/6/09
67
- version 0.1.4.6
68
- * allowed arity of 0 (as well as -1) for ruby 1.9 compatibility
69
-
70
- 13/6/09
71
- version 0.1.4.5
72
- * major bugfix with TexPlay#splice method (segfaut). Also added new color format parameter: color [1, 1, 0, 1] (e.g purple with full alpha).
73
- Also fixed subtle edge-case bug in constrain_local_boundaries().
74
-
75
- 9/6/09
76
- version 0.1.4
77
- * improved error checking. should work better with later gosu releases
78
-
79
- 20/2/09
80
- version 0.1.1
81
- * rerelease of this version fixing the oversized image bug for refresh_cache (i.e images over 500 x 500
82
-
83
- version 0.1.1
84
- * oops, bug in leftshift/rightshift functions, fixed!
85
-
86
- version 0.1.0
87
- * release!
88
-
1
+ 6/10/09
2
+ version 0.2.5
3
+ * fixed quad_draw flicker bug
4
+ * added splice_and_scale (to texplay-contrib.rb)
5
+ * now using rake-compiler to run build process
6
+
7
+ 15/9/09
8
+ version 0.2.4
9
+ * added lsystem
10
+ * made lsystem both 1.9.1 and 1.8.6 compatible
11
+
12
+ 11/9/09
13
+ version 0.2.3
14
+ * added Ruby 1.8.7 compatibility by modifying extconf.rb to define RUBY_19 macro
15
+ * and modified compat.h to get rid of feature test (fails on 1.8.7)
16
+
17
+ 8/9/09
18
+ version 0.2.2
19
+ * fixed color_control bug, action_struct->color was being overwritten (now using a temp).
20
+ * fixed faulty error msg where max tex size was being displayed as 1024 but is actually 1022
21
+ * added :start_angle parameter to ngon action
22
+ * fixed example screen height from 769 to 768
23
+ * arity of -1 and 0 now supported for color_control procs
24
+ * fixed parameter checks for circle and ngon
25
+ * updated documentation to reflect changes, and added details on caching
26
+
27
+ 2/9/09
28
+ version 0.2.1
29
+ * releasing a gem for TexPlay
30
+ * bumped version number so can add add gosu 0.7.14 dependency to github gem
31
+ * hopefully gem works on both github and rubyforge
32
+ 31/8/09
33
+ version 0.2.0
34
+ * added each iterator
35
+ * added alternative to proc for :color_control proc (allowing static linear transforms to pixels)
36
+ * no longer segfaulting on windows (no idea why not)
37
+ * rewrote EmptyImageStub in ruby, using philomory's code. now alot faster.
38
+ * implemented 'shadow' in terms of static :color_control pixel transform
39
+ * added more example code demonstrating each iterator (example_each.rb) and new color_control behaviour
40
+ i.e example_color_transform.rb
41
+ * should be relatively stable now!
42
+
43
+ 28/8/09
44
+ version 0.1.9.1 (still BETA)
45
+ * experimental features: Gosu::Image#dup and Gosu::Image#clone
46
+ * also TexPlay::create_blank_image(window, width, height)
47
+ * I noticed these features SEG FAULT on my setup in windows, so be warned
48
+ * This is a BETA release
49
+
50
+ 14/8/09
51
+ version 0.1.9.0 (BETA)
52
+ * major rewrite. TP now supports beziers, polylines, polygons, and more
53
+ * also supports alpha_blending (though still tempermental)
54
+ * This is a BETA release
55
+
56
+ 1/7/09
57
+ version 0.1.6.2
58
+ * fixed another subtle bug in constrain_local_boundaries(). Function was
59
+ unable to deal with drawing actions that were 100% outside the image
60
+ boundaries.
61
+
62
+ 28/6/09
63
+ version 0.1.6
64
+ * gen_eval now working as a replacement for instance_eval in the #paint block. Allows for more user-friendly interface.
65
+ * #paint can now be called without a block; if invoked this way it executes any commands in the action queue, e.g
66
+ @img.circle 20, 20, 40
67
+ @img.pixel 30, 30
68
+ @img.paint
69
+ * above will function as if: @img.paint { circle 20, 20, 40; pixel 30, 30 }
70
+ * collected 1.8.6/1.9.1 compatibility into compat.h
71
+
72
+ 16/6/09
73
+ version 0.1.4.6
74
+ * allowed arity of 0 (as well as -1) for ruby 1.9 compatibility
75
+
76
+ 13/6/09
77
+ version 0.1.4.5
78
+ * major bugfix with TexPlay#splice method (segfaut). Also added new color format parameter: color [1, 1, 0, 1] (e.g purple with full alpha).
79
+ Also fixed subtle edge-case bug in constrain_local_boundaries().
80
+
81
+ 9/6/09
82
+ version 0.1.4
83
+ * improved error checking. should work better with later gosu releases
84
+
85
+ 20/2/09
86
+ version 0.1.1
87
+ * rerelease of this version fixing the oversized image bug for refresh_cache (i.e images over 500 x 500
88
+
89
+ version 0.1.1
90
+ * oops, bug in leftshift/rightshift functions, fixed!
91
+
92
+ version 0.1.0
93
+ * release!
94
+
data/README.markdown CHANGED
@@ -1,35 +1,35 @@
1
- ![Alt text](https://dl.getdropbox.com/u/239375/texplay.png)
2
-
3
- *an image manipulation tool for ruby and gosu*
4
-
5
- INSTRUCTIONS
6
- ============
7
-
8
- **TexPlay version 0.2.4**
9
-
10
- Gem installation:
11
-
12
- + sudo gem install texplay
13
-
14
- To compile TexPlay from source, ensure you are in the directory with the Rakefile and type:
15
-
16
- + rake
17
-
18
- OR
19
-
20
- + rake19 (assuming this is the name of your 1.9.1 version of rake)
21
-
22
- **NB:** be sure to run the version of rake that corresponds to the ruby version you wish to use! on my system I use rake19 for ruby 1.9.1!
23
-
24
- If all goes well, run the example programs:
25
-
26
- + cd examples
27
- + ruby example_melt.rb
28
- + ruby example_simple.rb
29
- + ..etc
30
-
31
- + like any gosu application, gosu.so must be in the current directory (or the gosu gem installed) when running the examples.
32
-
33
-
34
- ---
35
- Enjoy!
1
+ ![Alt text](https://dl.getdropbox.com/u/239375/texplay.png)
2
+
3
+ *an image manipulation tool for ruby and gosu*
4
+
5
+ INSTRUCTIONS
6
+ ============
7
+
8
+ **TexPlay version 0.2.5**
9
+
10
+ Gem installation:
11
+
12
+ + sudo gem install texplay
13
+
14
+ To compile TexPlay from source, ensure you are in the directory with the Rakefile and type:
15
+
16
+ + rake compile
17
+
18
+ OR
19
+
20
+ + rake19 compile (assuming this is the name of your 1.9.1 version of rake)
21
+
22
+ **NB:** be sure to run the version of rake that corresponds to the ruby version you wish to use! on my system I use rake19 for ruby 1.9.1!
23
+
24
+ If all goes well, run the example programs:
25
+
26
+ + cd examples
27
+ + ruby example_melt.rb
28
+ + ruby example_simple.rb
29
+ + ..etc
30
+
31
+ + like any gosu application, gosu.so must be in the current directory (or the gosu gem installed) when running the examples.
32
+
33
+
34
+ ---
35
+ Enjoy!
data/Rakefile CHANGED
@@ -1,87 +1,66 @@
1
- require 'rake/clean'
2
- require 'rake/gempackagetask'
3
-
4
- TEXPLAY_VERSION = "0.2.4"
5
-
6
- $dlext = Config::CONFIG['DLEXT']
7
-
8
- CLEAN.include("src/*.#{$dlext}", "src/*.log", "src/*.o", "src/*~", "src/*#*", "src/*.obj", "src/*.def", "src/*.pdb")
9
- CLOBBER.include("**/*.#{$dlext}", "**/*~", "**/*#*", "**/*.log", "**/*.o")
10
-
11
- $make_program = if RUBY_PLATFORM =~ /win/
12
- "nmake"
13
- else
14
- "make"
15
- end
16
-
17
- task :default => [:build]
18
-
19
- desc "Build TexPlay"
20
- task :build => :clean do
21
- puts "(2) building Makefile..."
22
- chdir("./src/") do
23
- ruby "extconf.rb"
24
- puts "(3) building ctexplay.#{$dlext}..."
25
- sh "#{$make_program}"
26
- puts "(4) copying ctexplay.#{$dlext} to current directory..."
27
- cp "ctexplay.#{$dlext}", "../lib" , :verbose => true
28
-
29
- if RUBY_PLATFORM =~ /mswin/
30
- if RUBY_VERSION =~ /1.9/
31
- File.rename("../lib/ctexplay.#{$dlext}", "../lib/ctexplay.19.#{$dlext}")
32
- else
33
- File.rename("../lib/ctexplay.#{$dlext}", "../lib/ctexplay.18.#{$dlext}")
34
- end
35
- end
36
- puts "(5) ...done!"
37
- end
38
- end
39
-
40
- specification = Gem::Specification.new do |s|
41
- s.name = "texplay"
42
- s.summary = "TexPlay is a light-weight image manipulation framework for Ruby and Gosu"
43
- s.version = TEXPLAY_VERSION
44
- s.date = "2009-09-09"
45
- s.author = "John Mair (banisterfiend)"
46
- s.email = 'jrmair@gmail.com'
47
- s.description = s.summary
48
- s.require_path = 'lib'
49
- s.add_dependency("gosu",">=0.7.14")
50
- s.homepage = "http://banisterfiend.wordpress.com/2008/08/23/texplay-an-image-manipulation-tool-for-ruby-and-gosu/"
51
- s.has_rdoc = false
52
- s.files = ["Rakefile", "README.markdown", "CHANGELOG",
53
- "lib/texplay.rb", "lib/texplay-contrib.rb"] +
54
- FileList["src/*", "examples/*.rb", "examples/media/*"].to_a
55
-
56
- if RUBY_PLATFORM =~ /mswin/
57
- s.platform = Gem::Platform::CURRENT
58
- s.files += ["lib/ctexplay.18.so", "lib/ctexplay.19.so"]
59
-
60
- else
61
- s.platform = Gem::Platform::RUBY
62
- s.extensions = ["src/extconf.rb"]
63
- end
64
- end
65
- Rake::GemPackageTask.new(specification) do |package|
66
- package.need_zip = false
67
- package.need_tar = false
68
- end
69
-
70
- SELENE = '/home/john/ruby/projects/selene'
71
- desc "update selene's version of texplay"
72
- task :selene => ["#{SELENE}/lib/texplay.rb", "#{SELENE}/lib/texplay-contrib.rb",
73
- "#{SELENE}/lib/ctexplay.so"] do
74
- puts "...done!"
75
- end
76
-
77
- file "#{SELENE}/lib/texplay.rb" => "texplay.rb" do |t|
78
- cp t.prerequisites.first, t.name, :verbose => true
79
- end
80
-
81
- file "#{SELENE}/lib/texplay-contrib.rb" => "texplay-contrib.rb" do |t|
82
- cp t.prerequisites.first, t.name, :verbose => true
83
- end
84
-
85
- file "#{SELENE}/lib/ctexplay.#{$dlext}" => "ctexplay.#{$dlext}" do |t|
86
- cp t.prerequisites.first, t.name, :verbose => true
87
- end
1
+ require 'rake/clean'
2
+ require 'rake/gempackagetask'
3
+ #require 'rake/extensiontask'
4
+
5
+ TEXPLAY_VERSION = "0.2.5"
6
+
7
+ $dlext = Config::CONFIG['DLEXT']
8
+
9
+ CLEAN.include("ext/**/*.#{$dlext}", "ext/**/*.log", "ext/**/*.o", "ext/**/*~", "ext/**/*#*", "ext/**/*.obj", "ext/**/*.def", "ext/**/*.pdb")
10
+ CLOBBER.include("**/*.#{$dlext}", "**/*~", "**/*#*", "**/*.log", "**/*.o")
11
+
12
+ specification = Gem::Specification.new do |s|
13
+ s.name = "texplay"
14
+ s.summary = "TexPlay is a light-weight image manipulation framework for Ruby and Gosu"
15
+ s.version = TEXPLAY_VERSION
16
+ s.date = Time.now.strftime '%Y-%m-%d'
17
+ s.author = "John Mair (banisterfiend)"
18
+ s.email = 'jrmair@gmail.com'
19
+ s.description = s.summary
20
+ s.require_path = 'lib'
21
+ s.add_dependency("gosu",">=0.7.14")
22
+ s.platform = Gem::Platform::RUBY
23
+
24
+ s.homepage = "http://banisterfiend.wordpress.com/2008/08/23/texplay-an-image-manipulation-tool-for-ruby-and-gosu/"
25
+ s.has_rdoc = false
26
+ s.files = ["Rakefile", "README.markdown", "CHANGELOG",
27
+ "lib/texplay.rb", "lib/texplay-contrib.rb"] +
28
+ FileList["ext/**/extconf.rb", "ext/**/*.h", "ext/**/*.c", "examples/*.rb",
29
+ "examples/media/*"].to_a
30
+
31
+ if RUBY_PLATFORM =~ /mswin/
32
+ s.platform = Gem::Platform::CURRENT
33
+ s.files += ["lib/1.8/texplay.so", "lib/1.9/texplay.so"]
34
+
35
+ else
36
+ s.platform = Gem::Platform::RUBY
37
+ s.extensions = ["ext/texplay/extconf.rb"]
38
+ end
39
+
40
+
41
+ end
42
+
43
+ Rake::GemPackageTask.new(specification) do |package|
44
+ package.need_zip = false
45
+ package.need_tar = false
46
+ end
47
+
48
+
49
+ # SELENE = '/home/john/ruby/projects/selene'
50
+ # desc "update selene's version of texplay"
51
+ # task :selene => ["#{SELENE}/lib/texplay.rb", "#{SELENE}/lib/texplay-contrib.rb",
52
+ # "#{SELENE}/lib/ctexplay.so"] do
53
+ # puts "...done!"
54
+ # end
55
+
56
+ # file "#{SELENE}/lib/texplay.rb" => "texplay.rb" do |t|
57
+ # cp t.prerequisites.first, t.name, :verbose => true
58
+ # end
59
+
60
+ # file "#{SELENE}/lib/texplay-contrib.rb" => "texplay-contrib.rb" do |t|
61
+ # cp t.prerequisites.first, t.name, :verbose => true
62
+ # end
63
+
64
+ # file "#{SELENE}/lib/ctexplay.#{$dlext}" => "ctexplay.#{$dlext}" do |t|
65
+ # cp t.prerequisites.first, t.name, :verbose => true
66
+ # end
@@ -15,7 +15,7 @@ class W < Gosu::Window
15
15
 
16
16
  # NOTE: TexPlay also accepts points. a 'point' is any object that responds to 'x' or 'y'
17
17
  # NOTE: current maximum points for a bezier is 13
18
- (0..@img.width + 100).step(50) { |x|
18
+ (0..@img.width + 100).step(40) { |x|
19
19
  p = TexPlay::TPPoint.new
20
20
  p.x = x
21
21
  p.y = @img.height * rand
@@ -32,7 +32,30 @@ class W < Gosu::Window
32
32
  puts @bunk.little
33
33
 
34
34
  # add a red line to the copy to identify it
35
- @bunk.line 0, 0, 1024, 1024, :color => :red
35
+ #@bunk.line 0, 0, 1024, 1024, :color => :red
36
+
37
+ @bunk.each(:region =>[200,200,350,350]) { |c,x,y|
38
+
39
+ num_pixels = 0
40
+ total = [0, 0, 0, 0]
41
+ @bunk.circle x, y, 2,
42
+ :color_control => proc { |v|
43
+ if v
44
+ total[0] += v[0]
45
+ total[1] += v[1]
46
+ total[2] += v[2]
47
+ total[3] += v[3]
48
+
49
+ num_pixels += 1
50
+ end
51
+ :none
52
+ }
53
+
54
+ c[0] = total[0] / num_pixels.to_f
55
+ c[1] = total[1] / num_pixels.to_f
56
+ c[2] = total[2] / num_pixels.to_f
57
+ c[3] = total[3] / num_pixels.to_f
58
+ }
36
59
 
37
60
  end
38
61