/// <summary> /// This is port of TJSCALED macros from turbojpeg.h /// Compute the scaled value of <paramref name="dimension"/> using the given scaling factor. /// </summary> /// <param name="dimension">Dimension to scale</param> /// <param name="scalingFactor">Scaling factor</param> /// <returns></returns> public static int TJSCALED(int dimension, tjscalingfactor scalingFactor) { return((dimension * scalingFactor.num + scalingFactor.denom - 1) / scalingFactor.denom); }
/// <summary> /// This is port of TJSCALED macros from turbojpeg.h /// Compute the scaled value of <paramref name="dimension"/> using the given scaling factor. /// </summary> /// <param name="dimension">Dimension to scale</param> /// <param name="scalingFactor">Scaling factor</param> /// <returns></returns> public static int TJSCALED(int dimension, tjscalingfactor scalingFactor) { return ((dimension * scalingFactor.num + scalingFactor.denom - 1) / scalingFactor.denom); }