render

package
v0.0.0-...-c7c9265 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Render

func Render(grid Grid) image.Image

func ToFile

func ToFile(grid Grid, path string) error

Types

type Grid

type Grid interface {
	NumRows() int
	NumCols() int
	// LetterAt returns the letter at the given row and column.
	// Returning '.' will cause the square to render black.
	// Returning ' ' or '-' or 0 will cause no letter to be rendered.
	LetterAt(row, col int) byte
	// ShadeAt returns the shade in range [0,1] to shade the square at the given row/column.
	// It will only be called for white squares with no letters.
	ShadeAt(row, col int) float64
}

Grid describes a grid and its associated data.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL