udwImage

package
v0.0.0-...-f254aa5 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2020 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

View Source
const (
	StdLen = 16

	UUIDLen = 20
)

Variables

View Source
var StdChars = []byte("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789")

Functions

func ColorToRGBAHex

func ColorToRGBAHex(c color.Color) string

func ColorToRGBHex

func ColorToRGBHex(c color.Color) string

func GenerateOneColorImage

func GenerateOneColorImage(w int, h int, c color.Color) *image.RGBA

func GetColorBlack

func GetColorBlack() (c color.Color)

func GetColorBlue

func GetColorBlue() (c color.Color)

func GetColorGreen

func GetColorGreen() (c color.Color)

func GetColorRed

func GetColorRed() (c color.Color)

func GetColorWhite

func GetColorWhite() (c color.Color)

func MustColorRGBAHexToObj

func MustColorRGBAHexToObj(hex string) (c color.Color)

func MustDecodeConfigFromFile

func MustDecodeConfigFromFile(path string) (conf image.Config)

func MustDecodeImageFromByte

func MustDecodeImageFromByte(content []byte) image.Image

func MustDecodeImageFromFile

func MustDecodeImageFromFile(path string) (conf image.Image)

func MustPngDecodeConfigFromBytes

func MustPngDecodeConfigFromBytes(content []byte) (conf image.Config)

func MustPngDecodeConfigFromFile

func MustPngDecodeConfigFromFile(path string) (conf image.Config)

func MustPngDecodeFromBuf

func MustPngDecodeFromBuf(content []byte) image.Image

func MustPngEncodeFromGoImageToBytes

func MustPngEncodeFromGoImageToBytes(img image.Image) []byte

func MustPngEncodeFromGoImageToFile

func MustPngEncodeFromGoImageToFile(img image.Image, inPath string)

func New

func New() string

func NewLen

func NewLen(length int) string

func NewLenChars

func NewLenChars(length int, chars []byte) string

func PngDecodeConfigFromFile

func PngDecodeConfigFromFile(path string) (conf image.Config, err error)

Types

type Image

type Image struct {
	*image.NRGBA
	// contains filtered or unexported fields
}

func NewCaptchaImage

func NewCaptchaImage(digits [4]int, width, height int) *Image

func (*Image) WriteTo

func (img *Image) WriteTo(w io.Writer) (int64, error)

type ImageConfig

type ImageConfig struct {
	W      int
	H      int
	ImgExt string
}

func DecodeConfigFromByte

func DecodeConfigFromByte(content []byte) (config ImageConfig, err error)

func MustDecodeConfigFromByte

func MustDecodeConfigFromByte(content []byte) (config ImageConfig)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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