Vips.TargetCustom

g GObject.Object GObject.Object Vips.Object Vips.Object GObject.Object->Vips.Object Vips.Connection Vips.Connection Vips.Target Vips.Target Vips.Connection->Vips.Target Vips.Object->Vips.Connection Vips.TargetCustom Vips.TargetCustom Vips.Target->Vips.TargetCustom

Subclasses:

None

Methods

Inherited:

Vips.Target (13), Vips.Connection (2), Vips.Object (27), GObject.Object (37)

Structs:

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

class

new ()

Virtual Methods

Inherited:

Vips.Target (5), Vips.Object (9), GObject.Object (7)

do_end ()

do_finish ()

do_read (buffer, length)

do_seek (offset, whence)

do_write (data, length)

Properties

Inherited:

Vips.Target (2), Vips.Connection (2), Vips.Object (2)

Signals

Inherited:

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

Name

Short Description

end

This signal is emitted at the end of write.

finish

Deprecated for [signal`TargetCustom`:py:func:::end<Vips.TargetCustom.signals.end>].

read

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

seek

This signal is emitted to seek the target.

write

This signal is emitted to write bytes to the target.

Fields

Inherited:

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

Name

Type

Access

Description

parent_object

Vips.Target

r

Class Details

class Vips.TargetCustom(**kwargs)
Bases:

Vips.Target

Abstract:

No

Structure:

Vips.TargetCustomClass

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

This is supposed to be useful for language bindings.

classmethod new()
Returns:

a new [class`TargetCustom`]

Return type:

Vips.TargetCustom

Create a [class`TargetCustom`]. Attach signals to implement write and finish.

do_end() virtual
Return type:

int

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

int

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

  • whence (int) –

Return type:

int

do_write(data, length) virtual
Parameters:
Return type:

int

Signal Details

Vips.TargetCustom.signals.end(target_custom)
Signal Name:

end

Flags:

ACTION

Parameters:

target_custom (Vips.TargetCustom) – The object which received the signal

Returns:

0 on success, -1 on error.

Return type:

int

This signal is emitted at the end of write. The target should do any finishing necessary.

Vips.TargetCustom.signals.finish(target_custom)
Signal Name:

finish

Flags:

ACTION

Parameters:

target_custom (Vips.TargetCustom) – The object which received the signal

Deprecated for [signal`TargetCustom`:py:func:::end<Vips.TargetCustom.signals.end>].

Vips.TargetCustom.signals.read(target_custom, buffer, size)
Signal Name:

read

Flags:

ACTION

Parameters:
  • target_custom (Vips.TargetCustom) – 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 target into buffer.

The handler for an unreadable target should always return -1.

Vips.TargetCustom.signals.seek(target_custom, offset, whence)
Signal Name:

seek

Flags:

ACTION

Parameters:
  • target_custom (Vips.TargetCustom) – 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 target. The handler should change the target position appropriately.

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

Vips.TargetCustom.signals.write(target_custom, data, length)
Signal Name:

write

Flags:

ACTION

Parameters:
  • target_custom (Vips.TargetCustom) – The object which received the signal

  • data (object or None) – gpointer, bytes to write

  • length (int) – gint64, number of bytes

Returns:

the number of bytes written.

Return type:

int

This signal is emitted to write bytes to the target.