QRgbaFloat Class | Qt GUI 6.4.3

- Qt 6.4
- Qt GUI
- C++ Classes
- QRgbaFloat
- Qt 6.4.3 Reference Documentation

# QRgbaFloat Class

template <typename F> class QRgbaFloat

The QRgbaFloat struct contains a four part RGBA floating-point color. More...

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

- List of all members, including inherited members

## Public Types

| FastType

## Public Functions

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

## Related Non-Members

| QRgbaFloat16
| QRgbaFloat32

## Detailed Description

See also QRgb, QRgba64, and QColor.

## Member Type Documentation

### `[alias]` QRgbaFloat::FastType

Alias for float.

## Member Function Documentation

### quint8 QRgbaFloat::alpha8() const

Returns the alpha channel as an 8-bit.

### quint16 QRgbaFloat::alpha16() const

Returns the alpha channel as a 16-bit integer.

### FastType QRgbaFloat::alpha() const

Returns the alpha channel.

See also setAlpha().

### FastType QRgbaFloat::alphaNormalized() const

Returns the alpha channel normalized to values between `0.0f` and `1.0f`.

See also alpha().

### quint8 QRgbaFloat::blue8() const

Returns the blue color component as an 8-bit.

### quint16 QRgbaFloat::blue16() const

Returns the blue color component as a 16-bit integer.

### FastType QRgbaFloat::blue() const

Returns the blue color component.

See also setBlue().

### FastType QRgbaFloat::blueNormalized() const

Returns the blue color component normalized to values between `0.0f` and `1.0f`.

See also setBlue().

### quint8 QRgbaFloat::green8() const

Returns the green color component as an 8-bit.

### quint16 QRgbaFloat::green16() const

Returns the green color component as a 16-bit integer.

### FastType QRgbaFloat::green() const

Returns the green color component.

See also setGreen().

### FastType QRgbaFloat::greenNormalized() const

Returns the green color component normalized to values between `0.0f` and `1.0f`.

See also setGreen().

### bool QRgbaFloat::isOpaque() const

Returns whether the color is fully opaque.

See also isTransparent() and alpha().

### bool QRgbaFloat::isTransparent() const

Returns whether the color is fully transparent.

See also isOpaque() and alpha().

### QRgbaFloat<T> QRgbaFloat::premultiplied() const

Returns the color with the alpha premultiplied.

See also unpremultiplied().

### quint8 QRgbaFloat::red8() const

Returns the red color component as an 8-bit.

### quint16 QRgbaFloat::red16() const

Returns the red color component as a 16-bit integer.

### FastType QRgbaFloat::red() const

Returns the red color component.

See also setRed().

### FastType QRgbaFloat::redNormalized() const

Returns the red color component normalized to values between `0.0f` and `1.0f`.

See also setRed().

### void QRgbaFloat::setAlpha(FastType alpha)

Sets the alpha of this color to alpha.

See also alpha().

### void QRgbaFloat::setBlue(FastType blue)

Sets the blue color component of this color to blue.

See also blue().

### void QRgbaFloat::setGreen(FastType green)

Sets the green color component of this color to green.

See also green().

### void QRgbaFloat::setRed(FastType red)

Sets the red color component of this color to red.

See also red().

### uint QRgbaFloat::toArgb32() const

Returns the color as a 32-bit ARGB value.

See also fromArgb32().

### QRgbaFloat<T> QRgbaFloat::unpremultiplied() const

Returns the color with the alpha unpremultiplied.

See also premultiplied().

## Related Non-Members

### QRgbaFloat16

A 64-bit data-structure containing four 16-bit floating point color channels: Red, green, blue and alpha.

### QRgbaFloat32

A 128-bit data-structure containing four 32-bit floating point color channels: Red, green, blue and alpha.