Home - TBTerra/pictor GitHub Wiki

Welcome to the Pictor wiki!

Pictor was originally written in 2013 by a small group of first year students (Henry Wilson, Terra Barber, Emma Curati-Alasonatti and Chris Turner.), who couldn't wait to be given the official library.

It quickly became both faster and more feature complete than the library that they were later given.

It is now on the internet for current and future students to use and possibly even expand upon.


Usage

The library can be used by simply including pictor.h and any font files you wish to use, pictor.h automatically includes pictor.c so no special compile arguments are needed.

To compile Pictor using eclipse comment out line 164 in pictor.h, which reads, '#include "pictor.c"', as eclipse automatically links all source files in the folder.

Usage of the functions is best seen by looking at the example program, example.c.

The commands in Pictor can be split into two distinct groups: User Commands & Back-end Commands.

User Commands

User commands are the commands which would be used in regular use.
The subgroups are:

  • Colour Encoding - Used for encoding RGB values into colour values.
  • Draw Character Functions - Used printing characters and strings, including from program memory, with selectable colour, size and fonts.
  • Draw Number Functions - Used for printing hexadecimal bytes and signed integer numbers up to 16-bit.
  • Draw Shape Functions - Used for drawing all shapes, from individual pixels to filling the screen, and drawing boxes, circles and sprites.
  • LCD Initialisation - Used to initialise the display so the display memory can be written to.
  • LCD Composite Commands - Used to set the orientation of the screen.

Back-end Commands

The back-end commands are used internally by Pictor and generally would only be used externally to temporarily create a feature not implemented in Pictor.
The subgroups are:

  • Base LCD Commands - Includes the commands sending and receiving raw data and commands from the screen.
  • LCD Array Commands - Includes functions for writing and reading raw data in arrays or where a word is repeatedly written.
  • LCD Composite Commands - Includes a function to set the canvas area of the display memory that pixel data is sent to.

Compatibility

Pictor is generally compatible with projects written for previous versions of Pictor, except where maintaining compatibility limits the development of the library or leads to ambiguity.
As such Pictor is not backwards compatible in the following ways:

  • Pictor 0.3.2 is totally incompatible with previous versions due to re-worked function names.

Sprite Generation

Although it is possible to create sprites by hand, for all but the simplest sprites this can be a time consuming. This can also become complicated for the types of sprite where the pixels are not stored as raw colour values. To solve this issue a sprite generation tool has been created to convert PNG images into sprite structures, this tool is spriteCreator.