Palette File Format ------------------- offset length content 0 8 "DISPpal0" 8 4 number of colors(Intel order). 12 4 R,G,B,A for each color. ... ... ...... YUV Format (from Berkeley MPEG ENCODER package) ---------- The U and V components are subsampled 4:1. To give you an idea of what format the YUV file must be in, the following code will read in a YUV file: unsigned char **y_data, **cr_data, **cb_data; void ReadYUV(char *fileName, int width, int height) { FILE *fpointer; register int y; /* should allocate memory for y_data, cr_data, cb_data here */ fpointer = fopen(fileName, "r"); for (y = 0; y < height; y++) /* Y */ fread(y_data[y], 1, width, fpointer); for (y = 0; y < height / 2; y++) /* U */ fread(cb_data[y], 1, width / 2, fpointer); for (y = 0; y < height / 2; y++) /* V */ fread(cr_data[y], 1, width / 2, fpointer); fclose(fpointer); } Raw RGB Format -------------- for (y = 0; y < height; ++y) for (x = 0; x < width; ++x) { read RED; /* 1 byte */ read GREEN; /* 1 byte */ read BLUE; /* 1 byte */ } Raw GREY Format --------------- for (y = 0; y < height; ++y) for (x = 0; x < width; ++x) read GREY; /* 1 byte */