--- ray/src/rt/colortab.c 1990/01/16 16:00:00 1.10 +++ ray/src/rt/colortab.c 1990/02/23 10:08:33 1.13 @@ -80,7 +80,7 @@ int ncolors; /* partition color space */ cut(ctree, 0, CLRCUBE, 0, ncolors); /* clear histogram */ - bzero(histo, sizeof(histo)); + bzero((char *)histo, sizeof(histo)); /* return number of colors used */ return(ncolors); } @@ -129,9 +129,10 @@ int (*set_pixel)(); clrtab[h].ent[RED] = r; clrtab[h].ent[GRN] = g; /* reassign pixel */ clrtab[h].ent[BLU] = b; -#ifdef notdef - printf("pixel %d = (%d,%d,%d) (%d refs)\n", +#ifdef DEBUG + sprintf(errmsg, "pixel %d = (%d,%d,%d) (%d refs)\n", h, r, g, b, clrtab[h].n); + eputs(errmsg); #endif (*set_pixel)(h, r, g, b); } @@ -155,12 +156,22 @@ double gam; set_cmap(rmap, gmap, bmap) /* set custom color correction map */ BYTE *rmap, *gmap, *bmap; { - bcopy(rmap, clrmap[RED], 256); - bcopy(gmap, clrmap[GRN], 256); - bcopy(bmap, clrmap[BLU], 256); + bcopy((char *)rmap, (char *)clrmap[RED], 256); + bcopy((char *)gmap, (char *)clrmap[GRN], 256); + bcopy((char *)bmap, (char *)clrmap[BLU], 256); } +map_color(rgb, col) /* map a color to a byte triplet */ +BYTE rgb[3]; +COLOR col; +{ + rgb[RED] = map_col(col,RED); + rgb[GRN] = map_col(col,GRN); + rgb[BLU] = map_col(col,BLU); +} + + static cut(tree, level, box, c0, c1) /* partition color space */ register CNODE *tree; @@ -176,7 +187,7 @@ int c0, c1; } /* split box */ *tree = split(box); - bcopy(box, kb, sizeof(kb)); + bcopy((char *)box, (char *)kb, sizeof(kb)); /* do left (lesser) branch */ kb[prim(*tree)][1] = part(*tree); cut(tree+(1<>1);