imageruby 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,5 @@
1
+ 0.2.1 Fixed compatibility with ruby 1.9 on bitmap representation (Thanks amadanmath!)
2
+
1
3
  0.2.0 Added persistor and loaders
2
4
 
3
5
  Added more examples
data/Rakefile CHANGED
@@ -6,7 +6,7 @@ require 'rake/gempackagetask'
6
6
 
7
7
  spec = Gem::Specification.new do |s|
8
8
  s.name = 'imageruby'
9
- s.version = '0.2.0'
9
+ s.version = '0.2.1'
10
10
  s.author = 'Dario Seminara'
11
11
  s.email = 'robertodarioseminara@gmail.com'
12
12
  s.platform = Gem::Platform::RUBY
@@ -41,10 +41,10 @@ module ImageRuby
41
41
  index = (y*@width + x)
42
42
  pointindex = index*3
43
43
  Color.from_rgba(
44
- @array[pointindex+2],
45
- @array[pointindex+1],
46
- @array[pointindex],
47
- @alpha ? @alpha[index] : 255
44
+ @array[pointindex+2].ord,
45
+ @array[pointindex+1].ord,
46
+ @array[pointindex].ord,
47
+ @alpha ? @alpha[index].ord : 255
48
48
  )
49
49
 
50
50
  end
@@ -66,13 +66,13 @@ module ImageRuby
66
66
 
67
67
  index = (y*@width + x)
68
68
  pointindex = index*3
69
- @array[pointindex+2] = color.r
70
- @array[pointindex+1] = color.g
71
- @array[pointindex] = color.b
69
+ @array[pointindex+2] = color.r.chr
70
+ @array[pointindex+1] = color.g.chr
71
+ @array[pointindex] = color.b.chr
72
72
 
73
73
  if color.a != 255 then
74
74
  @alpha = "\xff"*(@height * @width) unless @alpha
75
- @alpha[index] = color.a
75
+ @alpha[index] = color.a.chr
76
76
  end
77
77
 
78
78
  self
@@ -164,9 +164,11 @@ module ImageRuby
164
164
  "olive" => [0x80,0x80,0], "lime" => [0,0xff,0], "aqua" => [0, 0xff, 0xff],
165
165
  "teal" => [0, 0x80, 0x80], "navy" => [0,0,0x80], "fuchsia" => [0xff,0x00,0xff],
166
166
  "purple" => [0x80,0,0x80], "orange" => [0xff, 0xa5, 0]
167
- end
168
167
 
169
- def to_s
170
- b.chr + g.chr + r.chr
168
+ def to_s
169
+ self.b.chr + self.g.chr + self.r.chr
170
+ end
171
+
171
172
  end
173
+
172
174
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: imageruby
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 0
10
- version: 0.2.0
9
+ - 1
10
+ version: 0.2.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Dario Seminara
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-05-13 00:00:00 -03:00
18
+ date: 2011-05-19 00:00:00 -03:00
19
19
  default_executable:
20
20
  dependencies: []
21
21