In questa pagina

QRgbaFloat Class

template <typename F> class QRgbaFloat

La struttura QRgbaFloat contiene un colore RGBA in virgola mobile composto da quattro parti. Per saperne di più...

Intestazione: #include <QRgbaFloat>
CMake: find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::Gui)
qmake: QT += gui
A partire da: Qt 6.2

Tipi pubblici

Funzioni pubbliche

quint8 alpha8() const
quint16 alpha16() const
float alpha() const
float alphaNormalized() const
quint8 blue8() const
quint16 blue16() const
float blue() const
float blueNormalized() const
quint8 green8() const
quint16 green16() const
float green() const
float greenNormalized() const
bool isOpaque() const
bool isTransparent() const
QRgbaFloat<T> premultiplied() const
quint8 red8() const
quint16 red16() const
float red() const
float redNormalized() const
void setAlpha(float alpha)
void setBlue(float blue)
void setGreen(float green)
void setRed(float red)
uint toArgb32() const
QRgbaFloat<T> unpremultiplied() const

Membri pubblici statici

QRgbaFloat<T> fromArgb32(uint rgb)
QRgbaFloat<T> fromRgba64(quint16 red, quint16 green, quint16 blue, quint16 alpha)
QRgbaFloat<T> fromRgba(quint8 red, quint8 green, quint8 blue, quint8 alpha)

Descrizione dettagliata

QRgbaFloat è una classe modello in cui F specifica il tipo a virgola mobile utilizzato per le componenti di colore. Qt fornisce due alias di tipo: QRgbaFloat16 che utilizza numeri a virgola mobile a mezza precisione a 16 bit e QRgbaFloat32 che utilizza numeri a virgola mobile a precisione singola a 32 bit.

Vedi anche QRgb, QRgba64 e QColor.

Documentazione sui tipi dei membri

[alias] QRgbaFloat::FastType

Alias per float.

Documentazione sulle funzioni membro

[constexpr] quint8 QRgbaFloat::alpha8() const

Restituisce il canale alfa come valore a 8 bit.

[constexpr] quint16 QRgbaFloat::alpha16() const

Restituisce il canale alfa come numero intero a 16 bit.

[constexpr] float QRgbaFloat::alpha() const

Restituisce il canale alfa.

Vedi anche setAlpha().

[constexpr] float QRgbaFloat::alphaNormalized() const

Restituisce il canale alfa normalizzato a valori compresi tra 0.0f e 1.0f.

Vedi anche alpha().

[constexpr] quint8 QRgbaFloat::blue8() const

Restituisce la componente di colore blu come valore a 8 bit.

[constexpr] quint16 QRgbaFloat::blue16() const

Restituisce la componente di colore blu come numero intero a 16 bit.

[constexpr] float QRgbaFloat::blue() const

Restituisce la componente di colore blu.

Vedi anche setBlue().

[constexpr] float QRgbaFloat::blueNormalized() const

Restituisce la componente di colore blu normalizzata a valori compresi tra 0.0f e 1.0f.

Vedi anche setBlue().

[static constexpr] QRgbaFloat<T> QRgbaFloat::fromArgb32(uint rgb)

Crea un valore di tipo “ QRgbaFloat ” a partire dal valore ARGB a 32 bit rgb.

Vedi anche fromRgba() e toArgb32().

[static constexpr] QRgbaFloat<T> QRgbaFloat::fromRgba64(quint16 red, quint16 green, quint16 blue, quint16 alpha)

Crea un valore di tipo “ QRgbaFloat ” a partire dai quattro canali di colore, ciascuno rappresentato da un numero intero a 16 bit: red, green, blue e alpha.

Vedi anche fromRgba().

[static constexpr] QRgbaFloat<T> QRgbaFloat::fromRgba(quint8 red, quint8 green, quint8 blue, quint8 alpha)

Crea un valore di tipo ` QRgbaFloat ` a partire dai quattro canali di colore a 8 bit: red, green, blue e alpha.

Vedi anche fromArgb32().

[constexpr] quint8 QRgbaFloat::green8() const

Restituisce la componente di colore verde come valore a 8 bit.

[constexpr] quint16 QRgbaFloat::green16() const

Restituisce la componente di colore verde come numero intero a 16 bit.

[constexpr] float QRgbaFloat::green() const

Restituisce la componente di colore verde.

Vedi anche setGreen().

[constexpr] float QRgbaFloat::greenNormalized() const

Restituisce la componente di colore verde normalizzata a valori compresi tra 0.0f e 1.0f.

Vedi anche setGreen().

[constexpr] bool QRgbaFloat::isOpaque() const

Restituisce se il colore è completamente opaco.

Vedi anche isTransparent() e alpha().

[constexpr] bool QRgbaFloat::isTransparent() const

Restituisce se il colore è completamente trasparente.

Vedi anche isOpaque() e alpha().

[constexpr] QRgbaFloat<T> QRgbaFloat::premultiplied() const

Restituisce il colore con l'alfa premoltiplicato.

Vedi anche unpremultiplied().

[constexpr] quint8 QRgbaFloat::red8() const

Restituisce la componente di colore rossa come valore a 8 bit.

[constexpr] quint16 QRgbaFloat::red16() const

Restituisce la componente di colore rossa come numero intero a 16 bit.

[constexpr] float QRgbaFloat::red() const

Restituisce la componente di colore rossa.

Vedi anche setRed().

[constexpr] float QRgbaFloat::redNormalized() const

Restituisce la componente di colore rossa normalizzata a valori compresi tra 0.0f e 1.0f.

Vedi anche setRed().

void QRgbaFloat::setAlpha(float alpha)

Imposta l'opacità di questo colore su alpha.

Vedi anche alpha().

void QRgbaFloat::setBlue(float blue)

Imposta la componente blu di questo colore su blue.

Vedi anche blue().

void QRgbaFloat::setGreen(float green)

Imposta la componente verde di questo colore su green.

Vedi anche green().

void QRgbaFloat::setRed(float red)

Imposta la componente rossa di questo colore su red.

Vedi anche red().

[constexpr] uint QRgbaFloat::toArgb32() const

Restituisce il colore come valore ARGB a 32 bit.

Vedi anche fromArgb32().

[constexpr] QRgbaFloat<T> QRgbaFloat::unpremultiplied() const

Restituisce il colore senza moltiplicazione dell’alfa.

Vedi anche premultiplied().

Elementi correlati non membri

QRgbaFloat16

Una struttura dati a 64 bit contenente quattro canali di colore in virgola mobile a 16 bit: rosso, verde, blu e alfa.

QRgbaFloat32

Una struttura dati a 128 bit contenente quattro canali di colore a virgola mobile da 32 bit ciascuno: rosso, verde, blu e alfa.

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