rgd2-ffij 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. data/.gitignore +5 -0
  2. data/COPYING +340 -0
  3. data/COPYRIGHT +17 -0
  4. data/README +34 -0
  5. data/Rakefile +32 -0
  6. data/gd2-ffij.gemspec +96 -0
  7. data/lib/gd2-ffij.rb +215 -0
  8. data/lib/gd2/canvas.rb +422 -0
  9. data/lib/gd2/color.rb +240 -0
  10. data/lib/gd2/ffi_struct.rb +76 -0
  11. data/lib/gd2/font.rb +343 -0
  12. data/lib/gd2/image.rb +795 -0
  13. data/lib/gd2/palette.rb +253 -0
  14. data/test/canvas_test.rb +186 -0
  15. data/test/image_test.rb +149 -0
  16. data/test/images/test.bmp +0 -0
  17. data/test/images/test.gd +0 -0
  18. data/test/images/test.gd2 +0 -0
  19. data/test/images/test.gif +0 -0
  20. data/test/images/test.jpg +0 -0
  21. data/test/images/test.png +0 -0
  22. data/test/images/test.wbmp +0 -0
  23. data/test/images/test.xbm +686 -0
  24. data/test/images/test.xcf +0 -0
  25. data/test/images/test.xpm +261 -0
  26. data/test/images/test_arc.gd2 +0 -0
  27. data/test/images/test_canvas_filled_polygon.gd2 +0 -0
  28. data/test/images/test_canvas_filled_rectangle.gd2 +0 -0
  29. data/test/images/test_canvas_line.gd2 +0 -0
  30. data/test/images/test_canvas_move_to_and_line_to.gd2 +0 -0
  31. data/test/images/test_canvas_polygon.gd2 +0 -0
  32. data/test/images/test_canvas_rectangle.gd2 +0 -0
  33. data/test/images/test_circle.gd2 +0 -0
  34. data/test/images/test_color.gd2 +0 -0
  35. data/test/images/test_color.png +0 -0
  36. data/test/images/test_color.xcf +0 -0
  37. data/test/images/test_color_indexed.gd2 +0 -0
  38. data/test/images/test_color_sharpened.gd2 +0 -0
  39. data/test/images/test_cropped.gd2 +0 -0
  40. data/test/images/test_ellipse.gd2 +0 -0
  41. data/test/images/test_fill.gd2 +0 -0
  42. data/test/images/test_fill_to.gd2 +0 -0
  43. data/test/images/test_filled_circle.gd2 +0 -0
  44. data/test/images/test_filled_ellipse.gd2 +0 -0
  45. data/test/images/test_filled_wedge.gd2 +0 -0
  46. data/test/images/test_polar_transform.gd2 +0 -0
  47. data/test/images/test_resampled.gd2 +0 -0
  48. data/test/images/test_resized.gd2 +0 -0
  49. data/test/images/test_rotated_180.gd2 +0 -0
  50. data/test/images/test_text.gd2 +0 -0
  51. data/test/images/test_text_circle.gd2 +0 -0
  52. data/test/images/test_wedge.gd2 +0 -0
  53. data/test/test_helper.rb +13 -0
  54. data/vendor/fonts/ttf/DejaVuSans.ttf +0 -0
  55. data/vendor/fonts/ttf/LICENSE +99 -0
  56. metadata +123 -0
