QWaylandBufferRef 类保持对表面缓冲的引用。 更多...
头: | #include <QWaylandBufferRef> |
CMake: |
find_package(Qt6 REQUIRED COMPONENTS WaylandCompositor)
target_link_libraries(mytarget PRIVATE Qt6::WaylandCompositor) |
qmake: | QT += waylandcompositor |
QWaylandBufferRef () | |
QWaylandBufferRef (const QWaylandBufferRef & ref ) | |
~QWaylandBufferRef () | |
bool | hasBuffer () const |
bool | hasContent () const |
(从 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 ) |
This class can be used to reference a surface buffer. As long as a reference to the buffer exists, it is owned by the compositor and the client cannot modify it.
构造 null 缓冲 ref 引用。
Creates a new reference to the buffer referenced by ref .
[noexcept]
QWaylandBufferRef::
~QWaylandBufferRef
()
解引用缓冲。
返回 true,若此 QWaylandBufferRef 引用缓冲。否则返回 false。
另请参阅 isNull () 和 hasContent ().
返回 true,若此 QWaylandBufferRef references a buffer that has content. Otherwise returns false.
另请参阅 isNull () 和 hasBuffer ().
[since 6.2]
bool
QWaylandBufferRef::
hasProtectedContent
() const
返回 true,若此 QWaylandBufferRef references a buffer that has protected content. Otherwise returns false.
注意: This is an enabler which presumes support in the client buffer integration. None of the client buffer integrations included with Qt currently support protected content buffers.
该函数在 Qt 6.2 引入。
另请参阅 hasContent ().
Returns an image with the contents of the buffer.
返回 true,若此 QWaylandBufferRef references a buffer that has been destroyed. Otherwise returns false.
返回 true,若此 QWaylandBufferRef does not reference a buffer. Otherwise returns false.
另请参阅 hasBuffer () 和 hasContent ().
Returns true if the buffer is a shared memory buffer. Otherwise returns false.
Returns the native handle for this buffer, and marks it as locked so it will not be released until unlockNativeBuffer () 被调用。
Returns 0 if there is no native handle for this buffer, or if the lock was unsuccessful.
Returns the origin of the buffer. If the buffer referenced is null, QWaylandSurface::OriginBottomLeft 被返回。
Returns the size of the buffer. If the buffer referenced is null, an invalid QSize() is returned.
Returns an OpenGL texture for the buffer. plane is the index for multi-plane formats, such as YUV.
The returned texture is owned by the buffer. The texture is only valid for as long as the buffer reference exists. The caller of this function must not delete the texture, and must keep a reference to the buffer for as long as the texture is being used.
返回
nullptr
if there is no valid buffer, or if no texture can be created.
Marks the native buffer as no longer in use. handle must correspond to the value returned by a previous call to lockNativeBuffer ().
返回用于缓冲的 Wayland 资源。
赋值 ref to this buffer and adds a reference to it. The previously referenced buffer is dereferenced.
[noexcept]
bool
operator!=
(const
QWaylandBufferRef
&
lhs
, const
QWaylandBufferRef
&
rhs
)
返回
false
if
lhs
引用相同缓冲如
rhs
. Otherwise returns
true
.
[noexcept]
bool
operator==
(const
QWaylandBufferRef
&
lhs
, const
QWaylandBufferRef
&
rhs
)
返回
true
if
lhs
引用相同缓冲如
rhs
. Otherwise returns
false
.