fromFloatRgba method
- Float32x4 pixel
override
Converts a pixel in the floatRgba pixel format to this
pixel format.
FLOAT_RGBA is used as the canonical floating-point pixel format, and this method guarantees that all pixel formats can be converted from it. Loss of precision may occur when converting from a higher-precision format.
Example
print(abgr8888.fromFloatRgba(floatRgba.red)); // 0xFFFF0000
print(abgr8888.fromFloatRgba(floatRgba.white)); // 0xFFFFFFFF
Implementation
@override
P fromFloatRgba(Float32x4 pixel) {
final (g, _) = _luminanceFloatRgba(pixel);
return createNormalized(gray: g);
}