encode
abstract fun encode(planes: HeifPlanes, parameters: HeifEncodeParameters, cancellationCheck: () -> Unit?): HeifCodedPicture(source)
Codes planes, one picture, as parameters ask. Luma has 1 sample or more on each side, and in subsampled chroma an even number, so the picture needs no rounding up. Call cancellationCheck at a coarse step, such as once a row of coding blocks, and let what it throws pass through. Throw IllegalArgumentException for a picture the codec cannot hold.