buildMips function
Builds the mip chain of image in a background isolate, at most
maxLevels levels (all the way to 1×1 by default): level 0 is the image
itself. srgb averages in linear light, so colour textures do not darken
as they shrink.
Implementation
Future<List<RgbaImage>> buildMips(
RgbaImage image, {
required bool srgb,
int? maxLevels,
}) => compute(_mips, (image, srgb, maxLevels ?? 64));