Vips.Blob

Fields

Name

Type

Access

Description

area

Vips.Area

r/w

Methods

class

copy (data)

class

new (free_fn, data)

get ()

set (free_fn, data)

Details

class Vips.Blob
classmethod copy(data)
Parameters:

data (bytes) – data to store

Returns:

the new [struct`Blob`].

Return type:

Vips.Blob

Like [ctor`Blob`.new], but take a copy of the data. Useful for bindings which struggle with callbacks.

::: seealso [ctor`Blob`.new].

classmethod new(free_fn, data)
Parameters:
Returns:

the new [struct`Blob`].

Return type:

Vips.Blob

Like [ctor`Area`.new], but track a length as well. The returned [struct`Blob`] takes ownership of data and will free it with free_fn. Pass NULL for free_fn to not transfer ownership.

An area of mem with a free func and a length (some sort of binary object, like an ICC profile).

::: seealso [method`Area`.unref].

get()
Returns:

the data

Return type:

bytes

Get the data from a [struct`Blob`].

::: seealso [ctor`Blob`.new].

set(free_fn, data)
Parameters:

Any old data is freed and new data attached.

It’s sometimes useful to be able to create blobs as empty and then fill them later.

::: seealso [ctor`Blob`.new].