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

Channels filters.

The filter does color channels' filtering by clearing (filling with specified values) values, which are inside/outside of the specified value's range. The filter allows to fill certain ranges of RGB color channels with specified value.

The filter is similar to ColorFiltering, but operates with not entire pixels, but with their RGB values individually. This means that pixel itself may not be filtered (will be kept), but one of its RGB values may be filtered if they are inside/outside of specified range.

The filter accepts 24 and 32 bpp color images for processing.

Sample usage:

// create filter ChannelFiltering filter = new ChannelFiltering( ); // set channels' ranges to keep filter.Red = new IntRange( 0, 255 ); filter.Green = new IntRange( 100, 255 ); filter.Blue = new IntRange( 100, 255 ); // apply the filter filter.ApplyInPlace( image );

Initial image:

Result image:

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

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

Метод Описание
ChannelFiltering ( ) : System

Initializes a new instance of the ChannelFiltering class.

ChannelFiltering ( IntRange red, IntRange green, IntRange blue ) : System

Initializes a new instance of the ChannelFiltering class.

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

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

Process the filter on the specified image.

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

Метод Описание
CalculateMap ( IntRange range, byte fill, bool fillOutsideRange, byte map ) : void

Calculate filtering map.

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

ChannelFiltering() публичный Метод

Initializes a new instance of the ChannelFiltering class.
public ChannelFiltering ( ) : System
Результат System

ChannelFiltering() публичный Метод

Initializes a new instance of the ChannelFiltering class.
public ChannelFiltering ( IntRange red, IntRange green, IntRange blue ) : System
red AForge.IntRange Red channel's filtering range.
green AForge.IntRange Green channel's filtering range.
blue AForge.IntRange Blue channel's filtering range.
Результат System

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

Process the filter on the specified image.
protected ProcessFilter ( UnmanagedImage image, Rectangle rect ) : void
image UnmanagedImage Source image data.
rect System.Drawing.Rectangle Image rectangle for processing by the filter.
Результат void