Documentation ¶
Overview ¶
Package cel implements a CEL and CL2 image decoder.
Below follows a pseudo-code description of the CEL file format.
// A CEL file contains of a file header and a sequence of frames. type CEL struct { // Number of frames. nframes uint32 // Offset to each frame. frameOffsets [nframes+1]uint32 // Header and pixel data contents of each frame. // // start: frameOffsets[frameNum] // end: frameOffsets[frameNum+1] frames [nframes]Frame } // A Frame consists of an optional frame header followed by encoded pixel // data. type Frame struct { // Optional frame header. header []byte // Encoded pixel data. data []byte }
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeAll ¶
DecodeAll decodes the given CEL image using colours from the provided palette, and returns the sequential frames.
func DecodeArchive ¶
DecodeArchive decodes the given CEL archive using colours from the provided palette, and returns the sequential frames of the embedded CEL images.
func ParsePal ¶
ParsePal parses the given PAL file and returns the corresponding palette.
Below follows a pseudo-code description of the PAL file format.
// A PAL file contains a sequence of colour definitions, representing a // palette. type PAL [256]Color // A Color represents a colour specified by red, green and blue intensity // levels. type Color struct { red, green, blue byte }
Types ¶
type TransitionTable ¶
type TransitionTable struct { // Indices maps from TRN index to palette index. Indices [256]uint8 }
A TransitionTable represents a colour transition table.
func ParseTrn ¶
func ParseTrn(path string) (*TransitionTable, error)
ParseTrn parses the given TRN file and returns the corresponding colour transition table.
Below follows a pseudo-code description of the TRN file format.
// A TRN file contains a sequence of colour transitions, representing // indexes into a palette. type TRN [256]uint8