toAbgr8888 method

  1. @override
int toAbgr8888(
  1. int pixel
)
override

Converts a pixel in this pixel format to the abgr8888 pixel format.

ABGR8888 is used as the canonical integer-based pixel format, and this method guarantees that all pixel formats can be converted to it. Loss of precision may occur when this pixel format has higher precision.

Example

print(abgr8888.toAbgr8888(floatRgba.red)); // 0xFFFF0000
print(abgr8888.toAbgr8888(floatRgba.white)); // 0xFFFFFFFF

Implementation

@override
int toAbgr8888(int pixel) {
  return abgr8888.create(
    red: getRed(pixel),
    green: getGreen(pixel),
    blue: getBlue(pixel),
  );
}