lib/colHash.c File Reference

#include "common.h"
#include "memgfx.h"
#include "colHash.h"

Include dependency graph for colHash.c:

Go to the source code of this file.

Functions

colHashcolHashNew ()
void colHashFree (struct colHash **pEl)
colHashElcolHashAdd (struct colHash *cHash, unsigned r, unsigned g, unsigned b, int ix)
colHashElcolHashLookup (struct colHash *cHash, unsigned r, unsigned g, unsigned b)

Variables

static char const rcsid [] = "$Id: colHash.c,v 1.3 2003/05/06 07:33:41 kate Exp $"


Function Documentation

struct colHashEl* colHashAdd ( struct colHash cHash,
unsigned  r,
unsigned  g,
unsigned  b,
int  ix 
) [read]

Definition at line 25 of file colHash.c.

References rgbColor::b, colHashEl::col, colHashFunc, colHash::freeEl, rgbColor::g, colHashEl::ix, colHash::lists, rgbColor::r, and slAddHead.

Referenced by mgAddColor(), and pscmAddColor().

00028 {
00029 struct colHashEl *che = cHash->freeEl++, **pCel;
00030 che->col.r = r;
00031 che->col.g = g;
00032 che->col.b = b;
00033 che->ix = ix;
00034 pCel = &cHash->lists[colHashFunc(r,g,b)];
00035 slAddHead(pCel, che);
00036 return che;
00037 }

Here is the caller graph for this function:

void colHashFree ( struct colHash **  pEl  ) 

Definition at line 19 of file colHash.c.

References freez().

Referenced by mgFree(), and pscmClose().

00021 {
00022 freez(pEl);
00023 }

Here is the call graph for this function:

Here is the caller graph for this function:

struct colHashEl* colHashLookup ( struct colHash cHash,
unsigned  r,
unsigned  g,
unsigned  b 
) [read]

Definition at line 39 of file colHash.c.

References rgbColor::b, colHashEl::col, colHashFunc, rgbColor::g, colHash::lists, colHashEl::next, and rgbColor::r.

Referenced by mgFindColor(), and pscmFindColorIx().

00042 {
00043 struct colHashEl *che;
00044 for (che = cHash->lists[colHashFunc(r,g,b)]; che != NULL; che = che->next)
00045     if (che->col.r == r && che->col.g == g && che->col.b == b)
00046         return che;
00047 return NULL;
00048 }

Here is the caller graph for this function:

struct colHash* colHashNew (  )  [read]

Definition at line 10 of file colHash.c.

References AllocVar, colHash::elBuf, and colHash::freeEl.

Referenced by mgNew(), and pscmOpen().

00012 {
00013 struct colHash *cHash;
00014 AllocVar(cHash);
00015 cHash->freeEl = cHash->elBuf;
00016 return cHash;
00017 }

Here is the caller graph for this function:


Variable Documentation

char const rcsid[] = "$Id: colHash.c,v 1.3 2003/05/06 07:33:41 kate Exp $" [static]

Definition at line 8 of file colHash.c.


Generated on Tue Dec 25 19:39:51 2007 for blat by  doxygen 1.5.2