graphics

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2024 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("not found")

Functions

This section is empty.

Types

type AnimationControl

type AnimationControl uint
const (
	NoAnimationAction AnimationControl = iota
	StopAnimation
	RunAnimationButWaitForNewFrames
	RunAnimation
)

type CompositionMode

type CompositionMode int // enum
const (
	AlphaBlend CompositionMode = iota // 0
	Overwrite                         // 1
)

type GRT_C

type GRT_C int // enum
const (
	GRT_cursor_move   GRT_C = iota // 0
	GRT_cursor_static              // 1
)

type GRT_U

type GRT_U int // enum
const (
	GRT_no_unicode_placeholder     GRT_U = iota // 0
	GRT_create_unicode_placeholder              // 1
)

type GRT_a

type GRT_a int // enum

Enums {{{

const (
	GRT_action_transmit             GRT_a = iota // t
	GRT_action_transmit_and_display              // T
	GRT_action_query                             // q
	GRT_action_display                           // p
	GRT_action_delete                            // d
	GRT_action_frame                             // f
	GRT_action_animate                           // a
	GRT_action_compose                           // c
)

type GRT_d

type GRT_d int // enum
const (
	GRT_delete_visible GRT_d = iota // a
	GRT_free_visible                // A

	GRT_delete_by_id // i
	GRT_free_by_id   // I

	GRT_delete_by_number // n
	GRT_free_by_number   // N

	GRT_delete_by_cursor // c
	GRT_free_by_cursor   // C

	GRT_delete_by_frame // f
	GRT_free_by_frame   // F

	GRT_delete_by_cell // p
	GRT_free_by_cell   // P

	GRT_delete_by_cell_zindex // q
	GRT_free_by_cell_zindex   // Q

	GRT_delete_by_range // r
	GRT_free_by_range   // R

	GRT_delete_by_column // x
	GRT_free_by_column   // X

	GRT_delete_by_row // y
	GRT_free_by_row   // Y

	GRT_delete_by_zindex // z
	GRT_free_by_zindex   // Z
)

type GRT_f

type GRT_f int // enum
const (
	GRT_format_rgba GRT_f = iota // 32
	GRT_format_rgb               // 24
	GRT_format_png               // 100
)

type GRT_m

type GRT_m int // enum
const (
	GRT_more_nomore GRT_m = iota // 0
	GRT_more_more                // 1
)

type GRT_o

type GRT_o int // enum
const (
	GRT_compression_none GRT_o = iota //
	GRT_compression_zlib              // z
)

type GRT_q

type GRT_q int // enum
const (
	GRT_quiet_noisy       GRT_q = iota // 0
	GRT_quiet_only_errors              // 1
	GRT_quiet_silent                   // 2
)

type GRT_t

type GRT_t int // enum
const (
	GRT_transmission_direct    GRT_t = iota // d
	GRT_transmission_file                   // f
	GRT_transmission_tempfile               // t
	GRT_transmission_sharedmem              // s
)

type GraphicsCommand

type GraphicsCommand struct {
	C GRT_C

	U GRT_U

	S, O, X, Y uint64

	I uint32

	DisableCompression       bool
	WrapPrefix, WrapSuffix   string
	EncodeSerializedDataFunc func(string) string
	// contains filtered or unexported fields
}

func GraphicsCommandFromAPC

func GraphicsCommandFromAPC(raw []byte) *GraphicsCommand

func GraphicsCommandFromAPCPayload

func GraphicsCommandFromAPCPayload(raw []byte) *GraphicsCommand

func (*GraphicsCommand) Action

func (self *GraphicsCommand) Action() GRT_a

Getters and Setters {{{

func (*GraphicsCommand) AnimationControl

func (self *GraphicsCommand) AnimationControl() AnimationControl

func (*GraphicsCommand) AsAPC

func (self *GraphicsCommand) AsAPC(payload []byte) string

func (*GraphicsCommand) BackgroundColor

func (self *GraphicsCommand) BackgroundColor() uint32

func (*GraphicsCommand) BaseFrame

func (self *GraphicsCommand) BaseFrame() uint64

func (*GraphicsCommand) BlendMode

func (self *GraphicsCommand) BlendMode() CompositionMode

func (*GraphicsCommand) Columns

func (self *GraphicsCommand) Columns() uint64

func (*GraphicsCommand) CompositionMode

func (self *GraphicsCommand) CompositionMode() CompositionMode

func (*GraphicsCommand) Compression

func (self *GraphicsCommand) Compression() GRT_o

func (*GraphicsCommand) CursorMovement

func (self *GraphicsCommand) CursorMovement() GRT_C

func (*GraphicsCommand) DataHeight

func (self *GraphicsCommand) DataHeight() uint64

func (*GraphicsCommand) DataOffset

func (self *GraphicsCommand) DataOffset() uint64

func (*GraphicsCommand) DataSize

func (self *GraphicsCommand) DataSize() uint64

func (*GraphicsCommand) DataWidth

func (self *GraphicsCommand) DataWidth() uint64

func (*GraphicsCommand) Delete

func (self *GraphicsCommand) Delete() GRT_d

func (*GraphicsCommand) Format

func (self *GraphicsCommand) Format() GRT_f

func (*GraphicsCommand) FrameToMakeCurrent

func (self *GraphicsCommand) FrameToMakeCurrent() uint64

func (*GraphicsCommand) Gap

func (self *GraphicsCommand) Gap() int32

func (*GraphicsCommand) Height

func (self *GraphicsCommand) Height() uint64

func (*GraphicsCommand) ImageId

func (self *GraphicsCommand) ImageId() uint32

func (*GraphicsCommand) ImageNumber

func (self *GraphicsCommand) ImageNumber() uint32

func (*GraphicsCommand) LeftEdge

func (self *GraphicsCommand) LeftEdge() uint64

func (*GraphicsCommand) NumberOfLoops

func (self *GraphicsCommand) NumberOfLoops() uint64

func (*GraphicsCommand) OverlaidFrame

func (self *GraphicsCommand) OverlaidFrame() uint64

func (*GraphicsCommand) PlacementId

func (self *GraphicsCommand) PlacementId() uint32

func (*GraphicsCommand) Quiet

func (self *GraphicsCommand) Quiet() GRT_q

func (*GraphicsCommand) ResponseMessage

func (self *GraphicsCommand) ResponseMessage() string

func (*GraphicsCommand) Rows

func (self *GraphicsCommand) Rows() uint64

func (*GraphicsCommand) SetAction

func (self *GraphicsCommand) SetAction(a GRT_a) *GraphicsCommand

func (*GraphicsCommand) SetAnimationControl

func (self *GraphicsCommand) SetAnimationControl(z uint) *GraphicsCommand

func (*GraphicsCommand) SetBackgroundColor

func (self *GraphicsCommand) SetBackgroundColor(y uint32) *GraphicsCommand

func (*GraphicsCommand) SetBaseFrame

func (self *GraphicsCommand) SetBaseFrame(c uint64) *GraphicsCommand

func (*GraphicsCommand) SetBlendMode

func (self *GraphicsCommand) SetBlendMode(x CompositionMode) *GraphicsCommand

func (*GraphicsCommand) SetColumns

func (self *GraphicsCommand) SetColumns(c uint64) *GraphicsCommand

func (*GraphicsCommand) SetCompositionMode

func (self *GraphicsCommand) SetCompositionMode(x CompositionMode) *GraphicsCommand

func (*GraphicsCommand) SetCompression

func (self *GraphicsCommand) SetCompression(o GRT_o) *GraphicsCommand

func (*GraphicsCommand) SetCursorMovement

func (self *GraphicsCommand) SetCursorMovement(c GRT_C) *GraphicsCommand

func (*GraphicsCommand) SetDataHeight

func (self *GraphicsCommand) SetDataHeight(h uint64) *GraphicsCommand

func (*GraphicsCommand) SetDataOffset

func (self *GraphicsCommand) SetDataOffset(o uint64) *GraphicsCommand

func (*GraphicsCommand) SetDataSize

func (self *GraphicsCommand) SetDataSize(s uint64) *GraphicsCommand

func (*GraphicsCommand) SetDataWidth

func (self *GraphicsCommand) SetDataWidth(w uint64) *GraphicsCommand

func (*GraphicsCommand) SetDelete

func (self *GraphicsCommand) SetDelete(d GRT_d) *GraphicsCommand

func (*GraphicsCommand) SetFormat

func (self *GraphicsCommand) SetFormat(f GRT_f) *GraphicsCommand

func (*GraphicsCommand) SetFrameToMakeCurrent

func (self *GraphicsCommand) SetFrameToMakeCurrent(c uint64) *GraphicsCommand

func (*GraphicsCommand) SetGap

func (self *GraphicsCommand) SetGap(z int32) *GraphicsCommand

func (*GraphicsCommand) SetHeight

func (self *GraphicsCommand) SetHeight(h uint64) *GraphicsCommand

func (*GraphicsCommand) SetImageId

func (self *GraphicsCommand) SetImageId(i uint32) *GraphicsCommand

func (*GraphicsCommand) SetImageNumber

func (self *GraphicsCommand) SetImageNumber(n uint32) *GraphicsCommand

func (*GraphicsCommand) SetLeftEdge

func (self *GraphicsCommand) SetLeftEdge(x uint64) *GraphicsCommand

func (*GraphicsCommand) SetNumberOfLoops

func (self *GraphicsCommand) SetNumberOfLoops(n uint64) *GraphicsCommand

func (*GraphicsCommand) SetOverlaidFrame

func (self *GraphicsCommand) SetOverlaidFrame(c uint64) *GraphicsCommand

func (*GraphicsCommand) SetPlacementId

func (self *GraphicsCommand) SetPlacementId(p uint32) *GraphicsCommand

func (*GraphicsCommand) SetQuiet

func (self *GraphicsCommand) SetQuiet(q GRT_q) *GraphicsCommand

func (*GraphicsCommand) SetRows

func (self *GraphicsCommand) SetRows(r uint64) *GraphicsCommand

func (*GraphicsCommand) SetSourceTopEdge

func (self *GraphicsCommand) SetSourceTopEdge(y uint64) *GraphicsCommand

func (*GraphicsCommand) SetString

func (self *GraphicsCommand) SetString(key byte, value string) (err error)

func (*GraphicsCommand) SetTargetFrame

func (self *GraphicsCommand) SetTargetFrame(r uint64) *GraphicsCommand

func (*GraphicsCommand) SetTopEdge

func (self *GraphicsCommand) SetTopEdge(y uint64) *GraphicsCommand

func (*GraphicsCommand) SetTransmission

func (self *GraphicsCommand) SetTransmission(t GRT_t) *GraphicsCommand

func (*GraphicsCommand) SetUnicodePlaceholder

func (self *GraphicsCommand) SetUnicodePlaceholder(U GRT_U) *GraphicsCommand

func (*GraphicsCommand) SetWidth

func (self *GraphicsCommand) SetWidth(w uint64) *GraphicsCommand

func (*GraphicsCommand) SetXOffset

func (self *GraphicsCommand) SetXOffset(x uint64) *GraphicsCommand

func (*GraphicsCommand) SetYOffset

func (self *GraphicsCommand) SetYOffset(y uint64) *GraphicsCommand

func (*GraphicsCommand) SetZIndex

func (self *GraphicsCommand) SetZIndex(z int32) *GraphicsCommand

func (*GraphicsCommand) SourceTopEdge

func (self *GraphicsCommand) SourceTopEdge() uint64

func (GraphicsCommand) String

func (self GraphicsCommand) String() string

func (*GraphicsCommand) TargetFrame

func (self *GraphicsCommand) TargetFrame() uint64

func (*GraphicsCommand) TopEdge

func (self *GraphicsCommand) TopEdge() uint64

func (*GraphicsCommand) Transmission

func (self *GraphicsCommand) Transmission() GRT_t

func (*GraphicsCommand) UnicodePlaceholder

func (self *GraphicsCommand) UnicodePlaceholder() GRT_U

func (*GraphicsCommand) Width

func (self *GraphicsCommand) Width() uint64

func (*GraphicsCommand) WriteWithPayloadTo

func (self *GraphicsCommand) WriteWithPayloadTo(o io.StringWriter, payload []byte) (err error)

func (*GraphicsCommand) WriteWithPayloadToLoop

func (self *GraphicsCommand) WriteWithPayloadToLoop(lp *loop.Loop, payload []byte) (err error)

func (*GraphicsCommand) XOffset

func (self *GraphicsCommand) XOffset() uint64

func (*GraphicsCommand) YOffset

func (self *GraphicsCommand) YOffset() uint64

func (*GraphicsCommand) ZIndex

func (self *GraphicsCommand) ZIndex() int32

type Image

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

func NewImage

func NewImage() *Image

func (*Image) ResizeForPageSize

func (self *Image) ResizeForPageSize(width, height int)

type ImageCollection

type ImageCollection struct {
	Shm_supported, Files_supported atomic.Bool
	// contains filtered or unexported fields
}

func NewImageCollection

func NewImageCollection(paths ...string) *ImageCollection

func (*ImageCollection) AddPaths

func (self *ImageCollection) AddPaths(paths ...string)

func (*ImageCollection) DeleteAllVisiblePlacements

func (self *ImageCollection) DeleteAllVisiblePlacements(lp *loop.Loop)

func (*ImageCollection) Finalize

func (self *ImageCollection) Finalize(lp *loop.Loop)

func (*ImageCollection) GetSizeIfAvailable

func (self *ImageCollection) GetSizeIfAvailable(key string, page_size Size) (Size, error)

func (*ImageCollection) HandleGraphicsCommand

func (self *ImageCollection) HandleGraphicsCommand(gc *GraphicsCommand) bool

Handle graphics response. Returns false if an image needs re-transmission because the terminal replied with ENOENT for a placement

func (*ImageCollection) Initialize

func (self *ImageCollection) Initialize(lp *loop.Loop)

func (*ImageCollection) LoadAll

func (self *ImageCollection) LoadAll()

func (*ImageCollection) PlaceImageSubRect

func (self *ImageCollection) PlaceImageSubRect(lp *loop.Loop, key string, page_size Size, left, top, width, height int)

func (*ImageCollection) ResizeForPageSize

func (self *ImageCollection) ResizeForPageSize(width, height int)

func (*ImageCollection) ResolutionOf

func (self *ImageCollection) ResolutionOf(key string) Size

type Size

type Size struct{ Width, Height int }

Jump to

Keyboard shortcuts

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