Documentation ¶
Overview ¶
Package image provides an image bubble which can render images as strings.
Index ¶
- func ToString(width int, img image.Image) string
- type Model
- func (m *Model) GotoBottom()
- func (m *Model) GotoTop()
- func (m Model) Init() tea.Cmd
- func (m *Model) NewStatusMessageCmd(s string) tea.Cmd
- func (m *Model) SetFileNameCmd(filename string) tea.Cmd
- func (m *Model) SetSizeCmd(w, h int) tea.Cmd
- func (m *Model) SetViewportDisabled(disabled bool)
- func (m Model) Update(msg tea.Msg) (Model, tea.Cmd)
- func (m Model) View() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Model ¶
type Model struct { Viewport viewport.Model ViewportDisabled bool FileName string ImageString string StatusMessage string StatusMessageLifetime time.Duration // contains filtered or unexported fields }
Model represents the properties of a image bubble.
func (*Model) GotoBottom ¶
func (m *Model) GotoBottom()
GotoBottom jumps to the bottom of the viewport.
func (*Model) NewStatusMessageCmd ¶
NewStatusMessage sets a new status message, which will show for a limited amount of time.
func (*Model) SetFileNameCmd ¶
SetFileName sets the image file and converts it to a string.
func (*Model) SetSizeCmd ¶
SetSize sets the size of the bubble.
func (*Model) SetViewportDisabled ¶
SetViewportDisabled toggles the state of the viewport.
Click to show internal directories.
Click to hide internal directories.