package ops
import "gioui.org/internal/ops"
Index ¶
- Constants
- func AddCall(o *Ops, callOps *Ops, pc PC, end PC)
- func BeginMulti(o *Ops)
- func DecodeCommand(d []byte) scene.Command
- func DecodeLoad(data []byte) int
- func DecodeOpacity(data []byte) float32
- func DecodeSave(data []byte) int
- func DecodeTransform(data []byte) (t f32.Affine2D, push bool)
- func EncodeCommand(out []byte, cmd scene.Command)
- func EndMulti(o *Ops)
- func FillMacro(o *Ops, startPC PC)
- func PopMacro(o *Ops, id StackID)
- func PopOp(o *Ops, kind StackKind, sid StackID, macroID uint32)
- func Reset(o *Ops)
- func Write(o *Ops, n int) []byte
- func Write1(o *Ops, n int, ref1 interface{}) []byte
- func Write1String(o *Ops, n int, ref1 string) []byte
- func Write2(o *Ops, n int, ref1, ref2 interface{}) []byte
- func Write2String(o *Ops, n int, ref1 interface{}, ref2 string) []byte
- func Write3(o *Ops, n int, ref1, ref2, ref3 interface{}) []byte
- func WriteMulti(o *Ops, n int) []byte
- type ClipOp
- type EncodedOp
- type Key
- type OpType
- type Ops
- type PC
- type Reader
- func (r *Reader) Decode() (EncodedOp, bool)
- func (r *Reader) Reset(ops *Ops)
- func (r *Reader) ResetAt(ops *Ops, pc PC)
- type Shape
- type StackID
- type StackKind
- type StateOp
Constants ¶
const ( TypeMacroLen = 1 + 4 + 4 TypeCallLen = 1 + 4 + 4 + 4 + 4 TypeDeferLen = 1 TypeTransformLen = 1 + 1 + 4*6 TypePopTransformLen = 1 TypePushOpacityLen = 1 + 4 TypePopOpacityLen = 1 TypeRedrawLen = 1 + 8 TypeImageLen = 1 + 1 TypePaintLen = 1 TypeColorLen = 1 + 4 TypeLinearGradientLen = 1 + 8*2 + 4*2 TypePassLen = 1 TypePopPassLen = 1 TypeInputLen = 1 TypeKeyInputHintLen = 1 + 1 TypeSaveLen = 1 + 4 TypeLoadLen = 1 + 4 TypeAuxLen = 1 TypeClipLen = 1 + 4*4 + 1 + 1 TypePopClipLen = 1 TypeCursorLen = 2 TypePathLen = 8 + 1 TypeStrokeLen = 1 + 4 TypeSemanticLabelLen = 1 TypeSemanticDescLen = 1 TypeSemanticClassLen = 2 TypeSemanticSelectedLen = 2 TypeSemanticEnabledLen = 2 TypeActionInputLen = 1 + 1 )
Functions ¶
func AddCall ¶
func BeginMulti ¶
func BeginMulti(o *Ops)
func DecodeCommand ¶
func DecodeLoad ¶
DecodeLoad decodes the state id of a load op.
func DecodeOpacity ¶
func DecodeSave ¶
DecodeSave decodes the state id of a save op.
func DecodeTransform ¶
func EncodeCommand ¶
func EndMulti ¶
func EndMulti(o *Ops)
func FillMacro ¶
func PopMacro ¶
func PopOp ¶
func Reset ¶
func Reset(o *Ops)
func Write ¶
func Write1 ¶
func Write1String ¶
func Write2 ¶
func Write2String ¶
func Write3 ¶
func WriteMulti ¶
Types ¶
type ClipOp ¶
ClipOp is the shadow of clip.Op.
func (*ClipOp) Decode ¶
type EncodedOp ¶
EncodedOp represents an encoded op returned by Reader.
type Key ¶
type Key struct {
// contains filtered or unexported fields
}
Key is a unique key for a given op.
type OpType ¶
type OpType byte
const ( TypeMacro OpType = iota + firstOpIndex TypeCall TypeDefer TypeTransform TypePopTransform TypePushOpacity TypePopOpacity TypeImage TypePaint TypeColor TypeLinearGradient TypePass TypePopPass TypeInput TypeKeyInputHint TypeSave TypeLoad TypeAux TypeClip TypePopClip TypeCursor TypePath TypeStroke TypeSemanticLabel TypeSemanticDesc TypeSemanticClass TypeSemanticSelected TypeSemanticEnabled TypeActionInput )
func (OpType) NumRefs ¶
func (OpType) Size ¶
func (OpType) String ¶
type Ops ¶
type Ops struct {
// contains filtered or unexported fields
}
type PC ¶
type PC struct {
// contains filtered or unexported fields
}
PC is an instruction counter for an operation list.
func PCFor ¶
func (PC) Add ¶
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader parses an ops list.
func (*Reader) Decode ¶
func (*Reader) Reset ¶
Reset start reading from the beginning of ops.
func (*Reader) ResetAt ¶
ResetAt is like Reset, except it starts reading from pc.
type Shape ¶
type Shape byte
type StackID ¶
type StackID struct {
// contains filtered or unexported fields
}
func PushMacro ¶
func PushOp ¶
type StackKind ¶
type StackKind uint8
type StateOp ¶
type StateOp struct {
// contains filtered or unexported fields
}
StateOp represents a saved operation snapshot to be restored later.
func Save ¶
Save the effective transformation.
func (StateOp) Load ¶
func (s StateOp) Load()
Load a previously saved operations state given its ID.
Source Files ¶
ops.go reader.go
- Version
- v0.8.0 (latest)
- Published
- Jan 14, 2025
- Platform
- linux/amd64
- Imports
- 6 packages
- Last checked
- 9 hours ago –
Tools for package owners.