En esta página

QRgbaFloat Class

template <typename F> class QRgbaFloat

La estructura QRgbaFloat contiene un color RGBA de punto flotante compuesto por cuatro partes. Más información...

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

Tipos públicos

Funciones públicas

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

Miembros públicos estáticos

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)

Descripción detallada

QRgbaFloat es una clase de plantilla en la que F especifica el tipo de punto flotante utilizado para los componentes de color. Qt proporciona dos alias de tipo: QRgbaFloat16, que utiliza números flotantes de media precisión de 16 bits, y QRgbaFloat32, que utiliza números flotantes de precisión simple de 32 bits.

Véase también QRgb, QRgba64 y QColor.

Documentación sobre tipos de miembros

[alias] QRgbaFloat::FastType

Alias de «float».

Documentación de funciones de miembro

[constexpr] quint8 QRgbaFloat::alpha8() const

Devuelve el canal alfa como un valor de 8 bits.

[constexpr] quint16 QRgbaFloat::alpha16() const

Devuelve el canal alfa como un entero de 16 bits.

[constexpr] float QRgbaFloat::alpha() const

Devuelve el canal alfa.

Véase también setAlpha().

[constexpr] float QRgbaFloat::alphaNormalized() const

Devuelve el canal alfa normalizado a valores comprendidos entre 0.0f y 1.0f.

Véase también alpha().

[constexpr] quint8 QRgbaFloat::blue8() const

Devuelve el componente de color azul como un valor de 8 bits.

[constexpr] quint16 QRgbaFloat::blue16() const

Devuelve el componente de color azul como un entero de 16 bits.

[constexpr] float QRgbaFloat::blue() const

Devuelve el componente de color azul.

Véase también setBlue().

[constexpr] float QRgbaFloat::blueNormalized() const

Devuelve el componente de color azul normalizado a valores comprendidos entre 0.0f y 1.0f.

Véase también setBlue().

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

Crea un valor de tipo « QRgbaFloat » a partir del valor ARGB de 32 bits « rgb ».

Véase también fromRgba() y toArgb32().

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

Crea un valor de tipo « QRgbaFloat » a partir de los cuatro canales de color, cada uno de 16 bits: red, green, blue y alpha.

Véase también fromRgba().

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

Crea un valor de tipo « QRgbaFloat » a partir de los cuatro canales de color de 8 bits: red, green, blue y alpha.

Véase también fromArgb32().

[constexpr] quint8 QRgbaFloat::green8() const

Devuelve el componente de color verde como un valor de 8 bits.

[constexpr] quint16 QRgbaFloat::green16() const

Devuelve el componente de color verde como un entero de 16 bits.

[constexpr] float QRgbaFloat::green() const

Devuelve el componente de color verde.

Véase también setGreen().

[constexpr] float QRgbaFloat::greenNormalized() const

Devuelve el componente de color verde normalizado a valores comprendidos entre 0.0f y 1.0f.

Véase también setGreen().

[constexpr] bool QRgbaFloat::isOpaque() const

Devuelve si el color es totalmente opaco.

Véase también isTransparent() y alpha().

[constexpr] bool QRgbaFloat::isTransparent() const

Devuelve si el color es totalmente transparente.

Véase también isOpaque() y alpha().

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

Devuelve el color con el alfa premultiplicado.

Véase también unpremultiplied().

[constexpr] quint8 QRgbaFloat::red8() const

Devuelve el componente de color rojo como un valor de 8 bits.

[constexpr] quint16 QRgbaFloat::red16() const

Devuelve el componente de color rojo como un entero de 16 bits.

[constexpr] float QRgbaFloat::red() const

Devuelve el componente de color rojo.

Véase también setRed().

[constexpr] float QRgbaFloat::redNormalized() const

Devuelve el componente de color rojo normalizado a valores comprendidos entre 0.0f y 1.0f.

Véase también setRed().

void QRgbaFloat::setAlpha(float alpha)

Establece el alfa de este color en alpha.

Véase también alpha().

void QRgbaFloat::setBlue(float blue)

Establece el componente azul de este color en blue.

Véase también blue().

void QRgbaFloat::setGreen(float green)

Establece el componente de verde de este color en green.

Véase también green().

void QRgbaFloat::setRed(float red)

Establece el componente de color rojo de este color en red.

Véase también red().

[constexpr] uint QRgbaFloat::toArgb32() const

Devuelve el color como un valor ARGB de 32 bits.

Véase también fromArgb32().

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

Devuelve el color sin multiplicar por el alfa.

Véase también premultiplied().

Elementos no miembros relacionados

QRgbaFloat16

Una estructura de datos de 64 bits que contiene cuatro canales de color de 16 bits en formato de coma flotante: rojo, verde, azul y alfa.

QRgbaFloat32

Una estructura de datos de 128 bits que contiene cuatro canales de color de 32 bits en formato de coma flotante: rojo, verde, azul y 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.