shape

package
v0.0.0-...-097d1aa Latest Latest
Warning

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

Go to latest
Published: May 16, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package shape represents a lottie shape.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ellipse

type Ellipse interface {
	// GetName gets the shape's name.
	GetName() string

	// GetPosition gets the shape's position.
	GetPosition() []float64

	// GetSize gets the shape's size.
	GetSize() []float64

	// Type returns EllipseType.
	Type() Type
}

Ellipse represents a lottie shape/ellipse.

type EllipseT

type EllipseT struct {
	// After Effect's Direction. Direction how the shape is drawn. Used for trim path for example.
	Direction *int `json:"d,omitempty"`

	// After Effect's Match Name. Used for expressions.
	MatchName *string `json:"mn,omitempty"`

	// After Effect's Name. Used for expressions.
	Name *string `json:"nm,omitempty"`

	// Ellipse's position
	Position json.RawMessage `json:"p,omitempty"`

	// Ellipse's size
	Size json.RawMessage `json:"s,omitempty"`

	// Shape content type.
	Ty *string `json:"ty,omitempty"`
}

EllipseT implements the Ellipse interface.

func (*EllipseT) GetDirection

func (e *EllipseT) GetDirection() int

GetDirection returns the Direction field if it's non-nil, zero value otherwise.

func (*EllipseT) GetMatchName

func (e *EllipseT) GetMatchName() string

GetMatchName returns the MatchName field if it's non-nil, zero value otherwise.

func (*EllipseT) GetName

func (e *EllipseT) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*EllipseT) GetPosition

func (e *EllipseT) GetPosition() []float64

GetPosition returns the initial rotation of the transform.

func (*EllipseT) GetSize

func (e *EllipseT) GetSize() []float64

GetSize returns the initial rotation of the transform.

func (*EllipseT) GetTy

func (e *EllipseT) GetTy() string

GetTy returns the Ty field if it's non-nil, zero value otherwise.

func (*EllipseT) Type

func (e *EllipseT) Type() Type

Type returns the layer type.

type Fill

type Fill interface {
	// GetColor returns an RGBA color (0-1).
	GetColor() [4]float64

	// GetName returns the name of the fill.
	GetName() string

	// GetOpacity returns the opacity of the fill.
	GetOpacity() float64

	// Type returns FillType.
	Type() Type
}

Fill represents a lottie shape/fill.

type FillT

type FillT struct {
	// Fill Color
	Color json.RawMessage `json:"c,omitempty"`

	// After Effect's Match Name. Used for expressions.
	MatchName *string `json:"mn,omitempty"`

	// After Effect's Name. Used for expressions.
	Name *string `json:"nm,omitempty"`

	// Fill Opacity
	Opacity json.RawMessage `json:"o,omitempty"`

	// Shape content type.
	Ty *string `json:"ty,omitempty"`
}

FillT implements the Fill interface.

func (*FillT) GetColor

func (f *FillT) GetColor() (color [4]float64)

GetColor returns an RGBA color (0-1).

func (*FillT) GetMatchName

func (f *FillT) GetMatchName() string

GetMatchName returns the MatchName field if it's non-nil, zero value otherwise.

func (*FillT) GetName

func (f *FillT) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*FillT) GetOpacity

func (f *FillT) GetOpacity() float64

GetOpacity returns the initial opacity of the transform.

func (*FillT) GetTy

func (f *FillT) GetTy() string

GetTy returns the Ty field if it's non-nil, zero value otherwise.

func (*FillT) Type

func (f *FillT) Type() Type

Type returns the layer type.

type GFill

type GFill interface {
	Type() Type
}

GFill represents a lottie shape/gFill.

type GFillT

type GFillT struct {
}

GFillT implements the GFill interface.

func (*GFillT) Type

func (s *GFillT) Type() Type

Type returns the layer type.

type GStroke

type GStroke interface {
	Type() Type
}

GStroke represents a lottie shape/gStroke.

type GStrokeT

type GStrokeT struct {
}

GStrokeT implements the GStroke interface.

func (*GStrokeT) Type

func (s *GStrokeT) Type() Type

Type returns the layer type.

type Group

type Group interface {
	// GetShapes returns the shapes in the group.
	GetShapes() []Shape

	// Type returns GroupType.
	Type() Type
}

Group represents a lottie shape/group.

type GroupT

type GroupT struct {
	// Group list of shapes.
	Shapes []json.RawMessage `json:"it,omitempty"`

	// After Effect's Match Name. Used for expressions.
	MatchName *string `json:"mn,omitempty"`

	// After Effect's Name. Used for expressions.
	Name *string `json:"nm,omitempty"`

	// Group number of properties. Used for expressions.
	NumProperties *int `json:"np,omitempty"`

	// Shape content type.
	Ty *string `json:"ty,omitempty"`
}

GroupT implements the Group interface.

func (*GroupT) GetMatchName

func (g *GroupT) GetMatchName() string

GetMatchName returns the MatchName field if it's non-nil, zero value otherwise.

func (*GroupT) GetName

func (g *GroupT) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*GroupT) GetNumProperties

func (g *GroupT) GetNumProperties() int

GetNumProperties returns the NumProperties field if it's non-nil, zero value otherwise.

func (*GroupT) GetShapes

func (s *GroupT) GetShapes() (result []Shape)

GetShapes returns the shapes casted to their appropriate types.

func (*GroupT) GetTy

func (g *GroupT) GetTy() string

GetTy returns the Ty field if it's non-nil, zero value otherwise.

func (*GroupT) Type

func (s *GroupT) Type() Type

