Documentation ¶
Index ¶
- Variables
- type Image
- func (this *Image) Composite(compositeImg *Image, x int64, y int64) error
- func (this *Image) CreateWand() error
- func (this *Image) Crop(width int64, height int64, x int64, y int64) error
- func (this *Image) DestoryWand()
- func (this *Image) DigitalWatermark(copyright *Image) error
- func (this *Image) Dissolve(dissolve int) error
- func (this *Image) GetFormat() (string, error)
- func (this *Image) GetHeight() (int64, error)
- func (this *Image) GetWidth() (int64, error)
- func (this *Image) Resize(width int64, height int64) error
- func (this *Image) Rotate(degrees float64) error
- func (this *Image) Scale(columns int64, rows int64) error
- func (this *Image) SetCompressionQuality(quality int) error
- func (this *Image) SetFormat(format string) error
- func (this *Image) Size() (int64, int64, error)
- func (this *Image) Strip() error
- func (this *Image) Write(p []byte) (int, error)
- func (this *Image) WriteImageBlob() error
Constants ¶
This section is empty.
Variables ¶
var (
ErrIllegalFormat = errors.New("illegal format")
)
Functions ¶
This section is empty.
Types ¶
type Image ¶
type Image struct { Format string // png, jpeg, bmp, gif, ... Blob []byte // raw image data cat.Cat //cat instance // contains filtered or unexported fields }
func (*Image) Composite ¶
Composite() composite one image onto another at the specified offset.
compositeImg: The composite image x: The column offset of the composited image. y: The row offset of the composited image.
func (*Image) CreateWand ¶
CreateWand() creates a new wand for this Image by using Blob data
func (*Image) Crop ¶
Crop() extracts a region of this image.
width: the region width height: the region height x: the region x offset y: the region y offset
func (*Image) DestoryWand ¶
func (this *Image) DestoryWand()
DestroyWand() deallocates memory associated with this Image wand.
func (*Image) DigitalWatermark ¶
DigitalWatermark() embed copyright image information into this image. The watermark is imperceptible to human senses
copyright: The copyright image
func (*Image) Dissolve ¶
Dissovle() sets transparency of this image to the specified value dissolve
dissolve: 0~100,0 means totally transparent while 100 means opa
func (*Image) Resize ¶
Resize() resizes the size of this image to the given dimensions.
width: width of the resized image height: height of the resized image
func (*Image) Rotate ¶
Rotate() rotates an image the specified number of degrees.
degrees: degrees of the rotated image
func (*Image) Scale ¶
Scale() scales the size of this image to the given dimensions.
columns: The number of columns in the scaled image. rows: The number of rows in the scaled image
func (*Image) SetCompressionQuality ¶
Sets the image quality factor, which determines compression options when saving the file
quality: The image quality
func (*Image) SetFormat ¶
Sets the file or blob format (e.g. "BMP") to be used when a file or blob is read. Usually this is not necessary because GraphicsMagick is able to auto-detect the format based on the file header (or the file extension), but some formats do not use a unique header or the selection may be ambigious.
Use MagickSetImageFormat() to set the format to be used when a file or blob is to be written.
format: The file or blob format
func (*Image) WriteImageBlob ¶
WriteImageBlob() writes this image wand to Blob