QPaintedTextureImage Class
class Qt3DRender::QPaintedTextureImageQPainter 을 통해 작성할 수 있는 QAbstractTextureImage.. . 더보기...
헤더: | #include <QPaintedTextureImage> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS 3drender) target_link_libraries(mytarget PRIVATE Qt6::3drender) |
qmake: | QT += 3drender |
상속합니다: | Qt3DRender::QAbstractTextureImage |
상태: | Deprecated |
속성
공용 기능
공용 슬롯
신호
void | heightChanged(int w) |
void | sizeChanged(QSize size) |
void | widthChanged(int w) |
보호된 기능
virtual void | paint(QPainter *painter) = 0 |
상세 설명
QPaintedTextureImage는 QPainter 를 통해 텍스처 이미지(따라서 OpenGL 텍스처)를 지정하는 방법을 제공합니다. 텍스처 이미지의 폭과 높이는 폭과 높이 또는 크기 프로퍼티를 통해 지정할 수 있습니다.
QPaintedTextureImage를 서브클래싱하고 가상 paint() 함수를 구현해야 합니다. QPaintedTextureImage에서 update()가 호출될 때마다 paint() 함수가 호출되고 결과 이미지가 업로드됩니다.
QPaintedTextureImage는 일부 QAbstractTexture 에 첨부되어야 합니다.
프로퍼티 문서
height : int
이 속성은 텍스처 이미지의 높이를 보유합니다. 높이는 1보다 크거나 같아야 합니다.
함수에 액세스합니다:
int | height() const |
void | setHeight(int h) |
알림 신호:
void | heightChanged(int w) |
size : QSize
이 속성은 텍스처 이미지의 크기를 보유합니다.
함수에 액세스합니다:
QSize | size() const |
void | setSize(QSize size) |
알림 신호:
void | sizeChanged(QSize size) |
width : int
이 속성은 텍스처 이미지의 너비를 보유합니다. 너비는 1보다 크거나 같아야 합니다.
함수에 액세스합니다:
int | width() const |
void | setWidth(int w) |
알림 신호:
void | widthChanged(int w) |
멤버 함수 문서
[pure virtual protected]
void QPaintedTextureImage::paint(QPainter *painter)
지정된 QPainter 객체 painter 로 텍스처 이미지를 그립니다.
QPainter 는 이미지의 왼쪽 상단 모서리를 원점으로 간주하는 반면 OpenGL은 텍스처의 왼쪽 하단 모서리를 원점으로 간주합니다. 이 차이를 설명하는 쉬운 방법은 다른 페인팅을 하기 전에 페인터에서 사용자 지정 뷰포트를 설정하는 것입니다:
painter->setViewport(0, height(), width(), -height()); ...
[slot]
void QPaintedTextureImage::setHeight(int h)
텍스처 이미지의 높이(h)를 설정합니다. 크기가 변경되면 업데이트를 트리거합니다.
참고: 속성의 세터 함수 height.
height()도 참조하세요 .
[slot]
void QPaintedTextureImage::setSize(QSize size)
텍스처 이미지의 너비와 높이를 설정합니다. size 가 변경되면 업데이트를 트리거합니다.
참고: size 속성에 대한 세터 함수입니다.
size()도 참조하세요 .
[slot]
void QPaintedTextureImage::setWidth(int w)
텍스처 이미지의 너비(w)를 설정합니다. 크기가 변경되면 업데이트를 트리거합니다.
참고: 속성의 세터 함수 width.
width()도 참조하세요 .
void QPaintedTextureImage::update(const QRect &rect = QRect())
페인트된 텍스처의 paint() 함수를 즉시 트리거하여 새 이미지를 GPU에 업로드합니다. 페인트된 텍스처를 여러 번 변경하는 경우 필요한 다시 칠하기 횟수를 최소화하기 위해 모든 변경이 완료될 때까지 기다렸다가 업데이트를 호출하는 것이 좋습니다.
rect 매개변수는 현재 사용되지 않습니다.
© 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.