image

package module
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2021 License: BSD-3-Clause Imports: 3 Imported by: 0

README

Golang image processer

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultBackgroundColor = color.White
View Source
var DefaultColor = color.Black
View Source
var DefaultFont = "NotoSerifCJKsc-Regular.otf"
View Source
var DefaultFontSize float64 = 16
View Source
var DefaultLineSpacing float64 = 1

Functions

This section is empty.

Types

type Canvas

type Canvas struct {
	*gg.Context
	// contains filtered or unexported fields
}

func NewCanvas

func NewCanvas(w int, h int, elements ...Element) *Canvas

func (*Canvas) Draw

func (c *Canvas) Draw() (*Canvas, error)

func (*Canvas) SaveJPG

func (c *Canvas) SaveJPG(path string, quality int) error

SaveJPG encodes the image as a JPG and writes it to disk.

func (*Canvas) SavePNG

func (c *Canvas) SavePNG(path string) error

SavePNG encodes the image as a PNG and writes it to disk.

func (*Canvas) SetBackgroundColor

func (c *Canvas) SetBackgroundColor(color color.Color) *Canvas

type Element

type Element interface {
	Draw(ctx *gg.Context) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL