C# Class SimplePaletteQuantizer.Quantizers.BaseColorQuantizer

Inheritance: IColorQuantizer
Datei anzeigen Open project: RHY3756547/FreeSO

Protected Properties

Property Type Description
UniqueColors Int16>.ConcurrentDictionary

Public Methods

Method Description
AddColor ( Color color, Int32 x, Int32 y ) : void

See IColorQuantizer.AddColor for more details.

ChangePathProvider ( IPathProvider pathProvider ) : void

Changes the path provider.

Finish ( ) : void

See IColorQuantizer.Finish for more details.

GetColorCount ( ) : Int32

See IColorQuantizer.GetColorCount for more details.

GetPalette ( Int32 colorCount ) : List

See IColorQuantizer.GetPalette for more details.

GetPaletteIndex ( Color color, Int32 x, Int32 y ) : Int32

See IColorQuantizer.GetPaletteIndex for more details.

GetPointPath ( Int32 width, Int32 heigth ) : IList

See IPathProvider.GetPointPath for more details.

Prepare ( ImageBuffer image ) : void

See IColorQuantizer.Prepare for more details.

Protected Methods

Method Description
BaseColorQuantizer ( ) : System

Initializes a new instance of the BaseColorQuantizer class.

OnAddColor ( Color color, Int32 key, Int32 x, Int32 y ) : void

Called when color is to be added.

OnCreateDefaultPathProvider ( ) : IPathProvider

Called when a need to create default path provider arisen.

OnFinish ( ) : void

Called when about to clear left-overs after quantization.

OnGetColorCount ( ) : Int32

Called when get color count.

OnGetPalette ( Int32 colorCount ) : List

Called when quantized palette is needed.

OnGetPaletteIndex ( Color color, Int32 key, Int32 x, Int32 y, Int32 &paletteIndex ) : void

Called when get palette index for a given color should be returned.

OnPrepare ( ImageBuffer image ) : void

Called when quantizer is about to be prepared for next round.

Private Methods

Method Description
GetPathProvider ( ) : IPathProvider

Method Details

AddColor() public method

See IColorQuantizer.AddColor for more details.
public AddColor ( Color color, Int32 x, Int32 y ) : void
color Color
x System.Int32
y System.Int32
return void

BaseColorQuantizer() protected method

Initializes a new instance of the BaseColorQuantizer class.
protected BaseColorQuantizer ( ) : System
return System

ChangePathProvider() public method

Changes the path provider.
public ChangePathProvider ( IPathProvider pathProvider ) : void
pathProvider IPathProvider The path provider.
return void

Finish() public method

See IColorQuantizer.Finish for more details.
public Finish ( ) : void
return void

GetColorCount() public method

See IColorQuantizer.GetColorCount for more details.
public GetColorCount ( ) : Int32
return System.Int32

GetPalette() public method

See IColorQuantizer.GetPalette for more details.
public GetPalette ( Int32 colorCount ) : List
colorCount System.Int32
return List

GetPaletteIndex() public method

See IColorQuantizer.GetPaletteIndex for more details.
public GetPaletteIndex ( Color color, Int32 x, Int32 y ) : Int32
color Color
x System.Int32
y System.Int32
return System.Int32

GetPointPath() public method

See IPathProvider.GetPointPath for more details.
public GetPointPath ( Int32 width, Int32 heigth ) : IList
width System.Int32
heigth System.Int32
return IList

OnAddColor() protected method

Called when color is to be added.
protected OnAddColor ( Color color, Int32 key, Int32 x, Int32 y ) : void
color Color
key System.Int32
x System.Int32
y System.Int32
return void

OnCreateDefaultPathProvider() protected method

Called when a need to create default path provider arisen.
protected OnCreateDefaultPathProvider ( ) : IPathProvider
return IPathProvider

OnFinish() protected method

Called when about to clear left-overs after quantization.
protected OnFinish ( ) : void
return void

OnGetColorCount() protected method

Called when get color count.
protected OnGetColorCount ( ) : Int32
return System.Int32

OnGetPalette() protected method

Called when quantized palette is needed.
protected OnGetPalette ( Int32 colorCount ) : List
colorCount System.Int32
return List

OnGetPaletteIndex() protected method

Called when get palette index for a given color should be returned.
protected OnGetPaletteIndex ( Color color, Int32 key, Int32 x, Int32 y, Int32 &paletteIndex ) : void
color Color
key System.Int32
x System.Int32
y System.Int32
paletteIndex System.Int32
return void

OnPrepare() protected method

Called when quantizer is about to be prepared for next round.
protected OnPrepare ( ImageBuffer image ) : void
image SimplePaletteQuantizer.Helpers.ImageBuffer
return void

Prepare() public method

See IColorQuantizer.Prepare for more details.
public Prepare ( ImageBuffer image ) : void
image SimplePaletteQuantizer.Helpers.ImageBuffer
return void

Property Details

UniqueColors protected_oe property

protected ConcurrentDictionary UniqueColors
return Int16>.ConcurrentDictionary