Back to index

radiance  4R0+20100331
Functions
clrtab.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int new_histo (int n)
void cnt_pixel (BYTE col[])
void cnt_colrs (COLR *cs, int n)
int new_clrtab (int ncolors)
int map_pixel (BYTE col[])
void map_colrs (BYTE *bs, COLR *cs, int n)
void dith_colrs (BYTE *bs, COLR *cs, int n)
int neu_init (long npixels)
void neu_pixel (BYTE col[])
void neu_colrs (COLR *cs, int n)
int neu_clrtab (int ncolors)
int neu_map_pixel (BYTE col[])
void neu_map_colrs (BYTE *bs, COLR *cs, int n)
void neu_dith_colrs (BYTE *bs, COLR *cs, int n)

Function Documentation

void cnt_colrs ( COLR cs,
int  n 
)
void cnt_pixel ( BYTE  col[])
void dith_colrs ( BYTE bs,
COLR cs,
int  n 
)
void map_colrs ( BYTE bs,
COLR cs,
int  n 
)
int map_pixel ( BYTE  col[])
int neu_clrtab ( int  ncolors)

Definition at line 137 of file neuclrtab.c.

{
       clrtabsiz = ncolors;
       if (clrtabsiz > 256) clrtabsiz = 256;
       initnet();
       learn();
       unbiasnet();
       cpyclrtab();
       inxbuild();
                            /* we're done with our samples */
       free((void *)thesamples);
                            /* reset dithering function */
       neu_dith_colrs((BYTE *)NULL, (COLR *)NULL, 0);
                            /* return new color table size */
       return(clrtabsiz);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void neu_colrs ( COLR cs,
int  n 
)

Here is the caller graph for this function:

void neu_dith_colrs ( BYTE bs,
COLR cs,
int  n 
)

Here is the caller graph for this function:

int neu_init ( long  npixels)

Definition at line 62 of file neuclrtab.c.

{
       register int  nsleft;
       register long sv;
       double rval, cumprob;
       long   npleft;

       nsamples = npixels/samplefac;
       if (nsamples < 600)
              return(-1);
       thesamples = (BYTE *)malloc(nsamples*3);
       if (thesamples == NULL)
              return(-1);
       cursamp = thesamples;
       npleft = npixels;
       nsleft = nsamples;
       while (nsleft) {
              rval = frandom();    /* random distance to next sample */
              sv = 0;
              cumprob = 0.;
              while ((cumprob += (1.-cumprob)*nsleft/(npleft-sv)) < rval)
                     sv++;
              if (nsleft == nsamples)
                     skipcount = sv;
              else {
                     setskip(cursamp, sv);
                     cursamp += 3;
              }
              npleft -= sv+1;
              nsleft--;
       }
       setskip(cursamp, npleft);   /* tag on end to skip the rest */
       cursamp = thesamples;
       return(0);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void neu_map_colrs ( BYTE bs,
COLR cs,
int  n 
)

Here is the caller graph for this function:

int neu_map_pixel ( BYTE  col[])

Here is the caller graph for this function:

void neu_pixel ( BYTE  col[])
int new_clrtab ( int  ncolors)

Definition at line 86 of file clrtab.c.

{
       if (ncolors < 1)
              return(0);
       if (ncolors > 256)
              ncolors = 256;
                            /* partition color space */
       cut(CLRCUBE, 0, ncolors);
#ifdef CLOSEST
       closest(ncolors);    /* ensure colors picked are closest */
#endif
                            /* reset dithering function */
       dith_colrs((BYTE *)NULL, (COLR *)NULL, 0);
                            /* return new color table size */
       return(ncolors);
}

Here is the call graph for this function:

Here is the caller graph for this function:

int new_histo ( int  n)

Definition at line 54 of file clrtab.c.

{
       memset((void *)histo, '\0', sizeof(histo));
       return(0);
}

Here is the caller graph for this function: