gvc

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2024 License: MIT Imports: 21 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetFontLoader added in v0.2.2

func SetFontLoader(loader FontLoader)

Types

type Color

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

func (*Color) HSVA added in v0.2.0

func (c *Color) HSVA() [4]float64

func (*Color) Index added in v0.2.0

func (c *Color) Index() int

func (*Color) RGBADouble added in v0.2.0

func (c *Color) RGBADouble() [4]float64

func (*Color) RGBAInt added in v0.2.0

func (c *Color) RGBAInt() [4]int

func (*Color) RGBAUint added in v0.2.0

func (c *Color) RGBAUint() [4]uint

func (*Color) SetHSVA added in v0.2.2

func (c *Color) SetHSVA(v [4]float64)

func (*Color) SetIndex added in v0.2.0

func (c *Color) SetIndex(v int)

func (*Color) SetRGBADouble added in v0.2.0

func (c *Color) SetRGBADouble(v [4]float64)

func (*Color) SetRGBAInt added in v0.2.0

func (c *Color) SetRGBAInt(v [4]int)

func (*Color) SetRGBAUint added in v0.2.0

func (c *Color) SetRGBAUint(v [4]uint)

func (*Color) SetString added in v0.2.0

func (c *Color) SetString(v string)

func (*Color) SetType added in v0.2.0

func (c *Color) SetType(v ColorType)

func (*Color) String added in v0.2.0

func (c *Color) String() string

func (*Color) Type added in v0.2.0

func (c *Color) Type() ColorType

type ColorType added in v0.2.0

type ColorType int64

type Context

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

func New

func New(ctx context.Context) (*Context, error)

func NewWithPlugins added in v0.2.0

func NewWithPlugins(ctx context.Context, plugins ...Plugin) (*Context, error)

func (*Context) Clone added in v0.2.0

func (c *Context) Clone(ctx context.Context) (*Context, error)

func (*Context) Close

func (c *Context) Close() error

func (*Context) FreeClonedContext added in v0.2.0

func (c *Context) FreeClonedContext(ctx context.Context) error

func (*Context) FreeLayout

func (c *Context) FreeLayout(ctx context.Context, g *cgraph.Graph) error

func (*Context) Layout

func (c *Context) Layout(ctx context.Context, g *cgraph.Graph, engine string) error

func (*Context) RenderData

func (c *Context) RenderData(ctx context.Context, g *cgraph.Graph, format string, w io.Writer) error

func (*Context) RenderFilename

func (c *Context) RenderFilename(ctx context.Context, g *cgraph.Graph, format, filename string) error

func (*Context) RenderImage

func (c *Context) RenderImage(ctx context.Context, g *cgraph.Graph, format string) (image.Image, error)

type DefaultRenderEngine added in v0.2.0

type DefaultRenderEngine struct {
}

func (*DefaultRenderEngine) BeginAnchor added in v0.2.0

func (e *DefaultRenderEngine) BeginAnchor(_ context.Context, _ *Job, _, _, _, _ string) error

func (*DefaultRenderEngine) BeginCluster added in v0.2.0

func (e *DefaultRenderEngine) BeginCluster(_ context.Context, _ *Job) error

func (*DefaultRenderEngine) BeginEdge added in v0.2.0

func (e *DefaultRenderEngine) BeginEdge(_ context.Context, _ *Job) error

func (*DefaultRenderEngine) BeginEdges added in v0.2.0

func (e *DefaultRenderEngine) BeginEdges(_ context.Context, _ *Job) error

func (*DefaultRenderEngine) BeginGraph added in v0.2.0

func (e *DefaultRenderEngine) BeginGraph(_ context.Context, _ *Job) error

func (*DefaultRenderEngine) BeginJob added in v0.2.0

func (e *DefaultRenderEngine) BeginJob(_ context.Context, _ *Job) error

func (*DefaultRenderEngine) BeginLabel added in v0.2.0

func (e *DefaultRenderEngine) BeginLabel(_ context.Context, _ *Job, _ LabelType) error

func (*DefaultRenderEngine) BeginLayer added in v0.2.0

func (e *DefaultRenderEngine) BeginLayer(_ context.Context, _ *Job, layerName string, layerNum, numLayers int) error

func (*DefaultRenderEngine) BeginNode added in v0.2.0

func (e *DefaultRenderEngine) BeginNode(_ context.Context, _ *Job) error

func (*DefaultRenderEngine) BeginNodes added in v0.2.0

func (e *DefaultRenderEngine) BeginNodes(_ context.Context, _ *Job) error

func (*DefaultRenderEngine) BeginPage added in v0.2.0

