rendering

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: May 20, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PrimitiveEmpty byte = iota
	PrimitivePoint
	PrimitiveLine
	PrimitiveRectangle
	PrimitiveEllipse
	PrimitiveTriangle
	PrimitiveText
	PrimitiveImage
	PrimitiveBezier
	PrimitiveGlyph
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ARenderer added in v0.2.0

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

func NewARenderer added in v0.2.0

func NewARenderer(delegate RendererDelegate, renderDispatcher dispatch.WorkDispatcher) *ARenderer

func (*ARenderer) AddLayer added in v0.2.0

func (r *ARenderer) AddLayer()

func (*ARenderer) AddPrimitive added in v0.2.0

func (r *ARenderer) AddPrimitive() int

Any thread, update goroutine

func (*ARenderer) Clear added in v0.2.0

func (r *ARenderer) Clear()

Update routine

func (*ARenderer) GetLayer added in v0.2.0

func (r *ARenderer) GetLayer(index int) *Layer

func (*ARenderer) GetRenderingPerformer added in v0.2.0

func (r *ARenderer) GetRenderingPerformer() func()

func (*ARenderer) PerformRendering added in v0.2.0

func (r *ARenderer) PerformRendering()

Main or rendering thread

func (*ARenderer) Prepare added in v0.2.0

func (r *ARenderer) Prepare()

PC - main, android - rendering thread

func (*ARenderer) RegisterPrimitiveRendererDelegate added in v0.2.0

func (r *ARenderer) RegisterPrimitiveRendererDelegate(primitiveKind byte, delegate PrimitiveRendererDelegate)

func (*ARenderer) RemoveLayer added in v0.2.0

func (r *ARenderer) RemoveLayer(index int)

func (*ARenderer) RemovePrimitive added in v0.2.0

func (r *ARenderer) RemovePrimitive(id int)

Any thread, update goroutine

func (*ARenderer) SetManagementMode added in v0.2.0

func (r *ARenderer) SetManagementMode(mode ManagementMode)

func (*ARenderer) SetPreparedCallback added in v0.2.1

func (r *ARenderer) SetPreparedCallback(f func())

func (*ARenderer) SetPrimitive added in v0.2.0

func (r *ARenderer) SetPrimitive(id int, primitive IPrimitive, shouldRerender bool)

Any thread, update goroutine

func (*ARenderer) SetPrimitiveLayer added in v0.2.0

func (r *ARenderer) SetPrimitiveLayer(primitiveId, layerIndex int)

func (*ARenderer) Stop added in v0.2.0

func (r *ARenderer) Stop()

type Appearance

type Appearance struct {
	FillColor    a.Color
	StrokeColor  a.Color
	StrokeWeight byte
	CornerRadius byte
}

func DefaultAppearance

func DefaultAppearance() Appearance

func (Appearance) ToMap

func (ap Appearance) ToMap() map[string]interface{}

type BezierPrimitive

type BezierPrimitive struct {
	Transform     Transform
	Appearance    Appearance
	ControlPoint1 a.IntVector3
	ControlPoint2 a.IntVector3
}

func NewBezierPrimitive

func NewBezierPrimitive(cp1, cp2 a.IntVector3) *BezierPrimitive

func (*BezierPrimitive) GetTransform

func (b *BezierPrimitive) GetTransform() Transform

func (*BezierPrimitive) GetType

func (b *BezierPrimitive) GetType() byte

func (*BezierPrimitive) SetTransform added in v0.2.0

func (b *BezierPrimitive) SetTransform(t Transform)

type GeometryPrimitive

type GeometryPrimitive struct {
	Transform  Transform
	Appearance Appearance
	// contains filtered or unexported fields
}

func NewGeometryPrimitive

func NewGeometryPrimitive(pType byte) *GeometryPrimitive

func (*GeometryPrimitive) GetTransform

func (p *GeometryPrimitive) GetTransform() Transform

func (*GeometryPrimitive) GetType

func (p *GeometryPrimitive) GetType() byte

func (*GeometryPrimitive) SetTransform added in v0.2.0

func (p *GeometryPrimitive) SetTransform(t Transform)

type IPrimitive

type IPrimitive interface {
	GetType() byte
	GetTransform() Transform
	SetTransform(t Transform)
}

type ImagePrimitive

type ImagePrimitive struct {
	Transform Transform
	ImageUrl  string
}

func NewImagePrimitive

func NewImagePrimitive(url string) *ImagePrimitive

func (*ImagePrimitive) GetTransform

func (p *ImagePrimitive) GetTransform() Transform

func (*ImagePrimitive) GetType

func (p *ImagePrimitive) GetType() byte

func (*ImagePrimitive) SetTransform added in v0.2.0

func (p *ImagePrimitive) SetTransform(t Transform)

type Layer added in v0.2.0

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

func (*Layer) GetTranslation added in v0.2.0

func (l *Layer) GetTranslation() a.IntVector3

func (*Layer) SetTranslation added in v0.2.0

func (l *Layer) SetTranslation(t a.IntVector3)

type ManagementMode added in v0.2.0

type ManagementMode byte
const (
	EngineManaged ManagementMode = iota
	FrontendManaged
)

type PrimitiveContainer added in v0.2.0

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

type PrimitiveRendererDelegate added in v0.2.0

type PrimitiveRendererDelegate interface {
	OnStart()
	OnSetPrimitive(ctx *PrimitiveRenderingContext)
	OnRender(ctx *PrimitiveRenderingContext)
	OnRemovePrimitive(ctx *PrimitiveRenderingContext)
	OnStop()
}

type PrimitiveRenderingContext added in v0.2.0

type PrimitiveRenderingContext struct {
	Renderer      *ARenderer
	Primitive     IPrimitive
	PrimitiveKind byte
	PrimitiveId   int
	State         interface{}
	Redraw        bool
}

type RendererDelegate added in v0.2.0

type RendererDelegate interface {
	OnPrepare()
	OnPerformRenderingStart()
	OnPerformRenderingEnd()
	OnClear()
	OnStop()
}

type TextAppearance

type TextAppearance struct {
	Font     string
	FontSize byte
}

func DefaultTextAppearance

func DefaultTextAppearance() TextAppearance

func (TextAppearance) ToMap

func (a TextAppearance) ToMap() map[string]interface{}

type TextPrimitive

type TextPrimitive struct {
	Transform      Transform
	Appearance     Appearance
	TextAppearance TextAppearance
	Text           string
	HTextAlign     a.TextAlign
	VTextAlign     a.TextAlign
}

func NewTextPrimitive

func NewTextPrimitive(text string) *TextPrimitive

func (*TextPrimitive) GetTransform

func (p *TextPrimitive) GetTransform() Transform

func (*TextPrimitive) GetType

func (p *TextPrimitive) GetType() byte

func (*TextPrimitive) SetTransform added in v0.2.0

func (p *TextPrimitive) SetTransform(t Transform)

type Transform

type Transform struct {
	Position a.IntVector3
	Rotation a.IntVector3
	Size     a.IntVector3
}

func NewTransform

func NewTransform() Transform

func (Transform) GetRect added in v0.1.9

func (t Transform) GetRect() *common.RectBoundary

func (Transform) ToMap

func (t Transform) ToMap() map[string]interface{}

Jump to

Keyboard shortcuts

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