vgcairo

package module
v0.0.0-...-847c5a5 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: MPL-2.0 Imports: 7 Imported by: 1

README

vgcairo

Cairo rendering backend for gonum/plot. Primarily meant to be used with gotk4's GTK3 and GTK4.

Documentation

Overview

Package vgcairo provides a Cairo drawing backend for gonum.org/plot/vg.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ColorSurface

func ColorSurface(surface *cairo.Surface, x, y float64) color.Color

ColorSurface is a type that implements all of color.Color's methods and wraps around a cairo.Surface. This is useful for SetColor.

Note that calling RGBA on the returned color will always return a transparent color.

Types

type Canvas

type Canvas struct {
	// contains filtered or unexported fields
}

Canvas implements the vg.Canvas interface, drawing to a cairo.Context.

func NewCanvas

func NewCanvas(t *cairo.Context) Canvas

NewCanvas returns a new Cairo Canvas.

func (Canvas) Context

func (c Canvas) Context() *cairo.Context

Context returns the Canvas' cairo.Context.

func (Canvas) DrawImage

func (c Canvas) DrawImage(rect vg.Rectangle, img image.Image)

DrawImage implements vg.Canvas.

func (Canvas) Fill

func (c Canvas) Fill(path vg.Path)

Fill implements vg.Canvas.

func (Canvas) FillString

func (c Canvas) FillString(f font.Face, pt vg.Point, text string)

FillString implements vg.Canvas.

func (Canvas) Pop

func (c Canvas) Pop()

Pop implements vg.Canvas.

func (Canvas) Push

func (c Canvas) Push()

Push implements vg.Canvas.

func (Canvas) Rotate

func (c Canvas) Rotate(rad float64)

Rotate implements vg.Canvas.

func (Canvas) Scale

func (c Canvas) Scale(x, y float64)

Scale implements vg.Canvas.

func (Canvas) SetColor

func (c Canvas) SetColor(clr color.Color)

SetColor implements vg.Canvas.

func (Canvas) SetLineDash

func (c Canvas) SetLineDash(pattern []vg.Length, offset vg.Length)

SetLineDash implements vg.Canvas.

func (Canvas) SetLineWidth

func (c Canvas) SetLineWidth(l vg.Length)

SetLineWidth implements vg.Canvas.

func (Canvas) Stroke

func (c Canvas) Stroke(path vg.Path)

Stroke implements vg.Canvas.

func (Canvas) Translate

func (c Canvas) Translate(pt vg.Point)

Translate implements vg.Canvas.

Directories

Path Synopsis
internal
bezier
Package bezier provides helper functions for Bezier curves.
Package bezier provides helper functions for Bezier curves.

Jump to

Keyboard shortcuts

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