QWaylandBufferRef Class
La classe QWaylandBufferRef contiene il riferimento a un buffer di superficie. Per saperne di più...
| Intestazione: | #include <QWaylandBufferRef> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS WaylandCompositor) target_link_libraries(mytarget PRIVATE Qt6::WaylandCompositor) |
| qmake: | QT += waylandcompositor |
Funzioni pubbliche
| 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) |
Elementi non membri correlati
| bool | operator!=(const QWaylandBufferRef &lhs, const QWaylandBufferRef &rhs) |
| bool | operator==(const QWaylandBufferRef &lhs, const QWaylandBufferRef &rhs) |
Descrizione dettagliata
Questa classe può essere utilizzata per fare riferimento a un buffer di superficie. Finché esiste un riferimento al buffer, esso è di proprietà del compositore e il client non può modificarlo.
Documentazione delle funzioni membro
QWaylandBufferRef::QWaylandBufferRef()
Crea un riferimento a un buffer nullo.
QWaylandBufferRef::QWaylandBufferRef(const QWaylandBufferRef &ref)
Crea un nuovo riferimento al buffer indicato da ` ref`.
[noexcept] QWaylandBufferRef::~QWaylandBufferRef()
Rimuove il riferimento al buffer.
bool QWaylandBufferRef::hasBuffer() const
Restituisce true se questo QWaylandBufferRef fa riferimento a un buffer. In caso contrario, restituisce false.
Vedi anche ` isNull()` e ` hasContent()`.
bool QWaylandBufferRef::hasContent() const
Restituisce true se questo QWaylandBufferRef fa riferimento a un buffer contenente dati. In caso contrario, restituisce false.
Vedi anche isNull() e hasBuffer().
[since 6.2] bool QWaylandBufferRef::hasProtectedContent() const
Restituisce true se questo QWaylandBufferRef fa riferimento a un buffer contenente contenuti protetti. In caso contrario, restituisce false.
Nota: si tratta di un'opzione abilitabile che presuppone il supporto nell'integrazione del buffer client. Nessuna delle integrazioni del buffer client incluse in Qt supporta attualmente i buffer con contenuti protetti.
Questa funzione è stata introdotta in Qt 6.2.
Vedi anche hasContent().
QImage QWaylandBufferRef::image() const
Restituisce un'immagine contenente il contenuto del buffer.
bool QWaylandBufferRef::isDestroyed() const
Restituisce true se questo oggetto ` QWaylandBufferRef ` fa riferimento a un buffer che è stato distrutto. Altrimenti restituisce false.
bool QWaylandBufferRef::isNull() const
Restituisce true se questo oggetto ` QWaylandBufferRef ` non fa riferimento a un buffer. In caso contrario, restituisce false.
Vedi anche ` hasBuffer()` e ` hasContent()`.
bool QWaylandBufferRef::isSharedMemory() const
Restituisce true se il buffer è un buffer di memoria condivisa. In caso contrario, restituisce false.
quintptr QWaylandBufferRef::lockNativeBuffer()
Restituisce l'handle nativo di questo buffer e lo contrassegna come bloccato, in modo che non venga rilasciato finché non viene chiamata la funzion unlockNativeBuffer().
Restituisce 0 se non esiste un handle nativo per questo buffer o se il blocco non è andato a buon fine.
QWaylandSurface::Origin QWaylandBufferRef::origin() const
Restituisce l'origine del buffer. Se il buffer a cui si fa riferimento è nullo, viene restituito il valore " QWaylandSurface::OriginBottomLeft ".
QSize QWaylandBufferRef::size() const
Restituisce la dimensione del buffer. Se il buffer a cui si fa riferimento è nullo, viene restituito un valore QSize() non valido.
QOpenGLTexture *QWaylandBufferRef::toOpenGLTexture(int plane = 0) const
Restituisce una texture OpenGL per il buffer. ` plane ` è l'indice per i formati multipiano, come YUV.
La texture restituita è di proprietà del buffer. La texture è valida solo finché esiste il riferimento al buffer. Chi chiama questa funzione non deve eliminare la texture e deve mantenere un riferimento al buffer per tutto il tempo in cui la texture viene utilizzata.
Restituisce nullptr se non esiste un buffer valido o se non è possibile creare alcuna texture.
void QWaylandBufferRef::unlockNativeBuffer(quintptr handle)
Contrassegna il buffer nativo come non più in uso. Il parametro ` handle ` deve corrispondere al valore restituito da una precedente chiamata alla funzione ` lockNativeBuffer()`.
struct wl_resource *QWaylandBufferRef::wl_buffer() const
Restituisce la risorsa Wayland corrispondente al buffer.
QWaylandBufferRef &QWaylandBufferRef::operator=(const QWaylandBufferRef &ref)
Assegna ` ref ` a questo buffer e aggiunge un riferimento ad esso. Il buffer precedentemente referenziato viene dereferenziato.
Elementi non membri correlati
[noexcept] bool operator!=(const QWaylandBufferRef &lhs, const QWaylandBufferRef &rhs)
Restituisce ` false ` se ` lhs ` fa riferimento allo stesso buffer di ` rhs`. In caso contrario, restituisce ` true`.
[noexcept] bool operator==(const QWaylandBufferRef &lhs, const QWaylandBufferRef &rhs)
Restituisce ` true ` se ` lhs ` fa riferimento allo stesso buffer di ` rhs`. In caso contrario, restituisce ` 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.