imageruby 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +2 -0
- data/Rakefile +1 -1
- data/lib/imageruby/bitmap/rbbitmap.rb +8 -8
- data/lib/imageruby/color.rb +5 -3
- metadata +4 -4
data/CHANGELOG
CHANGED
data/Rakefile
CHANGED
@@ -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
|
data/lib/imageruby/color.rb
CHANGED
@@ -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
|
-
|
170
|
-
|
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:
|
4
|
+
hash: 21
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
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-
|
18
|
+
date: 2011-05-19 00:00:00 -03:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|