# 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.BUTTON` - Mouse buttons
  - Constant `RASTER.BUTTON.LEFT` - Left button
  - Constant `RASTER.BUTTON.MIDDLE` - Middle button
  - Constant `RASTER.BUTTON.RIGHT` - Right button
- 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
  - Variable `x`, `y` - Pointer coordinates
- Group `RASTER.KEY` - Key symbols
  - Constant `RASTER.KEY.BACKSPACE` - Backspace
  - Constant `RASTER.KEY.BREAK` - Break
  - Constant `RASTER.KEY.CAPSLOCK` - Caps lock
  - Constant `RASTER.KEY.CLEAR` - Clear
  - Constant `RASTER.KEY.COMPOSE` - Compose
  - Constant `RASTER.KEY.DELETE` - Delete
  - Constant `RASTER.KEY.DOWN` - Down arrow
  - Constant `RASTER.KEY.END` - End
  - Constant `RASTER.KEY.ESCAPE` - Escape
  - Constant `RASTER.KEY.EURO` - Euro
  - Constant `RASTER.KEY.F1` - F1
  - Constant `RASTER.KEY.F10` - F10
  - Constant `RASTER.KEY.F11` - F11
  - Constant `RASTER.KEY.F12` - F12
  - Constant `RASTER.KEY.F13` - F13
  - Constant `RASTER.KEY.F14` - F14
  - Constant `RASTER.KEY.F15` - F15
  - Constant `RASTER.KEY.F2` - F2
  - Constant `RASTER.KEY.F3` - F3
  - Constant `RASTER.KEY.F4` - F4
  - Constant `RASTER.KEY.F5` - F5
  - Constant `RASTER.KEY.F6` - F6
  - Constant `RASTER.KEY.F7` - F7
  - Constant `RASTER.KEY.F8` - F8
  - Constant `RASTER.KEY.F9` - F9
  - Constant `RASTER.KEY.HELP` - Help
  - Constant `RASTER.KEY.HOME` - Home
  - Constant `RASTER.KEY.INSERT` - Insert
  - Constant `RASTER.KEY.KP.DIVIDE` - Keypad /
  - Constant `RASTER.KEY.KP.ENTER` - Keypad Enter
  - Constant `RASTER.KEY.KP.EQUALS` - Keypad =
  - Constant `RASTER.KEY.KP.MINUS` - Keypad -
  - Constant `RASTER.KEY.KP.MULTIPLY` - Keypad *
  - Constant `RASTER.KEY.KP.PERIOD` - Keypad
  - Constant `RASTER.KEY.KP.PLUS` - Keypad +
  - Constant `RASTER.KEY.KP0` - Keypad 0
  - Constant `RASTER.KEY.KP1` - Keypad 1
  - Constant `RASTER.KEY.KP2` - Keypad 2
  - Constant `RASTER.KEY.KP3` - Keypad 3
  - Constant `RASTER.KEY.KP4` - Keypad 4
  - Constant `RASTER.KEY.KP5` - Keypad 5
  - Constant `RASTER.KEY.KP6` - Keypad 6
  - Constant `RASTER.KEY.KP7` - Keypad 7
  - Constant `RASTER.KEY.KP8` - Keypad 8
  - Constant `RASTER.KEY.KP9` - Keypad 9
  - Constant `RASTER.KEY.LALT` - Left alt
  - Constant `RASTER.KEY.LCTRL` - Left control
  - Constant `RASTER.KEY.LEFT` - Left arrow
  - Constant `RASTER.KEY.LMETA` - Left meta
  - Constant `RASTER.KEY.LSHIFT` - Left shift
  - Constant `RASTER.KEY.LSUPER` - Left super
  - Constant `RASTER.KEY.MENU` - Menu
  - Constant `RASTER.KEY.MODE` - Mode
  - Constant `RASTER.KEY.NUMLOCK` - Num lock
  - Constant `RASTER.KEY.PAGEDOWN` - Page down
  - Constant `RASTER.KEY.PAGEUP` - Page up
  - Constant `RASTER.KEY.PAUSE` - Pause
  - Constant `RASTER.KEY.POWER` - Power
  - Constant `RASTER.KEY.PRINT` - Print
  - Constant `RASTER.KEY.RALT` - Right alt
  - Constant `RASTER.KEY.RCTRL` - Right control
  - Constant `RASTER.KEY.RETURN` - Return
  - Constant `RASTER.KEY.RIGHT` - Right arrow
  - Constant `RASTER.KEY.RMETA` - Right meta
  - Constant `RASTER.KEY.RSHIFT` - Right shift
  - Constant `RASTER.KEY.RSUPER` - Right super
  - Constant `RASTER.KEY.SCROLLOCK` - Scroll lock
  - Constant `RASTER.KEY.SYSREQ` - SysReq
  - Constant `RASTER.KEY.TAB` - Tab
  - Constant `RASTER.KEY.UNDO` - Undo
  - Constant `RASTER.KEY.UP` - Up arrow
