이 페이지에서

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 열거형은 텍스처가 적용된 사각형에 대한 텍스처 좌표를 생성하는 데 사용되는 모드를 지정하는 데 사용됩니다.

상수값설명
QSGSimpleTextureNode::NoTransform0x00텍스처 좌표는 창 좌표계, 즉 왼쪽 상단을 원점으로 하는 좌표계를 따릅니다.
QSGSimpleTextureNode::MirrorHorizontally0x01텍스처 좌표는 창 좌표계에 대해 수평축에서 반전됩니다.
QSGSimpleTextureNode::MirrorVertically0x02텍스처 좌표는 창 좌표계에 대해 수직축에서 반전됩니다.

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

이 텍스처 노드의 대상 사각형을 반환합니다.

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)

이 텍스처 노드의 대상 사각형을 r 로 설정합니다.

rect()도 참조하십시오 .

void QSGSimpleTextureNode::setRect(qreal x, qreal y, qreal w, qreal h)

이 텍스처 노드의 사각형이 (x, y)에서 시작하고, 너비는 w, 높이는 h 이 되도록 설정합니다.

이 함수는 오버로드된 함수입니다.

void QSGSimpleTextureNode::setSourceRect(const QRectF &r)

이 텍스처 노드의 소스 직사각형을 r 로 설정합니다.

sourceRect()도 참조하십시오 .

void QSGSimpleTextureNode::setSourceRect(qreal x, qreal y, qreal w, qreal h)

이 텍스처 노드의 사각형을 (x, y) 위치에서 텍스처를 표시하도록 설정하며, 너비는 w, 높이는 h 로 지정하고, 이는 QSGTexture::textureSize 를 기준으로 상대적인 위치입니다.

이 함수는 오버로드된 함수입니다.

void QSGSimpleTextureNode::setTexture(QSGTexture *texture)

이 텍스처 노드의 텍스처를 ` texture`로 설정합니다.

setOwnsTexture()를 사용하여 노드가 텍스처의 소유권을 가져올지 여부를 설정합니다. 기본적으로 노드는 소유권을 가져오지 않습니다.

경고: 텍스처노드는 렌더링되기 위해 씬그래프에 추가되기 전에 텍스처를 가지고 있어야 합니다.

texture()도 참조하십시오 .

void QSGSimpleTextureNode::setTextureCoordinatesTransform(QSGSimpleTextureNode::TextureCoordinatesTransformMode mode)

텍스처 좌표를 생성하는 데 사용되는 메서드를 ` mode`로 설정합니다. 이를 통해 텍스처의 올바른 방향을 얻을 수 있습니다. OpenGL은 ` Qt Quick`에 비해 y축이 반전되어 있으므로, 타사 OpenGL 라이브러리를 사용하여 텍스처에 렌더링할 때 일반적으로 이 설정이 필요합니다.

textureCoordinatesTransform()도 참조하십시오 .

QRectF QSGSimpleTextureNode::sourceRect() const

이 텍스처 노드의 소스 레크트를 반환합니다.

setSourceRect()도 참조하십시오 .

QSGTexture *QSGSimpleTextureNode::texture() const

이 텍스처 노드의 텍스처를 반환합니다

setTexture()도 참조하십시오 .

QSGSimpleTextureNode::TextureCoordinatesTransformMode QSGSimpleTextureNode::textureCoordinatesTransform() const

이 노드의 텍스처 좌표를 생성하는 데 사용되는 모드를 반환합니다.

setTextureCoordinatesTransform()도 참조하십시오 .

© 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.