Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Contour ¶
type Contour []Point
Contour is a list of Points which define an isoline. Contours may be open or closed. Closed contours have c[0] == c[len(c)-1].
type ContourMap ¶
type ContourMap struct { W int // width of the contour map in pixels H int // height of the contour map in pixels Min float64 // minimum value contained in this contour map Max float64 // maximum value contained in this contour map // contains filtered or unexported fields }
func FromFloat64s ¶
func FromFloat64s(w, h int, grid []float64) *ContourMap
FromFloat64s returns a new ContourMap for the provided 2D grid of values. len(grid) must equal w * h.
func FromFunction ¶
func FromFunction(w, h int, f Function) *ContourMap
FromFloat64s returns a new ContourMap for the provided function. The function will be called for all points x = [0, w) and y = [0, h) to determine the Z value at each point.
func FromImage ¶
func FromImage(im image.Image) *ContourMap
FromImage returns a new ContourMap for the provided image. The image is converted to 16-bit grayscale and will have Z values mapped from [0, 65535] to [0, 1].
func (*ContourMap) Closed ¶
func (m *ContourMap) Closed() *ContourMap
Closed returns a new ContourMap that will ensure all Contours are closed paths by following the border when they would normally stop at the edge of the grid.
func (*ContourMap) Contours ¶
func (m *ContourMap) Contours(z float64) []Contour
Contours returns a list of contours that represent isolines at the specified Z value.
func (*ContourMap) HistogramZs ¶
func (m *ContourMap) HistogramZs(numLevels int) []float64