Documentation ¶
Index ¶
- Variables
- func DrawRadialGradient(mainImage *image.RGBA, center Point, from, to color.RGBA)
- func FillColor(img *image.RGBA, colorData color.RGBA)
- func FillGradient(img *image.RGBA, startColor, endColor color.RGBA, ...)
- func HexToRGBA(hexCode string) (c color.RGBA, err error)
- func MergeRGBA(main, overlay color.RGBA) color.RGBA
- func NewImage(width, height int) *image.RGBA
- func OpenImage(imageBytes io.Reader) (decodedImage image.Image, err error)
- func OpenImageByBytes(imageBytes []byte) (decodedImage image.Image, err error)
- func OpenImageByPath(imagePath string) (decodedImage image.Image, err error)
- func OpenImageFromEFS(fileStorage fs.FS, path string) (decodedImage image.Image, err error)
- func Paste(img draw.Image, overlay image.Image, X, Y int)
- func Resize(mainImage image.Image, width, height float64, mode ResizeMode) image.Image
- func Save(mainImage image.Image, path string) error
- func SaveToStream(mainImage image.Image, writer io.Writer) error
- func Write(img draw.Image, text string, textColor color.Color, fontStyle font.Face, ...)
- type Gradient
- type GradientOrientation
- type LlamaFont
- func (f *LlamaFont) FitHeight(maxHeight int) (font.Face, int)
- func (f *LlamaFont) FitTextWidth(text string, fontSize float64, maxWidth int) (font.Face, int)
- func (f *LlamaFont) GetHeight(fontSize float64) int
- func (f *LlamaFont) GetTextSize(fontSize float64, text string) (width, height int)
- func (f *LlamaFont) GetWidth(fontSize float64, text string) int
- func (f *LlamaFont) NewFace(size float64) font.Face
- type Point
- type ResizeMode
- type Vector
- func (v *Vector) Draw(on draw.Image, with image.Image, onX, onY int) *Vector
- func (v *Vector) DrawOp(on draw.Image, with image.Image, onX, onY int) *Vector
- func (v *Vector) DrawOpX(on draw.Image, with image.Image, onX, onY int) *Vector
- func (v *Vector) DrawX(on draw.Image, with image.Image, onX, onY int) *Vector
- func (v *Vector) From(x, y int) *Vector
- func (v *Vector) Height() int
- func (v *Vector) Reset() *Vector
- func (v *Vector) To(x, y int) *Vector
- func (v *Vector) Width() int
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidFormat = errors.New("invalid format")
Functions ¶
func DrawRadialGradient ¶ added in v0.2.0
Draws a Radial Gradient on the image with respect to transparent colors and the center point
func FillGradient ¶ added in v0.1.3
func FillGradient(img *image.RGBA, startColor, endColor color.RGBA, orientation GradientOrientation)
func HexToRGBA ¶
Convers hex color to color.RGBA
valid format: #000000 || #000
returns an error on inavlid fomat
func OpenImageByBytes ¶
func OpenImageFromEFS ¶
Types ¶
type Gradient ¶ added in v0.2.0
type Gradient struct {
R, G, B, A float64
// contains filtered or unexported fields
}
func GetGradientColors ¶ added in v0.2.0
type GradientOrientation ¶
type GradientOrientation uint8
const ( GradientOrientationHorizontal GradientOrientation = iota GradientOrientationVertical )
type LlamaFont ¶ added in v0.1.3
func (*LlamaFont) FitTextWidth ¶ added in v0.1.4
func (*LlamaFont) GetTextSize ¶ added in v0.1.3
type ResizeMode ¶ added in v0.1.5
type ResizeMode uint8
const ( ResizeFit ResizeMode = iota ResizeFill )
Click to show internal directories.
Click to hide internal directories.