Binary file
@@ -0,0 +1,261 @@
1
+ /* XPM */
2
+ static char * test_xpm[] = {
3
+ "256 256 2 1",
4
+ " c None",
5
+ ". c #000000",
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
+ " ...... ...... ................ ...... ",
49
+ " ...... ...... ............ ...... ",
50
+ " ...... ...... .......... ...... ",
51
+ " ...... ...... ........ ...... ",
52
+ " ...... ...... ....... ...... ",
53
+ " ...... ...... ....... ...... ",
54
+ " ...... ...... ....... ...... ",
55
+ " ...... ...... ...... ...... ",
56
+ " ...... ...... ...... ...... ",
57
+ " ...... ...... ...... ...... ",
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
+ " ",
87
+ " ",
88
+ " ",
89
+ " ",
90
+ " ",
91
+ " ",
92
+ " ",
93
+ " ",
94
+ " ",
95
+ " ",
96
+ " ",
97
+ " ",
98
+ " ",
99
+ " ",
100
+ " ",
101
+ " ",
102
+ " ",
103
+ " ",
104
+ " ",
105
+ " ",
106
+ " ",
107
+ " ",
108
+ " ",
109
+ " ",
110
+ " ",
111
+ " ",
112
+ " ",
113
+ " ",
114
+ " ",
115
+ " ",
116
+ " ",
117
+ " ",
118
+ " .......... .......... ",
119
+ " ................. ................. ",
120
+ " ........................... ..................... ..................... ",
121
+ " ........................... ......................... ......................... ",
122
+ " ........................... ........................... ........................... ",
123
+ " ........................... .......... .......... .......... .......... ",
124
+ " ........................... ......... ......... ......... ......... ",
125
+ " ...... ........ ........ ........ ........ ",
126
+ " ...... ........ ........ ........ ........ ",
127
+ " ...... ....... ....... ....... ....... ",
128
+ " ...... ....... ....... ....... ....... ",
129
+ " ...... ...... ...... ...... ...... ",
130
+ " ...... ....... ....... ....... ....... ",
131
+ " ...... ...... ...... ...... ...... ",
132
+ " ...... ....... ....... ....... ....... ",
133
+ " ...... ...... ...... ...... ...... ",
134
+ " ...... ...... ...... ...... ...... ",
135
+ " ...... ...... ...... ...... ...... ",
136
+ " ...... ....... ....... ....... ....... ",
137
+ " ...... ...... ...... ...... ...... ",
138
+ " ...... ...... ...... ...... ...... ",
139
+ " ......................... ...... ...... ...... ...... ",
140
+ " ......................... ...... ...... ...... ...... ",
141
+ " ......................... ...... ...... ...... ...... ",
142
+ " ......................... ...... ...... ...... ...... ",
143
+ " ......................... ...... ...... ...... ...... ",
144
+ " ...... ...... ...... ...... ...... ",
145
+ " ...... ...... ...... ...... ...... ",
146
+ " ...... ...... ...... ...... ...... ",
147
+ " ...... ...... ...... ...... ...... ",
148
+ " ...... ....... ....... ....... ....... ",
149
+ " ...... ...... ...... ...... ...... ",
150
+ " ...... ...... ...... ...... ...... ",
151
+ " ...... ...... ...... ...... ...... ",
152
+ " ...... ....... ....... ....... ....... ",
153
+ " ...... ...... ...... ...... ...... ",
154
+ " ...... ....... ....... ....... ....... ",
155
+ " ...... ...... ...... ...... ...... ",
156
+ " ...... ....... ....... ....... ....... ",
157
+ " ...... ....... ....... ....... ....... ",
158
+ " ...... ........ ........ ........ ........ ",
159
+ " ...... ........ ........ ........ ........ ",
160
+ " ...... ......... ......... ......... ......... ",
161
+ " ...... .......... .......... .......... .......... ",
162
+ " ...... ........................... ........................... ",
163
+ " ...... ......................... ......................... ",
164
+ " ...... ..................... ..................... ",
165
+ " ...... ................. ................. ",
166
+ " ...... ........... ........... ",
167
+ " ",
168
+ " ",
169
+ " ",
170
+ " ",
171
+ " ",
172
+ " ",
173
+ " ",
174
+ " ",
175
+ " ",
176
+ " ",
177
+ " ",
178
+ " ",
179
+ " ",
180
+ " ",
181
+ " ",
182
+ " ",
183
+ " ",
184
+ " ",
185
+ " ",
186
+ " ",
187
+ " ",
188
+ " ",
189
+ " ",
190
+ " ",
191
+ " ",
192
+ " ",
193
+ " ",
194
+ " ",
195
+ " ",
196
+ " ",
197
+ " ",
198
+ " ",
199
+ " ",
200
+ " ",
201
+ " ",
202
+ " ",
203
+ " ",
204
+ " ",
205
+ " ",
206
+ " ",
207
+ " ",
208
+ " ",
209
+ " .................... ........ ................... ",
210
+ " ........................ ........ ....................... ",
211
+ " .......................... ......... ......................... ",
212
+ " ........................... .......... .......................... ",
213
+ " ............................ .......... ........................... ",
214
+ " ...... ......... ............ ...... .......... ",
215
+ " ...... ........ ............ ...... ....... ",
216
+ " ...... ....... ...... ...... ...... ....... ",
217
+ " ...... ....... ...... ...... ...... ...... ",
218
+ " ...... ....... ...... ...... ...... ....... ",
219
+ " ...... ...... ...... ...... ...... ...... ",
220
+ " ...... ...... ...... ...... ...... ...... ",
221
+ " ...... ...... ...... ...... ...... ...... ",
222
+ " ...... ...... ...... ....... ...... ...... ",
223
+ " ...... ...... ...... ...... ...... ...... ",
224
+ " ...... ....... ....... ...... ...... ...... ",
225
+ " ...... ...... ...... ...... ...... ...... ",
226
+ " ...... ....... ...... ...... ...... ....... ",
227
+ " ...... ....... ....... ...... ...... ...... ",
228
+ " ...... ......... ...... ...... ...... ....... ",
229
+ " ............................ ...... ...... ...... ....... ",
230
+ " .......................... ...... ....... ...... ......... ",
231
+ " ........................ ...... ...... ........................... ",
232
+ " ........................... ....... ...... .......................... ",
233
+ " ............................ ...... ....... ........................ ",
234
+ " ...... ......... ...... ...... ........................ ",
235
+ " ...... ........ ....... ...... ......................... ",
236
+ " ...... ...... ...... ...... ...... ......... ",
237
+ " ...... ...... ...... ...... ...... ........ ",
238
+ " ...... ...... ....... ....... ...... ....... ",
239
+ " ...... ...... .............................. ...... ....... ",
240
+ " ...... ...... ............................... ...... ....... ",
241
+ " ...... ...... ................................ ...... ....... ",
242
+ " ...... ...... ................................ ...... ....... ",
243
+ " ...... ...... .................................. ...... ....... ",
244
+ " ...... ...... ...... ...... ...... ....... ",
245
+ " ...... ...... ....... ...... ...... ....... ",
246
+ " ...... ....... ....... ....... ...... ....... ",
247
+ " ...... ...... ...... ...... ...... ....... ",
248
+ " ...... ....... ....... ...... ...... ....... ",
249
+ " ...... ....... ...... ....... ...... ....... ",
250
+ " ...... .......... ...... ...... ...... ....... ",
251
+ " .............................. ....... ....... ...... ....... ",
252
+ " ............................. ...... ....... ...... ....... ",
253
+ " ........................... ....... ...... ...... ....... ",
254
+ " ......................... ....... ....... ...... ...... ",
255
+ " ...................... ...... ...... ...... ....... ",
256
+ " ",
257
+ " ",
258
+ " ",
259
+ " ",
260
+ " ",
261
+ " "};
Binary file
Binary file
Binary file
@@ -0,0 +1,13 @@
1
+
2
+ module TestHelper
3
+ PATH_TO_IMAGES = File.join(File.dirname(__FILE__), 'images')
4
+ PATH_TO_FONT = File.join(File.dirname(__FILE__), '..', 'vendor', 'fonts', 'ttf', 'DejaVuSans.ttf')
5
+
6
+ def new_image
7
+ GD2::Image.new(256, 256)
8
+ end
9
+
10
+ def load_image(file_name)
11
+ GD2::Image.load(File.read(File.join(PATH_TO_IMAGES, file_name)))
12
+ end
13
+ end
@@ -0,0 +1,99 @@
1
+ Fonts are (c) Bitstream (see below). DejaVu changes are in public domain.
2
+ Glyphs imported from Arev fonts are (c) Tavmjong Bah (see below)
3
+
4
+ Bitstream Vera Fonts Copyright
5
+ ------------------------------
6
+
7
+ Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is
8
+ a trademark of Bitstream, Inc.
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of the fonts accompanying this license ("Fonts") and associated
12
+ documentation files (the "Font Software"), to reproduce and distribute the
13
+ Font Software, including without limitation the rights to use, copy, merge,
14
+ publish, distribute, and/or sell copies of the Font Software, and to permit
15
+ persons to whom the Font Software is furnished to do so, subject to the
16
+ following conditions:
17
+
18
+ The above copyright and trademark notices and this permission notice shall
19
+ be included in all copies of one or more of the Font Software typefaces.
20
+
21
+ The Font Software may be modified, altered, or added to, and in particular
22
+ the designs of glyphs or characters in the Fonts may be modified and
23
+ additional glyphs or characters may be added to the Fonts, only if the fonts
24
+ are renamed to names not containing either the words "Bitstream" or the word
25
+ "Vera".
26
+
27
+ This License becomes null and void to the extent applicable to Fonts or Font
28
+ Software that has been modified and is distributed under the "Bitstream
29
+ Vera" names.
30
+
31
+ The Font Software may be sold as part of a larger software package but no
32
+ copy of one or more of the Font Software typefaces may be sold by itself.
33
+
34
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
35
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY,
36
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT,
37
+ TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME
38
+ FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING
39
+ ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
40
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
41
+ THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE
42
+ FONT SOFTWARE.
43
+
44
+ Except as contained in this notice, the names of Gnome, the Gnome
45
+ Foundation, and Bitstream Inc., shall not be used in advertising or
46
+ otherwise to promote the sale, use or other dealings in this Font Software
47
+ without prior written authorization from the Gnome Foundation or Bitstream
48
+ Inc., respectively. For further information, contact: fonts at gnome dot
49
+ org.
50
+
51
+ Arev Fonts Copyright
52
+ ------------------------------
53
+
54
+ Copyright (c) 2006 by Tavmjong Bah. All Rights Reserved.
55
+
56
+ Permission is hereby granted, free of charge, to any person obtaining
57
+ a copy of the fonts accompanying this license ("Fonts") and
58
+ associated documentation files (the "Font Software"), to reproduce
59
+ and distribute the modifications to the Bitstream Vera Font Software,
60
+ including without limitation the rights to use, copy, merge, publish,
61
+ distribute, and/or sell copies of the Font Software, and to permit
62
+ persons to whom the Font Software is furnished to do so, subject to
63
+ the following conditions:
64
+
65
+ The above copyright and trademark notices and this permission notice
66
+ shall be included in all copies of one or more of the Font Software
67
+ typefaces.
68
+
69
+ The Font Software may be modified, altered, or added to, and in
70
+ particular the designs of glyphs or characters in the Fonts may be
71
+ modified and additional glyphs or characters may be added to the
72
+ Fonts, only if the fonts are renamed to names not containing either
73
+ the words "Tavmjong Bah" or the word "Arev".
74
+
75
+ This License becomes null and void to the extent applicable to Fonts
76
+ or Font Software that has been modified and is distributed under the
77
+ "Tavmjong Bah Arev" names.
78
+
79
+ The Font Software may be sold as part of a larger software package but
80
+ no copy of one or more of the Font Software typefaces may be sold by
81
+ itself.
82
+
83
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
84
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
85
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
86
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL
87
+ TAVMJONG BAH BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
88
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
89
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
90
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
91
+ OTHER DEALINGS IN THE FONT SOFTWARE.
92
+
93
+ Except as contained in this notice, the name of Tavmjong Bah shall not
94
+ be used in advertising or otherwise to promote the sale, use or other
95
+ dealings in this Font Software without prior written authorization
96
+ from Tavmjong Bah. For further information, contact: tavmjong @ free
97
+ . fr.
98
+
99
+ $Id: LICENSE 2133 2007-11-28 02:46:28Z lechimp $
metadata ADDED
@@ -0,0 +1,123 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rgd2-ffij
3
+ version: !ruby/object:Gem::Version
4
+ hash: 25
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 3
10
+ version: 0.0.3
11
+ platform: ruby
12
+ authors:
13
+ - Amar Daxini
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2010-11-10 00:00:00 +05:30
19
+ default_executable:
20
+ dependencies: []
21
+
22
+ description: gd2-ffij is a refactoring of the Ruby/GD2 library implemented with FFI
23
+ email: amardaxini@gmail.com
24
+ executables: []
25
+
26
+ extensions: []
27
+
28
+ extra_rdoc_files:
29
+ - README
30
+ files:
31
+ - .gitignore
32
+ - COPYING
33
+ - COPYRIGHT
34
+ - README
35
+ - Rakefile
36
+ - gd2-ffij.gemspec
37
+ - lib/gd2-ffij.rb
38
+ - lib/gd2/canvas.rb
39
+ - lib/gd2/color.rb
40
+ - lib/gd2/ffi_struct.rb
41
+ - lib/gd2/font.rb
42
+ - lib/gd2/image.rb
43
+ - lib/gd2/palette.rb
44
+ - test/canvas_test.rb
45
+ - test/image_test.rb
46
+ - test/images/test.bmp
47
+ - test/images/test.gd
48
+ - test/images/test.gd2
49
+ - test/images/test.gif
50
+ - test/images/test.jpg
51
+ - test/images/test.png
52
+ - test/images/test.wbmp
53
+ - test/images/test.xbm
54
+ - test/images/test.xcf
55
+ - test/images/test.xpm
56
+ - test/images/test_arc.gd2
57
+ - test/images/test_canvas_filled_polygon.gd2
58
+ - test/images/test_canvas_filled_rectangle.gd2
59
+ - test/images/test_canvas_line.gd2
60
+ - test/images/test_canvas_move_to_and_line_to.gd2
61
+ - test/images/test_canvas_polygon.gd2
62
+ - test/images/test_canvas_rectangle.gd2
63
+ - test/images/test_circle.gd2
64
+ - test/images/test_color.gd2
65
+ - test/images/test_color.png
66
+ - test/images/test_color.xcf
67
+ - test/images/test_color_indexed.gd2
68
+ - test/images/test_color_sharpened.gd2
69
+ - test/images/test_cropped.gd2
70
+ - test/images/test_ellipse.gd2
71
+ - test/images/test_fill.gd2
72
+ - test/images/test_fill_to.gd2
73
+ - test/images/test_filled_circle.gd2
74
+ - test/images/test_filled_ellipse.gd2
75
+ - test/images/test_filled_wedge.gd2
76
+ - test/images/test_polar_transform.gd2
77
+ - test/images/test_resampled.gd2
78
+ - test/images/test_resized.gd2
79
+ - test/images/test_rotated_180.gd2
80
+ - test/images/test_text.gd2
81
+ - test/images/test_text_circle.gd2
82
+ - test/images/test_wedge.gd2
83
+ - test/test_helper.rb
84
+ - vendor/fonts/ttf/DejaVuSans.ttf
85
+ - vendor/fonts/ttf/LICENSE
86
+ has_rdoc: true
87
+ homepage: http://github.com/amardaxini/gd2-ffij
88
+ licenses: []
89
+
90
+ post_install_message:
91
+ rdoc_options:
92
+ - --charset=UTF-8
93
+ require_paths:
94
+ - lib
95
+ required_ruby_version: !ruby/object:Gem::Requirement
96
+ none: false
97
+ requirements:
98
+ - - ">="
99
+ - !ruby/object:Gem::Version
100
+ hash: 3
101
+ segments:
102
+ - 0
103
+ version: "0"
104
+ required_rubygems_version: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ hash: 3
110
+ segments:
111
+ - 0
112
+ version: "0"
113
+ requirements: []
114
+
115
+ rubyforge_project:
116
+ rubygems_version: 1.3.7
117
+ signing_key:
118
+ specification_version: 3
119
+ summary: gd2-ffij is a refactoring of the Ruby/GD2 library implemented with FFI
120
+ test_files:
121
+ - test/canvas_test.rb
122
+ - test/image_test.rb
123
+ - test/test_helper.rb