Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • joeylib joeylib
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 11
    • Issues 11
    • List
    • Boards
    • Service Desk
    • Milestones
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Public Skunkworks
  • joeylibjoeylib
  • Wiki
  • JoeyLib Formats

Last edited by Scott Duensing Oct 17, 2019
Page history

JoeyLib Formats

STA - Static Images

Static images are created either by JoeyLib applications or the imgconvert tool. Static images are 320x200 pixels with a 16 color 4-bit RGB palette. The on-disk format is the same as the in-memory format. STA files begin with a three byte signature ("STA") and a single byte version number followed by palette and then image data.

typedef struct {
	 byte b : 4;
	 byte g : 4;
	 byte r : 4;
	 byte reserved : 4;
} jlColorT;

typedef struct {
	byte l : 4;
	byte r : 4;
} jlPixelPairT;

typedef struct {
	char         id[3];
	byte         version;
	jlColorT     palette[16];    // 4 bits reserved, 4 bits red, 4 green, 4 blue
	jlPixelPairT pixels[32000];  // 320x200, 4 bits per pixel
} jlStaT;

VEC - Vector Images

Vector images begin life as a text file specifying the operations needed to draw them. The text file is processed by the vecdraw utility into an efficient byte stream that can be used by JoeyLib. The supported operations in the text format are:

C <color>                 - Specify Drawing Color
E                         - Erase the Display
D <x1> <y1> ...           - Draw a Pixel
L <x1> <y1> ... <xn> <yn> - Draw a Line
B <x1> <y1> <x2> <y2> ... - Draw a Hollow Box
S <x1> <y1> <x2> <y2> ... - Draw a Solid Box
F <x1> <y1> ...           - Flood Fill over Single Color
T <x1> <y1> <color> ...   - Flood Fill To Color
P <i> <r> <g> <b> ...     - Set Palette Color
R                         - Reset Palette to Default

One command can be entered per line and lines can be up to 1024 characters long.

Commands followed by "..." can have additional sets of parameters added to repeat the operation without the need to specify another command line.

After processing, the byte stream is stored as a three byte header ("VEC") followed by a single byte version number, an unsigned integer length of the data to follow, and then the data itself.

typedef struct {
	char          id[3];
	byte          version;
	unsigned int  length;
	byte         *data;
} jlVecT;
Clone repository
  • Installation
  • JoeyLib API
  • JoeyLib Concepts
  • JoeyLib Data Types
  • JoeyLib Definitions
  • JoeyLib Display Functions
  • JoeyLib Drawing Functions
  • JoeyLib Enumerations
  • JoeyLib Formats
  • JoeyLib Gamepad Functions
  • JoeyLib Keyboard Functions
  • JoeyLib Memory Functions
  • JoeyLib Palette Functions
  • JoeyLib Sound Functions
  • JoeyLib Static Image Functions
View All Pages