Raster graphics operations/Ruby: Difference between revisions

m
→‎The Code: improve iterat
m (→‎The Code: add each_pixel iterator)
m (→‎The Code: improve iterat)
Line 115:
 
def each_pixel
if block_given?
@height.times {|y| @width.times {|x| yield x,y}}
else
to_enum(:each_pixel)
end
end
 
Anonymous user