C# Класс AForge.Imaging.Filters.ApplyMask

Apply mask to the specified image.

The filter applies mask to the specified image - keeps all pixels in the image if corresponding pixels/values of the mask are not equal to 0. For all 0 pixels/values in mask, corresponding pixels in the source image are set to 0.

Mask can be specified as .NET's managed Bitmap, as UnmanagedImage or as byte array. In the case if mask is specified as image, it must be 8 bpp grayscale image. In all case mask size must be the same as size of the image to process.

The filter accepts 8/16 bpp grayscale and 24/32/48/64 bpp color images for processing.

Наследование: BaseInPlacePartialFilter
Показать файл Открыть проект

Открытые методы

Метод Описание
ApplyMask ( Bitmap maskImage ) : System

Initializes a new instance of the ApplyMask class.

ApplyMask ( UnmanagedImage unmanagedMaskImage ) : System

Initializes a new instance of the ApplyMask class.

ApplyMask ( byte mask ) : System

Initializes a new instance of the ApplyMask class.

Защищенные методы

Метод Описание
ProcessFilter ( UnmanagedImage image, Rectangle rect ) : void

Process the filter on the specified image.

Приватные методы

Метод Описание
ApplyMask ( ) : System
ProcessImage ( UnmanagedImage image, Rectangle rect, byte mask, int maskLineSize ) : void

Описание методов

ApplyMask() публичный метод

Initializes a new instance of the ApplyMask class.
public ApplyMask ( Bitmap maskImage ) : System
maskImage System.Drawing.Bitmap Mask image to use.
Результат System

ApplyMask() публичный метод

Initializes a new instance of the ApplyMask class.
public ApplyMask ( UnmanagedImage unmanagedMaskImage ) : System
unmanagedMaskImage UnmanagedImage Unmanaged mask image to use.
Результат System

ApplyMask() публичный метод

Initializes a new instance of the ApplyMask class.
public ApplyMask ( byte mask ) : System
mask byte to use.
Результат System

ProcessFilter() защищенный метод

Process the filter on the specified image.
None of the possible mask properties were set. Need to provide mask before applying the filter. Invalid size of provided mask. Its size must be the same as the size of the image to mask.
protected ProcessFilter ( UnmanagedImage image, Rectangle rect ) : void
image UnmanagedImage Source image data.
rect System.Drawing.Rectangle Image rectangle for processing by the filter.
Результат void