QSGImageNode Class
QSGImageNode 클래스는 QML 씬 그래프를 사용하여 텍스처 콘텐츠를 쉽게 그릴 수 있도록 편의를 위해 제공됩니다. 더 보기...
Header: | #include <QSGImageNode> |
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 |
공용 함수
virtual QSGTexture::AnisotropyLevel | anisotropyLevel() const = 0 |
virtual QSGTexture::Filtering | filtering() const = 0 |
virtual QSGTexture::Filtering | mipmapFiltering() const = 0 |
virtual bool | ownsTexture() const = 0 |
virtual QRectF | rect() const = 0 |
virtual void | setAnisotropyLevel(QSGTexture::AnisotropyLevel level) = 0 |
virtual void | setFiltering(QSGTexture::Filtering filtering) = 0 |
virtual void | setMipmapFiltering(QSGTexture::Filtering filtering) = 0 |
virtual void | setOwnsTexture(bool owns) = 0 |
virtual void | setRect(const QRectF &rect) = 0 |
void | setRect(qreal x, qreal y, qreal w, qreal h) |
virtual void | setSourceRect(const QRectF &rect) = 0 |
void | setSourceRect(qreal x, qreal y, qreal w, qreal h) |
virtual void | setTexture(QSGTexture *texture) = 0 |
virtual void | setTextureCoordinatesTransform(QSGImageNode::TextureCoordinatesTransformMode mode) = 0 |
virtual QRectF | sourceRect() const = 0 |
virtual QSGTexture * | texture() const = 0 |
virtual QSGImageNode::TextureCoordinatesTransformMode | textureCoordinatesTransform() const = 0 |
정적 공용 멤버
void | rebuildGeometry(QSGGeometry *g, QSGTexture *texture, const QRectF &rect, QRectF sourceRect, QSGImageNode::TextureCoordinatesTransformMode texCoordMode) |
멤버 유형 문서
enum QSGImageNode::TextureCoordinatesTransformFlag
플래그 QSGImageNode::TextureCoordinatesTransformMode
텍스처 쿼드의 텍스처 좌표를 생성하는 데 사용되는 모드를 지정하는 데 사용되는 TextureCoordinatesTransformFlag 열거형입니다.
상수 | 값 | 설명 |
---|---|---|
QSGImageNode::NoTransform | 0x00 | 텍스처 좌표의 방향은 창 좌표, 즉 원점이 왼쪽 상단에 있습니다. |
QSGImageNode::MirrorHorizontally | 0x01 | 텍스처 좌표는 창 좌표에 대해 가로축에서 반전됩니다. |
QSGImageNode::MirrorVertically | 0x02 | 텍스처 좌표가 창 좌표에 대해 세로 축에서 반전됩니다. |
TextureCoordinatesTransformMode 유형은 QFlags<TextureCoordinatesTransformFlag>에 대한 typedef입니다. TextureCoordinatesTransformFlag 값의 OR 조합을 저장합니다.
멤버 함수 문서
[pure virtual]
QSGTexture::AnisotropyLevel QSGImageNode::anisotropyLevel() const
이 이미지 노드의 비등방성 레벨을 반환합니다.
setAnisotropyLevel()도 참조하세요 .
[pure virtual]
QSGTexture::Filtering QSGImageNode::filtering() const
이 이미지 노드에 대한 필터링을 반환합니다.
setFiltering()도 참조하세요 .
[pure virtual]
QSGTexture::Filtering QSGImageNode::mipmapFiltering() const
이 이미지 노드에 대한 밉맵 필터링을 반환합니다.
setMipmapFiltering()도 참조하세요 .
[pure virtual]
bool QSGImageNode::ownsTexture() const
노드가 텍스처의 소유권을 가지면 true
를 반환하고, 그렇지 않으면 false
을 반환합니다.
setOwnsTexture()도 참조하세요 .
[static]
void QSGImageNode::rebuildGeometry(QSGGeometry *g, QSGTexture *texture, const QRectF &rect, QRectF sourceRect, QSGImageNode::TextureCoordinatesTransformMode texCoordMode)
지오메트리 g 를 texture 의 좌표, rect 의 좌표, sourceRect 의 텍스처 좌표로 업데이트합니다.
g 는 QSGGeometry::TexturedPoint2D 유형의 정점 4개로 이루어진 삼각형 스트립으로 가정합니다.
texCoordMode 는 sourceRect 을 정규화하는 데 사용됩니다.
[pure virtual]
QRectF QSGImageNode::rect() const
이 이미지 노드의 타깃 렉트를 반환합니다.
setRect()도 참조하세요 .
[pure virtual]
void QSGImageNode::setAnisotropyLevel(QSGTexture::AnisotropyLevel level)
이 이미지 노드의 비등방성 수준을 level 로 설정합니다.
anisotropyLevel()도 참조하세요 .
[pure virtual]
void QSGImageNode::setFiltering(QSGTexture::Filtering filtering)
이 이미지 노드에 사용할 필터링을 filtering 로 설정합니다.
부드러운 스케일링을 위해 QSGTexture::Linear 을 사용합니다. 일반 스케일링의 경우 QSGTexture::Nearest 을 사용합니다.
filtering()도 참조하세요 .
[pure virtual]
void QSGImageNode::setMipmapFiltering(QSGTexture::Filtering filtering)
이 이미지 노드에 사용할 밉맵 필터링을 filtering 로 설정합니다.
밉맵 간의 부드러운 스케일링을 위해 QSGTexture::Linear 을 사용합니다. 일반 스케일링의 경우 QSGTexture::Nearest 을 사용합니다.
mipmapFiltering()도 참조하세요 .
[pure virtual]
void QSGImageNode::setOwnsTexture(bool owns)
노드가 텍스처의 소유권을 owns 로 가져갈지 여부를 설정합니다.
기본적으로 노드는 텍스처의 소유권을 갖지 않습니다.
ownsTexture()도 참조하세요 .
[pure virtual]
void QSGImageNode::setRect(const QRectF &rect)
이 이미지 노드의 대상 렉을 rect 로 설정합니다.
rect()도 참조하세요 .
void QSGImageNode::setRect(qreal x, qreal y, qreal w, qreal h)
이 함수는 오버로드된 함수입니다.
이 이미지 노드의 직사각형이 (x, y)에서 시작하고 너비 w 와 높이 h 를 갖도록 설정합니다.
[pure virtual]
void QSGImageNode::setSourceRect(const QRectF &rect)
이 이미지 노드의 소스 렉을 rect 로 설정합니다.
sourceRect()도 참조하세요 .
void QSGImageNode::setSourceRect(qreal x, qreal y, qreal w, qreal h)
이것은 오버로드된 함수입니다.
이 이미지 노드의 직사각형이 (x, y)의 텍스처를 표시하도록 설정하고 너비 w 와 높이 h 를 QSGTexture::textureSize 에 상대적으로 갖도록 설정합니다.
[pure virtual]
void QSGImageNode::setTexture(QSGTexture *texture)
이 이미지 노드의 텍스처를 texture 로 설정합니다.
setOwnsTexture()를 사용하여 노드가 텍스처의 소유권을 가져갈지 여부를 설정합니다. 기본적으로 노드는 소유권을 갖지 않습니다.
경고: 이미지 노드는 렌더링할 시나리오에 추가되기 전에 텍스처가 있어야 합니다.
texture()도 참조하세요 .
[pure virtual]
void QSGImageNode::setTextureCoordinatesTransform(QSGImageNode::TextureCoordinatesTransformMode mode)
텍스처 좌표 생성에 사용되는 메서드를 mode 로 설정합니다. 텍스처의 올바른 방향을 얻는 데 사용할 수 있습니다. 이 옵션은 일반적으로 타사 OpenGL 라이브러리를 사용하여 텍스처에 렌더링할 때 필요하며, OpenGL은 Qt Quick 에 대해 반전된 y축을 갖기 때문입니다.
textureCoordinatesTransform()도 참조하세요 .
[pure virtual]
QRectF QSGImageNode::sourceRect() const
이 이미지 노드의 소스 렉트를 반환합니다.
setSourceRect()도 참조하세요 .
[pure virtual]
QSGTexture *QSGImageNode::texture() const
이 이미지 노드의 텍스처를 반환합니다.
setTexture()도 참조하세요 .
[pure virtual]
QSGImageNode::TextureCoordinatesTransformMode QSGImageNode::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.