gomap

package
v0.0.0-...-ad9000f Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2022 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DEEPWATER = color.RGBA{0, 83, 209, 255}
	WATER     = color.RGBA{45, 118, 228, 255}
	SHORE     = color.RGBA{100, 193, 240, 255}
	LAND      = color.RGBA{81, 168, 95, 255}
	MOUNTAIN  = color.RGBA{115, 66, 12, 255}
)

---------------------------------------------------------------------------- Auxiliaries

Functions

func HeightMapToImage

func HeightMapToImage(m *HeightMap, sl uint8) *image.RGBA

Heightmap -> RGBA image

func SaveHeightMap

func SaveHeightMap(s string, h *HeightMap) error

---------------------------------------------------------------------------- Other functions Saves the heightmap

func SaveHeightMapColored

func SaveHeightMapColored(s string, h *HeightMap, sl uint8) error

Saves a colored version of the heightmap

Types

type HeightMap

type HeightMap struct {
	Pix  [][]uint8       // Map
	Rect image.Rectangle // Bounds
}

---------------------------------------------------------------------------- Heightmap

func NewHeightMapDS

func NewHeightMapDS(s int, o, r uint8) *HeightMap

Diamond Square (works better with h,w = 2^k)

func NewHeightMapRN

func NewHeightMapRN(w, h, o int) *HeightMap

---------------------------------------------------------------------------- Heightmap generator functions Random noise

func (*HeightMap) At

func (h *HeightMap) At(x, y int) color.Color

Image interface functions

func (*HeightMap) Bounds

func (h *HeightMap) Bounds() image.Rectangle

func (*HeightMap) ColorModel

func (h *HeightMap) ColorModel() color.Model

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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