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