# File lib/gd2/image.rb, line 327 def each # optimize for speed get_pixel = SYM[:gdImageGetPixel] ptr = image_ptr (0...height).each do |y| row = (0...width).inject(Array.new(width)) do |row, x| row[x] = get_pixel.call(ptr, x, y).at(0) row end yield row end end