User Tools

Site Tools


old:ilda_files

An Ilda file is a binary file that stores laser art. Each file is composed of sections which start with a 32 byte header, followed by data.

The official standard can be found on the website of Ilda: http://www.laserist.org/StandardsDocs/ILDA_IDTF14_rev011.pdf

Formats

There are several Ilda file formats. These are always per header, so one Ilda file can be composed of parts that have a different format number.

* Format 0: 3D laser art. Per point, three coordinates (X, Y and Z) are stored, in addition to a 'status code' which tells the colour number for lookup in a palette, and a blanking bit. * Format 1: Similar to Format 0 but with 2D points. * Format 2: A palette. Each entry has a red, green and blue value. The status code of a format 0 or 1 file refers to the place the colour of a point can be found in the palette. The total amount of colours in a palette is limited to 256. This is not much but according to Ilda not a problem, since the major companies rarely used more than 256 colours before 1995. * Format 3: Abandoned idea for storing true colour. Not a part of the standard. * Format 4: 3D laser art using RGB data per point. Remarkably, colours are stored in BGR format, not RGB. * Format 5: Similar to Format 4 but with 2D points.

Headers

Headers are quite similar across all formats. They all start with 4 bytes, which correspond to the ASCII letters 'I', 'L', 'D' and 'A'. Then follow three bytes which are equal to 0. The eighth byte is the format number (0, 1, 2, 4 or 5). Then eight bytes follow, which store the frame (or palette) name. Eight more bytes save the company name. Bytes 25-26 tell the total points or colours in the data part of the section. When this value is set to 0, it means this is the last frame. The next two bytes code the frame number so a reader can keep track of the animation. This means an ilda file is theoretically limited to 65536 frames, but ilda file readers can choose to ignore this limitation. Bytes 29-30 indicate the total frames in the sequence. Byte 31 refers to the scanner head, byte 32 is reserved for future use and should be set to 0.

Data

After the header, the data follows. Each data entry has a number of bytes determined by the format number: format 0 has 8 bytes (XX, YY, ZZ, StatusStatus), format 1 has 6 (XX, YY, StatusStatus), format 2 has 3 (R, G, B), format 4 has 10 (XX, YY, ZZ, Status, B, G, R) and format 5 has 8 (XX, YY, Status, B, G, R).

All laser art is composed in a similar way: * The first two bytes are the X coordinate (twos complement, signed). The extreme left corresponds to -32768, the extreme right to 32767. * The following two bytes are the Y coordinate. -32768 is the bottom, 32767 is the top. * In formats 0 and 4, the next two bytes are the Z coordinate. The rear is -32768, the front is 32767. * In formats 0 and 1, the next two bytes are the status code. The first 8 bits determine the colour number for lookup in a palette (which might or might not be included in the ilda file, it could be the program assumes which palette to use). Because this is only 8 bits, a maximum of 256 different colours can be used in the same frame. The next 6 bits are reserved for future use and should be set to 0. The following bit is the blanking bit: 1 if blanked and 0 if not blanked. The last bit is 1 when the current point is the last point of the frame. * In formats 4 and 5, the status code only has the last byte: 6 bits which are zero, then a blanking bit and a last point bit. Since Ilda has not released the official standard for these formats, it is unclear if this information is accurate. * In formats 4 and 5 only, the status code is followed by three bytes which represent the colour of the point. First comes the blue byte, then green and finally red. It is unclear why Ilda decided to use this order instead of the traditional RGB.

A palette section uses one byte each for the red, green and blue component of each colour (so it's RGB, not BGR).

After all data entries comes the header of the next section. Even after the last frame of an animation, there should be a header (with no data following) where bytes 25 and 26 (total points or colours) are set to 0. When writing an ilda file parser, it's a bad idea to rely on this feature to determine the end of a file, as programs might output empty frames in between.

old/ilda_files.txt · Last modified: 2018/02/22 10:40 by wikiadmin