calculateInSampleSize

fun calculateInSampleSize(@Px() srcWidth: Int, @Px() srcHeight: Int, @Px() dstWidth: Int, @Px() dstHeight: Int, scale: Scale): Int

Calculate the BitmapFactory.Options.inSampleSize given the source dimensions of the image (srcWidth and srcHeight), the output dimensions (dstWidth, dstHeight), and the scale.