- Group `RASTER.MOD` - Modifier keys
  - Constant `RASTER.MOD.CAPS` - Caps lock
  - Constant `RASTER.MOD.LALT` - Left alt
  - Constant `RASTER.MOD.LCTRL` - Left control
  - Constant `RASTER.MOD.LMETA` - Left meta
  - Constant `RASTER.MOD.LSHIFT` - Left shift
  - Constant `RASTER.MOD.MODE` - Mode lock
  - Constant `RASTER.MOD.NUM` - Num lock
  - Constant `RASTER.MOD.RALT` - Right alt
  - Constant `RASTER.MOD.RCTRL` - Right control
  - Constant `RASTER.MOD.RMETA` - Right meta
  - Constant `RASTER.MOD.RSHIFT` - Right shift

## 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`:57Variable `id`

`INT`

Identifier.

- For keyboard events, this is the key symbol -- a Unicode character, or one of `RASTER.KEY`.
- For mouse button events, this is one of `RASTER.BUTTON`.

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

`INT`

Modifier keys.

- For keyboard and mouse button events, this is the modifier state -- one or more of `RASTER.MOD` bitwise-ORed together.

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

`INT16`

Pointer coordinates.

- For mouse events, this is the pointer position.

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

``

Input event types.

### `raster.inc`:72Constant `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`:73Constant `RASTER.ET.QUIT`

`VAL INT RASTER.ET.QUIT`

Window closed

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

`VAL INT RASTER.ET.KEYDOWN`

Key down

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

`VAL INT RASTER.ET.KEYUP`

Key up

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

`VAL INT RASTER.ET.MOUSEBUTTONDOWN`

Mouse button down

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

`VAL INT RASTER.ET.MOUSEBUTTONUP`

Mouse button up

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

`VAL INT RASTER.ET.MOUSEMOTION`

Mouse motion

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

`VAL INT RASTER.ET.EXPOSE`

Window exposure

### `raster.inc`:81Group `RASTER.KEY`

``

Key symbols.

### `raster.inc`:86Constant `RASTER.KEY.BACKSPACE`

`VAL INT RASTER.KEY.BACKSPACE`

Backspace.

### `raster.inc`:87Constant `RASTER.KEY.TAB`

`VAL INT RASTER.KEY.TAB`

Tab.

### `raster.inc`:88Constant `RASTER.KEY.CLEAR`

`VAL INT RASTER.KEY.CLEAR`

Clear.

### `raster.inc`:89Constant `RASTER.KEY.RETURN`

`VAL INT RASTER.KEY.RETURN`

Return.

### `raster.inc`:90Constant `RASTER.KEY.PAUSE`

`VAL INT RASTER.KEY.PAUSE`

Pause.

### `raster.inc`:91Constant `RASTER.KEY.ESCAPE`

`VAL INT RASTER.KEY.ESCAPE`

Escape.

### `raster.inc`:92Constant `RASTER.KEY.DELETE`

`VAL INT RASTER.KEY.DELETE`

Delete.

### `raster.inc`:93Constant `RASTER.KEY.KP0`

`VAL INT RASTER.KEY.KP0`

Keypad 0.

### `raster.inc`:94Constant `RASTER.KEY.KP1`

`VAL INT RASTER.KEY.KP1`

Keypad 1.

### `raster.inc`:95Constant `RASTER.KEY.KP2`

`VAL INT RASTER.KEY.KP2`

Keypad 2.

### `raster.inc`:96Constant `RASTER.KEY.KP3`

`VAL INT RASTER.KEY.KP3`

Keypad 3.

### `raster.inc`:97Constant `RASTER.KEY.KP4`

`VAL INT RASTER.KEY.KP4`

Keypad 4.

### `raster.inc`:98Constant `RASTER.KEY.KP5`

`VAL INT RASTER.KEY.KP5`

Keypad 5.

### `raster.inc`:99Constant `RASTER.KEY.KP6`

`VAL INT RASTER.KEY.KP6`

Keypad 6.

### `raster.inc`:100Constant `RASTER.KEY.KP7`

`VAL INT RASTER.KEY.KP7`

Keypad 7.

### `raster.inc`:101Constant `RASTER.KEY.KP8`

`VAL INT RASTER.KEY.KP8`

Keypad 8.

### `raster.inc`:102Constant `RASTER.KEY.KP9`

`VAL INT RASTER.KEY.KP9`

Keypad 9.

### `raster.inc`:103Constant `RASTER.KEY.KP.PERIOD`

`VAL INT RASTER.KEY.KP.PERIOD`

Keypad `.`.

