class ChunkyPNG::Canvas

def [](*args)

Other tags:
    See: #get_pixel -

Raises:
  • (ChunkyPNG::OutOfBounds) - when the coordinates are outside of the image's dimensions.

Returns:
  • (Integer) - The current color value at the provided coordinates.
  • (Integer) - The current color value at the provided coordinates.

Parameters:
  • y (Integer) -- The y-coordinate of the pixel (row)
  • x (Integer) -- The x-coordinate of the pixel (column)
  • point (ChunkyPNG::Point, ...) -- The coordinates of the pixel as point.

Overloads:
  • [](x, y)
  • [](point)
def [](*args)
  point = ChunkyPNG::Point(*args)
  assert_xy!(point.x, point.y)
  @pixels[point.y * width + point.x]
end