Set the pixels for this buffer by copying them, or allocate a new memory region.

This will allocate a new buffer in memory and copy the input pixels to it. The internal colorspace is not guaranteed to be preserved, and colorspace conversion may happen internally.

If pixels is null, then a new empty buffer will be allocated. If the buffer already had pixel data, the previous image data will be dropped. This is the same as Efl.Gfx.Buffer.buffer_managed_set.

The memory buffer pixels must be large enough to hold width x height pixels encoded in the colorspace cspace.

slice should not be the return value of Efl.Gfx.Buffer.buffer_managed_get.


buffer_copy_set @pure_virtual {
    params {
        @in slice: ptr(const(Eina.Slice)) @nullable;
        @in size: Eina.Size2D;
        @in stride: int @optional;
        @in cspace: Efl.Gfx.Colorspace @optional;
        @in plane: int @optional;
    return: bool;

C signature

Eina_Bool efl_gfx_buffer_copy_set(Eo *obj, const Eina_Slice *slice, Eina_Size2D size, int stride, Efl_Gfx_Colorspace cspace, int plane);


  • slice (in) - If null, allocates an empty buffer
  • size (in) - The size in pixels.
  • stride (in) - If 0, automatically guessed from the width.
  • cspace (in) - argb8888 by default.
  • plane (in) - Plane ID. 0 by default. Useful for planar formats only.

Implemented by

  • Efl.Gfx.Buffer.buffer_copy_set