scene

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2023 License: MIT, Unlicense Imports: 6 Imported by: 0

Documentation

Overview

Package scene encodes and decodes graphics commands in the format used by the compute renderer.

Index

Constants

View Source
const (
	FillModeNonzero = 0
	FillModeStroke  = 1
)
View Source
const CommandSize = int(unsafe.Sizeof(Command{}))

Variables

This section is empty.

Functions

func DecodeCubic

func DecodeCubic(cmd Command) (from, ctrl0, ctrl1, to f32.Point)

func DecodeGap

func DecodeGap(cmd Command) (from, to f32.Point)

func DecodeLine

func DecodeLine(cmd Command) (from, to f32.Point)

func DecodeQuad

func DecodeQuad(cmd Command) (from, ctrl, to f32.Point)

Types

type Command

type Command [sceneElemSize / 4]uint32

func BeginClip

func BeginClip(bbox f32.Rectangle) Command

func Cubic

func Cubic(start, ctrl0, ctrl1, end f32.Point) Command

func EndClip

func EndClip(bbox f32.Rectangle) Command

func FillColor

func FillColor(col color.RGBA) Command

func FillImage

func FillImage(index int, offset image.Point) Command

func Gap

func Gap(start, end f32.Point) Command

func Line

func Line(start, end f32.Point) Command

func Quad

func Quad(start, ctrl, end f32.Point) Command

func SetFillMode

func SetFillMode(mode FillMode) Command

func SetLineWidth

func SetLineWidth(width float32) Command

func Transform

func Transform(m f32.Affine2D) Command

func (Command) Op

func (c Command) Op() Op

func (Command) String

func (c Command) String() string

type FillMode

type FillMode uint32

FillModes, from setup.h.

type Op

type Op uint32
const (
	OpNop Op = iota
	OpLine
	OpQuad
	OpCubic
	OpFillColor
	OpLineWidth
	OpTransform
	OpBeginClip
	OpEndClip
	OpFillImage
	OpSetFillMode
	OpGap
)

GPU commands from piet/scene.h in package gioui.org/shaders.

Jump to

Keyboard shortcuts

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