BitMiracle.LibJpeg.Classic.Internal.my_1pass_cquantizer.output_value C# (CSharp) Method

output_value() private static method

Return j'th output value, where j will range from 0 to maxj The output values must fall in 0..MAXJSAMPLE in increasing order
private static output_value ( int j, int maxj ) : int
j int
maxj int
return int
        private static int output_value(int j, int maxj)
        {
            /* We always provide values 0 and MAXJSAMPLE for each component;
             * any additional values are equally spaced between these limits.
             * (Forcing the upper and lower values to the limits ensures that
             * dithering can't produce a color outside the selected gamut.)
             */
            return (int)((j * JpegConstants.MAXJSAMPLE + maxj / 2) / maxj);
        }