blimp

Types

pub opaque type Pixel

Values

pub fn render(
  width width: Int,
  height height: Int,
  state state: state,
  pixel plot: fn(state, Int, Int) -> #(state, Pixel),
) -> #(state, BitArray)

Build a BMP image by iterating over each pixel with some state.

The callback gets the X and Y position of the pixel, where 0,0 is bottom-left.

Rendering starts at the top and goes over each row, left to right, top to bottom.

pub fn rgb(
  red red: Int,
  green green: Int,
  blue blue: Int,
) -> Pixel

Construct a pixel from 3 ints from 0 to 255 (inclusive).

Numbers outside this range will be truncated.

pub fn simple_render(
  width width: Int,
  height height: Int,
  pixel plot: fn(Int, Int) -> Pixel,
) -> BitArray

Build a BMP image by iterating over each pixel.

The callback gets the X and Y position of the pixel, where 0,0 is bottom-left.

Rendering starts at the top and goes over each row, left to right, top to bottom.

Search Document