Class: ZPNG::Pixels
Instance Method Summary collapse
- #==(other) ⇒ Object
- #each ⇒ Object
-
#initialize(image) ⇒ Pixels
constructor
A new instance of Pixels.
- #uniq ⇒ Object
Constructor Details
#initialize(image) ⇒ Pixels
Returns a new instance of Pixels.
5 6 7 |
# File 'lib/zpng/pixels.rb', line 5 def initialize image @image = image end |
Instance Method Details
#==(other) ⇒ Object
17 18 19 |
# File 'lib/zpng/pixels.rb', line 17 def == other self.to_a == other.to_a end |
#each ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/zpng/pixels.rb', line 9 def each @image.height.times do |y| @image.width.times do |x| yield @image[x,y] end end end |
#uniq ⇒ Object
21 22 23 |
# File 'lib/zpng/pixels.rb', line 21 def uniq self.to_a.uniq end |