Documentation ¶
Index ¶
- type Block
- type Image
- func (im *Image) ActualSize() (height, width int)
- func (im *Image) Blank() string
- func (im *Image) BlankReset() string
- func (im *Image) ParseFile(fpath string) error
- func (im *Image) ParseReader(rd io.Reader) error
- func (im *Image) Size() (rows, cols int)
- func (im *Image) String() string
- func (im *Image) WriteTo(wr io.Writer) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Block ¶
type Block struct { Top *ansirgb.Color Bottom *ansirgb.Color // contains filtered or unexported fields }
Block represents two pixels or a character in a string. It contains a Unicode LOWER/UPPER HALF BLOCK, so the top or bottom "pixel" is the foreground color and the other one is the background color. The character used might change if transparency is needed, which is only possible by using the default background color.
func (*Block) String ¶
String returns the string representation of the block. If aimg can't determine whether this is a UTF-8 environment, String will use a '#' instead of the LOWER/UPPER HALF BLOCK. If the block's color is equal to the one before, it'll just return a string containing a single space.
type Image ¶
type Image struct {
// contains filtered or unexported fields
}
Image represents an ANSI color code "image"
func (*Image) ActualSize ¶
ActualSize returns the size of the underlying image.
func (*Image) Blank ¶
Blank returns a string containing as many newlines as needed to display the image.
func (*Image) BlankReset ¶
BlankReset returns a string like Blank() but with an escape code to set the cursor to the first of the previous newlines.
func (*Image) ParseReader ¶
ParseReader reads image data from the reader.