Accord.Imaging.Filters.Grayscale.Grayscale C# (CSharp) Method

Grayscale() public method

Initializes a new instance of the Grayscale class.
public Grayscale ( double cr, double cg, double cb ) : System
cr double Red coefficient.
cg double Green coefficient.
cb double Blue coefficient.
return System
        public Grayscale(double cr, double cg, double cb)
        {
            RedCoefficient = cr;
            GreenCoefficient = cg;
            BlueCoefficient = cb;

            // initialize format translation dictionary
            formatTranslations[PixelFormat.Format24bppRgb] = PixelFormat.Format8bppIndexed;
            formatTranslations[PixelFormat.Format32bppRgb] = PixelFormat.Format8bppIndexed;
            formatTranslations[PixelFormat.Format32bppArgb] = PixelFormat.Format8bppIndexed;
            formatTranslations[PixelFormat.Format48bppRgb] = PixelFormat.Format16bppGrayScale;
            formatTranslations[PixelFormat.Format64bppArgb] = PixelFormat.Format16bppGrayScale;
        }