Pixbuf.from_bytes


Description:

[ CCode ( has_construct_function = false ) ]
[ Version ( since = "2.32" ) ]
public Pixbuf.from_bytes (Bytes data, Colorspace colorspace, bool has_alpha, int bits_per_sample, int width, int height, int rowstride)

Creates a new Pixbuf out of in-memory readonly image data.

Currently only RGB images with 8 bits per sample are supported.

This is the `GBytes` variant of Pixbuf.with_unowned_data, useful for language bindings.

Parameters:

data

Image data in 8-bit/sample packed format inside a Bytes

colorspace

Colorspace for the image data

has_alpha

Whether the data has an opacity channel

bits_per_sample

Number of bits per sample

width

Width of the image in pixels, must be > 0

height

Height of the image in pixels, must be > 0

rowstride

Distance in bytes between row starts

Returns:

A newly-created pixbuf