Rasterized rendering

Rasterized rendering#

module:

navground.sim.ui.render

Rasterizes SVG using cairosvg.

Renders the world as a raw image

Parameters:
  • world – The world to be rendered

  • background_color – A valid SVG color for the background

  • kwargs – Optional configuration: same fields as navground.sim.ui.RenderConfig.

The actual configuration is computed by looking (in order) to

  1. the arguments of this function;

  2. the world-specific configuration navground.sim.World.render_kwargs;

  3. the default configuration navground.sim.ui.render_default_config.

Returns:

An RGB image as a numpy array

Renders the world as an png image

Parameters:
  • world – The world to be rendered

  • background_color – A valid SVG color for the background

  • kwargs – Optional configuration: same fields as navground.sim.ui.RenderConfig.

The actual configuration is computed by looking (in order) to

  1. the arguments of this function;

  2. the world-specific configuration navground.sim.World.render_kwargs;

  3. the default configuration navground.sim.ui.render_default_config.

Returns:

A png bytestring

Renders the world as an pdf image

Parameters:
  • world – The world to be rendered

  • background_color – A valid SVG color for the background

  • kwargs – Optional configuration: same fields as navground.sim.ui.RenderConfig.

The actual configuration is computed by looking (in order) to

  1. the arguments of this function;

  2. the world-specific configuration navground.sim.World.render_kwargs;

  3. the default configuration navground.sim.ui.render_default_config.

Returns:

A pdf bytestring