Accord.Imaging.Filters.ChannelFiltering.CalculateMap C# (CSharp) Method

CalculateMap() private static method

Calculate filtering map.
private static CalculateMap ( IntRange range, byte fill, bool fillOutsideRange, byte map ) : void
range AForge.IntRange Filtering range.
fill byte Fillter value.
fillOutsideRange bool Fill outside or inside the range.
map byte Filtering map.
return void
        private static void CalculateMap(IntRange range, byte fill, bool fillOutsideRange, byte[] map)
        {
            for (int i = 0; i < 256; i++)
            {
                if ((i >= range.Min) && (i <= range.Max))
                {
                    map[i] = (fillOutsideRange) ? (byte)i : fill;
                }
                else
                {
                    map[i] = (fillOutsideRange) ? fill : (byte)i;
                }
            }
        }
    }