### `raster.inc`:104Constant `RASTER.KEY.KP.DIVIDE`

`VAL INT RASTER.KEY.KP.DIVIDE`

Keypad `/`.

### `raster.inc`:105Constant `RASTER.KEY.KP.MULTIPLY`

`VAL INT RASTER.KEY.KP.MULTIPLY`

Keypad `*`.

### `raster.inc`:106Constant `RASTER.KEY.KP.MINUS`

`VAL INT RASTER.KEY.KP.MINUS`

Keypad `-`.

### `raster.inc`:107Constant `RASTER.KEY.KP.PLUS`

`VAL INT RASTER.KEY.KP.PLUS`

Keypad `+`.

### `raster.inc`:108Constant `RASTER.KEY.KP.ENTER`

`VAL INT RASTER.KEY.KP.ENTER`

Keypad Enter.

### `raster.inc`:109Constant `RASTER.KEY.KP.EQUALS`

`VAL INT RASTER.KEY.KP.EQUALS`

Keypad `=`.

### `raster.inc`:110Constant `RASTER.KEY.UP`

`VAL INT RASTER.KEY.UP`

Up arrow.

### `raster.inc`:111Constant `RASTER.KEY.DOWN`

`VAL INT RASTER.KEY.DOWN`

Down arrow.

### `raster.inc`:112Constant `RASTER.KEY.RIGHT`

`VAL INT RASTER.KEY.RIGHT`

Right arrow.

### `raster.inc`:113Constant `RASTER.KEY.LEFT`

`VAL INT RASTER.KEY.LEFT`

Left arrow.

### `raster.inc`:114Constant `RASTER.KEY.INSERT`

`VAL INT RASTER.KEY.INSERT`

Insert.

### `raster.inc`:115Constant `RASTER.KEY.HOME`

`VAL INT RASTER.KEY.HOME`

Home.

### `raster.inc`:116Constant `RASTER.KEY.END`

`VAL INT RASTER.KEY.END`

End.

### `raster.inc`:117Constant `RASTER.KEY.PAGEUP`

`VAL INT RASTER.KEY.PAGEUP`

Page up.

### `raster.inc`:118Constant `RASTER.KEY.PAGEDOWN`

`VAL INT RASTER.KEY.PAGEDOWN`

Page down.

### `raster.inc`:119Constant `RASTER.KEY.F1`

`VAL INT RASTER.KEY.F1`

F1.

### `raster.inc`:120Constant `RASTER.KEY.F2`

`VAL INT RASTER.KEY.F2`

F2.

### `raster.inc`:121Constant `RASTER.KEY.F3`

`VAL INT RASTER.KEY.F3`

F3.

### `raster.inc`:122Constant `RASTER.KEY.F4`

`VAL INT RASTER.KEY.F4`

F4.

### `raster.inc`:123Constant `RASTER.KEY.F5`

`VAL INT RASTER.KEY.F5`

F5.

### `raster.inc`:124Constant `RASTER.KEY.F6`

`VAL INT RASTER.KEY.F6`

F6.

### `raster.inc`:125Constant `RASTER.KEY.F7`

`VAL INT RASTER.KEY.F7`

F7.

### `raster.inc`:126Constant `RASTER.KEY.F8`

`VAL INT RASTER.KEY.F8`

F8.

### `raster.inc`:127Constant `RASTER.KEY.F9`

`VAL INT RASTER.KEY.F9`

F9.

### `raster.inc`:128Constant `RASTER.KEY.F10`

`VAL INT RASTER.KEY.F10`

F10.

### `raster.inc`:129Constant `RASTER.KEY.F11`

`VAL INT RASTER.KEY.F11`

F11.

### `raster.inc`:130Constant `RASTER.KEY.F12`

`VAL INT RASTER.KEY.F12`

F12.

### `raster.inc`:131Constant `RASTER.KEY.F13`

`VAL INT RASTER.KEY.F13`

F13.

### `raster.inc`:132Constant `RASTER.KEY.F14`

`VAL INT RASTER.KEY.F14`

F14.

### `raster.inc`:133Constant `RASTER.KEY.F15`

`VAL INT RASTER.KEY.F15`

F15.

### `raster.inc`:134Constant `RASTER.KEY.NUMLOCK`

`VAL INT RASTER.KEY.NUMLOCK`

Num lock.

### `raster.inc`:135Constant `RASTER.KEY.CAPSLOCK`

`VAL INT RASTER.KEY.CAPSLOCK`

Caps lock.

### `raster.inc`:136Constant `RASTER.KEY.SCROLLOCK`

`VAL INT RASTER.KEY.SCROLLOCK`

Scroll lock.

### `raster.inc`:137Constant `RASTER.KEY.RSHIFT`

`VAL INT RASTER.KEY.RSHIFT`

Right shift.

### `raster.inc`:138Constant `RASTER.KEY.LSHIFT`

