Skip to content

sim.img #

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_settings #

fn new_image_settings(settings ImageSettings) 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

struct ImageSettings #

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

fn (ImageSettings) to_grid_settings #

fn (s ImageSettings) to_grid_settings() sim.GridSettings

struct ImageWritter #

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

struct PPMWriter #

struct PPMWriter {
mut:
	file       os.File
	cache      []byte
	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 #

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