img4g

package
v0.0.0-...-57214d0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2015 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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 NewImage

func NewImage(width, height int, format string, CAT cat.Cat) (*Image, error)

func NewImageAsPNG

func NewImageAsPNG(width, height int, CAT cat.Cat) (*Image, error)

func (*Image) Composite

func (this *Image) Composite(compositeImg *Image, x int64, y int64) error

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

func (this *Image) CreateWand() error

CreateWand() creates a new wand for this Image by using Blob data

func (*Image) Crop

func (this *Image) Crop(width int64, height int64, x int64, y int64) error

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

func (this *Image) DigitalWatermark(copyright *Image) error

DigitalWatermark() embed copyright image information into this image. The watermark is imperceptible to human senses

copyright: The copyright image

func (*Image) Dissolve

func (this *Image) Dissolve(dissolve int) error

Dissovle() sets transparency of this image to the specified value dissolve

dissolve: 0~100,0 means totally transparent while 100 means opa

func (*Image) GetFormat

func (this *Image) GetFormat() (string, error)

GetFormat() return format of this image

func (*Image) GetHeight

func (this *Image) GetHeight() (int64, error)

Returns the image height

func (*Image) GetWidth

func (this *Image) GetWidth() (int64, error)

Returns the image width

func (*Image) Resize

func (this *Image) Resize(width int64, height int64) error

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

func (this *Image) Rotate(degrees float64) error

Rotate() rotates an image the specified number of degrees.

degrees: degrees of the rotated image

func (*Image) Scale

func (this *Image) Scale(columns int64, rows int64) error

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

func (this *Image) SetCompressionQuality(quality int) error

Sets the image quality factor, which determines compression options when saving the file

quality: The image quality

func (*Image) SetFormat

func (this *Image) SetFormat(format string) error

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) Size

func (this *Image) Size() (int64, int64, error)

func (*Image) Strip

func (this *Image) Strip() error

Strip() removes all profiles and text attributes from this image.

func (*Image) Write

func (this *Image) Write(p []byte) (int, error)

func (*Image) WriteImageBlob

func (this *Image) WriteImageBlob() error

WriteImageBlob() writes this image wand to Blob

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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