このページでは

QWaylandBufferRef Class

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
(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)

詳細な説明

このクラスは、サーフェス・バッファを参照するために使用できます。バッファへの参照が存在する限り、そのバッファはコンポジターによって管理され、クライアントはそれを変更することはできません。

メンバ関数のドキュメント

QWaylandBufferRef::QWaylandBufferRef()

nullバッファの参照を作成します。

QWaylandBufferRef::QWaylandBufferRef(const QWaylandBufferRef &ref)

ref が参照するバッファへの新しい参照を作成します。

[noexcept] QWaylandBufferRef::~QWaylandBufferRef()

バッファの参照を解除します。

bool QWaylandBufferRef::hasBuffer() const

このQWaylandBufferRef がバッファを参照している場合はtrueを返します。そうでない場合はfalseを返します。

isNull() およびhasContent()も参照してください 。

bool QWaylandBufferRef::hasContent() const

このQWaylandBufferRef が、内容を含むバッファを参照している場合はtrueを返します。そうでない場合はfalseを返します。

isNull() およびhasBuffer()も参照してください 。

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

このQWaylandBufferRef が、保護されたコンテンツを含むバッファを参照している場合はtrueを返します。そうでない場合はfalseを返します。

注:これは 、クライアントバッファ統合でのサポートを前提とする有効化機能です。現在、Qt に含まれているクライアントバッファ統合のいずれも、保護されたコンテンツのバッファをサポートしていません。

この関数は Qt 6.2 で導入されました。

hasContent()も参照してください 。

QImage QWaylandBufferRef::image() const

バッファの内容を含む画像を返します。

bool QWaylandBufferRef::isDestroyed() const

このQWaylandBufferRef が、すでに破棄されたバッファを参照している場合はtrueを返します。それ以外の場合はfalseを返します。

bool QWaylandBufferRef::isNull() const

このQWaylandBufferRef がバッファを参照していない場合、trueを返します。それ以外の場合はfalseを返します。

hasBuffer() およびhasContent()も参照してください 。

bool QWaylandBufferRef::isSharedMemory() const

バッファが共有メモリバッファである場合は true を返します。そうでない場合は false を返します。

quintptr QWaylandBufferRef::lockNativeBuffer()

このバッファのネイティブハンドルを返し、unlockNativeBuffer() が呼び出されるまで解放されないよう、ロック状態としてマークします。

このバッファのネイティブハンドルが存在しない場合、またはロックに失敗した場合は、0を返します。

QWaylandSurface::Origin QWaylandBufferRef::origin() const

バッファの原点を返します。参照されたバッファがNULLの場合、QWaylandSurface::OriginBottomLeft が返されます。

QSize QWaylandBufferRef::size() const

バッファのサイズを返します。参照先のバッファがNULLの場合、無効な QSize() が返されます。

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

バッファに対応する OpenGL テクスチャを返します。plane は、YUV などのマルチプレーン形式のインデックスです。

返されるテクスチャは、そのバッファが所有します。このテクスチャは、バッファへの参照が存在する間のみ有効です。この関数の呼び出し元は、テクスチャを削除してはならず、テクスチャが使用されている間はバッファへの参照を保持し続けなければなりません。

有効なバッファが存在しない場合、またはテクスチャを作成できない場合は、nullptr を返します。

void QWaylandBufferRef::unlockNativeBuffer(quintptr handle)

ネイティブバッファが使用済みではないことを示します。handle は、以前にlockNativeBuffer()を呼び出した際に返された値と一致している必要があります。

struct wl_resource *QWaylandBufferRef::wl_buffer() const

そのバッファに対応する Wayland リソースを返します。

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

このバッファにref を割り当て、その参照を追加します。以前に参照されていたバッファの参照は解除されます。

関連する非メンバー関数

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

lhs がrhs と同じバッファを参照している場合、false を返します。そうでない場合は、true を返します。

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

lhs がrhs と同じバッファを参照している場合は、true を返します。そうでない場合は、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.