Module sim.img stdlib

sim.img
Version:
0.3.3
License:
MIT
Dependencies from vmod:
0
Imports:
5
Imported by:
1
Repository:
OS-specific
Show selected OS-specific symbols.
Backend-specific
Show selected Backend-specific symbols.

Dependencies defined in v.mod

This section is empty.

Imports

Imported by

Aliases

This section is empty.

Constants

This section is empty.

Sum types

This section is empty.

Functions

#fn compute_pixel

fn compute_pixel(result sim.SimResult) gx.Color

#fn image_settings_from_grid

fn image_settings_from_grid(grid sim.GridSettings) ImageSettings

#fn image_worker

fn image_worker(mut writer &PPMWriter, result_chan chan &sim.SimResult, settings ImageSettings)

#fn new_image_writer

fn new_image_writer(mut writer &PPMWriter, settings ImageSettings) &ImageWritter

#fn ppm_writer_for_fname

fn ppm_writer_for_fname(fname string, settings ImageSettings) !&PPMWriter

Structs

#struct ImageSettings

params
pub struct ImageSettings {
pub:
	width      int = sim.default_width
	height     int = sim.default_height
	cache_size int = 200
}

#fn new_image_settings

fn new_image_settings(settings ImageSettings) ImageSettings

#fn (ImageSettings) to_grid_settings

fn (s ImageSettings) to_grid_settings() sim.GridSettings

#struct PPMWriter

pub struct PPMWriter {
mut:
	file       os.File
	cache      []u8
	cache_size int
}

#fn (&PPMWriter) start_for_file

fn (mut writer &PPMWriter) start_for_file(fname string, settings ImageSettings) !

#fn (&PPMWriter) handle_pixel

fn (mut writer &PPMWriter) handle_pixel(p gx.Color) !

#fn (&PPMWriter) flush

fn (mut writer &PPMWriter) flush() !

#fn (&PPMWriter) write

fn (mut writer &PPMWriter) write() !

#fn (&PPMWriter) close

fn (mut writer &PPMWriter) close()

#struct ValidColor

pub struct ValidColor {
	gx.Color
pub mut:
	valid bool
}

#struct ImageWritter

pub struct ImageWritter {
	settings ImageSettings
pub mut:
	writer        PPMWriter
	current_index int
	buffer        []ValidColor
}

#fn (&ImageWritter) handle

fn (mut iw &ImageWritter) handle(result sim.SimResult) !int

Interfaces

This section is empty.

Enums

This section is empty.