psvg

package module
Version: v0.0.0-...-fd8ea21 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2018 License: BSD-3-Clause Imports: 8 Imported by: 0

README

psvg

Documentation

Overview

Spec SVG1.1 https://www.w3.org/TR/SVG/paths.html

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArcAbs

type ArcAbs struct {
	To       mgl32.Vec2
	Radius   mgl32.Vec2
	Angle    float32
	LargeArc bool
	Sweep    bool
}

https://www.w3.org/TR/SVG/paths.html#Interfaceseg.TypeArcAbs

func (ArcAbs) String

func (s ArcAbs) String() string

func (ArcAbs) Type

func (s ArcAbs) Type() seg.Type

type ArcArguments

type ArcArguments struct {
	To       mgl32.Vec2
	Radius   mgl32.Vec2
	Angle    float32
	LargeArc bool
	Sweep    bool
}

type ArcRel

type ArcRel struct {
	To       mgl32.Vec2
	Radius   mgl32.Vec2
	Angle    float32
	LargeArc bool
	Sweep    bool
}

https://www.w3.org/TR/SVG/paths.html#Interfaceseg.TypeArcRel

func (ArcRel) String

func (s ArcRel) String() string

func (ArcRel) Type

func (s ArcRel) Type() seg.Type

type ClosePath

type ClosePath struct{}

https://www.w3.org/TR/SVG/paths.html#Interfaceseg.TypeClosePath

func (ClosePath) String

func (s ClosePath) String() string

func (ClosePath) Type

func (s ClosePath) Type() seg.Type

type CurveToCubicAbs

type CurveToCubicAbs struct {
	P0, P1, To mgl32.Vec2
}

https://www.w3.org/TR/SVG/paths.html#Interfaceseg.TypeCurvetoCubicAbs

func (CurveToCubicAbs) String

func (s CurveToCubicAbs) String() string

func (CurveToCubicAbs) Type

func (s CurveToCubicAbs) Type() seg.Type

type CurveToCubicRel

type CurveToCubicRel struct {
	P0, P1, To mgl32.Vec2
}

https://www.w3.org/TR/SVG/paths.html#Interfaceseg.TypeCurvetoCubicRel

func (CurveToCubicRel) String

func (s CurveToCubicRel) String() string

func (CurveToCubicRel) Type

func (s CurveToCubicRel) Type() seg.Type

type CurveToCubicSmoothAbs

type CurveToCubicSmoothAbs struct {
	P1 mgl32.Vec2
	To mgl32.Vec2
}

https://www.w3.org/TR/SVG/paths.html#Interfaceseg.TypeCurvetoCubicSmoothAbs

func (CurveToCubicSmoothAbs) String

func (s CurveToCubicSmoothAbs) String() string

func (CurveToCubicSmoothAbs) Type

func (s CurveToCubicSmoothAbs) Type() seg.Type

type CurveToCubicSmoothRel

type CurveToCubicSmoothRel struct {
	P1 mgl32.Vec2
	To mgl32.Vec2
}

https://www.w3.org/TR/SVG/paths.html#Interfaceseg.TypeCurvetoCubicSmoothRel

func (CurveToCubicSmoothRel) String

func (s CurveToCubicSmoothRel) String() string

func (CurveToCubicSmoothRel) Type

func (s CurveToCubicSmoothRel) Type() seg.Type

type CurveToQuadraticAbs

type CurveToQuadraticAbs struct {
	P0, To mgl32.Vec2
}

https://www.w3.org/TR/SVG/paths.html#Interfaceseg.TypeCurvetoQuadraticAbs

func (CurveToQuadraticAbs) String

func (s CurveToQuadraticAbs) String() string

func (CurveToQuadraticAbs) Type

func (s CurveToQuadraticAbs) Type() seg.Type

type CurveToQuadraticRel

type CurveToQuadraticRel struct {
	P0, To mgl32.Vec2
}

https://www.w3.org/TR/SVG/paths.html#Interfaceseg.TypeCurvetoQuadraticRel

func (CurveToQuadraticRel) String

func (s CurveToQuadraticRel) String() string

func (CurveToQuadraticRel) Type

func (s CurveToQuadraticRel) Type() seg.Type

type CurveToQuadraticSmoothAbs

type CurveToQuadraticSmoothAbs struct {
	To mgl32.Vec2
}

https://www.w3.org/TR/SVG/paths.html#Interfaceseg.TypeCurvetoQuadraticSmoothAbs

func (CurveToQuadraticSmoothAbs) String

func (s CurveToQuadraticSmoothAbs) String() string

func (CurveToQuadraticSmoothAbs) Type

type CurveToQuadraticSmoothRel

type CurveToQuadraticSmoothRel struct {
	To mgl32.Vec2
}

https://www.w3.org/TR/SVG/paths.html#Interfaceseg.TypeCurvetoQuadraticSmoothRel

