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.
- data/CHANGELOG +94 -88
- data/README.markdown +35 -35
- data/Rakefile +66 -87
- data/examples/example_bezier.rb +1 -1
- data/examples/example_dup.rb +24 -1
- data/examples/example_lsystem.rb +59 -51
- data/examples/example_scale.rb +29 -0
- data/{src → ext/texplay}/actions.c +2 -2
- data/{src → ext/texplay}/actions.h +0 -0
- data/{src → ext/texplay}/bindings.c +0 -0
- data/{src → ext/texplay}/bindings.h +0 -0
- data/{src → ext/texplay}/cache.c +5 -2
- data/{src → ext/texplay}/cache.h +0 -0
- data/{src → ext/texplay}/compat.h +0 -0
- data/{src → ext/texplay}/extconf.rb +2 -2
- data/{src → ext/texplay}/gen_eval.c +0 -0
- data/{src → ext/texplay}/gen_eval.h +0 -0
- data/{src → ext/texplay}/object2module.c +0 -0
- data/{src → ext/texplay}/object2module.h +0 -0
- data/{src → ext/texplay}/texplay.c +1 -1
- data/{src → ext/texplay}/texplay.h +0 -0
- data/{src → ext/texplay}/utils.c +10 -7
- data/{src → ext/texplay}/utils.h +0 -0
- data/lib/{ctexplay.18.so → 1.8/texplay.so} +0 -0
- data/lib/{ctexplay.19.so → 1.9/texplay.so} +0 -0
- data/lib/texplay-contrib.rb +171 -149
- data/lib/texplay.rb +134 -134
- metadata +21 -36
- data/src/Makefile +0 -212
- data/src/TAGS +0 -286
- data/src/actions.obj +0 -0
- data/src/bindings.obj +0 -0
- data/src/cache.obj +0 -0
- data/src/ctexplay-i386-mswin32.def +0 -2
- data/src/ctexplay-i386-mswin32.exp +0 -0
- data/src/ctexplay-i386-mswin32.lib +0 -0
- data/src/ctexplay-i386-mswin32.pdb +0 -0
- data/src/ctexplay.so +0 -0
- data/src/gen_eval.obj +0 -0
- data/src/mkmf.log +0 -33
- data/src/object2module.obj +0 -0
- data/src/texplay.obj +0 -0
- data/src/utils.obj +0 -0
- data/src/vc60.pdb +0 -0
data/CHANGELOG
CHANGED
@@ -1,88 +1,94 @@
|
|
1
|
-
|
2
|
-
version 0.2.
|
3
|
-
*
|
4
|
-
*
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
*
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
*
|
15
|
-
*
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
*
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
*
|
24
|
-
*
|
25
|
-
*
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
*
|
30
|
-
*
|
31
|
-
*
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
*
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
*
|
40
|
-
|
41
|
-
*
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
*
|
47
|
-
*
|
48
|
-
* This is a BETA release
|
49
|
-
|
50
|
-
|
51
|
-
version 0.1.
|
52
|
-
*
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
version 0.1.6
|
58
|
-
*
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
*
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
version 0.1.
|
87
|
-
*
|
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.
|
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
|
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
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
end
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
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
|
data/examples/example_bezier.rb
CHANGED
@@ -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(
|
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
|
data/examples/example_dup.rb
CHANGED
@@ -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
|
-
|
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
|
|