Generates mipmaps for image.
function GenerateMipMaps(const Image: TImageData; Levels: LongInt; var MipMaps: TDynImageDataArray): Boolean;
Imaging (at line 181)
Levels is the number of desired mipmaps levels with zero (or some invalid number) meaning all possible levels.