Documentation ¶
Overview ¶
Package render convert the char pixel matrix that converted from the image2ascii to a png image that draw all ascii chars to the image
Index ¶
- Variables
- type DrawOptions
- type Drawer
- type ImageDrawer
- func (drawer *ImageDrawer) BatchConvertThenDraw(frames []image.Image, convertOptions convert.Options, drawOptions DrawOptions, ...) (asciiImages []image.Image, err error)
- func (drawer *ImageDrawer) DrawCharPixelMatrix2Image(charPixelMatrix [][]ascii.CharPixel, options DrawOptions) (img image.Image, err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultDrawOptions = DrawOptions{ TTF: gomono.TTF, FontSize: 20, Colored: true, BackGroundColor: color.RGBA{ R: 0, G: 0, B: 0, A: 255, }, ForeGroundColor: color.RGBA{ R: 255, G: 255, B: 255, A: 255, }, }
DefaultDrawOptions is default draw options
Functions ¶
This section is empty.
Types ¶
type DrawOptions ¶
type DrawOptions struct { TTF []byte // draw font FontSize float64 // font size Colored bool BackGroundColor color.RGBA ForeGroundColor color.RGBA }
DrawOptions control how to draw the pixel to the image
type Drawer ¶
type Drawer interface { DrawCharPixelMatrix2Image(charPixelMatrix [][]ascii.CharPixel, options DrawOptions) (img image.Image, err error) BatchConvertThenDraw(frames []image.Image, convertOptions convert.Options, drawOptions DrawOptions, progress chan<- int) (asciiImages []image.Image, err error) }
Drawer interface define the operation that draw char pixel to image
type ImageDrawer ¶
type ImageDrawer struct { }
ImageDrawer implement the drawer interface
func (*ImageDrawer) BatchConvertThenDraw ¶
func (drawer *ImageDrawer) BatchConvertThenDraw(frames []image.Image, convertOptions convert.Options, drawOptions DrawOptions, progress chan<- int) (asciiImages []image.Image, err error)
BatchConvertThenDraw batch draw the images and output the images
func (*ImageDrawer) DrawCharPixelMatrix2Image ¶
func (drawer *ImageDrawer) DrawCharPixelMatrix2Image(charPixelMatrix [][]ascii.CharPixel, options DrawOptions) (img image.Image, err error)
DrawCharPixelMatrix2Image draw a char pixel matrix to a image
Click to show internal directories.
Click to hide internal directories.