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

Contrast adjusting in RGB color space.

The filter operates in RGB color space and adjusts pixels' contrast value by increasing RGB values of bright pixel and decreasing RGB values of dark pixels (or vise versa if contrast needs to be decreased). The filter is based on LevelsLinear filter and simply sets all input ranges to (Factor, 255-Factor) and all output range to (0, 255) in the case if the factor value is positive. If the factor value is negative, then all input ranges are set to (0, 255 ) and all output ranges are set to (-Factor, 255_Factor).

See LevelsLinear documentation forr more information about the base filter.

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

Sample usage:

// create filter ContrastCorrection filter = new ContrastCorrection( 15 ); // apply the filter filter.ApplyInPlace( image );

Initial image:

Result image:

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

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

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

Initializes a new instance of the ContrastCorrection class.

ContrastCorrection ( int factor ) : System

Initializes a new instance of the ContrastCorrection class.

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

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

Process the filter on the specified image.

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

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

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

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

Initializes a new instance of the ContrastCorrection class.
public ContrastCorrection ( int factor ) : System
factor int Contrast adjusting factor.
Результат 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