Documentation
¶
Overview ¶
Code generated by vipsgen. DO NOT EDIT.
Package vips provides go bindings for libvips, a fast image processing library.
Index ¶
- Constants
- Variables
- func AssertNoLeaks(t testing.TB)
- func ClearCache()
- func GetGenericGrayGamma22ICCProfilePath() (string, error)
- func GetSGrayV2MicroICCProfilePath() (string, error)
- func GetSRGBIEC6196621ICCProfilePath() (string, error)
- func GetSRGBV2MicroICCProfilePath() (string, error)
- func IsTypeSupported(imageType ImageType) bool
- func LoggingSettings(handler LoggingHandlerFunction, verbosity LogLevel)
- func NewInterpolate(name string) (*C.VipsInterpolate, error)
- func OpenImageRefs() int64
- func Pixelate(imageRef *ImageRef, factor float64) (err error)
- func PrintCache()
- func PrintObjectReport(label string)
- func ReadRuntimeStats(stats *RuntimeStats)
- func ReadVipsMemStats(stats *MemoryStats)
- func Shutdown()
- func ShutdownThread()
- func Startup(config *Config) error
- type AffineOptions
- type Align
- type Angle
- type Angle45
- type ArrayjoinOptions
- type AvifExportParams
- type BandFormat
- type BandfoldOptions
- type BandrankOptions
- type BandunfoldOptions
- type BlackOptions
- type BlendMode
- type BoolParameter
- type CacheOptions
- type CannyOptions
- type CastOptions
- type ClampOptions
- type Coding
- type Color
- type ColorRGBA
- type Combine
- type CombineMode
- type CompassOptions
- type Composite2Options
- type Config
- type ConvOptions
- type ConvaOptions
- type ConvasepOptions
- type ConvsepOptions
- type CopyOptions
- type Direction
- type ExportParams
- type ExtendStrategy
- type ExtractBandOptions
- type EyeOptions
- type FailOn
- type FlattenOptions
- type Float64Parameter
- type ForeignKeep
- type GammaOptions
- type GaussblurOptions
- type GaussmatOptions
- type GaussnoiseOptions
- type GifExportParams
- type GlobalbalanceOptions
- type Gravity
- type GravityOptions
- type GreyOptions
- type HeifExportParams
- type HistEqualOptions
- type HistFindIndexedOptions
- type HistFindNdimOptions
- type HistFindOptions
- type HistLocalOptions
- type HoughCircleOptions
- type HoughLineOptions
- type IccExportOptions
- type IccImportOptions
- type IdentityOptions
- type IfthenelseOptions
- type ImageComposite
- type ImageMetadata
- type ImageRef
- func Black(width, height int) (*ImageRef, error)
- func Grey(width, height int, uchar bool) (*ImageRef, error)
- func Identity(ushort bool) (*ImageRef, error)
- func LoadImageFromBuffer(buf []byte, params *ImportParams) (*ImageRef, error)
- func LoadImageFromFile(file string, params *ImportParams) (*ImageRef, error)
- func LoadThumbnailFromBuffer(buf []byte, width, height int, crop Interesting, size Size, ...) (*ImageRef, error)
- func LoadThumbnailFromFile(file string, width, height int, crop Interesting, size Size, ...) (*ImageRef, error)
- func NewImageFromBuffer(buf []byte) (*ImageRef, error)
- func NewImageFromFile(file string) (*ImageRef, error)
- func NewImageFromGoImage(img image.Image) (*ImageRef, error)
- func NewImageFromReader(r io.Reader) (*ImageRef, error)
- func NewThumbnailFromBuffer(buf []byte, width, height int, crop Interesting) (*ImageRef, error)
- func NewThumbnailFromFile(file string, width, height int, crop Interesting) (*ImageRef, error)
- func NewThumbnailWithSizeFromBuffer(buf []byte, width, height int, crop Interesting, size Size) (*ImageRef, error)
- func NewThumbnailWithSizeFromFile(file string, width, height int, crop Interesting, size Size) (*ImageRef, error)
- func NewTransparentCanvas(width, height int) (*ImageRef, error)
- func Text(params *TextParams) (*ImageRef, error)
- func XYZ(width, height int) (*ImageRef, error)
- func (r *ImageRef) Abs() error
- func (r *ImageRef) Add(addend *ImageRef) error
- func (r *ImageRef) AddAlpha() error
- func (r *ImageRef) ArrayJoin(images []*ImageRef, across int) error
- func (r *ImageRef) AutoRotate() error
- func (r *ImageRef) Average() (float64, error)
- func (r *ImageRef) Background() ([]float64, error)
- func (r *ImageRef) BandFormat() BandFormat
- func (r *ImageRef) BandJoin(images ...*ImageRef) error
- func (r *ImageRef) BandJoinConst(constants []float64) error
- func (r *ImageRef) BandSplit() ([]*ImageRef, error)
- func (r *ImageRef) Bands() int
- func (r *ImageRef) Cast(format BandFormat) error
- func (r *ImageRef) Close()
- func (r *ImageRef) Coding() Coding
- func (r *ImageRef) ColorSpace() Interpretation
- func (r *ImageRef) Composite(overlay *ImageRef, mode BlendMode, x, y int) error
- func (r *ImageRef) CompositeMulti(ins []*ImageComposite) error
- func (r *ImageRef) Copy() (*ImageRef, error)
- func (r *ImageRef) CopyChangingInterpretation(interpretation Interpretation) (*ImageRef, error)
- func (r *ImageRef) CopyChangingResolution(xres, yres float64) (*ImageRef, error)
- func (r *ImageRef) Crop(left int, top int, width int, height int) error
- func (r *ImageRef) Divide(denominator *ImageRef) error
- func (r *ImageRef) DrawRect(ink ColorRGBA, left int, top int, width int, height int, fill bool) error
- func (r *ImageRef) Embed(left, top, width, height int, extend ExtendStrategy) error
- func (r *ImageRef) EmbedBackground(left, top, width, height int, backgroundColor *Color) error
- func (r *ImageRef) EmbedBackgroundRGBA(left, top, width, height int, backgroundColor *ColorRGBA) error
- func (r *ImageRef) Export(params *ExportParams) ([]byte, *ImageMetadata, error)
- func (r *ImageRef) ExportAvif(params *AvifExportParams) ([]byte, *ImageMetadata, error)
- func (r *ImageRef) ExportGIF(params *GifExportParams) ([]byte, *ImageMetadata, error)
- func (r *ImageRef) ExportHeif(params *HeifExportParams) ([]byte, *ImageMetadata, error)
- func (r *ImageRef) ExportJp2k(params *Jp2kExportParams) ([]byte, *ImageMetadata, error)
- func (r *ImageRef) ExportJpeg(params *JpegExportParams) ([]byte, *ImageMetadata, error)
- func (r *ImageRef) ExportJxl(params *JxlExportParams) ([]byte, *ImageMetadata, error)
- func (r *ImageRef) ExportMagick(params *MagickExportParams) ([]byte, *ImageMetadata, error)
- func (r *ImageRef) ExportNative() ([]byte, *ImageMetadata, error)
- func (r *ImageRef) ExportPng(params *PngExportParams) ([]byte, *ImageMetadata, error)
- func (r *ImageRef) ExportTiff(params *TiffExportParams) ([]byte, *ImageMetadata, error)
- func (r *ImageRef) ExportWebp(params *WebpExportParams) ([]byte, *ImageMetadata, error)
- func (r *ImageRef) ExtractArea(left, top, width, height int) error
- func (r *ImageRef) ExtractBand(band int, num int) error
- func (r *ImageRef) ExtractBandToImage(band int, num int) (*ImageRef, error)
- func (r *ImageRef) FindTrim(threshold float64, backgroundColor *Color) (int, int, int, int, error)
- func (r *ImageRef) Flatten(backgroundColor *Color) error
- func (r *ImageRef) Flip(direction Direction) error
- func (r *ImageRef) Format() ImageType
- func (r *ImageRef) Gamma(gamma float64) error
- func (r *ImageRef) GaussianBlur(sigmas ...float64) error
- func (r *ImageRef) GetAsString(name string) string
- func (r *ImageRef) GetBlob(name string) []byte
- func (r *ImageRef) GetDouble(name string) float64
- func (r *ImageRef) GetExif() map[string]string
- func (r *ImageRef) GetFields() []string
- func (r *ImageRef) GetICCProfile() []byte
- func (r *ImageRef) GetInt(name string) int
- func (r *ImageRef) GetOrientation() intdeprecated
- func (r *ImageRef) GetPageHeight() int
- func (r *ImageRef) GetPages() intdeprecated
- func (r *ImageRef) GetPoint(x int, y int) ([]float64, error)
- func (r *ImageRef) GetString(name string) string
- func (r *ImageRef) Gravity(gravity Gravity, width int, height int) error
- func (r *ImageRef) Grid(tileHeight, across, down int) error
- func (r *ImageRef) HasAlpha() bool
- func (r *ImageRef) HasExif() bool
- func (r *ImageRef) HasICCProfile() bool
- func (r *ImageRef) HasIPTC() bool
- func (r *ImageRef) HasProfile() bool
- func (r *ImageRef) Height() int
- func (r *ImageRef) HistogramCumulative() error
- func (r *ImageRef) HistogramEntropy() (float64, error)
- func (r *ImageRef) HistogramFind() error
- func (r *ImageRef) HistogramNormalise() error
- func (r *ImageRef) ImageFields() []string
- func (r *ImageRef) Insert(sub *ImageRef, x, y int, expand bool, background *ColorRGBA) error
- func (r *ImageRef) Interpretation() Interpretation
- func (r *ImageRef) Invert() error
- func (r *ImageRef) IsColorSpaceSupported() bool
- func (r *ImageRef) Join(in *ImageRef, dir Direction) error
- func (r *ImageRef) Label(labelParams *LabelParams) error
- func (r *ImageRef) Linear(a, b []float64) error
- func (r *ImageRef) Linear1(a, b float64) error
- func (r *ImageRef) Loop() int
- func (r *ImageRef) Mapim(index *ImageRef) error
- func (r *ImageRef) Maplut(lut *ImageRef) error
- func (r *ImageRef) Metadata() *ImageMetadata
- func (r *ImageRef) Min() (float64, int, int, error)
- func (r *ImageRef) Modulate(brightness, saturation, hue float64) error
- func (r *ImageRef) ModulateHSV(brightness, saturation float64, hue int) error
- func (r *ImageRef) Multiply(multiplier *ImageRef) error
- func (r *ImageRef) OffsetX() int
- func (r *ImageRef) OffsetY() int
- func (r *ImageRef) OptimizeICCProfile() error
- func (r *ImageRef) Orientation() int
- func (r *ImageRef) OriginalFormat() ImageType
- func (r *ImageRef) PageDelay() ([]int, error)
- func (r *ImageRef) PageHeight() int
- func (r *ImageRef) Pages() int
- func (r *ImageRef) PremultiplyAlpha() error
- func (r *ImageRef) Project() (*ImageRef, *ImageRef, error)
- func (r *ImageRef) Rank(width int, height int, index int) error
- func (r *ImageRef) Recomb(matrix [][]float64) error
- func (r *ImageRef) RemoveICCProfile() error
- func (r *ImageRef) RemoveMetadata(keep ...string) error
- func (r *ImageRef) RemoveOrientation() error
- func (r *ImageRef) Replicate(across int, down int) error
- func (r *ImageRef) ResX() float64
- func (r *ImageRef) ResY() float64
- func (r *ImageRef) Resize(scale float64, kernel Kernel) error
- func (r *ImageRef) ResizeWithVScale(hScale, vScale float64, kernel Kernel) error
- func (r *ImageRef) Rotate(angle Angle) error
- func (r *ImageRef) SetBlob(name string, data []byte)
- func (r *ImageRef) SetDouble(name string, f float64)
- func (r *ImageRef) SetInt(name string, i int)
- func (r *ImageRef) SetLoop(loop int) error
- func (r *ImageRef) SetOrientation(orientation int) error
- func (r *ImageRef) SetPageDelay(delay []int) error
- func (r *ImageRef) SetPageHeight(height int) error
- func (r *ImageRef) SetPages(pages int) error
- func (r *ImageRef) SetString(name string, str string)
- func (r *ImageRef) Sharpen(sigma float64, x1 float64, m2 float64) error
- func (r *ImageRef) Similarity(scale float64, angle float64, backgroundColor *ColorRGBA, idx float64, ...) error
- func (r *ImageRef) SmartCrop(width int, height int, interesting Interesting) error
- func (r *ImageRef) Sobel() error
- func (r *ImageRef) Stats() error
- func (r *ImageRef) Subtract(in2 *ImageRef) error
- func (r *ImageRef) Thumbnail(width, height int, crop Interesting) error
- func (r *ImageRef) ThumbnailWithSize(width, height int, crop Interesting, size Size) error
- func (r *ImageRef) ToBytes() ([]byte, error)
- func (r *ImageRef) ToColorSpace(interpretation Interpretation) error
- func (r *ImageRef) ToGoImage() (image.Image, error)
- func (r *ImageRef) ToImage(params *ExportParams) (image.Image, error)
- func (r *ImageRef) TransformICCProfile(outputProfilePath string) error
- func (r *ImageRef) TransformICCProfileWithFallback(targetProfilePath, fallbackProfilePath string) error
- func (r *ImageRef) UnpremultiplyAlpha() error
- func (r *ImageRef) Width() int
- func (r *ImageRef) Zoom(xFactor int, yFactor int) error
- type ImageType
- type ImportParams
- type InsertOptions
- type IntParameter
- type Intent
- type Interesting
- type Interpretation
- type InvertlutOptions
- type InvfftOptions
- type JoinOptions
- type Jp2kExportParams
- type JpegExportParams
- type JxlExportParams
- type Kernel
- type Lab2XYZOptions
- type LabelParams
- type LinearOptions
- type LinecacheOptions
- type LogLevel
- type LoggingHandlerFunction
- type LogmatOptions
- type MagickExportParams
- type MapimOptions
- type MaplutOptions
- type MaskButterworthBandOptions
- type MaskButterworthOptions
- type MaskButterworthRingOptions
- type MaskFractalOptions
- type MaskGaussianBandOptions
- type MaskGaussianOptions
- type MaskGaussianRingOptions
- type MaskIdealBandOptions
- type MaskIdealOptions
- type MaskIdealRingOptions
- type MatchOptions
- type MemoryStats
- type MergeOptions
- type Mosaic1Options
- type MosaicOptions
- type MsbOptions
- type OperationBoolean
- type OperationComplex
- type OperationComplex2
- type OperationComplexget
- type OperationMath
- type OperationMath2
- type OperationMorphology
- type OperationRelational
- type OperationRound
- type Parameter
- type PerlinOptions
- type PngExportParams
- type PngFilter
- type PreMultiplicationState
- type Precision
- type PremultiplyOptions
- type QuadraticOptions
- type ReduceOptions
- type ReducehOptions
- type ReducevOptions
- type Rot45Options
- type RotateOptions
- type RuntimeStats
- type ScRGB2BWOptions
- type ScRGB2sRGBOptions
- type Scalar
- type ScaleOptions
- type SequentialOptions
- type SharpenOptions
- type ShrinkOptions
- type ShrinkhOptions
- type ShrinkvOptions
- type SimilarityOptions
- type SinesOptions
- type Size
- type SmartcropOptions
- type StdifOptions
- type SubsampleMode
- type SubsampleOptions
- type TextParams
- type TextWrap
- type TiffCompression
- type TiffExportParams
- type TiffPredictor
- type TilecacheOptions
- type TonelutOptions
- type Transpose3dOptions
- type UnpremultiplyOptions
- type WebpExportParams
- type WorleyOptions
- type WrapOptions
- type XYZ2LabOptions
- type XyzOptions
- type ZoneOptions
Constants ¶
const ( AccessRandom int = C.VIPS_ACCESS_RANDOM AccessSequential int = C.VIPS_ACCESS_SEQUENTIAL AccessSequentialUnbuffered int = C.VIPS_ACCESS_SEQUENTIAL_UNBUFFERED AccessLast int = C.VIPS_ACCESS_LAST )
Access represents how libvips opens files. See https://www.libvips.org/API/current/How-it-opens-files.html
const DefaultFont = "sans 10"
DefaultFont is the default font to be used for label texts created by govips
const GaussBlurDefaultMinAMpl = 0.2
Variables ¶
var ( // Version is the full libvips version string (x.y.z) Version = C.GoString(C.vips_version_string()) // MajorVersion is the libvips major component of the version string (x in x.y.z) MajorVersion = int(C.vips_version(0)) // MinorVersion is the libvips minor component of the version string (y in x.y.z) MinorVersion = int(C.vips_version(1)) // MicroVersion is the libvips micro component of the version string (z in x.y.z) // Also known as patch version MicroVersion = int(C.vips_version(2)) )
var ( SRGBV2MicroICCProfilePath = sRGBV2MicroICCProfilePathToken SGrayV2MicroICCProfilePath = sGrayV2MicroICCProfilePathToken SRGBIEC6196621ICCProfilePath = sRGBIEC6196621ICCProfilePathToken GenericGrayGamma22ICCProfilePath = genericGrayGamma22ICCProfilePathToken )
var ( // ErrUnsupportedImageFormat when image type is unsupported ErrUnsupportedImageFormat = errors.New("unsupported image format") )
var ImageTypes = map[ImageType]string{ ImageTypeGIF: "gif", ImageTypeJPEG: "jpeg", ImageTypeMagick: "magick", ImageTypePDF: "pdf", ImageTypePNG: "png", ImageTypeSVG: "svg", ImageTypeTIFF: "tiff", ImageTypeWEBP: "webp", ImageTypeHEIF: "heif", ImageTypeBMP: "bmp", ImageTypeAVIF: "heif", ImageTypeJP2K: "jp2k", ImageTypeJXL: "jxl", ImageTypePSD: "psd", }
ImageTypes defines the various image types supported by govips
Functions ¶
func AssertNoLeaks ¶ added in v2.18.0
AssertNoLeaks fails the test if any ImageRef instances remain open. Call this at the end of tests to catch leaked images.
func ClearCache ¶
func ClearCache()
ClearCache drops the whole operation cache, handy for leak tracking.
func GetGenericGrayGamma22ICCProfilePath ¶ added in v2.16.0
func GetSGrayV2MicroICCProfilePath ¶ added in v2.16.0
func GetSRGBIEC6196621ICCProfilePath ¶ added in v2.16.0
func GetSRGBV2MicroICCProfilePath ¶ added in v2.16.0
func IsTypeSupported ¶
IsTypeSupported checks whether given image type is supported by govips
func LoggingSettings ¶ added in v2.1.0
func LoggingSettings(handler LoggingHandlerFunction, verbosity LogLevel)
LoggingSettings sets the logging handler and logging verbosity for govips. The handler function is the function which will be called for each log message. You can define one yourself to log somewhere else besides the default (stderr). Use nil as handler to use standard logging handler. Verbosity is the minimum logLevel you want to log. Default is logLevelInfo due to backwards compatibility but it's quite verbose for a library. Suggest setting it to at least logLevelWarning. Use logLevelDebug for debugging.
func NewInterpolate ¶ added in v2.17.0
func NewInterpolate(name string) (*C.VipsInterpolate, error)
NewInterpolate creates a VipsInterpolate from a name string. Common names: "nearest", "bilinear", "bicubic", "nohalo", "vsqbs", "lbb". The caller should call g_object_unref on the result when done, or pass it to a generated operation (which does not take ownership).
func OpenImageRefs ¶ added in v2.18.0
func OpenImageRefs() int64
OpenImageRefs returns the number of ImageRef instances that haven't been closed.
func PrintCache ¶
func PrintCache()
PrintCache prints the whole operation cache to stdout for debugging purposes.
func PrintObjectReport ¶
func PrintObjectReport(label string)
PrintObjectReport outputs all of the current internal objects in libvips
func ReadRuntimeStats ¶
func ReadRuntimeStats(stats *RuntimeStats)
ReadRuntimeStats returns operation counts for govips
func ReadVipsMemStats ¶
func ReadVipsMemStats(stats *MemoryStats)
ReadVipsMemStats returns various memory statistics such as allocated memory and open files.
func ShutdownThread ¶
func ShutdownThread()
ShutdownThread clears the cache for for the given thread. This needs to be called when a thread using vips exits.
Types ¶
type AffineOptions ¶ added in v2.17.0
type AffineOptions struct {
Interpolate *C.VipsInterpolate
Oarea []int
Odx *float64
Ody *float64
Idx *float64
Idy *float64
Background []float64
Premultiplied *bool
Extend *ExtendStrategy
}
AffineOptions are optional parameters for affine.
type Align ¶
type Align int
Align represents VIPS_ALIGN
const ( AlignLow Align = C.VIPS_ALIGN_LOW AlignCenter Align = C.VIPS_ALIGN_CENTRE AlignHigh Align = C.VIPS_ALIGN_HIGH )
Direction enum
type Angle ¶
type Angle int
Angle represents VIPS_ANGLE type
const ( Angle0 Angle = C.VIPS_ANGLE_D0 Angle90 Angle = C.VIPS_ANGLE_D90 Angle180 Angle = C.VIPS_ANGLE_D180 Angle270 Angle = C.VIPS_ANGLE_D270 )
Angle enum
func GetRotationAngleFromExif ¶
GetRotationAngleFromExif returns the angle which the image is currently rotated in. First returned value is the angle and second is a boolean indicating whether image is flipped. This is based on the EXIF orientation tag standard. If no proper orientation number is provided, the picture will be assumed to be upright.
type Angle45 ¶
type Angle45 int
Angle45 represents VIPS_ANGLE45 type
const ( Angle45_0 Angle45 = C.VIPS_ANGLE45_D0 Angle45_45 Angle45 = C.VIPS_ANGLE45_D45 Angle45_90 Angle45 = C.VIPS_ANGLE45_D90 Angle45_135 Angle45 = C.VIPS_ANGLE45_D135 Angle45_180 Angle45 = C.VIPS_ANGLE45_D180 Angle45_225 Angle45 = C.VIPS_ANGLE45_D225 Angle45_270 Angle45 = C.VIPS_ANGLE45_D270 Angle45_315 Angle45 = C.VIPS_ANGLE45_D315 )
Angle45 enum
type ArrayjoinOptions ¶ added in v2.17.0
type ArrayjoinOptions struct {
Across *int
Shim *int
Background []float64
Halign *Align
Valign *Align
Hspacing *int
Vspacing *int
}
ArrayjoinOptions are optional parameters for arrayjoin.
type AvifExportParams ¶ added in v2.7.0
type AvifExportParams struct {
StripMetadata bool
Quality int
Bitdepth int
Effort int
Lossless bool
// DEPRECATED - Use Effort instead.
Speed int
}
AvifExportParams are options when exporting an AVIF to file or buffer.
func NewAvifExportParams ¶ added in v2.7.0
func NewAvifExportParams() *AvifExportParams
NewAvifExportParams creates default values for an export of an AVIF image.
type BandFormat ¶
type BandFormat int
BandFormat represents VIPS_FORMAT type
const ( BandFormatNotSet BandFormat = C.VIPS_FORMAT_NOTSET BandFormatUchar BandFormat = C.VIPS_FORMAT_UCHAR BandFormatChar BandFormat = C.VIPS_FORMAT_CHAR BandFormatUshort BandFormat = C.VIPS_FORMAT_USHORT BandFormatShort BandFormat = C.VIPS_FORMAT_SHORT BandFormatUint BandFormat = C.VIPS_FORMAT_UINT BandFormatInt BandFormat = C.VIPS_FORMAT_INT BandFormatFloat BandFormat = C.VIPS_FORMAT_FLOAT BandFormatComplex BandFormat = C.VIPS_FORMAT_COMPLEX BandFormatDouble BandFormat = C.VIPS_FORMAT_DOUBLE BandFormatDpComplex BandFormat = C.VIPS_FORMAT_DPCOMPLEX )
BandFormat enum
type BandfoldOptions ¶ added in v2.17.0
type BandfoldOptions struct {
Factor *int
}
BandfoldOptions are optional parameters for bandfold.
type BandrankOptions ¶ added in v2.17.0
type BandrankOptions struct {
Index *int
}
BandrankOptions are optional parameters for bandrank.
type BandunfoldOptions ¶ added in v2.17.0
type BandunfoldOptions struct {
Factor *int
}
BandunfoldOptions are optional parameters for bandunfold.
type BlackOptions ¶ added in v2.17.0
type BlackOptions struct {
Bands *int
}
BlackOptions are optional parameters for black.
type BlendMode ¶
type BlendMode int
BlendMode gives the various Porter-Duff and PDF blend modes. See https://libvips.github.io/libvips/API/current/libvips-conversion.html#VipsBlendMode
const ( BlendModeClear BlendMode = C.VIPS_BLEND_MODE_CLEAR BlendModeSource BlendMode = C.VIPS_BLEND_MODE_SOURCE BlendModeOver BlendMode = C.VIPS_BLEND_MODE_OVER BlendModeIn BlendMode = C.VIPS_BLEND_MODE_IN BlendModeOut BlendMode = C.VIPS_BLEND_MODE_OUT BlendModeAtop BlendMode = C.VIPS_BLEND_MODE_ATOP BlendModeDest BlendMode = C.VIPS_BLEND_MODE_DEST BlendModeDestOver BlendMode = C.VIPS_BLEND_MODE_DEST_OVER BlendModeDestIn BlendMode = C.VIPS_BLEND_MODE_DEST_IN BlendModeDestOut BlendMode = C.VIPS_BLEND_MODE_DEST_OUT BlendModeDestAtop BlendMode = C.VIPS_BLEND_MODE_DEST_ATOP BlendModeXOR BlendMode = C.VIPS_BLEND_MODE_XOR BlendModeAdd BlendMode = C.VIPS_BLEND_MODE_ADD BlendModeSaturate BlendMode = C.VIPS_BLEND_MODE_SATURATE BlendModeMultiply BlendMode = C.VIPS_BLEND_MODE_MULTIPLY BlendModeScreen BlendMode = C.VIPS_BLEND_MODE_SCREEN BlendModeOverlay BlendMode = C.VIPS_BLEND_MODE_OVERLAY BlendModeDarken BlendMode = C.VIPS_BLEND_MODE_DARKEN BlendModeLighten BlendMode = C.VIPS_BLEND_MODE_LIGHTEN BlendModeColorDodge BlendMode = C.VIPS_BLEND_MODE_COLOUR_DODGE BlendModeColorBurn BlendMode = C.VIPS_BLEND_MODE_COLOUR_BURN BlendModeHardLight BlendMode = C.VIPS_BLEND_MODE_HARD_LIGHT BlendModeSoftLight BlendMode = C.VIPS_BLEND_MODE_SOFT_LIGHT BlendModeDifference BlendMode = C.VIPS_BLEND_MODE_DIFFERENCE BlendModeExclusion BlendMode = C.VIPS_BLEND_MODE_EXCLUSION )
Constants define the various Porter-Duff and PDF blend modes. See https://libvips.github.io/libvips/API/current/libvips-conversion.html#VipsBlendMode
type BoolParameter ¶ added in v2.8.0
type BoolParameter struct {
Parameter
}
func (*BoolParameter) Get ¶ added in v2.8.0
func (p *BoolParameter) Get() bool
func (*BoolParameter) Set ¶ added in v2.8.0
func (p *BoolParameter) Set(v bool)
type CacheOptions ¶ added in v2.17.0
CacheOptions are optional parameters for cache.
type CannyOptions ¶ added in v2.17.0
CannyOptions are optional parameters for canny.
type CastOptions ¶ added in v2.17.0
type CastOptions struct {
Shift *bool
}
CastOptions are optional parameters for cast.
type ClampOptions ¶ added in v2.17.0
ClampOptions are optional parameters for clamp.
type Coding ¶
type Coding int
Coding represents VIPS_CODING type
const ( CodingError Coding = C.VIPS_CODING_ERROR CodingNone Coding = C.VIPS_CODING_NONE CodingLABQ Coding = C.VIPS_CODING_LABQ CodingRAD Coding = C.VIPS_CODING_RAD )
Coding enum
type ColorRGBA ¶ added in v2.4.0
type ColorRGBA struct {
R, G, B, A uint8
}
ColorRGBA represents an RGB with alpha channel (A)
type Combine ¶ added in v2.17.0
type Combine int
Combine represents VipsCombine for combining operations.
const ( CombineMax Combine = C.VIPS_COMBINE_MAX CombineSum Combine = C.VIPS_COMBINE_SUM CombineMin Combine = C.VIPS_COMBINE_MIN )
type CombineMode ¶ added in v2.17.0
type CombineMode int
CombineMode represents VipsCombineMode for draw combine operations.
const ( CombineModeSet CombineMode = C.VIPS_COMBINE_MODE_SET CombineModeAdd CombineMode = C.VIPS_COMBINE_MODE_ADD )
type CompassOptions ¶ added in v2.17.0
type CompassOptions struct {
Times *int
Angle *Angle45
Combine *Combine
Precision *Precision
Layers *int
Cluster *int
}
CompassOptions are optional parameters for compass.
type Composite2Options ¶ added in v2.17.0
type Composite2Options struct {
X *int
Y *int
CompositingSpace *Interpretation
Premultiplied *bool
}
Composite2Options are optional parameters for composite2.
type Config ¶
type Config struct {
ConcurrencyLevel int
MaxCacheFiles int
MaxCacheMem int
MaxCacheSize int
ReportLeaks bool
CacheTrace bool
CollectStats bool
}
Config allows fine-tuning of libvips library
type ConvOptions ¶ added in v2.17.0
ConvOptions are optional parameters for conv.
type ConvaOptions ¶ added in v2.17.0
ConvaOptions are optional parameters for conva.
type ConvasepOptions ¶ added in v2.17.0
type ConvasepOptions struct {
Layers *int
}
ConvasepOptions are optional parameters for convasep.
type ConvsepOptions ¶ added in v2.17.0
ConvsepOptions are optional parameters for convsep.
type CopyOptions ¶ added in v2.17.0
type CopyOptions struct {
Width *int
Height *int
Bands *int
Format *BandFormat
Coding *Coding
Interpretation *Interpretation
Xres *float64
Yres *float64
Xoffset *int
Yoffset *int
}
CopyOptions are optional parameters for copy.
type Direction ¶
type Direction int
Direction represents VIPS_DIRECTION type
const ( DirectionHorizontal Direction = C.VIPS_DIRECTION_HORIZONTAL DirectionVertical Direction = C.VIPS_DIRECTION_VERTICAL )
Direction enum
type ExportParams ¶
type ExportParams struct {
Format ImageType
Quality int
Compression int
Interlaced bool
Lossless bool
Effort int
StripMetadata bool
OptimizeCoding bool // jpeg param
SubsampleMode SubsampleMode // jpeg param
TrellisQuant bool // jpeg param
OvershootDeringing bool // jpeg param
OptimizeScans bool // jpeg param
QuantTable int // jpeg param
Speed int // avif param
}
ExportParams are options when exporting an image to file or buffer. Deprecated: Use format-specific params
func NewDefaultExportParams ¶
func NewDefaultExportParams() *ExportParams
NewDefaultExportParams creates default values for an export when image type is not JPEG, PNG or WEBP. By default, govips creates interlaced, lossy images with a quality of 80/100 and compression of 6/10. As these are default values for a wide variety of image formats, their application varies. Some formats use the quality parameters, some compression, etc. Deprecated: Use format-specific params
func NewDefaultJPEGExportParams ¶
func NewDefaultJPEGExportParams() *ExportParams
NewDefaultJPEGExportParams creates default values for an export of a JPEG image. By default, govips creates interlaced JPEGs with a quality of 80/100. Deprecated: Use NewJpegExportParams
func NewDefaultPNGExportParams ¶
func NewDefaultPNGExportParams() *ExportParams
NewDefaultPNGExportParams creates default values for an export of a PNG image. By default, govips creates non-interlaced PNGs with a compression of 6/10. Deprecated: Use NewPngExportParams
func NewDefaultWEBPExportParams ¶
func NewDefaultWEBPExportParams() *ExportParams
NewDefaultWEBPExportParams creates default values for an export of a WEBP image. By default, govips creates lossy images with a quality of 75/100. Deprecated: Use NewWebpExportParams
type ExtendStrategy ¶
type ExtendStrategy int
ExtendStrategy represents VIPS_EXTEND type
const ( ExtendBlack ExtendStrategy = C.VIPS_EXTEND_BLACK ExtendCopy ExtendStrategy = C.VIPS_EXTEND_COPY ExtendRepeat ExtendStrategy = C.VIPS_EXTEND_REPEAT ExtendMirror ExtendStrategy = C.VIPS_EXTEND_MIRROR ExtendWhite ExtendStrategy = C.VIPS_EXTEND_WHITE ExtendBackground ExtendStrategy = C.VIPS_EXTEND_BACKGROUND )
ExtendStrategy enum
type ExtractBandOptions ¶ added in v2.17.0
type ExtractBandOptions struct {
N *int
}
ExtractBandOptions are optional parameters for extract_band.
type EyeOptions ¶ added in v2.17.0
EyeOptions are optional parameters for eye.
type FailOn ¶ added in v2.17.0
type FailOn int
FailOn represents VipsFailOn for controlling error handling on load.
const ( FailOnNone FailOn = C.VIPS_FAIL_ON_NONE FailOnTruncated FailOn = C.VIPS_FAIL_ON_TRUNCATED FailOnError FailOn = C.VIPS_FAIL_ON_ERROR FailOnWarning FailOn = C.VIPS_FAIL_ON_WARNING )
type FlattenOptions ¶ added in v2.17.0
FlattenOptions are optional parameters for flatten.
type Float64Parameter ¶ added in v2.8.0
type Float64Parameter struct {
Parameter
}
func (*Float64Parameter) Get ¶ added in v2.8.0
func (p *Float64Parameter) Get() float64
func (*Float64Parameter) Set ¶ added in v2.8.0
func (p *Float64Parameter) Set(v float64)
type ForeignKeep ¶ added in v2.17.0
type ForeignKeep int
ForeignKeep represents VipsForeignKeep flags for controlling metadata retention.
type GammaOptions ¶ added in v2.17.0
type GammaOptions struct {
Exponent *float64
}
GammaOptions are optional parameters for gamma.
type GaussblurOptions ¶ added in v2.17.0
GaussblurOptions are optional parameters for gaussblur.
type GaussmatOptions ¶ added in v2.17.0
GaussmatOptions are optional parameters for gaussmat.
type GaussnoiseOptions ¶ added in v2.17.0
GaussnoiseOptions are optional parameters for gaussnoise.
type GifExportParams ¶ added in v2.6.0
type GifExportParams struct {
StripMetadata bool
// Quality is only used with vips < 8.12 (magicksave fallback).
// Ignored by native gifsave in vips 8.12+.
Quality int
Dither float64
Effort int
Bitdepth int
}
GifExportParams are options when exporting a GIF to file or buffer.
For vips 8.12+, native gifsave is used. The relevant parameters are Dither, Effort, and Bitdepth. Quality is ignored because native gifsave does not support a quality parameter.
For vips below 8.12, magicksave is used as a fallback. The relevant parameters are Quality and Bitdepth.
StripMetadata has no effect on GIF images.
func NewGifExportParams ¶ added in v2.6.0
func NewGifExportParams() *GifExportParams
NewGifExportParams creates default values for an export of a GIF image.
type GlobalbalanceOptions ¶ added in v2.17.0
GlobalbalanceOptions are optional parameters for globalbalance.
type Gravity ¶ added in v2.17.0
type Gravity int
Gravity represents VIPS_GRAVITY type
const ( GravityCentre Gravity = C.VIPS_COMPASS_DIRECTION_CENTRE GravityNorth Gravity = C.VIPS_COMPASS_DIRECTION_NORTH GravityEast Gravity = C.VIPS_COMPASS_DIRECTION_EAST GravitySouth Gravity = C.VIPS_COMPASS_DIRECTION_SOUTH GravityWest Gravity = C.VIPS_COMPASS_DIRECTION_WEST GravityNorthEast Gravity = C.VIPS_COMPASS_DIRECTION_NORTH_EAST GravityNorthWest Gravity = C.VIPS_COMPASS_DIRECTION_NORTH_WEST GravitySouthEast Gravity = C.VIPS_COMPASS_DIRECTION_SOUTH_EAST GravitySouthWest Gravity = C.VIPS_COMPASS_DIRECTION_SOUTH_WEST )
Gravity enum
type GravityOptions ¶ added in v2.17.0
type GravityOptions struct {
Extend *ExtendStrategy
Background []float64
}
GravityOptions are optional parameters for gravity.
type GreyOptions ¶ added in v2.17.0
type GreyOptions struct {
Uchar *bool
}
GreyOptions are optional parameters for grey.
type HeifExportParams ¶ added in v2.4.0
HeifExportParams are options when exporting a HEIF to file or buffer
func NewHeifExportParams ¶ added in v2.4.0
func NewHeifExportParams() *HeifExportParams
NewHeifExportParams creates default values for an export of a HEIF image.
type HistEqualOptions ¶ added in v2.17.0
type HistEqualOptions struct {
Band *int
}
HistEqualOptions are optional parameters for hist_equal.
type HistFindIndexedOptions ¶ added in v2.17.0
type HistFindIndexedOptions struct {
Combine *Combine
}
HistFindIndexedOptions are optional parameters for hist_find_indexed.
type HistFindNdimOptions ¶ added in v2.17.0
type HistFindNdimOptions struct {
Bins *int
}
HistFindNdimOptions are optional parameters for hist_find_ndim.
type HistFindOptions ¶ added in v2.17.0
type HistFindOptions struct {
Band *int
}
HistFindOptions are optional parameters for hist_find.
type HistLocalOptions ¶ added in v2.17.0
type HistLocalOptions struct {
MaxSlope *int
}
HistLocalOptions are optional parameters for hist_local.
type HoughCircleOptions ¶ added in v2.17.0
HoughCircleOptions are optional parameters for hough_circle.
type HoughLineOptions ¶ added in v2.17.0
HoughLineOptions are optional parameters for hough_line.
type IccExportOptions ¶ added in v2.17.0
type IccExportOptions struct {
Pcs *int
Intent *Intent
BlackPointCompensation *bool
OutputProfile *string
Depth *int
}
IccExportOptions are optional parameters for icc_export.
type IccImportOptions ¶ added in v2.17.0
type IccImportOptions struct {
Pcs *int
Intent *Intent
BlackPointCompensation *bool
Embedded *bool
InputProfile *string
}
IccImportOptions are optional parameters for icc_import.
type IdentityOptions ¶ added in v2.17.0
IdentityOptions are optional parameters for identity.
type IfthenelseOptions ¶ added in v2.17.0
type IfthenelseOptions struct {
Blend *bool
}
IfthenelseOptions are optional parameters for ifthenelse.
type ImageComposite ¶ added in v2.2.0
ImageComposite image to composite param
type ImageMetadata ¶
type ImageMetadata struct {
Format ImageType
Width int
Height int
Colorspace Interpretation
Orientation int
Pages int
}
ImageMetadata is a data structure holding the width, height, orientation and other metadata of the picture.
type ImageRef ¶
type ImageRef struct {
// contains filtered or unexported fields
}
ImageRef contains a libvips image and manages its lifecycle.
func Grey ¶ added in v2.17.0
Grey creates a horizontal gradient image (ramp from black to white). When uchar is true, pixel values are 0-255 uint8; when false, 0.0-1.0 float. Useful for creating gradient overlays when combined with rotation, BandJoin, and Composite.
func Identity ¶ added in v2.5.0
Identity creates an identity lookup table, which will leave an image unchanged when applied with Maplut. Each entry in the table has a value equal to its position.
func LoadImageFromBuffer ¶ added in v2.8.0
func LoadImageFromBuffer(buf []byte, params *ImportParams) (*ImageRef, error)
LoadImageFromBuffer loads an image buffer and creates a new Image
func LoadImageFromFile ¶ added in v2.10.0
func LoadImageFromFile(file string, params *ImportParams) (*ImageRef, error)
LoadImageFromFile loads an image from file and creates a new ImageRef
func LoadThumbnailFromBuffer ¶ added in v2.11.0
func LoadThumbnailFromBuffer(buf []byte, width, height int, crop Interesting, size Size, params *ImportParams) (*ImageRef, error)
LoadThumbnailFromBuffer loads an image buffer and creates a new Image with thumbnail crop and size
func LoadThumbnailFromFile ¶ added in v2.11.0
func LoadThumbnailFromFile(file string, width, height int, crop Interesting, size Size, params *ImportParams) (*ImageRef, error)
LoadThumbnailFromFile loads an image from file and creates a new ImageRef with thumbnail crop and size
func NewImageFromBuffer ¶
NewImageFromBuffer loads an image buffer and creates a new Image
func NewImageFromFile ¶
NewImageFromFile loads an image from file and creates a new ImageRef
func NewImageFromGoImage ¶ added in v2.17.0
NewImageFromGoImage creates a new ImageRef from a Go image.Image. The image is normalized to NRGBA (non-premultiplied RGBA, 8-bit) and imported into libvips in sRGB color space.
func NewImageFromReader ¶
NewImageFromReader loads an ImageRef from the given reader
func NewThumbnailFromBuffer ¶ added in v2.9.0
func NewThumbnailFromBuffer(buf []byte, width, height int, crop Interesting) (*ImageRef, error)
NewThumbnailFromBuffer loads an image buffer and creates a new Image with thumbnail crop
func NewThumbnailFromFile ¶ added in v2.9.0
func NewThumbnailFromFile(file string, width, height int, crop Interesting) (*ImageRef, error)
NewThumbnailFromFile loads an image from file and creates a new ImageRef with thumbnail crop
func NewThumbnailWithSizeFromBuffer ¶ added in v2.9.0
func NewThumbnailWithSizeFromBuffer(buf []byte, width, height int, crop Interesting, size Size) (*ImageRef, error)
NewThumbnailWithSizeFromBuffer loads an image buffer and creates a new Image with thumbnail crop and size
func NewThumbnailWithSizeFromFile ¶ added in v2.9.0
func NewThumbnailWithSizeFromFile(file string, width, height int, crop Interesting, size Size) (*ImageRef, error)
NewThumbnailWithSizeFromFile loads an image from file and creates a new ImageRef with thumbnail crop and size
func NewTransparentCanvas ¶ added in v2.17.0
NewTransparentCanvas creates a fully transparent RGBA image of the given dimensions. The image is in sRGB color space with 4 bands (RGBA), all channels set to 0.
func Text ¶ added in v2.17.0
func Text(params *TextParams) (*ImageRef, error)
Text draws the string text to an image.
func XYZ ¶ added in v2.3.0
XYZ creates a two-band uint32 image where the elements in the first band have the value of their x coordinate and elements in the second band have their y coordinate.
func (*ImageRef) Add ¶ added in v2.3.0
Add calculates a sum of the image + addend and stores it back in the image
func (*ImageRef) ArrayJoin ¶ added in v2.8.0
ArrayJoin joins an array of images together wrapping at each n images
func (*ImageRef) AutoRotate ¶
AutoRotate rotates the image upright based on the EXIF Orientation tag. It also resets the orientation information in the EXIF tag to be 1 (i.e. upright). N.B. libvips does not flip images currently (i.e. no support for orientations 2, 4, 5 and 7). N.B. due to the HEIF image standard, HEIF images are always autorotated by default on load. Thus, calling AutoRotate for HEIF images is not needed. todo: use https://www.libvips.org/API/current/libvips-conversion.html#vips-autorot-remove-angle
func (*ImageRef) Background ¶ added in v2.17.0
Background get the background of image.
func (*ImageRef) BandFormat ¶
func (r *ImageRef) BandFormat() BandFormat
BandFormat returns the current band format
func (*ImageRef) BandJoinConst ¶ added in v2.4.0
BandJoinConst appends a set of constant bands to an image.
func (*ImageRef) BandSplit ¶ added in v2.13.0
BandSplit split an n-band image into n separate images..
func (*ImageRef) Cast ¶ added in v2.5.0
func (r *ImageRef) Cast(format BandFormat) error
Cast converts the image to a target band format
func (*ImageRef) Close ¶
func (r *ImageRef) Close()
Close manually closes the image and frees the memory. Calling Close() is optional. Images are automatically closed by GC. However, in high volume applications the GC can't keep up with the amount of memory, so you might want to manually close the images.
func (*ImageRef) ColorSpace ¶
func (r *ImageRef) ColorSpace() Interpretation
ColorSpace returns the interpretation of the current color space. Alias to Interpretation().
func (*ImageRef) Composite ¶
Composite composites the given overlay image on top of the associated image with provided blending mode.
func (*ImageRef) CompositeMulti ¶ added in v2.2.0
func (r *ImageRef) CompositeMulti(ins []*ImageComposite) error
CompositeMulti composites the given overlay image on top of the associated image with provided blending mode.
func (*ImageRef) CopyChangingInterpretation ¶ added in v2.13.0
func (r *ImageRef) CopyChangingInterpretation(interpretation Interpretation) (*ImageRef, error)
Copy creates a new copy of the given image with the interpretation.
func (*ImageRef) CopyChangingResolution ¶ added in v2.13.0
Copy creates a new copy of the given image with the new X and Y resolution (PPI).
func (*ImageRef) Divide ¶ added in v2.3.0
Divide calculates the product of the image / denominator and stores it back in the image
func (*ImageRef) DrawRect ¶ added in v2.4.0
func (r *ImageRef) DrawRect(ink ColorRGBA, left int, top int, width int, height int, fill bool) error
DrawRect draws an (optionally filled) rectangle with a single colour
func (*ImageRef) Embed ¶
func (r *ImageRef) Embed(left, top, width, height int, extend ExtendStrategy) error
Embed embeds the given picture in a new one, i.e. the opposite of ExtractArea
func (*ImageRef) EmbedBackground ¶ added in v2.9.0
EmbedBackground embeds the given picture with a background color
func (*ImageRef) EmbedBackgroundRGBA ¶ added in v2.11.0
func (r *ImageRef) EmbedBackgroundRGBA(left, top, width, height int, backgroundColor *ColorRGBA) error
EmbedBackgroundRGBA embeds the given picture with a background rgba color
func (*ImageRef) Export ¶
func (r *ImageRef) Export(params *ExportParams) ([]byte, *ImageMetadata, error)
Export creates a byte array of the image for use. The function returns a byte array that can be written to a file e.g. via os.WriteFile(). N.B. govips does not currently have built-in support for directly exporting to a file. The function also returns a copy of the image metadata as well as an error. Deprecated: Use ExportNative or format-specific Export methods
func (*ImageRef) ExportAvif ¶ added in v2.7.0
func (r *ImageRef) ExportAvif(params *AvifExportParams) ([]byte, *ImageMetadata, error)
ExportAvif exports the image as AVIF to a buffer.
func (*ImageRef) ExportGIF ¶ added in v2.6.0
func (r *ImageRef) ExportGIF(params *GifExportParams) ([]byte, *ImageMetadata, error)
ExportGIF exports the image as GIF to a buffer.
func (*ImageRef) ExportHeif ¶ added in v2.4.0
func (r *ImageRef) ExportHeif(params *HeifExportParams) ([]byte, *ImageMetadata, error)
ExportHeif exports the image as HEIF to a buffer.
func (*ImageRef) ExportJp2k ¶ added in v2.8.0
func (r *ImageRef) ExportJp2k(params *Jp2kExportParams) ([]byte, *ImageMetadata, error)
ExportJp2k exports the image as JPEG2000 to a buffer.
func (*ImageRef) ExportJpeg ¶ added in v2.4.0
func (r *ImageRef) ExportJpeg(params *JpegExportParams) ([]byte, *ImageMetadata, error)
ExportJpeg exports the image as JPEG to a buffer.
func (*ImageRef) ExportJxl ¶ added in v2.14.0
func (r *ImageRef) ExportJxl(params *JxlExportParams) ([]byte, *ImageMetadata, error)
ExportJxl exports the image as JPEG XL to a buffer.
func (*ImageRef) ExportMagick ¶ added in v2.17.0
func (r *ImageRef) ExportMagick(params *MagickExportParams) ([]byte, *ImageMetadata, error)
ExportMagick exports the image as Format set in param to a buffer.
func (*ImageRef) ExportNative ¶ added in v2.4.0
func (r *ImageRef) ExportNative() ([]byte, *ImageMetadata, error)
ExportNative exports the image to a buffer based on its native format with default parameters.
func (*ImageRef) ExportPng ¶ added in v2.4.0
func (r *ImageRef) ExportPng(params *PngExportParams) ([]byte, *ImageMetadata, error)
ExportPng exports the image as PNG to a buffer.
func (*ImageRef) ExportTiff ¶ added in v2.4.0
func (r *ImageRef) ExportTiff(params *TiffExportParams) ([]byte, *ImageMetadata, error)
ExportTiff exports the image as TIFF to a buffer.
func (*ImageRef) ExportWebp ¶ added in v2.4.0
func (r *ImageRef) ExportWebp(params *WebpExportParams) ([]byte, *ImageMetadata, error)
ExportWebp exports the image as WEBP to a buffer.
func (*ImageRef) ExtractArea ¶
ExtractArea crops the image to a specified area
func (*ImageRef) ExtractBand ¶
ExtractBand extracts one or more bands out of the image (replacing the associated ImageRef)
func (*ImageRef) ExtractBandToImage ¶ added in v2.13.0
ExtractBandToImage extracts one or more bands out of the image to a new image
func (*ImageRef) FindTrim ¶ added in v2.6.0
FindTrim returns the bounding box of the non-border part of the image Returned values are left, top, width, height
func (*ImageRef) Flatten ¶
Flatten removes the alpha channel from the image and replaces it with the background color
func (*ImageRef) Flip ¶
Flip flips the image either horizontally or vertically based on the parameter
func (*ImageRef) Gamma ¶ added in v2.15.0
Adjusts the image's gamma value. See https://www.libvips.org/API/current/libvips-conversion.html#vips-gamma
func (*ImageRef) GaussianBlur ¶
GaussianBlur blurs the image add support minAmpl
func (*ImageRef) GetAsString ¶ added in v2.13.0
func (*ImageRef) GetICCProfile ¶ added in v2.13.0
GetICCProfile retrieves the ICC profile data (if any) from the image.
func (*ImageRef) GetOrientation
deprecated
func (*ImageRef) GetPageHeight ¶ added in v2.10.0
GetPageHeight return the height of a single page Deprecated use PageHeight() instead
func (*ImageRef) GetPoint ¶ added in v2.8.0
GetPoint reads a single pixel on an image. The pixel values are returned in a slice of length n.
func (*ImageRef) HasICCProfile ¶
HasICCProfile checks whether the image has an ICC profile embedded. Alias to HasProfile
func (*ImageRef) HasIPTC ¶
HasIPTC returns a boolean whether the image in question has IPTC data associated with it.
func (*ImageRef) HasProfile ¶
HasProfile returns if the image has an ICC profile embedded.
func (*ImageRef) HistogramCumulative ¶ added in v2.14.0
HistogramCumulative form cumulative histogram.
func (*ImageRef) HistogramEntropy ¶ added in v2.14.0
HistogramEntropy estimate image entropy from a histogram. Entropy is calculated as: `-sum(p * log2(p))` where p is histogram-value / sum-of-histogram-values.
func (*ImageRef) HistogramFind ¶ added in v2.14.0
HistogramFind find the histogram the image. Find the histogram for all bands (producing a one-band histogram). char and uchar images are cast to uchar before histogramming, all other image types are cast to ushort.
func (*ImageRef) HistogramNormalise ¶ added in v2.14.0
HistogramNormalise The maximum of each band becomes equal to the maximum index, so for example the max for a uchar image becomes 255. Normalise each band separately.
func (*ImageRef) ImageFields ¶ added in v2.8.0
func (*ImageRef) Insert ¶ added in v2.6.0
Insert draws the image on top of the associated image at the given coordinates.
func (*ImageRef) Interpretation ¶
func (r *ImageRef) Interpretation() Interpretation
Interpretation returns the current interpretation of the color space of the image.
func (*ImageRef) IsColorSpaceSupported ¶
IsColorSpaceSupported returns a boolean whether the image's color space is supported by libvips.
func (*ImageRef) Join ¶ added in v2.8.0
Join joins this image with another in the direction specified
func (*ImageRef) Label ¶
func (r *ImageRef) Label(labelParams *LabelParams) error
Label overlays a label on top of the image
func (*ImageRef) Linear ¶
Linear passes an image through a linear transformation (i.e. output = input * a + b). See https://libvips.github.io/libvips/API/current/libvips-arithmetic.html#vips-linear
func (*ImageRef) Linear1 ¶
Linear1 runs Linear() with a single constant. See https://libvips.github.io/libvips/API/current/libvips-arithmetic.html#vips-linear1
func (*ImageRef) Loop ¶ added in v2.17.0
Loop returns the loop count for animated images. A value of 0 means infinite looping.
func (*ImageRef) Maplut ¶ added in v2.5.0
Maplut maps an image through another image acting as a LUT (Look Up Table)
func (*ImageRef) Metadata ¶
func (r *ImageRef) Metadata() *ImageMetadata
Metadata returns the metadata (ImageMetadata struct) of the associated ImageRef
func (*ImageRef) ModulateHSV ¶
ModulateHSV modulates the image HSV values based on the supplier parameters.
func (*ImageRef) Multiply ¶ added in v2.3.0
Multiply calculates the product of the image * multiplier and stores it back in the image
func (*ImageRef) OptimizeICCProfile ¶
OptimizeICCProfile optimizes the ICC color profile of the image. For two color channel images, it sets a grayscale profile. For color images, it sets a CMYK or non-CMYK profile based on the image metadata.
func (*ImageRef) Orientation ¶ added in v2.10.0
Orientation returns the orientation number as it appears in the EXIF, if present
func (*ImageRef) OriginalFormat ¶ added in v2.13.0
OriginalFormat returns the original format of the image when loaded. In some cases the loaded image is converted on load, for example, a BMP is automatically converted to PNG This method returns the format of the original buffer, as opposed to Format() with will return the format of the currently held buffer content.
func (*ImageRef) PageHeight ¶ added in v2.10.0
PageHeight return the height of a single page
func (*ImageRef) Pages ¶ added in v2.10.0
Pages returns the number of pages in the Image For animated images this corresponds to the number of frames
func (*ImageRef) PremultiplyAlpha ¶
PremultiplyAlpha premultiplies the alpha channel. See https://libvips.github.io/libvips/API/current/libvips-conversion.html#vips-premultiply
func (*ImageRef) Rank ¶ added in v2.6.0
Rank does rank filtering on an image. A window of size width by height is passed over the image. At each position, the pixels inside the window are sorted into ascending order and the pixel at position index is output. index numbers from 0.
func (*ImageRef) Recomb ¶ added in v2.14.0
Recomb recombines the image bands using the matrix provided
func (*ImageRef) RemoveICCProfile ¶
RemoveICCProfile removes the ICC Profile information from the image. Typically, browsers and other software assume images without profile to be in the sRGB color space.
func (*ImageRef) RemoveMetadata ¶
RemoveMetadata removes the EXIF metadata from the image. N.B. this function won't remove the ICC profile, orientation and pages metadata because govips needs it to correctly display the image.
func (*ImageRef) RemoveOrientation ¶
RemoveOrientation removes the EXIF orientation information of the image.
func (*ImageRef) ResizeWithVScale ¶
ResizeWithVScale resizes the image with both horizontal and vertical scaling. The parameters are the scaling factors.
func (*ImageRef) Rotate ¶
Rotate rotates the image by multiples of 90 degrees. To rotate by arbitrary angles use Similarity.
func (*ImageRef) SetLoop ¶ added in v2.17.0
SetLoop sets the loop count for animated images. A value of 0 means infinite looping.
func (*ImageRef) SetOrientation ¶
SetOrientation sets the orientation in the EXIF header of the associated image.
func (*ImageRef) SetPageDelay ¶ added in v2.11.0
SetPageDelay set the page delay array for animation
func (*ImageRef) SetPageHeight ¶ added in v2.10.0
SetPageHeight set the height of a page For animated images this is used when "unrolling" back to frames
func (*ImageRef) SetPages ¶ added in v2.10.0
SetPages sets the number of pages in the Image For animated images this corresponds to the number of frames
func (*ImageRef) Sharpen ¶
Sharpen sharpens the image sigma: sigma of the gaussian x1: flat/jaggy threshold m2: slope for jaggy areas
func (*ImageRef) Similarity ¶ added in v2.4.0
func (r *ImageRef) Similarity(scale float64, angle float64, backgroundColor *ColorRGBA, idx float64, idy float64, odx float64, ody float64) error
Similarity lets you scale, offset and rotate images by arbitrary angles in a single operation while defining the color of new background pixels. If the input image has no alpha channel, the alpha on `backgroundColor` will be ignored. You can add an alpha channel to an image with `BandJoinConst` (e.g. `img.BandJoinConst([]float64{255})`) or AddAlpha.
func (*ImageRef) SmartCrop ¶ added in v2.4.0
func (r *ImageRef) SmartCrop(width int, height int, interesting Interesting) error
SmartCrop will crop the image based on interesting factor
func (*ImageRef) Stats ¶ added in v2.14.0
Stats find many image statistics in a single pass through the data. Image is changed into a one-band `BandFormatDouble` image of at least 10 columns by n + 1 (where n is number of bands in image in) rows. Columns are statistics, and are, in order: minimum, maximum, sum, sum of squares, mean, standard deviation, x coordinate of minimum, y coordinate of minimum, x coordinate of maximum, y coordinate of maximum.
Row 0 has statistics for all bands together, row 1 has stats for band 1, and so on.
If there is more than one maxima or minima, one of them will be chosen at random.
func (*ImageRef) Subtract ¶ added in v2.17.0
Subtract calculate subtract operation between two images.
func (*ImageRef) Thumbnail ¶ added in v2.2.0
func (r *ImageRef) Thumbnail(width, height int, crop Interesting) error
Thumbnail resizes the image to the given width and height. crop decides algorithm vips uses to shrink and crop to fill target,
func (*ImageRef) ThumbnailWithSize ¶ added in v2.9.0
func (r *ImageRef) ThumbnailWithSize(width, height int, crop Interesting, size Size) error
ThumbnailWithSize resizes the image to the given width and height. crop decides algorithm vips uses to shrink and crop to fill target, size controls upsize, downsize, both or force
func (*ImageRef) ToBytes ¶
ToBytes writes the image to memory in VIPs format and returns the raw bytes, useful for storage.
func (*ImageRef) ToColorSpace ¶
func (r *ImageRef) ToColorSpace(interpretation Interpretation) error
ToColorSpace changes the color space of the image to the interpretation supplied as the parameter.
func (*ImageRef) ToGoImage ¶ added in v2.17.0
ToGoImage converts a vips image directly to a Go image.Image without encoding. This is significantly faster than ToImage() which round-trips through JPEG/PNG. The resulting image will be in sRGB color space with 8-bit depth.
func (*ImageRef) ToImage ¶ added in v2.4.0
func (r *ImageRef) ToImage(params *ExportParams) (image.Image, error)
ToImage converts a VIPs image to a golang image.Image object, useful for interoperability with other golang libraries. Deprecated: Use ToGoImage for a faster, direct conversion without encoding round-trip.
func (*ImageRef) TransformICCProfile ¶ added in v2.9.0
TransformICCProfile transforms from the embedded ICC profile of the image to the icc profile at the given path.
func (*ImageRef) TransformICCProfileWithFallback ¶ added in v2.15.0
func (r *ImageRef) TransformICCProfileWithFallback(targetProfilePath, fallbackProfilePath string) error
TransformICCProfileWithFallback transforms from the embedded ICC profile of the image to the ICC profile at the given path. The fallback ICC profile is used if the image does not have an embedded ICC profile.
func (*ImageRef) UnpremultiplyAlpha ¶
UnpremultiplyAlpha unpremultiplies any alpha channel. See https://libvips.github.io/libvips/API/current/libvips-conversion.html#vips-unpremultiply
type ImageType ¶
type ImageType int
ImageType represents an image type
const ( ImageTypeUnknown ImageType = C.UNKNOWN ImageTypeGIF ImageType = C.GIF ImageTypeJPEG ImageType = C.JPEG ImageTypeMagick ImageType = C.MAGICK ImageTypePDF ImageType = C.PDF ImageTypePNG ImageType = C.PNG ImageTypeSVG ImageType = C.SVG ImageTypeTIFF ImageType = C.TIFF ImageTypeWEBP ImageType = C.WEBP ImageTypeHEIF ImageType = C.HEIF ImageTypeBMP ImageType = C.BMP ImageTypeAVIF ImageType = C.AVIF ImageTypeJP2K ImageType = C.JP2K ImageTypeJXL ImageType = C.JXL ImageTypePSD ImageType = C.PSD )
ImageType enum
func DetermineImageType ¶
DetermineImageType attempts to determine the image type of the given buffer
type ImportParams ¶ added in v2.8.0
type ImportParams struct {
AutoRotate BoolParameter
FailOnError BoolParameter
Page IntParameter
NumPages IntParameter
Density IntParameter
JpegShrinkFactor IntParameter
WebpScaleFactor Float64Parameter
HeifThumbnail BoolParameter
SvgUnlimited BoolParameter
Access IntParameter
}
ImportParams are options for loading an image. Some are type-specific. For default loading, use NewImportParams() or specify nil
func NewImportParams ¶ added in v2.8.0
func NewImportParams() *ImportParams
NewImportParams creates default ImportParams
func (*ImportParams) OptionString ¶ added in v2.11.0
func (i *ImportParams) OptionString() string
OptionString convert import params to option_string
type InsertOptions ¶ added in v2.17.0
InsertOptions are optional parameters for insert.
type IntParameter ¶ added in v2.8.0
type IntParameter struct {
Parameter
}
func (*IntParameter) Get ¶ added in v2.8.0
func (p *IntParameter) Get() int
func (*IntParameter) Set ¶ added in v2.8.0
func (p *IntParameter) Set(v int)
type Intent ¶ added in v2.8.0
type Intent int
Intent represents VIPS_INTENT type
const ( IntentPerceptual Intent = C.VIPS_INTENT_PERCEPTUAL IntentRelative Intent = C.VIPS_INTENT_RELATIVE IntentSaturation Intent = C.VIPS_INTENT_SATURATION IntentAbsolute Intent = C.VIPS_INTENT_ABSOLUTE IntentLast Intent = C.VIPS_INTENT_LAST )
Intent enum
type Interesting ¶ added in v2.2.0
type Interesting int
Interesting represents VIPS_INTERESTING type https://libvips.github.io/libvips/API/current/libvips-conversion.html#VipsInteresting
const ( InterestingNone Interesting = C.VIPS_INTERESTING_NONE InterestingCentre Interesting = C.VIPS_INTERESTING_CENTRE InterestingEntropy Interesting = C.VIPS_INTERESTING_ENTROPY InterestingAttention Interesting = C.VIPS_INTERESTING_ATTENTION InterestingLow Interesting = C.VIPS_INTERESTING_LOW InterestingHigh Interesting = C.VIPS_INTERESTING_HIGH InterestingAll Interesting = C.VIPS_INTERESTING_ALL InterestingLast Interesting = C.VIPS_INTERESTING_LAST )
Interesting constants represent areas of interest which smart cropping will crop based on.
type Interpretation ¶
type Interpretation int
Interpretation represents VIPS_INTERPRETATION type
const ( InterpretationError Interpretation = C.VIPS_INTERPRETATION_ERROR InterpretationMultiband Interpretation = C.VIPS_INTERPRETATION_MULTIBAND InterpretationBW Interpretation = C.VIPS_INTERPRETATION_B_W InterpretationHistogram Interpretation = C.VIPS_INTERPRETATION_HISTOGRAM InterpretationXYZ Interpretation = C.VIPS_INTERPRETATION_XYZ InterpretationLAB Interpretation = C.VIPS_INTERPRETATION_LAB InterpretationCMYK Interpretation = C.VIPS_INTERPRETATION_CMYK InterpretationLABQ Interpretation = C.VIPS_INTERPRETATION_LABQ InterpretationRGB Interpretation = C.VIPS_INTERPRETATION_RGB InterpretationRGB16 Interpretation = C.VIPS_INTERPRETATION_RGB16 InterpretationCMC Interpretation = C.VIPS_INTERPRETATION_CMC InterpretationLCH Interpretation = C.VIPS_INTERPRETATION_LCH InterpretationLABS Interpretation = C.VIPS_INTERPRETATION_LABS InterpretationSRGB Interpretation = C.VIPS_INTERPRETATION_sRGB InterpretationYXY Interpretation = C.VIPS_INTERPRETATION_YXY InterpretationFourier Interpretation = C.VIPS_INTERPRETATION_FOURIER InterpretationGrey16 Interpretation = C.VIPS_INTERPRETATION_GREY16 InterpretationMatrix Interpretation = C.VIPS_INTERPRETATION_MATRIX InterpretationScRGB Interpretation = C.VIPS_INTERPRETATION_scRGB InterpretationHSV Interpretation = C.VIPS_INTERPRETATION_HSV )
Interpretation enum
type InvertlutOptions ¶ added in v2.17.0
type InvertlutOptions struct {
Size *int
}
InvertlutOptions are optional parameters for invertlut.
type InvfftOptions ¶ added in v2.17.0
type InvfftOptions struct {
Real *bool
}
InvfftOptions are optional parameters for invfft.
type JoinOptions ¶ added in v2.17.0
JoinOptions are optional parameters for join.
type Jp2kExportParams ¶ added in v2.8.0
type Jp2kExportParams struct {
Quality int
Lossless bool
TileWidth int
TileHeight int
SubsampleMode SubsampleMode
}
Jp2kExportParams are options when exporting an JPEG2000 to file or buffer.
func NewJp2kExportParams ¶ added in v2.8.0
func NewJp2kExportParams() *Jp2kExportParams
NewJp2kExportParams creates default values for an export of an JPEG2000 image.
type JpegExportParams ¶ added in v2.4.0
type JpegExportParams struct {
StripMetadata bool
Quality int
Interlace bool
OptimizeCoding bool
SubsampleMode SubsampleMode
TrellisQuant bool
OvershootDeringing bool
OptimizeScans bool
QuantTable int
}
JpegExportParams are options when exporting a JPEG to file or buffer
func NewJpegExportParams ¶ added in v2.4.0
func NewJpegExportParams() *JpegExportParams
NewJpegExportParams creates default values for an export of a JPEG image. By default, govips creates interlaced JPEGs with a quality of 80/100.
type JxlExportParams ¶ added in v2.14.0
JxlExportParams are options when exporting an JXL to file or buffer.
func NewJxlExportParams ¶ added in v2.14.0
func NewJxlExportParams() *JxlExportParams
NewJxlExportParams creates default values for an export of an JXL image.
type Kernel ¶
type Kernel int
Kernel represents VipsKernel type
const ( KernelAuto Kernel = -1 KernelNearest Kernel = C.VIPS_KERNEL_NEAREST KernelLinear Kernel = C.VIPS_KERNEL_LINEAR KernelCubic Kernel = C.VIPS_KERNEL_CUBIC KernelLanczos2 Kernel = C.VIPS_KERNEL_LANCZOS2 KernelLanczos3 Kernel = C.VIPS_KERNEL_LANCZOS3 KernelMitchell Kernel = C.VIPS_KERNEL_MITCHELL )
Kernel enum
type Lab2XYZOptions ¶ added in v2.17.0
type Lab2XYZOptions struct {
Temp []float64
}
Lab2XYZOptions are optional parameters for Lab2XYZ.
type LabelParams ¶
type LabelParams struct {
Text string
Font string
Width Scalar
Height Scalar
OffsetX Scalar
OffsetY Scalar
Opacity float32
Color Color
Alignment Align
}
LabelParams represents a text-based label
type LinearOptions ¶ added in v2.17.0
type LinearOptions struct {
Uchar *bool
}
LinearOptions are optional parameters for linear.
type LinecacheOptions ¶ added in v2.17.0
LinecacheOptions are optional parameters for linecache.
type LogLevel ¶ added in v2.1.0
type LogLevel int
LogLevel is the enum controlling logging message verbosity.
const ( LogLevelError LogLevel = C.G_LOG_LEVEL_ERROR LogLevelCritical LogLevel = C.G_LOG_LEVEL_CRITICAL LogLevelWarning LogLevel = C.G_LOG_LEVEL_WARNING LogLevelMessage LogLevel = C.G_LOG_LEVEL_MESSAGE LogLevelInfo LogLevel = C.G_LOG_LEVEL_INFO LogLevelDebug LogLevel = C.G_LOG_LEVEL_DEBUG )
The logging verbosity levels classify and filter logging messages. From most to least verbose, they are debug, info, message, warning, critical and error.
type LoggingHandlerFunction ¶ added in v2.1.0
LoggingHandlerFunction is a function which will be called for each log message. By default, govips sends logging messages to os.Stderr. If you want to log elsewhere such as to a file or to a state variable which you inspect yourself, define a new logging handler function and set it via LoggingSettings().
type LogmatOptions ¶ added in v2.17.0
LogmatOptions are optional parameters for logmat.
type MagickExportParams ¶ added in v2.17.0
type MagickExportParams struct {
Quality int
Format string
OptimizeGifFrames bool
OptimizeGifTransparency bool
BitDepth int
}
MagickExportParams are options when exporting an image to file or buffer by ImageMagick.
func NewMagickExportParams ¶ added in v2.17.0
func NewMagickExportParams() *MagickExportParams
NewMagickExportParams creates default values for an export of an image by ImageMagick.
type MapimOptions ¶ added in v2.17.0
type MapimOptions struct {
Interpolate *C.VipsInterpolate
Background []float64
Premultiplied *bool
Extend *ExtendStrategy
}
MapimOptions are optional parameters for mapim.
type MaplutOptions ¶ added in v2.17.0
type MaplutOptions struct {
Band *int
}
MaplutOptions are optional parameters for maplut.
type MaskButterworthBandOptions ¶ added in v2.17.0
MaskButterworthBandOptions are optional parameters for mask_butterworth_band.
type MaskButterworthOptions ¶ added in v2.17.0
MaskButterworthOptions are optional parameters for mask_butterworth.
type MaskButterworthRingOptions ¶ added in v2.17.0
MaskButterworthRingOptions are optional parameters for mask_butterworth_ring.
type MaskFractalOptions ¶ added in v2.17.0
MaskFractalOptions are optional parameters for mask_fractal.
type MaskGaussianBandOptions ¶ added in v2.17.0
MaskGaussianBandOptions are optional parameters for mask_gaussian_band.
type MaskGaussianOptions ¶ added in v2.17.0
MaskGaussianOptions are optional parameters for mask_gaussian.
type MaskGaussianRingOptions ¶ added in v2.17.0
MaskGaussianRingOptions are optional parameters for mask_gaussian_ring.
type MaskIdealBandOptions ¶ added in v2.17.0
MaskIdealBandOptions are optional parameters for mask_ideal_band.
type MaskIdealOptions ¶ added in v2.17.0
MaskIdealOptions are optional parameters for mask_ideal.
type MaskIdealRingOptions ¶ added in v2.17.0
MaskIdealRingOptions are optional parameters for mask_ideal_ring.
type MatchOptions ¶ added in v2.17.0
type MatchOptions struct {
Hwindow *int
Harea *int
Search *bool
Interpolate *C.VipsInterpolate
}
MatchOptions are optional parameters for match.
type MemoryStats ¶
MemoryStats is a data structure that houses various memory statistics from ReadVipsMemStats()
type MergeOptions ¶ added in v2.17.0
type MergeOptions struct {
Mblend *int
}
MergeOptions are optional parameters for merge.
type Mosaic1Options ¶ added in v2.17.0
type Mosaic1Options struct {
Hwindow *int
Harea *int
Search *bool
Interpolate *C.VipsInterpolate
Mblend *int
}
Mosaic1Options are optional parameters for mosaic1.
type MosaicOptions ¶ added in v2.17.0
MosaicOptions are optional parameters for mosaic.
type MsbOptions ¶ added in v2.17.0
type MsbOptions struct {
Band *int
}
MsbOptions are optional parameters for msb.
type OperationBoolean ¶ added in v2.17.0
type OperationBoolean int
OperationBoolean represents VipsOperationBoolean for boolean operations.
const ( OperationBooleanAnd OperationBoolean = C.VIPS_OPERATION_BOOLEAN_AND OperationBooleanOr OperationBoolean = C.VIPS_OPERATION_BOOLEAN_OR OperationBooleanEor OperationBoolean = C.VIPS_OPERATION_BOOLEAN_EOR OperationBooleanLshift OperationBoolean = C.VIPS_OPERATION_BOOLEAN_LSHIFT OperationBooleanRshift OperationBoolean = C.VIPS_OPERATION_BOOLEAN_RSHIFT )
type OperationComplex ¶ added in v2.17.0
type OperationComplex int
OperationComplex represents VipsOperationComplex for complex operations.
const ( OperationComplexPolar OperationComplex = C.VIPS_OPERATION_COMPLEX_POLAR OperationComplexRect OperationComplex = C.VIPS_OPERATION_COMPLEX_RECT OperationComplexConj OperationComplex = C.VIPS_OPERATION_COMPLEX_CONJ )
type OperationComplex2 ¶ added in v2.17.0
type OperationComplex2 int
OperationComplex2 represents VipsOperationComplex2 for binary complex operations.
const (
OperationComplex2CrossPhase OperationComplex2 = C.VIPS_OPERATION_COMPLEX2_CROSS_PHASE
)
type OperationComplexget ¶ added in v2.17.0
type OperationComplexget int
OperationComplexget represents VipsOperationComplexget for getting complex components.
const ( OperationComplexgetReal OperationComplexget = C.VIPS_OPERATION_COMPLEXGET_REAL OperationComplexgetImag OperationComplexget = C.VIPS_OPERATION_COMPLEXGET_IMAG )
type OperationMath ¶ added in v2.17.0
type OperationMath int
OperationMath represents VipsOperationMath for math operations.
const ( OperationMathSin OperationMath = C.VIPS_OPERATION_MATH_SIN OperationMathCos OperationMath = C.VIPS_OPERATION_MATH_COS OperationMathTan OperationMath = C.VIPS_OPERATION_MATH_TAN OperationMathAsin OperationMath = C.VIPS_OPERATION_MATH_ASIN OperationMathAcos OperationMath = C.VIPS_OPERATION_MATH_ACOS OperationMathAtan OperationMath = C.VIPS_OPERATION_MATH_ATAN OperationMathLog OperationMath = C.VIPS_OPERATION_MATH_LOG OperationMathLog10 OperationMath = C.VIPS_OPERATION_MATH_LOG10 OperationMathExp OperationMath = C.VIPS_OPERATION_MATH_EXP OperationMathExp10 OperationMath = C.VIPS_OPERATION_MATH_EXP10 )
type OperationMath2 ¶ added in v2.17.0
type OperationMath2 int
OperationMath2 represents VipsOperationMath2 for binary math operations.
const ( OperationMath2Pow OperationMath2 = C.VIPS_OPERATION_MATH2_POW OperationMath2Wop OperationMath2 = C.VIPS_OPERATION_MATH2_WOP OperationMath2Atan2 OperationMath2 = C.VIPS_OPERATION_MATH2_ATAN2 )
type OperationMorphology ¶ added in v2.17.0
type OperationMorphology int
OperationMorphology represents VipsOperationMorphology for morphological operations.
const ( OperationMorphologyErode OperationMorphology = C.VIPS_OPERATION_MORPHOLOGY_ERODE OperationMorphologyDilate OperationMorphology = C.VIPS_OPERATION_MORPHOLOGY_DILATE )
type OperationRelational ¶ added in v2.17.0
type OperationRelational int
OperationRelational represents VipsOperationRelational for relational operations.
const ( OperationRelationalEqual OperationRelational = C.VIPS_OPERATION_RELATIONAL_EQUAL OperationRelationalNoteq OperationRelational = C.VIPS_OPERATION_RELATIONAL_NOTEQ OperationRelationalLess OperationRelational = C.VIPS_OPERATION_RELATIONAL_LESS OperationRelationalLesseq OperationRelational = C.VIPS_OPERATION_RELATIONAL_LESSEQ OperationRelationalMore OperationRelational = C.VIPS_OPERATION_RELATIONAL_MORE OperationRelationalMoreeq OperationRelational = C.VIPS_OPERATION_RELATIONAL_MOREEQ )
type OperationRound ¶ added in v2.17.0
type OperationRound int
OperationRound represents VipsOperationRound for rounding operations.
const ( OperationRoundRint OperationRound = C.VIPS_OPERATION_ROUND_RINT OperationRoundCeil OperationRound = C.VIPS_OPERATION_ROUND_CEIL OperationRoundFloor OperationRound = C.VIPS_OPERATION_ROUND_FLOOR )
type Parameter ¶ added in v2.8.0
type Parameter struct {
// contains filtered or unexported fields
}
type PerlinOptions ¶ added in v2.17.0
PerlinOptions are optional parameters for perlin.
type PngExportParams ¶ added in v2.4.0
type PngExportParams struct {
StripMetadata bool
Compression int
Filter PngFilter
Interlace bool
Quality int
Palette bool
Dither float64
Bitdepth int
Profile string
}
PngExportParams are options when exporting a PNG to file or buffer
func NewPngExportParams ¶ added in v2.4.0
func NewPngExportParams() *PngExportParams
NewPngExportParams creates default values for an export of a PNG image. By default, govips creates non-interlaced PNGs with a compression of 6/10.
type PngFilter ¶ added in v2.13.0
type PngFilter int
PngFilter represents filter algorithms that can be applied before compression. See https://www.w3.org/TR/PNG-Filters.html
const ( PngFilterNone PngFilter = C.VIPS_FOREIGN_PNG_FILTER_NONE PngFilterSub PngFilter = C.VIPS_FOREIGN_PNG_FILTER_SUB PngFilterUo PngFilter = C.VIPS_FOREIGN_PNG_FILTER_UP PngFilterAvg PngFilter = C.VIPS_FOREIGN_PNG_FILTER_AVG PngFilterPaeth PngFilter = C.VIPS_FOREIGN_PNG_FILTER_PAETH PngFilterAll PngFilter = C.VIPS_FOREIGN_PNG_FILTER_ALL )
PngFilter enum
type PreMultiplicationState ¶
type PreMultiplicationState struct {
// contains filtered or unexported fields
}
PreMultiplicationState stores the pre-multiplication band format of the image
type Precision ¶ added in v2.17.0
type Precision int
Precision represents VipsPrecision for controlling computation precision.
const ( PrecisionInteger Precision = C.VIPS_PRECISION_INTEGER PrecisionFloat Precision = C.VIPS_PRECISION_FLOAT PrecisionApproximate Precision = C.VIPS_PRECISION_APPROXIMATE )
type PremultiplyOptions ¶ added in v2.17.0
type PremultiplyOptions struct {
MaxAlpha *float64
}
PremultiplyOptions are optional parameters for premultiply.
type QuadraticOptions ¶ added in v2.17.0
type QuadraticOptions struct {
Interpolate *C.VipsInterpolate
}
QuadraticOptions are optional parameters for quadratic.
type ReduceOptions ¶ added in v2.17.0
ReduceOptions are optional parameters for reduce.
type ReducehOptions ¶ added in v2.17.0
ReducehOptions are optional parameters for reduceh.
type ReducevOptions ¶ added in v2.17.0
ReducevOptions are optional parameters for reducev.
type Rot45Options ¶ added in v2.17.0
type Rot45Options struct {
Angle *Angle45
}
Rot45Options are optional parameters for rot45.
type RotateOptions ¶ added in v2.17.0
type RotateOptions struct {
Interpolate *C.VipsInterpolate
Background []float64
Odx *float64
Ody *float64
Idx *float64
Idy *float64
}
RotateOptions are optional parameters for rotate.
type RuntimeStats ¶
RuntimeStats is a data structure to house a map of govips operation counts
type ScRGB2BWOptions ¶ added in v2.17.0
type ScRGB2BWOptions struct {
Depth *int
}
ScRGB2BWOptions are optional parameters for scRGB2BW.
type ScRGB2sRGBOptions ¶ added in v2.17.0
type ScRGB2sRGBOptions struct {
Depth *int
}
ScRGB2sRGBOptions are optional parameters for scRGB2sRGB.
type Scalar ¶
Scalar is the basic scalar measurement of an image's height, width or offset coordinate.
func (*Scalar) Get ¶
Get returns the value of the scalar. Either absolute, or if relative, multiplied by the base given as parameter.
func (*Scalar) GetRounded ¶
GetRounded returns the value of the associated Scalar, rounded to the nearest integer, if absolute. If the Scalar is relative, it will be multiplied by the supplied base parameter.
type ScaleOptions ¶ added in v2.17.0
ScaleOptions are optional parameters for scale.
type SequentialOptions ¶ added in v2.17.0
type SequentialOptions struct {
TileHeight *int
}
SequentialOptions are optional parameters for sequential.
type SharpenOptions ¶ added in v2.17.0
type SharpenOptions struct {
Sigma *float64
X1 *float64
Y2 *float64
Y3 *float64
M1 *float64
M2 *float64
}
SharpenOptions are optional parameters for sharpen.
type ShrinkOptions ¶ added in v2.17.0
type ShrinkOptions struct {
Ceil *bool
}
ShrinkOptions are optional parameters for shrink.
type ShrinkhOptions ¶ added in v2.17.0
type ShrinkhOptions struct {
Ceil *bool
}
ShrinkhOptions are optional parameters for shrinkh.
type ShrinkvOptions ¶ added in v2.17.0
type ShrinkvOptions struct {
Ceil *bool
}
ShrinkvOptions are optional parameters for shrinkv.
type SimilarityOptions ¶ added in v2.17.0
type SimilarityOptions struct {
Scale *float64
Angle *float64
Interpolate *C.VipsInterpolate
Background []float64
Odx *float64
Ody *float64
Idx *float64
Idy *float64
}
SimilarityOptions are optional parameters for similarity.
type SinesOptions ¶ added in v2.17.0
SinesOptions are optional parameters for sines.
type Size ¶ added in v2.9.0
type Size int
Size represents VipsSize type
const ( SizeBoth Size = C.VIPS_SIZE_BOTH SizeUp Size = C.VIPS_SIZE_UP SizeDown Size = C.VIPS_SIZE_DOWN SizeForce Size = C.VIPS_SIZE_FORCE SizeLast Size = C.VIPS_SIZE_LAST )
type SmartcropOptions ¶ added in v2.17.0
type SmartcropOptions struct {
Interesting *Interesting
Premultiplied *bool
}
SmartcropOptions are optional parameters for smartcrop.
type StdifOptions ¶ added in v2.17.0
StdifOptions are optional parameters for stdif.
type SubsampleMode ¶ added in v2.6.0
type SubsampleMode int
SubsampleMode correlates to a libvips subsample mode
const ( VipsForeignSubsampleAuto SubsampleMode = C.VIPS_FOREIGN_SUBSAMPLE_AUTO VipsForeignSubsampleOn SubsampleMode = C.VIPS_FOREIGN_SUBSAMPLE_ON VipsForeignSubsampleOff SubsampleMode = C.VIPS_FOREIGN_SUBSAMPLE_OFF VipsForeignSubsampleLast SubsampleMode = C.VIPS_FOREIGN_SUBSAMPLE_LAST )
SubsampleMode enum correlating to libvips subsample modes
type SubsampleOptions ¶ added in v2.17.0
type SubsampleOptions struct {
Point *bool
}
SubsampleOptions are optional parameters for subsample.
type TextParams ¶ added in v2.17.0
type TextWrap ¶ added in v2.17.0
type TextWrap int
const ( TextWrapWord TextWrap = C.VIPS_TEXT_WRAP_WORD TextWrapChar TextWrap = C.VIPS_TEXT_WRAP_CHAR TextWrapWordChar TextWrap = C.VIPS_TEXT_WRAP_WORD_CHAR TextWrapNone TextWrap = C.VIPS_TEXT_WRAP_NONE )
TextWrap enum
type TiffCompression ¶ added in v2.4.0
type TiffCompression int
TiffCompression represents method for compressing a tiff at export
const ( TiffCompressionNone TiffCompression = C.VIPS_FOREIGN_TIFF_COMPRESSION_NONE TiffCompressionJpeg TiffCompression = C.VIPS_FOREIGN_TIFF_COMPRESSION_JPEG TiffCompressionDeflate TiffCompression = C.VIPS_FOREIGN_TIFF_COMPRESSION_DEFLATE TiffCompressionPackbits TiffCompression = C.VIPS_FOREIGN_TIFF_COMPRESSION_PACKBITS TiffCompressionFax4 TiffCompression = C.VIPS_FOREIGN_TIFF_COMPRESSION_CCITTFAX4 TiffCompressionLzw TiffCompression = C.VIPS_FOREIGN_TIFF_COMPRESSION_LZW TiffCompressionWebp TiffCompression = C.VIPS_FOREIGN_TIFF_COMPRESSION_WEBP TiffCompressionZstd TiffCompression = C.VIPS_FOREIGN_TIFF_COMPRESSION_ZSTD )
TiffCompression enum
type TiffExportParams ¶ added in v2.4.0
type TiffExportParams struct {
StripMetadata bool
Quality int
Compression TiffCompression
Predictor TiffPredictor
Pyramid bool
Tile bool
TileHeight int
TileWidth int
}
TiffExportParams are options when exporting a TIFF to file or buffer
func NewTiffExportParams ¶ added in v2.4.0
func NewTiffExportParams() *TiffExportParams
NewTiffExportParams creates default values for an export of a TIFF image.
type TiffPredictor ¶ added in v2.5.0
type TiffPredictor int
TiffPredictor represents method for compressing a tiff at export
const ( TiffPredictorNone TiffPredictor = C.VIPS_FOREIGN_TIFF_PREDICTOR_NONE TiffPredictorHorizontal TiffPredictor = C.VIPS_FOREIGN_TIFF_PREDICTOR_HORIZONTAL TiffPredictorFloat TiffPredictor = C.VIPS_FOREIGN_TIFF_PREDICTOR_FLOAT )
TiffPredictor enum
type TilecacheOptions ¶ added in v2.17.0
type TilecacheOptions struct {
TileWidth *int
TileHeight *int
MaxTiles *int
Access *int
Threaded *bool
Persistent *bool
}
TilecacheOptions are optional parameters for tilecache.
type TonelutOptions ¶ added in v2.17.0
type TonelutOptions struct {
InMax *int
OutMax *int
Lb *float64
Lw *float64
Ps *float64
Pm *float64
Ph *float64
S *float64
M *float64
H *float64
}
TonelutOptions are optional parameters for tonelut.
type Transpose3dOptions ¶ added in v2.17.0
type Transpose3dOptions struct {
PageHeight *int
}
Transpose3dOptions are optional parameters for transpose3d.
type UnpremultiplyOptions ¶ added in v2.17.0
UnpremultiplyOptions are optional parameters for unpremultiply.
type WebpExportParams ¶ added in v2.4.0
type WebpExportParams struct {
StripMetadata bool
Quality int
Lossless bool
NearLossless bool
ReductionEffort int
IccProfile string
MinSize bool
MinKeyFrames int
MaxKeyFrames int
}
WebpExportParams are options when exporting a WEBP to file or buffer see https://www.libvips.org/API/current/VipsForeignSave.html#vips-webpsave for details on each parameter
func NewWebpExportParams ¶ added in v2.4.0
func NewWebpExportParams() *WebpExportParams
NewWebpExportParams creates default values for an export of a WEBP image. By default, govips creates lossy images with a quality of 75/100.
type WorleyOptions ¶ added in v2.17.0
WorleyOptions are optional parameters for worley.
type WrapOptions ¶ added in v2.17.0
WrapOptions are optional parameters for wrap.
type XYZ2LabOptions ¶ added in v2.17.0
type XYZ2LabOptions struct {
Temp []float64
}
XYZ2LabOptions are optional parameters for XYZ2Lab.
type XyzOptions ¶ added in v2.17.0
XyzOptions are optional parameters for xyz.
type ZoneOptions ¶ added in v2.17.0
type ZoneOptions struct {
Uchar *bool
}
ZoneOptions are optional parameters for zone.