# File lib/pixels.rb, line 382
382:     def row_offset(y)
383:       if y < 0 or y >= @height
384:         raise ArgumentError.new("y-coordinate #{y} out of range")
385:       end
386: 
387:       # Flip the vertical axis when (0, 0) is in the lower-left
388:       # corner of the image.
389:       if @origin == :LOWER_LEFT
390:         y = (@height-1) - y
391:       end
392: 
393:       return @image_data_offset + @bytes_per_row * y
394:     end