C# 클래스 AForge.Imaging.Filters.ColorRemapping

Color remapping.

The filter allows to remap colors of the image. Unlike LevelsLinear filter the filter allow to do non-linear remapping. For each pixel of specified image the filter changes its values (value of each color plane) to values, which are stored in remapping arrays by corresponding indexes. For example, if pixel's RGB value equals to (32, 96, 128), the filter will change it to (RedMap[32], GreenMap[96], BlueMap[128]).

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

Sample usage:

// create map byte[] map = new byte[256]; for ( int i = 0; i < 256; i++ ) { map[i] = (byte) Math.Min( 255, Math.Pow( 2, (double) i / 32 ) ); } // create filter ColorRemapping filter = new ColorRemapping( map, map, map ); // apply the filter filter.ApplyInPlace( image );

Initial image:

Result image:

상속: BaseInPlacePartialFilter
파일 보기 프로젝트 열기: holisticware-admin/MonoVersal.AForgeNET

공개 메소드들

메소드 설명
ColorRemapping ( ) : System

Initializes a new instance of the ColorRemapping class.

Initializes the filter without any remapping. All pixel values are mapped to the same values.

ColorRemapping ( byte grayMap ) : System

Initializes a new instance of the ColorRemapping class.

This constructor is supposed for grayscale images.

ColorRemapping ( byte redMap, byte greenMap, byte blueMap ) : System

Initializes a new instance of the ColorRemapping class.

보호된 메소드들

메소드 설명
ProcessFilter ( UnmanagedImage image, Rectangle rect ) : void

Process the filter on the specified image.

메소드 상세

ColorRemapping() 공개 메소드

Initializes a new instance of the ColorRemapping class.
Initializes the filter without any remapping. All pixel values are mapped to the same values.
public ColorRemapping ( ) : System
리턴 System

ColorRemapping() 공개 메소드

Initializes a new instance of the ColorRemapping class.
This constructor is supposed for grayscale images.
public ColorRemapping ( byte grayMap ) : System
grayMap byte Gray map.
리턴 System

ColorRemapping() 공개 메소드

Initializes a new instance of the ColorRemapping class.
public ColorRemapping ( byte redMap, byte greenMap, byte blueMap ) : System
redMap byte Red map.
greenMap byte Green map.
blueMap byte Blue map.
리턴 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