func (e *DefaultRenderEngine) BeginPage(_ context.Context, _ *Job) error

func (*DefaultRenderEngine) BezierCurve added in v0.2.0

func (e *DefaultRenderEngine) BezierCurve(_ context.Context, _ *Job, _ []*PointFloat, _ bool) error

func (*DefaultRenderEngine) Comment added in v0.2.0

func (e *DefaultRenderEngine) Comment(_ context.Context, _ *Job, _ string) error

func (*DefaultRenderEngine) Ellipse added in v0.2.0

func (e *DefaultRenderEngine) Ellipse(_ context.Context, _ *Job, _ []*PointFloat, _ bool) error

func (*DefaultRenderEngine) EndAnchor added in v0.2.0

func (e *DefaultRenderEngine) EndAnchor(_ context.Context, _ *Job) error

func (*DefaultRenderEngine) EndCluster added in v0.2.0

func (e *DefaultRenderEngine) EndCluster(_ context.Context, _ *Job) error

func (*DefaultRenderEngine) EndEdge added in v0.2.0

func (e *DefaultRenderEngine) EndEdge(_ context.Context, _ *Job) error

func (*DefaultRenderEngine) EndEdges added in v0.2.0

func (e *DefaultRenderEngine) EndEdges(_ context.Context, _ *Job) error

func (*DefaultRenderEngine) EndGraph added in v0.2.0

func (e *DefaultRenderEngine) EndGraph(_ context.Context, _ *Job) error

func (*DefaultRenderEngine) EndJob added in v0.2.0

func (e *DefaultRenderEngine) EndJob(_ context.Context, _ *Job) error

func (*DefaultRenderEngine) EndLabel added in v0.2.0

func (e *DefaultRenderEngine) EndLabel(_ context.Context, _ *Job) error

func (*DefaultRenderEngine) EndLayer added in v0.2.0

func (e *DefaultRenderEngine) EndLayer(_ context.Context, _ *Job) error

func (*DefaultRenderEngine) EndNode added in v0.2.0

func (e *DefaultRenderEngine) EndNode(_ context.Context, _ *Job) error

func (*DefaultRenderEngine) EndNodes added in v0.2.0

func (e *DefaultRenderEngine) EndNodes(_ context.Context, _ *Job) error

func (*DefaultRenderEngine) EndPage added in v0.2.0

func (e *DefaultRenderEngine) EndPage(_ context.Context, _ *Job) error

func (*DefaultRenderEngine) LibraryShape added in v0.2.0

func (e *DefaultRenderEngine) LibraryShape(_ context.Context, _ *Job, _ string, _ []*PointFloat, _ bool) error

func (*DefaultRenderEngine) Polygon added in v0.2.0

func (e *DefaultRenderEngine) Polygon(_ context.Context, _ *Job, _ []*PointFloat, _ bool) error

func (*DefaultRenderEngine) Polyline added in v0.2.0

func (e *DefaultRenderEngine) Polyline(_ context.Context, _ *Job, _ []*PointFloat) error

func (*DefaultRenderEngine) ResolveColor added in v0.2.0

func (e *DefaultRenderEngine) ResolveColor(_ context.Context, _ *Job, _ *Color) error

func (*DefaultRenderEngine) TextSpan added in v0.2.0

func (e *DefaultRenderEngine) TextSpan(_ context.Context, _ *Job, _ *PointFloat, _ *TextSpan) error

type DevicePlugin added in v0.2.0

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

func JPGDevicePlugin added in v0.2.0

func JPGDevicePlugin(ctx context.Context) (*DevicePlugin, error)

func NewDevicePlugin added in v0.2.0

func NewDevicePlugin(ctx context.Context, typ string, opts ...DevicePluginOption) (*DevicePlugin, error)

func PNGDevicePlugin added in v0.2.0

func PNGDevicePlugin(ctx context.Context) (*DevicePlugin, error)

type DevicePluginOption added in v0.2.0

type DevicePluginOption func(*deviceConfig)

func WithDeviceDPI added in v0.2.0

func WithDeviceDPI(x, y float64) DevicePluginOption

func WithDeviceFeatures added in v0.2.0

func WithDeviceFeatures(features ...DeviceFeature) DevicePluginOption

func WithDeviceQuality added in v0.2.0

func WithDeviceQuality(quality int) DevicePluginOption

type FillType added in v0.2.0

type FillType int64

type FontLoader added in v0.2.2

type FontLoader func(ctx context.Context, job *Job, font *TextFont) (font.Face, error)

type ImageRenderer

type ImageRenderer struct {
	*DefaultRenderEngine
	// contains filtered or unexported fields
}

