devil 0.1.9.1 → 0.1.9.5
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +112 -105
- data/LICENSE +21 -21
- data/README +52 -52
- data/Rakefile +55 -76
- data/ext/devil/extconf.rb +23 -23
- data/ext/devil/ruby_devil_ext.c +9 -9
- data/ext/devil/ruby_devil_ext.h +8 -8
- data/ext/devil/ruby_il.c +546 -546
- data/ext/devil/ruby_ilu.c +228 -228
- data/lib/devil.rb +547 -542
- data/lib/devil/gosu.rb +122 -122
- data/lib/devil/version.rb +3 -3
- data/test/test_blank.rb +21 -21
- data/test/test_blit.rb +21 -21
- data/test/test_clone_and_crop.rb +28 -28
- data/test/test_gosu_load.rb +23 -23
- data/test/test_gosu_roundtrip.rb +29 -29
- data/test/test_gosu_save.rb +26 -26
- data/test/test_gosu_show.rb +10 -10
- data/test/test_group.rb +18 -18
- data/test/test_ilut.rb +95 -95
- data/test/test_new_api.rb +28 -28
- data/test/test_profile.rb +8 -8
- data/test/test_quality.rb +9 -9
- data/test/test_scale_algos.rb +30 -30
- data/test/test_screenshot.rb +33 -33
- data/test/test_thumbnail.rb +13 -13
- data/test/texture_out1.jpg +0 -0
- data/test/texture_out2.jpg +0 -0
- data/test/thumb.png +0 -0
- metadata +33 -19
- data/test/test_equality.rb +0 -18
data/CHANGELOG
CHANGED
@@ -1,105 +1,112 @@
|
|
1
|
-
|
2
|
-
* version 0.1.9.
|
3
|
-
*
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
*
|
10
|
-
* added
|
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
|
-
* added
|
46
|
-
*
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
* added
|
51
|
-
|
52
|
-
|
53
|
-
* added
|
54
|
-
* added
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
* added
|
61
|
-
* added
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
* made
|
66
|
-
*
|
67
|
-
*
|
68
|
-
|
69
|
-
|
70
|
-
*
|
71
|
-
*
|
72
|
-
*
|
73
|
-
*
|
74
|
-
*
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
*
|
80
|
-
*
|
81
|
-
* added
|
82
|
-
*
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
*
|
87
|
-
*
|
88
|
-
*
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
*
|
93
|
-
*
|
94
|
-
*
|
95
|
-
*
|
96
|
-
|
97
|
-
|
98
|
-
* added
|
99
|
-
*
|
100
|
-
|
101
|
-
|
102
|
-
*
|
103
|
-
|
104
|
-
|
105
|
-
*
|
1
|
+
2010-8-10 John Mair (Banisterfiend)
|
2
|
+
* version 0.1.9.5
|
3
|
+
* mingw32 gem
|
4
|
+
|
5
|
+
2010-22-03 John Mair (Banisterfiend)
|
6
|
+
* automatically convert from array to packed string in Devil.from_blob
|
7
|
+
|
8
|
+
2009-6-12 John Mair (Banisterfiend)
|
9
|
+
* version 0.1.9.1
|
10
|
+
* added thumbnail2 and resize2 for anti-aliased image scaling
|
11
|
+
* made Gosu::Window#screenshot 1.9 compatible (now using glReadPixels)
|
12
|
+
* using version.rb to help manage versions
|
13
|
+
|
14
|
+
2009-14-11 John Mair (Banisterfiend)
|
15
|
+
* added to ruby_il.c:
|
16
|
+
* IL::SetInteger, IL::JPG_QUALITY
|
17
|
+
* added to ruby_ilu.c:
|
18
|
+
* ILU::CompareImage
|
19
|
+
* added test_quality.rb to tests
|
20
|
+
* added :jpg_quality option parameter to Devil::Image#save
|
21
|
+
|
22
|
+
2009-11-11 John Mair (Banisterfiend)
|
23
|
+
* version 0.1.9.0 re-release
|
24
|
+
* REMOVED ILUT (OpenGL) support because ILUT is not built with OpenGL support on all platforms (e.g gentoo and some ubuntu distros)
|
25
|
+
|
26
|
+
2009-11-10 John Mair (Banisterfiend)
|
27
|
+
* version 0.1.9.0
|
28
|
+
* added ILUT (OpenGL) support
|
29
|
+
* updated installation info (no longer using c:\windows\system\ for dlls)
|
30
|
+
|
31
|
+
2009-10-29 John Mair (Banisterfiend)
|
32
|
+
* version 0.1.8.8
|
33
|
+
* added Devil.with_group (for loading multiple images into the same block)
|
34
|
+
* all images passed into block are cleaned up at end of block
|
35
|
+
* images at end of block are only free'd if they have not already been freed by user
|
36
|
+
* ruby_il.c: added IMAGE_BITS_PER_PIXEL and IMAGE_BYTES_PER_PIXEL constants
|
37
|
+
* finalizers still not implemented
|
38
|
+
|
39
|
+
2009-10-28 John Mair (Banisterfiend)
|
40
|
+
* removed finalizer and replaced with explicit call to image.free at end of block. If no block is used, user must call image.free at end of use
|
41
|
+
* above fixes memory leak.
|
42
|
+
* changed STR2CSTR() to StringValuePtr() in ruby_il.c
|
43
|
+
|
44
|
+
2009-10-28 John Mair (Banisterfiend)
|
45
|
+
* added IL::ConvertImage(IL::RGBA, IL::UNSIGNED_BYTE) to Devil#load; ensures that all image data is in the same format (image files only support RGB/UB and RGBA/UB so make them all RGBA/UB)
|
46
|
+
* changed compile-time conditional for the IL_LBM constant. now checks if IL_LBM is defined before it tries IL_ILBM
|
47
|
+
|
48
|
+
2009-10-25 John Mair (Banisterfiend)
|
49
|
+
version 0.1.8.5
|
50
|
+
* added hooks: prepare_image_hook, create_image_hook, load_image_hook
|
51
|
+
* e.g Devil.set_options :load_image_hook => proc { IL::ConvertImage(IL::RGBA, IL::UNSIGNED_BYTE) }
|
52
|
+
* added Devil.create_image() method for creating blank images (useful as a blitting canvas?)
|
53
|
+
* added :color parameter to create_image (to set background color of new image)
|
54
|
+
* added :in_profile and :out_profile to Devil.load_image and Devil.create_image
|
55
|
+
* color profiles do not appear to work! so not officially supported or documented.
|
56
|
+
* fixed gosu image flip bug
|
57
|
+
* added more tests and rdoc
|
58
|
+
|
59
|
+
2009-10-22 John Mair (Banisterfiend)
|
60
|
+
* added ESC exit from Devil::Image#show
|
61
|
+
* added optional :filter parameter to Devil::Image#thumbnail and Devil::Image#resize
|
62
|
+
|
63
|
+
2009-10-21 John Mair (Banisterfiend)
|
64
|
+
version 0.1.8
|
65
|
+
* made LANCZOS3 scaling filter the default for highquality thumbnails
|
66
|
+
* changed clear color to DevIL default (mother of pearl and full alpha)
|
67
|
+
* added blit function to HLA (high level API)
|
68
|
+
* added mirror, edge_detect, emboss, enlarge_canvas, etc to HLA
|
69
|
+
* added ILU_CENTER, ILU_LOWER_LEFT, ILU_PLACEMENT etc to LLA
|
70
|
+
* include ILU and IL modules in Devil::Image now
|
71
|
+
* made Devil::Image#show return self
|
72
|
+
* made Devil::Image#show use a dup of the image (so a 'snapshot' is taken of image)
|
73
|
+
* added Devil.set_options method to HLA
|
74
|
+
* refactored HLA to use an 'action' method, saved code duplication of set_binding/error_check etc.
|
75
|
+
|
76
|
+
2009-10-17 John Mair (Banisterfiend)
|
77
|
+
* ruby_il.c added:
|
78
|
+
* constants: IMAGE_DEPTH, ORIGIN_SET, CONV_PAL, CUR_IMAGE, ORIGIN_LOWER_LEFT, ORIGIN_LOWER_RIGHT
|
79
|
+
* methods: Disable, OriginFunc, ClearColour, ClearImage.
|
80
|
+
* Modified FromBlob method to restore old binding after use.
|
81
|
+
* ruby_ilu.c added:
|
82
|
+
* methods: EnlargeCanvas, EdgeDetectP, EdgeDetectS, Emboss, Mirror, SwapColours.
|
83
|
+
* Modified Crop to now take z-axis parameters. (stick to original API as closely as possible)
|
84
|
+
|
85
|
+
2009-10-15 John Mair (Banisterfiend)
|
86
|
+
* hopefully fixed compile errors on SnowLeopard!
|
87
|
+
* added error checking to Devil::load_image()
|
88
|
+
* added monkeypatch to Gosu::Image::new() to transparently load multiple formats
|
89
|
+
* updated some rdoc
|
90
|
+
|
91
|
+
2009-10-13 John Mair (Banisterfiend)
|
92
|
+
* version 0.1.6
|
93
|
+
* added Gosu and TexPlay interoperability
|
94
|
+
* ...bunch of other miscellaneous functionality
|
95
|
+
* released gem
|
96
|
+
|
97
|
+
2009-10-10 John Mair (Banisterfiend)
|
98
|
+
* constants added to ruby_il.c:
|
99
|
+
* IMAGE_WIDTH, IMAGE_HEIGHT, IMAGE_FORMAT, FILE_OVERWRITE
|
100
|
+
* functions added to ruby_il.c:
|
101
|
+
* ilEnable, ilGetInteger, ilConvertImage, ToBlob, ilCloneCurImage
|
102
|
+
* conditional compilation added to ruby_il.c for LBM constant
|
103
|
+
* functions added to ruby_ilu.c:
|
104
|
+
* ilFlipImage, ilRotate, ilCrop
|
105
|
+
* added Gosu and TexPlay interoperability
|
106
|
+
* ...bunch of other miscellaneous functionality
|
107
|
+
|
108
|
+
2009-10-06 John Mair (Banisterfiend)
|
109
|
+
* ruby 1.9 compatibility
|
110
|
+
|
111
|
+
2006-09-28 Jaroslaw Tworek <dev.jrx@gmail.com>
|
112
|
+
* Initial release
|
data/LICENSE
CHANGED
@@ -1,21 +1,21 @@
|
|
1
|
-
Copyright (C) 2006 Jaroslaw Tworek
|
2
|
-
Copyright (C) 2009 John Mair
|
3
|
-
|
4
|
-
This software is provided 'as-is', without any express or implied
|
5
|
-
warranty. In no event will the authors be held liable for any damages
|
6
|
-
arising from the use of this software.
|
7
|
-
|
8
|
-
Permission is granted to anyone to use this software for any purpose,
|
9
|
-
including commercial applications, and to alter it and redistribute it
|
10
|
-
freely, subject to the following restrictions:
|
11
|
-
|
12
|
-
1. The origin of this software must not be misrepresented; you must not
|
13
|
-
claim that you wrote the original software. If you use this software
|
14
|
-
in a product, an acknowledgment in the product documentation would be
|
15
|
-
appreciated but is not required.
|
16
|
-
2. Altered source versions must be plainly marked as such, and must not be
|
17
|
-
misrepresented as being the original software.
|
18
|
-
3. This notice may not be removed or altered from any source distribution.
|
19
|
-
|
20
|
-
Jaroslaw Tworek < dev.jrx@gmail.com >
|
21
|
-
John Mair, http://banisterfiend.wordpress.com
|
1
|
+
Copyright (C) 2006 Jaroslaw Tworek
|
2
|
+
Copyright (C) 2009 John Mair
|
3
|
+
|
4
|
+
This software is provided 'as-is', without any express or implied
|
5
|
+
warranty. In no event will the authors be held liable for any damages
|
6
|
+
arising from the use of this software.
|
7
|
+
|
8
|
+
Permission is granted to anyone to use this software for any purpose,
|
9
|
+
including commercial applications, and to alter it and redistribute it
|
10
|
+
freely, subject to the following restrictions:
|
11
|
+
|
12
|
+
1. The origin of this software must not be misrepresented; you must not
|
13
|
+
claim that you wrote the original software. If you use this software
|
14
|
+
in a product, an acknowledgment in the product documentation would be
|
15
|
+
appreciated but is not required.
|
16
|
+
2. Altered source versions must be plainly marked as such, and must not be
|
17
|
+
misrepresented as being the original software.
|
18
|
+
3. This notice may not be removed or altered from any source distribution.
|
19
|
+
|
20
|
+
Jaroslaw Tworek < dev.jrx@gmail.com >
|
21
|
+
John Mair, http://banisterfiend.wordpress.com
|
data/README
CHANGED
@@ -1,52 +1,52 @@
|
|
1
|
-
Ruby Devil version 0.1.9.
|
2
|
-
========================
|
3
|
-
|
4
|
-
* Original author: Jaroslaw Tworek <dev.jrx@gmail.com>
|
5
|
-
* Current maintainer: John Mair (banisterfiend) [http://banisterfiend.wordpress.com]
|
6
|
-
|
7
|
-
Ruby bindings for the Developer's Image Library
|
8
|
-
You need DevIL installed to use this extension
|
9
|
-
|
10
|
-
The Ruby Devil Project page is here: [http://github.com/banister/devil]
|
11
|
-
|
12
|
-
|
13
|
-
Installation Instructions:
|
14
|
-
==========================
|
15
|
-
|
16
|
-
For debian:
|
17
|
-
|
18
|
-
* install the libdevil and libdevil-dev packages
|
19
|
-
|
20
|
-
For Gentoo:
|
21
|
-
|
22
|
-
* emerge "media-libs/devil"
|
23
|
-
|
24
|
-
For windows:
|
25
|
-
|
26
|
-
* download devil-dlls.zip from [http://github.com/banister/devil/downloads]
|
27
|
-
* and copy the uncompressed files to c:\ruby\bin\
|
28
|
-
|
29
|
-
For macosx:
|
30
|
-
|
31
|
-
* sudo port install libdevil
|
32
|
-
|
33
|
-
For other systems:
|
34
|
-
|
35
|
-
* install libdevil and lib-devil-dev using your package manager
|
36
|
-
* OR download and install the libraries from [http://openil.sourceforge.net]
|
37
|
-
|
38
|
-
After you've installed the DevIL libraries you install the gem by going:
|
39
|
-
|
40
|
-
* gem install devil
|
41
|
-
|
42
|
-
If you wish to use the Gosu and TexPlay extensions, it is necessary to also have:
|
43
|
-
|
44
|
-
* the Gosu gem (gem install gosu)
|
45
|
-
* the TexPlay gem (gem install texplay)
|
46
|
-
* ruby-opengl (gem install ruby-opengl)
|
47
|
-
|
48
|
-
For now, there is support for just a subset of DevIL functions, but it is enough
|
49
|
-
for 95% things you may want to do.
|
50
|
-
|
51
|
-
For example uses, see test/ directory
|
52
|
-
(note: that many of the examples use the Gosu library...this is often just for visualization purposes. Alot of the functionality does not depend on Gosu being present)
|
1
|
+
Ruby Devil version 0.1.9.5
|
2
|
+
========================
|
3
|
+
|
4
|
+
* Original author: Jaroslaw Tworek <dev.jrx@gmail.com>
|
5
|
+
* Current maintainer: John Mair (banisterfiend) [http://banisterfiend.wordpress.com]
|
6
|
+
|
7
|
+
Ruby bindings for the Developer's Image Library
|
8
|
+
You need DevIL installed to use this extension
|
9
|
+
|
10
|
+
The Ruby Devil Project page is here: [http://github.com/banister/devil]
|
11
|
+
|
12
|
+
|
13
|
+
Installation Instructions:
|
14
|
+
==========================
|
15
|
+
|
16
|
+
For debian:
|
17
|
+
|
18
|
+
* install the libdevil and libdevil-dev packages
|
19
|
+
|
20
|
+
For Gentoo:
|
21
|
+
|
22
|
+
* emerge "media-libs/devil"
|
23
|
+
|
24
|
+
For windows:
|
25
|
+
|
26
|
+
* download devil-dlls.zip from [http://github.com/banister/devil/downloads]
|
27
|
+
* and copy the uncompressed files to c:\ruby\bin\
|
28
|
+
|
29
|
+
For macosx:
|
30
|
+
|
31
|
+
* sudo port install libdevil
|
32
|
+
|
33
|
+
For other systems:
|
34
|
+
|
35
|
+
* install libdevil and lib-devil-dev using your package manager
|
36
|
+
* OR download and install the libraries from [http://openil.sourceforge.net]
|
37
|
+
|
38
|
+
After you've installed the DevIL libraries you install the gem by going:
|
39
|
+
|
40
|
+
* gem install devil
|
41
|
+
|
42
|
+
If you wish to use the Gosu and TexPlay extensions, it is necessary to also have:
|
43
|
+
|
44
|
+
* the Gosu gem (gem install gosu)
|
45
|
+
* the TexPlay gem (gem install texplay)
|
46
|
+
* ruby-opengl (gem install ruby-opengl)
|
47
|
+
|
48
|
+
For now, there is support for just a subset of DevIL functions, but it is enough
|
49
|
+
for 95% things you may want to do.
|
50
|
+
|
51
|
+
For example uses, see test/ directory
|
52
|
+
(note: that many of the examples use the Gosu library...this is often just for visualization purposes. Alot of the functionality does not depend on Gosu being present)
|
data/Rakefile
CHANGED
@@ -1,76 +1,55 @@
|
|
1
|
-
require 'rake/clean'
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
require '
|
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
|
-
|
49
|
-
end
|
50
|
-
|
51
|
-
Rake::
|
52
|
-
|
53
|
-
|
54
|
-
end
|
55
|
-
|
56
|
-
task :compile => :clean
|
57
|
-
|
58
|
-
if RUBY_PLATFORM !~ /win32/
|
59
|
-
Rake::ExtensionTask.new('devil', spec) do |ext|
|
60
|
-
ext.config_script = 'extconf.rb'
|
61
|
-
ext.cross_compile = true
|
62
|
-
ext.cross_platform = 'i386-mswin32'
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
Rake::TestTask.new do |t|
|
67
|
-
t.libs << "lib"
|
68
|
-
t.test_files = FileList['test/test*.rb']
|
69
|
-
t.verbose = true
|
70
|
-
end
|
71
|
-
|
72
|
-
Rake::RDocTask.new do |rd|
|
73
|
-
rd.main = "README"
|
74
|
-
rd.rdoc_files.include("README", "lib/devil.rb", "lib/devil/gosu.rb", "lib/devil/version.rb")
|
75
|
-
end
|
76
|
-
|
1
|
+
require 'rake/clean'
|
2
|
+
require 'rake/gempackagetask'
|
3
|
+
require 'rake/testtask'
|
4
|
+
require 'rake/rdoctask'
|
5
|
+
|
6
|
+
# get the devil version
|
7
|
+
require './lib/devil/version'
|
8
|
+
dlext = Config::CONFIG['DLEXT']
|
9
|
+
|
10
|
+
CLEAN.include("ext/**/*.#{dlext}", "ext/**/.log", "ext/**/.o", "ext/**/*~", "ext/**/*#*", "ext/**/.obj", "ext/**/.def", "ext/**/.pdb")
|
11
|
+
CLOBBER.include("**/*.#{dlext}", "**/*~", "**/*#*", "**/*.log", "**/*.o", "doc/**")
|
12
|
+
|
13
|
+
spec = Gem::Specification.new do |s|
|
14
|
+
s.name = "devil"
|
15
|
+
s.summary = "Ruby bindings for DevIL cross platform image loading library"
|
16
|
+
s.description = s.summary
|
17
|
+
s.version = Devil::VERSION
|
18
|
+
s.author = "Jaroslaw Tworek, John Mair (banisterfiend)"
|
19
|
+
s.email = 'jrmair@gmail.com'
|
20
|
+
s.date = Time.now.strftime '%Y-%m-%d'
|
21
|
+
s.homepage = "http://banisterfiend.wordpress.com"
|
22
|
+
|
23
|
+
# s.platform = 'i386-mswin32'
|
24
|
+
s.platform = Gem::Platform::RUBY
|
25
|
+
|
26
|
+
s.extensions = FileList["ext/**/extconf.rb"]
|
27
|
+
|
28
|
+
s.has_rdoc = 'yard'
|
29
|
+
s.extra_rdoc_files = ["README"]
|
30
|
+
s.rdoc_options << '--main' << 'README'
|
31
|
+
s.files = ["Rakefile", "README", "CHANGELOG", "LICENSE", "lib/devil.rb", "lib/devil/gosu.rb", "lib/devil/version.rb"] +
|
32
|
+
FileList["ext/**/extconf.rb", "ext/**/*.h", "ext/**/*.c", "test/test*.rb", "test/*.png", "test/*.jpg"].to_a
|
33
|
+
|
34
|
+
#s.files += ["lib/1.8/devil.so", "lib/1.9/devil.so"]
|
35
|
+
end
|
36
|
+
|
37
|
+
Rake::GemPackageTask.new(spec) do |pkg|
|
38
|
+
pkg.need_zip = false
|
39
|
+
pkg.need_tar = false
|
40
|
+
end
|
41
|
+
|
42
|
+
task :compile => :clean
|
43
|
+
|
44
|
+
|
45
|
+
Rake::TestTask.new do |t|
|
46
|
+
t.libs << "lib"
|
47
|
+
t.test_files = FileList['test/test*.rb']
|
48
|
+
t.verbose = true
|
49
|
+
end
|
50
|
+
|
51
|
+
Rake::RDocTask.new do |rd|
|
52
|
+
rd.main = "README"
|
53
|
+
rd.rdoc_files.include("README", "lib/devil.rb", "lib/devil/gosu.rb", "lib/devil/version.rb")
|
54
|
+
end
|
55
|
+
|