QWaylandBufferRef 類

QWaylandBufferRef 類保持對錶麵緩衝的引用。 更多...

頭: #include <QWaylandBufferRef>
qmake: QT += waylandcompositor
Since: Qt 5.8

該類在 Qt 5.8 引入。

公共函數

QWaylandBufferRef (const QWaylandBufferRef & ref )
QWaylandBufferRef ()
QWaylandBufferRef & operator= (const QWaylandBufferRef & ref )
~QWaylandBufferRef ()
bool hasBuffer () const
bool hasContent () 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
bool operator!= (const QWaylandBufferRef & ref )
bool operator== (const QWaylandBufferRef & ref )

詳細描述

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.

成員函數文檔編製

QWaylandBufferRef:: QWaylandBufferRef (const QWaylandBufferRef & ref )

Creates a new reference to the buffer referenced by ref .

QWaylandBufferRef:: QWaylandBufferRef ()

構造 null 緩衝 ref 引用。

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

賦值 ref to this buffer and adds a reference to it. The previously referenced buffer is dereferenced.

QWaylandBufferRef:: ~QWaylandBufferRef ()

解引用緩衝。

bool QWaylandBufferRef:: hasBuffer () const

返迴 true,若此 QWaylandBufferRef 引用緩衝。否則返迴 false。

另請參閱 isNull () 和 hasContent ().

bool QWaylandBufferRef:: hasContent () const

返迴 true,若此 QWaylandBufferRef references a buffer that has content. Otherwise returns false.

另請參閱 isNull () 和 hasBuffer ().

QImage QWaylandBufferRef:: image () const

Returns an image with the contents of the buffer.

bool QWaylandBufferRef:: isDestroyed () const

返迴 true,若此 QWaylandBufferRef references a buffer that has been destroyed. Otherwise returns false.

bool QWaylandBufferRef:: isNull () const

返迴 true,若此 QWaylandBufferRef does not reference a buffer. Otherwise returns false.

另請參閱 hasBuffer () 和 hasContent ().

bool QWaylandBufferRef:: isSharedMemory () const

Returns true if the buffer is a shared memory buffer. Otherwise returns false.

quintptr QWaylandBufferRef:: lockNativeBuffer ()

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.

QWaylandSurface::Origin QWaylandBufferRef:: origin () const

Returns the origin of the buffer. If the buffer referenced is null, QWaylandSurface::OriginBottomLeft 被返迴。

QSize QWaylandBufferRef:: size () const

Returns the size of the buffer. If the buffer referenced is null, an invalid QSize() is returned.

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

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.

void QWaylandBufferRef:: unlockNativeBuffer ( quintptr handle )

Marks the native buffer as no longer in use. handle must correspond to the value returned by a previous call to lockNativeBuffer ().

struct wl_resource *QWaylandBufferRef:: wl_buffer () const

返迴用於緩衝的 Wayland 資源。

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

返迴 false,若此 QWaylandBufferRef 引用相同緩衝如 ref 。否則返迴 true。

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

返迴 true,若此 QWaylandBufferRef 引用相同緩衝如 ref 。否則返迴 false。