Documentation
¶
Overview ¶
Package gd provides PHP's image functions over the standard library's image packages and golang.org/x/image.
The surface is the one a ported image class actually calls: decode, create, resample, draw, write. It is not all of ext/gd, and it is not everything ext/gd would let you register: a binding is here because something needs it, and the text family is absent because nothing did.
imagetypes is answered rather than omitted because ported code branches on it, but there is one decoder set behind it and it always reports the same three formats.
A GD image reaches a script as a *Image, the way fopen hands back a stream. A colour reaches it as an int packed the way libgd packs one, 0xAARRGGBB with alpha in the top byte, so a script can hold a colour in a variable and pass it to any drawing call.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
Register installs the image functions and the IMG_* and IMAGETYPE_* constants, rooted at the process working directory the way the filesystem shims are.
func RegisterRoot ¶
RegisterRoot installs the image functions rooted at dir. Reads resolve against it and cannot climb out; writes are additionally held to the runtime's writable_paths, matching stdlib/files.
Types ¶
type Image ¶
type Image struct {
// contains filtered or unexported fields
}
Image is a GD image handle. A script never looks inside it; it holds one and passes it back to the drawing and writing functions.
func (*Image) Bounds ¶
Bounds is the image rectangle. It is exported so a host embedding this package can inspect what a script produced.
func (*Image) Underlying ¶
Underlying returns the drawable the handle wraps.