The Alias Pix File format

An Alias pix file has a 10 byte header containing 5 short integers (there is no explicit magic number) which is then followed immediately by image data in a simple run-length encoded scheme.

Only RGB information is contained in the file; matte files are similar but exist in a separate file (see Matte File Format for details).

bytes header value notes
----- ----- -----
0,1 width x resolution in pixels
2,3 height y resolution in pixels
4,5 xoffset unused
6,7 yoffset unused
8,9 bits/pixel 24 for pix files (0x18)

The pixels are then run-length encoded in 4 byte packets on a per-scanline basis (runs do not extend beyond a single scanline) starting with the top scanline in the image.

bytes data range notes
----- ----- -----
runlength 1-255 number of pixels in succession with given RGB
blue 0-255 value of blue component
green 0-255 value of green component
red 0-255 value of red component

Here is the output of od -x for a pix file that is 8 pixels wide and 6 pixels high, representing a ramp that goes from black at the bottom of the image to blue at the top:

0000000 0008 0006 0000 0005 0018 08ff 0000 08cc 0000020 0000 0899 0000 0866 0000 0833 0000 0800 0000040 0000 0000042 This is read as describing an image that is 8 pixels wide [0008] and 6 scanlines high [0006]. The next four bytes describe the obsolete offset information. This is a pix file since there are 24 bits/pixel [0018]. The first (top) scanline is composed of a run of 8 pixels of (B=255, G=0, R=0)[08ff 0000]. The next scanline (since this one is complete) is 8 pixels of (B=204, G=0, R=0) [08cc 0000]. The rest of the scanlines are coded in the same fashion with the last scanline of eight pixels of (B=0, G=0, R=0) [0800 0000].

Matte File Format

Alias matte files are a variant of Alias pix files.

bytes header value notes
----- ----- -----
0,1 width x resolution in pixels
2,3 height y resolution in pixels
4,5 xoffset unused
6,7 yoffset unused
8,9 bits/pixel 8 for matte files (0x8)

The coverage (matte) information is then run-length encoded in 2-byte packets on a per-scanline basis (i.e. runs do not extend beyond a single scanline) starting with the top scanline in the image, where a value of zero indicates no coverage and a value of 255 indicates complete coverage of that pixel:

bytes data range notes
----- ----- -----
runlength 1-255 number of pixels in succession with given coverage
coverage 0-255 value for coverage

The following is an octal dump of an 8x6 Alias matte file for a sphere that nearly fills the image:

0000000 0008 0006 0000 0005 0008 0100 0110 015f 0000020 02bf 015f 0110 0100 0100 015f 04ff 015f 0000040 0100 0100 01bf 04ff 01bf 0100 0100 01bf 0000060 04ff 01bf 0100 0100 015f 04ff 015f 0100 0000100 0100 010f 015f 02bf 015f 010f 0100 0000116 This is read as describing an image that is 8 pixels wide [0008] and 6 scanlines high [0006]. The next four bytes describe the obsolete offset information.This is a matte file since there are 8 bits/pixel [0008].The description below shows the remainder of the file which describes the matte from the top scanline to the bottom.

0100 - one pixel of 0/255 (0%) coverage, 0110 - one pixel of 16/255 (6%) coverage, 015f - one pixel of 95/255 (37%) coverage, 02bf - two pixels of 191/255 (75%) coverage, 015f - one pixel of 95/255 (37%) coverage, 0110 - one pixel of 16/255 (6%) coverage, 0100 - one pixel of 0/255 (0%) coverage. Now you know you are on the next scanline since the first is filled.

0100 - one pixel of 0/255 (0%) coverage, 015f - one pixel of 95/255 (37%) coverage, 04ff - four pixels of 255/255 (100%) coverage, 015f - one pixel of 95/255 (37%) coverage, 0100 - one pixel of 0/255 (0%) coverage. Moving on to the next scanline:

0100 - one pixel of 0/255 (0%) coverage, 01bf - one pixel of 191/255 (75%) coverage, 04ff - four pixels of 255/255 (100%) coverage, 015f - one pixel of 191/255 (75%) coverage, 0100 - one pixel of 0/255 (0%) coverage. And so on. The next scanline is exactly the same, the one after that matches the second and the last one is the same as the first. This is the fortunate result of choosing a sphere.