func (*ImageRenderer) BeginPage

func (r *ImageRenderer) BeginPage(ctx context.Context, job *Job) error

func (*ImageRenderer) BezierCurve

func (r *ImageRenderer) BezierCurve(ctx context.Context, job *Job, a []*PointFloat, filled bool) error

func (*ImageRenderer) Ellipse

func (r *ImageRenderer) Ellipse(ctx context.Context, job *Job, p []*PointFloat, filled bool) error

func (*ImageRenderer) EndPage

func (r *ImageRenderer) EndPage(ctx context.Context, job *Job) error

func (*ImageRenderer) Polygon

func (r *ImageRenderer) Polygon(ctx context.Context, job *Job, a []*PointFloat, filled bool) error

func (*ImageRenderer) Polyline

func (r *ImageRenderer) Polyline(ctx context.Context, job *Job, a []*PointFloat) error

func (*ImageRenderer) TextSpan

func (r *ImageRenderer) TextSpan(ctx context.Context, job *Job, p *PointFloat, span *TextSpan) error

type Job

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

func (*Job) DPI added in v0.2.2

func (j *Job) DPI() *PointFloat

func (*Job) ExternalContext added in v0.2.0

func (j *Job) ExternalContext() bool

func (*Job) Height added in v0.2.0

func (j *Job) Height() uint64

func (*Job) Object added in v0.2.0

func (j *Job) Object() *ObjectState

func (*Job) OutputData added in v0.2.0

func (j *Job) OutputData() []byte

func (*Job) OutputDataPosition added in v0.2.0

func (j *Job) OutputDataPosition() uint

func (*Job) OutputFileName added in v0.2.0

func (j *Job) OutputFileName() string

func (*Job) OutputLangName added in v0.2.0

func (j *Job) OutputLangName() string

func (*Job) Scale added in v0.2.0

func (j *Job) Scale() *Scale

func (*Job) SetDPI added in v0.2.2

func (j *Job) SetDPI(v *PointFloat)

func (*Job) SetHeight added in v0.2.0

func (j *Job) SetHeight(v uint64)

func (*Job) SetOutputData added in v0.2.0

func (j *Job) SetOutputData(v []byte)

func (*Job) SetOutputDataPosition added in v0.2.0

func (j *Job) SetOutputDataPosition(v uint)

func (*Job) SetOutputFileName added in v0.2.0

func (j *Job) SetOutputFileName(v string)

func (*Job) SetOutputLangName added in v0.2.0

func (j *Job) SetOutputLangName(v string)

func (*Job) SetScale added in v0.2.0

func (j *Job) SetScale(v *Scale)

func (*Job) SetTranslation added in v0.2.0

func (j *Job) SetTranslation(v *Translation)

func (*Job) SetWidth added in v0.2.0

func (j *Job) SetWidth(v uint64)

func (*Job) SetZoom added in v0.2.2

func (j *Job) SetZoom(v float64)

func (*Job) Translation added in v0.2.0

func (j *Job) Translation() *Translation

func (*Job) Width added in v0.2.0

func (j *Job) Width() uint64

func (*Job) Zoom added in v0.2.2

func (j *Job) Zoom() float64

type LabelType added in v0.2.0

type LabelType int
var (
	LabelPlain LabelType = LabelType(wasm.LABEL_PLAIN)
	LabelHTML  LabelType = LabelType(wasm.LABEL_HTML)
)

type ObjectState added in v0.2.0

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

func (*ObjectState) Fill added in v0.2.0

func (s *ObjectState) Fill() FillType

func (*ObjectState) FillColor added in v0.2.0

func (s *ObjectState) FillColor() *Color

func (*ObjectState) Pen added in v0.2.0

func (s *ObjectState) Pen() PenType

func (*ObjectState) PenColor added in v0.2.0

func (s *ObjectState) PenColor() *Color

func (*ObjectState) PenWidth added in v0.2.0

func (s *ObjectState) PenWidth() float64

func (*ObjectState) RawStyle added in v0.2.1

func (s *ObjectState) RawStyle() []string

func (*ObjectState) SetFill added in v0.2.0

func (s *ObjectState) SetFill(v FillType)

func (*ObjectState) SetFillColor added in v0.2.0

func (s *ObjectState) SetFillColor(v *Color)

func (*ObjectState) SetPen added in v0.2.0

func (s *ObjectState) SetPen(v PenType)

func (*ObjectState) SetPenColor added in v0.2.0

func (s *ObjectState) SetPenColor(v *Color)

func (*ObjectState) SetPenWidth added in v0.2.0

func (s *ObjectState) SetPenWidth(v float64)

