AForge.Imaging.ImageStatisticsYCbCr.CheckMaskProperties C# (CSharp) Method

CheckMaskProperties() private method

private CheckMaskProperties ( PixelFormat maskFormat, Size maskSize, Size sourceImageSize ) : void
maskFormat PixelFormat
maskSize System.Drawing.Size
sourceImageSize System.Drawing.Size
return void
        private void CheckMaskProperties( PixelFormat maskFormat, Size maskSize, Size sourceImageSize )
        {
            if ( maskFormat != PixelFormat.Format8bppIndexed )
            {
                throw new ArgumentException( "Mask image must be 8 bpp grayscale image." );
            }

            if ( ( maskSize.Width != sourceImageSize.Width ) || ( maskSize.Height != sourceImageSize.Height ) )
            {
                throw new ArgumentException( "Mask must have the same size as the source image to get statistics for." );
            }
        }
    }