QWaylandBufferRef Class
La clase QWaylandBufferRef contiene la referencia a un búfer de superficie. Más información...
| 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) |
Elementos no miembros relacionados
| 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, este es propiedad del compositor y el cliente no puede modificarlo.
Documentación de las funciones de miembro
QWaylandBufferRef::QWaylandBufferRef()
Crea una referencia a un búfer nulo.
QWaylandBufferRef::QWaylandBufferRef(const QWaylandBufferRef &ref)
Crea una nueva referencia al búfer al que hace referencia ref.
[noexcept] QWaylandBufferRef::~QWaylandBufferRef()
Desreferencia el búfer.
bool QWaylandBufferRef::hasBuffer() const
Devuelve «true» si este objeto ` QWaylandBufferRef ` hace referencia a un búfer. En caso contrario, devuelve «false».
Véase también isNull() y hasContent().
bool QWaylandBufferRef::hasContent() const
Devuelve «true» si este objeto ` QWaylandBufferRef ` hace referencia a un búfer que contiene datos. 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 búfer con contenido protegido. En caso contrario, devuelve «false».
Nota: Se trata de un habilitador que presupone compatibilidad con la integración de búferes del cliente. Ninguna de las integraciones de búferes del cliente incluidas en Qt es compatible actualmente con 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 búfer.
bool QWaylandBufferRef::isDestroyed() const
Devuelve «true» si este objeto ` QWaylandBufferRef ` hace referencia a un búfer que ha sido destruido. En caso contrario, devuelve «false».
bool QWaylandBufferRef::isNull() const
Devuelve «true» si este objeto ` QWaylandBufferRef ` no hace referencia a un búfer. En caso contrario, devuelve «false».
Véase también ` hasBuffer()` y ` hasContent()`.
bool QWaylandBufferRef::isSharedMemory() const
Devuelve «true» si el búfer es un búfer de memoria compartida. En caso contrario, devuelve «false».
quintptr QWaylandBufferRef::lockNativeBuffer()
Devuelve el identificador nativo de este búfer y lo marca como bloqueado, de modo que no se liberará hasta que se llame a unlockNativeBuffer().
Devuelve 0 si no existe un identificador nativo para este búfer o si el bloqueo no se ha realizado correctamente.
QWaylandSurface::Origin QWaylandBufferRef::origin() const
Devuelve el origen del búfer. Si el búfer al que se hace referencia es nulo, se devuelve « QWaylandSurface::OriginBottomLeft ».
QSize QWaylandBufferRef::size() const
Devuelve el tamaño del búfer. Si el búfer al que se hace referencia es nulo, se devuelve un valor QSize() no vá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 búfer. La textura solo es válida mientras exista la referencia al búfer. Quien llame a esta función no debe eliminar la textura y debe conservar una referencia al búfer mientras se utilice la textura.
Devuelve nullptr si no hay ningún búfer válido o si no se puede crear ninguna textura.
void QWaylandBufferRef::unlockNativeBuffer(quintptr handle)
Marca el búfer nativo como ya no en uso. El valor de « handle » debe coincidir con el valor devuelto por una llamada previa a « lockNativeBuffer()».
struct wl_resource *QWaylandBufferRef::wl_buffer() const
Devuelve el recurso de Wayland correspondiente al búfer.
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 al que se hacía referencia anteriormente.
Elementos no miembros relacionados
[noexcept] bool operator!=(const QWaylandBufferRef &lhs, const QWaylandBufferRef &rhs)
Devuelve « false » si « lhs » hace referencia al mismo búfer que « rhs ». En caso contrario, devuelve « true ».
[noexcept] bool operator==(const QWaylandBufferRef &lhs, const QWaylandBufferRef &rhs)
Devuelve ` true ` si ` lhs ` hace referencia al mismo búfer 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.