gd

package module
v0.0.0-...-4cf806c Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2019 License: MIT Imports: 8 Imported by: 0

README

#Go bindings for GD

#go绑定gd库-Go bindings for GD

#安装方法:

  1. 安装 libgd (https://libgd.github.io/)

  2. 获取包文件:"go get gitee.com/shirdonl/goGd"

测试直接运行:go run sample.go (go run sample.jpg)

Documentation

Index

Constants

View Source
const (
	FONTTINY = iota
	FONTSMALL
	FONTMEDIUMBOLD
	FONTLARGE
	FONTGIANT
)

Variables

This section is empty.

Functions

func GetFonts

func GetFonts() (list []string)

func ImageToGifBuffer

func ImageToGifBuffer(p *Image) []byte

func ImageToJpegBuffer

func ImageToJpegBuffer(p *Image, quality int) []byte

func ImageToPngBuffer

func ImageToPngBuffer(p *Image) []byte

func ImageToWebpBuffer

func ImageToWebpBuffer(p *Image, quantization int) []byte

Types

type Color

type Color int

type Font

type Font struct {
	// contains filtered or unexported fields
}

func GetFont

func GetFont(size byte) *Font

type Image

type Image struct {
	// contains filtered or unexported fields
}

func CreateFromGifPtr

func CreateFromGifPtr(imagebuffer []byte) *Image

func CreateFromJpegPtr

func CreateFromJpegPtr(imagebuffer []byte) *Image

func CreateFromPngPtr

func CreateFromPngPtr(imagebuffer []byte) *Image

func CreateFromWebpPtr

func CreateFromWebpPtr(imagebuffer []byte) *Image

func (*Image) AABlend

func (p *Image) AABlend()

func (*Image) AlphaBlending

func (p *Image) AlphaBlending(blendmode bool)

http://php.net/manual/en/function.imagealphablending.php

func (*Image) Arc

func (p *Image) Arc(cx, cy, w, h, s, e int, color Color)

http://php.net/manual/en/function.imagearc.php

func (*Image) Brightness

func (p *Image) Brightness(brightness int)

func (*Image) Char

func (p *Image) Char(font *Font, x, y int, c string, color Color)

http://php.net/manual/en/function.imagechar.php

func (*Image) CharUp

func (p *Image) CharUp(font *Font, x, y int, c string, color Color)

http://php.net/manual/en/function.imagecharup.php

func (*Image) Color

func (p *Image) Color(r, g, b, a int)

func (*Image) ColorExactAlpha

func (p *Image) ColorExactAlpha(r, g, b, a int) Color

http://php.net/manual/en/function.imagecolorexactalpha.php

func (*Image) Contrast

func (p *Image) Contrast(contrast float64)

func (*Image) Convolution

func (p *Image) Convolution(filter [3][3]float32, filter_div, offset float32)

func (*Image) Copy

func (p *Image) Copy(dst *Image, dstX, dstY, srcX, srcY, w, h int)

http://php.net/manual/en/function.imagecopy.php

func (*Image) CopyMerge

func (p *Image) CopyMerge(dst *Image, dstX, dstY, srcX, srcY, w, h, pct int)

http://php.net/manual/en/function.imagecopymerge.php

func (*Image) CopyMergeGray

func (p *Image) CopyMergeGray(dst *Image, dstX, dstY, srcX, srcY, w, h, pct int)

http://php.net/manual/en/function.imagecopymergegray.php

func (*Image) CopyResampled

func (p *Image) CopyResampled(dst *Image, dstX, dstY, srcX, srcY, dstW, dstH, srcW, srcH int)

http://php.net/manual/en/function.imagecopyresampled.php

func (*Image) CopyResized

func (p *Image) CopyResized(dst *Image, dstX, dstY, srcX, srcY, dstW, dstH, srcW, srcH int)

http://php.net/manual/en/function.imagecopyresized.php

func (*Image) CopyRotated

func (p *Image) CopyRotated(dst *Image, dstX, dstY, srcX, srcY, srcWidth, srcHeight, angle int)

func (*Image) DashedLine

func (p *Image) DashedLine(x1, y1, x2, y2 int, color Color)

http://php.net/manual/en/function.imagedashedline.php

func (*Image) EdgeDetectQuick

func (p *Image) EdgeDetectQuick()

func (*Image) Ellipse

func (p *Image) Ellipse(cx, cy, w, h int, color Color)

http://php.net/manual/en/function.imageellipse.php

func (*Image) Emboss

func (p *Image) Emboss()

func (*Image) Fill

func (p *Image) Fill(x, y int, c Color)

http://php.net/manual/en/function.imagefill.php

func (*Image) FillToBorder

func (p *Image) FillToBorder(x, y, border, color Color)

http://php.net/manual/en/function.imagefilltoborder.php

func (*Image) FilledArc

func (p *Image) FilledArc(cx, cy, w, h, s, e, color Color, style Style)

http://php.net/manual/en/function.imagefilledarc.php

func (*Image) FilledEllipse

func (p *Image) FilledEllipse(cx, cy, w, h int, color Color)

http://php.net/manual/en/function.imagefilledellipse.php

func (*Image) FilledPolygon

func (p *Image) FilledPolygon(points []Point, c Color)

http://php.net/manual/en/function.imagefilledpolygon.php

func (*Image) FilledRectangle

func (p *Image) FilledRectangle(x1, y1, x2, y2 int, color Color)

http://php.net/manual/en/function.imagefilledrectangle.php

func (*Image) GaussianBlur

func (p *Image) GaussianBlur()

func (*Image) GetInterlaced

func (p *Image) GetInterlaced() bool

func (*Image) GrayScale

func (p *Image) GrayScale()

func (*Image) Interlace

func (p *Image) Interlace(interlacemode bool)

http://php.net/manual/en/function.imageinterlace.php

func (*Image) Jpeg

func (p *Image) Jpeg(out string, quality int)

http://php.net/manual/en/function.imagejpeg.php

func (*Image) Line

func (p *Image) Line(x1, y1, x2, y2 int, color Color)

http://php.net/manual/en/function.imageline.php

func (*Image) MeanRemoval

func (p *Image) MeanRemoval()

func (*Image) Negate

func (p *Image) Negate()

func (*Image) OpenPolygon

func (p *Image) OpenPolygon(points []Point, c Color)

http://php.net/manual/en/function.imageopenpolygon.php

func (*Image) Polygon

func (p *Image) Polygon(points []Point, c Color)

http://php.net/manual/en/function.imagepolygon.php

func (*Image) Rectangle

func (p *Image) Rectangle(x1, y1, x2, y2 int, color Color)

func (*Image) SaveAlpha

func (p *Image) SaveAlpha(saveflag bool)

http://php.net/manual/en/function.imagesavealpha.php

func (*Image) SetAntiAliased

func (p *Image) SetAntiAliased(c Color)

func (*Image) SetAntiAliasedDontBlend

func (p *Image) SetAntiAliasedDontBlend(c Color, dont_blend bool)

func (*Image) SetPixel

func (p *Image) SetPixel(x, y int, color Color)

http://php.net/manual/en/function.imagesetpixel.php

func (*Image) SetStyle

func (p *Image) SetStyle(style ...Color)

http://php.net/manual/en/function.imagesetstyle.php

func (*Image) SetThickness

func (p *Image) SetThickness(thickness int)

http://php.net/manual/en/function.imagesetthickness.php

func (*Image) Sharpen

func (p *Image) Sharpen(pct int)

func (*Image) Smooth

func (p *Image) Smooth(weight float32)

func (*Image) SmoothFilledArc

func (p *Image) SmoothFilledArc(cx, cy, w, h int, color Color, start, stop float64)

func (*Image) SmoothFilledEllipse

func (p *Image) SmoothFilledEllipse(cx, cy, w, h int, color Color)

func (*Image) SquareToCircle

func (p *Image) SquareToCircle(radius int) *Image

func (*Image) StackBlur

func (img *Image) StackBlur(radius int, keepalpha bool)

func (*Image) String

func (p *Image) String(font *Font, x, y int, s string, color Color)

http://php.net/manual/en/function.imagestring.php

func (*Image) StringFT

func (p *Image) StringFT(fg Color, fontname string, ptsize, angle float64, x, y int, str string) (brect [8]int32)

func (*Image) StringUp

func (p *Image) StringUp(font *Font, x, y int, s string, color Color)

http://php.net/manual/en/function.imagestringup.php

func (*Image) TrueColor

func (p *Image) TrueColor() bool

func (*Image) TrueColorToPalette

func (p *Image) TrueColorToPalette(ditherFlag bool, colorsWanted int)

http://php.net/manual/en/function.imagetruecolortopalette.php

func (*Image) Wbmp

func (p *Image) Wbmp(out string, foreground Color)

http://php.net/manual/en/function.imagewbmp.php

func (*Image) Webp

func (p *Image) Webp(out string, quantization int)

http://php.net/manual/en/function.imagewebp.php

type Point

type Point struct {
	X, Y int
}

type Style

type Style int
const (
	ARCPIE   Style = 0
	ARCCHORD Style = 1 << iota
	ARCNOFILL
	ARCEDGED
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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