Documentation ¶
Index ¶
- func AlphaBlend(dst, src int) int
- func ExtraVersion() string
- func FontCacheSetup() bool
- func FontCacheShutdown()
- func Free(m unsafe.Pointer)
- func FreeFontCache()
- func LayerMultiply(dst, src int) int
- func LayerOverlay(dst, src int) int
- func MajorVersion() int
- func MinorVersion() int
- func ReleaseVersion() int
- func TrueColor(r, g, b uint8) int32
- func TrueColorAlpha(r, g, b, a uint8) int32
- func Version() string
- type Font
- type HeifChroma
- type HeifCodec
- type Image
- func Create(width, height int) *Image
- func CreateFromAvif(data []byte) *Image
- func CreateFromBmp(data []byte) *Image
- func CreateFromGd(data []byte) *Image
- func CreateFromGd2(data []byte) *Image
- func CreateFromGd2Part(data []byte, x, y, w, h int) *Image
- func CreateFromGif(data []byte) *Image
- func CreateFromHeif(data []byte) *Image
- func CreateFromJpeg(data []byte) *Image
- func CreateFromJpegEx(data []byte, ignoreWarning bool) *Image
- func CreateFromPng(data []byte) *Image
- func CreateFromTga(data []byte) *Image
- func CreateFromTiff(data []byte) *Image
- func CreateFromWBMP(data []byte) *Image
- func CreateFromWebp(data []byte) *Image
- func CreateTrueColor(width, height int) *Image
- func (img *Image) AABlend()
- func (img *Image) AlphaBlending(alphaBlending bool)
- func (img *Image) Arc(cx, cy, w, h, s, e int, color int32)
- func (img *Image) BoundsSafe(x, y int) int
- func (img *Image) Char(f Font, x, y, c int, color int32)
- func (img *Image) CharUp(f Font, x, y, c int, color int32)
- func (img *Image) Clone() *Image
- func (img *Image) Close()
- func (img *Image) ColorAllocate(r, g, b uint8) int32
- func (img *Image) ColorAllocateAlpha(r, g, b, a uint8) int32
- func (img *Image) ColorClosest(r, g, b uint8) int32
- func (img *Image) ColorClosestAlpha(r, g, b, a uint8) int32
- func (img *Image) ColorClosestHWB(r, g, b uint8) int32
- func (img *Image) ColorDeallocate(color int32)
- func (img *Image) ColorExact(r, g, b uint8) int32
- func (img *Image) ColorExactAlpha(r, g, b, a uint8) int32
- func (img *Image) ColorMatch(dst *Image) bool
- func (img *Image) ColorReplace(src, dst int32) int
- func (img *Image) ColorReplaceArray(src, dst []int32) int
- func (img *Image) ColorReplaceThreshold(src, dst int32, threshold float64) int
- func (img *Image) ColorResolve(r, g, b uint8) int32
- func (img *Image) ColorResolveAlpha(r, g, b, a uint8) int32
- func (img *Image) ColorTransparent(color int32)
- func (img *Image) Copy(dst *Image, dstX, dstY, srcX, srcY, w, h int)
- func (img *Image) CopyMerge(dst *Image, dstX, dstY, srcX, srcY, w, h, pct int)
- func (img *Image) CopyMergeGray(dst *Image, dstX, dstY, srcX, srcY, w, h, pct int)
- func (img *Image) CopyResampled(dst *Image, dstX, dstY, srcX, srcY, dstW, dstH, srcW, srcH int)
- func (img *Image) CopyResized(dst *Image, dstX, dstY, srcX, srcY, dstW, dstH, srcW, srcH int)
- func (img *Image) CopyRotated(dst *Image, dstX, dstY float64, srcX, srcY, srcW, srcH, angle int)
- func (img *Image) CreatePaletteFromTrueColor(ditherFlag bool, colorsWanted int) *Image
- func (img *Image) DashedLine(x1, y1, x2, y2 int, color int32)
- func (img *Image) Ellipse(cx, cy, w, h int, color int32)
- func (img *Image) Fill(x, y int, color int32)
- func (img *Image) FillToBorder(x, y, border int, color int32)
- func (img *Image) FilledArc(cx, cy, w, h, s, e int, color int32, style int)
- func (img *Image) FilledEllipse(cx, cy, w, h int, color int32)
- func (img *Image) FilledPolygon(p *Point, n, c int)
- func (img *Image) FilledRectangle(x1, y1, x2, y2 int, color int32)
- func (img *Image) GetClip() (x1, y1, x2, y2 int)
- func (img *Image) GetColorsTotal() int
- func (img *Image) GetPalettePixel(x, y int) int32
- func (img *Image) GetResolutionX() uint
- func (img *Image) GetResolutionY() uint
- func (img *Image) GetTransparent() uint8
- func (img *Image) GetTrueColorPixel(x, y int) int32
- func (img *Image) Height() int
- func (img *Image) IsInterlaced() bool
- func (img *Image) IsTrueColor() bool
- func (img *Image) Line(x1, y1, x2, y2 int, color int32)
- func (img *Image) OpenPolygon(p *Point, n, c int)
- func (img *Image) PaletteCopy(dst *Image)
- func (img *Image) PaletteToTrueColor() int
- func (img *Image) Polygon(p *Point, n, c int)
- func (img *Image) Rectangle(x1, y1, x2, y2 int, color int32)
- func (img *Image) SaveAlpha(saveAlpha bool)
- func (img *Image) SetClip(x1, y1, x2, y2 int)
- func (img *Image) SetPixel(x, y int, color int32)
- func (img *Image) SetResolution(x, y uint)
- func (img *Image) String(f Font, x, y int, s string, color int32)
- func (img *Image) String16(f Font, x, y int, s string, color int32)
- func (img *Image) StringFT(fg int, fontList string, size, angle float64, x, y int, text string) ([]int, error)
- func (img *Image) StringTTF(fg int, fontList string, size, angle float64, x, y int, text string) ([]int, error)
- func (img *Image) StringUp(f Font, x, y int, s string, color int32)
- func (img *Image) StringUp16(f Font, x, y int, s string, color int32)
- func (img *Image) ToAVIF() []byte
- func (img *Image) ToAVIFEx(quality, speed int) []byte
- func (img *Image) ToBMP(compression int) []byte
- func (img *Image) ToGD() []byte
- func (img *Image) ToGD2(cs, fmt int) []byte
- func (img *Image) ToGIF() []byte
- func (img *Image) ToHEIF() []byte
- func (img *Image) ToHEIFEx(quality int, codec HeifCodec, chroma HeifChroma) []byte
- func (img *Image) ToJPEG(quality int) []byte
- func (img *Image) ToPNG() []byte
- func (img *Image) ToPNGEx(level int) []byte
- func (img *Image) ToTIFF() []byte
- func (img *Image) ToWBMP(fg int) []byte
- func (img *Image) ToWEBP() []byte
- func (img *Image) ToWEBPEx(quantization int) []byte
- func (img *Image) TrueColorToPalette(ditherFlag bool, colorsWanted int) int
- func (img *Image) TrueColorToPaletteSetMethod(method, speed int) int
- func (img *Image) TrueColorToPaletteSetQuality(minQuality, maxQuality int)
- func (img *Image) Width() int
- type Point
- type PointF
- type Rect
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AlphaBlend ¶
func ExtraVersion ¶
func ExtraVersion() string
func FontCacheSetup ¶
func FontCacheSetup() bool
func FontCacheShutdown ¶
func FontCacheShutdown()
func FreeFontCache ¶
func FreeFontCache()
func LayerMultiply ¶
func LayerOverlay ¶
func MajorVersion ¶
func MajorVersion() int
func MinorVersion ¶
func MinorVersion() int
func ReleaseVersion ¶
func ReleaseVersion() int
func TrueColorAlpha ¶
TrueColorAlpha - Compose a true color value from its components.
Parameters:
r - The red channel (0-255) g - The green channel (0-255) b - The blue channel (0-255) a - The alpha channel (0-127, where 127 is fully transparent, and 0 is completely opaque).
Types ¶
type Font ¶
type Font struct {
// contains filtered or unexported fields
}
Font - A font structure, containing the bitmaps of all characters in a font. Used to declare the characteristics of a font. Text-output functions expect these as their second argument, following the <gdImagePtr> argument. <gdFontGetSmall> and <gdFontGetLarge> both return one.
You can provide your own font data by providing such a structure and the associated pixel array. You can determine the width and height of a single character in a font by examining the w and h members of the structure. If you will not be creating your own fonts, you will not need to concern yourself with the rest of the components of this structure.
func (*Font) Data ¶
Data - Font data; array of characters, one row after another. Easily included in code, also easily loaded from data files.
type HeifChroma ¶
type HeifChroma string
HeifChroma - HEIF Chroma Subsampling : Values that select the HEIF chroma subsampling.
type HeifCodec ¶
type HeifCodec int
HeifCodec - HEIF Coding Format : Values that select the HEIF coding format.
const ( HeifCodecUnknown HeifCodec = C.GD_HEIF_CODEC_UNKNOWN HeifCodecHEVC HeifCodec = C.GD_HEIF_CODEC_HEVC HeifCodecAV1 HeifCodec = C.GD_HEIF_CODEC_AV1 )
type Image ¶
type Image struct {
// contains filtered or unexported fields
}
Image - The data structure in which gd stores images. <gdImageCreate>, <gdImageCreateTrueColor> and the various image file-loading functions return a pointer to this type, and the other functions expect to receive a pointer to this type as their first argument.
func CreateFromAvif ¶
CreateFromAvif - Creates an image by decoding a AVIF file from a byte slice.
func CreateFromBmp ¶
CreateFromBmp - Creates an image by decoding a BMP file from a byte slice.
func CreateFromGd ¶
CreateFromGd - Creates an image by decoding a GD file from a byte slice.
func CreateFromGd2 ¶
CreateFromGd2 - Creates an image by decoding a GD2 file from a byte slice.
func CreateFromGd2Part ¶
CreateFromGd2Part - Creates an part image by decoding a GD2 file from a byte slice.
func CreateFromGif ¶
CreateFromGif - Creates an image by decoding a GIF file from a byte slice.
func CreateFromHeif ¶
CreateFromHeif - Creates an image by decoding a HEIF file from a byte slice.
func CreateFromJpeg ¶
CreateFromJpeg - Creates an image by decoding a JPEG file from a byte slice.
func CreateFromJpegEx ¶
CreateFromJpegEx - Creates an extended image by decoding a JPEG file from a byte slice.
func CreateFromPng ¶
func CreateFromTga ¶
CreateFromTga - Creates an image by decoding a TGA file from a byte slice.
func CreateFromTiff ¶
CreateFromTiff - Creates an image by decoding a TIFF file from a byte slice.
func CreateFromWBMP ¶
CreateFromWBMP - Creates an image by decoding a WBMP file from a byte slice.
func CreateFromWebp ¶
CreateFromWebp - Creates an image by decoding a WEBP file from a byte slice.
func CreateTrueColor ¶
CreateTrueColor - Creates a true color image (millions of colors).
func (*Image) AlphaBlending ¶
func (*Image) BoundsSafe ¶
func (*Image) ColorAllocate ¶
func (*Image) ColorAllocateAlpha ¶
func (*Image) ColorClosest ¶
func (*Image) ColorClosestAlpha ¶
func (*Image) ColorClosestHWB ¶
func (*Image) ColorDeallocate ¶
func (*Image) ColorExact ¶
func (*Image) ColorExactAlpha ¶
func (*Image) ColorMatch ¶
func (*Image) ColorReplace ¶
func (*Image) ColorReplaceArray ¶
func (*Image) ColorReplaceThreshold ¶
func (*Image) ColorResolve ¶
func (*Image) ColorResolveAlpha ¶
func (*Image) ColorTransparent ¶
func (*Image) CopyMergeGray ¶
func (*Image) CopyResampled ¶
func (*Image) CopyResized ¶
func (*Image) CopyRotated ¶
func (*Image) CreatePaletteFromTrueColor ¶
func (*Image) DashedLine ¶
func (*Image) FillToBorder ¶
func (*Image) FilledEllipse ¶
func (*Image) FilledPolygon ¶
func (*Image) FilledRectangle ¶
func (*Image) GetColorsTotal ¶
func (*Image) GetPalettePixel ¶
func (*Image) GetResolutionX ¶
func (*Image) GetResolutionY ¶
func (*Image) GetTransparent ¶
func (*Image) GetTrueColorPixel ¶
func (*Image) IsInterlaced ¶
func (*Image) IsTrueColor ¶
func (*Image) OpenPolygon ¶
func (*Image) PaletteCopy ¶
func (*Image) PaletteToTrueColor ¶
func (*Image) SetResolution ¶
func (*Image) ToHEIFEx ¶
func (img *Image) ToHEIFEx(quality int, codec HeifCodec, chroma HeifChroma) []byte
func (*Image) TrueColorToPalette ¶
func (*Image) TrueColorToPaletteSetMethod ¶
func (*Image) TrueColorToPaletteSetQuality ¶
type Point ¶
type Point struct {
// contains filtered or unexported fields
}
Point - Represents a point in the coordinate space of the image; used by <gdImagePolygon>, <gdImageOpenPolygon> and <gdImageFilledPolygon> for polygon drawing.
type PointF ¶
type PointF struct {
// contains filtered or unexported fields
}
PointF - Defines a point in a 2D coordinate system using floating point values.