draw

package
v0.0.0-...-68e3ea5 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: CC-BY-3.0, Freetype, GPL-3.0-or-later Imports: 18 Imported by: 0

Documentation

Overview

2D rendering of data slices.

Index

Constants

View Source
const (
	X = 0
	Y = 1
	Z = 2
)

Variables

This section is empty.

Functions

func ColorMap

func ColorMap(min, max, value float32, colormap ...color.RGBA) color.RGBA

func GIF256

func GIF256(w io.Writer, img image.Image) error

full quality gif coded, passable to Render()

func HSLMap

func HSLMap(x, y, z float32) color.RGBA

Colormap for 3D vector data.

func HSLtoRGB

func HSLtoRGB(h, s, l float32) color.RGBA

h = 0..2pi, s=0..1, l=0..1

func Image

func Image(f *data.Slice, fmin, fmax string, arrowSize int, colormap ...ColorMapSpec) *image.RGBA

Renders an image of slice. fmin, fmax = "auto" or a number to set the min/max color scale.

func JPEG100

func JPEG100(w io.Writer, img image.Image) error

full-quality jpeg codec, passable to Render()

func On

func On(img *image.RGBA, f *data.Slice, fmin, fmax string, arrowSize int, colormap ...ColorMapSpec)

Render on existing image buffer. Resize it if needed

func PNG

func PNG(w io.Writer, img image.Image) error

png codec, passable to Render()

func Render

func Render(out io.Writer, f *data.Slice, min, max string, arrowSize int, encode codec, colormap ...ColorMapSpec) error

Render data and encode with arbitrary codec.

func RenderFile

func RenderFile(fname string, f *data.Slice, min, max string, arrowSize int, colormap ...ColorMapSpec) error

func RenderFormat

func RenderFormat(out io.Writer, f *data.Slice, min, max string, arrowSize int, format string, colormap ...ColorMapSpec) error

func SVG

func SVG(out io.Writer, arr [3][][][]float32)

Renders svg image of vector data.

Types

type Canvas

type Canvas struct {
	*image.RGBA
	*raster.RGBAPainter
	// contains filtered or unexported fields
}

A Canvas is used to draw on.

func NewCanvas

func NewCanvas(img *image.RGBA) *Canvas

Make a new canvas of size w x h.

func (*Canvas) Arrow

func (c *Canvas) Arrow(x, y, mx, my, mz, size float32)

type ColorMapSpec

type ColorMapSpec struct {
	Cmap  []color.RGBA
	Ccomp int
}

Jump to

Keyboard shortcuts

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