Documentation ¶
Index ¶
- func ColorHex(c color.Color) string
- func Encode(fg, bg color.Color, prevfg, prevbg *color.Color) (encoded string)
- func FromFile(filename string) (encoded string, err error)
- func FromImage(img image.Image) (encoded string, err error)
- func FromImageGeneric(img image.Image) (encoded string, err error)
- func FromNRGBA(img *image.NRGBA) (encoded string, err error)
- func FromPaletted(img *image.Paletted) (encoded string, err error)
- func FromReader(reader io.Reader) (encoded string, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Encode ¶
Encode converts a fg & bg colour into a formatted pair of 'pixels', using the prevfg & prevbg colours to perform something akin to run-length encoding
func FromFile ¶
FromFile func is a convenience function that converts a file to a formatted string. See FromImage() for more details.
func FromImage ¶
FromImage is the core function of `pxl`, It takes an image.Image and converts it to a string formatted for tview. The unicode half-block character (▀) with a fg & bg colour set will represent pixels in the returned string. Because each character represents two pixels, it is not possible to convert an
func FromImageGeneric ¶
FromImageGeneric is the fallback function for processing images. It will be used for more exotic image formats than png or gif.
func FromNRGBA ¶
FromNRGBA saves a handful of μs when working with NRGBA images. These are what PNG24 images are decoded as.
func FromPaletted ¶
FromPaletted saves a few μs when working with paletted images. These are what PNG8 images are decoded as.
Types ¶
This section is empty.