| 1 |
greg |
1.2 |
/* Copyright 1988 Regents of the University of California */ |
| 2 |
greg |
1.1 |
|
| 3 |
|
|
/* SCCSid "$SunId$ LBL" */ |
| 4 |
greg |
1.2 |
|
| 5 |
|
|
#include <stdio.h> |
| 6 |
greg |
1.1 |
#include "pic.h" |
| 7 |
|
|
|
| 8 |
|
|
#define red(i) ((i)>>7&0xf8|4) /* 5 bits red, 5 bits green, 5 bits blue */ |
| 9 |
|
|
#define gre(i) ((i)>>2&0xf8|4) |
| 10 |
|
|
#define blu(i) ((i)<<3&0xf8|4) |
| 11 |
|
|
#define len 32768 |
| 12 |
|
|
|
| 13 |
|
|
extern int hist[len]; /* list of frequencies or pixelvalues for coded color */ |
| 14 |
|
|
|
| 15 |
|
|
extern colormap color; /* quantization colormap */ |
| 16 |
|
|
extern int n; /* number of colors in it */ |
| 17 |
|
|
|
| 18 |
|
|
#define linealloc(xdim) (pixel *)emalloc(sizeof(pixel)*xdim) |
| 19 |
|
|
#define line3alloc(xdim) (rgbpixel *)emalloc(sizeof(rgbpixel)*xdim) |
| 20 |
|
|
|
| 21 |
|
|
extern char *emalloc(); |