C# Класс ScreenToGif.Encoding.NeuQuant

Neural Quantization Class
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
Map ( int b, int g, int r ) : int

Search for BGR values 0..255 (after net is unbiased) and return color index.

NeuQuant ( byte thePic, int len, int sample ) : System

Initialise the quantization process in range (0,0,0) to (255,255,255).

Process ( ) : byte[]

Starts the quantization.

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

Метод Описание
AlterNeighbour ( int radValue, int bestBias, int b, int g, int r ) : void

Move adjacent neurons by precomputed alpha*(1-((i-j)^2/[r]^2)) in _radpower[|i-j|]

Altersingle ( int alpha, int bestBias, int b, int g, int r ) : void

Move neuron (bestBias) towards biased (b,g,r) by factor alpha.

ColorMap ( ) : byte[]
Contest ( int b, int g, int r ) : int

Search for biased BGR values.

Inxbuild ( ) : void

Insertion sort of network and building of _netindex[0..255] (to do after unbias).

Learn ( ) : void

Main Learning Loop.

Unbiasnet ( ) : void

Unbias network to give byte values 0..255 and record position to prepare for sort.

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

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

Search for BGR values 0..255 (after net is unbiased) and return color index.
public Map ( int b, int g, int r ) : int
b int Blue
g int Green
r int Red
Результат int

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

Initialise the quantization process in range (0,0,0) to (255,255,255).
public NeuQuant ( byte thePic, int len, int sample ) : System
thePic byte The image in bytes.
len int The length of the pixels.
sample int Sample interval for the quantitizer.
Результат System

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

Starts the quantization.
public Process ( ) : byte[]
Результат byte[]