# Module `raster` - Basic raster graphics support

Basic raster graphics support. This module provides basic data types for two-dimensional bitmap ("raster") graphics. To display graphics, you'll want to use a module like `sdlraster`.

## Index

- Data type `RASTER` - A bitmap image
- Group `RASTER.ET` - Input event types
  - Constant `RASTER.ET.EXPOSE` - Window exposure
  - Constant `RASTER.ET.KEYDOWN` - Key down
  - Constant `RASTER.ET.KEYUP` - Key up
  - Constant `RASTER.ET.MOUSEBUTTONDOWN` - Mouse button down
  - Constant `RASTER.ET.MOUSEBUTTONUP` - Mouse button up
  - Constant `RASTER.ET.MOUSEMOTION` - Mouse motion
  - Constant `RASTER.ET.QUIT` - Window closed
  - Constant `RASTER.ET.SHUTDOWN` - The event channel is shutting down
- Record `RASTER.EVENT` - An input event
  - Variable `id` - Identifier
  - Variable `mod` - Modifier keys
  - Variable `type` - What type of event this is -- one of RASTER.ET
  - Variable `x`, `y` - Pointer coordinates

## Declarations

### `raster.inc`:44Data type `RASTER`

`DATA TYPE RASTER`

A bitmap image.

This is really a `MOBILE [][]INT`, with the first dimension being the Y coordinate and the second the X coordinate. Each element represents an RGB-colourspace pixel in `#AARRGGBB` format, with eight bits for each of red, green, blue and alpha. (Most things ignore the alpha component.)

The pixel representation uses the native endianism, so if you retype it to an array of `BYTE`s then the order of the components will vary between platforms.

It's sometimes useful to have a sentinel value of this type (for example, to use as a poison value in process networks); a zero-by-zero raster can be used for this purpose (`MOBILE [0][0]INT`).

### `raster.inc`:49Record `RASTER.EVENT`

`DATA TYPE RASTER.EVENT`

An input event.

### `raster.inc`:52Variable `type`

`INT`

What type of event this is -- one of `RASTER.ET`.

### `raster.inc`:59Variable `id`

`INT`

Identifier.

- For keyboard events, this is the key symbol -- a Unicode character, or one of the SDL constants for special keys (`SDLK.LEFT`, etc.).
- For mouse button events, this is the mouse button number (`SDL.BUTTON.LEFT`, etc.).

### `raster.inc`:63Variable `mod`

`INT`

Modifier keys.

- For keyboard and mouse button events, this is the modifier state -- a combination of the SDL modifier constants (`KMOD.LALT`, etc.).

### `raster.inc`:66Variable `x`, `y`

`INT16`

Pointer coordinates.

- For mouse events, this is the pointer position.

### `raster.inc`:70Group `RASTER.ET`

``

Input event types.

### `raster.inc`:74Constant `RASTER.ET.SHUTDOWN`

`VAL INT RASTER.ET.SHUTDOWN`

The event channel is shutting down. This will always be the last event you receive.

### `raster.inc`:75Constant `RASTER.ET.QUIT`

`VAL INT RASTER.ET.QUIT`

Window closed

### `raster.inc`:76Constant `RASTER.ET.KEYDOWN`

`VAL INT RASTER.ET.KEYDOWN`

Key down

### `raster.inc`:77Constant `RASTER.ET.KEYUP`

`VAL INT RASTER.ET.KEYUP`

Key up

### `raster.inc`:78Constant `RASTER.ET.MOUSEBUTTONDOWN`

`VAL INT RASTER.ET.MOUSEBUTTONDOWN`

Mouse button down

### `raster.inc`:79Constant `RASTER.ET.MOUSEBUTTONUP`

`VAL INT RASTER.ET.MOUSEBUTTONUP`

Mouse button up

### `raster.inc`:80Constant `RASTER.ET.MOUSEMOTION`

`VAL INT RASTER.ET.MOUSEMOTION`

Mouse motion

### `raster.inc`:81Constant `RASTER.ET.EXPOSE`

`VAL INT RASTER.ET.EXPOSE`

Window exposure