rendering

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AttributeTransform    = 0
	AttributeFillColor    = 1
	AttributeStrokeColor  = 2
	AttributeStrokeWeight = 3
	AttributeText         = 4
	AttributeFontSize     = 5
	AttributeResIndex     = 6
	AttributeCornerRadius = 7
	AttributePoint        = 8
)
View Source
const (
	CommandAddPrimitive    = 0
	CommandRedrawPrimitive = 1
	CommandRemovePrimitive = 2
	CommandEndOfCommands   = 255
)
View Source
const (
	PrimitiveEmpty     = 0
	PrimitivePoint     = 1
	PrimitiveLine      = 2
	PrimitiveRectangle = 3
	PrimitiveEllipse   = 4
	PrimitiveTriangle  = 5
	PrimitiveText      = 6
	PrimitiveImage     = 7
	PrimitiveBezier    = 8
)

Variables

This section is empty.

Functions

This section is empty.

Types

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 Attribute deprecated

type Attribute struct {
	Code  byte
	Value []byte
}

Deprecated: no longer needed

func NewAttribute

func NewAttribute(code byte, value a.ByteArrayEncodable) Attribute

func (Attribute) EncodeToByteArray

func (at Attribute) EncodeToByteArray() []byte

func (Attribute) GetLength

func (at Attribute) GetLength() int

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

type Command

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

Deprecated

func (Command) EncodeToByteArray

func (c Command) EncodeToByteArray() []byte

func (Command) GetLength

func (c Command) GetLength() int

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

type IPrimitive

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

type ImagePrimitive

type ImagePrimitive struct {
	Transform Transform
	ResIndex  int
}

func NewImagePrimitive

func NewImagePrimitive(index int) *ImagePrimitive

func (*ImagePrimitive) GetTransform

func (p *ImagePrimitive) GetTransform() Transform

func (*ImagePrimitive) GetType

func (p *ImagePrimitive) GetType() byte

type Primitive deprecated

type Primitive struct {
	Type       a.Byte
	Attributes []Attribute
}

Deprecated: no longer needed

func NewPrimitive

func NewPrimitive(pType a.Byte) *Primitive

func (*Primitive) AddAttribute

func (p *Primitive) AddAttribute(attr Attribute)

func (*Primitive) EncodeToByteArray

func (p *Primitive) EncodeToByteArray() []byte

type PrimitiveBuilder deprecated

type PrimitiveBuilder interface {
	BuildPrimitive() *Primitive
}

Deprecated: no longer needed

type Renderer

type Renderer interface {
	Prepare()
	AddPrimitive() int
	SetPrimitive(id int, primitive IPrimitive, shouldRerender bool)
	RemovePrimitive(id int)
	PerformRendering()
	Clear()
	Stop()
}

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
}

func NewTextPrimitive

func NewTextPrimitive(text string) *TextPrimitive

func (*TextPrimitive) GetTransform

func (p *TextPrimitive) GetTransform() Transform

func (*TextPrimitive) GetType

func (p *TextPrimitive) GetType() byte

type Transform

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

func NewTransform

func NewTransform() Transform

func (Transform) EncodeToByteArray

func (t Transform) EncodeToByteArray() []byte

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