cell

package
v1.0.260758 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package cell defines the shared cell framebuffer types for TTYPE Desk.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attr

type Attr uint16

Attr holds text attributes.

const (
	AttrBold Attr = 1 << iota
	AttrUnderline
	AttrItalic
	AttrBlink
	AttrReverse
	AttrStrike
)

type Cell

type Cell struct {
	Rune rune
	FG   Color
	BG   Color
	Attr Attr
}

Cell is one terminal cell.

func (Cell) Equals

func (c Cell) Equals(o Cell) bool

type Color

type Color struct {
	R, G, B uint8
}

Color is always 24-bit RGB.

func RGB

func RGB(r, g, b uint8) Color

func (Color) Equals

func (c Color) Equals(o Color) bool

type Diff

type Diff struct {
	Rect  Rect
	Cells []Cell // row-major, length W*H
}

Diff is a dirty region of cells.

func FullGridDiff

func FullGridDiff(cols, rows int, cells []Cell) Diff

FullGridDiff builds a Diff covering an entire grid.

type Rect

type Rect struct {
	X, Y, W, H int
}

Rect is an inclusive-start exclusive-end rectangle in cell coordinates.

func (Rect) Contains

func (r Rect) Contains(x, y int) bool

Jump to

Keyboard shortcuts

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