Vips.SourceCustom

g GObject.Object GObject.Object Vips.Object Vips.Object GObject.Object->Vips.Object Vips.Connection Vips.Connection Vips.Source Vips.Source Vips.Connection->Vips.Source Vips.Object->Vips.Connection Vips.SourceCustom Vips.SourceCustom Vips.Source->Vips.SourceCustom

Subclasses:

None

Methods

Inherited:

Vips.Source (19), Vips.Connection (2), Vips.Object (27), GObject.Object (37)

Structs:

Vips.ObjectClass (1), GObject.ObjectClass (5)

class

new ()

Virtual Methods

Inherited:

Vips.Source (2), Vips.Object (9), GObject.Object (7)

do_read (buffer, length)

do_seek (offset, whence)

Properties

Inherited:

Vips.Source (1), Vips.Connection (2), Vips.Object (2)

Signals

Inherited:

Vips.Object (4), GObject.Object (1)

Name

Short Description

read

This signal is emitted to read bytes from the source into buffer.

seek

This signal is emitted to seek the source.

Fields

Inherited:

Vips.Object (4), GObject.Object (1)

Name

Type

Access

Description

parent_object

Vips.Source

r

Class Details

class Vips.SourceCustom(**kwargs)
Bases:

Vips.Source

Abstract:

No

Structure:

Vips.SourceCustomClass

Subclass of [class`Source`] with action signals for handlers.

This is supposed to be useful for language bindings.

classmethod new()
Returns:

a new [class`SourceCustom`]

Return type:

Vips.SourceCustom

Create a [class`SourceCustom`]. Attach signals to implement read and seek.

do_read(buffer, length) virtual
Parameters:
Return type:

int

do_seek(offset, whence) virtual
Parameters:
  • offset (int) –

  • whence (int) –

Return type:

int

Signal Details

Vips.SourceCustom.signals.read(source_custom, buffer, size)
Signal Name:

read

Flags:

ACTION

Parameters:
  • source_custom (Vips.SourceCustom) – The object which received the signal

  • buffer (object or None) – gpointer, buffer to fill

  • size (int) – gint64, size of buffer

Returns:

the number of bytes read. Return 0 for EOF.

Return type:

int

This signal is emitted to read bytes from the source into buffer.

Vips.SourceCustom.signals.seek(source_custom, offset, whence)
Signal Name:

seek

Flags:

ACTION

Parameters:
  • source_custom (Vips.SourceCustom) – The object which received the signal

  • offset (int) – gint64, seek offset

  • whence (int) – gint, seek origin

Returns:

the new seek position.

Return type:

int

This signal is emitted to seek the source. The handler should change the source position appropriately.

The handler for an unseekable source should always return -1.