AForge.Imaging.ImageStatisticsHSL.ImageStatisticsHSL C# (CSharp) Method

ImageStatisticsHSL() public method

Initializes a new instance of the ImageStatisticsHSL class.

The mask array must be of the same size as the specified source image, where 0 values correspond to areas which should be excluded from processing. So statistics is calculated only for pixels, which have none zero corresponding value in the mask.

Source pixel format is not supported. Mask must have the same size as the source image to get statistics for.
public ImageStatisticsHSL ( UnmanagedImage image, byte mask ) : System
image UnmanagedImage Image to gather statistics about.
mask byte Mask array which specifies areas to collect statistics for.
return System
        public ImageStatisticsHSL( UnmanagedImage image, byte[,] mask )
        {
            CheckSourceFormat( image.PixelFormat );
            CheckMaskProperties( PixelFormat.Format8bppIndexed,
                new Size( mask.GetLength( 1 ), mask.GetLength( 0 ) ), new Size( image.Width, image.Height ) );

            unsafe
            {
                fixed ( byte* maskPtr = mask )
                {
                    ProcessImage( image, maskPtr, mask.GetLength( 1 ) );
                }
            }
        }

Same methods

ImageStatisticsHSL::ImageStatisticsHSL ( Bitmap image ) : System
ImageStatisticsHSL::ImageStatisticsHSL ( Bitmap image, Bitmap mask ) : System
ImageStatisticsHSL::ImageStatisticsHSL ( Bitmap image, byte mask ) : System
ImageStatisticsHSL::ImageStatisticsHSL ( UnmanagedImage image ) : System
ImageStatisticsHSL::ImageStatisticsHSL ( UnmanagedImage image, UnmanagedImage mask ) : System