# E:/DevIL/src-IL/src/il_neuquant.c File Reference

`#include "il_internal.h"`

## Defines

#define | prime1 499
#define | prime2 491
#define | prime3 487
#define | prime4 503
#define | minpicturebytes (3*prime4)
#define | netsize 256
#define | maxnetpos (netsizethink-1)
#define | netbiasshift 4
#define | ncycles 100
#define | intbiasshift 16
#define | intbias (((ILint) 1)<<intbiasshift)
#define | gammashift 10
#define | gamma (((ILint) 1)<<gammashift)
#define | betashift 10
#define | beta (intbias>>betashift)
#define | betagamma (intbias<<(gammashift-betashift))
#define | initrad (netsize>>3)
#define | radiusbiasshift 6
#define | radiusbias (((ILint) 1)<<radiusbiasshift)
#define | initradius (initrad*radiusbias)
#define | radiusdec 30
#define | alphabiasshift 10
#define | initalpha (((ILint) 1)<<alphabiasshift)
#define | radbiasshift 8
#define | radbias (((ILint) 1)<<radbiasshift)
#define | alpharadbshift (alphabiasshift+radbiasshift)
#define | alpharadbias (((ILint) 1)<<alpharadbshift)

## Typedefs

typedef int | pixel [4]

## Functions

void | initnet (ILubyte *thepic, ILint len, ILint sample)
void | unbiasnet ()
void | inxbuild ()
ILubyte | inxsearch (ILint b, ILint g, ILint r)
void | learn ()
ILint | contest (ILint b, ILint g, ILint r)
void | altersingle (ILint alpha, ILint i, ILint b, ILint g, ILint r)
void | alterneigh (ILint rad, ILint i, ILint b, ILint g, ILint r)
ILimage * | iNeuQuant (ILimage *Image, ILuint NumCols)

## Variables

ILint | alphadec
unsigned char * | thepicture
int | lengthcount
int | samplefac
int | netindex [256]
int | bias [netsize]
int | freq [netsize]
int | radpower [initrad]
int | netsizethink

## Define Documentation

#define alphabiasshift 10

#define alpharadbias (((ILint) 1)<<alpharadbshift)

Referenced by alterneigh().

#define alpharadbshift (alphabiasshift+radbiasshift)

#define beta (intbias>>betashift)

Referenced by contest().

#define betagamma (intbias<<(gammashift-betashift))

Referenced by contest().

#define betashift 10

Referenced by contest().

#define gamma (((ILint) 1)<<gammashift)

#define gammashift 10

Referenced by contest().

#define initalpha (((ILint) 1)<<alphabiasshift)

Referenced by altersingle(), and learn().

#define initrad (netsize>>3)

#define initradius (initrad*radiusbias)

Referenced by learn().

#define intbias (((ILint) 1)<<intbiasshift)

Referenced by initnet().

#define intbiasshift 16

Referenced by contest().

#define maxnetpos (netsizethink-1)

Referenced by inxbuild().

#define minpicturebytes (3*prime4)

#define ncycles 100

Referenced by learn().

#define netbiasshift 4

Referenced by contest(), initnet(), learn(), and unbiasnet().

#define netsize 256

Referenced by initnet().

#define prime1 499

Referenced by learn().

#define prime2 491

Referenced by learn().

#define prime3 487

Referenced by learn().

#define prime4 503

Referenced by learn().

#define radbias (((ILint) 1)<<radbiasshift)

Referenced by learn().

#define radbiasshift 8

#define radiusbias (((ILint) 1)<<radiusbiasshift)

#define radiusbiasshift 6

Referenced by learn().

#define radiusdec 30

Referenced by learn().

## Typedef Documentation

typedef int pixel[4]

## Function Documentation

void alterneigh | ( | ILint | rad,
|  | ILint | i,
|  | ILint | b,
|  | ILint | g,
|  | ILint | r |
| ) |  |  |

Referenced by learn().

void altersingle | ( | ILint | alpha,
|  | ILint | i,
|  | ILint | b,
|  | ILint | g,
|  | ILint | r |
| ) |  |  |

Referenced by learn().

ILint contest | ( | ILint | b,
|  | ILint | g,
|  | ILint | r |
| ) |  |  |

Referenced by learn().

ILimage* iNeuQuant | ( | ILimage * | Image,
|  | ILuint | NumCols |
| ) |  |  |

Referenced by iConvertImage(), and iSaveWbmpInternal().

void initnet | ( | ILubyte * | thepic,
|  | ILint | len,
|  | ILint | sample |
| ) |  |  |

Referenced by iNeuQuant().

void inxbuild | ( |  | ) |

Referenced by iNeuQuant().

ILubyte inxsearch | ( | ILint | b,
|  | ILint | g,
|  | ILint | r |
| ) |  |  |

Referenced by iNeuQuant().

void learn | ( |  | ) |

Referenced by iNeuQuant().

void unbiasnet | ( |  | ) |

Referenced by iNeuQuant().

## Variable Documentation

ILint alphadec

Referenced by learn().

int bias[netsize]

Referenced by contest(), and initnet().

int freq[netsize]

Referenced by contest(), and initnet().

int lengthcount

Referenced by initnet(), and learn().

int netindex[256]

Referenced by inxbuild(), and inxsearch().

int netsizethink

Referenced by alterneigh(), contest(), iNeuQuant(), initnet(), inxbuild(), inxsearch(), and unbiasnet().

int radpower[initrad]

Referenced by alterneigh(), and learn().

int samplefac

Referenced by initnet(), and learn().

unsigned char* thepicture

Referenced by initnet(), and learn().