Accord.Imaging.Filters.BayerFilterOptimized.ProcessFilter C# (CSharp) Method

ProcessFilter() protected method

Process the filter on the specified image.
protected ProcessFilter ( UnmanagedImage sourceData, UnmanagedImage destinationData ) : void
sourceData UnmanagedImage Source image data.
destinationData UnmanagedImage Destination image data.
return void
        protected override void ProcessFilter(UnmanagedImage sourceData, UnmanagedImage destinationData)
        {
            // get width and height
            int width = sourceData.Width;
            int height = sourceData.Height;

            if (((width & 1) == 1) || ((height & 1) == 1) ||
                 (width < 2) || (height < 2))
            {
                throw new InvalidImagePropertiesException("Source image must have even width and height. Width and height can not be smaller than 2.");
            }

            switch (bayerPattern)
            {
                case BayerPattern.GRBG:
                    ApplyGRBG(sourceData, destinationData);
                    break;

                case BayerPattern.BGGR:
                    ApplyBGGR(sourceData, destinationData);
                    break;
            }
        }