Class: Rays::Bitmap
Instance Method Summary collapse
Instance Method Details
#bounds ⇒ Object
26 27 28 |
# File 'lib/rays/bitmap.rb', line 26 def bounds() Bounds.new 0, 0, width, height end |
#each ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/rays/bitmap.rb', line 11 def each() height.times do |y| width.times do |x| yield self[x, y], x, y end end end |
#pixels ⇒ Object
19 20 21 22 23 24 |
# File 'lib/rays/bitmap.rb', line 19 def pixels() case o = pixels! when Array then o when String then o.unpack 'L*' end end |
#to_a ⇒ Object
30 31 32 |
# File 'lib/rays/bitmap.rb', line 30 def to_a() map {|o| o} end |