New Platform Message Storage Format

Revision 6

Note: all multi-byte integers are in big-endian format unless otherwise specified. All fields without a value specified may be any value.

Message Storage Format
Size Data Type Value Description
1 unsigned byte 0 Block type. (see below)
1 unsigned byte 1 Message storage format version
2 unsigned short The number of bytes in the title. For a string, this may be set to 0 and the embeded string will be used as the title. A graphic must have a title specified. (This is a short, rather than a byte, for simplicity in reading the formats in Java.)
0 – (216-1) bytes The message's title, encoded in UTF-8
4 integer The running time of the message, specified in milliseconds (hint).

NOTE: if the message's title is of the form NTCIP-GRAPHIC-1 through NTCIP-GRAPHIC-99, then this value & 0xffff is the NTCIP CRC of the contained image.
1 unsigned byte The average luminous intensity of the message. (hint) It is specified in 1/256ths of all pixels turned on full at the current intensity. (I.e. it does not include the adjustment for the ambient lighting, only what percentage of the current will be applied relative to if all pixels were on full at the current ambient-adjusted brightness level.)
1 unsigned byte The type of the embeded data:
0 Static string
1 Dynamic string
2 MULTI string
3 Image Data
4 Long String
5 Solartech Formatted String
6 Scrolling Text
7 Solartech Formatted Message 2
variable variable The embeded data. Static Strings, Dynamic Strings, and Long Strings are all represented with a java string (as indicated below in the Static String Format and the Long String Format). SfmStrings are encoded as indicated in its documentation. Images are embeded using the Image Format (below).

Version 1 of the message storage format added embedded data type 6, scrolling text.

Static String Format
Size Data Type Value Description
2 unsigned short length of string
0 – (216-1) bytes the string, encoded in UTF-8
Long String Format
Size Data Type Value Description
2 unsigned short length of string
0 – (216-1) bytes the string, encoded in UTF-8

A long string is automatically sized and paginated to fit onto the sign in what is determined for that sign to be a reasonably optimized format.

Note: animated messages or graphics will be accomplished by making them sequences and allowing sequence composition, however they may be presented to the user. Since we're designing from the ground up, it makes no sense to have two alternative sequence formats. (An animated graphic is nothing more than a sequence of graphic images.) Better to allow generic sequence composition and be done with it.

Image Format
Size Data Type Value Description
1 unsigned byte bits/pixel
1 unsigned unsigned byte bits/color

The image format is determined from this. If the bpp and bpc are equal, this is a grayscale image of the appropriate bit-depth. If the bpp is a multiple of the bpc, then the multiple indicates the color format:
1 Grayscale
2 Red,Green
3 Red,Green,Blue
4 Red,Green,Blue,Alpha

2 unsigned short width (pixels)
2 unsigned short height (pixels)
3 unsigned bytes Transparent Color (this is a hint to store information from NTCIP images which use the crappy inferior transparent color scheme rather than a full RGBA scheme; when an NTCIP image is downloaded it can easily be mapped to an RGBA value with zero opacity, but this hint allows storing the information should an NTCIP client want it back.)
ceil(width*height*(bpp/8)) bytes The image data, encoded as densly as possible with the last byte zero-padded if necessary. If less than 8 bits are used per pixel, than the least significant bits represent the left-most pixel.
1 unsigned byte The number of text areas in the image
variable bytes The text area blocks (if any)

NOTE: the text area blocks is a feature to enable use of images as templates, where an area in the image is defined to allow an interface to create a new image by typing text into the text area. This feature was never used, and in practice all images have 0 text areas in them.

Text Area Block Format
Size Data Type Value Description
2 unsigned short top left x value
2 unsigned short top left y value
2 unsigned short bottom right x value
2 unsigned short bottom right y value
Block Type
Value Block Type
0 Message
1 Sequence

Last modified: Tue May 17 15:23:17 EDT 2005