fromFloatRgba method

  1. @override
int fromFloatRgba(
  1. 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
int fromFloatRgba(Float32x4 pixel) {
  return copyWithNormalized(
    zero,
    red: pixel.x,
    green: pixel.y,
    blue: pixel.z,
  );
}