Type returns the layer type.

type Merge

type Merge interface {
	Type() Type
}

Merge represents a lottie shape/merge.

type MergeT

type MergeT struct {
}

MergeT implements the Merge interface.

func (*MergeT) Type

func (s *MergeT) Type() Type

Type returns the layer type.

type Rect

type Rect interface {
	Type() Type
}

Rect represents a lottie shape/rect.

type RectT

type RectT struct {
}

RectT implements the Rect interface.

func (*RectT) Type

func (s *RectT) Type() Type

Type returns the layer type.

type Repeater

type Repeater interface {
	Type() Type
}

Repeater represents a lottie shape/repeater.

type RepeaterT

type RepeaterT struct {
}

RepeaterT implements the Repeater interface.

func (*RepeaterT) Type

func (s *RepeaterT) Type() Type

Type returns the layer type.

type Round

type Round interface {
	Type() Type
}

Round represents a lottie shape/round.

type RoundT

type RoundT struct {
}

RoundT implements the Round interface.

func (*RoundT) Type

func (s *RoundT) Type() Type

Type returns the layer type.

type Shape

type Shape interface {
	Type() Type
}

Shape represents a lottie shape/shape.

func New

func New(buf json.RawMessage) Shape

New uses reflection to return a Shape.

type ShapeT

type ShapeT struct {
}

ShapeT implements the Shape interface.

func (*ShapeT) Type

func (s *ShapeT) Type() Type

Type returns the layer type.

type Star

type Star interface {
	Type() Type
}

Star represents a lottie shape/star.

type StarT

type StarT struct {
}

StarT implements the Star interface.

func (*StarT) Type

func (s *StarT) Type() Type

Type returns the layer type.

type Stroke

type Stroke interface {
	Type() Type
}

Stroke represents a lottie shape/stroke.

type StrokeT

type StrokeT struct {
}

StrokeT implements the Stroke interface.

func (*StrokeT) Type

func (s *StrokeT) Type() Type

Type returns the layer type.

type Transform

type Transform interface {
	InitialOpacity() float64

	// InitialRotation returns the initial rotation of the transform.
	InitialRotation() float64

	// InitialPosition returns the initial rotation of the transform.
	InitialPosition() []float64

	// InitialScale returns the initial rotation of the transform.
	InitialScale() []float64

	// Type returns TransformType.
	Type() Type
}

Transform represents a lottie shape/transform.

type TransformT

type TransformT struct {
	// Shape Transform Anchor Point
	AnchorPoint json.RawMessage `json:"a,omitempty"`

	// After Effect's Name. Used for expressions.
	Name *string `json:"nm,omitempty"`

	// Shape Transform Opacity
	Opacity json.RawMessage `json:"o,omitempty"`

	// Shape Transform Position
	Position json.RawMessage `json:"p,omitempty"`

	// Shape Transform Rotation
	Rotation json.RawMessage `json:"r,omitempty"`

	// Shape Transform Scale
	Scale json.RawMessage `json:"s,omitempty"`

	// Shape Transform Skew Axis
	SkewAxis json.RawMessage `json:"sa,omitempty"`

	// Shape Transform Skew
	Skew json.RawMessage `json:"sk,omitempty"`
}

TransformT implements the Transform interface.

func (*TransformT) GetName

func (t *TransformT) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*TransformT) InitialOpacity

func (t *TransformT) InitialOpacity() float64

InitialOpacity returns the initial opacity of the transform.

func (*TransformT) InitialPosition

func (t *TransformT) InitialPosition() []float64

InitialPosition returns the initial rotation of the transform.

func (*TransformT) InitialRotation

func (t *TransformT) InitialRotation() float64

InitialRotation returns the initial rotation of the transform.

func (*TransformT) InitialScale

func (t *TransformT) InitialScale() []float64

InitialScale returns the initial rotation of the transform.

func (*TransformT) Type

func (t *TransformT) Type() Type

Type returns the layer type.

type Trim

type Trim interface {
	Type() Type
}

Trim represents a lottie shape/trim.

type TrimT

type TrimT struct {
}

TrimT implements the Trim interface.

func (*TrimT) Type

func (s *TrimT) Type() Type

Type returns the layer type.

type Type

type Type string

Type represents a shape type.

const (
	// EllipseType represents a lottie shape/ellipse.
	EllipseType Type = "el"
)
const (
	// FillType represents a lottie shape/fill.
	FillType Type = "fl"
)
const (
	// GFillType represents a lottie shape/gFill.
	GFillType Type = "gf"
)
const (
	// GStrokeType represents a lottie shape/gStroke.
	GStrokeType Type = "gs"
)
const (
	// GroupType represents a lottie shape/group.
	GroupType Type = "gr"
)
const (
	// MergeType represents a lottie shape/merge.
	MergeType Type = "mm"
)
const (
	// RectType represents a lottie shape/rect.
	RectType Type = "rc"
)
const (
	// RepeaterType represents a lottie shape/repeater.
	RepeaterType Type = "rp"
)
const (
	// RoundType represents a lottie shape/round.
	RoundType Type = "rd"
)
const (
	// ShapeType represents a lottie shape/shape.
	ShapeType Type = "sh"
)
const (
	// StarType represents a lottie shape/star.
	StarType Type = "sr"
)
const (
	// StrokeType represents a lottie shape/stroke.
	StrokeType Type = "st"
)
const (
	// TransformType represents a lottie transform.
	TransformType Type = "tr"
)
const (
	// TrimType represents a lottie shape/trim.
	TrimType Type = "tm"
)

Jump to

Keyboard shortcuts

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