QRhiViewport Class
ビューポートの矩形を指定します。詳細...
ヘッダ: | #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スタイルのビューポート座標を想定しています。負の幅や高さは許されない。
典型的な使い方は以下のようなものである:
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
ビューポートの深度範囲のmaxDepth値を返す。
setMaxDepth()も参照してください 。
float QRhiViewport::minDepth() const
ビューポートの深度範囲のminDepth値を返す。
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, width, height を返す。
setViewport()も参照 。
関連する非会員
[noexcept]
size_t qHash(const QRhiViewport &key, size_t seed = 0)
key のハッシュ値を返す。計算のシードにはseed を使用する。
[noexcept]
bool operator!=(const QRhiViewport &a, const QRhiViewport &b)
2つのQRhiViewport オブジェクトa とb の値が等しい場合はfalse
を返し、そうでない場合はtrue
を返す。
[noexcept]
bool operator==(const QRhiViewport &a, const QRhiViewport &b)
2つの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.