Particle File Format

The Particle file format is a simple ASCII dump of the current status of every particle in the system. Rendering, mass, generator, and other information is carried in the wire file or SDL file.

The file is all space separated:

Field Type Comments
----- ----- -----------
<file_type> Integer Two possible values currently: 4 or 5
<num_blobs> Integer The number of particles in this file.

<blob_info> (See the following table. There are 'num_blobs' entries of this type.)

For type 4 particles (normal), each blob info consists of the following:

Field Type Comments
----- ----- -----------
<start_x> Float X position of particle at start of frame.
<start_y> Float Y position of particle at start of frame.
<start_z> Float Z position of particle at start of frame.
<end_x> Float X position of particle at end of frame.
<end_y> Float Y position of particle at end of frame.
<end_z> Float Z position of particle at end of frame.
<R> Float Red color of particle this frame.
<G> Float Green color of particle this frame.
<B> Float Blue color of particle this frame.
<cycles_left> Integer Number of cycles left in particles life.
<cycles_total> Integer Total number of cycles in particles life.

For type 5 particles (diffusing gas particles), each blob info consists of the following:

Field Type Comments
----- ----- -----------
<start_x> Float X position of particle at start of frame.
<start_y> Float Y position of particle at start of frame.
<start_z> Float Z position of particle at start of frame.
<end_x> Float X position of particle at end of frame.
<end_y> Float Y position of particle at end of frame.
<end_z> Float Z position of particle at end of frame.
<R> Float Red color of particle this frame.
<G> Float Green color of particle this frame.
<B> Float Blue color of particle this frame.
<cycles_left> Integer Number of cycles left in particles life.
<cycles_total> Integer Total number of cycles in particles life.
<start_size> Float Size of particle at start of frame.
<end_size> Float Size of particle at end of frame.

depthmap Format

depthmap is used to create an 8 bit file from geometry to use as a texture map.

Usage: depthmap [-h] [-a # # #] <infile> <outfile>

Function: takes a camera depth file and converts it into an Alias RLE matte/mask file.

-h print this message

-a convert an animation, takes startframe, endframe and byframe

Note: -a is limited to integer numbers.

The file for this stand-alone utility must be generated by an Alias renderer, providing a depth file name for the camera in the camera editor. The depth file contains an array of floating point values which represent the Z depth of each pixel.

Alias Camera Depth File Format

An Alias Camera Depth File contains depth information corresponding to the image created from that camera. The Camera Depth File's main use is for post-render 3D compositing. The file contains a magic number, an X and Y resolution, and an array of floating point depth values.

bytes header value notes C-type
----- ----- ----- -----
0,1,2,3 magic number Uniquely identifies files of this type int
4,5 width x resolution in pixels short
6,7 height y resolution in pixels short

The magic number for Alias camera depth files is 55655. The rest of the file contains an X by Y array of floating point values in row order.

The following C-code is an example of how to read a Camera Depth File:

filein = open( infilename, O_RDONLY );

read( filein, &magic, sizeof( int ) ); /* magic number */

if ( magic != 55655 ) {

fprintf( stderr,"given input file '%s' does not have proper magic number (55655)\n", infilename );

exit(0);

}

read ( filein, &width, sizeof(short) ); /* Xres */

read ( filein, &height, sizeof(short) ); /* Yres */

size = width * height;

buffer = (float *)malloc ( size * sizeof( float ) );

read( filein, buffer, sizeof(float)*size2 ); /* fill the array */

close( filein );

for (i = 0; i < height; ++i) {

for (j = 0; j < width; ++j) {

/* Do something to the pixel. */

}

}

Other Details

The following are some additional miscellaneous bits of information that may be useful.

pix/final_left.1o pix/final_right.1o pix/final_left.1e pix/final_right.1e pix/final_left.2o pix/final_right.2o pix/final_left.2e pix/final_right.2e





[email protected]

Copyright © 1998, Alias|Wavefront, a Silicon Graphics Company. All rights reserved.