e70152e44cc66cc599ff6b699eb8adc07f3e656a kent Sat May 24 21:09:34 2014 -0700 Adding Copyright NNNN Regents of the University of California to all files I believe with reasonable certainty were developed under UCSC employ or as part of Genome Browser copyright assignment. diff --git src/lib/colHash.c src/lib/colHash.c index 49d1537..4d085ed 100644 --- src/lib/colHash.c +++ src/lib/colHash.c @@ -1,48 +1,51 @@ /* colHash - stuff for fast lookup of index given an * rgb value. */ +/* Copyright (C) 2011 The Regents of the University of California + * See README in this or parent directory for licensing information. */ + #include "common.h" #include "memgfx.h" #include "colHash.h" struct colHash *colHashNew() /* Get a new color hash. */ { struct colHash *cHash; AllocVar(cHash); cHash->freeEl = cHash->elBuf; return cHash; } void colHashFree(struct colHash **pEl) /* Free up color hash. */ { freez(pEl); } struct colHashEl *colHashAdd(struct colHash *cHash, unsigned r, unsigned g, unsigned b, int ix) /* Add new element to color hash. */ { struct colHashEl *che = cHash->freeEl++, **pCel; che->col.r = r; che->col.g = g; che->col.b = b; che->ix = ix; pCel = &cHash->lists[colHashFunc(r,g,b)]; slAddHead(pCel, che); return che; } struct colHashEl *colHashLookup(struct colHash *cHash, unsigned r, unsigned g, unsigned b) /* Lookup value in hash. */ { struct colHashEl *che; for (che = cHash->lists[colHashFunc(r,g,b)]; che != NULL; che = che->next) if (che->col.r == r && che->col.g == g && che->col.b == b) return che; return NULL; }