func (*ObjectState) StopColor added in v0.2.1

func (s *ObjectState) StopColor() *Color

type PenType added in v0.2.0

type PenType int64
var (
	PenNone   PenType = PenType(wasm.PEN_NONE)
	PenDashed PenType = PenType(wasm.PEN_DASHED)
	PenDotted PenType = PenType(wasm.PEN_DOTTED)
	PenSolid  PenType = PenType(wasm.PEN_SOLID)
)

type Plugin added in v0.2.0

type Plugin interface {
	// contains filtered or unexported methods
}

func DefaultPlugins added in v0.2.0

func DefaultPlugins(ctx context.Context) ([]Plugin, error)

type PointFloat added in v0.2.0

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

func (*PointFloat) SetX added in v0.2.0

func (p *PointFloat) SetX(x float64)

func (*PointFloat) SetY added in v0.2.0

func (p *PointFloat) SetY(y float64)

func (*PointFloat) X added in v0.2.0

func (p *PointFloat) X() float64

func (*PointFloat) Y added in v0.2.0

func (p *PointFloat) Y() float64

type PostScriptAlias added in v0.2.0

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

func (*PostScriptAlias) Family added in v0.2.0

func (s *PostScriptAlias) Family() string

func (*PostScriptAlias) Name added in v0.2.0

func (s *PostScriptAlias) Name() string

func (*PostScriptAlias) SVGFontFamily added in v0.2.0

func (s *PostScriptAlias) SVGFontFamily() string

func (*PostScriptAlias) SVGFontStyle added in v0.2.0

func (s *PostScriptAlias) SVGFontStyle() string

func (*PostScriptAlias) SVGFontWeight added in v0.2.0

func (s *PostScriptAlias) SVGFontWeight() string

func (*PostScriptAlias) SetFamily added in v0.2.0

func (s *PostScriptAlias) SetFamily(v string)

func (*PostScriptAlias) SetName added in v0.2.0

func (s *PostScriptAlias) SetName(v string)

func (*PostScriptAlias) SetSVGFontFamily added in v0.2.0

func (s *PostScriptAlias) SetSVGFontFamily(v string)

func (*PostScriptAlias) SetSVGFontStyle added in v0.2.0

func (s *PostScriptAlias) SetSVGFontStyle(v string)

func (*PostScriptAlias) SetSVGFontWeight added in v0.2.0

func (s *PostScriptAlias) SetSVGFontWeight(v string)

func (*PostScriptAlias) SetStretch added in v0.2.0

func (s *PostScriptAlias) SetStretch(v string)

func (*PostScriptAlias) SetStyle added in v0.2.0

func (s *PostScriptAlias) SetStyle(v string)

func (*PostScriptAlias) SetWeight added in v0.2.0

func (s *PostScriptAlias) SetWeight(v string)

func (*PostScriptAlias) SetXFigCode added in v0.2.0

func (s *PostScriptAlias) SetXFigCode(v int)

func (*PostScriptAlias) Stretch added in v0.2.0

func (s *PostScriptAlias) Stretch() string

func (*PostScriptAlias) Style added in v0.2.0

func (s *PostScriptAlias) Style() string

func (*PostScriptAlias) Weight added in v0.2.0

func (s *PostScriptAlias) Weight() string

func (*PostScriptAlias) XFigCode added in v0.2.0

func (s *PostScriptAlias) XFigCode() int

type RenderEngine added in v0.2.0

type RenderEngine interface {
	BeginJob(ctx context.Context, job *Job) error
	EndJob(ctx context.Context, job *Job) error
	BeginGraph(ctx context.Context, job *Job) error
	EndGraph(ctx context.Context, job *Job) error
	BeginLayer(ctx context.Context, job *Job, layerName string, layerNum, numLayers int) error
	EndLayer(ctx context.Context, job *Job) error
	BeginPage(ctx context.Context, job *Job) error
	EndPage(ctx context.Context, job *Job) error
	BeginCluster(ctx context.Context, job *Job) error
	EndCluster(ctx context.Context, job *Job) error
	BeginNodes(ctx context.Context, job *Job) error
	EndNodes(ctx context.Context, job *Job) error
	BeginEdges(ctx context.Context, job *Job) error
	EndEdges(ctx context.Context, job *Job) error
	BeginNode(ctx context.Context, job *Job) error
	EndNode(ctx context.Context, job *Job) error
	BeginEdge(ctx context.Context, job *Job) error
	EndEdge(ctx context.Context, job *Job) error
	BeginAnchor(ctx context.Context, job *Job, href, tooltip, target, id string) error
	EndAnchor(ctx context.Context, job *Job) error
	BeginLabel(ctx context.Context, job *Job, labelType LabelType) error
	EndLabel(ctx context.Context, job *Job) error
	TextSpan(ctx context.Context, job *Job, point *PointFloat, textSpan *TextSpan) error
	ResolveColor(ctx context.Context, job *Job, color *Color) error
	Ellipse(ctx context.Context, job *Job, points []*PointFloat, filled bool) error
	Polygon(ctx context.Context, job *Job, points []*PointFloat, filled bool) error
	BezierCurve(ctx context.Context, job *Job, points []*PointFloat, filled bool) error
	Polyline(ctx context.Context, job *Job, points []*PointFloat) error
	Comment(ctx context.Context, job *Job, comment string) error
	LibraryShape(ctx context.Context, job *Job, s string, points []*PointFloat, filled bool) error
}

