En esta página

QWaylandBufferRef Class

La clase QWaylandBufferRef contiene la referencia a un buffer de superficie. Más...

Cabecera: #include <QWaylandBufferRef>
CMake: find_package(Qt6 REQUIRED COMPONENTS WaylandCompositor)
target_link_libraries(mytarget PRIVATE Qt6::WaylandCompositor)
qmake: QT += waylandcompositor

Funciones públicas

QWaylandBufferRef()
QWaylandBufferRef(const QWaylandBufferRef &ref)
~QWaylandBufferRef()
bool hasBuffer() const
bool hasContent() const
(since 6.2) bool hasProtectedContent() const
QImage image() const
bool isDestroyed() const
bool isNull() const
bool isSharedMemory() const
quintptr lockNativeBuffer()
QWaylandSurface::Origin origin() const
QSize size() const
QOpenGLTexture *toOpenGLTexture(int plane = 0) const
void unlockNativeBuffer(quintptr handle)
struct wl_resource *wl_buffer() const
QWaylandBufferRef &operator=(const QWaylandBufferRef &ref)
bool operator!=(const QWaylandBufferRef &lhs, const QWaylandBufferRef &rhs)
bool operator==(const QWaylandBufferRef &lhs, const QWaylandBufferRef &rhs)

Descripción detallada

Esta clase se puede utilizar para hacer referencia a un búfer de superficie. Mientras exista una referencia al búfer, éste será propiedad del compositor y el cliente no podrá modificarlo.

Documentación de las funciones miembro

QWaylandBufferRef::QWaylandBufferRef()

Construye un buffer ref nulo.

QWaylandBufferRef::QWaylandBufferRef(const QWaylandBufferRef &ref)

Crea una nueva referencia al búfer referenciado por ref.

[noexcept] QWaylandBufferRef::~QWaylandBufferRef()

Dereferences the buffer.

bool QWaylandBufferRef::hasBuffer() const

Devuelve true si este QWaylandBufferRef hace referencia a un buffer. En caso contrario, devuelve false.

Véase también isNull() y hasContent().

bool QWaylandBufferRef::hasContent() const

Devuelve true si este QWaylandBufferRef hace referencia a un buffer que tiene contenido. En caso contrario, devuelve false.

Véase también isNull() y hasBuffer().

[since 6.2] bool QWaylandBufferRef::hasProtectedContent() const

Devuelve true si este QWaylandBufferRef hace referencia a un buffer que tiene contenido protegido. En caso contrario, devuelve false.

Nota: Este es un habilitador que presume soporte en la integración del buffer cliente. Ninguna de las integraciones de búfer de cliente incluidas con Qt soporta actualmente búferes de contenido protegido.

Esta función se introdujo en Qt 6.2.

Véase también hasContent().

QImage QWaylandBufferRef::image() const

Devuelve una imagen con el contenido del buffer.

bool QWaylandBufferRef::isDestroyed() const

Devuelve true si este QWaylandBufferRef hace referencia a un buffer que ha sido destruido. En caso contrario, devuelve false.

bool QWaylandBufferRef::isNull() const

Devuelve true si este QWaylandBufferRef no hace referencia a un buffer. En caso contrario, devuelve false.

Véase también hasBuffer() y hasContent().

bool QWaylandBufferRef::isSharedMemory() const

Devuelve true si el buffer es un buffer de memoria compartida. En caso contrario, devuelve false.

quintptr QWaylandBufferRef::lockNativeBuffer()

Devuelve el manejador nativo de este buffer, y lo marca como bloqueado para que no sea liberado hasta que se llame a unlockNativeBuffer().

Devuelve 0 si no hay un manejador nativo para este búfer, o si el bloqueo no tuvo éxito.

QWaylandSurface::Origin QWaylandBufferRef::origin() const

Devuelve el origen de la memoria intermedia. Si el búfer referenciado es nulo, se devuelve QWaylandSurface::OriginBottomLeft.

QSize QWaylandBufferRef::size() const

Devuelve el tamaño de la memoria intermedia. Si el búfer referenciado es null, se devuelve un QSize() inválido.

QOpenGLTexture *QWaylandBufferRef::toOpenGLTexture(int plane = 0) const

Devuelve una textura OpenGL para el búfer. plane es el índice para formatos multiplano, como YUV.

La textura devuelta es propiedad del buffer. La textura sólo es válida mientras exista la referencia al búfer. El que llama a esta función no debe borrar la textura, y debe mantener una referencia al buffer mientras la textura esté siendo utilizada.

Devuelve nullptr si no hay una memoria intermedia válida, o si no se puede crear una textura.

void QWaylandBufferRef::unlockNativeBuffer(quintptr handle)

Marca el búfer nativo como ya no en uso. handle debe corresponder al valor devuelto por una llamada anterior a lockNativeBuffer().

struct wl_resource *QWaylandBufferRef::wl_buffer() const

Devuelve el recurso Wayland para el buffer.

QWaylandBufferRef &QWaylandBufferRef::operator=(const QWaylandBufferRef &ref)

Asigna ref a este búfer y añade una referencia al mismo. Se elimina la referencia al búfer anterior.

No miembros relacionados

[noexcept] bool operator!=(const QWaylandBufferRef &lhs, const QWaylandBufferRef &rhs)

Devuelve false si lhs hace referencia a la misma memoria intermedia que rhs. En caso contrario, devuelve true.

[noexcept] bool operator==(const QWaylandBufferRef &lhs, const QWaylandBufferRef &rhs)

Devuelve true si lhs hace referencia a la misma memoria intermedia que rhs. En caso contrario, devuelve false.

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.