Constant flic::codec::FLI_BRUN [] [src]

pub const FLI_BRUN: u16 = 15

Magic for a FLI_BRUN chunk - Byte Run Length Compression.

This chunk contains the entire image in a compressed format. Usually this chunk is used in the first frame of an animation, or within a postage stamp image chunk.

The data is organized in lines. Each line contains packets of compressed pixels. The first line is at the top of the animation, followed by subsequent lines moving downward. The number of lines in this chunk is given by the height of the animation.

The first byte of each line is a count of packets in the line. This value is ignored, it is a holdover from the original Animator. It is possible to generate more than 255 packets on a line. The width of the animation is now used to drive the decoding of packets on a line; continue reading and processing packets until width pixels have been processed, then proceed to the next line.

Each packet consist of a type/size byte, followed by one or more pixels. If the packet type is negative it is a count of pixels to be copied from the packet to the animation image. If the packet type is positive it contains a single pixel which is to be replicated; the absolute value of the packet type is the number of times the pixel is to be replicated.