imageview

package
v0.0.0-...-7ff6b7e Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2026 License: CC0-1.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_IMAGE_HEIGHT = 24
	DEFAULT_IMAGE_WIDTH  = 80
)
View Source
const ANSI_BG_RGB_COLOR = "\x1b[48;2;%d;%d;%dm"
View Source
const ANSI_BG_TRANSPARENT_COLOR = "\x1b[0;39;49m"
View Source
const ANSI_FG_RGB_COLOR = "\x1b[38;2;%d;%d;%dm▄"
View Source
const ANSI_FG_TRANSPARENT_COLOR = "\x1b[0m "
View Source
const ANSI_RESET = "\x1b[0m"

Variables

View Source
var InterpolationType = imaging.Lanczos

Functions

This section is empty.

Types

type ImageViewModel

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

A model which handles the displaying/resizing of an image in ASCII characters

func NewImageViewModelFromBytes

func NewImageViewModelFromBytes(imageBytes []byte) (output ImageViewModel)

Returns a new ImageViewModel with the given image bytes

func (ImageViewModel) Init

func (m ImageViewModel) Init() tea.Cmd

func (*ImageViewModel) RerenderImage

func (m *ImageViewModel) RerenderImage(newDimensions tea.WindowSizeMsg) *ImageViewModel

Rerenders the image's bytes in ASCII characters according to the given dimensions and sets the ImageViewModel's stringifiedImage to the result

func (ImageViewModel) Update

func (m ImageViewModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (ImageViewModel) View

func (m ImageViewModel) View() string

Jump to

Keyboard shortcuts

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