type RenderPlugin added in v0.2.0

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

func JPGRenderPlugin added in v0.2.0

func JPGRenderPlugin(ctx context.Context) (*RenderPlugin, error)

func NewRenderPlugin added in v0.2.0

func NewRenderPlugin(ctx context.Context, typ string, engine RenderEngine, opts ...RenderPluginOption) (*RenderPlugin, error)

func PNGRenderPlugin added in v0.2.0

func PNGRenderPlugin(ctx context.Context) (*RenderPlugin, error)

type RenderPluginOption added in v0.2.0

type RenderPluginOption func(*renderConfig)

func WithRenderColorType added in v0.2.0

func WithRenderColorType(typ ColorType) RenderPluginOption

func WithRenderFeatures added in v0.2.0

func WithRenderFeatures(features ...RenderFeature) RenderPluginOption

func WithRenderPAD added in v0.2.0

func WithRenderPAD(pad float64) RenderPluginOption

func WithRenderQuality added in v0.2.0

func WithRenderQuality(quality int) RenderPluginOption

type Scale added in v0.2.0

type Scale = PointFloat

type TextFont added in v0.2.0

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

func (*TextFont) Color added in v0.2.0

func (f *TextFont) Color() string

func (*TextFont) Count added in v0.2.0

func (f *TextFont) Count() uint

func (*TextFont) Flags added in v0.2.0

func (f *TextFont) Flags() uint

func (*TextFont) Name added in v0.2.0

func (f *TextFont) Name() string

func (*TextFont) PostScriptAlias added in v0.2.0

func (f *TextFont) PostScriptAlias() *PostScriptAlias

func (*TextFont) SetColor added in v0.2.0

func (f *TextFont) SetColor(v string)

func (*TextFont) SetCount added in v0.2.0

func (f *TextFont) SetCount(v uint)

func (*TextFont) SetFlags added in v0.2.0

func (f *TextFont) SetFlags(v uint)

func (*TextFont) SetName added in v0.2.0

func (f *TextFont) SetName(v string)

func (*TextFont) SetPostScriptAlias added in v0.2.0

func (f *TextFont) SetPostScriptAlias(v *PostScriptAlias)

func (*TextFont) SetSize added in v0.2.0

func (f *TextFont) SetSize(v float64)

func (*TextFont) Size added in v0.2.0

func (f *TextFont) Size() float64

type TextSpan

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

func (*TextSpan) Font added in v0.2.0

func (s *TextSpan) Font() *TextFont

func (*TextSpan) Just added in v0.2.0

func (s *TextSpan) Just() int

func (*TextSpan) SetFont added in v0.2.0

func (s *TextSpan) SetFont(v *TextFont)

func (*TextSpan) SetJust added in v0.2.0

func (s *TextSpan) SetJust(v int)

func (*TextSpan) SetSize added in v0.2.0

func (s *TextSpan) SetSize(v *PointFloat)

func (*TextSpan) SetText added in v0.2.0

func (s *TextSpan) SetText(v string)

func (*TextSpan) SetYOffsetCenterLine added in v0.2.0

func (s *TextSpan) SetYOffsetCenterLine(v float64)

func (*TextSpan) SetYOffsetLayout added in v0.2.0

func (s *TextSpan) SetYOffsetLayout(v float64)

func (*TextSpan) Size added in v0.2.0

func (s *TextSpan) Size() *PointFloat

func (*TextSpan) Text added in v0.2.0

func (s *TextSpan) Text() string

func (*TextSpan) YOffsetCenterLine added in v0.2.0

func (s *TextSpan) YOffsetCenterLine() float64

func (*TextSpan) YOffsetLayout added in v0.2.0

func (s *TextSpan) YOffsetLayout() float64

type Translation added in v0.2.0

type Translation = PointFloat

Jump to

Keyboard shortcuts

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