16 #define TACHYON_INTERNAL 1 22 static void putbyte(FILE * outf,
unsigned char val) {
25 fwrite(buf, 1, 1, outf);
28 static void putshort(FILE * outf,
unsigned short val) {
32 fwrite(buf, 2, 1, outf);
35 static void putint(FILE * outf,
unsigned int val) {
37 buf[0] = (
unsigned char) (val >> 24);
38 buf[1] = (
unsigned char) (val >> 16);
39 buf[2] = (
unsigned char) (val >> 8);
40 buf[3] = (
unsigned char) (val & 0xff);
41 fwrite(buf, 4, 1, outf);
44 int writergb(
char *name,
int xres,
int yres,
unsigned char *imgdata) {
49 if ((ofp = fopen(name,
"wb")) != NULL) {
54 putshort(ofp, (
unsigned short) xres);
55 putshort(ofp, (
unsigned short) yres);
63 strcpy(iname,
"Tachyon Ray Tracer Image");
64 fwrite(iname, 80, 1, ofp);
73 fwrite(&imgdata[(y*xres + x)*3 + i], 1, 1, ofp);
int writergb(char *name, int xres, int yres, unsigned char *imgdata)
Tachyon cross-platform timers, special math function wrappers, and RNGs.
#define IMAGENOERR
no error
static void putbyte(FILE *outf, unsigned char val)
static void putshort(FILE *outf, unsigned short val)
static void putint(FILE *outf, unsigned int val)
Tachyon public API function prototypes and declarations used to drive the ray tracing engine...