devil 0.1.9.5-i386-mswin32
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +112 -0
- data/LICENSE +21 -0
- data/README +52 -0
- data/Rakefile +55 -0
- data/ext/devil/extconf.rb +23 -0
- data/ext/devil/ruby_devil_ext.c +9 -0
- data/ext/devil/ruby_devil_ext.h +8 -0
- data/ext/devil/ruby_il.c +546 -0
- data/ext/devil/ruby_ilu.c +228 -0
- data/lib/1.8/devil.so +0 -0
- data/lib/1.9/devil.so +0 -0
- data/lib/devil.rb +547 -0
- data/lib/devil/gosu.rb +122 -0
- data/lib/devil/version.rb +3 -0
- data/test/red.png +0 -0
- data/test/tank.png +0 -0
- data/test/test_blank.rb +21 -0
- data/test/test_blit.rb +21 -0
- data/test/test_clone_and_crop.rb +28 -0
- data/test/test_gosu_load.rb +23 -0
- data/test/test_gosu_roundtrip.rb +29 -0
- data/test/test_gosu_save.rb +26 -0
- data/test/test_gosu_show.rb +10 -0
- data/test/test_group.rb +18 -0
- data/test/test_ilut.rb +95 -0
- data/test/test_new_api.rb +28 -0
- data/test/test_profile.rb +8 -0
- data/test/test_quality.rb +9 -0
- data/test/test_scale_algos.rb +30 -0
- data/test/test_screenshot.rb +33 -0
- data/test/test_thumbnail.rb +13 -0
- data/test/texture.jpg +0 -0
- data/test/texture.png +0 -0
- data/test/texture_out1.jpg +0 -0
- data/test/texture_out2.jpg +0 -0
- data/test/thumb.png +0 -0
- metadata +101 -0
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'devil'
|
3
|
+
|
4
|
+
algorithms = {
|
5
|
+
ILU::NEAREST => :nearest,
|
6
|
+
ILU::LINEAR => :linear,
|
7
|
+
ILU::BILINEAR => :bilinear,
|
8
|
+
ILU::SCALE_BOX => :scale_box,
|
9
|
+
ILU::SCALE_TRIANGLE => :scale_triangle,
|
10
|
+
ILU::SCALE_BELL => :scale_bell,
|
11
|
+
ILU::SCALE_BSPLINE => :scale_bspline,
|
12
|
+
ILU::SCALE_LANCZOS3 => :scale_lanczos3,
|
13
|
+
ILU::SCALE_MITCHELL => :scale_mitchell
|
14
|
+
}
|
15
|
+
|
16
|
+
|
17
|
+
algorithms.each do |key, value|
|
18
|
+
puts "Generating image using filter: #{value}"
|
19
|
+
IL.Init
|
20
|
+
|
21
|
+
name = IL.GenImages(1)[0]
|
22
|
+
IL.BindImage(name)
|
23
|
+
IL.LoadImage("texture.jpg")
|
24
|
+
ILU.ImageParameter(ILU::FILTER, key)
|
25
|
+
|
26
|
+
ILU.Scale(100, 100, 1)
|
27
|
+
IL.Enable(IL::FILE_OVERWRITE)
|
28
|
+
IL.SaveImage("scaling_test_#{value}.jpg")
|
29
|
+
|
30
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
$direc = File.dirname(__FILE__)
|
2
|
+
|
3
|
+
$LOAD_PATH.push("#{$direc}/../lib/")
|
4
|
+
|
5
|
+
require 'rubygems'
|
6
|
+
require 'devil/gosu'
|
7
|
+
|
8
|
+
class W < Gosu::Window
|
9
|
+
def initialize
|
10
|
+
super(1024, 768, false, 20)
|
11
|
+
|
12
|
+
@img = Gosu::Image.new(self, "tank.png")
|
13
|
+
@img2 = @img.dup
|
14
|
+
@img.circle 100, 100, 50, :color => :purple, :filled => true
|
15
|
+
end
|
16
|
+
|
17
|
+
def draw
|
18
|
+
@img.draw 100, 50,1
|
19
|
+
@img.draw 300, 50, 1
|
20
|
+
@img2.draw 300, 400, 1
|
21
|
+
end
|
22
|
+
|
23
|
+
def update
|
24
|
+
if button_down?(Gosu::KbEscape)
|
25
|
+
screenshot.rotate(45).save("screenshot.png").free
|
26
|
+
exit
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
w = W.new
|
32
|
+
w.show
|
33
|
+
|
@@ -0,0 +1,13 @@
|
|
1
|
+
$direc = File.dirname(__FILE__)
|
2
|
+
|
3
|
+
$LOAD_PATH.push("#{$direc}/../lib/")
|
4
|
+
|
5
|
+
require 'rubygems'
|
6
|
+
require 'devil/gosu'
|
7
|
+
|
8
|
+
Devil.load("texture.png") do |img|
|
9
|
+
img.dup.thumbnail2(100, :filter => Devil::NEAREST, :gauss => 4).show(200, 300).free
|
10
|
+
img.dup.thumbnail2(100, :filter => Devil::NEAREST, :gauss => 1).show(500, 300).free
|
11
|
+
img.dup.thumbnail(100).save("thumb.png").show(200, 500).free
|
12
|
+
end
|
13
|
+
|
data/test/texture.jpg
ADDED
Binary file
|
data/test/texture.png
ADDED
Binary file
|
Binary file
|
Binary file
|
data/test/thumb.png
ADDED
Binary file
|
metadata
ADDED
@@ -0,0 +1,101 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: devil
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 1
|
8
|
+
- 9
|
9
|
+
- 5
|
10
|
+
version: 0.1.9.5
|
11
|
+
platform: i386-mswin32
|
12
|
+
authors:
|
13
|
+
- Jaroslaw Tworek, John Mair (banisterfiend)
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2010-10-08 00:00:00 +13:00
|
19
|
+
default_executable:
|
20
|
+
dependencies: []
|
21
|
+
|
22
|
+
description: Ruby bindings for DevIL cross platform image loading library
|
23
|
+
email: jrmair@gmail.com
|
24
|
+
executables: []
|
25
|
+
|
26
|
+
extensions: []
|
27
|
+
|
28
|
+
extra_rdoc_files:
|
29
|
+
- README
|
30
|
+
files:
|
31
|
+
- Rakefile
|
32
|
+
- README
|
33
|
+
- CHANGELOG
|
34
|
+
- LICENSE
|
35
|
+
- lib/devil.rb
|
36
|
+
- lib/devil/gosu.rb
|
37
|
+
- lib/devil/version.rb
|
38
|
+
- ext/devil/extconf.rb
|
39
|
+
- ext/devil/ruby_devil_ext.h
|
40
|
+
- ext/devil/ruby_devil_ext.c
|
41
|
+
- ext/devil/ruby_il.c
|
42
|
+
- ext/devil/ruby_ilu.c
|
43
|
+
- test/test_blank.rb
|
44
|
+
- test/test_blit.rb
|
45
|
+
- test/test_clone_and_crop.rb
|
46
|
+
- test/test_gosu_load.rb
|
47
|
+
- test/test_gosu_roundtrip.rb
|
48
|
+
- test/test_gosu_save.rb
|
49
|
+
- test/test_gosu_show.rb
|
50
|
+
- test/test_group.rb
|
51
|
+
- test/test_ilut.rb
|
52
|
+
- test/test_new_api.rb
|
53
|
+
- test/test_profile.rb
|
54
|
+
- test/test_quality.rb
|
55
|
+
- test/test_scale_algos.rb
|
56
|
+
- test/test_screenshot.rb
|
57
|
+
- test/test_thumbnail.rb
|
58
|
+
- test/red.png
|
59
|
+
- test/tank.png
|
60
|
+
- test/texture.png
|
61
|
+
- test/thumb.png
|
62
|
+
- test/texture.jpg
|
63
|
+
- test/texture_out1.jpg
|
64
|
+
- test/texture_out2.jpg
|
65
|
+
- lib/1.8/devil.so
|
66
|
+
- lib/1.9/devil.so
|
67
|
+
has_rdoc: yard
|
68
|
+
homepage: http://banisterfiend.wordpress.com
|
69
|
+
licenses: []
|
70
|
+
|
71
|
+
post_install_message:
|
72
|
+
rdoc_options:
|
73
|
+
- --main
|
74
|
+
- README
|
75
|
+
require_paths:
|
76
|
+
- lib
|
77
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
78
|
+
none: false
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
segments:
|
83
|
+
- 0
|
84
|
+
version: "0"
|
85
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
86
|
+
none: false
|
87
|
+
requirements:
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
segments:
|
91
|
+
- 0
|
92
|
+
version: "0"
|
93
|
+
requirements: []
|
94
|
+
|
95
|
+
rubyforge_project:
|
96
|
+
rubygems_version: 1.3.7
|
97
|
+
signing_key:
|
98
|
+
specification_version: 3
|
99
|
+
summary: Ruby bindings for DevIL cross platform image loading library
|
100
|
+
test_files: []
|
101
|
+
|