`VAL INT RASTER.KEY.LSHIFT`

Left shift.

### `raster.inc`:139Constant `RASTER.KEY.RCTRL`

`VAL INT RASTER.KEY.RCTRL`

Right control.

### `raster.inc`:140Constant `RASTER.KEY.LCTRL`

`VAL INT RASTER.KEY.LCTRL`

Left control.

### `raster.inc`:141Constant `RASTER.KEY.RALT`

`VAL INT RASTER.KEY.RALT`

Right alt.

### `raster.inc`:142Constant `RASTER.KEY.LALT`

`VAL INT RASTER.KEY.LALT`

Left alt.

### `raster.inc`:143Constant `RASTER.KEY.RMETA`

`VAL INT RASTER.KEY.RMETA`

Right meta.

### `raster.inc`:144Constant `RASTER.KEY.LMETA`

`VAL INT RASTER.KEY.LMETA`

Left meta.

### `raster.inc`:145Constant `RASTER.KEY.LSUPER`

`VAL INT RASTER.KEY.LSUPER`

Left super.

### `raster.inc`:146Constant `RASTER.KEY.RSUPER`

`VAL INT RASTER.KEY.RSUPER`

Right super.

### `raster.inc`:147Constant `RASTER.KEY.MODE`

`VAL INT RASTER.KEY.MODE`

Mode.

### `raster.inc`:148Constant `RASTER.KEY.COMPOSE`

`VAL INT RASTER.KEY.COMPOSE`

Compose.

### `raster.inc`:149Constant `RASTER.KEY.HELP`

`VAL INT RASTER.KEY.HELP`

Help.

### `raster.inc`:150Constant `RASTER.KEY.PRINT`

`VAL INT RASTER.KEY.PRINT`

Print.

### `raster.inc`:151Constant `RASTER.KEY.SYSREQ`

`VAL INT RASTER.KEY.SYSREQ`

SysReq.

### `raster.inc`:152Constant `RASTER.KEY.BREAK`

`VAL INT RASTER.KEY.BREAK`

Break.

### `raster.inc`:153Constant `RASTER.KEY.MENU`

`VAL INT RASTER.KEY.MENU`

Menu.

### `raster.inc`:154Constant `RASTER.KEY.POWER`

`VAL INT RASTER.KEY.POWER`

Power.

### `raster.inc`:155Constant `RASTER.KEY.EURO`

`VAL INT RASTER.KEY.EURO`

Euro

### `raster.inc`:156Constant `RASTER.KEY.UNDO`

`VAL INT RASTER.KEY.UNDO`

Undo.

### `raster.inc`:158Group `RASTER.BUTTON`

``

Mouse buttons.

### `raster.inc`:160Constant `RASTER.BUTTON.LEFT`

`VAL INT RASTER.BUTTON.LEFT`

Left button.

### `raster.inc`:161Constant `RASTER.BUTTON.MIDDLE`

`VAL INT RASTER.BUTTON.MIDDLE`

Middle button.

### `raster.inc`:162Constant `RASTER.BUTTON.RIGHT`

`VAL INT RASTER.BUTTON.RIGHT`

Right button.

### `raster.inc`:164Group `RASTER.MOD`

``

Modifier keys.

### `raster.inc`:168Constant `RASTER.MOD.LSHIFT`

`VAL INT RASTER.MOD.LSHIFT`

Left shift.

### `raster.inc`:169Constant `RASTER.MOD.RSHIFT`

`VAL INT RASTER.MOD.RSHIFT`

Right shift.

### `raster.inc`:170Constant `RASTER.MOD.LCTRL`

`VAL INT RASTER.MOD.LCTRL`

Left control.

### `raster.inc`:171Constant `RASTER.MOD.RCTRL`

`VAL INT RASTER.MOD.RCTRL`

Right control.

### `raster.inc`:172Constant `RASTER.MOD.LALT`

`VAL INT RASTER.MOD.LALT`

Left alt.

### `raster.inc`:173Constant `RASTER.MOD.RALT`

`VAL INT RASTER.MOD.RALT`

Right alt.

### `raster.inc`:174Constant `RASTER.MOD.LMETA`

`VAL INT RASTER.MOD.LMETA`

Left meta.

### `raster.inc`:175Constant `RASTER.MOD.RMETA`

`VAL INT RASTER.MOD.RMETA`

Right meta.

### `raster.inc`:176Constant `RASTER.MOD.NUM`

`VAL INT RASTER.MOD.NUM`

Num lock.

### `raster.inc`:177Constant `RASTER.MOD.CAPS`

`VAL INT RASTER.MOD.CAPS`

Caps lock.

### `raster.inc`:178Constant `RASTER.MOD.MODE`

`VAL INT RASTER.MOD.MODE`

Mode lock.