KWayland::Client::Buffer

#include <buffer.h>

Public Types

enum  Format { Format::ARGB32, Format::RGB32 }
 
typedef QWeakPointer< BufferPtr
 

Public Member Functions

uchar * address ()
 
wl_buffer * buffer () const
 
void copy (const void *src)
 
Format format () const
 
bool isReleased () const
 
bool isUsed () const
 
 operator wl_buffer * ()
 
 operator wl_buffer * () const
 
void setReleased (bool released)
 
void setUsed (bool used)
 
QSize size () const
 
int32_t stride () const
 

Static Public Member Functions

static quint32 getId (wl_buffer *b)
 

Detailed Description

Wrapper class for wl_buffer interface.

The Buffer is provided by ShmPool and is owned by ShmPool.

See also
ShmPool

Definition at line 31 of file buffer.h.

Member Enumeration Documentation

All image formats supported by the implementation.

Enumerator
ARGB32 

32-bit ARGB format, can be used for QImage::Format_ARGB32 and QImage::Format_ARGB32_Premultiplied

RGB32 

32-bit RGB format, can be used for QImage::Format_RGB32

Definition at line 37 of file buffer.h.

Member Function Documentation

uchar * KWayland::Client::Buffer::address ( )
Returns
the memory address of this Buffer.

Definition at line 68 of file buffer.cpp.

void KWayland::Client::Buffer::copy ( const void *  src)

Copies the data from src into the Buffer.

Definition at line 63 of file buffer.cpp.

Buffer::Format KWayland::Client::Buffer::format ( ) const
Returns
The image format used by this Buffer.

Definition at line 118 of file buffer.cpp.

quint32 KWayland::Client::Buffer::getId ( wl_buffer *  b)
static

Helper method to get the id for a provided native buffer.

Since
5.3

Definition at line 123 of file buffer.cpp.

bool KWayland::Client::Buffer::isReleased ( ) const
Returns
true if the Wayland server doesn't need the Buffer anymore.

Definition at line 88 of file buffer.cpp.

bool KWayland::Client::Buffer::isUsed ( ) const
Returns
true if the Buffer's user is still needing the Buffer.

Definition at line 108 of file buffer.cpp.

void KWayland::Client::Buffer::setReleased ( bool  released)

Sets the Buffer as released.

This is automatically invoked when the Wayland server sends the release event.

Parameters
releasedWhether the Buffer got released by the Wayland server.
See also
isReleased

Definition at line 93 of file buffer.cpp.

void KWayland::Client::Buffer::setUsed ( bool  used)

Sets whether the Buffer is used.

If the Buffer may not be reused when it gets released, the user of a Buffer should mark the Buffer as used. This is needed for example when the memory is shared with a QImage. As soon as the Buffer can be reused again one should call this method with false again.

By default a Buffer is not used.

Parameters
usedWhether the Bufer should be marked as used.
See also
isUsed

Definition at line 113 of file buffer.cpp.

QSize KWayland::Client::Buffer::size ( ) const
Returns
The size of this Buffer.

Definition at line 98 of file buffer.cpp.

int32_t KWayland::Client::Buffer::stride ( ) const
Returns
The stride (bytes per line) of this Buffer.

Definition at line 103 of file buffer.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Aug 10 2020 22:53:37 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.