class ChunkyPNG::Canvas

def assert_size!(matrix_width, matrix_height)

Throws an exception if the matrix width and height does not match this canvas' dimensions.
def assert_size!(matrix_width, matrix_height)
  if width  != matrix_width
    raise ChunkyPNG::ExpectationFailed,
      'The width of the matrix does not match the canvas width!'
  end
  if height != matrix_height
    raise ChunkyPNG::ExpectationFailed,
      'The height of the matrix does not match the canvas height!'
  end
  true
end