Documentation ¶
Index ¶
- Constants
- Variables
- func ColourspaceIsSupported(v *VipsImage) bool
- func Configure(config Config) error
- func EncodeJpegBytes(i *VipsImage, options *EncodeJpegOptions) ([]byte, error)
- func EncodeJpegFile(i *VipsImage, file *os.File, options *EncodeJpegOptions) error
- func EncodePngBytes(i *VipsImage, options *EncodePngOptions) ([]byte, error)
- func EncodePngFile(i *VipsImage, file *os.File, options *EncodePngOptions) error
- func EncodeWebpBytes(i *VipsImage, options *EncodeWebpOptions) ([]byte, error)
- func EncodeWebpFile(i *VipsImage, file *os.File, options *EncodeWebpOptions) error
- func ErrorBuffer() error
- func Initialize() error
- func InitializeWithConfig(config Config) error
- func Shutdown()
- func ThreadShutdown()
- type AffineOptions
- type BlurOptions
- type CMYKVipsImage
- type ColourspaceOptions
- type Config
- type DecodeGifOptions
- type DecodeJpegOptions
- type DecodeMagickOptions
- type DecodeOptions
- type DecodeWebpOptions
- type EmbedOptions
- type EncodeJpegOptions
- type EncodePngOptions
- type EncodeWebpOptions
- type FlattenOptions
- type GrayVipsImage
- type ICCTransformOptions
- type NRGBAVipsImage
- type PngFilter
- type SharpenOptions
- type SimilarityOptions
- type VipsAccess
- type VipsExtend
- type VipsImage
- func Affine(v *VipsImage, a, b, c, d float64, options *AffineOptions) (*VipsImage, error)
- func Blur(v *VipsImage, sigma float64, options *BlurOptions) (*VipsImage, error)
- func Colourspace(v *VipsImage, space VipsInterpretation, options *ColourspaceOptions) (*VipsImage, error)
- func Crop(v *VipsImage, left, top, width, height int) (*VipsImage, error)
- func DecodeGifBytes(b []byte, options *DecodeGifOptions) (*VipsImage, error)
- func DecodeGifReader(r io.Reader, options *DecodeGifOptions) (*VipsImage, error)
- func DecodeJpegBytes(b []byte, options *DecodeJpegOptions) (*VipsImage, error)
- func DecodeJpegReader(r io.Reader, options *DecodeJpegOptions) (*VipsImage, error)
- func DecodeMagickBytes(b []byte, options *DecodeMagickOptions) (*VipsImage, error)
- func DecodeMagickReader(r io.Reader, options *DecodeMagickOptions) (*VipsImage, error)
- func DecodePngBytes(b []byte, options *DecodeOptions) (*VipsImage, error)
- func DecodePngReader(r io.Reader, options *DecodeOptions) (*VipsImage, error)
- func DecodeWebpBytes(b []byte, options *DecodeWebpOptions) (*VipsImage, error)
- func DecodeWebpReader(r io.Reader, options *DecodeWebpOptions) (*VipsImage, error)
- func Embed(v *VipsImage, x, y, width, height int, options *EmbedOptions) (*VipsImage, error)
- func ExtractArea(v *VipsImage, left, top, width, height int) (*VipsImage, error)
- func Flatten(v *VipsImage, options *FlattenOptions) (*VipsImage, error)
- func ICCTransform(v *VipsImage, outputProfile string, options *ICCTransformOptions) (*VipsImage, error)
- func Reduce(v *VipsImage, xshrink, yshrink float64, kernel VipsKernel) (*VipsImage, error)
- func ReduceH(v *VipsImage, xshrink float64, kernel VipsKernel) (*VipsImage, error)
- func ReduceV(v *VipsImage, yshrink float64, kernel VipsKernel) (*VipsImage, error)
- func Resize(v *VipsImage, scale, vscale float64, kernel VipsKernel) (*VipsImage, error)
- func Sharpen(v *VipsImage, options *SharpenOptions) (*VipsImage, error)
- func Shrink(v *VipsImage, xshrink, yshrink float64) (*VipsImage, error)
- func ShrinkH(v *VipsImage, xshrink float64) (*VipsImage, error)
- func ShrinkV(v *VipsImage, yshrink float64) (*VipsImage, error)
- func Similarity(v *VipsImage, options *SimilarityOptions) (*VipsImage, error)
- type VipsIntent
- type VipsInterpolate
- func NewBicubicVipsInterpolator() *VipsInterpolate
- func NewBilinearVipsInterpolator() *VipsInterpolate
- func NewLBBVipsInterpolator() *VipsInterpolate
- func NewNearestVipsInterpolator() *VipsInterpolate
- func NewNohaloVipsInterpolator() *VipsInterpolate
- func NewVSQBSVipsInterpolator() *VipsInterpolate
- func NewVipsInterpolator(interpolator string) (*VipsInterpolate, error)
- type VipsInterpretation
- type VipsKernel
- type VipsPrecision
- type WebpPreset
Constants ¶
View Source
const ( INT_ZERO = -1 FLOAT_ZERO = -1.0 STRING_ZERO = "GOVIPS_STRING_ZERO" DEFAULT_CONCURRENCY = 0 DEFAULT_CACHE_MAX = 1000 DEFAULT_CACHE_MAX_FILES = 100 DEFAULT_CACHE_MAX_MEMORY = 100 * 1024 * 1024 )
Special constants used to signify a zero value instead of the default value.
View Source
const ( JPEG_QUANTIZATION_TABLE_DEFAULT int = 0 JPEG_QUANTIZATION_TABLE_FLAT JPEG_QUANTIZATION_TABLE_MSSIM JPEG_QUANTIZATION_TABLE_IMAGEMAGICK JPEG_QUANTIZATION_TABLE_PSNR_HVS_M )
View Source
const ( VIPS_INTENT_PERCEPTUAL = iota VIPS_INTENT_RELATIVE VIPS_INTENT_SATURATION VIPS_INTENT_ABSOLUTE VIPS_INTENT_LAST )
Variables ¶
View Source
var ( ErrInitialize = errors.New("Failed to initialize libvips") ErrConfigure = errors.New("Failed to configure libvips") ErrLoad = errors.New("Failed to load image") ErrSave = errors.New("Failed to save image") ErrEmbed = errors.New("Failed to embed image") ErrCrop = errors.New("Failed to crop image") ErrShrink = errors.New("Failed to shrink image") ErrReduce = errors.New("Failed to reduce image") ErrResize = errors.New("Failed to resize image") ErrAffine = errors.New("Failed to affine image") ErrBlur = errors.New("Failed to blur image") ErrSharpen = errors.New("Failed to sharpen image") ErrFlatten = errors.New("Failed to flatten image") ErrColourspace = errors.New("Failed to convert colourspace of image") ErrICCTransform = errors.New("Failed to transform colourspace of image") )
View Source
var ( VIPS_BACKGROUND_BLACK = []float64{0} VIPS_BACKGROUND_WHITE = []float64{255} )
Functions ¶
func ColourspaceIsSupported ¶
func EncodeJpegBytes ¶
func EncodeJpegBytes(i *VipsImage, options *EncodeJpegOptions) ([]byte, error)
func EncodeJpegFile ¶
func EncodeJpegFile(i *VipsImage, file *os.File, options *EncodeJpegOptions) error
func EncodePngBytes ¶
func EncodePngBytes(i *VipsImage, options *EncodePngOptions) ([]byte, error)
func EncodePngFile ¶
func EncodePngFile(i *VipsImage, file *os.File, options *EncodePngOptions) error
func EncodeWebpBytes ¶
func EncodeWebpBytes(i *VipsImage, options *EncodeWebpOptions) ([]byte, error)
func EncodeWebpFile ¶
func EncodeWebpFile(i *VipsImage, file *os.File, options *EncodeWebpOptions) error
func ErrorBuffer ¶
func ErrorBuffer() error
func Initialize ¶
func Initialize() error
func InitializeWithConfig ¶
func ThreadShutdown ¶
func ThreadShutdown()
Types ¶
type AffineOptions ¶
type BlurOptions ¶
type BlurOptions struct { Precision VipsPrecision MinimumAmplitude float64 }
type CMYKVipsImage ¶
type CMYKVipsImage struct { *VipsImage // contains filtered or unexported fields }
func NewCMYKVipsImage ¶
func NewCMYKVipsImage(vi *VipsImage) (*CMYKVipsImage, error)
func (*CMYKVipsImage) ColorModel ¶
func (v *CMYKVipsImage) ColorModel() color.Model
func (*CMYKVipsImage) Free ¶
func (v *CMYKVipsImage) Free()
type ColourspaceOptions ¶
type ColourspaceOptions struct {
SourceSpace VipsInterpretation
}
type DecodeGifOptions ¶
type DecodeGifOptions struct { DecodeOptions Page int }
type DecodeJpegOptions ¶
type DecodeJpegOptions struct { DecodeOptions Shrink int Fail bool Autorotate bool }
type DecodeMagickOptions ¶
type DecodeMagickOptions struct { DecodeOptions AllFrames bool Density string Page int }
type DecodeOptions ¶
type DecodeOptions struct { Access VipsAccess Disc bool }
type DecodeWebpOptions ¶
type DecodeWebpOptions struct { DecodeOptions Shrink int }
type EmbedOptions ¶
type EmbedOptions struct { Extend VipsExtend Background []float64 }
type EncodeJpegOptions ¶
type EncodePngOptions ¶
type EncodeWebpOptions ¶
type FlattenOptions ¶
type GrayVipsImage ¶
type GrayVipsImage struct { *VipsImage // contains filtered or unexported fields }
func NewGrayVipsImage ¶
func NewGrayVipsImage(vi *VipsImage) (*GrayVipsImage, error)
func (*GrayVipsImage) ColorModel ¶
func (v *GrayVipsImage) ColorModel() color.Model
func (*GrayVipsImage) Free ¶
func (v *GrayVipsImage) Free()
type ICCTransformOptions ¶
type ICCTransformOptions struct { InputProfile string Intent VipsIntent Depth int Embedded bool }
type NRGBAVipsImage ¶
type NRGBAVipsImage struct { *VipsImage // contains filtered or unexported fields }
func NewNRGBAVipsImage ¶
func NewNRGBAVipsImage(vi *VipsImage) (*NRGBAVipsImage, error)
func (*NRGBAVipsImage) ColorModel ¶
func (v *NRGBAVipsImage) ColorModel() color.Model
func (*NRGBAVipsImage) Free ¶
func (v *NRGBAVipsImage) Free()
type SharpenOptions ¶
type SimilarityOptions ¶
type VipsAccess ¶
type VipsAccess int
const ( VIPS_ACCESS_RANDOM VipsAccess = iota VIPS_ACCESS_SEQUENTIAL VIPS_ACCESS_SEQUENTIAL_UNBUFFERED VIPS_ACCESS_LAST )
type VipsExtend ¶
type VipsExtend int
const ( VIPS_EXTEND_BLACK VipsExtend = iota VIPS_EXTEND_COPY VIPS_EXTEND_REPEAT VIPS_EXTEND_MIRROR VIPS_EXTEND_WHITE VIPS_EXTEND_BACKGROUND )
type VipsImage ¶
type VipsImage struct {
// contains filtered or unexported fields
}
func Affine ¶
func Affine(v *VipsImage, a, b, c, d float64, options *AffineOptions) (*VipsImage, error)
func Colourspace ¶
func Colourspace(v *VipsImage, space VipsInterpretation, options *ColourspaceOptions) (*VipsImage, error)
func DecodeGifBytes ¶
func DecodeGifBytes(b []byte, options *DecodeGifOptions) (*VipsImage, error)
func DecodeGifReader ¶
func DecodeGifReader(r io.Reader, options *DecodeGifOptions) (*VipsImage, error)
func DecodeJpegBytes ¶
func DecodeJpegBytes(b []byte, options *DecodeJpegOptions) (*VipsImage, error)
func DecodeJpegReader ¶
func DecodeJpegReader(r io.Reader, options *DecodeJpegOptions) (*VipsImage, error)
func DecodeMagickBytes ¶
func DecodeMagickBytes(b []byte, options *DecodeMagickOptions) (*VipsImage, error)
func DecodeMagickReader ¶
func DecodeMagickReader(r io.Reader, options *DecodeMagickOptions) (*VipsImage, error)
func DecodePngBytes ¶
func DecodePngBytes(b []byte, options *DecodeOptions) (*VipsImage, error)
func DecodePngReader ¶
func DecodePngReader(r io.Reader, options *DecodeOptions) (*VipsImage, error)
func DecodeWebpBytes ¶
func DecodeWebpBytes(b []byte, options *DecodeWebpOptions) (*VipsImage, error)
func DecodeWebpReader ¶
func DecodeWebpReader(r io.Reader, options *DecodeWebpOptions) (*VipsImage, error)
func Embed ¶
func Embed(v *VipsImage, x, y, width, height int, options *EmbedOptions) (*VipsImage, error)
func ICCTransform ¶
func ICCTransform(v *VipsImage, outputProfile string, options *ICCTransformOptions) (*VipsImage, error)
func Reduce ¶
func Reduce(v *VipsImage, xshrink, yshrink float64, kernel VipsKernel) (*VipsImage, error)
func Resize ¶
func Resize(v *VipsImage, scale, vscale float64, kernel VipsKernel) (*VipsImage, error)
func Similarity ¶
func Similarity(v *VipsImage, options *SimilarityOptions) (*VipsImage, error)
func (*VipsImage) HasProfile ¶
func (*VipsImage) Interpretation ¶
func (v *VipsImage) Interpretation() VipsInterpretation
func (*VipsImage) RemoveProfile ¶
func (v *VipsImage) RemoveProfile()
type VipsIntent ¶
type VipsIntent int
type VipsInterpolate ¶
type VipsInterpolate struct { Nickname string // contains filtered or unexported fields }
func NewBicubicVipsInterpolator ¶
func NewBicubicVipsInterpolator() *VipsInterpolate
func NewBilinearVipsInterpolator ¶
func NewBilinearVipsInterpolator() *VipsInterpolate
func NewLBBVipsInterpolator ¶
func NewLBBVipsInterpolator() *VipsInterpolate
func NewNearestVipsInterpolator ¶
func NewNearestVipsInterpolator() *VipsInterpolate
func NewNohaloVipsInterpolator ¶
func NewNohaloVipsInterpolator() *VipsInterpolate
func NewVSQBSVipsInterpolator ¶
func NewVSQBSVipsInterpolator() *VipsInterpolate
func NewVipsInterpolator ¶
func NewVipsInterpolator(interpolator string) (*VipsInterpolate, error)
func (*VipsInterpolate) Free ¶
func (i *VipsInterpolate) Free()
type VipsInterpretation ¶
type VipsInterpretation int
const ( VIPS_INTERPRETATION_ERROR VipsInterpretation = C.VIPS_INTERPRETATION_ERROR VIPS_INTERPRETATION_MULTIBAND VipsInterpretation = C.VIPS_INTERPRETATION_MULTIBAND VIPS_INTERPRETATION_B_W VipsInterpretation = C.VIPS_INTERPRETATION_B_W VIPS_INTERPRETATION_HISTOGRAM VipsInterpretation = C.VIPS_INTERPRETATION_HISTOGRAM VIPS_INTERPRETATION_XYZ VipsInterpretation = C.VIPS_INTERPRETATION_XYZ VIPS_INTERPRETATION_LAB VipsInterpretation = C.VIPS_INTERPRETATION_LAB VIPS_INTERPRETATION_CMYK VipsInterpretation = C.VIPS_INTERPRETATION_CMYK VIPS_INTERPRETATION_LABQ VipsInterpretation = C.VIPS_INTERPRETATION_LABQ VIPS_INTERPRETATION_RGB VipsInterpretation = C.VIPS_INTERPRETATION_RGB VIPS_INTERPRETATION_CMC VipsInterpretation = C.VIPS_INTERPRETATION_CMC VIPS_INTERPRETATION_LCH VipsInterpretation = C.VIPS_INTERPRETATION_LCH VIPS_INTERPRETATION_LABS VipsInterpretation = C.VIPS_INTERPRETATION_LABS VIPS_INTERPRETATION_sRGB VipsInterpretation = C.VIPS_INTERPRETATION_sRGB VIPS_INTERPRETATION_YXY VipsInterpretation = C.VIPS_INTERPRETATION_YXY VIPS_INTERPRETATION_FOURIER VipsInterpretation = C.VIPS_INTERPRETATION_FOURIER VIPS_INTERPRETATION_RGB16 VipsInterpretation = C.VIPS_INTERPRETATION_RGB16 VIPS_INTERPRETATION_GREY16 VipsInterpretation = C.VIPS_INTERPRETATION_GREY16 VIPS_INTERPRETATION_MATRIX VipsInterpretation = C.VIPS_INTERPRETATION_MATRIX VIPS_INTERPRETATION_scRGB VipsInterpretation = C.VIPS_INTERPRETATION_scRGB VIPS_INTERPRETATION_HSV VipsInterpretation = C.VIPS_INTERPRETATION_HSV VIPS_INTERPRETATION_LAST VipsInterpretation = C.VIPS_INTERPRETATION_LAST )
type VipsKernel ¶
type VipsKernel int
const ( VIPS_KERNEL_NEAREST VipsKernel = iota VIPS_KERNEL_LINEAR VIPS_KERNEL_CUBIC VIPS_KERNEL_LANCZOS2 VIPS_KERNEL_LANCZOS3 VIPS_KERNEL_LAST )
type VipsPrecision ¶
type VipsPrecision int
const ( VIPS_PRECISION_INTEGER VipsPrecision = iota VIPS_PRECISION_FLOAT VIPS_PRECISION_APPROXIMATE VIPS_PRECISION_LAST )
type WebpPreset ¶
type WebpPreset int
const ( VIPS_WEBP_PRESET_DEFAULT WebpPreset = iota VIPS_WEBP_PRESET_PICTURE VIPS_WEBP_PRESET_PHOTO VIPS_WEBP_PRESET_DRAWING VIPS_WEBP_PRESET_ICON VIPS_WEBP_PRESET_TEXT VIPS_WEBP_PRESET_LAST )
Click to show internal directories.
Click to hide internal directories.