QRhiScissor Class

Gibt ein Scherenrechteck an. Mehr...

Kopfzeile: #include <rhi/qrhi.h>
CMake: find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::GuiPrivate)
qmake: QT += gui-private
Since: Qt 6.6

Öffentliche Funktionen

QRhiScissor()
QRhiScissor(int x, int y, int w, int h)
std::array<int, 4> scissor() const
void setScissor(int x, int y, int w, int h)
size_t qHash(const QRhiScissor &key, size_t seed = 0)
bool operator!=(const QRhiScissor &a, const QRhiScissor &b)
bool operator==(const QRhiScissor &a, const QRhiScissor &b)

Detaillierte Beschreibung

Wird mit QRhiCommandBuffer::setScissor() verwendet. Das Setzen eines Scherenrechtecks ist nur mit einem QRhiGraphicsPipeline möglich, bei dem QRhiGraphicsPipeline::UsesScissor gesetzt ist.

QRhi Nimmt Scherenkoordinaten im OpenGL-Stil an, d.h. x und y sind unten links. Negative Breite oder Höhe sind nicht erlaubt. Abgesehen davon gilt jedoch die flexible OpenGL-Semantik: Negative x und y, teilweise außerhalb der Grenzen liegende Rechtecke usw. werden anständig behandelt, indem sie entsprechend geklemmt werden. Daher kann jede Rendering-Logik, die auf OpenGL abzielt, Scissor-Rechtecke in QRhiScissor einspeisen, wie sie sind, ohne jegliche Anpassung.

Hinweis: Dies ist eine RHI-API mit begrenzten Kompatibilitätsgarantien, siehe QRhi für Details.

Siehe auch QRhiCommandBuffer::setScissor() und QRhiViewport.

Dokumentation der Mitgliedsfunktionen

[constexpr noexcept] QRhiScissor::QRhiScissor()

Konstruiert eine leere Schere.

QRhiScissor::QRhiScissor(int x, int y, int w, int h)

Konstruiert eine Schere mit dem durch x, y, w und h angegebenen Rechteck.

Hinweis: x und y werden als untere linke Position angenommen. Negative w oder h sind nicht erlaubt, solche Scherenrechtecke werden von QRhiCommandBuffer ignoriert. Ansonsten gilt die flexible OpenGL-Semantik: Negative x- und y-Werte, Rechtecke, die teilweise außerhalb des Rahmens liegen, usw. werden korrekt behandelt und gegebenenfalls geklemmt.

std::array<int, 4> QRhiScissor::scissor() const

Gibt die Position und Größe der Schere zurück.

Siehe auch setScissor().

void QRhiScissor::setScissor(int x, int y, int w, int h)

Setzt die Position und Größe der Schere auf x, y, w, h.

Hinweis: Es wird immer erwartet, dass die Position in einem Koordinatensystem angegeben wird, das seinen Ursprung in der unteren linken Ecke hat, wie OpenGL.

Siehe auch scissor().

Verwandte Nicht-Mitglieder

[noexcept] size_t qHash(const QRhiScissor &key, size_t seed = 0)

Gibt den Hash-Wert für key zurück, wobei seed als Startwert für die Berechnung verwendet wird.

[noexcept] bool operator!=(const QRhiScissor &a, const QRhiScissor &b)

Gibt false zurück, wenn die Werte in den beiden Objekten QRhiScissor a und b gleich sind; andernfalls wird true zurückgegeben.

[noexcept] bool operator==(const QRhiScissor &a, const QRhiScissor &b)

Gibt true zurück, wenn die Werte in den beiden Objekten QRhiScissor a und b gleich sind.

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