QRhiViewport Class
뷰포트 사각형을 지정합니다. 더 보기...
Header: | #include <rhi/qrhi.h> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Gui) target_link_libraries(mytarget PRIVATE Qt6::GuiPrivate) |
qmake: | QT += gui-private |
이후: | Qt 6.6 |
공용 함수
QRhiViewport() | |
QRhiViewport(float x, float y, float w, float h, float minDepth = 0.0f, float maxDepth = 1.0f) | |
float | maxDepth() const |
float | minDepth() const |
void | setMaxDepth(float maxDepth) |
void | setMinDepth(float minDepth) |
void | setViewport(float x, float y, float w, float h) |
std::array<float, 4> | viewport() const |
관련 비회원
size_t | qHash(const QRhiViewport &key, size_t seed = 0) |
bool | operator!=(const QRhiViewport &a, const QRhiViewport &b) |
bool | operator==(const QRhiViewport &a, const QRhiViewport &b) |
상세 설명
QRhiCommandBuffer::setViewport()와 함께 사용됩니다.
QRhi 는 OpenGL 스타일 뷰포트 좌표, 즉 x와 y가 왼쪽 아래라고 가정합니다. 음수 너비나 높이는 허용되지 않습니다.
일반적인 사용법은 다음과 같습니다:
const QSize outputSizeInPixels = swapchain->currentPixelSize(); const QRhiViewport viewport(0, 0, outputSizeInPixels.width(), outputSizeInPixels.height()); cb->beginPass(swapchain->currentFrameRenderTarget(), Qt::black, { 1.0f, 0 }); cb->setGraphicsPipeline(ps); cb->setViewport(viewport); // ...
참고: 호환성이 제한적으로 보장되는 RHI API이며, 자세한 내용은 QRhi 을 참조하세요.
QRhiCommandBuffer::setViewport(), QRhi::clipSpaceCorrMatrix() 및 QRhiScissor 를참조하세요 .
멤버 함수 문서
[constexpr noexcept]
QRhiViewport::QRhiViewport()
빈 사각형과 깊이 범위가 0.0f - 1.0f인 뷰포트 설명을 작성합니다.
QRhi::clipSpaceCorrMatrix()도 참조하세요 .
QRhiViewport::QRhiViewport(float x, float y, float w, float h, float minDepth = 0.0f, float maxDepth = 1.0f)
x, y, w, h 및 깊이 범위 minDepth 및 maxDepth 로 지정된 사각형으로 뷰포트 설명을 구성합니다.
참고: x 및 y 은 왼쪽 아래 위치로 가정합니다. w 및 h 은 음수가 아니어야 하며, 그렇지 않으면 뷰포트는 QRhiCommandBuffer::setViewport()에 의해 무시됩니다.
QRhi::clipSpaceCorrMatrix()도 참조하세요 .
float QRhiViewport::maxDepth() const
뷰포트의 깊이 범위의 최대 깊이 값을 반환합니다.
setMaxDepth()도 참조하세요 .
float QRhiViewport::minDepth() const
뷰포트의 깊이 범위의 최소 깊이 값을 반환합니다.
setMinDepth()도 참조하세요 .
void QRhiViewport::setMaxDepth(float maxDepth)
뷰포트의 깊이 범위( maxDepth )를 설정합니다. 기본적으로 이 값은 1.0f로 설정됩니다.
maxDepth()도 참조하세요 .
void QRhiViewport::setMinDepth(float minDepth)
뷰포트의 깊이 범위( minDepth )를 설정합니다. 기본적으로 이 값은 0.0f로 설정됩니다.
minDepth()도 참조하세요 .
void QRhiViewport::setViewport(float x, float y, float w, float h)
뷰포트의 위치와 크기를 x, y, w, h 로 설정합니다.
참고: 뷰포트는 좌표계로 지정되며 원점이 왼쪽 하단에 있습니다.
viewport()도 참조하세요 .
std::array<float, 4> QRhiViewport::viewport() const
뷰포트의 x, y, 너비, 높이를 반환합니다.
setViewport()도 참조하세요 .
관련 비회원
[noexcept]
size_t qHash(const QRhiViewport &key, size_t seed = 0)
seed 을 사용하여 key 에 대한 해시값을 반환합니다.
[noexcept]
bool operator!=(const QRhiViewport &a, const QRhiViewport &b)
두 개의 QRhiViewport 객체 a 와 b 의 값이 같으면 false
를 반환하고, 그렇지 않으면 true
를 반환합니다.
[noexcept]
bool operator==(const QRhiViewport &a, const QRhiViewport &b)
두 개의 QRhiViewport 객체 a 및 b 의 값이 같으면 true
을 반환합니다.
© 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.