# Blinker - Canvas

The canvas module allows to merge several streams into one. It works like a canvas, onto which rectangular sections of different streams are drawn. The result obtained on the canvas is then sent to a single output stream.

## Configuration

The configuration of the canvas module with name `NAME` is located in the `canvases/NAME` subdirectory.

### Format

The file `format` describes the format of the canvas, i.e. its dimensions, the number of channels and the color depth on each channel. The file must contain a string `<width>x<height>-<channels>/<colors>`, e.g. `18x8-1/256` for 18 pixels width, 8 pixels height in 256 grayscales.

### Input List

The inputs to be drawn onto the canvas are configured in the `inputs` subdirectory. Each input is configured in an own subdirectory in `inputs`. E.g. the configurations for inputs with names `top` and `bottom` reside in subdirectories `inputs/top` and `inputs/bottom` respectively. All inputs are drawn to the canvas in alphanumerical order, i.e. `top` is painted over `bottom` on overlapping pixels.

The configuration inside an input subdirectory consists of the following settings:

#### Input Stream

The file `instream` contains the name of the stream to read for this input.

#### Source Position

The file `srcpos` defines the top-left corner of the recangular section to be taken from the stream. The file must contain a string `<x>,<y>`.

#### Size

The file `size` defines the size of the recangular section to be taken from the stream. The file must contain a string `<width>x<height>`.

#### Destination Position

The file `destpos` defines the top-left corner of the rectangular section on the canvas to draw to. The file must contain a string `<x>,<y>`.

### Output Stream

The file `outstream` contains the name of the stream to send the frames to.