Method: Vips::Region#fetch

Defined in:
lib/vips/region.rb

#fetch(left, top, width, height) ⇒ Object

Fetch a region filled with pixel data.

Raises:

[View source]

62
63
64
65
66
67
68
69
70
71
# File 'lib/vips/region.rb', line 62

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