func (CurveToQuadraticSmoothRel) String

func (s CurveToQuadraticSmoothRel) String() string

func (CurveToQuadraticSmoothRel) Type

type Elem

type Elem interface {
	Type() seg.Type
	fmt.Stringer
}

refer by https://www.w3.org/TR/SVG/paths.html#DOMInterfaces

type LineToAbs

type LineToAbs struct {
	To mgl32.Vec2
}

https://www.w3.org/TR/SVG/paths.html#Interfaceseg.TypeLinetoAbs

func (LineToAbs) String

func (s LineToAbs) String() string

func (LineToAbs) Type

func (s LineToAbs) Type() seg.Type

type LineToHorizontalAbs

type LineToHorizontalAbs struct {
	X float32
}

https://www.w3.org/TR/SVG/paths.html#Interfaceseg.TypeLinetoHorizontalAbs

func (LineToHorizontalAbs) String

func (s LineToHorizontalAbs) String() string

func (LineToHorizontalAbs) Type

func (s LineToHorizontalAbs) Type() seg.Type

type LineToHorizontalRel

type LineToHorizontalRel struct {
	X float32
}

https://www.w3.org/TR/SVG/paths.html#Interfaceseg.TypeLinetoHorizontalRel

func (LineToHorizontalRel) String

func (s LineToHorizontalRel) String() string

func (LineToHorizontalRel) Type

func (s LineToHorizontalRel) Type() seg.Type

type LineToRel

type LineToRel struct {
	To mgl32.Vec2
}

https://www.w3.org/TR/SVG/paths.html#Interfaceseg.TypeLinetoRel

func (LineToRel) String

func (s LineToRel) String() string

func (LineToRel) Type

func (s LineToRel) Type() seg.Type

type LineToVerticalAbs

type LineToVerticalAbs struct {
	Y float32
}

https://www.w3.org/TR/SVG/paths.html#Interfaceseg.TypeLinetoVerticalAbs

func (LineToVerticalAbs) String

func (s LineToVerticalAbs) String() string

func (LineToVerticalAbs) Type

func (s LineToVerticalAbs) Type() seg.Type

type LineToVerticalRel

type LineToVerticalRel struct {
	Y float32
}

https://www.w3.org/TR/SVG/paths.html#Interfaceseg.TypeLinetoVerticalRel

func (LineToVerticalRel) String

func (s LineToVerticalRel) String() string

func (LineToVerticalRel) Type

func (s LineToVerticalRel) Type() seg.Type

type MoveToAbs

type MoveToAbs struct {
	To mgl32.Vec2
}

https://www.w3.org/TR/SVG/paths.html#Interfaceseg.TypeMovetoAbs

func (MoveToAbs) String

func (s MoveToAbs) String() string

func (MoveToAbs) Type

func (s MoveToAbs) Type() seg.Type

type MoveToRel

type MoveToRel struct {
	To mgl32.Vec2
}

https://www.w3.org/TR/SVG/paths.html#Interfaceseg.TypeMovetoRel

func (MoveToRel) String

func (s MoveToRel) String() string

func (MoveToRel) Type

func (s MoveToRel) Type() seg.Type

type Parser

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

func NewParser

func NewParser(src io.Reader) *Parser

func (*Parser) Next

func (s *Parser) Next() Elem

Elem can be error interface, Unknown* is Elem, also error

If read all Elems from 'src', It return nil Return nil mean, 'src' faces io.EOF

type Renderer

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

func NewRenderer

func NewRenderer(data ...Elem) *Renderer

func NewRendererFromReader

func NewRendererFromReader(src io.Reader) (*Renderer, error)

func (*Renderer) CheckError

func (s *Renderer) CheckError(onError func(unknown UnknownError)) (res bool)

func (*Renderer) CheckUnknown

func (s *Renderer) CheckUnknown(onUnknown func(unknown UnknownCommand)) (res bool)

func (*Renderer) Render

func (s *Renderer) Render(support Support)

type Support

type Support interface {
	MoveTo(to mgl32.Vec2)
	LineTo(to mgl32.Vec2)
	QuadTo(p0, to mgl32.Vec2)
	CubeTo(p0, p1, to mgl32.Vec2)
	CloseTo()
}

type UnknownCommand

type UnknownCommand struct {
	Command string
}

refer by https://www.w3.org/TR/SVG/paths.html#DOMInterfaces

func (UnknownCommand) Error

func (s UnknownCommand) Error() string

func (UnknownCommand) String

func (s UnknownCommand) String() string

func (UnknownCommand) Type

func (s UnknownCommand) Type() seg.Type

type UnknownError

type UnknownError struct {
	From string
	Err  error
}

Kind Of Error

func (UnknownError) Error

func (s UnknownError) Error() string

func (UnknownError) String

func (s UnknownError) String() string

func (UnknownError) Type

func (s UnknownError) Type() seg.Type

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL