Method: Vips::SourceCustom#on_seek

Defined in:
lib/vips/sourcecustom.rb

#on_seek {|offset, whence| ... } ⇒ Object

The block is executed to seek the source. The interface is exactly as IO::seek, ie. it should take an offset and whence, and return the new read position.

This handler is optional -- if you do not attach a seek handler, Vips::Source will treat your source like an unseekable pipe object and do extra caching.

Yield Parameters:

  • offset (Integer)

    Seek offset

  • whence (Integer)

    Seek whence

Yield Returns:

  • (Integer)

    the new read position, or -1 on error



83
84
85
86
87
# File 'lib/vips/sourcecustom.rb', line 83

def on_seek &block
  signal_connect "seek" do |offset, whence|
    block.call offset, whence
  end
end