C# Class SimplePaletteQuantizer.Quantizers.MedianCut.MedianCutCube

Datei anzeigen Open project: RHY3756547/FreeSO Class Usage Examples

Public Methods

Method Description
IsColorIn ( Color color ) : System.Boolean

Determines whether the color is in the space of this cube.

MedianCutCube ( ICollection colors ) : System

Initializes a new instance of the MedianCutCube class.

SetPaletteIndex ( Int32 newPaletteIndex ) : void

Assigns a palette index to this cube, to be later found by a GetPaletteIndex method.

SplitAtMedian ( Byte componentIndex, MedianCutCube &firstMedianCutCube, MedianCutCube &secondMedianCutCube ) : void

Splits this cube's color list at median index, and returns two newly created cubes.

Private Methods

Method Description
Shrink ( ) : void

Shrinks this cube to the least dimensions that covers all the colors in the RGB space.

Method Details

IsColorIn() public method

Determines whether the color is in the space of this cube.
public IsColorIn ( Color color ) : System.Boolean
color Color The color to be checked, if it's contained in this cube.
return System.Boolean

MedianCutCube() public method

Initializes a new instance of the MedianCutCube class.
public MedianCutCube ( ICollection colors ) : System
colors ICollection The colors.
return System

SetPaletteIndex() public method

Assigns a palette index to this cube, to be later found by a GetPaletteIndex method.
public SetPaletteIndex ( Int32 newPaletteIndex ) : void
newPaletteIndex System.Int32 The palette index to be assigned to this cube.
return void

SplitAtMedian() public method

Splits this cube's color list at median index, and returns two newly created cubes.
public SplitAtMedian ( Byte componentIndex, MedianCutCube &firstMedianCutCube, MedianCutCube &secondMedianCutCube ) : void
componentIndex Byte Index of the component (red = 0, green = 1, blue = 2).
firstMedianCutCube MedianCutCube The first created cube.
secondMedianCutCube MedianCutCube The second created cube.
return void