XRAW is a simple format designed for raw image or volume data for both RGBA and palette index color mode.

Though it can be used for general volume/image data representation, here we only use one of the many possible combinations.
It includes three sections : header ( 24 bytes ), voxel buffer, palette buffer

- integer is stored as little endian

# bytes description value ext. ( NOT used here )
4 magic number "XRAW" : X is at 0 byte
1 channel data type 0 : unsigned integer 1: signed integer 2 : float
1 # channels 4 : RGBA : R is at 0 byte 3, 2, 1 : RGB, RG, R
1 # bits per channel 8 : unsigned byte 1, 16, 32, 64
1 # bits per index 8 : unsigned byte 0, 16
4 volume size x
4 volume size y
4 volume size z
4 # palette colors 256
- end of header
#V voxel buffer voxels
#P palette buffer colors


some calculations :

1. #voxels = sizex * sizey * sizez;

2. voxel offset = x + y * sizex + z * sizex * sizezy;

3. #V = #voxels *
#bitsPerChannel * #channels / 8 ( if #bitsPerIndex == 0 );
#bitsPerIndex / 8 ( otherwise );

4. #P = #bitsPerIndex * #paletteColors;


Last edited Oct 8, 2014 at 9:42 PM by glkasumi, version 7

Comments

No comments yet.