C# Class AForge.Imaging.Filters.ExtractChannel

Extract RGB channel from image.

Extracts specified channel of color image and returns it as grayscale image.

The filter accepts 24, 32, 48 and 64 bpp color images and produces 8 (if source is 24 or 32 bpp image) or 16 (if source is 48 or 64 bpp image) bpp grayscale image.

Sample usage:

// create filter ExtractChannel filter = new ExtractChannel( RGB.G ); // apply the filter Bitmap channelImage = filter.Apply( image );

Initial image:

Result image:

Inheritance: BaseFilter
Afficher le fichier Open project: holisticware-admin/MonoVersal.AForgeNET Class Usage Examples

Méthodes publiques

Méthode Description
ExtractChannel ( ) : System

Initializes a new instance of the ExtractChannel class.

ExtractChannel ( short channel ) : System

Initializes a new instance of the ExtractChannel class.

Méthodes protégées

Méthode Description
ProcessFilter ( UnmanagedImage sourceData, UnmanagedImage destinationData ) : void

Process the filter on the specified image.

Method Details

ExtractChannel() public méthode

Initializes a new instance of the ExtractChannel class.
public ExtractChannel ( ) : System
Résultat System

ExtractChannel() public méthode

Initializes a new instance of the ExtractChannel class.
public ExtractChannel ( short channel ) : System
channel short ARGB channel to extract.
Résultat System

ProcessFilter() protected méthode

Process the filter on the specified image.
Can not extract alpha channel from none ARGB image. The /// exception is throw, when alpha channel is requested from RGB image.
protected ProcessFilter ( UnmanagedImage sourceData, UnmanagedImage destinationData ) : void
sourceData UnmanagedImage Source image data.
destinationData UnmanagedImage Destination image data.
Résultat void