Versions in this module Expand all Collapse all v0 v0.2.1 Jul 9, 2024 v0.2.0 Jul 9, 2024 Changes in this version + var ErrSaveImageFormatNotSupport = errors.New("save image format not support") + var ErrSourceImageIsNil = errors.New("source image is nil") + var ErrSourceImageNotSupport = errors.New("source image not support") + var ErrSourceNotSupport = errors.New("source not support") + var ErrSourceStringIsEmpty = errors.New("source string is empty") + func Color2Hex(c color.Color) string + func GetImageType(bytes []byte) (ext string, mimetype string, decoder func(r io.Reader) (image.Image, error), ...) + func Image2RGBA(img image.Image) *image.RGBA + func LoadFontFace(path string, points float64) (font.Face, error) + func Radians(degrees float64) float64 + type Align int + const AlignCenter + const AlignLeft + const AlignRight + type Context struct + func NewContext(width, height int) *Context + func NewContextForImage(im image.Image) *Context + func NewContextForRGBA(im *image.RGBA) *Context + func (dc *Context) AsMask() *image.Alpha + func (dc *Context) Clear() + func (dc *Context) ClearPath() + func (dc *Context) Clip() + func (dc *Context) ClipPreserve() + func (dc *Context) ClosePath() + func (dc *Context) CubicTo(x1, y1, x2, y2, x3, y3 float64) + func (dc *Context) DrawArc(x, y, r, angle1, angle2 float64) + func (dc *Context) DrawCircle(x, y, r float64) + func (dc *Context) DrawEllipse(x, y, rx, ry float64) + func (dc *Context) DrawEllipticalArc(x, y, rx, ry, angle1, angle2 float64) + func (dc *Context) DrawImage(im image.Image, x, y int) + func (dc *Context) DrawImageAnchored(im image.Image, x, y int, ax, ay float64) + func (dc *Context) DrawLine(x1, y1, x2, y2 float64) + func (dc *Context) DrawPoint(x, y, r float64) + func (dc *Context) DrawRectangle(x, y, w, h float64) + func (dc *Context) DrawRegularPolygon(n int, x, y, r, rotation float64) + func (dc *Context) DrawRoundedRectangle(x, y, w, h, r float64) + func (dc *Context) DrawString(s string, x, y float64) + func (dc *Context) DrawStringAnchored(s string, x, y, ax, ay float64) + func (dc *Context) DrawStringWrapped(s string, x, y, ax, ay, width, lineSpacing float64, align Align) + func (dc *Context) Fill() + func (dc *Context) FillPreserve() + func (dc *Context) FontHeight() float64 + func (dc *Context) GetCurrentPoint() (Point, bool) + func (dc *Context) Height() int + func (dc *Context) Identity() + func (dc *Context) Image() image.Image + func (dc *Context) InvertMask() + func (dc *Context) InvertY() + func (dc *Context) LineTo(x, y float64) + func (dc *Context) LoadFontFace(path string, points float64) error + func (dc *Context) MeasureMultilineString(s string, lineSpacing float64) (width, height float64) + func (dc *Context) MeasureString(s string) (w, h float64) + func (dc *Context) MoveTo(x, y float64) + func (dc *Context) NewSubPath() + func (dc *Context) Pop() + func (dc *Context) Push() + func (dc *Context) QuadraticTo(x1, y1, x2, y2 float64) + func (dc *Context) ResetClip() + func (dc *Context) Rotate(angle float64) + func (dc *Context) RotateAbout(angle, x, y float64) + func (dc *Context) Scale(x, y float64) + func (dc *Context) ScaleAbout(sx, sy, x, y float64) + func (dc *Context) SetColor(c color.Color) + func (dc *Context) SetDash(dashes ...float64) + func (dc *Context) SetDashOffset(offset float64) + func (dc *Context) SetFillRule(fillRule FillRule) + func (dc *Context) SetFillRuleEvenOdd() + func (dc *Context) SetFillRuleWinding() + func (dc *Context) SetFontFace(fontFace font.Face) + func (dc *Context) SetLineCap(lineCap LineCap) + func (dc *Context) SetLineCapButt() + func (dc *Context) SetLineCapRound() + func (dc *Context) SetLineCapSquare() + func (dc *Context) SetLineJoin(lineJoin LineJoin) + func (dc *Context) SetLineJoinBevel() + func (dc *Context) SetLineJoinRound() + func (dc *Context) SetLineWidth(lineWidth float64) + func (dc *Context) SetMask(mask *image.Alpha) error + func (dc *Context) SetPixel(x, y int) + func (dc *Context) SetRGB(r, g, b float64) + func (dc *Context) SetRGB255(r, g, b int) + func (dc *Context) SetRGBA(r, g, b, a float64) + func (dc *Context) SetRGBA255(r, g, b, a int) + func (dc *Context) SetStrokeStyle(pattern Pattern) + func (dc *Context) Shear(x, y float64) + func (dc *Context) ShearAbout(sx, sy, x, y float64) + func (dc *Context) Stroke() + func (dc *Context) StrokePreserve() + func (dc *Context) TransformPoint(x, y float64) (tx, ty float64) + func (dc *Context) Translate(x, y float64) + func (dc *Context) Width() int + func (dc *Context) WordWrap(s string, w float64) []string + type FillRule int + const FillRuleEvenOdd + const FillRuleWinding + type FlipType int + const Horizontal + const Vertical + type Image struct + Error error + func Canvas(width, height int, fillColor ...color.Color) *Image + func Load(source interface{}) *Image + func LoadFromBase64(base64Str string) (i *Image) + func LoadFromFile(file *os.File) (i *Image) + func LoadFromImage(img image.Image) (i *Image) + func LoadFromImgo(i *Image) *Image + func LoadFromPath(path string) (i *Image) + func LoadFromUrl(url string) (i *Image) + func (i *Image) Blur(ksize int) *Image + func (i *Image) BorderRadius(radius float64) *Image + func (i *Image) Circle(x, y, radius int, c color.Color) *Image + func (i *Image) Crop(x, y, width, height int) *Image + func (i *Image) Ellipse(x, y, width, height int, c color.Color) *Image + func (i *Image) Flip(flipType FlipType) *Image + func (i *Image) GaussianBlur(ksize int, sigma float64) *Image + func (i *Image) Grayscale() *Image + func (i *Image) Insert(source interface{}, x, y int) *Image + func (i *Image) Line(x1, y1, x2, y2 int, c color.Color, width ...int) *Image + func (i *Image) MainColor() (res color.RGBA) + func (i *Image) Mosaic(size, x1, y1, x2, y2 int) *Image + func (i *Image) Pixel(x, y int, c color.Color) *Image + func (i *Image) Pixelate(size int) *Image + func (i *Image) Rectangle(x, y, width, height int, c color.Color) *Image + func (i *Image) Resize(width, height int) *Image + func (i *Image) Rotate(angle int) *Image + func (i *Image) Save(path string, quality ...int) *Image + func (i *Image) Text(label string, x, y int, fontPath string, fontColor color.Color, ...) *Image + func (i *Image) TextWordWrap(label string, x, y float64, fontPath string, fontColor color.Color, ...) *Image + func (i *Image) Thumbnail(width, height int) *Image + func (i Image) Bounds() image.Rectangle + func (i Image) Extension() string + func (i Image) Filesize() int64 + func (i Image) Height() int + func (i Image) HttpHandler(w http.ResponseWriter, r *http.Request) + func (i Image) Mimetype() string + func (i Image) PickColor(x, y int) (res color.RGBA) + func (i Image) String() string + func (i Image) ToBase64() string + func (i Image) ToImage() image.Image + func (i Image) Width() int + type ImageManager struct + type LineCap int + const LineCapButt + const LineCapRound + const LineCapSquare + type LineJoin int + const LineJoinBevel + const LineJoinRound + type Matrix struct + X0 float64 + XX float64 + XY float64 + Y0 float64 + YX float64 + YY float64 + func Identity() Matrix + func Rotate(angle float64) Matrix + func Scale(x, y float64) Matrix + func Shear(x, y float64) Matrix + func Translate(x, y float64) Matrix + func (a Matrix) Multiply(b Matrix) Matrix + func (a Matrix) Rotate(angle float64) Matrix + func (a Matrix) Scale(x, y float64) Matrix + func (a Matrix) Shear(x, y float64) Matrix + func (a Matrix) TransformPoint(x, y float64) (tx, ty float64) + func (a Matrix) TransformVector(x, y float64) (tx, ty float64) + func (a Matrix) Translate(x, y float64) Matrix + type Pattern interface + ColorAt func(x, y int) color.Color + func NewSolidPattern(color color.Color) Pattern + func NewSurfacePattern(im image.Image, op RepeatOp) Pattern + type Point struct + X float64 + Y float64 + func CubicBezier(x0, y0, x1, y1, x2, y2, x3, y3 float64) []Point + func QuadraticBezier(x0, y0, x1, y1, x2, y2 float64) []Point + func (a Point) Distance(b Point) float64 + func (a Point) Fixed() fixed.Point26_6 + func (a Point) Interpolate(b Point, t float64) Point + type Radius struct + func (c *Radius) At(x, y int) color.Color + func (c *Radius) Bounds() image.Rectangle + func (c *Radius) ColorModel() color.Model + type RepeatOp int + const RepeatBoth + const RepeatNone + const RepeatX + const RepeatY