kittyimg

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2026 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BaseImageDirectory = filepath.Join(xdg.DataHome, "chatuino")
)
View Source
var ErrUnsupportedAnimatedFormat = errors.New("emote is animated but in non supported format")

Functions

This section is empty.

Types

type DecodedImage

type DecodedImage struct {
	ID     int32               `json:"-"`
	Cols   int                 `json:"cols"`
	Images []DecodedImageFrame `json:"images"`
	// contains filtered or unexported fields
}

func (DecodedImage) DisplayUnicodePlaceholder

func (i DecodedImage) DisplayUnicodePlaceholder() string

func (DecodedImage) MarshalEasyJSON

func (v DecodedImage) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (DecodedImage) PrepareCommand

func (i DecodedImage) PrepareCommand() string

func (*DecodedImage) UnmarshalEasyJSON

func (v *DecodedImage) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

type DecodedImageFrame

type DecodedImageFrame struct {
	Width       int    `json:"width"`
	Height      int    `json:"height"`
	EncodedPath string `json:"encoded_path"`
	DelayInMS   int    `json:"delay_in_ms"`
}

func (DecodedImageFrame) MarshalEasyJSON

func (v DecodedImageFrame) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (*DecodedImageFrame) UnmarshalEasyJSON

func (v *DecodedImageFrame) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

type DisplayManager

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

func NewDisplayManager

func NewDisplayManager(fs afero.Fs, cellWidth, cellHeight float32) *DisplayManager

func (*DisplayManager) CleanupAllImagesCommand

func (d *DisplayManager) CleanupAllImagesCommand() string

func (*DisplayManager) CleanupOldImagesCommand

func (d *DisplayManager) CleanupOldImagesCommand(maxAge time.Duration) string

func (*DisplayManager) Convert

func (d *DisplayManager) Convert(unit DisplayUnit) (KittyDisplayUnit, error)

type DisplayUnit

type DisplayUnit struct {
	ID           string
	Directory    string
	IsAnimated   bool
	RightPadding int                                   // pixels of transparent padding to add on right side
	Load         func() (io.ReadCloser, string, error) `json:"-"`
}

type KittyDisplayUnit

type KittyDisplayUnit struct {
	PrepareCommand  string
	ReplacementText string
}

Jump to

Keyboard shortcuts

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