![]() |
Skia
2D Graphics Library
|
RGBA color value, holding four floating point components. More...
#include <SkColor.h>
Public Member Functions | |
| bool | operator== (const SkRGBA4f &other) const |
| Compares SkRGBA4f with other, and returns true if all components are equal. More... | |
| bool | operator!= (const SkRGBA4f &other) const |
| Compares SkRGBA4f with other, and returns true if not all components are equal. More... | |
| SkRGBA4f | operator* (float scale) const |
| Returns SkRGBA4f multiplied by scale. More... | |
| SkRGBA4f | operator* (const SkRGBA4f &scale) const |
| Returns SkRGBA4f multiplied component-wise by scale. More... | |
| const float * | vec () const |
| Returns a pointer to components of SkRGBA4f, for array access. More... | |
| float * | vec () |
| Returns a pointer to components of SkRGBA4f, for array access. More... | |
| std::array< float, 4 > | array () const |
| As a std::array<float, 4> More... | |
| float | operator[] (int index) const |
| Returns one component. More... | |
| float & | operator[] (int index) |
| Returns one component. More... | |
| bool | isOpaque () const |
| Returns true if SkRGBA4f is an opaque color. More... | |
| bool | fitsInBytes () const |
| Returns true if all channels are in [0, 1]. More... | |
| SkColor | toSkColor () const |
| Returns closest SkColor to SkRGBA4f. More... | |
| SkRGBA4f< kPremul_SkAlphaType > | premul () const |
| Returns SkRGBA4f premultiplied by alpha. More... | |
| SkRGBA4f< kUnpremul_SkAlphaType > | unpremul () const |
| Returns SkRGBA4f unpremultiplied by alpha. More... | |
| uint32_t | toBytes_RGBA () const |
| SkRGBA4f | makeOpaque () const |
| Returns a copy of the SkRGBA4f but with alpha component set to 1.0f. More... | |
Static Public Member Functions | |
| static SkRGBA4f | FromColor (SkColor color) |
| Returns closest SkRGBA4f to SkColor. More... | |
| static SkRGBA4f | FromPMColor (SkPMColor) |
| Returns closest SkRGBA4f to SkPMColor. More... | |
| static SkRGBA4f | FromBytes_RGBA (uint32_t color) |
Public Attributes | |
| float | fR |
| red component More... | |
| float | fG |
| green component More... | |
| float | fB |
| blue component More... | |
| float | fA |
| alpha component More... | |
RGBA color value, holding four floating point components.
Color components are always in a known order. kAT determines if the SkRGBA4f's R, G, and B components are premultiplied by alpha or not.
Skia's public API always uses unpremultiplied colors, which can be stored as SkRGBA4f<kUnpremul_SkAlphaType>. For convenience, this type can also be referred to as SkColor4f.
|
inline |
As a std::array<float, 4>
|
inline |
Returns true if all channels are in [0, 1].
|
inline |
Returns a copy of the SkRGBA4f but with alpha component set to 1.0f.
|
inline |
Returns one component.
Asserts if index is out of range and SK_DEBUG is defined.
| index | one of: 0 (fR), 1 (fG), 2 (fB), 3 (fA) |
|
inline |
Returns one component.
Asserts if index is out of range and SK_DEBUG is defined.
| index | one of: 0 (fR), 1 (fG), 2 (fB), 3 (fA) |
|
inline |
| uint32_t SkRGBA4f< kAT >::toBytes_RGBA | ( | ) | const |
|
inline |
|
inline |
Returns a pointer to components of SkRGBA4f, for array access.
|
inline |
Returns a pointer to components of SkRGBA4f, for array access.
| float SkRGBA4f< kAT >::fA |
alpha component
| float SkRGBA4f< kAT >::fB |
blue component
| float SkRGBA4f< kAT >::fG |
green component
| float SkRGBA4f< kAT >::fR |
red component