ScreenToGif.Encoding.NeuQuant.NeuQuant C# (CSharp) Method

NeuQuant() public method

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.
return System
        public NeuQuant(byte[] thePic, int len, int sample)
        {
            _thepicture = thePic;
            _lengthCount = len;
            _samplefac = sample;

            _network = new int[Netsize][];

            for (int i = 0; i < Netsize; i++)
            {
                _network[i] = new int[4];

                _network[i][0] = _network[i][1] = _network[i][2] = (i << (Netbiasshift + 8)) / Netsize;
                _freq[i] = IntBias / Netsize; /* 1/netsize */
                _bias[i] = 0;
            }
        }