Obviously this is a very simple format, just the way I like it
Also the image sizes are gigantic, but I don't really care.
Note that the Indigo Tone Mapper program expects the colour space to be XYZ.
Do whatever you want with this format, the spec is 'public domain'.
Look forward to seeing some cool stuff
Code: Select all
/*=====================================================================
IndigoImageHeader
-----------------
This should be stored on disk as a tightly packed structure (no padding between elements)
in little endian byte order.
Image data starts at byte 5032. (This should also be the size of the header on disk)
All integers and unsigned integers are 32 bit
=====================================================================*/
class IndigoImageHeader
{
public:
IndigoImageHeader(){}
~IndigoImageHeader(){}
static const int MAGIC_NUMBER = 66613373;
int magic_number; // Should be 66613373
static const int LATEST_FORMAT_VERSION = 4;
int format_version;
double num_samples; // Total num samples taken over entire image
unsigned int width; // Width of supersampled (large) image
unsigned int height; // Height of supersampled (large) image
unsigned int supersample_factor; // >= 1
int zipped; // Boolean
int image_data_size; // Size of image data in bytes
// Should be equal to width*height*12*num_layers, if data is uncompressed.
unsigned int colour_space; // 0 = XYZ
// New in format version 2: total render time spent on image, in seconds.
double render_time;
// New in format version 3: number of light layers in file.
unsigned int num_layers;
// New in format version 4: Layer names
unsigned int layer_name_format; // 0 = ASCII
unsigned int num_named_layers; // This should be <= num_layers
struct LayerName
{
unsigned int layer_name_len;
static const int MAX_LAYER_NAME_BYTES = 64;
char name_data[MAX_LAYER_NAME_BYTES];
}; // 68 bytes
static const int MAX_NUM_LAYER_NAMES = 16;
LayerName layer_names[MAX_NUM_LAYER_NAMES]; // 68B * 16 = 1088B
unsigned int last_rng_seed;
// 16 * 4 = 64 bytes + 1088 bytes = 1152 bytes
unsigned char padding[3880]; // Padding in case I want more stuff in the header in future. Starts at byte 1152.
// Image data follows:
// For each layer,
// top row, then next-to-top row, etc...
// left to right across the row.
// 3 32 bit floats per pixel.
};
Old specification (version 2)
Code: Select all
class IndigoImageHeader
{
public:
IndigoImageHeader();
~IndigoImageHeader();
// All integers and unsigned integers are 32 bit
// Byte order should be little endian (Intel byte order)
int magic_number; // Should be 66613373
int format_version; // Latest version is 2
double num_samples; // Total num samples taken over entire image
unsigned int width; // Width of supersampled (large) image
unsigned int height; // Height of supersampled (large) image
unsigned int supersample_factor; // >= 1
int zipped; // Boolean
int image_data_size; // Size of image data in bytes
// Should be equal to width*height*12, if data is uncompressed.
unsigned int colour_space; // 0 = XYZ
// New in format version 2: total render time spent on image, in seconds.
double render_time;
unsigned char padding[4992]; // Padding in case I want more stuff in the header in future.
// Image data follows:
// top row, then next-to-top row, etc...
// left to right across the row.
// 3 32 bit floats per pixel.
};
Old v1 spec:
Code: Select all
class IndigoImageHeader
{
public:
/*=====================================================================
IndigoImageHeader
-----------------
=====================================================================*/
IndigoImageHeader();
~IndigoImageHeader();
//all integers and unsigned integers are 32 bit
int magic_number;//should be 66613373
int format_version;//1
double num_samples;//total num samples taken over entire image
unsigned int width;//width of supersampled (large) image
unsigned int height;//height of supersampled (large) image
unsigned int supersample_factor;// >= 1
int zipped;//boolean
int image_data_size;//size of image data in bytes
//should be equal to width*height*12, if data is uncompressed.
unsigned int colour_space;//0 = XYZ
unsigned char padding[5000];//padding in case i want more stuff in the header in future
//image data follows:
//top row, then next-to-top row, etc...
//left to right across the row.
//3 32 bit floats per pixel.
};