Aravis.Buffer

g Aravis.Buffer Aravis.Buffer GObject.Object GObject.Object GObject.Object->Aravis.Buffer

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (size, preallocated)

class

new_allocate (size)

class

new_full (size, preallocated, user_data, user_data_destroy_func)

find_component (component_id)

get_chunk_data (chunk_id)

get_data ()

get_frame_id ()

get_image_data ()

get_image_height ()

get_image_padding ()

get_image_pixel_format ()

get_image_region ()

get_image_width ()

get_image_x ()

get_image_y ()

get_n_parts ()

get_part_component_id (part_id)

get_part_data (part_id)

get_part_data_type (part_id)

get_part_height (part_id)

get_part_padding (part_id)

get_part_pixel_format (part_id)

get_part_region (part_id)

get_part_width (part_id)

get_part_x (part_id)

get_part_y (part_id)

get_payload_type ()

get_status ()

get_system_timestamp ()

get_timestamp ()

get_user_data ()

has_chunks ()

set_frame_id (frame_id)

set_system_timestamp (timestamp_ns)

set_timestamp (timestamp_ns)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

None

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class Aravis.Buffer(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Aravis.BufferClass

[class`ArvBuffer`] provides a class for the instantiation of buffers used for the storage of the separate images of the video stream.

The actual data space may either be allocated by [class`ArvBuffer`] during an object instantiation, of pre-allocated. [class`ArvBuffer`] also allows the transmission of image metadata, such as offsets and size of the transmitted region of interest, pixel format and time stamp.

classmethod new(size, preallocated)
Parameters:
  • size (int) – payload size

  • preallocated (object or None) – preallocated memory buffer

Returns:

a new Aravis.Buffer object

Return type:

Aravis.Buffer

Creates a new buffer for the storage of the video stream images. The data space can be either preallocated, and the caller is responsible for it’s deallocation, or allocated by this function. If it is the case, data memory will be freed when the buffer is destroyed.

New in version 0.2.0.

classmethod new_allocate(size)
Parameters:

size (int) – payload size

Returns:

a new Aravis.Buffer object

Return type:

Aravis.Buffer

Creates a new buffer for the storage of the video stream images. The data space is allocated by this function, and will be freed when the buffer is destroyed.

New in version 0.2.3.

classmethod new_full(size, preallocated, user_data, user_data_destroy_func)
Parameters:
  • size (int) – payload size

  • preallocated (object or None) – preallocated memory buffer

  • user_data (object or None) – a pointer to user data associated to this buffer

  • user_data_destroy_func (GLib.DestroyNotify or None) – an optional user data destroy callback

Returns:

a new [class`ArvBuffer`] object

Return type:

Aravis.Buffer

Creates a new buffer for the storage of the video stream images. The data space can be either preallocated, and the caller is responsible for it’s deallocation, or allocated by this function. If it is the case, data memory will be freed when the buffer is destroyed.

If user_data_destroy_func is non None, it will be called in order to destroy user_data when the buffer is destroyed.

New in version 0.2.0.

find_component(component_id)
Parameters:

component_id (int) – the component id to find

Returns:

the corresponding part id, -1 if not found.

Return type:

int

Search for the part corresponding to component_id

New in version 0.8.25.

get_chunk_data(chunk_id)
Parameters:

chunk_id (int) – chunk id

Returns:

a pointer to the chunk data.

Return type:

bytes

Chunk data accessor.

New in version 0.4.0.

get_data()
Returns:

a pointer to the buffer data.

Return type:

bytes

Buffer data accessor.

New in version 0.4.0.

get_frame_id()
Returns:

frame id, 0 on error.

Return type:

int

Gets the buffer frame id. For GigEVision devices, 0 is an invalid value.

New in version 0.8.0.

get_image_data()
Returns:

a pointer to the image data.

Return type:

bytes

New in version 0.8.25.

get_image_height()
Returns:

image height, in pixels.

Return type:

int

Gets the image width.

This function must only be called if buffer payload is either Aravis.BufferPayloadType.IMAGE, Aravis.BufferPayloadType.EXTENDED_CHUNK_DATA or Aravis.BufferPayloadType.MULTIPART.

New in version 0.4.0.

get_image_padding()
Returns:

x_padding:

image x offset placeholder

y_padding:

image y offset placeholder

Return type:

(x_padding: int, y_padding: int)

Gets the image padding.

This function must only be called if buffer payload is either Aravis.BufferPayloadType.IMAGE, Aravis.BufferPayloadType.EXTENDED_CHUNK_DATA or Aravis.BufferPayloadType.MULTIPART.

New in version 0.8.23.

get_image_pixel_format()
Returns:

image pixel format.

Return type:

int

Gets the image pixel format.

This function must only be called if buffer payload is either Aravis.BufferPayloadType.IMAGE, Aravis.BufferPayloadType.EXTENDED_CHUNK_DATA or Aravis.BufferPayloadType.MULTIPART.

New in version 0.4.0.

get_image_region()
Returns:

x:

image x offset placeholder

y:

image y offset placeholder

width:

image width placholder

height:

image height placeholder

Return type:

(x: int, y: int, width: int, height: int)

Gets the image region.

This function must only be called if buffer payload is either Aravis.BufferPayloadType.IMAGE, Aravis.BufferPayloadType.EXTENDED_CHUNK_DATA or Aravis.BufferPayloadType.MULTIPART.

New in version 0.4.0.

get_image_width()
Returns:

image width, in pixels.

Return type:

int

Gets the image width.

This function must only be called if buffer payload is either Aravis.BufferPayloadType.IMAGE, Aravis.BufferPayloadType.EXTENDED_CHUNK_DATA or Aravis.BufferPayloadType.MULTIPART.

New in version 0.4.0.

get_image_x()
Returns:

image x offset, in pixels.

Return type:

int

Gets the image x offset.

This function must only be called if buffer payload is either Aravis.BufferPayloadType.IMAGE, Aravis.BufferPayloadType.EXTENDED_CHUNK_DATA or Aravis.BufferPayloadType.MULTIPART.

New in version 0.4.0.

get_image_y()
Returns:

image y offset, in pixels.

Return type:

int

Gets the image y offset.

This function must only be called if buffer payload is either Aravis.BufferPayloadType.IMAGE, Aravis.BufferPayloadType.EXTENDED_CHUNK_DATA or Aravis.BufferPayloadType.MULTIPART.

New in version 0.4.0.

get_n_parts()
Returns:

the number of part in the buffer.

Return type:

int

New in version 0.8.23.

get_part_component_id(part_id)
Parameters:

part_id (int) – part id

Returns:

the part component id value

Return type:

int

New in version 0.8.25.

get_part_data(part_id)
Parameters:

part_id (int) – part id

Returns:

a pointer to the part data.

Return type:

bytes

New in version 0.8.23.

get_part_data_type(part_id)
Parameters:

part_id (int) – part id

Returns:

the part Aravis.BufferPartDataType

Return type:

Aravis.BufferPartDataType

New in version 0.8.23.

get_part_height(part_id)
Parameters:

part_id (int) – a part id

Returns:

height, in pixels.

Return type:

int

Gets the part height.

This function must only be called if buffer payload is either Aravis.BufferPayloadType.IMAGE, Aravis.BufferPayloadType.EXTENDED_CHUNK_DATA or Aravis.BufferPayloadType.MULTIPART.

New in version 0.8.23.

get_part_padding(part_id)
Parameters:

part_id (int) – a part id

Returns:

x_padding:

x offset placeholder

y_padding:

y offset placeholder

Return type:

(x_padding: int, y_padding: int)

Gets the part padding.

This function must only be called if buffer payload is either Aravis.BufferPayloadType.IMAGE, Aravis.BufferPayloadType.EXTENDED_CHUNK_DATA or Aravis.BufferPayloadType.MULTIPART.

New in version 0.8.23.

get_part_pixel_format(part_id)
Parameters:

part_id (int) – a part id

Returns:

part pixel format.

Return type:

int

Gets the part pixel format.

This function must only be called if buffer payload is either Aravis.BufferPayloadType.IMAGE, Aravis.BufferPayloadType.EXTENDED_CHUNK_DATA or Aravis.BufferPayloadType.MULTIPART.

New in version 0.8.23.

get_part_region(part_id)
Parameters:

part_id (int) – a part id

Returns:

x:

x offset placeholder

y:

y offset placeholder

width:

width placeholder

height:

height placeholder

Return type:

(x: int, y: int, width: int, height: int)

Gets the part region.

This function must only be called if buffer payload is either Aravis.BufferPayloadType.IMAGE, Aravis.BufferPayloadType.EXTENDED_CHUNK_DATA or Aravis.BufferPayloadType.MULTIPART.

New in version 0.8.23.

get_part_width(part_id)
Parameters:

part_id (int) – a part id

Returns:

width, in pixels.

Return type:

int

Gets the part width.

This function must only be called if buffer payload is either Aravis.BufferPayloadType.IMAGE, Aravis.BufferPayloadType.EXTENDED_CHUNK_DATA or Aravis.BufferPayloadType.MULTIPART.

New in version 0.8.23.

get_part_x(part_id)
Parameters:

part_id (int) – a part id

Returns:

x offset, in pixels.

Return type:

int

Gets the part x offset.

This function must only be called if buffer payload is either Aravis.BufferPayloadType.IMAGE, Aravis.BufferPayloadType.EXTENDED_CHUNK_DATA or Aravis.BufferPayloadType.MULTIPART.

New in version 0.8.23.

get_part_y(part_id)
Parameters:

part_id (int) – a part id

Returns:

y offset, in pixels.

Return type:

int

Gets the part y_offset.

This function must only be called if buffer payload is either Aravis.BufferPayloadType.IMAGE, Aravis.BufferPayloadType.EXTENDED_CHUNK_DATA or Aravis.BufferPayloadType.MULTIPART.

New in version 0.8.23.

get_payload_type()
Returns:

payload type.

Return type:

Aravis.BufferPayloadType

Gets the buffer payload type.

New in version 0.4.0.

get_status()
Returns:

buffer acquisition status.

Return type:

Aravis.BufferStatus

Gets the buffer acquisition status.

New in version 0.4.0.

get_system_timestamp()
Returns:

buffer system timestamp, in nanoseconds.

Return type:

int

Gets the system timestamp for when the frame was received. Expressed in nanoseconds.

New in version 0.6.0.

get_timestamp()
Returns:

buffer timestamp, in nanoseconds.

Return type:

int

Gets the buffer camera timestamp, expressed as nanoseconds. Not all devices provide reliable timestamp, which means sometimes its better to rely on the buffer completion host local time, or to use Aravis.Buffer.get_system_timestamp().

New in version 0.4.0.

get_user_data()
Returns:

user data, or None if not set.

Return type:

object or None

Gets a pointer to user data set by Aravis.Buffer.new_full.

New in version 0.4.0.

has_chunks()
Returns:

True if self has a payload type that contains chunk data.

Return type:

bool

New in version 0.8.0.

set_frame_id(frame_id)
Parameters:

frame_id (int) – a #guint64

Sets the buffer frame id. For GigEVision devices, 0 is an invalid value.

New in version 0.8.3.

set_system_timestamp(timestamp_ns)
Parameters:

timestamp_ns (int) – a timestamp, expressed as nanoseconds

Sets the system timestamp for when the frame was received. Expressed in nanoseconds.

New in version 0.6.0.

set_timestamp(timestamp_ns)
Parameters:

timestamp_ns (int) – a timestamp, expressed as nanoseconds

Sets the buffer timestamp, which allows to override the timpestamp set by the camera, which in some case is incorrect.

New in version 0.4.0.