Documentation ¶
Index ¶
- Variables
- func DimensionChanger(img draw.Image, w, h int) draw.Image
- func DrawText(img draw.Image, c color.Color, text string)
- func Empty(img draw.Image)
- func Fill(img draw.Image, c color.Color)
- func MaskForCharacter(c byte) image.Image
- func NewPixel() draw.Image
- func PixelPusher() (chan<- draw.Image, <-chan *Click)
- func PixelSizeChanger(img draw.Image, w, h int) draw.Image
- func StretchCopy(dst draw.Image, src image.Image)
- func SubImage(img draw.Image, r image.Rectangle) draw.Image
- type Click
- type HSLA
- type ImageWriter
Constants ¶
This section is empty.
Variables ¶
var ( Red = color.RGBA{255, 0, 0, 255} Yellow = color.RGBA{255, 255, 0, 255} Green = color.RGBA{0, 255, 0, 255} Cyan = color.RGBA{0, 255, 255, 255} Blue = color.RGBA{0, 0, 255, 255} Magenta = color.RGBA{255, 0, 255, 255} White = color.RGBA{255, 255, 255, 255} Black = color.RGBA{0, 0, 0, 255} )
Functions ¶
func DimensionChanger ¶
Like PixelSizeChanger, but instead of the pixel size the new image is given.
func MaskForCharacter ¶
MaskForCharacter returns an 4x6 black-and-white image mask for the given character. Useful for image/draw.DrawMask().
func PixelPusher ¶
PixelPusher returns 2 channels. One, over which a pixel can be pushed onto the wall, and another over which click events can be received.
func PixelSizeChanger ¶
PixelSizeChanger enlarges pixels to the given size, effectively making the image smaller. If either of the pixel dimensions is not a multiple of the respective image dimension, a padding of unusable pixels will remain to the right and bottom.
func StretchCopy ¶
StretchCopy transforms src to fill dst and draws the result over dst.
Types ¶
type Click ¶
type Click struct { PixelId string `json:"key"` Position struct { X int `json:"x"` Y int `json:"y"` } `json:"position"` }
Click represents a click event on a pixel.
type ImageWriter ¶
type ImageWriter interface { draw.Image io.Writer // Resets the `cursor` to the initial position Cls() }
ImageWriter is a writable image. The image behaves like a non-scrolling terminal.
func NewImageWriter ¶
func NewImageWriter(img draw.Image, c color.Color) ImageWriter
NewImageWriter creates a new ImageWriter, which writes on the given image in the given color.