gummyimage

package module
v0.0.0-...-35d613c Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2014 License: BSD-3-Clause Imports: 17 Imported by: 0

README

gummyimage

Dummy image clone made in Go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadFont

func LoadFont(path string) (*truetype.Font, error)

Types

type Gummy

type Gummy struct {
	Img   *image.RGBA
	Color *color.Color
	Font  *truetype.Font
}

func NewDefaultGummy

func NewDefaultGummy(w, h int, hexColor string) (*Gummy, error)

Color in HEX format: FAFAFA If hexColor = "" then random color

func NewGummy

func NewGummy(x, y, w, h int, gummyColor color.Color) (*Gummy, error)

func (*Gummy) DrawText

func (g *Gummy) DrawText(text, textColor string, fontSize, xPosition, yPosition int) error

Color in HEX format: FAFAFA

func (*Gummy) DrawTextCenter

func (g *Gummy) DrawTextCenter(text string, textColor string) error

func (*Gummy) DrawTextSize

func (g *Gummy) DrawTextSize(textColor string) error

Color in HEX format: FAFAFA If "" the color of the text is black or white depending on the brightness of the bg

func (*Gummy) Get

func (g *Gummy) Get(format string, r io.Writer) error

Gets the image in the specified format (JPEG, GIF or PNG) in the specified writer

func (*Gummy) GetGif

func (g *Gummy) GetGif() ([]byte, error)

func (*Gummy) GetJpeg

func (g *Gummy) GetJpeg() ([]byte, error)

func (*Gummy) GetPng

func (g *Gummy) GetPng() ([]byte, error)

func (*Gummy) SaveGif

func (g *Gummy) SaveGif(path string) error

func (*Gummy) SaveJpeg

func (g *Gummy) SaveJpeg(path string) error

func (*Gummy) SavePng

func (g *Gummy) SavePng(path string) error

func (*Gummy) SetFont

func (g *Gummy) SetFont(path string) error

Directories

Path Synopsis
app
routes
GENERATED CODE - DO NOT EDIT
GENERATED CODE - DO NOT EDIT

Jump to

Keyboard shortcuts

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