class Vips::Region

def fetch(left, top, width, height)

Fetch a region filled with pixel data.
def fetch(left, top, width, height)
  len = Vips::SizeStruct.new
  ptr = Vips.vips_region_fetch self, left, top, width, height, len
  raise Vips::Error if ptr.null?
  # wrap up as an autopointer
  ptr = FFI::AutoPointer.new(ptr, GLib::G_FREE)
  ptr.get_bytes 0, len[:value]
end