QSGSimpleTextureNode Class
QSGSimpleTextureNodeクラスは、QMLシーングラフを使ってテクスチャコンテンツを簡単に描画するための便利なクラスです。詳細...
ヘッダー | #include <QSGSimpleTextureNode> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Quick) target_link_libraries(mytarget PRIVATE Qt6::Quick) |
qmake: | QT += quick |
継承: | QSGGeometryNode |
パブリックな型
enum | TextureCoordinatesTransformFlag { NoTransform, MirrorHorizontally, MirrorVertically } |
flags | TextureCoordinatesTransformMode |
パブリック関数
QSGSimpleTextureNode() | |
virtual | ~QSGSimpleTextureNode() override |
QSGTexture::Filtering | filtering() const |
bool | ownsTexture() const |
QRectF | rect() const |
void | setFiltering(QSGTexture::Filtering filtering) |
void | setOwnsTexture(bool owns) |
void | setRect(const QRectF &r) |
void | setRect(qreal x, qreal y, qreal w, qreal h) |
void | setSourceRect(const QRectF &r) |
void | setSourceRect(qreal x, qreal y, qreal w, qreal h) |
void | setTexture(QSGTexture *texture) |
void | setTextureCoordinatesTransform(QSGSimpleTextureNode::TextureCoordinatesTransformMode mode) |
QRectF | sourceRect() const |
QSGTexture * | texture() const |
QSGSimpleTextureNode::TextureCoordinatesTransformMode | textureCoordinatesTransform() const |
詳しい説明
警告 単純テクスチャ・ノード・クラスは、レンダリングされるシーングラフに追加される前にテクスチャを持たなければなりません。
警告 このユーティリティ・クラスは、Qt Quick シーングラフのデフォルトまたはソフトウェア・バックエンドで実行する場合にのみ機能します。別の方法として、QQuickWindow::createImageNode() を介してQSGImageNode を使用することをお勧めします。しかし、このスタンドアロン・クラスは、サブクラス化によって使用され、アプリケーションが特別なシーングラフ・バックエンドが関与しないことを知っている場合、まだ有用です。
メンバ型ドキュメント
enum QSGSimpleTextureNode::TextureCoordinatesTransformFlag
flags QSGSimpleTextureNode::TextureCoordinatesTransformMode
TextureCoordinatesTransformFlag enum は、テクスチャ四角形のテクスチャ座標を生成するために使用されるモードを指定するために使用されます。
定数 | 値 | 説明 |
---|---|---|
QSGSimpleTextureNode::NoTransform | 0x00 | テクスチャ座標はウィンドウ座標、すなわち左上を原点として方向付けられます。 |
QSGSimpleTextureNode::MirrorHorizontally | 0x01 | テクスチャ座標は、ウィンドウ座標に対して横軸が反転します。 |
QSGSimpleTextureNode::MirrorVertically | 0x02 | テクスチャ座標は、ウィンドウ座標に対して垂直軸で反転されます。 |
TextureCoordinatesTransformMode 型はQFlags<TextureCoordinatesTransformFlag> の typedef です。TextureCoordinatesTransformFlag 値の OR の組み合わせを格納します。
メンバー関数ドキュメント
QSGSimpleTextureNode::QSGSimpleTextureNode()
新しいシンプルなテクスチャノードを構築する
[override virtual noexcept]
QSGSimpleTextureNode::~QSGSimpleTextureNode()
テクスチャノードを破壊する
QSGTexture::Filtering QSGSimpleTextureNode::filtering() const
このテクスチャノードに現在設定されているフィルタリングを返します。
setFiltering()も参照してください 。
bool QSGSimpleTextureNode::ownsTexture() const
ノードがテクスチャの所有権を持つ場合はtrue
を返し、そうでない場合はfalse
を返します。
setOwnsTexture()も参照してください 。
QRectF QSGSimpleTextureNode::rect() const
このテクスチャノードのターゲット rect を返します。
setRect()も参照してください 。
void QSGSimpleTextureNode::setFiltering(QSGTexture::Filtering filtering)
このテクスチャノードに使用するフィルタリングをfiltering に設定します。
スムーズなスケーリングにはQSGTexture::Linear を使用し、通常のスケーリングにはQSGTexture::Nearest を使用します。
filtering()も参照してください 。
void QSGSimpleTextureNode::setOwnsTexture(bool owns)
ノードがテクスチャの所有権を取得するかどうかをowns に設定します。
デフォルトでは、ノードはテクスチャの所有権を持ちません。
ownsTexture() およびsetTexture()も参照してください 。
void QSGSimpleTextureNode::setRect(const QRectF &r)
このテクスチャノードのターゲット rect をr に設定します。
rect()も参照してください 。
void QSGSimpleTextureNode::setRect(qreal x, qreal y, qreal w, qreal h)
これはオーバーロードされた関数です。
このテクスチャノードの矩形を、 (x,y) から始まり、幅w と高さh を持つように設定します。
void QSGSimpleTextureNode::setSourceRect(const QRectF &r)
このテクスチャノードのソース rect をr に設定します。
sourceRect()も参照してください 。
void QSGSimpleTextureNode::setSourceRect(qreal x, qreal y, qreal w, qreal h)
これはオーバーロードされた関数です。
このテクスチャノードの矩形を、 (x,y) からそのテクスチャを表示し、QSGTexture::textureSize に対して相対的に幅w と高さh を持つように設定します。
void QSGSimpleTextureNode::setTexture(QSGTexture *texture)
このテクスチャノードのテクスチャをtexture に設定します。
setOwnsTexture() を使用して、ノードがテクスチャの所有権を取得するかどうかを設定します。デフォルトでは、ノードは所有権を取りません。
警告 テクスチャ・ノードは、レンダリングされるシーングラフに追加される前に、テクスチャを持たなければなりません。
texture()も参照してください 。
void QSGSimpleTextureNode::setTextureCoordinatesTransform(QSGSimpleTextureNode::TextureCoordinatesTransformMode mode)
テクスチャ座標を生成するために使用されるメソッドをmode に設定します。 これは、テクスチャの正しい向きを得るために使用できます。Qt Quickこれは、サードパーティの OpenGL ライブラリを使用してテクスチャをレンダリングする場合に一般的に必要となります。
textureCoordinatesTransform()も参照してください 。
QRectF QSGSimpleTextureNode::sourceRect() const
このテクスチャノードのソース rect を返します。
setSourceRect()も参照してください 。
QSGTexture *QSGSimpleTextureNode::texture() const
このテクスチャノードのテクスチャを返します。
setTexture()も参照してください 。
QSGSimpleTextureNode::TextureCoordinatesTransformMode QSGSimpleTextureNode::textureCoordinatesTransform() const
このノードのテクスチャ座標の生成に使用されたモードを返します。
setTextureCoordinatesTransform()も参照してください 。
© 2025 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.