gm

package
v0.0.0-...-d1245af Latest Latest
Warning

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

Go to latest
Published: May 28, 2018 License: Apache-2.0 Imports: 4 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MagickWand

type MagickWand struct {
	*gmagick.MagickWand
}

Wrapper of gmagick's MagickWand

func NewMagickWand

func NewMagickWand(blob []byte) (*MagickWand, error)

New a MagickWand from the image blob

func (*MagickWand) AutoOrient

func (mw *MagickWand) AutoOrient() error

AutoOrient adjusts the current image based on EXIF orientation so that it is suitable for viewing.

func (*MagickWand) CheckRGBColorspace

func (mw *MagickWand) CheckRGBColorspace() bool

CheckRGBColorspace checks wheather the wand is RGB colorspace

func (*MagickWand) Composite

func (mw *MagickWand) Composite(compositeImage *MagickWand, x, y int) error

Composite composites the compositeImage onto current image at position (x, y)

func (*MagickWand) Crop

func (mw *MagickWand) Crop(width, height uint, x, y int) error

Corp extracts a region of the image

func (*MagickWand) CubicResize

func (mw *MagickWand) CubicResize(cols, rows uint) error

CublicResize resizes image use cubic filter

func (*MagickWand) Format

func (mw *MagickWand) Format() string

Format returns the format of a particular image in a sequence.

func (*MagickWand) Height

func (mw *MagickWand) Height() uint

Height returns the image height

func (*MagickWand) LanczosResize

func (mw *MagickWand) LanczosResize(cols, rows uint) error

LanczosResize resizes image use lanczos filter

func (*MagickWand) PreserveJPEGSamplingFactor

func (mw *MagickWand) PreserveJPEGSamplingFactor() error

PreserveJPEGSamplingFactor will use "sampling-factor" settings as the input file in encoding output file, if both the input and output are JPEG fromat and sampling factor equals to "1x1,1x1,1x1", or default "2x2, 1x1, 1x1" sampling factors will be used.

func (*MagickWand) PreserveJPEGSettings

func (mw *MagickWand) PreserveJPEGSettings() error

PreserveJPEGSettings will use the same "quality" and "sampling-factor" settings as the input file in encoding output file, if both input and output are JPEG format. Manual set quality and sampling-factor will be ignored.

func (*MagickWand) RGBCharPixels

func (mw *MagickWand) RGBCharPixels(xOffset, yOffset int, columns, rows uint) ([]byte, error)

RGBCharPixels extracts char RGB pixel data from the image

func (*MagickWand) Rotate

func (mw *MagickWand) Rotate(degree float64) error

Rotates an image the specified number of degrees

func (*MagickWand) Scale

func (mw *MagickWand) Scale(cols, rows uint) error

Scales the size of an image to the given dimensions.

func (*MagickWand) SetFormat

func (mw *MagickWand) SetFormat(format string) error

SetFormat sets the format of the magick wand.

func (*MagickWand) SetRGBCharPixels

func (mw *MagickWand) SetRGBCharPixels(xOffset, yOffset int, columns, rows uint, pixels []byte) error

Sets pixel data in the image at the location you specify

func (*MagickWand) Sharpen

func (mw *MagickWand) Sharpen(radius, sigma float64) error

Sharpen sharpens the image use Gaussian convolution with the given radius and standard deviation (sigma)

func (*MagickWand) Size

func (mw *MagickWand) Size() (columns, rows uint, err error)

Size returns the size associated with the magick wand.

func (*MagickWand) Strip

func (mw *MagickWand) Strip() error

Strip removes all profiles and text attributes from this image.

func (*MagickWand) Width

func (mw *MagickWand) Width() uint

Width returns the image width

func (*MagickWand) WriteBlob

func (mw *MagickWand) WriteBlob() ([]byte, error)

WriteBlob returns the image as a byte array (a formatted GIF, JPEG, PNG, etc. in memory),

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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