Back to index

radiance  4R0+20100331
pic.h
Go to the documentation of this file.
00001 /* RCSid: $Id: pic.h,v 2.4 2004/03/28 20:33:14 schorsch Exp $ */
00002 /* the following three structures are used by ciq */
00003 
00004 #ifndef _RAD_PIC_H_
00005 #define _RAD_PIC_H_
00006 
00007 #ifdef __cplusplus
00008 extern "C" {
00009 #endif
00010 
00011 typedef int colormap[3][256];
00012 
00013 typedef unsigned char pixel;
00014 
00015 typedef struct {
00016     pixel r,g,b;
00017 } rgbpixel;
00018 
00019 #define  rgb_bright(p)             (int)((77L*(p)->r+151L*(p)->g+28L*(p)->b)/256)
00020 
00021 /* image resolution */
00022 extern int    xmax,ymax;
00023 
00024        /* defined in closest.c */
00025 extern void initializeclosest(void);
00026 extern int closest(int r, int g, int b);
00027 
00028        /* defined in cut.c */
00029 extern int makecm(int nw, int *na);
00030 
00031        /* defined in ciq.c */
00032 extern void ciq(int dith, int nw, int synth, colormap cm);
00033 
00034        /* defined in biq.c */
00035 extern void biq(int dith, int nw, int synth, colormap cm);
00036 
00037        /* defined in in the calling program */
00038 extern void picreadcm(colormap  map);
00039 extern void picwritecm(colormap  cm);
00040 extern void picwriteline(int  y, pixel  *l);
00041 extern void picreadline3(int  y, rgbpixel  *l3);
00042 
00043 
00044 #ifdef __cplusplus
00045 }
00046 #endif
00047 #endif /* _RAD_PIC_H_ */
00048