netpbm

Values

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

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

True is white, false is black.

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

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

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

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

0 is black, 255 is white. Values outside this range are truncated.

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

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

pub fn simple_render_pbm(
  width width: Int,
  height height: Int,
  pixel plot: fn(Int, Int) -> Bool,
) -> BitArray

Build a PBM image by iterating over each pixel.

True is white, false is black.

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

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

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

Build a PGM image by iterating over each pixel.

0 is black, 255 is white. Values outside this range are truncated.

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

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

Search Document