imageutil

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func ConvertColor

func ConvertColor(model ColorModel, red, green, blue, alpha int) (int, int, int, int)

func CopyImage

func CopyImage(src image.Image, model ColorModel) image.Image

func Decode

func Decode(r io.Reader, encoding ImageEncoding) (image.Image, error)

func Draw

func Draw(base image.Image, sub image.Image, x, y, width, height int)

func Encode

func Encode(w io.Writer, img image.Image, encoding ImageEncoding) error

func EncodingExtension

func EncodingExtension(encoding ImageEncoding) string

func NewImage

func NewImage(width, height int, model ColorModel) image.Image

func PointToTable

func PointToTable(state *golua.LState, p image.Point) *golua.LTable

func RGBAToTable

func RGBAToTable(state *golua.LState, rgba *color.RGBA) *golua.LTable

func Set

func Set(img image.Image, x, y, red, green, blue, alpha int)

func SubImage

func SubImage(img image.Image, x1, y1, x2, y2 int, copy bool) image.Image

func TableToPoint

func TableToPoint(state *golua.LState, t *golua.LTable) image.Point

func TableToRGBA

func TableToRGBA(state *golua.LState, t *golua.LTable) *color.RGBA

Types

type ColorModel

type ColorModel int
const (
	MODEL_RGBA ColorModel = iota
	MODEL_RGBA64
	MODEL_NRGBA
	MODEL_NRGBA64
	MODEL_ALPHA
	MODEL_ALPHA16
	MODEL_GRAY
	MODEL_GRAY16
	MODEL_CMYK
)

func Limit

func Limit(img image.Image, model ColorModel) (image.Image, ColorModel)

type ImageEncoding

type ImageEncoding int
const (
	ENCODING_PNG ImageEncoding = iota
	ENCODING_JPEG
	ENCODING_GIF
	ENCODING_UNKNOWN
)

func ExtensionEncoding

func ExtensionEncoding(ext string) ImageEncoding

type PNGChunkStripper

type PNGChunkStripper struct {
	Reader io.Reader

	ErrList []error
	// contains filtered or unexported fields
}

func (*PNGChunkStripper) Read

func (r *PNGChunkStripper) Read(p []byte) (int, error)

Jump to

Keyboard shortcuts

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