Documentation
¶
Index ¶
- Constants
- func DefaultInit()
- func Error() error
- func ForeignFindLoad(filename string) string
- func ForeignFindLoadBuffer(data []byte) string
- func Free(in *Image)
- func Init() (err error)
- func LeakSet(leak bool)
- func ProgressSet(progress bool)
- func Shutdown()
- func Version(flag int) int
- func VersionString() string
- type Angle
- type BlendMode
- type CompassDirection
- type Direction
- type Image
- func AnalyzeLoad(filename string) (out *Image, err error)
- func Black(width, height int) (out *Image, err error)
- func CSVLoad(filename string) (out *Image, err error)
- func Eye(width, height int) (out *Image, err error)
- func FITSLoad(filename string) (out *Image, err error)
- func FractSurf(width, height int, fractalDimension float64) (out *Image, err error)
- func GIFLoad(filename string) (out *Image, err error)
- func GIFLoadBuffer(buf []byte) (out *Image, err error)
- func GaussMat(sigma, minAmpl float64) (out *Image, err error)
- func GaussNoise(width, height int) (out *Image, err error)
- func Grey(width, height int) (out *Image, err error)
- func HEIFLoad(filename string) (out *Image, err error)
- func HEIFLoadBuffer(buf []byte) (out *Image, err error)
- func Identity() (out *Image, err error)
- func JPEGLoad(filename string) (out *Image, err error)
- func JPEGLoadBuffer(buf []byte) (out *Image, err error)
- func Load(filename string) (out *Image, err error)
- func LogMat(sigma, minAmpl float64) (out *Image, err error)
- func MagickLoad(filename string) (out *Image, err error)
- func MagickLoadBuffer(buf []byte) (out *Image, err error)
- func MaskButterWorth(width, height int, order, frequencyCutoff, amplitudeCutoff float64) (out *Image, err error)
- func MaskButterWorthBand(width, height int, ...) (out *Image, err error)
- func MaskButterWorthRing(width, height int, order, frequencyCutoff, amplitudeCutoff, ringWidth float64) (out *Image, err error)
- func MaskFractal(width, height int, fractalDimension float64) (out *Image, err error)
- func MaskGaussian(width, height int, frequencyCutoff, amplitudeCutoff float64) (out *Image, err error)
- func MaskGaussianBand(width, height int, ...) (out *Image, err error)
- func MaskGaussianRing(width, height int, frequencyCutoff, amplitudeCutoff, ringWidth float64) (out *Image, err error)
- func MaskIdeal(width, height int, frequencyCutoff float64) (out *Image, err error)
- func MaskIdealBand(width, height int, frequencyCutoffX, frequencyCutoffY, radius float64) (out *Image, err error)
- func MaskIdealRing(width, height int, frequencyCutoff, ringWidth float64) (out *Image, err error)
- func MatLoad(filename string) (out *Image, err error)
- func MatrixLoad(filename string) (out *Image, err error)
- func NIFTILoad(filename string) (out *Image, err error)
- func New() *Image
- func NewFromBuffer(buf []byte, optionString string) *Image
- func NewFromFile(filename string) (out *Image, err error)
- func NewMemory() *Image
- func OpenEXRLoad(filename string) (out *Image, err error)
- func OpenSlideLoad(filename string) (out *Image, err error)
- func PDFLoad(filename string) (out *Image, err error)
- func PDFLoadBuffer(buf []byte) (out *Image, err error)
- func PNGLoad(filename string) (out *Image, err error)
- func PNGLoadBuffer(buf []byte) (out *Image, err error)
- func PPMLoad(filename string) (out *Image, err error)
- func Perlin(width, height int) (out *Image, err error)
- func RADLoad(filename string) (out *Image, err error)
- func RawLoad(filename string, width, height, bands int) (out *Image, err error)
- func SVGLoad(filename string) (out *Image, err error)
- func SVGLoadBuffer(buf []byte) (out *Image, err error)
- func Sines(width, height int) (out *Image, err error)
- func TIFFLoad(filename string) (out *Image, err error)
- func TIFFLoadBuffer(buf []byte) (out *Image, err error)
- func Text(text string) (out *Image, err error)
- func Thumbnail(filename string, width int) (out *Image, err error)
- func ThumbnailBuffer(buf []byte, width int) (out *Image, err error)
- func ToneLut() (out *Image, err error)
- func WEBPLoad(filename string) (out *Image, err error)
- func WEBPLoadBuffer(buf []byte) (out *Image, err error)
- func Worley(width, height int) (out *Image, err error)
- func Xyz(width, height int) (out *Image, err error)
- func Zone(width, height int) (out *Image, err error)
- func (th *Image) AutoRot() (err error)
- func (th *Image) BuildLut() (err error)
- func (th *Image) CSVSave(filename string) (err error)
- func (th *Image) Composite()
- func (th *Image) Composite2(overlay *Image, mode BlendMode, point image.Point) (err error)
- func (th *Image) Copy() (out *Image, err error)
- func (th *Image) Crop(left, top, width, height int) (err error)
- func (th *Image) DZSave(filename string) (err error)
- func (th *Image) DrawCircle(ink []float64, cx, cy, radius int) (err error)
- func (th *Image) DrawCircle1(ink float64, cx, cy, radius int) (err error)
- func (th *Image) DrawFlood(ink []float64, x, y int) (err error)
- func (th *Image) DrawFlood1(ink float64, x, y int) (err error)
- func (th *Image) DrawImage(sub *Image, x, y int) (err error)
- func (th *Image) DrawLine(ink []float64, x1, y1, x2, y2 int) (err error)
- func (th *Image) DrawLine1(ink float64, x1, y1, x2, y2 int) (err error)
- func (th *Image) DrawMask(ink []float64, mask *Image, x, y int) (err error)
- func (th *Image) DrawMask1(ink float64, mask *Image, x, y int) (err error)
- func (th *Image) DrawPoint(ink []float64, x, y int) (err error)
- func (th *Image) DrawPoint1(ink float64, x, y int) (err error)
- func (th *Image) DrawRect(ink []float64, left, top, width, height int) (err error)
- func (th *Image) DrawRect1(ink float64, left, top, width, height int) (err error)
- func (th *Image) DrawSmudge(left, top, width, height int) (err error)
- func (th *Image) Embed(x, y, width, height int) (err error)
- func (th *Image) ExtractArea(left, top, width, height int) (err error)
- func (th *Image) ExtractBand(band int) (err error)
- func (th *Image) FITSSave(filename string) (err error)
- func (th *Image) Flip(direction Direction) (err error)
- func (th *Image) FormatSizeof()
- func (th *Image) Free()
- func (th *Image) FreqMult(mask *Image) (err error)
- func (th *Image) FwFFT() (err error)
- func (th *Image) GlobalBalance() (err error)
- func (th *Image) Gravity(direction CompassDirection, width, height int) (err error)
- func (th *Image) Grid(tileHeight, across, down int) (err error)
- func (th *Image) HEIFSave(filename string) (err error)
- func (th *Image) HEIFSaveBuffer() (buf []byte, size int, err error)
- func (th *Image) Height() int
- func (th *Image) ImageSetProgress(progress bool)
- func (th *Image) InvFFT() (err error)
- func (th *Image) InvertLut() (err error)
- func (th *Image) JPEGSave(filename string) (err error)
- func (th *Image) JPEGSaveBuffer() (buf []byte, size int, err error)
- func (th *Image) JPEGSaveMime() (err error)
- func (th *Image) MagickSave(filename string) (err error)
- func (th *Image) MagickSaveBuffer() (buf []byte, size int, err error)
- func (th *Image) Match(sec *Image, xr1, yr1, xs1, ys1, xr2, yr2, xs2, ys2 int) (err error)
- func (th *Image) MatrixPrint() (err error)
- func (th *Image) MatrixSave(filename string) (err error)
- func (th *Image) Merge(sec *Image, direction Direction, dx, dy int) (err error)
- func (th *Image) Mosaic(sec *Image, direction Direction, xref, yref, xsec, ysec int) (err error)
- func (th *Image) Mosaic1(sec *Image, direction Direction, xr1, yr1, xs1, ys1, xr2, yr2, xs2, ys2 int) (err error)
- func (th *Image) NIFTISave(filename string) (err error)
- func (th *Image) PNGSave(filename string) (err error)
- func (th *Image) PNGSaveBuffer() (buf []byte, size int, err error)
- func (th *Image) PPMSave(filename string) (err error)
- func (th *Image) Phasecor(in *Image) (err error)
- func (th *Image) RADSave(filename string) (err error)
- func (th *Image) RADSaveBuffer() (buf []byte, size int, err error)
- func (th *Image) RawSave(filename string) (err error)
- func (th *Image) ReMosaic(oldStr, newStr string) (err error)
- func (th *Image) Replicate(across, down int) (err error)
- func (th *Image) Resize(scale float64) (err error)
- func (th *Image) Rotate(angle float64) (err error)
- func (th *Image) Save2file(filename string) (err error)
- func (th *Image) Scale() (err error)
- func (th *Image) SmartCrop(width, height int) (err error)
- func (th *Image) Spectrum() (err error)
- func (th *Image) SubSample(xFac, yFac int) (err error)
- func (th *Image) TIFFSave(filename string) (err error)
- func (th *Image) TIFFSaveBuffer() (buf []byte, size int, err error)
- func (th *Image) ThumbnailImage(width int) (err error)
- func (th *Image) WEBPSave(filename string) (err error)
- func (th *Image) WEBPSaveBuffer() (buf []byte, size int, err error)
- func (th *Image) WEBPSaveMime() (err error)
- func (th *Image) Width() int
- func (th *Image) Wrap() (err error)
- func (th *Image) Zoom(xFac, yFac int) (err error)
Constants ¶
const ( // DirectionCentre centre DirectionCentre = CompassDirection(C.VIPS_COMPASS_DIRECTION_CENTRE) // DirectionNorth notrh DirectionNorth = CompassDirection(C.VIPS_COMPASS_DIRECTION_NORTH) // DirectionEast east DirectionEast = CompassDirection(C.VIPS_COMPASS_DIRECTION_EAST) // DirectionSouth south DirectionSouth = CompassDirection(C.VIPS_COMPASS_DIRECTION_SOUTH) // DirectionWest west DirectionWest = CompassDirection(C.VIPS_COMPASS_DIRECTION_WEST) // DirectionNorthEast north-east DirectionNorthEast = CompassDirection(C.VIPS_COMPASS_DIRECTION_NORTH_EAST) // DirectionSouthEast south-east DirectionSouthEast = CompassDirection(C.VIPS_COMPASS_DIRECTION_SOUTH_EAST) // DirectionSouthWest south-west DirectionSouthWest = CompassDirection(C.VIPS_COMPASS_DIRECTION_SOUTH_WEST) // DirectionNorthWest north-west DirectionNorthWest = CompassDirection(C.VIPS_COMPASS_DIRECTION_NORTH_WEST) )
const ( // BlendModeClear where the second object is drawn, the first is removed BlendModeClear = BlendMode(C.VIPS_BLEND_MODE_CLEAR) // BlendModeSource the second object is drawn as if nothing were below BlendModeSource = BlendMode(C.VIPS_BLEND_MODE_SOURCE) // BlendModeOver the image shows what you would expect if you held two semi-transparent slides on top of each other BlendModeOver = BlendMode(C.VIPS_BLEND_MODE_OVER) // BlendModeIn the first object is removed completely, the second is only drawn where the first was BlendModeIn = BlendMode(C.VIPS_BLEND_MODE_IN) // BlendModeOut the second is drawn only where the first isn't BlendModeOut = BlendMode(C.VIPS_BLEND_MODE_OUT) // BlendModeAtop this leaves the first object mostly intact, but mixes both objects in the overlapping area BlendModeAtop = BlendMode(C.VIPS_BLEND_MODE_ATOP) // BlendModeDest leaves the first object untouched, the second is discarded completely BlendModeDest = BlendMode(C.VIPS_BLEND_MODE_DEST) // BlendModeDestOver like OVER, but swaps the arguments BlendModeDestOver = BlendMode(C.VIPS_BLEND_MODE_DEST_OVER) // BlendModeDestIn like IN, but swaps the arguments BlendModeDestIn = BlendMode(C.VIPS_BLEND_MODE_DEST_IN) // BlendModeDestOut like OUT, but swaps the arguments BlendModeDestOut = BlendMode(C.VIPS_BLEND_MODE_DEST_OUT) // BlendModeDestAtop like ATOP, but swaps the arguments BlendModeDestAtop = BlendMode(C.VIPS_BLEND_MODE_DEST_ATOP) // BlendModeXor something like a difference operator BlendModeXor = BlendMode(C.VIPS_BLEND_MODE_XOR) // BlendModeAdd a bit like adding the two images BlendModeAdd = BlendMode(C.VIPS_BLEND_MODE_ADD) // BlendModeSaturate a bit like the darker of the two BlendModeSaturate = BlendMode(C.VIPS_BLEND_MODE_SATURATE) // BlendModeMultiply at least as dark as the darker of the two inputs BlendModeMultiply = BlendMode(C.VIPS_BLEND_MODE_MULTIPLY) // BlendModeScreen at least as light as the lighter of the inputs BlendModeScreen = BlendMode(C.VIPS_BLEND_MODE_SCREEN) // BlendModeOverlay multiplies or screens colors, depending on the lightness BlendModeOverlay = BlendMode(C.VIPS_BLEND_MODE_OVERLAY) // BlendModeDarken the darker of each component BlendModeDarken = BlendMode(C.VIPS_BLEND_MODE_DARKEN) // BlendModeLighten the lighter of each component BlendModeLighten = BlendMode(C.VIPS_BLEND_MODE_LIGHTEN) // BlendModeColourDodge brighten first by a factor second BlendModeColourDodge = BlendMode(C.VIPS_BLEND_MODE_COLOUR_DODGE) // BlendModeColourBurn darken first by a factor of second BlendModeColourBurn = BlendMode(C.VIPS_BLEND_MODE_COLOUR_BURN) // BlendModeHardLight multiply or screen, depending on lightness BlendModeHardLight = BlendMode(C.VIPS_BLEND_MODE_HARD_LIGHT) // BlendModeSoftLight darken or lighten, depending on lightness BlendModeSoftLight = BlendMode(C.VIPS_BLEND_MODE_SOFT_LIGHT) // BlendModeDifference difference of the two BlendModeDifference = BlendMode(C.VIPS_BLEND_MODE_DIFFERENCE) // BlendModeExclusion somewhat like DIFFERENCE, but lower-contrast BlendModeExclusion = BlendMode(C.VIPS_BLEND_MODE_EXCLUSION) )
const ( // AngleD0 no rotate AngleD0 = Angle(C.VIPS_ANGLE_D0) // AngleD90 90 degrees clockwise AngleD90 = Angle(C.VIPS_ANGLE_D90) // AngleD180 180 degree rotate AngleD180 = Angle(C.VIPS_ANGLE_D180) // AngleD270 90 degrees anti-clockwise AngleD270 = Angle(C.VIPS_ANGLE_D270) )
const ( // DirectionHorizontal left-right DirectionHorizontal = Direction(C.VIPS_DIRECTION_HORIZONTAL) // DirectionVertical top-bottom DirectionVertical = Direction(C.VIPS_DIRECTION_VERTICAL) )
Variables ¶
This section is empty.
Functions ¶
func Error ¶
func Error() error
Error Get a pointer to the start of the error buffer as a C string. The string is owned by the error system and must not be freed.
func ForeignFindLoad ¶
ForeignFindLoad searches for an operation you could use to load filename. Any trailing options on filename are stripped and ignored.
func ForeignFindLoadBuffer ¶
ForeignFindLoadBuffer searches for an operation you could use to load a memory buffer.
func ProgressSet ¶
func ProgressSet(progress bool)
ProgressSet ff set, vips will print messages about the progress of computation to stdout. This can also be enabled with the --vips-progress option, or by setting the environment variable VIPS_PROGRESS.
func Shutdown ¶
func Shutdown()
Shutdown drop caches and close plugins. Run with "--vips-leak" to do a leak check too.
func VersionString ¶
func VersionString() string
VersionString get the VIPS version as a static string, including a build date and time. Do not free.
Types ¶
type BlendMode ¶
type BlendMode int
BlendMode The various Porter-Duff and PDF blend modes. See vips_composite(), for example. The Cairo docs have a nice explanation of all the blend modes:
https://www.cairographics.org/operators The non-separable modes are not implemented.
type Direction ¶
type Direction int
Direction Operations like Flip() need to be told whether to flip left-right or top-bottom.
type Image ¶
type Image struct {
// contains filtered or unexported fields
}
Image wrap *C.VipsImage to go
func AnalyzeLoad ¶
AnalyzeLoad load an Analyze 6.0 file. If filename is "fred.img", this will look for an image header called "fred.hdr" and pixel data in "fred.img". You can also load "fred" or "fred.hdr".
func CSVLoad ¶
CSVLoad load a CSV (comma-separated values) file. The output image is always 1 band (monochrome), VIPS_FORMAT_DOUBLE. Use BandFold() to turn RGBRGBRGB mono images into colour iamges."fred.img". You can also load "fred" or "fred.hdr".
func FractSurf ¶
FractSurf Generate an image of size width by height and fractal dimension fractalDimension. The dimension should be between 2 and 3.
func GIFLoad ¶
GIFLoad render a GIF file into a VIPS image. Rendering uses the librgif library and should be fast.
func GIFLoadBuffer ¶
GIFLoadBuffer read a GIF-formatted memory block into a VIPS image. Exactly as GIFLoad, but read from a memory buffer.
func GaussMat ¶
GaussMat Creates a circularly symmetric Gaussian image of radius sigma. The size of the mask is determined by the variable minAmpl ; if for instance the value .1 is entered this means that the produced mask is clipped at values less than 10 percent of the maximum amplitude.
func GaussNoise ¶
GaussNoise make a one band float image of gaussian noise with the specified distribution. The noise distribution is created by averaging 12 random numbers with the appropriate weights.
func Grey ¶
Grey create a one-band float image with the left-most column zero and the right-most 1. Intermediate pixels are a linear ramp.
func HEIFLoadBuffer ¶
HEIFLoadBuffer read a HEIF-formatted memory block into a VIPS image. Exactly as HEIFLoad, but read from a memory buffer.
func Identity ¶
Identity creates an identity lookup table. ie. one which will leave an image unchanged when applied with Maplut(). Each entry in the table has a value equal to its position.
func JPEGLoad ¶
JPEGLoad read a JPEG file into a VIPS image. It can read most 8-bit JPEG images, including CMYK and YCbCr.
func JPEGLoadBuffer ¶
JPEGLoadBuffer read a JPEG-formatted memory block into a VIPS image. Exactly as JPEGLoad, but read from a memory buffer.
func LogMat ¶
LogMat creates a circularly symmetric Laplacian of Gaussian mask of radius sigma. The size of the mask is determined by the variable min_ampl ; if for instance the value .1 is entered this means that the produced mask is clipped at values within 10 persent of zero, and where the change between mask elements is less than 10%.
func MagickLoad ¶
MagickLoad read in an image using libMagick, the ImageMagick library. This library can read more than 80 file formats, including SVG, BMP, EPS, DICOM and many others. The reader can handle any ImageMagick image, including the float and double formats. It will work with any quantum size, including HDR. Any metadata attached to the libMagick image is copied on to the VIPS image.
func MagickLoadBuffer ¶
MagickLoadBuffer read a Magick-formatted memory block into a VIPS image. Exactly as MagickLoad, but read from a memory buffer.
func MaskButterWorth ¶
func MaskButterWorth(width, height int, order, frequencyCutoff, amplitudeCutoff float64) (out *Image, err error)
MaskButterWorth make an butterworth high- or low-pass filter, that is, one with a variable, smooth transition positioned at frequency_cutoff , where frequency_cutoff is in range 0 - 1. The shape of the curve is controlled by order --- higher values give a sharper transition. See Gonzalez and Wintz, Digital Image Processing, 1987.
func MaskButterWorthBand ¶
func MaskButterWorthBand(width, height int, order, frequencyCutoffX, frequencyCutoffY, radius, amplitudeCutoff float64) (out *Image, err error)
MaskButterWorthBand make an butterworth band-pass or band-reject filter, that is, one with a variable, smooth transition positioned at frequencyCutoffX, frequencyCutoffY , of radius radius . The shape of the curve is controlled by order --- higher values give a sharper transition. See Gonzalez and Wintz, Digital Image Processing, 1987.
func MaskButterWorthRing ¶
func MaskButterWorthRing(width, height int, order, frequencyCutoff, amplitudeCutoff, ringWidth float64) (out *Image, err error)
MaskButterWorthRing Make a butterworth ring-pass or ring-reject filter, that is, one with a variable, smooth transition positioned at frequencyCutoff of width width , where frequencyCutoff is in the range 0 - 1. The shape of the curve is controlled by order --- higher values give a sharper transition. See Gonzalez and Wintz, Digital Image Processing, 1987.
func MaskFractal ¶
MaskFractal operation should be used to create fractal images by filtering the power spectrum of Gaussian white noise. See GaussNoise().
func MaskGaussian ¶
func MaskGaussian(width, height int, frequencyCutoff, amplitudeCutoff float64) (out *Image, err error)
MaskGaussian Make a gaussian high- or low-pass filter, that is, one with a variable, smooth transition positioned at frequencyCutoff .
func MaskGaussianBand ¶
func MaskGaussianBand(width, height int, frequencyCutoffX, frequencyCutoffY, radius, amplitudeCutoff float64) (out *Image, err error)
MaskGaussianBand Make a gaussian band-pass or band-reject filter, that is, one with a variable, smooth transition positioned at frequencyCutoffX, frequencyCutoffY, of radius radius.
func MaskGaussianRing ¶
func MaskGaussianRing(width, height int, frequencyCutoff, amplitudeCutoff, ringWidth float64) (out *Image, err error)
MaskGaussianRing Make a gaussian ring-pass or ring-reject filter, that is, one with a variable, smooth transition positioned at frequencyCutoff of width ringWidth .
func MaskIdeal ¶
MaskIdeal Make an ideal high- or low-pass filter, that is, one with a sharp cutoff positioned at frequencyCutoff , where frequencyCutoff is in the range 0 - 1.
func MaskIdealBand ¶
func MaskIdealBand(width, height int, frequencyCutoffX, frequencyCutoffY, radius float64) (out *Image, err error)
MaskIdealBand make an ideal band-pass or band-reject filter, that is, one with a sharp cutoff around the point frequencyCutoffX, frequencyCutoffY of size radius .
func MaskIdealRing ¶
MaskIdealRing make an ideal ring-pass or ring-reject filter, that is, one with a sharp ring positioned at frequency_cutoff of width width , where frequencyCutoff and width are expressed as the range 0 - 1.
func MatrixLoad ¶
MatrixLoad reads a matrix from a file.
func NewFromBuffer ¶
NewFromBuffer loads an image from the formatted area of memory buf.
func NewFromFile ¶
NewFromFile opens filename for reading. It can load files in many image formats, including VIPS, TIFF, PNG, JPEG, FITS, Matlab, OpenEXR, CSV, WebP, Radiance, RAW, PPM and others.
func NewMemory ¶
func NewMemory() *Image
NewMemory creates a new VipsImage. when written to, will create a memory image.
func OpenEXRLoad ¶
OpenEXRLoad read a OpenEXR file into a VIPS image.
func OpenSlideLoad ¶
OpenSlideLoad Read a virtual slide supported by the OpenSlide library into a VIPS image. OpenSlide supports images in Aperio, Hamamatsu, MIRAX, Sakura, Trestle, and Ventana formats.
func PDFLoad ¶
PDFLoad read a PDF-formatted memory buffer into a VIPS image. Exactly as vips_pdfload(), but read from memory.
func PDFLoadBuffer ¶
PDFLoadBuffer read a PDF-formatted memory block into a VIPS image. Exactly as PDFLoad, but read from a memory buffer.
func PNGLoad ¶
PNGLoad read a PNG-formatted memory block into a VIPS image. It can read all png images, including 8- and 16-bit images, 1 and 3 channel, with and without an alpha channel.
func PNGLoadBuffer ¶
PNGLoadBuffer read a PNG-formatted memory block into a VIPS image. Exactly as PNGLoad, but read from a memory buffer.
func RawLoad ¶
RawLoad mmaps the file, setting up out so that access to that image will read from the file.
func SVGLoad ¶
SVGLoad render a SVG file into a VIPS image. Rendering uses the librsvg library and should be fast.
func SVGLoadBuffer ¶
SVGLoadBuffer read a SVG-formatted memory block into a VIPS image. Exactly as SVGLoad, but read from a memory buffer.
func TIFFLoad ¶
TIFFLoad read a TIFF file into a VIPS image. It is a full baseline TIFF 6 reader, with extensions for tiled images, multipage images, LAB colour space, pyramidal images and JPEG compression. including CMYK and YCbCr.
func TIFFLoadBuffer ¶
TIFFLoadBuffer read a TIFF-formatted memory block into a VIPS image. Exactly as TIFFLoad, but read from a memory buffer.
func Text ¶
Text draw the string text to an image. out is a one-band 8-bit unsigned char image, with 0 for no text and 255 for text. Values between are used for anti-aliasing.
func ThumbnailBuffer ¶
ThumbnailBuffer Make a thumbnail from []byte
func ToneLut ¶
ToneLut generates a tone curve for the adjustment of image levels. It is mostly designed for adjusting the L* part of a LAB image in a way suitable for print work, but you can use it for other things too.
func WEBPLoadBuffer ¶
WEBPLoadBuffer read a WebP-formatted memory block into a VIPS image. Exactly as WEBPLoad, but read from a memory buffer.
func Xyz ¶
Xyz Create 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.
You can make any image where the value of a pixel is a function of its (x, y) coordinate by combining this operator with the arithmetic operators.
func (*Image) AutoRot ¶
AutoRot look at the image metadata and rotate the image to make it upright. Note:
vips only supports the four simple rotations, it does not support the various mirror modes. If the image is using one of these mirror modes, the image is not rotated and the VIPS_META_ORIENTATION tag is not removed.
func (*Image) BuildLut ¶
BuildLut this operation builds a lookup table from a set of points. Intermediate values are generated by piecewise linear interpolation
func (*Image) Composite2 ¶
Composite2 composite overlay on top of base with mode. See Composite.
func (*Image) Copy ¶
Copy an image, optionally modifying the header. VIPS copies images by copying pointers, so this operation is instant, even for very large images.
func (*Image) DZSave ¶
DZSave save an image as a set of tiles at various resolutions. By default dzsave uses DeepZoom layout -- use layout to pick other conventions.
func (*Image) DrawCircle ¶
DrawCircle Draws a circle on image. If fill is TRUE then the circle is filled, otherwise a 1-pixel-wide perimeter is drawn.
func (*Image) DrawCircle1 ¶
DrawCircle1 as DrawCircle, but just take a single double for ink.
func (*Image) DrawFlood ¶
DrawFlood flood-fill image with ink, starting at position x , y. The filled area is bounded by pixels that are equal to the ink colour, in other words, it searches for pixels enclosed by an edge of ink .
func (*Image) DrawFlood1 ¶
DrawFlood1 as DrawFlood, but just take a single double for ink.
func (*Image) DrawMask ¶
DrawMask draw mask on the image. mask is a monochrome 8-bit image with 0/255 for transparent or ink coloured points. Intermediate values blend the ink with the pixel. Use with Text() to draw text on an image. Use in a DrawLine() subclass to draw an object along a line.
func (*Image) DrawPoint1 ¶
DrawPoint1 as DrawPoint, but just take a single float64 for ink.
func (*Image) DrawRect ¶
DrawRect paint pixels within left , top , width , height in image with ink. If fill is zero, just paint a 1-pixel-wide outline.
func (*Image) DrawSmudge ¶
DrawSmudge smudge a section of image. Each pixel in the area left , top , width , height is replaced by the average of the surrounding 3x3 pixels.
func (*Image) ExtractArea ¶
ExtractArea extract an area from an image. The area must fit within *Image.
func (*Image) ExtractBand ¶
ExtractBand extract a band or bands from an image. Extracting out of range is an error.
func (*Image) FreqMult ¶
FreqMult transformed to Fourier space, multipled with mask, then transformed back to real space. If in is already a complex image, just multiply then inverse transform.
func (*Image) FwFFT ¶
FwFFT transform an image to Fourier space. VIPS uses the fftw Fourier Transform library. If this library was not available when VIPS was configured, these functions will fail.
func (*Image) GlobalBalance ¶
GlobalBalance can be used to remove contrast differences in an assembled mosaic.
func (*Image) Gravity ¶
func (th *Image) Gravity(direction CompassDirection, width, height int) (err error)
Gravity place in within an image of size width by height at a certain gravity.
func (*Image) Grid ¶
Grid chop a tall thin image up into a set of tiles, lay the tiles out in a grid.
func (*Image) HEIFSaveBuffer ¶
HEIFSaveBuffer as HEIFSave, but save to a memory buffer.
func (*Image) ImageSetProgress ¶
ImageSetProgress vips signals evaluation progress via the “preeval”, “eval” and “posteval” signals. Progress is signalled on the most-downstream image for which vips_image_set_progress() was called.
func (*Image) InvFFT ¶
InvFFT transform an image from Fourier space to real space. The result is complex.
func (*Image) InvertLut ¶
InvertLut given a mask of target values and real values, generate a LUT which will map reals to targets. Handy for linearising images from measurements of a colour chart. All values in [0,1]. Piecewise linear interpolation, extrapolate head and tail to 0 and 1.
func (*Image) JPEGSaveBuffer ¶
JPEGSaveBuffer as JPEGSave, but save to a memory buffer.
func (*Image) JPEGSaveMime ¶
JPEGSaveMime As JPEGSave, but save as a mime jpeg on stdout.
func (*Image) MagickSave ¶
MagickSave write a VIPS image to a file as Magick.
func (*Image) MagickSaveBuffer ¶
MagickSaveBuffer as MagickSave, but save to a memory buffer.
func (*Image) MatrixPrint ¶
MatrixPrint print in to stdout in matrix format. See MatrixLoad for a description of the format.
func (*Image) MatrixSave ¶
MatrixSave write a VIPS image to a file as Matrix.
func (*Image) Merge ¶
Merge joins two images left-right (with ref on the left) or up-down (with ref above) with a smooth seam.
func (*Image) Mosaic ¶
Mosaic joins two images left-right (with ref on the left) or top-bottom (with ref above) given an approximate overlap.
func (*Image) Mosaic1 ¶
func (th *Image) Mosaic1(sec *Image, direction Direction, xr1, yr1, xs1, ys1, xr2, yr2, xs2, ys2 int) (err error)
Mosaic1 This operation joins two images top-bottom (with sec on the right) or left-right (with sec at the bottom) given an approximate pair of tie-points. sec is scaled and rotated as necessary before the join.
func (*Image) PNGSaveBuffer ¶
PNGSaveBuffer as PNGSave, but save to a memory buffer.
func (*Image) Phasecor ¶
Phasecor convert the two input images to Fourier space, calculate phase-correlation, back to real space.
func (*Image) RADSaveBuffer ¶
RADSaveBuffer as RADSave, but save to a memory buffer.
func (*Image) ReMosaic ¶
ReMosaic takes apart the mosaiced image in and rebuilds it, substituting images. todo failed: class "remosaic" not found
func (*Image) Replicate ¶
Replicate repeats an image many times. across: repeat input this many times across down: repeat input this many times down
func (*Image) Scale ¶
Scale search the image for the maximum and minimum value, then return the image as unsigned 8-bit, scaled so that the maximum value is 255 and the minimum is zero.
func (*Image) SmartCrop ¶
SmartCrop crop an image down to a specified width and height by removing boring parts.
func (*Image) SubSample ¶
SubSample an image by an integer fraction. This is fast, nearest-neighbour shrink.
func (*Image) TIFFSaveBuffer ¶
TIFFSaveBuffer as TIFFSave, but save to a memory buffer.
func (*Image) ThumbnailImage ¶
ThumbnailImage Make a thumbnail from *Image
func (*Image) WEBPSaveBuffer ¶
WEBPSaveBuffer as WEBPSave, but save to a memory buffer.
func (*Image) WEBPSaveMime ¶
WEBPSaveMime As WEBPSave, but save as a mime webp on stdout.