//------------------------------------------------------------------------------ // // This code was generated by a tool. // libvips version: 8.17.0 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // //------------------------------------------------------------------------------ using System.IO; namespace NetVips; public partial class Image { #region auto-generated functions /// /// Absolute value of an image. /// /// /// /// using Image @out = in.Abs(); /// /// /// A new . public Image Abs() { return this.Call("abs") as Image; } /// /// Add two images. /// /// /// /// using Image @out = left.Add(right); /// /// /// Right-hand image argument. /// A new . public Image Add(Image right) { return this.Call("add", right) as Image; } /// /// Affine transform of an image. /// /// /// /// using Image @out = in.Affine(matrix, interpolate: GObject, oarea: int[], odx: double, ody: double, idx: double, idy: double, background: double[], premultiplied: bool, extend: Enums.Extend); /// /// /// Transformation matrix. /// Interpolate pixels with this. /// Area of output to generate. /// Horizontal output displacement. /// Vertical output displacement. /// Horizontal input displacement. /// Vertical input displacement. /// Background value. /// Images have premultiplied alpha. /// How to generate the extra pixels. /// A new . public Image Affine(double[] matrix, GObject interpolate = null, int[] oarea = null, double? odx = null, double? ody = null, double? idx = null, double? idy = null, double[] background = null, bool? premultiplied = null, Enums.Extend? extend = null) { var options = new VOption(); options.AddIfPresent(nameof(interpolate), interpolate); options.AddIfPresent(nameof(oarea), oarea); options.AddIfPresent(nameof(odx), odx); options.AddIfPresent(nameof(ody), ody); options.AddIfPresent(nameof(idx), idx); options.AddIfPresent(nameof(idy), idy); options.AddIfPresent(nameof(background), background); options.AddIfPresent(nameof(premultiplied), premultiplied); options.AddIfPresent(nameof(extend), extend); return this.Call("affine", options, matrix) as Image; } /// /// Load an Analyze6 image. /// /// /// /// using Image @out = NetVips.Image.Analyzeload(filename, memory: bool, access: Enums.Access, failOn: Enums.FailOn, revalidate: bool); /// /// /// Filename to load from. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// Don't use a cached result for this operation. /// A new . public static Image Analyzeload(string filename, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null, bool? revalidate = null) { var options = new VOption(); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.AddIfPresent(nameof(revalidate), revalidate); return Operation.Call("analyzeload", options, filename) as Image; } /// /// Load an Analyze6 image. /// /// /// /// using Image @out = NetVips.Image.Analyzeload(filename, out var flags, memory: bool, access: Enums.Access, failOn: Enums.FailOn, revalidate: bool); /// /// /// Filename to load from. /// Flags for this file. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// Don't use a cached result for this operation. /// A new . public static Image Analyzeload(string filename, out Enums.ForeignFlags flags, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null, bool? revalidate = null) { var options = new VOption(); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.AddIfPresent(nameof(revalidate), revalidate); options.Add("flags", true); var results = Operation.Call("analyzeload", options, filename) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; flags = (Enums.ForeignFlags)opts?["flags"]; return finalResult; } /// /// Join an array of images. /// /// /// /// using Image @out = NetVips.Image.Arrayjoin(@in, across: int, shim: int, background: double[], halign: Enums.Align, valign: Enums.Align, hspacing: int, vspacing: int); /// /// /// Array of input images. /// Number of images across grid. /// Pixels between images. /// Colour for new pixels. /// Align on the left, centre or right. /// Align on the top, centre or bottom. /// Horizontal spacing between images. /// Vertical spacing between images. /// A new . public static Image Arrayjoin(Image[] @in, int? across = null, int? shim = null, double[] background = null, Enums.Align? halign = null, Enums.Align? valign = null, int? hspacing = null, int? vspacing = null) { var options = new VOption(); options.AddIfPresent(nameof(across), across); options.AddIfPresent(nameof(shim), shim); options.AddIfPresent(nameof(background), background); options.AddIfPresent(nameof(halign), halign); options.AddIfPresent(nameof(valign), valign); options.AddIfPresent(nameof(hspacing), hspacing); options.AddIfPresent(nameof(vspacing), vspacing); return Operation.Call("arrayjoin", options, new object[] { @in }) as Image; } /// /// Autorotate image by exif tag. /// /// /// /// using Image @out = in.Autorot(); /// /// /// A new . public Image Autorot() { return this.Call("autorot") as Image; } /// /// Autorotate image by exif tag. /// /// /// /// using Image @out = in.Autorot(out var angle); /// /// /// Angle image was rotated by. /// A new . public Image Autorot(out Enums.Angle angle) { var optionalOutput = new VOption { {"angle", true} }; var results = this.Call("autorot", optionalOutput) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; angle = (Enums.Angle)opts?["angle"]; return finalResult; } /// /// Autorotate image by exif tag. /// /// /// /// using Image @out = in.Autorot(out var angle, out var flip); /// /// /// Angle image was rotated by. /// Whether the image was flipped or not. /// A new . public Image Autorot(out Enums.Angle angle, out bool flip) { var optionalOutput = new VOption { {"angle", true}, {"flip", true} }; var results = this.Call("autorot", optionalOutput) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; angle = (Enums.Angle)opts?["angle"]; flip = opts?["flip"] is bool out2 && out2; return finalResult; } /// /// Find image average. /// /// /// /// double @out = in.Avg(); /// /// /// A double. public double Avg() { return this.Call("avg") is double result ? result : 0d; } /// /// Boolean operation across image bands. /// /// /// /// using Image @out = in.Bandbool(boolean); /// /// /// Boolean to perform. /// A new . public Image Bandbool(Enums.OperationBoolean boolean) { return this.Call("bandbool", boolean) as Image; } /// /// Fold up x axis into bands. /// /// /// /// using Image @out = in.Bandfold(factor: int); /// /// /// Fold by this factor. /// A new . public Image Bandfold(int? factor = null) { var options = new VOption(); options.AddIfPresent(nameof(factor), factor); return this.Call("bandfold", options) as Image; } /// /// Append a constant band to an image. /// /// /// /// using Image @out = in.BandjoinConst(c); /// /// /// Array of constants to add. /// A new . public Image BandjoinConst(double[] c) { return this.Call("bandjoin_const", c) as Image; } /// /// Band-wise average. /// /// /// /// using Image @out = in.Bandmean(); /// /// /// A new . public Image Bandmean() { return this.Call("bandmean") as Image; } /// /// Unfold image bands into x axis. /// /// /// /// using Image @out = in.Bandunfold(factor: int); /// /// /// Unfold by this factor. /// A new . public Image Bandunfold(int? factor = null) { var options = new VOption(); options.AddIfPresent(nameof(factor), factor); return this.Call("bandunfold", options) as Image; } /// /// Make a black image. /// /// /// /// using Image @out = NetVips.Image.Black(width, height, bands: int); /// /// /// Image width in pixels. /// Image height in pixels. /// Number of bands in image. /// A new . public static Image Black(int width, int height, int? bands = null) { var options = new VOption(); options.AddIfPresent(nameof(bands), bands); return Operation.Call("black", options, width, height) as Image; } /// /// Boolean operation on two images. /// /// /// /// using Image @out = left.Boolean(right, boolean); /// /// /// Right-hand image argument. /// Boolean to perform. /// A new . public Image Boolean(Image right, Enums.OperationBoolean boolean) { return this.Call("boolean", right, boolean) as Image; } /// /// Boolean operations against a constant. /// /// /// /// using Image @out = in.BooleanConst(boolean, c); /// /// /// Boolean to perform. /// Array of constants. /// A new . public Image BooleanConst(Enums.OperationBoolean boolean, double[] c) { return this.Call("boolean_const", boolean, c) as Image; } /// /// Build a look-up table. /// /// /// /// using Image @out = in.Buildlut(); /// /// /// A new . public Image Buildlut() { return this.Call("buildlut") as Image; } /// /// Byteswap an image. /// /// /// /// using Image @out = in.Byteswap(); /// /// /// A new . public Image Byteswap() { return this.Call("byteswap") as Image; } /// /// Canny edge detector. /// /// /// /// using Image @out = in.Canny(sigma: double, precision: Enums.Precision); /// /// /// Sigma of Gaussian. /// Convolve with this precision. /// A new . public Image Canny(double? sigma = null, Enums.Precision? precision = null) { var options = new VOption(); options.AddIfPresent(nameof(sigma), sigma); options.AddIfPresent(nameof(precision), precision); return this.Call("canny", options) as Image; } /// /// Cast an image. /// /// /// /// using Image @out = in.Cast(format, shift: bool); /// /// /// Format to cast to. /// Shift integer values up and down. /// A new . public Image Cast(Enums.BandFormat format, bool? shift = null) { var options = new VOption(); options.AddIfPresent(nameof(shift), shift); return this.Call("cast", options, format) as Image; } /// /// Clamp values of an image. /// /// /// /// using Image @out = in.Clamp(min: double, max: double); /// /// /// Minimum value. /// Maximum value. /// A new . public Image Clamp(double? min = null, double? max = null) { var options = new VOption(); options.AddIfPresent(nameof(min), min); options.AddIfPresent(nameof(max), max); return this.Call("clamp", options) as Image; } /// /// Transform LCh to CMC. /// /// /// /// using Image @out = in.CMC2LCh(); /// /// /// A new . public Image CMC2LCh() { return this.Call("CMC2LCh") as Image; } /// /// Transform CMYK to XYZ. /// /// /// /// using Image @out = in.CMYK2XYZ(); /// /// /// A new . public Image CMYK2XYZ() { return this.Call("CMYK2XYZ") as Image; } /// /// Convert to a new colorspace. /// /// /// /// using Image @out = in.Colourspace(space, sourceSpace: Enums.Interpretation); /// /// /// Destination color space. /// Source color space. /// A new . public Image Colourspace(Enums.Interpretation space, Enums.Interpretation? sourceSpace = null) { var options = new VOption(); options.AddIfPresent("source_space", sourceSpace); return this.Call("colourspace", options, space) as Image; } /// /// Convolve with rotating mask. /// /// /// /// using Image @out = in.Compass(mask, times: int, angle: Enums.Angle45, combine: Enums.Combine, precision: Enums.Precision, layers: int, cluster: int); /// /// /// Input matrix image. /// Rotate and convolve this many times. /// Rotate mask by this much between convolutions. /// Combine convolution results like this. /// Convolve with this precision. /// Use this many layers in approximation. /// Cluster lines closer than this in approximation. /// A new . public Image Compass(Image mask, int? times = null, Enums.Angle45? angle = null, Enums.Combine? combine = null, Enums.Precision? precision = null, int? layers = null, int? cluster = null) { var options = new VOption(); options.AddIfPresent(nameof(times), times); options.AddIfPresent(nameof(angle), angle); options.AddIfPresent(nameof(combine), combine); options.AddIfPresent(nameof(precision), precision); options.AddIfPresent(nameof(layers), layers); options.AddIfPresent(nameof(cluster), cluster); return this.Call("compass", options, mask) as Image; } /// /// Perform a complex operation on an image. /// /// /// /// using Image @out = in.Complex(cmplx); /// /// /// Complex to perform. /// A new . public Image Complex(Enums.OperationComplex cmplx) { return this.Call("complex", cmplx) as Image; } /// /// Complex binary operations on two images. /// /// /// /// using Image @out = left.Complex2(right, cmplx); /// /// /// Right-hand image argument. /// Binary complex operation to perform. /// A new . public Image Complex2(Image right, Enums.OperationComplex2 cmplx) { return this.Call("complex2", right, cmplx) as Image; } /// /// Form a complex image from two real images. /// /// /// /// using Image @out = left.Complexform(right); /// /// /// Right-hand image argument. /// A new . public Image Complexform(Image right) { return this.Call("complexform", right) as Image; } /// /// Get a component from a complex image. /// /// /// /// using Image @out = in.Complexget(get); /// /// /// Complex to perform. /// A new . public Image Complexget(Enums.OperationComplexget get) { return this.Call("complexget", get) as Image; } /// /// Blend a pair of images with a blend mode. /// /// /// /// using Image @out = base.Composite2(overlay, mode, x: int, y: int, compositingSpace: Enums.Interpretation, premultiplied: bool); /// /// /// Overlay image. /// VipsBlendMode to join with. /// x position of overlay. /// y position of overlay. /// Composite images in this colour space. /// Images have premultiplied alpha. /// A new . public Image Composite2(Image overlay, Enums.BlendMode mode, int? x = null, int? y = null, Enums.Interpretation? compositingSpace = null, bool? premultiplied = null) { var options = new VOption(); options.AddIfPresent(nameof(x), x); options.AddIfPresent(nameof(y), y); options.AddIfPresent("compositing_space", compositingSpace); options.AddIfPresent(nameof(premultiplied), premultiplied); return this.Call("composite2", options, overlay, mode) as Image; } /// /// Convolution operation. /// /// /// /// using Image @out = in.Conv(mask, precision: Enums.Precision, layers: int, cluster: int); /// /// /// Input matrix image. /// Convolve with this precision. /// Use this many layers in approximation. /// Cluster lines closer than this in approximation. /// A new . public Image Conv(Image mask, Enums.Precision? precision = null, int? layers = null, int? cluster = null) { var options = new VOption(); options.AddIfPresent(nameof(precision), precision); options.AddIfPresent(nameof(layers), layers); options.AddIfPresent(nameof(cluster), cluster); return this.Call("conv", options, mask) as Image; } /// /// Approximate integer convolution. /// /// /// /// using Image @out = in.Conva(mask, layers: int, cluster: int); /// /// /// Input matrix image. /// Use this many layers in approximation. /// Cluster lines closer than this in approximation. /// A new . public Image Conva(Image mask, int? layers = null, int? cluster = null) { var options = new VOption(); options.AddIfPresent(nameof(layers), layers); options.AddIfPresent(nameof(cluster), cluster); return this.Call("conva", options, mask) as Image; } /// /// Approximate separable integer convolution. /// /// /// /// using Image @out = in.Convasep(mask, layers: int); /// /// /// Input matrix image. /// Use this many layers in approximation. /// A new . public Image Convasep(Image mask, int? layers = null) { var options = new VOption(); options.AddIfPresent(nameof(layers), layers); return this.Call("convasep", options, mask) as Image; } /// /// Float convolution operation. /// /// /// /// using Image @out = in.Convf(mask); /// /// /// Input matrix image. /// A new . public Image Convf(Image mask) { return this.Call("convf", mask) as Image; } /// /// Int convolution operation. /// /// /// /// using Image @out = in.Convi(mask); /// /// /// Input matrix image. /// A new . public Image Convi(Image mask) { return this.Call("convi", mask) as Image; } /// /// Separable convolution operation. /// /// /// /// using Image @out = in.Convsep(mask, precision: Enums.Precision, layers: int, cluster: int); /// /// /// Input matrix image. /// Convolve with this precision. /// Use this many layers in approximation. /// Cluster lines closer than this in approximation. /// A new . public Image Convsep(Image mask, Enums.Precision? precision = null, int? layers = null, int? cluster = null) { var options = new VOption(); options.AddIfPresent(nameof(precision), precision); options.AddIfPresent(nameof(layers), layers); options.AddIfPresent(nameof(cluster), cluster); return this.Call("convsep", options, mask) as Image; } /// /// Copy an image. /// /// /// /// using Image @out = in.Copy(width: int, height: int, bands: int, format: Enums.BandFormat, coding: Enums.Coding, interpretation: Enums.Interpretation, xres: double, yres: double, xoffset: int, yoffset: int); /// /// /// Image width in pixels. /// Image height in pixels. /// Number of bands in image. /// Pixel format in image. /// Pixel coding. /// Pixel interpretation. /// Horizontal resolution in pixels/mm. /// Vertical resolution in pixels/mm. /// Horizontal offset of origin. /// Vertical offset of origin. /// A new . public Image Copy(int? width = null, int? height = null, int? bands = null, Enums.BandFormat? format = null, Enums.Coding? coding = null, Enums.Interpretation? interpretation = null, double? xres = null, double? yres = null, int? xoffset = null, int? yoffset = null) { var options = new VOption(); options.AddIfPresent(nameof(width), width); options.AddIfPresent(nameof(height), height); options.AddIfPresent(nameof(bands), bands); options.AddIfPresent(nameof(format), format); options.AddIfPresent(nameof(coding), coding); options.AddIfPresent(nameof(interpretation), interpretation); options.AddIfPresent(nameof(xres), xres); options.AddIfPresent(nameof(yres), yres); options.AddIfPresent(nameof(xoffset), xoffset); options.AddIfPresent(nameof(yoffset), yoffset); return this.Call("copy", options) as Image; } /// /// Count lines in an image. /// /// /// /// double nolines = in.Countlines(direction); /// /// /// Countlines left-right or up-down. /// A double. public double Countlines(Enums.Direction direction) { return this.Call("countlines", direction) is double result ? result : 0d; } /// /// Load csv. /// /// /// /// using Image @out = NetVips.Image.Csvload(filename, skip: int, lines: int, whitespace: string, separator: string, memory: bool, access: Enums.Access, failOn: Enums.FailOn, revalidate: bool); /// /// /// Filename to load from. /// Skip this many lines at the start of the file. /// Read this many lines from the file. /// Set of whitespace characters. /// Set of separator characters. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// Don't use a cached result for this operation. /// A new . public static Image Csvload(string filename, int? skip = null, int? lines = null, string whitespace = null, string separator = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null, bool? revalidate = null) { var options = new VOption(); options.AddIfPresent(nameof(skip), skip); options.AddIfPresent(nameof(lines), lines); options.AddIfPresent(nameof(whitespace), whitespace); options.AddIfPresent(nameof(separator), separator); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.AddIfPresent(nameof(revalidate), revalidate); return Operation.Call("csvload", options, filename) as Image; } /// /// Load csv. /// /// /// /// using Image @out = NetVips.Image.Csvload(filename, out var flags, skip: int, lines: int, whitespace: string, separator: string, memory: bool, access: Enums.Access, failOn: Enums.FailOn, revalidate: bool); /// /// /// Filename to load from. /// Flags for this file. /// Skip this many lines at the start of the file. /// Read this many lines from the file. /// Set of whitespace characters. /// Set of separator characters. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// Don't use a cached result for this operation. /// A new . public static Image Csvload(string filename, out Enums.ForeignFlags flags, int? skip = null, int? lines = null, string whitespace = null, string separator = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null, bool? revalidate = null) { var options = new VOption(); options.AddIfPresent(nameof(skip), skip); options.AddIfPresent(nameof(lines), lines); options.AddIfPresent(nameof(whitespace), whitespace); options.AddIfPresent(nameof(separator), separator); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.AddIfPresent(nameof(revalidate), revalidate); options.Add("flags", true); var results = Operation.Call("csvload", options, filename) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; flags = (Enums.ForeignFlags)opts?["flags"]; return finalResult; } /// /// Load csv. /// /// /// /// using Image @out = NetVips.Image.CsvloadSource(source, skip: int, lines: int, whitespace: string, separator: string, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Source to load from. /// Skip this many lines at the start of the file. /// Read this many lines from the file. /// Set of whitespace characters. /// Set of separator characters. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image CsvloadSource(Source source, int? skip = null, int? lines = null, string whitespace = null, string separator = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(skip), skip); options.AddIfPresent(nameof(lines), lines); options.AddIfPresent(nameof(whitespace), whitespace); options.AddIfPresent(nameof(separator), separator); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); return Operation.Call("csvload_source", options, source) as Image; } /// /// Load csv. /// /// /// /// using Image @out = NetVips.Image.CsvloadStream(stream, skip: int, lines: int, whitespace: string, separator: string, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Stream to load from. /// Skip this many lines at the start of the file. /// Read this many lines from the file. /// Set of whitespace characters. /// Set of separator characters. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image CsvloadStream(Stream stream, int? skip = null, int? lines = null, string whitespace = null, string separator = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var source = SourceStream.NewFromStream(stream); var image = CsvloadSource(source, skip, lines, whitespace, separator, memory, access, failOn); image.OnPostClose += () => source.Dispose(); return image; } /// /// Load csv. /// /// /// /// using Image @out = NetVips.Image.CsvloadSource(source, out var flags, skip: int, lines: int, whitespace: string, separator: string, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Source to load from. /// Flags for this file. /// Skip this many lines at the start of the file. /// Read this many lines from the file. /// Set of whitespace characters. /// Set of separator characters. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image CsvloadSource(Source source, out Enums.ForeignFlags flags, int? skip = null, int? lines = null, string whitespace = null, string separator = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(skip), skip); options.AddIfPresent(nameof(lines), lines); options.AddIfPresent(nameof(whitespace), whitespace); options.AddIfPresent(nameof(separator), separator); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.Add("flags", true); var results = Operation.Call("csvload_source", options, source) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; flags = (Enums.ForeignFlags)opts?["flags"]; return finalResult; } /// /// Load csv. /// /// /// /// using Image @out = NetVips.Image.CsvloadStream(stream, out var flags, skip: int, lines: int, whitespace: string, separator: string, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Stream to load from. /// Flags for this file. /// Skip this many lines at the start of the file. /// Read this many lines from the file. /// Set of whitespace characters. /// Set of separator characters. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image CsvloadStream(Stream stream, out Enums.ForeignFlags flags, int? skip = null, int? lines = null, string whitespace = null, string separator = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var source = SourceStream.NewFromStream(stream); var image = CsvloadSource(source, out flags, skip, lines, whitespace, separator, memory, access, failOn); image.OnPostClose += () => source.Dispose(); return image; } /// /// Save image to csv. /// /// /// /// in.Csvsave(filename, separator: string, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Filename to save to. /// Separator characters. /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. public void Csvsave(string filename, string separator = null, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { var options = new VOption(); options.AddIfPresent(nameof(separator), separator); options.AddForeignKeep(keep); options.AddIfPresent(nameof(background), background); options.AddIfPresent("page_height", pageHeight); options.AddIfPresent(nameof(profile), profile); this.Call("csvsave", options, filename); } /// /// Save image to csv. /// /// /// /// in.CsvsaveTarget(target, separator: string, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Target to save to. /// Separator characters. /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. public void CsvsaveTarget(Target target, string separator = null, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { var options = new VOption(); options.AddIfPresent(nameof(separator), separator); options.AddForeignKeep(keep); options.AddIfPresent(nameof(background), background); options.AddIfPresent("page_height", pageHeight); options.AddIfPresent(nameof(profile), profile); this.Call("csvsave_target", options, target); } /// /// Save image to csv. /// /// /// /// in.CsvsaveStream(stream, separator: string, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Stream to save to. /// Separator characters. /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. public void CsvsaveStream(Stream stream, string separator = null, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { using var target = TargetStream.NewFromStream(stream); CsvsaveTarget(target, separator, keep, background, pageHeight, profile); } /// /// Calculate dE00. /// /// /// /// using Image @out = left.DE00(right); /// /// /// Right-hand input image. /// A new . public Image DE00(Image right) { return this.Call("dE00", right) as Image; } /// /// Calculate dE76. /// /// /// /// using Image @out = left.DE76(right); /// /// /// Right-hand input image. /// A new . public Image DE76(Image right) { return this.Call("dE76", right) as Image; } /// /// Calculate dECMC. /// /// /// /// using Image @out = left.DECMC(right); /// /// /// Right-hand input image. /// A new . public Image DECMC(Image right) { return this.Call("dECMC", right) as Image; } /// /// Find image standard deviation. /// /// /// /// double @out = in.Deviate(); /// /// /// A double. public double Deviate() { return this.Call("deviate") is double result ? result : 0d; } /// /// Divide two images. /// /// /// /// using Image @out = left.Divide(right); /// /// /// Right-hand image argument. /// A new . public Image Divide(Image right) { return this.Call("divide", right) as Image; } /// /// Save image to deepzoom file. /// /// /// /// in.Dzsave(filename, imagename: string, layout: Enums.ForeignDzLayout, suffix: string, overlap: int, tileSize: int, centre: bool, depth: Enums.ForeignDzDepth, angle: Enums.Angle, container: Enums.ForeignDzContainer, compression: int, regionShrink: Enums.RegionShrink, skipBlanks: int, id: string, q: int, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Filename to save to. /// Image name. /// Directory layout. /// Filename suffix for tiles. /// Tile overlap in pixels. /// Tile size in pixels. /// Center image in tile. /// Pyramid depth. /// Rotate image during save. /// Pyramid container type. /// ZIP deflate compression level. /// Method to shrink regions. /// Skip tiles which are nearly equal to the background. /// Resource ID. /// Q factor. /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. public void Dzsave(string filename, string imagename = null, Enums.ForeignDzLayout? layout = null, string suffix = null, int? overlap = null, int? tileSize = null, bool? centre = null, Enums.ForeignDzDepth? depth = null, Enums.Angle? angle = null, Enums.ForeignDzContainer? container = null, int? compression = null, Enums.RegionShrink? regionShrink = null, int? skipBlanks = null, string id = null, int? q = null, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { var options = new VOption(); options.AddIfPresent(NetVips.AtLeastLibvips(8, 15) ? nameof(imagename) : "basename", imagename); options.AddIfPresent(nameof(layout), layout); options.AddIfPresent(nameof(suffix), suffix); options.AddIfPresent(nameof(overlap), overlap); options.AddIfPresent("tile_size", tileSize); options.AddIfPresent(nameof(centre), centre); options.AddIfPresent(nameof(depth), depth); options.AddIfPresent(nameof(angle), angle); options.AddIfPresent(nameof(container), container); options.AddIfPresent(nameof(compression), compression); options.AddIfPresent("region_shrink", regionShrink); options.AddIfPresent("skip_blanks", skipBlanks); options.AddIfPresent(nameof(id), id); options.AddIfPresent("Q", q); options.AddForeignKeep(keep, true); options.AddIfPresent(nameof(background), background); options.AddIfPresent("page_height", pageHeight); options.AddIfPresent(nameof(profile), profile); this.Call("dzsave", options, filename); } /// /// Save image to dz buffer. /// /// /// /// byte[] buffer = in.DzsaveBuffer(imagename: string, layout: Enums.ForeignDzLayout, suffix: string, overlap: int, tileSize: int, centre: bool, depth: Enums.ForeignDzDepth, angle: Enums.Angle, container: Enums.ForeignDzContainer, compression: int, regionShrink: Enums.RegionShrink, skipBlanks: int, id: string, q: int, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Image name. /// Directory layout. /// Filename suffix for tiles. /// Tile overlap in pixels. /// Tile size in pixels. /// Center image in tile. /// Pyramid depth. /// Rotate image during save. /// Pyramid container type. /// ZIP deflate compression level. /// Method to shrink regions. /// Skip tiles which are nearly equal to the background. /// Resource ID. /// Q factor. /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. /// An array of bytes. public byte[] DzsaveBuffer(string imagename = null, Enums.ForeignDzLayout? layout = null, string suffix = null, int? overlap = null, int? tileSize = null, bool? centre = null, Enums.ForeignDzDepth? depth = null, Enums.Angle? angle = null, Enums.ForeignDzContainer? container = null, int? compression = null, Enums.RegionShrink? regionShrink = null, int? skipBlanks = null, string id = null, int? q = null, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { var options = new VOption(); options.AddIfPresent(NetVips.AtLeastLibvips(8, 15) ? nameof(imagename) : "basename", imagename); options.AddIfPresent(nameof(layout), layout); options.AddIfPresent(nameof(suffix), suffix); options.AddIfPresent(nameof(overlap), overlap); options.AddIfPresent("tile_size", tileSize); options.AddIfPresent(nameof(centre), centre); options.AddIfPresent(nameof(depth), depth); options.AddIfPresent(nameof(angle), angle); options.AddIfPresent(nameof(container), container); options.AddIfPresent(nameof(compression), compression); options.AddIfPresent("region_shrink", regionShrink); options.AddIfPresent("skip_blanks", skipBlanks); options.AddIfPresent(nameof(id), id); options.AddIfPresent("Q", q); options.AddForeignKeep(keep, true); options.AddIfPresent(nameof(background), background); options.AddIfPresent("page_height", pageHeight); options.AddIfPresent(nameof(profile), profile); return this.Call("dzsave_buffer", options) as byte[]; } /// /// Save image to deepzoom target. /// /// /// /// in.DzsaveTarget(target, imagename: string, layout: Enums.ForeignDzLayout, suffix: string, overlap: int, tileSize: int, centre: bool, depth: Enums.ForeignDzDepth, angle: Enums.Angle, container: Enums.ForeignDzContainer, compression: int, regionShrink: Enums.RegionShrink, skipBlanks: int, id: string, q: int, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Target to save to. /// Image name. /// Directory layout. /// Filename suffix for tiles. /// Tile overlap in pixels. /// Tile size in pixels. /// Center image in tile. /// Pyramid depth. /// Rotate image during save. /// Pyramid container type. /// ZIP deflate compression level. /// Method to shrink regions. /// Skip tiles which are nearly equal to the background. /// Resource ID. /// Q factor. /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. public void DzsaveTarget(Target target, string imagename = null, Enums.ForeignDzLayout? layout = null, string suffix = null, int? overlap = null, int? tileSize = null, bool? centre = null, Enums.ForeignDzDepth? depth = null, Enums.Angle? angle = null, Enums.ForeignDzContainer? container = null, int? compression = null, Enums.RegionShrink? regionShrink = null, int? skipBlanks = null, string id = null, int? q = null, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { var options = new VOption(); options.AddIfPresent(NetVips.AtLeastLibvips(8, 15) ? nameof(imagename) : "basename", imagename); options.AddIfPresent(nameof(layout), layout); options.AddIfPresent(nameof(suffix), suffix); options.AddIfPresent(nameof(overlap), overlap); options.AddIfPresent("tile_size", tileSize); options.AddIfPresent(nameof(centre), centre); options.AddIfPresent(nameof(depth), depth); options.AddIfPresent(nameof(angle), angle); options.AddIfPresent(nameof(container), container); options.AddIfPresent(nameof(compression), compression); options.AddIfPresent("region_shrink", regionShrink); options.AddIfPresent("skip_blanks", skipBlanks); options.AddIfPresent(nameof(id), id); options.AddIfPresent("Q", q); options.AddForeignKeep(keep, true); options.AddIfPresent(nameof(background), background); options.AddIfPresent("page_height", pageHeight); options.AddIfPresent(nameof(profile), profile); this.Call("dzsave_target", options, target); } /// /// Save image to deepzoom stream. /// /// /// /// in.DzsaveStream(stream, imagename: string, layout: Enums.ForeignDzLayout, suffix: string, overlap: int, tileSize: int, centre: bool, depth: Enums.ForeignDzDepth, angle: Enums.Angle, container: Enums.ForeignDzContainer, compression: int, regionShrink: Enums.RegionShrink, skipBlanks: int, id: string, q: int, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Stream to save to. /// Image name. /// Directory layout. /// Filename suffix for tiles. /// Tile overlap in pixels. /// Tile size in pixels. /// Center image in tile. /// Pyramid depth. /// Rotate image during save. /// Pyramid container type. /// ZIP deflate compression level. /// Method to shrink regions. /// Skip tiles which are nearly equal to the background. /// Resource ID. /// Q factor. /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. public void DzsaveStream(Stream stream, string imagename = null, Enums.ForeignDzLayout? layout = null, string suffix = null, int? overlap = null, int? tileSize = null, bool? centre = null, Enums.ForeignDzDepth? depth = null, Enums.Angle? angle = null, Enums.ForeignDzContainer? container = null, int? compression = null, Enums.RegionShrink? regionShrink = null, int? skipBlanks = null, string id = null, int? q = null, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { using var target = TargetStream.NewFromStream(stream); DzsaveTarget(target, imagename, layout, suffix, overlap, tileSize, centre, depth, angle, container, compression, regionShrink, skipBlanks, id, q, keep, background, pageHeight, profile); } /// /// Embed an image in a larger image. /// /// /// /// using Image @out = in.Embed(x, y, width, height, extend: Enums.Extend, background: double[]); /// /// /// Left edge of input in output. /// Top edge of input in output. /// Image width in pixels. /// Image height in pixels. /// How to generate the extra pixels. /// Color for background pixels. /// A new . public Image Embed(int x, int y, int width, int height, Enums.Extend? extend = null, double[] background = null) { var options = new VOption(); options.AddIfPresent(nameof(extend), extend); options.AddIfPresent(nameof(background), background); return this.Call("embed", options, x, y, width, height) as Image; } /// /// Extract an area from an image. /// /// /// /// using Image @out = input.ExtractArea(left, top, width, height); /// /// /// Left edge of extract area. /// Top edge of extract area. /// Width of extract area. /// Height of extract area. /// A new . public Image ExtractArea(int left, int top, int width, int height) { return this.Call("extract_area", left, top, width, height) as Image; } /// /// Extract band from an image. /// /// /// /// using Image @out = in.ExtractBand(band, n: int); /// /// /// Band to extract. /// Number of bands to extract. /// A new . public Image ExtractBand(int band, int? n = null) { var options = new VOption(); options.AddIfPresent(nameof(n), n); return this.Call("extract_band", options, band) as Image; } /// /// Make an image showing the eye's spatial response. /// /// /// /// using Image @out = NetVips.Image.Eye(width, height, uchar: bool, factor: double); /// /// /// Image width in pixels. /// Image height in pixels. /// Output an unsigned char image. /// Maximum spatial frequency. /// A new . public static Image Eye(int width, int height, bool? uchar = null, double? factor = null) { var options = new VOption(); options.AddIfPresent(nameof(uchar), uchar); options.AddIfPresent(nameof(factor), factor); return Operation.Call("eye", options, width, height) as Image; } /// /// False-color an image. /// /// /// /// using Image @out = in.Falsecolour(); /// /// /// A new . public Image Falsecolour() { return this.Call("falsecolour") as Image; } /// /// Fast correlation. /// /// /// /// using Image @out = in.Fastcor(@ref); /// /// /// Input reference image. /// A new . public Image Fastcor(Image @ref) { return this.Call("fastcor", @ref) as Image; } /// /// Fill image zeros with nearest non-zero pixel. /// /// /// /// using Image @out = in.FillNearest(); /// /// /// A new . public Image FillNearest() { return this.Call("fill_nearest") as Image; } /// /// Fill image zeros with nearest non-zero pixel. /// /// /// /// using Image @out = in.FillNearest(out var distance); /// /// /// Distance to nearest non-zero pixel. /// A new . public Image FillNearest(out Image distance) { var optionalOutput = new VOption { {"distance", true} }; var results = this.Call("fill_nearest", optionalOutput) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; distance = opts?["distance"] as Image; return finalResult; } /// /// Search an image for non-edge areas. /// /// /// /// var output = in.FindTrim(threshold: double, background: double[], lineArt: bool); /// /// /// Object threshold. /// Color for background pixels. /// Enable line art mode. /// An array of objects. public object[] FindTrim(double? threshold = null, double[] background = null, bool? lineArt = null) { var options = new VOption(); options.AddIfPresent(nameof(threshold), threshold); options.AddIfPresent(nameof(background), background); options.AddIfPresent("line_art", lineArt); return this.Call("find_trim", options) as object[]; } /// /// Load a FITS image. /// /// /// /// using Image @out = NetVips.Image.Fitsload(filename, memory: bool, access: Enums.Access, failOn: Enums.FailOn, revalidate: bool); /// /// /// Filename to load from. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// Don't use a cached result for this operation. /// A new . public static Image Fitsload(string filename, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null, bool? revalidate = null) { var options = new VOption(); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.AddIfPresent(nameof(revalidate), revalidate); return Operation.Call("fitsload", options, filename) as Image; } /// /// Load a FITS image. /// /// /// /// using Image @out = NetVips.Image.Fitsload(filename, out var flags, memory: bool, access: Enums.Access, failOn: Enums.FailOn, revalidate: bool); /// /// /// Filename to load from. /// Flags for this file. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// Don't use a cached result for this operation. /// A new . public static Image Fitsload(string filename, out Enums.ForeignFlags flags, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null, bool? revalidate = null) { var options = new VOption(); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.AddIfPresent(nameof(revalidate), revalidate); options.Add("flags", true); var results = Operation.Call("fitsload", options, filename) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; flags = (Enums.ForeignFlags)opts?["flags"]; return finalResult; } /// /// Load FITS from a source. /// /// /// /// using Image @out = NetVips.Image.FitsloadSource(source, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Source to load from. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image FitsloadSource(Source source, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); return Operation.Call("fitsload_source", options, source) as Image; } /// /// Load FITS from a stream. /// /// /// /// using Image @out = NetVips.Image.FitsloadStream(stream, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Stream to load from. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image FitsloadStream(Stream stream, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var source = SourceStream.NewFromStream(stream); var image = FitsloadSource(source, memory, access, failOn); image.OnPostClose += () => source.Dispose(); return image; } /// /// Load FITS from a source. /// /// /// /// using Image @out = NetVips.Image.FitsloadSource(source, out var flags, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Source to load from. /// Flags for this file. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image FitsloadSource(Source source, out Enums.ForeignFlags flags, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.Add("flags", true); var results = Operation.Call("fitsload_source", options, source) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; flags = (Enums.ForeignFlags)opts?["flags"]; return finalResult; } /// /// Load FITS from a stream. /// /// /// /// using Image @out = NetVips.Image.FitsloadStream(stream, out var flags, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Stream to load from. /// Flags for this file. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image FitsloadStream(Stream stream, out Enums.ForeignFlags flags, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var source = SourceStream.NewFromStream(stream); var image = FitsloadSource(source, out flags, memory, access, failOn); image.OnPostClose += () => source.Dispose(); return image; } /// /// Save image to fits file. /// /// /// /// in.Fitssave(filename, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Filename to save to. /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. public void Fitssave(string filename, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { var options = new VOption(); options.AddForeignKeep(keep); options.AddIfPresent(nameof(background), background); options.AddIfPresent("page_height", pageHeight); options.AddIfPresent(nameof(profile), profile); this.Call("fitssave", options, filename); } /// /// Flatten alpha out of an image. /// /// /// /// using Image @out = in.Flatten(background: double[], maxAlpha: double); /// /// /// Background value. /// Maximum value of alpha channel. /// A new . public Image Flatten(double[] background = null, double? maxAlpha = null) { var options = new VOption(); options.AddIfPresent(nameof(background), background); options.AddIfPresent("max_alpha", maxAlpha); return this.Call("flatten", options) as Image; } /// /// Flip an image. /// /// /// /// using Image @out = in.Flip(direction); /// /// /// Direction to flip image. /// A new . public Image Flip(Enums.Direction direction) { return this.Call("flip", direction) as Image; } /// /// Transform float RGB to Radiance coding. /// /// /// /// using Image @out = in.Float2rad(); /// /// /// A new . public Image Float2rad() { return this.Call("float2rad") as Image; } /// /// Make a fractal surface. /// /// /// /// using Image @out = NetVips.Image.Fractsurf(width, height, fractalDimension); /// /// /// Image width in pixels. /// Image height in pixels. /// Fractal dimension. /// A new . public static Image Fractsurf(int width, int height, double fractalDimension) { return Operation.Call("fractsurf", width, height, fractalDimension) as Image; } /// /// Frequency-domain filtering. /// /// /// /// using Image @out = in.Freqmult(mask); /// /// /// Input mask image. /// A new . public Image Freqmult(Image mask) { return this.Call("freqmult", mask) as Image; } /// /// Forward FFT. /// /// /// /// using Image @out = in.Fwfft(); /// /// /// A new . public Image Fwfft() { return this.Call("fwfft") as Image; } /// /// Gamma an image. /// /// /// /// using Image @out = in.Gamma(exponent: double); /// /// /// Gamma factor. /// A new . public Image Gamma(double? exponent = null) { var options = new VOption(); options.AddIfPresent(nameof(exponent), exponent); return this.Call("gamma", options) as Image; } /// /// Gaussian blur. /// /// /// /// using Image @out = in.Gaussblur(sigma, minAmpl: double, precision: Enums.Precision); /// /// /// Sigma of Gaussian. /// Minimum amplitude of Gaussian. /// Convolve with this precision. /// A new . public Image Gaussblur(double sigma, double? minAmpl = null, Enums.Precision? precision = null) { var options = new VOption(); options.AddIfPresent("min_ampl", minAmpl); options.AddIfPresent(nameof(precision), precision); return this.Call("gaussblur", options, sigma) as Image; } /// /// Make a gaussian image. /// /// /// /// using Image @out = NetVips.Image.Gaussmat(sigma, minAmpl, separable: bool, precision: Enums.Precision); /// /// /// Sigma of Gaussian. /// Minimum amplitude of Gaussian. /// Generate separable Gaussian. /// Generate with this precision. /// A new . public static Image Gaussmat(double sigma, double minAmpl, bool? separable = null, Enums.Precision? precision = null) { var options = new VOption(); options.AddIfPresent(nameof(separable), separable); options.AddIfPresent(nameof(precision), precision); return Operation.Call("gaussmat", options, sigma, minAmpl) as Image; } /// /// Make a gaussnoise image. /// /// /// /// using Image @out = NetVips.Image.Gaussnoise(width, height, sigma: double, mean: double, seed: int); /// /// /// Image width in pixels. /// Image height in pixels. /// Standard deviation of pixels in generated image. /// Mean of pixels in generated image. /// Random number seed. /// A new . public static Image Gaussnoise(int width, int height, double? sigma = null, double? mean = null, int? seed = null) { var options = new VOption(); options.AddIfPresent(nameof(sigma), sigma); options.AddIfPresent(nameof(mean), mean); options.AddIfPresent(nameof(seed), seed); return Operation.Call("gaussnoise", options, width, height) as Image; } /// /// Read a point from an image. /// /// /// /// double[] outArray = in.Getpoint(x, y, unpackComplex: bool); /// /// /// Point to read. /// Point to read. /// Complex pixels should be unpacked. /// An array of doubles. public double[] Getpoint(int x, int y, bool? unpackComplex = null) { var options = new VOption(); options.AddIfPresent("unpack_complex", unpackComplex); return this.Call("getpoint", options, x, y) as double[]; } /// /// Load GIF with libnsgif. /// /// /// /// using Image @out = NetVips.Image.Gifload(filename, n: int, page: int, memory: bool, access: Enums.Access, failOn: Enums.FailOn, revalidate: bool); /// /// /// Filename to load from. /// Number of pages to load, -1 for all. /// First page to load. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// Don't use a cached result for this operation. /// A new . public static Image Gifload(string filename, int? n = null, int? page = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null, bool? revalidate = null) { var options = new VOption(); options.AddIfPresent(nameof(n), n); options.AddIfPresent(nameof(page), page); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.AddIfPresent(nameof(revalidate), revalidate); return Operation.Call("gifload", options, filename) as Image; } /// /// Load GIF with libnsgif. /// /// /// /// using Image @out = NetVips.Image.Gifload(filename, out var flags, n: int, page: int, memory: bool, access: Enums.Access, failOn: Enums.FailOn, revalidate: bool); /// /// /// Filename to load from. /// Flags for this file. /// Number of pages to load, -1 for all. /// First page to load. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// Don't use a cached result for this operation. /// A new . public static Image Gifload(string filename, out Enums.ForeignFlags flags, int? n = null, int? page = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null, bool? revalidate = null) { var options = new VOption(); options.AddIfPresent(nameof(n), n); options.AddIfPresent(nameof(page), page); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.AddIfPresent(nameof(revalidate), revalidate); options.Add("flags", true); var results = Operation.Call("gifload", options, filename) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; flags = (Enums.ForeignFlags)opts?["flags"]; return finalResult; } /// /// Load GIF with libnsgif. /// /// /// /// using Image @out = NetVips.Image.GifloadBuffer(buffer, n: int, page: int, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Buffer to load from. /// Number of pages to load, -1 for all. /// First page to load. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image GifloadBuffer(byte[] buffer, int? n = null, int? page = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(n), n); options.AddIfPresent(nameof(page), page); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); return Operation.Call("gifload_buffer", options, buffer) as Image; } /// /// Load GIF with libnsgif. /// /// /// /// using Image @out = NetVips.Image.GifloadBuffer(buffer, out var flags, n: int, page: int, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Buffer to load from. /// Flags for this file. /// Number of pages to load, -1 for all. /// First page to load. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image GifloadBuffer(byte[] buffer, out Enums.ForeignFlags flags, int? n = null, int? page = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(n), n); options.AddIfPresent(nameof(page), page); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.Add("flags", true); var results = Operation.Call("gifload_buffer", options, buffer) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; flags = (Enums.ForeignFlags)opts?["flags"]; return finalResult; } /// /// Load gif from source. /// /// /// /// using Image @out = NetVips.Image.GifloadSource(source, n: int, page: int, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Source to load from. /// Number of pages to load, -1 for all. /// First page to load. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image GifloadSource(Source source, int? n = null, int? page = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(n), n); options.AddIfPresent(nameof(page), page); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); return Operation.Call("gifload_source", options, source) as Image; } /// /// Load gif from stream. /// /// /// /// using Image @out = NetVips.Image.GifloadStream(stream, n: int, page: int, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Stream to load from. /// Number of pages to load, -1 for all. /// First page to load. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image GifloadStream(Stream stream, int? n = null, int? page = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var source = SourceStream.NewFromStream(stream); var image = GifloadSource(source, n, page, memory, access, failOn); image.OnPostClose += () => source.Dispose(); return image; } /// /// Load gif from source. /// /// /// /// using Image @out = NetVips.Image.GifloadSource(source, out var flags, n: int, page: int, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Source to load from. /// Flags for this file. /// Number of pages to load, -1 for all. /// First page to load. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image GifloadSource(Source source, out Enums.ForeignFlags flags, int? n = null, int? page = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(n), n); options.AddIfPresent(nameof(page), page); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.Add("flags", true); var results = Operation.Call("gifload_source", options, source) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; flags = (Enums.ForeignFlags)opts?["flags"]; return finalResult; } /// /// Load gif from stream. /// /// /// /// using Image @out = NetVips.Image.GifloadStream(stream, out var flags, n: int, page: int, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Stream to load from. /// Flags for this file. /// Number of pages to load, -1 for all. /// First page to load. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image GifloadStream(Stream stream, out Enums.ForeignFlags flags, int? n = null, int? page = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var source = SourceStream.NewFromStream(stream); var image = GifloadSource(source, out flags, n, page, memory, access, failOn); image.OnPostClose += () => source.Dispose(); return image; } /// /// Save as gif. /// /// /// /// in.Gifsave(filename, dither: double, effort: int, bitdepth: int, interframeMaxerror: double, reuse: bool, interpaletteMaxerror: double, interlace: bool, keepDuplicateFrames: bool, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Filename to save to. /// Amount of dithering. /// Quantisation effort. /// Number of bits per pixel. /// Maximum inter-frame error for transparency. /// Reuse palette from input. /// Maximum inter-palette error for palette reusage. /// Generate an interlaced (progressive) GIF. /// Keep duplicate frames in the output instead of combining them. /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. public void Gifsave(string filename, double? dither = null, int? effort = null, int? bitdepth = null, double? interframeMaxerror = null, bool? reuse = null, double? interpaletteMaxerror = null, bool? interlace = null, bool? keepDuplicateFrames = null, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { var options = new VOption(); options.AddIfPresent(nameof(dither), dither); options.AddIfPresent(nameof(effort), effort); options.AddIfPresent(nameof(bitdepth), bitdepth); options.AddIfPresent("interframe_maxerror", interframeMaxerror); options.AddIfPresent(nameof(reuse), reuse); options.AddIfPresent("interpalette_maxerror", interpaletteMaxerror); options.AddIfPresent(nameof(interlace), interlace); options.AddIfPresent("keep_duplicate_frames", keepDuplicateFrames); options.AddForeignKeep(keep); options.AddIfPresent(nameof(background), background); options.AddIfPresent("page_height", pageHeight); options.AddIfPresent(nameof(profile), profile); this.Call("gifsave", options, filename); } /// /// Save as gif. /// /// /// /// byte[] buffer = in.GifsaveBuffer(dither: double, effort: int, bitdepth: int, interframeMaxerror: double, reuse: bool, interpaletteMaxerror: double, interlace: bool, keepDuplicateFrames: bool, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Amount of dithering. /// Quantisation effort. /// Number of bits per pixel. /// Maximum inter-frame error for transparency. /// Reuse palette from input. /// Maximum inter-palette error for palette reusage. /// Generate an interlaced (progressive) GIF. /// Keep duplicate frames in the output instead of combining them. /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. /// An array of bytes. public byte[] GifsaveBuffer(double? dither = null, int? effort = null, int? bitdepth = null, double? interframeMaxerror = null, bool? reuse = null, double? interpaletteMaxerror = null, bool? interlace = null, bool? keepDuplicateFrames = null, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { var options = new VOption(); options.AddIfPresent(nameof(dither), dither); options.AddIfPresent(nameof(effort), effort); options.AddIfPresent(nameof(bitdepth), bitdepth); options.AddIfPresent("interframe_maxerror", interframeMaxerror); options.AddIfPresent(nameof(reuse), reuse); options.AddIfPresent("interpalette_maxerror", interpaletteMaxerror); options.AddIfPresent(nameof(interlace), interlace); options.AddIfPresent("keep_duplicate_frames", keepDuplicateFrames); options.AddForeignKeep(keep); options.AddIfPresent(nameof(background), background); options.AddIfPresent("page_height", pageHeight); options.AddIfPresent(nameof(profile), profile); return this.Call("gifsave_buffer", options) as byte[]; } /// /// Save as gif. /// /// /// /// in.GifsaveTarget(target, dither: double, effort: int, bitdepth: int, interframeMaxerror: double, reuse: bool, interpaletteMaxerror: double, interlace: bool, keepDuplicateFrames: bool, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Target to save to. /// Amount of dithering. /// Quantisation effort. /// Number of bits per pixel. /// Maximum inter-frame error for transparency. /// Reuse palette from input. /// Maximum inter-palette error for palette reusage. /// Generate an interlaced (progressive) GIF. /// Keep duplicate frames in the output instead of combining them. /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. public void GifsaveTarget(Target target, double? dither = null, int? effort = null, int? bitdepth = null, double? interframeMaxerror = null, bool? reuse = null, double? interpaletteMaxerror = null, bool? interlace = null, bool? keepDuplicateFrames = null, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { var options = new VOption(); options.AddIfPresent(nameof(dither), dither); options.AddIfPresent(nameof(effort), effort); options.AddIfPresent(nameof(bitdepth), bitdepth); options.AddIfPresent("interframe_maxerror", interframeMaxerror); options.AddIfPresent(nameof(reuse), reuse); options.AddIfPresent("interpalette_maxerror", interpaletteMaxerror); options.AddIfPresent(nameof(interlace), interlace); options.AddIfPresent("keep_duplicate_frames", keepDuplicateFrames); options.AddForeignKeep(keep); options.AddIfPresent(nameof(background), background); options.AddIfPresent("page_height", pageHeight); options.AddIfPresent(nameof(profile), profile); this.Call("gifsave_target", options, target); } /// /// Save as gif. /// /// /// /// in.GifsaveStream(stream, dither: double, effort: int, bitdepth: int, interframeMaxerror: double, reuse: bool, interpaletteMaxerror: double, interlace: bool, keepDuplicateFrames: bool, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Stream to save to. /// Amount of dithering. /// Quantisation effort. /// Number of bits per pixel. /// Maximum inter-frame error for transparency. /// Reuse palette from input. /// Maximum inter-palette error for palette reusage. /// Generate an interlaced (progressive) GIF. /// Keep duplicate frames in the output instead of combining them. /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. public void GifsaveStream(Stream stream, double? dither = null, int? effort = null, int? bitdepth = null, double? interframeMaxerror = null, bool? reuse = null, double? interpaletteMaxerror = null, bool? interlace = null, bool? keepDuplicateFrames = null, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { using var target = TargetStream.NewFromStream(stream); GifsaveTarget(target, dither, effort, bitdepth, interframeMaxerror, reuse, interpaletteMaxerror, interlace, keepDuplicateFrames, keep, background, pageHeight, profile); } /// /// Global balance an image mosaic. /// /// /// /// using Image @out = in.Globalbalance(gamma: double, intOutput: bool); /// /// /// Image gamma. /// Integer output. /// A new . public Image Globalbalance(double? gamma = null, bool? intOutput = null) { var options = new VOption(); options.AddIfPresent(nameof(gamma), gamma); options.AddIfPresent("int_output", intOutput); return this.Call("globalbalance", options) as Image; } /// /// Place an image within a larger image with a certain gravity. /// /// /// /// using Image @out = in.Gravity(direction, width, height, extend: Enums.Extend, background: double[]); /// /// /// Direction to place image within width/height. /// Image width in pixels. /// Image height in pixels. /// How to generate the extra pixels. /// Color for background pixels. /// A new . public Image Gravity(Enums.CompassDirection direction, int width, int height, Enums.Extend? extend = null, double[] background = null) { var options = new VOption(); options.AddIfPresent(nameof(extend), extend); options.AddIfPresent(nameof(background), background); return this.Call("gravity", options, direction, width, height) as Image; } /// /// Make a grey ramp image. /// /// /// /// using Image @out = NetVips.Image.Grey(width, height, uchar: bool); /// /// /// Image width in pixels. /// Image height in pixels. /// Output an unsigned char image. /// A new . public static Image Grey(int width, int height, bool? uchar = null) { var options = new VOption(); options.AddIfPresent(nameof(uchar), uchar); return Operation.Call("grey", options, width, height) as Image; } /// /// Grid an image. /// /// /// /// using Image @out = in.Grid(tileHeight, across, down); /// /// /// Chop into tiles this high. /// Number of tiles across. /// Number of tiles down. /// A new . public Image Grid(int tileHeight, int across, int down) { return this.Call("grid", tileHeight, across, down) as Image; } /// /// Load a HEIF image. /// /// /// /// using Image @out = NetVips.Image.Heifload(filename, page: int, n: int, thumbnail: bool, unlimited: bool, memory: bool, access: Enums.Access, failOn: Enums.FailOn, revalidate: bool); /// /// /// Filename to load from. /// First page to load. /// Number of pages to load, -1 for all. /// Fetch thumbnail image. /// Remove all denial of service limits. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// Don't use a cached result for this operation. /// A new . public static Image Heifload(string filename, int? page = null, int? n = null, bool? thumbnail = null, bool? unlimited = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null, bool? revalidate = null) { var options = new VOption(); options.AddIfPresent(nameof(page), page); options.AddIfPresent(nameof(n), n); options.AddIfPresent(nameof(thumbnail), thumbnail); options.AddIfPresent(nameof(unlimited), unlimited); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.AddIfPresent(nameof(revalidate), revalidate); return Operation.Call("heifload", options, filename) as Image; } /// /// Load a HEIF image. /// /// /// /// using Image @out = NetVips.Image.Heifload(filename, out var flags, page: int, n: int, thumbnail: bool, unlimited: bool, memory: bool, access: Enums.Access, failOn: Enums.FailOn, revalidate: bool); /// /// /// Filename to load from. /// Flags for this file. /// First page to load. /// Number of pages to load, -1 for all. /// Fetch thumbnail image. /// Remove all denial of service limits. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// Don't use a cached result for this operation. /// A new . public static Image Heifload(string filename, out Enums.ForeignFlags flags, int? page = null, int? n = null, bool? thumbnail = null, bool? unlimited = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null, bool? revalidate = null) { var options = new VOption(); options.AddIfPresent(nameof(page), page); options.AddIfPresent(nameof(n), n); options.AddIfPresent(nameof(thumbnail), thumbnail); options.AddIfPresent(nameof(unlimited), unlimited); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.AddIfPresent(nameof(revalidate), revalidate); options.Add("flags", true); var results = Operation.Call("heifload", options, filename) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; flags = (Enums.ForeignFlags)opts?["flags"]; return finalResult; } /// /// Load a HEIF image. /// /// /// /// using Image @out = NetVips.Image.HeifloadBuffer(buffer, page: int, n: int, thumbnail: bool, unlimited: bool, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Buffer to load from. /// First page to load. /// Number of pages to load, -1 for all. /// Fetch thumbnail image. /// Remove all denial of service limits. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image HeifloadBuffer(byte[] buffer, int? page = null, int? n = null, bool? thumbnail = null, bool? unlimited = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(page), page); options.AddIfPresent(nameof(n), n); options.AddIfPresent(nameof(thumbnail), thumbnail); options.AddIfPresent(nameof(unlimited), unlimited); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); return Operation.Call("heifload_buffer", options, buffer) as Image; } /// /// Load a HEIF image. /// /// /// /// using Image @out = NetVips.Image.HeifloadBuffer(buffer, out var flags, page: int, n: int, thumbnail: bool, unlimited: bool, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Buffer to load from. /// Flags for this file. /// First page to load. /// Number of pages to load, -1 for all. /// Fetch thumbnail image. /// Remove all denial of service limits. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image HeifloadBuffer(byte[] buffer, out Enums.ForeignFlags flags, int? page = null, int? n = null, bool? thumbnail = null, bool? unlimited = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(page), page); options.AddIfPresent(nameof(n), n); options.AddIfPresent(nameof(thumbnail), thumbnail); options.AddIfPresent(nameof(unlimited), unlimited); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.Add("flags", true); var results = Operation.Call("heifload_buffer", options, buffer) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; flags = (Enums.ForeignFlags)opts?["flags"]; return finalResult; } /// /// Load a HEIF image. /// /// /// /// using Image @out = NetVips.Image.HeifloadSource(source, page: int, n: int, thumbnail: bool, unlimited: bool, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Source to load from. /// First page to load. /// Number of pages to load, -1 for all. /// Fetch thumbnail image. /// Remove all denial of service limits. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image HeifloadSource(Source source, int? page = null, int? n = null, bool? thumbnail = null, bool? unlimited = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(page), page); options.AddIfPresent(nameof(n), n); options.AddIfPresent(nameof(thumbnail), thumbnail); options.AddIfPresent(nameof(unlimited), unlimited); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); return Operation.Call("heifload_source", options, source) as Image; } /// /// Load a HEIF image. /// /// /// /// using Image @out = NetVips.Image.HeifloadStream(stream, page: int, n: int, thumbnail: bool, unlimited: bool, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Stream to load from. /// First page to load. /// Number of pages to load, -1 for all. /// Fetch thumbnail image. /// Remove all denial of service limits. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image HeifloadStream(Stream stream, int? page = null, int? n = null, bool? thumbnail = null, bool? unlimited = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var source = SourceStream.NewFromStream(stream); var image = HeifloadSource(source, page, n, thumbnail, unlimited, memory, access, failOn); image.OnPostClose += () => source.Dispose(); return image; } /// /// Load a HEIF image. /// /// /// /// using Image @out = NetVips.Image.HeifloadSource(source, out var flags, page: int, n: int, thumbnail: bool, unlimited: bool, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Source to load from. /// Flags for this file. /// First page to load. /// Number of pages to load, -1 for all. /// Fetch thumbnail image. /// Remove all denial of service limits. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image HeifloadSource(Source source, out Enums.ForeignFlags flags, int? page = null, int? n = null, bool? thumbnail = null, bool? unlimited = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(page), page); options.AddIfPresent(nameof(n), n); options.AddIfPresent(nameof(thumbnail), thumbnail); options.AddIfPresent(nameof(unlimited), unlimited); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.Add("flags", true); var results = Operation.Call("heifload_source", options, source) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; flags = (Enums.ForeignFlags)opts?["flags"]; return finalResult; } /// /// Load a HEIF image. /// /// /// /// using Image @out = NetVips.Image.HeifloadStream(stream, out var flags, page: int, n: int, thumbnail: bool, unlimited: bool, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Stream to load from. /// Flags for this file. /// First page to load. /// Number of pages to load, -1 for all. /// Fetch thumbnail image. /// Remove all denial of service limits. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image HeifloadStream(Stream stream, out Enums.ForeignFlags flags, int? page = null, int? n = null, bool? thumbnail = null, bool? unlimited = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var source = SourceStream.NewFromStream(stream); var image = HeifloadSource(source, out flags, page, n, thumbnail, unlimited, memory, access, failOn); image.OnPostClose += () => source.Dispose(); return image; } /// /// Save image in HEIF format. /// /// /// /// in.Heifsave(filename, q: int, bitdepth: int, lossless: bool, compression: Enums.ForeignHeifCompression, effort: int, subsampleMode: Enums.ForeignSubsample, encoder: Enums.ForeignHeifEncoder, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Filename to save to. /// Q factor. /// Number of bits per pixel. /// Enable lossless compression. /// Compression format. /// CPU effort. /// Select chroma subsample operation mode. /// Select encoder to use. /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. public void Heifsave(string filename, int? q = null, int? bitdepth = null, bool? lossless = null, Enums.ForeignHeifCompression? compression = null, int? effort = null, Enums.ForeignSubsample? subsampleMode = null, Enums.ForeignHeifEncoder? encoder = null, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { var options = new VOption(); options.AddIfPresent("Q", q); options.AddIfPresent(nameof(bitdepth), bitdepth); options.AddIfPresent(nameof(lossless), lossless); options.AddIfPresent(nameof(compression), compression); options.AddIfPresent(nameof(effort), effort); options.AddIfPresent("subsample_mode", subsampleMode); options.AddIfPresent(nameof(encoder), encoder); options.AddForeignKeep(keep); options.AddIfPresent(nameof(background), background); options.AddIfPresent("page_height", pageHeight); options.AddIfPresent(nameof(profile), profile); this.Call("heifsave", options, filename); } /// /// Save image in HEIF format. /// /// /// /// byte[] buffer = in.HeifsaveBuffer(q: int, bitdepth: int, lossless: bool, compression: Enums.ForeignHeifCompression, effort: int, subsampleMode: Enums.ForeignSubsample, encoder: Enums.ForeignHeifEncoder, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Q factor. /// Number of bits per pixel. /// Enable lossless compression. /// Compression format. /// CPU effort. /// Select chroma subsample operation mode. /// Select encoder to use. /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. /// An array of bytes. public byte[] HeifsaveBuffer(int? q = null, int? bitdepth = null, bool? lossless = null, Enums.ForeignHeifCompression? compression = null, int? effort = null, Enums.ForeignSubsample? subsampleMode = null, Enums.ForeignHeifEncoder? encoder = null, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { var options = new VOption(); options.AddIfPresent("Q", q); options.AddIfPresent(nameof(bitdepth), bitdepth); options.AddIfPresent(nameof(lossless), lossless); options.AddIfPresent(nameof(compression), compression); options.AddIfPresent(nameof(effort), effort); options.AddIfPresent("subsample_mode", subsampleMode); options.AddIfPresent(nameof(encoder), encoder); options.AddForeignKeep(keep); options.AddIfPresent(nameof(background), background); options.AddIfPresent("page_height", pageHeight); options.AddIfPresent(nameof(profile), profile); return this.Call("heifsave_buffer", options) as byte[]; } /// /// Save image in HEIF format. /// /// /// /// in.HeifsaveTarget(target, q: int, bitdepth: int, lossless: bool, compression: Enums.ForeignHeifCompression, effort: int, subsampleMode: Enums.ForeignSubsample, encoder: Enums.ForeignHeifEncoder, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Target to save to. /// Q factor. /// Number of bits per pixel. /// Enable lossless compression. /// Compression format. /// CPU effort. /// Select chroma subsample operation mode. /// Select encoder to use. /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. public void HeifsaveTarget(Target target, int? q = null, int? bitdepth = null, bool? lossless = null, Enums.ForeignHeifCompression? compression = null, int? effort = null, Enums.ForeignSubsample? subsampleMode = null, Enums.ForeignHeifEncoder? encoder = null, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { var options = new VOption(); options.AddIfPresent("Q", q); options.AddIfPresent(nameof(bitdepth), bitdepth); options.AddIfPresent(nameof(lossless), lossless); options.AddIfPresent(nameof(compression), compression); options.AddIfPresent(nameof(effort), effort); options.AddIfPresent("subsample_mode", subsampleMode); options.AddIfPresent(nameof(encoder), encoder); options.AddForeignKeep(keep); options.AddIfPresent(nameof(background), background); options.AddIfPresent("page_height", pageHeight); options.AddIfPresent(nameof(profile), profile); this.Call("heifsave_target", options, target); } /// /// Save image in HEIF format. /// /// /// /// in.HeifsaveStream(stream, q: int, bitdepth: int, lossless: bool, compression: Enums.ForeignHeifCompression, effort: int, subsampleMode: Enums.ForeignSubsample, encoder: Enums.ForeignHeifEncoder, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Stream to save to. /// Q factor. /// Number of bits per pixel. /// Enable lossless compression. /// Compression format. /// CPU effort. /// Select chroma subsample operation mode. /// Select encoder to use. /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. public void HeifsaveStream(Stream stream, int? q = null, int? bitdepth = null, bool? lossless = null, Enums.ForeignHeifCompression? compression = null, int? effort = null, Enums.ForeignSubsample? subsampleMode = null, Enums.ForeignHeifEncoder? encoder = null, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { using var target = TargetStream.NewFromStream(stream); HeifsaveTarget(target, q, bitdepth, lossless, compression, effort, subsampleMode, encoder, keep, background, pageHeight, profile); } /// /// Form cumulative histogram. /// /// /// /// using Image @out = in.HistCum(); /// /// /// A new . public Image HistCum() { return this.Call("hist_cum") as Image; } /// /// Estimate image entropy. /// /// /// /// double @out = in.HistEntropy(); /// /// /// A double. public double HistEntropy() { return this.Call("hist_entropy") is double result ? result : 0d; } /// /// Histogram equalisation. /// /// /// /// using Image @out = in.HistEqual(band: int); /// /// /// Equalise with this band. /// A new . public Image HistEqual(int? band = null) { var options = new VOption(); options.AddIfPresent(nameof(band), band); return this.Call("hist_equal", options) as Image; } /// /// Find image histogram. /// /// /// /// using Image @out = in.HistFind(band: int); /// /// /// Find histogram of band. /// A new . public Image HistFind(int? band = null) { var options = new VOption(); options.AddIfPresent(nameof(band), band); return this.Call("hist_find", options) as Image; } /// /// Find indexed image histogram. /// /// /// /// using Image @out = in.HistFindIndexed(index, combine: Enums.Combine); /// /// /// Index image. /// Combine bins like this. /// A new . public Image HistFindIndexed(Image index, Enums.Combine? combine = null) { var options = new VOption(); options.AddIfPresent(nameof(combine), combine); return this.Call("hist_find_indexed", options, index) as Image; } /// /// Find n-dimensional image histogram. /// /// /// /// using Image @out = in.HistFindNdim(bins: int); /// /// /// Number of bins in each dimension. /// A new . public Image HistFindNdim(int? bins = null) { var options = new VOption(); options.AddIfPresent(nameof(bins), bins); return this.Call("hist_find_ndim", options) as Image; } /// /// Test for monotonicity. /// /// /// /// bool monotonic = in.HistIsmonotonic(); /// /// /// A bool. public bool HistIsmonotonic() { return this.Call("hist_ismonotonic") is bool result && result; } /// /// Local histogram equalisation. /// /// /// /// using Image @out = in.HistLocal(width, height, maxSlope: int); /// /// /// Window width in pixels. /// Window height in pixels. /// Maximum slope (CLAHE). /// A new . public Image HistLocal(int width, int height, int? maxSlope = null) { var options = new VOption(); options.AddIfPresent("max_slope", maxSlope); return this.Call("hist_local", options, width, height) as Image; } /// /// Match two histograms. /// /// /// /// using Image @out = in.HistMatch(@ref); /// /// /// Reference histogram. /// A new . public Image HistMatch(Image @ref) { return this.Call("hist_match", @ref) as Image; } /// /// Normalise histogram. /// /// /// /// using Image @out = in.HistNorm(); /// /// /// A new . public Image HistNorm() { return this.Call("hist_norm") as Image; } /// /// Plot histogram. /// /// /// /// using Image @out = in.HistPlot(); /// /// /// A new . public Image HistPlot() { return this.Call("hist_plot") as Image; } /// /// Find hough circle transform. /// /// /// /// using Image @out = in.HoughCircle(scale: int, minRadius: int, maxRadius: int); /// /// /// Scale down dimensions by this factor. /// Smallest radius to search for. /// Largest radius to search for. /// A new . public Image HoughCircle(int? scale = null, int? minRadius = null, int? maxRadius = null) { var options = new VOption(); options.AddIfPresent(nameof(scale), scale); options.AddIfPresent("min_radius", minRadius); options.AddIfPresent("max_radius", maxRadius); return this.Call("hough_circle", options) as Image; } /// /// Find hough line transform. /// /// /// /// using Image @out = in.HoughLine(width: int, height: int); /// /// /// Horizontal size of parameter space. /// Vertical size of parameter space. /// A new . public Image HoughLine(int? width = null, int? height = null) { var options = new VOption(); options.AddIfPresent(nameof(width), width); options.AddIfPresent(nameof(height), height); return this.Call("hough_line", options) as Image; } /// /// Transform HSV to sRGB. /// /// /// /// using Image @out = in.HSV2sRGB(); /// /// /// A new . public Image HSV2sRGB() { return this.Call("HSV2sRGB") as Image; } /// /// Output to device with ICC profile. /// /// /// /// using Image @out = in.IccExport(pcs: Enums.PCS, intent: Enums.Intent, blackPointCompensation: bool, outputProfile: string, depth: int); /// /// /// Set Profile Connection Space. /// Rendering intent. /// Enable black point compensation. /// Filename to load output profile from. /// Output device space depth in bits. /// A new . public Image IccExport(Enums.PCS? pcs = null, Enums.Intent? intent = null, bool? blackPointCompensation = null, string outputProfile = null, int? depth = null) { var options = new VOption(); options.AddIfPresent(nameof(pcs), pcs); options.AddIfPresent(nameof(intent), intent); options.AddIfPresent("black_point_compensation", blackPointCompensation); options.AddIfPresent("output_profile", outputProfile); options.AddIfPresent(nameof(depth), depth); return this.Call("icc_export", options) as Image; } /// /// Import from device with ICC profile. /// /// /// /// using Image @out = in.IccImport(pcs: Enums.PCS, intent: Enums.Intent, blackPointCompensation: bool, embedded: bool, inputProfile: string); /// /// /// Set Profile Connection Space. /// Rendering intent. /// Enable black point compensation. /// Use embedded input profile, if available. /// Filename to load input profile from. /// A new . public Image IccImport(Enums.PCS? pcs = null, Enums.Intent? intent = null, bool? blackPointCompensation = null, bool? embedded = null, string inputProfile = null) { var options = new VOption(); options.AddIfPresent(nameof(pcs), pcs); options.AddIfPresent(nameof(intent), intent); options.AddIfPresent("black_point_compensation", blackPointCompensation); options.AddIfPresent(nameof(embedded), embedded); options.AddIfPresent("input_profile", inputProfile); return this.Call("icc_import", options) as Image; } /// /// Transform between devices with ICC profiles. /// /// /// /// using Image @out = in.IccTransform(outputProfile, pcs: Enums.PCS, intent: Enums.Intent, blackPointCompensation: bool, embedded: bool, inputProfile: string, depth: int); /// /// /// Filename to load output profile from. /// Set Profile Connection Space. /// Rendering intent. /// Enable black point compensation. /// Use embedded input profile, if available. /// Filename to load input profile from. /// Output device space depth in bits. /// A new . public Image IccTransform(string outputProfile, Enums.PCS? pcs = null, Enums.Intent? intent = null, bool? blackPointCompensation = null, bool? embedded = null, string inputProfile = null, int? depth = null) { var options = new VOption(); options.AddIfPresent(nameof(pcs), pcs); options.AddIfPresent(nameof(intent), intent); options.AddIfPresent("black_point_compensation", blackPointCompensation); options.AddIfPresent(nameof(embedded), embedded); options.AddIfPresent("input_profile", inputProfile); options.AddIfPresent(nameof(depth), depth); return this.Call("icc_transform", options, outputProfile) as Image; } /// /// Make a 1D image where pixel values are indexes. /// /// /// /// using Image @out = NetVips.Image.Identity(bands: int, @ushort: bool, size: int); /// /// /// Number of bands in LUT. /// Create a 16-bit LUT. /// Size of 16-bit LUT. /// A new . public static Image Identity(int? bands = null, bool? @ushort = null, int? size = null) { var options = new VOption(); options.AddIfPresent(nameof(bands), bands); options.AddIfPresent("ushort", @ushort); options.AddIfPresent(nameof(size), size); return Operation.Call("identity", options) as Image; } /// /// Insert image @sub into @main at @x, @y. /// /// /// /// using Image @out = main.Insert(sub, x, y, expand: bool, background: double[]); /// /// /// Sub-image to insert into main image. /// Left edge of sub in main. /// Top edge of sub in main. /// Expand output to hold all of both inputs. /// Color for new pixels. /// A new . public Image Insert(Image sub, int x, int y, bool? expand = null, double[] background = null) { var options = new VOption(); options.AddIfPresent(nameof(expand), expand); options.AddIfPresent(nameof(background), background); return this.Call("insert", options, sub, x, y) as Image; } /// /// Invert an image. /// /// /// /// using Image @out = in.Invert(); /// /// /// A new . public Image Invert() { return this.Call("invert") as Image; } /// /// Build an inverted look-up table. /// /// /// /// using Image @out = in.Invertlut(size: int); /// /// /// LUT size to generate. /// A new . public Image Invertlut(int? size = null) { var options = new VOption(); options.AddIfPresent(nameof(size), size); return this.Call("invertlut", options) as Image; } /// /// Inverse FFT. /// /// /// /// using Image @out = in.Invfft(real: bool); /// /// /// Output only the real part of the transform. /// A new . public Image Invfft(bool? real = null) { var options = new VOption(); options.AddIfPresent(nameof(real), real); return this.Call("invfft", options) as Image; } /// /// Join a pair of images. /// /// /// /// using Image @out = in1.Join(in2, direction, expand: bool, shim: int, background: double[], align: Enums.Align); /// /// /// Second input image. /// Join left-right or up-down. /// Expand output to hold all of both inputs. /// Pixels between images. /// Colour for new pixels. /// Align on the low, centre or high coordinate edge. /// A new . public Image Join(Image in2, Enums.Direction direction, bool? expand = null, int? shim = null, double[] background = null, Enums.Align? align = null) { var options = new VOption(); options.AddIfPresent(nameof(expand), expand); options.AddIfPresent(nameof(shim), shim); options.AddIfPresent(nameof(background), background); options.AddIfPresent(nameof(align), align); return this.Call("join", options, in2, direction) as Image; } /// /// Load JPEG2000 image. /// /// /// /// using Image @out = NetVips.Image.Jp2kload(filename, page: int, oneshot: bool, memory: bool, access: Enums.Access, failOn: Enums.FailOn, revalidate: bool); /// /// /// Filename to load from. /// Load this page from the image. /// Load images a frame at a time. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// Don't use a cached result for this operation. /// A new . public static Image Jp2kload(string filename, int? page = null, bool? oneshot = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null, bool? revalidate = null) { var options = new VOption(); options.AddIfPresent(nameof(page), page); options.AddIfPresent(nameof(oneshot), oneshot); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.AddIfPresent(nameof(revalidate), revalidate); return Operation.Call("jp2kload", options, filename) as Image; } /// /// Load JPEG2000 image. /// /// /// /// using Image @out = NetVips.Image.Jp2kload(filename, out var flags, page: int, oneshot: bool, memory: bool, access: Enums.Access, failOn: Enums.FailOn, revalidate: bool); /// /// /// Filename to load from. /// Flags for this file. /// Load this page from the image. /// Load images a frame at a time. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// Don't use a cached result for this operation. /// A new . public static Image Jp2kload(string filename, out Enums.ForeignFlags flags, int? page = null, bool? oneshot = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null, bool? revalidate = null) { var options = new VOption(); options.AddIfPresent(nameof(page), page); options.AddIfPresent(nameof(oneshot), oneshot); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.AddIfPresent(nameof(revalidate), revalidate); options.Add("flags", true); var results = Operation.Call("jp2kload", options, filename) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; flags = (Enums.ForeignFlags)opts?["flags"]; return finalResult; } /// /// Load JPEG2000 image. /// /// /// /// using Image @out = NetVips.Image.Jp2kloadBuffer(buffer, page: int, oneshot: bool, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Buffer to load from. /// Load this page from the image. /// Load images a frame at a time. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image Jp2kloadBuffer(byte[] buffer, int? page = null, bool? oneshot = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(page), page); options.AddIfPresent(nameof(oneshot), oneshot); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); return Operation.Call("jp2kload_buffer", options, buffer) as Image; } /// /// Load JPEG2000 image. /// /// /// /// using Image @out = NetVips.Image.Jp2kloadBuffer(buffer, out var flags, page: int, oneshot: bool, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Buffer to load from. /// Flags for this file. /// Load this page from the image. /// Load images a frame at a time. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image Jp2kloadBuffer(byte[] buffer, out Enums.ForeignFlags flags, int? page = null, bool? oneshot = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(page), page); options.AddIfPresent(nameof(oneshot), oneshot); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.Add("flags", true); var results = Operation.Call("jp2kload_buffer", options, buffer) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; flags = (Enums.ForeignFlags)opts?["flags"]; return finalResult; } /// /// Load JPEG2000 image. /// /// /// /// using Image @out = NetVips.Image.Jp2kloadSource(source, page: int, oneshot: bool, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Source to load from. /// Load this page from the image. /// Load images a frame at a time. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image Jp2kloadSource(Source source, int? page = null, bool? oneshot = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(page), page); options.AddIfPresent(nameof(oneshot), oneshot); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); return Operation.Call("jp2kload_source", options, source) as Image; } /// /// Load JPEG2000 image. /// /// /// /// using Image @out = NetVips.Image.Jp2kloadStream(stream, page: int, oneshot: bool, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Stream to load from. /// Load this page from the image. /// Load images a frame at a time. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image Jp2kloadStream(Stream stream, int? page = null, bool? oneshot = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var source = SourceStream.NewFromStream(stream); var image = Jp2kloadSource(source, page, oneshot, memory, access, failOn); image.OnPostClose += () => source.Dispose(); return image; } /// /// Load JPEG2000 image. /// /// /// /// using Image @out = NetVips.Image.Jp2kloadSource(source, out var flags, page: int, oneshot: bool, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Source to load from. /// Flags for this file. /// Load this page from the image. /// Load images a frame at a time. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image Jp2kloadSource(Source source, out Enums.ForeignFlags flags, int? page = null, bool? oneshot = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(page), page); options.AddIfPresent(nameof(oneshot), oneshot); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.Add("flags", true); var results = Operation.Call("jp2kload_source", options, source) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; flags = (Enums.ForeignFlags)opts?["flags"]; return finalResult; } /// /// Load JPEG2000 image. /// /// /// /// using Image @out = NetVips.Image.Jp2kloadStream(stream, out var flags, page: int, oneshot: bool, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Stream to load from. /// Flags for this file. /// Load this page from the image. /// Load images a frame at a time. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image Jp2kloadStream(Stream stream, out Enums.ForeignFlags flags, int? page = null, bool? oneshot = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var source = SourceStream.NewFromStream(stream); var image = Jp2kloadSource(source, out flags, page, oneshot, memory, access, failOn); image.OnPostClose += () => source.Dispose(); return image; } /// /// Save image in JPEG2000 format. /// /// /// /// in.Jp2ksave(filename, tileWidth: int, tileHeight: int, lossless: bool, q: int, subsampleMode: Enums.ForeignSubsample, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Filename to save to. /// Tile width in pixels. /// Tile height in pixels. /// Enable lossless compression. /// Q factor. /// Select chroma subsample operation mode. /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. public void Jp2ksave(string filename, int? tileWidth = null, int? tileHeight = null, bool? lossless = null, int? q = null, Enums.ForeignSubsample? subsampleMode = null, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { var options = new VOption(); options.AddIfPresent("tile_width", tileWidth); options.AddIfPresent("tile_height", tileHeight); options.AddIfPresent(nameof(lossless), lossless); options.AddIfPresent("Q", q); options.AddIfPresent("subsample_mode", subsampleMode); options.AddForeignKeep(keep); options.AddIfPresent(nameof(background), background); options.AddIfPresent("page_height", pageHeight); options.AddIfPresent(nameof(profile), profile); this.Call("jp2ksave", options, filename); } /// /// Save image in JPEG2000 format. /// /// /// /// byte[] buffer = in.Jp2ksaveBuffer(tileWidth: int, tileHeight: int, lossless: bool, q: int, subsampleMode: Enums.ForeignSubsample, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Tile width in pixels. /// Tile height in pixels. /// Enable lossless compression. /// Q factor. /// Select chroma subsample operation mode. /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. /// An array of bytes. public byte[] Jp2ksaveBuffer(int? tileWidth = null, int? tileHeight = null, bool? lossless = null, int? q = null, Enums.ForeignSubsample? subsampleMode = null, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { var options = new VOption(); options.AddIfPresent("tile_width", tileWidth); options.AddIfPresent("tile_height", tileHeight); options.AddIfPresent(nameof(lossless), lossless); options.AddIfPresent("Q", q); options.AddIfPresent("subsample_mode", subsampleMode); options.AddForeignKeep(keep); options.AddIfPresent(nameof(background), background); options.AddIfPresent("page_height", pageHeight); options.AddIfPresent(nameof(profile), profile); return this.Call("jp2ksave_buffer", options) as byte[]; } /// /// Save image in JPEG2000 format. /// /// /// /// in.Jp2ksaveTarget(target, tileWidth: int, tileHeight: int, lossless: bool, q: int, subsampleMode: Enums.ForeignSubsample, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Target to save to. /// Tile width in pixels. /// Tile height in pixels. /// Enable lossless compression. /// Q factor. /// Select chroma subsample operation mode. /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. public void Jp2ksaveTarget(Target target, int? tileWidth = null, int? tileHeight = null, bool? lossless = null, int? q = null, Enums.ForeignSubsample? subsampleMode = null, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { var options = new VOption(); options.AddIfPresent("tile_width", tileWidth); options.AddIfPresent("tile_height", tileHeight); options.AddIfPresent(nameof(lossless), lossless); options.AddIfPresent("Q", q); options.AddIfPresent("subsample_mode", subsampleMode); options.AddForeignKeep(keep); options.AddIfPresent(nameof(background), background); options.AddIfPresent("page_height", pageHeight); options.AddIfPresent(nameof(profile), profile); this.Call("jp2ksave_target", options, target); } /// /// Save image in JPEG2000 format. /// /// /// /// in.Jp2ksaveStream(stream, tileWidth: int, tileHeight: int, lossless: bool, q: int, subsampleMode: Enums.ForeignSubsample, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Stream to save to. /// Tile width in pixels. /// Tile height in pixels. /// Enable lossless compression. /// Q factor. /// Select chroma subsample operation mode. /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. public void Jp2ksaveStream(Stream stream, int? tileWidth = null, int? tileHeight = null, bool? lossless = null, int? q = null, Enums.ForeignSubsample? subsampleMode = null, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { using var target = TargetStream.NewFromStream(stream); Jp2ksaveTarget(target, tileWidth, tileHeight, lossless, q, subsampleMode, keep, background, pageHeight, profile); } /// /// Load jpeg from file. /// /// /// /// using Image @out = NetVips.Image.Jpegload(filename, shrink: int, autorotate: bool, unlimited: bool, memory: bool, access: Enums.Access, failOn: Enums.FailOn, revalidate: bool); /// /// /// Filename to load from. /// Shrink factor on load. /// Rotate image using exif orientation. /// Remove all denial of service limits. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// Don't use a cached result for this operation. /// A new . public static Image Jpegload(string filename, int? shrink = null, bool? autorotate = null, bool? unlimited = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null, bool? revalidate = null) { var options = new VOption(); options.AddIfPresent(nameof(shrink), shrink); options.AddIfPresent(nameof(autorotate), autorotate); options.AddIfPresent(nameof(unlimited), unlimited); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.AddIfPresent(nameof(revalidate), revalidate); return Operation.Call("jpegload", options, filename) as Image; } /// /// Load jpeg from file. /// /// /// /// using Image @out = NetVips.Image.Jpegload(filename, out var flags, shrink: int, autorotate: bool, unlimited: bool, memory: bool, access: Enums.Access, failOn: Enums.FailOn, revalidate: bool); /// /// /// Filename to load from. /// Flags for this file. /// Shrink factor on load. /// Rotate image using exif orientation. /// Remove all denial of service limits. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// Don't use a cached result for this operation. /// A new . public static Image Jpegload(string filename, out Enums.ForeignFlags flags, int? shrink = null, bool? autorotate = null, bool? unlimited = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null, bool? revalidate = null) { var options = new VOption(); options.AddIfPresent(nameof(shrink), shrink); options.AddIfPresent(nameof(autorotate), autorotate); options.AddIfPresent(nameof(unlimited), unlimited); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.AddIfPresent(nameof(revalidate), revalidate); options.Add("flags", true); var results = Operation.Call("jpegload", options, filename) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; flags = (Enums.ForeignFlags)opts?["flags"]; return finalResult; } /// /// Load jpeg from buffer. /// /// /// /// using Image @out = NetVips.Image.JpegloadBuffer(buffer, shrink: int, autorotate: bool, unlimited: bool, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Buffer to load from. /// Shrink factor on load. /// Rotate image using exif orientation. /// Remove all denial of service limits. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image JpegloadBuffer(byte[] buffer, int? shrink = null, bool? autorotate = null, bool? unlimited = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(shrink), shrink); options.AddIfPresent(nameof(autorotate), autorotate); options.AddIfPresent(nameof(unlimited), unlimited); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); return Operation.Call("jpegload_buffer", options, buffer) as Image; } /// /// Load jpeg from buffer. /// /// /// /// using Image @out = NetVips.Image.JpegloadBuffer(buffer, out var flags, shrink: int, autorotate: bool, unlimited: bool, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Buffer to load from. /// Flags for this file. /// Shrink factor on load. /// Rotate image using exif orientation. /// Remove all denial of service limits. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image JpegloadBuffer(byte[] buffer, out Enums.ForeignFlags flags, int? shrink = null, bool? autorotate = null, bool? unlimited = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(shrink), shrink); options.AddIfPresent(nameof(autorotate), autorotate); options.AddIfPresent(nameof(unlimited), unlimited); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.Add("flags", true); var results = Operation.Call("jpegload_buffer", options, buffer) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; flags = (Enums.ForeignFlags)opts?["flags"]; return finalResult; } /// /// Load image from jpeg source. /// /// /// /// using Image @out = NetVips.Image.JpegloadSource(source, shrink: int, autorotate: bool, unlimited: bool, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Source to load from. /// Shrink factor on load. /// Rotate image using exif orientation. /// Remove all denial of service limits. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image JpegloadSource(Source source, int? shrink = null, bool? autorotate = null, bool? unlimited = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(shrink), shrink); options.AddIfPresent(nameof(autorotate), autorotate); options.AddIfPresent(nameof(unlimited), unlimited); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); return Operation.Call("jpegload_source", options, source) as Image; } /// /// Load image from jpeg stream. /// /// /// /// using Image @out = NetVips.Image.JpegloadStream(stream, shrink: int, autorotate: bool, unlimited: bool, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Stream to load from. /// Shrink factor on load. /// Rotate image using exif orientation. /// Remove all denial of service limits. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image JpegloadStream(Stream stream, int? shrink = null, bool? autorotate = null, bool? unlimited = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var source = SourceStream.NewFromStream(stream); var image = JpegloadSource(source, shrink, autorotate, unlimited, memory, access, failOn); image.OnPostClose += () => source.Dispose(); return image; } /// /// Load image from jpeg source. /// /// /// /// using Image @out = NetVips.Image.JpegloadSource(source, out var flags, shrink: int, autorotate: bool, unlimited: bool, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Source to load from. /// Flags for this file. /// Shrink factor on load. /// Rotate image using exif orientation. /// Remove all denial of service limits. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image JpegloadSource(Source source, out Enums.ForeignFlags flags, int? shrink = null, bool? autorotate = null, bool? unlimited = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(shrink), shrink); options.AddIfPresent(nameof(autorotate), autorotate); options.AddIfPresent(nameof(unlimited), unlimited); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.Add("flags", true); var results = Operation.Call("jpegload_source", options, source) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; flags = (Enums.ForeignFlags)opts?["flags"]; return finalResult; } /// /// Load image from jpeg stream. /// /// /// /// using Image @out = NetVips.Image.JpegloadStream(stream, out var flags, shrink: int, autorotate: bool, unlimited: bool, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Stream to load from. /// Flags for this file. /// Shrink factor on load. /// Rotate image using exif orientation. /// Remove all denial of service limits. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image JpegloadStream(Stream stream, out Enums.ForeignFlags flags, int? shrink = null, bool? autorotate = null, bool? unlimited = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var source = SourceStream.NewFromStream(stream); var image = JpegloadSource(source, out flags, shrink, autorotate, unlimited, memory, access, failOn); image.OnPostClose += () => source.Dispose(); return image; } /// /// Save image to jpeg file. /// /// /// /// in.Jpegsave(filename, q: int, optimizeCoding: bool, interlace: bool, trellisQuant: bool, overshootDeringing: bool, optimizeScans: bool, quantTable: int, subsampleMode: Enums.ForeignSubsample, restartInterval: int, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Filename to save to. /// Q factor. /// Compute optimal Huffman coding tables. /// Generate an interlaced (progressive) jpeg. /// Apply trellis quantisation to each 8x8 block. /// Apply overshooting to samples with extreme values. /// Split spectrum of DCT coefficients into separate scans. /// Use predefined quantization table with given index. /// Select chroma subsample operation mode. /// Add restart markers every specified number of mcu. /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. public void Jpegsave(string filename, int? q = null, bool? optimizeCoding = null, bool? interlace = null, bool? trellisQuant = null, bool? overshootDeringing = null, bool? optimizeScans = null, int? quantTable = null, Enums.ForeignSubsample? subsampleMode = null, int? restartInterval = null, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { var options = new VOption(); options.AddIfPresent("Q", q); options.AddIfPresent("optimize_coding", optimizeCoding); options.AddIfPresent(nameof(interlace), interlace); options.AddIfPresent("trellis_quant", trellisQuant); options.AddIfPresent("overshoot_deringing", overshootDeringing); options.AddIfPresent("optimize_scans", optimizeScans); options.AddIfPresent("quant_table", quantTable); options.AddIfPresent("subsample_mode", subsampleMode); options.AddIfPresent("restart_interval", restartInterval); options.AddForeignKeep(keep); options.AddIfPresent(nameof(background), background); options.AddIfPresent("page_height", pageHeight); options.AddIfPresent(nameof(profile), profile); this.Call("jpegsave", options, filename); } /// /// Save image to jpeg buffer. /// /// /// /// byte[] buffer = in.JpegsaveBuffer(q: int, optimizeCoding: bool, interlace: bool, trellisQuant: bool, overshootDeringing: bool, optimizeScans: bool, quantTable: int, subsampleMode: Enums.ForeignSubsample, restartInterval: int, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Q factor. /// Compute optimal Huffman coding tables. /// Generate an interlaced (progressive) jpeg. /// Apply trellis quantisation to each 8x8 block. /// Apply overshooting to samples with extreme values. /// Split spectrum of DCT coefficients into separate scans. /// Use predefined quantization table with given index. /// Select chroma subsample operation mode. /// Add restart markers every specified number of mcu. /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. /// An array of bytes. public byte[] JpegsaveBuffer(int? q = null, bool? optimizeCoding = null, bool? interlace = null, bool? trellisQuant = null, bool? overshootDeringing = null, bool? optimizeScans = null, int? quantTable = null, Enums.ForeignSubsample? subsampleMode = null, int? restartInterval = null, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { var options = new VOption(); options.AddIfPresent("Q", q); options.AddIfPresent("optimize_coding", optimizeCoding); options.AddIfPresent(nameof(interlace), interlace); options.AddIfPresent("trellis_quant", trellisQuant); options.AddIfPresent("overshoot_deringing", overshootDeringing); options.AddIfPresent("optimize_scans", optimizeScans); options.AddIfPresent("quant_table", quantTable); options.AddIfPresent("subsample_mode", subsampleMode); options.AddIfPresent("restart_interval", restartInterval); options.AddForeignKeep(keep); options.AddIfPresent(nameof(background), background); options.AddIfPresent("page_height", pageHeight); options.AddIfPresent(nameof(profile), profile); return this.Call("jpegsave_buffer", options) as byte[]; } /// /// Save image to jpeg mime. /// /// /// /// in.JpegsaveMime(q: int, optimizeCoding: bool, interlace: bool, trellisQuant: bool, overshootDeringing: bool, optimizeScans: bool, quantTable: int, subsampleMode: Enums.ForeignSubsample, restartInterval: int, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Q factor. /// Compute optimal Huffman coding tables. /// Generate an interlaced (progressive) jpeg. /// Apply trellis quantisation to each 8x8 block. /// Apply overshooting to samples with extreme values. /// Split spectrum of DCT coefficients into separate scans. /// Use predefined quantization table with given index. /// Select chroma subsample operation mode. /// Add restart markers every specified number of mcu. /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. public void JpegsaveMime(int? q = null, bool? optimizeCoding = null, bool? interlace = null, bool? trellisQuant = null, bool? overshootDeringing = null, bool? optimizeScans = null, int? quantTable = null, Enums.ForeignSubsample? subsampleMode = null, int? restartInterval = null, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { var options = new VOption(); options.AddIfPresent("Q", q); options.AddIfPresent("optimize_coding", optimizeCoding); options.AddIfPresent(nameof(interlace), interlace); options.AddIfPresent("trellis_quant", trellisQuant); options.AddIfPresent("overshoot_deringing", overshootDeringing); options.AddIfPresent("optimize_scans", optimizeScans); options.AddIfPresent("quant_table", quantTable); options.AddIfPresent("subsample_mode", subsampleMode); options.AddIfPresent("restart_interval", restartInterval); options.AddForeignKeep(keep); options.AddIfPresent(nameof(background), background); options.AddIfPresent("page_height", pageHeight); options.AddIfPresent(nameof(profile), profile); this.Call("jpegsave_mime", options); } /// /// Save image to jpeg target. /// /// /// /// in.JpegsaveTarget(target, q: int, optimizeCoding: bool, interlace: bool, trellisQuant: bool, overshootDeringing: bool, optimizeScans: bool, quantTable: int, subsampleMode: Enums.ForeignSubsample, restartInterval: int, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Target to save to. /// Q factor. /// Compute optimal Huffman coding tables. /// Generate an interlaced (progressive) jpeg. /// Apply trellis quantisation to each 8x8 block. /// Apply overshooting to samples with extreme values. /// Split spectrum of DCT coefficients into separate scans. /// Use predefined quantization table with given index. /// Select chroma subsample operation mode. /// Add restart markers every specified number of mcu. /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. public void JpegsaveTarget(Target target, int? q = null, bool? optimizeCoding = null, bool? interlace = null, bool? trellisQuant = null, bool? overshootDeringing = null, bool? optimizeScans = null, int? quantTable = null, Enums.ForeignSubsample? subsampleMode = null, int? restartInterval = null, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { var options = new VOption(); options.AddIfPresent("Q", q); options.AddIfPresent("optimize_coding", optimizeCoding); options.AddIfPresent(nameof(interlace), interlace); options.AddIfPresent("trellis_quant", trellisQuant); options.AddIfPresent("overshoot_deringing", overshootDeringing); options.AddIfPresent("optimize_scans", optimizeScans); options.AddIfPresent("quant_table", quantTable); options.AddIfPresent("subsample_mode", subsampleMode); options.AddIfPresent("restart_interval", restartInterval); options.AddForeignKeep(keep); options.AddIfPresent(nameof(background), background); options.AddIfPresent("page_height", pageHeight); options.AddIfPresent(nameof(profile), profile); this.Call("jpegsave_target", options, target); } /// /// Save image to jpeg stream. /// /// /// /// in.JpegsaveStream(stream, q: int, optimizeCoding: bool, interlace: bool, trellisQuant: bool, overshootDeringing: bool, optimizeScans: bool, quantTable: int, subsampleMode: Enums.ForeignSubsample, restartInterval: int, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Stream to save to. /// Q factor. /// Compute optimal Huffman coding tables. /// Generate an interlaced (progressive) jpeg. /// Apply trellis quantisation to each 8x8 block. /// Apply overshooting to samples with extreme values. /// Split spectrum of DCT coefficients into separate scans. /// Use predefined quantization table with given index. /// Select chroma subsample operation mode. /// Add restart markers every specified number of mcu. /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. public void JpegsaveStream(Stream stream, int? q = null, bool? optimizeCoding = null, bool? interlace = null, bool? trellisQuant = null, bool? overshootDeringing = null, bool? optimizeScans = null, int? quantTable = null, Enums.ForeignSubsample? subsampleMode = null, int? restartInterval = null, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { using var target = TargetStream.NewFromStream(stream); JpegsaveTarget(target, q, optimizeCoding, interlace, trellisQuant, overshootDeringing, optimizeScans, quantTable, subsampleMode, restartInterval, keep, background, pageHeight, profile); } /// /// Load JPEG-XL image. /// /// /// /// using Image @out = NetVips.Image.Jxlload(filename, page: int, n: int, memory: bool, access: Enums.Access, failOn: Enums.FailOn, revalidate: bool); /// /// /// Filename to load from. /// First page to load. /// Number of pages to load, -1 for all. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// Don't use a cached result for this operation. /// A new . public static Image Jxlload(string filename, int? page = null, int? n = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null, bool? revalidate = null) { var options = new VOption(); options.AddIfPresent(nameof(page), page); options.AddIfPresent(nameof(n), n); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.AddIfPresent(nameof(revalidate), revalidate); return Operation.Call("jxlload", options, filename) as Image; } /// /// Load JPEG-XL image. /// /// /// /// using Image @out = NetVips.Image.Jxlload(filename, out var flags, page: int, n: int, memory: bool, access: Enums.Access, failOn: Enums.FailOn, revalidate: bool); /// /// /// Filename to load from. /// Flags for this file. /// First page to load. /// Number of pages to load, -1 for all. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// Don't use a cached result for this operation. /// A new . public static Image Jxlload(string filename, out Enums.ForeignFlags flags, int? page = null, int? n = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null, bool? revalidate = null) { var options = new VOption(); options.AddIfPresent(nameof(page), page); options.AddIfPresent(nameof(n), n); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.AddIfPresent(nameof(revalidate), revalidate); options.Add("flags", true); var results = Operation.Call("jxlload", options, filename) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; flags = (Enums.ForeignFlags)opts?["flags"]; return finalResult; } /// /// Load JPEG-XL image. /// /// /// /// using Image @out = NetVips.Image.JxlloadBuffer(buffer, page: int, n: int, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Buffer to load from. /// First page to load. /// Number of pages to load, -1 for all. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image JxlloadBuffer(byte[] buffer, int? page = null, int? n = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(page), page); options.AddIfPresent(nameof(n), n); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); return Operation.Call("jxlload_buffer", options, buffer) as Image; } /// /// Load JPEG-XL image. /// /// /// /// using Image @out = NetVips.Image.JxlloadBuffer(buffer, out var flags, page: int, n: int, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Buffer to load from. /// Flags for this file. /// First page to load. /// Number of pages to load, -1 for all. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image JxlloadBuffer(byte[] buffer, out Enums.ForeignFlags flags, int? page = null, int? n = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(page), page); options.AddIfPresent(nameof(n), n); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.Add("flags", true); var results = Operation.Call("jxlload_buffer", options, buffer) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; flags = (Enums.ForeignFlags)opts?["flags"]; return finalResult; } /// /// Load JPEG-XL image. /// /// /// /// using Image @out = NetVips.Image.JxlloadSource(source, page: int, n: int, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Source to load from. /// First page to load. /// Number of pages to load, -1 for all. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image JxlloadSource(Source source, int? page = null, int? n = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(page), page); options.AddIfPresent(nameof(n), n); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); return Operation.Call("jxlload_source", options, source) as Image; } /// /// Load JPEG-XL image. /// /// /// /// using Image @out = NetVips.Image.JxlloadStream(stream, page: int, n: int, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Stream to load from. /// First page to load. /// Number of pages to load, -1 for all. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image JxlloadStream(Stream stream, int? page = null, int? n = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var source = SourceStream.NewFromStream(stream); var image = JxlloadSource(source, page, n, memory, access, failOn); image.OnPostClose += () => source.Dispose(); return image; } /// /// Load JPEG-XL image. /// /// /// /// using Image @out = NetVips.Image.JxlloadSource(source, out var flags, page: int, n: int, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Source to load from. /// Flags for this file. /// First page to load. /// Number of pages to load, -1 for all. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image JxlloadSource(Source source, out Enums.ForeignFlags flags, int? page = null, int? n = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(page), page); options.AddIfPresent(nameof(n), n); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.Add("flags", true); var results = Operation.Call("jxlload_source", options, source) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; flags = (Enums.ForeignFlags)opts?["flags"]; return finalResult; } /// /// Load JPEG-XL image. /// /// /// /// using Image @out = NetVips.Image.JxlloadStream(stream, out var flags, page: int, n: int, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Stream to load from. /// Flags for this file. /// First page to load. /// Number of pages to load, -1 for all. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image JxlloadStream(Stream stream, out Enums.ForeignFlags flags, int? page = null, int? n = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var source = SourceStream.NewFromStream(stream); var image = JxlloadSource(source, out flags, page, n, memory, access, failOn); image.OnPostClose += () => source.Dispose(); return image; } /// /// Save image in JPEG-XL format. /// /// /// /// in.Jxlsave(filename, tier: int, distance: double, effort: int, lossless: bool, q: int, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Filename to save to. /// Decode speed tier. /// Target butteraugli distance. /// Encoding effort. /// Enable lossless compression. /// Quality factor. /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. public void Jxlsave(string filename, int? tier = null, double? distance = null, int? effort = null, bool? lossless = null, int? q = null, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { var options = new VOption(); options.AddIfPresent(nameof(tier), tier); options.AddIfPresent(nameof(distance), distance); options.AddIfPresent(nameof(effort), effort); options.AddIfPresent(nameof(lossless), lossless); options.AddIfPresent("Q", q); options.AddForeignKeep(keep); options.AddIfPresent(nameof(background), background); options.AddIfPresent("page_height", pageHeight); options.AddIfPresent(nameof(profile), profile); this.Call("jxlsave", options, filename); } /// /// Save image in JPEG-XL format. /// /// /// /// byte[] buffer = in.JxlsaveBuffer(tier: int, distance: double, effort: int, lossless: bool, q: int, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Decode speed tier. /// Target butteraugli distance. /// Encoding effort. /// Enable lossless compression. /// Quality factor. /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. /// An array of bytes. public byte[] JxlsaveBuffer(int? tier = null, double? distance = null, int? effort = null, bool? lossless = null, int? q = null, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { var options = new VOption(); options.AddIfPresent(nameof(tier), tier); options.AddIfPresent(nameof(distance), distance); options.AddIfPresent(nameof(effort), effort); options.AddIfPresent(nameof(lossless), lossless); options.AddIfPresent("Q", q); options.AddForeignKeep(keep); options.AddIfPresent(nameof(background), background); options.AddIfPresent("page_height", pageHeight); options.AddIfPresent(nameof(profile), profile); return this.Call("jxlsave_buffer", options) as byte[]; } /// /// Save image in JPEG-XL format. /// /// /// /// in.JxlsaveTarget(target, tier: int, distance: double, effort: int, lossless: bool, q: int, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Target to save to. /// Decode speed tier. /// Target butteraugli distance. /// Encoding effort. /// Enable lossless compression. /// Quality factor. /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. public void JxlsaveTarget(Target target, int? tier = null, double? distance = null, int? effort = null, bool? lossless = null, int? q = null, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { var options = new VOption(); options.AddIfPresent(nameof(tier), tier); options.AddIfPresent(nameof(distance), distance); options.AddIfPresent(nameof(effort), effort); options.AddIfPresent(nameof(lossless), lossless); options.AddIfPresent("Q", q); options.AddForeignKeep(keep); options.AddIfPresent(nameof(background), background); options.AddIfPresent("page_height", pageHeight); options.AddIfPresent(nameof(profile), profile); this.Call("jxlsave_target", options, target); } /// /// Save image in JPEG-XL format. /// /// /// /// in.JxlsaveStream(stream, tier: int, distance: double, effort: int, lossless: bool, q: int, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Stream to save to. /// Decode speed tier. /// Target butteraugli distance. /// Encoding effort. /// Enable lossless compression. /// Quality factor. /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. public void JxlsaveStream(Stream stream, int? tier = null, double? distance = null, int? effort = null, bool? lossless = null, int? q = null, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { using var target = TargetStream.NewFromStream(stream); JxlsaveTarget(target, tier, distance, effort, lossless, q, keep, background, pageHeight, profile); } /// /// Transform float Lab to LabQ coding. /// /// /// /// using Image @out = in.Lab2LabQ(); /// /// /// A new . public Image Lab2LabQ() { return this.Call("Lab2LabQ") as Image; } /// /// Transform float Lab to signed short. /// /// /// /// using Image @out = in.Lab2LabS(); /// /// /// A new . public Image Lab2LabS() { return this.Call("Lab2LabS") as Image; } /// /// Transform Lab to LCh. /// /// /// /// using Image @out = in.Lab2LCh(); /// /// /// A new . public Image Lab2LCh() { return this.Call("Lab2LCh") as Image; } /// /// Transform CIELAB to XYZ. /// /// /// /// using Image @out = in.Lab2XYZ(temp: double[]); /// /// /// Color temperature. /// A new . public Image Lab2XYZ(double[] temp = null) { var options = new VOption(); options.AddIfPresent(nameof(temp), temp); return this.Call("Lab2XYZ", options) as Image; } /// /// Label regions in an image. /// /// /// /// using Image mask = in.Labelregions(); /// /// /// A new . public Image Labelregions() { return this.Call("labelregions") as Image; } /// /// Label regions in an image. /// /// /// /// using Image mask = in.Labelregions(out var segments); /// /// /// Number of discrete contiguous regions. /// A new . public Image Labelregions(out int segments) { var optionalOutput = new VOption { {"segments", true} }; var results = this.Call("labelregions", optionalOutput) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; segments = opts?["segments"] is int out1 ? out1 : 0; return finalResult; } /// /// Unpack a LabQ image to float Lab. /// /// /// /// using Image @out = in.LabQ2Lab(); /// /// /// A new . public Image LabQ2Lab() { return this.Call("LabQ2Lab") as Image; } /// /// Unpack a LabQ image to short Lab. /// /// /// /// using Image @out = in.LabQ2LabS(); /// /// /// A new . public Image LabQ2LabS() { return this.Call("LabQ2LabS") as Image; } /// /// Convert a LabQ image to sRGB. /// /// /// /// using Image @out = in.LabQ2sRGB(); /// /// /// A new . public Image LabQ2sRGB() { return this.Call("LabQ2sRGB") as Image; } /// /// Transform signed short Lab to float. /// /// /// /// using Image @out = in.LabS2Lab(); /// /// /// A new . public Image LabS2Lab() { return this.Call("LabS2Lab") as Image; } /// /// Transform short Lab to LabQ coding. /// /// /// /// using Image @out = in.LabS2LabQ(); /// /// /// A new . public Image LabS2LabQ() { return this.Call("LabS2LabQ") as Image; } /// /// Transform LCh to CMC. /// /// /// /// using Image @out = in.LCh2CMC(); /// /// /// A new . public Image LCh2CMC() { return this.Call("LCh2CMC") as Image; } /// /// Transform LCh to Lab. /// /// /// /// using Image @out = in.LCh2Lab(); /// /// /// A new . public Image LCh2Lab() { return this.Call("LCh2Lab") as Image; } /// /// Calculate (a * in + b). /// /// /// /// using Image @out = in.Linear(a, b, uchar: bool); /// /// /// Multiply by this. /// Add this. /// Output should be uchar. /// A new . public Image Linear(double[] a, double[] b, bool? uchar = null) { var options = new VOption(); options.AddIfPresent(nameof(uchar), uchar); return this.Call("linear", options, a, b) as Image; } /// /// Cache an image as a set of lines. /// /// /// /// using Image @out = in.Linecache(tileHeight: int, access: Enums.Access, threaded: bool, persistent: bool); /// /// /// Tile height in pixels. /// Expected access pattern. /// Allow threaded access. /// Keep cache between evaluations. /// A new . public Image Linecache(int? tileHeight = null, Enums.Access? access = null, bool? threaded = null, bool? persistent = null) { var options = new VOption(); options.AddIfPresent("tile_height", tileHeight); options.AddIfPresent(nameof(access), access); options.AddIfPresent(nameof(threaded), threaded); options.AddIfPresent(nameof(persistent), persistent); return this.Call("linecache", options) as Image; } /// /// Make a Laplacian of Gaussian image. /// /// /// /// using Image @out = NetVips.Image.Logmat(sigma, minAmpl, separable: bool, precision: Enums.Precision); /// /// /// Radius of Gaussian. /// Minimum amplitude of Gaussian. /// Generate separable Gaussian. /// Generate with this precision. /// A new . public static Image Logmat(double sigma, double minAmpl, bool? separable = null, Enums.Precision? precision = null) { var options = new VOption(); options.AddIfPresent(nameof(separable), separable); options.AddIfPresent(nameof(precision), precision); return Operation.Call("logmat", options, sigma, minAmpl) as Image; } /// /// Load file with ImageMagick. /// /// /// /// using Image @out = NetVips.Image.Magickload(filename, density: string, page: int, n: int, memory: bool, access: Enums.Access, failOn: Enums.FailOn, revalidate: bool); /// /// /// Filename to load from. /// Canvas resolution for rendering vector formats like SVG. /// First page to load. /// Number of pages to load, -1 for all. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// Don't use a cached result for this operation. /// A new . public static Image Magickload(string filename, string density = null, int? page = null, int? n = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null, bool? revalidate = null) { var options = new VOption(); options.AddIfPresent(nameof(density), density); options.AddIfPresent(nameof(page), page); options.AddIfPresent(nameof(n), n); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.AddIfPresent(nameof(revalidate), revalidate); return Operation.Call("magickload", options, filename) as Image; } /// /// Load file with ImageMagick. /// /// /// /// using Image @out = NetVips.Image.Magickload(filename, out var flags, density: string, page: int, n: int, memory: bool, access: Enums.Access, failOn: Enums.FailOn, revalidate: bool); /// /// /// Filename to load from. /// Flags for this file. /// Canvas resolution for rendering vector formats like SVG. /// First page to load. /// Number of pages to load, -1 for all. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// Don't use a cached result for this operation. /// A new . public static Image Magickload(string filename, out Enums.ForeignFlags flags, string density = null, int? page = null, int? n = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null, bool? revalidate = null) { var options = new VOption(); options.AddIfPresent(nameof(density), density); options.AddIfPresent(nameof(page), page); options.AddIfPresent(nameof(n), n); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.AddIfPresent(nameof(revalidate), revalidate); options.Add("flags", true); var results = Operation.Call("magickload", options, filename) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; flags = (Enums.ForeignFlags)opts?["flags"]; return finalResult; } /// /// Load buffer with ImageMagick. /// /// /// /// using Image @out = NetVips.Image.MagickloadBuffer(buffer, density: string, page: int, n: int, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Buffer to load from. /// Canvas resolution for rendering vector formats like SVG. /// First page to load. /// Number of pages to load, -1 for all. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image MagickloadBuffer(byte[] buffer, string density = null, int? page = null, int? n = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(density), density); options.AddIfPresent(nameof(page), page); options.AddIfPresent(nameof(n), n); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); return Operation.Call("magickload_buffer", options, buffer) as Image; } /// /// Load buffer with ImageMagick. /// /// /// /// using Image @out = NetVips.Image.MagickloadBuffer(buffer, out var flags, density: string, page: int, n: int, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Buffer to load from. /// Flags for this file. /// Canvas resolution for rendering vector formats like SVG. /// First page to load. /// Number of pages to load, -1 for all. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image MagickloadBuffer(byte[] buffer, out Enums.ForeignFlags flags, string density = null, int? page = null, int? n = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(density), density); options.AddIfPresent(nameof(page), page); options.AddIfPresent(nameof(n), n); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.Add("flags", true); var results = Operation.Call("magickload_buffer", options, buffer) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; flags = (Enums.ForeignFlags)opts?["flags"]; return finalResult; } /// /// Save file with ImageMagick. /// /// /// /// in.Magicksave(filename, format: string, quality: int, optimizeGifFrames: bool, optimizeGifTransparency: bool, bitdepth: int, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Filename to save to. /// Format to save in. /// Quality to use. /// Apply GIF frames optimization. /// Apply GIF transparency optimization. /// Number of bits per pixel. /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. public void Magicksave(string filename, string format = null, int? quality = null, bool? optimizeGifFrames = null, bool? optimizeGifTransparency = null, int? bitdepth = null, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { var options = new VOption(); options.AddIfPresent(nameof(format), format); options.AddIfPresent(nameof(quality), quality); options.AddIfPresent("optimize_gif_frames", optimizeGifFrames); options.AddIfPresent("optimize_gif_transparency", optimizeGifTransparency); options.AddIfPresent(nameof(bitdepth), bitdepth); options.AddForeignKeep(keep); options.AddIfPresent(nameof(background), background); options.AddIfPresent("page_height", pageHeight); options.AddIfPresent(nameof(profile), profile); this.Call("magicksave", options, filename); } /// /// Save image to magick buffer. /// /// /// /// byte[] buffer = in.MagicksaveBuffer(format: string, quality: int, optimizeGifFrames: bool, optimizeGifTransparency: bool, bitdepth: int, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Format to save in. /// Quality to use. /// Apply GIF frames optimization. /// Apply GIF transparency optimization. /// Number of bits per pixel. /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. /// An array of bytes. public byte[] MagicksaveBuffer(string format = null, int? quality = null, bool? optimizeGifFrames = null, bool? optimizeGifTransparency = null, int? bitdepth = null, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { var options = new VOption(); options.AddIfPresent(nameof(format), format); options.AddIfPresent(nameof(quality), quality); options.AddIfPresent("optimize_gif_frames", optimizeGifFrames); options.AddIfPresent("optimize_gif_transparency", optimizeGifTransparency); options.AddIfPresent(nameof(bitdepth), bitdepth); options.AddForeignKeep(keep); options.AddIfPresent(nameof(background), background); options.AddIfPresent("page_height", pageHeight); options.AddIfPresent(nameof(profile), profile); return this.Call("magicksave_buffer", options) as byte[]; } /// /// Resample with a map image. /// /// /// /// using Image @out = in.Mapim(index, interpolate: GObject, background: double[], premultiplied: bool, extend: Enums.Extend); /// /// /// Index pixels with this. /// Interpolate pixels with this. /// Background value. /// Images have premultiplied alpha. /// How to generate the extra pixels. /// A new . public Image Mapim(Image index, GObject interpolate = null, double[] background = null, bool? premultiplied = null, Enums.Extend? extend = null) { var options = new VOption(); options.AddIfPresent(nameof(interpolate), interpolate); options.AddIfPresent(nameof(background), background); options.AddIfPresent(nameof(premultiplied), premultiplied); options.AddIfPresent(nameof(extend), extend); return this.Call("mapim", options, index) as Image; } /// /// Map an image though a lut. /// /// /// /// using Image @out = in.Maplut(lut, band: int); /// /// /// Look-up table image. /// Apply one-band lut to this band of in. /// A new . public Image Maplut(Image lut, int? band = null) { var options = new VOption(); options.AddIfPresent(nameof(band), band); return this.Call("maplut", options, lut) as Image; } /// /// Make a butterworth filter. /// /// /// /// using Image @out = NetVips.Image.MaskButterworth(width, height, order, frequencyCutoff, amplitudeCutoff, uchar: bool, nodc: bool, reject: bool, optical: bool); /// /// /// Image width in pixels. /// Image height in pixels. /// Filter order. /// Frequency cutoff. /// Amplitude cutoff. /// Output an unsigned char image. /// Remove DC component. /// Invert the sense of the filter. /// Rotate quadrants to optical space. /// A new . public static Image MaskButterworth(int width, int height, double order, double frequencyCutoff, double amplitudeCutoff, bool? uchar = null, bool? nodc = null, bool? reject = null, bool? optical = null) { var options = new VOption(); options.AddIfPresent(nameof(uchar), uchar); options.AddIfPresent(nameof(nodc), nodc); options.AddIfPresent(nameof(reject), reject); options.AddIfPresent(nameof(optical), optical); return Operation.Call("mask_butterworth", options, width, height, order, frequencyCutoff, amplitudeCutoff) as Image; } /// /// Make a butterworth_band filter. /// /// /// /// using Image @out = NetVips.Image.MaskButterworthBand(width, height, order, frequencyCutoffX, frequencyCutoffY, radius, amplitudeCutoff, uchar: bool, nodc: bool, reject: bool, optical: bool); /// /// /// Image width in pixels. /// Image height in pixels. /// Filter order. /// Frequency cutoff x. /// Frequency cutoff y. /// Radius of circle. /// Amplitude cutoff. /// Output an unsigned char image. /// Remove DC component. /// Invert the sense of the filter. /// Rotate quadrants to optical space. /// A new . public static Image MaskButterworthBand(int width, int height, double order, double frequencyCutoffX, double frequencyCutoffY, double radius, double amplitudeCutoff, bool? uchar = null, bool? nodc = null, bool? reject = null, bool? optical = null) { var options = new VOption(); options.AddIfPresent(nameof(uchar), uchar); options.AddIfPresent(nameof(nodc), nodc); options.AddIfPresent(nameof(reject), reject); options.AddIfPresent(nameof(optical), optical); return Operation.Call("mask_butterworth_band", options, width, height, order, frequencyCutoffX, frequencyCutoffY, radius, amplitudeCutoff) as Image; } /// /// Make a butterworth ring filter. /// /// /// /// using Image @out = NetVips.Image.MaskButterworthRing(width, height, order, frequencyCutoff, amplitudeCutoff, ringwidth, uchar: bool, nodc: bool, reject: bool, optical: bool); /// /// /// Image width in pixels. /// Image height in pixels. /// Filter order. /// Frequency cutoff. /// Amplitude cutoff. /// Ringwidth. /// Output an unsigned char image. /// Remove DC component. /// Invert the sense of the filter. /// Rotate quadrants to optical space. /// A new . public static Image MaskButterworthRing(int width, int height, double order, double frequencyCutoff, double amplitudeCutoff, double ringwidth, bool? uchar = null, bool? nodc = null, bool? reject = null, bool? optical = null) { var options = new VOption(); options.AddIfPresent(nameof(uchar), uchar); options.AddIfPresent(nameof(nodc), nodc); options.AddIfPresent(nameof(reject), reject); options.AddIfPresent(nameof(optical), optical); return Operation.Call("mask_butterworth_ring", options, width, height, order, frequencyCutoff, amplitudeCutoff, ringwidth) as Image; } /// /// Make fractal filter. /// /// /// /// using Image @out = NetVips.Image.MaskFractal(width, height, fractalDimension, uchar: bool, nodc: bool, reject: bool, optical: bool); /// /// /// Image width in pixels. /// Image height in pixels. /// Fractal dimension. /// Output an unsigned char image. /// Remove DC component. /// Invert the sense of the filter. /// Rotate quadrants to optical space. /// A new . public static Image MaskFractal(int width, int height, double fractalDimension, bool? uchar = null, bool? nodc = null, bool? reject = null, bool? optical = null) { var options = new VOption(); options.AddIfPresent(nameof(uchar), uchar); options.AddIfPresent(nameof(nodc), nodc); options.AddIfPresent(nameof(reject), reject); options.AddIfPresent(nameof(optical), optical); return Operation.Call("mask_fractal", options, width, height, fractalDimension) as Image; } /// /// Make a gaussian filter. /// /// /// /// using Image @out = NetVips.Image.MaskGaussian(width, height, frequencyCutoff, amplitudeCutoff, uchar: bool, nodc: bool, reject: bool, optical: bool); /// /// /// Image width in pixels. /// Image height in pixels. /// Frequency cutoff. /// Amplitude cutoff. /// Output an unsigned char image. /// Remove DC component. /// Invert the sense of the filter. /// Rotate quadrants to optical space. /// A new . public static Image MaskGaussian(int width, int height, double frequencyCutoff, double amplitudeCutoff, bool? uchar = null, bool? nodc = null, bool? reject = null, bool? optical = null) { var options = new VOption(); options.AddIfPresent(nameof(uchar), uchar); options.AddIfPresent(nameof(nodc), nodc); options.AddIfPresent(nameof(reject), reject); options.AddIfPresent(nameof(optical), optical); return Operation.Call("mask_gaussian", options, width, height, frequencyCutoff, amplitudeCutoff) as Image; } /// /// Make a gaussian filter. /// /// /// /// using Image @out = NetVips.Image.MaskGaussianBand(width, height, frequencyCutoffX, frequencyCutoffY, radius, amplitudeCutoff, uchar: bool, nodc: bool, reject: bool, optical: bool); /// /// /// Image width in pixels. /// Image height in pixels. /// Frequency cutoff x. /// Frequency cutoff y. /// Radius of circle. /// Amplitude cutoff. /// Output an unsigned char image. /// Remove DC component. /// Invert the sense of the filter. /// Rotate quadrants to optical space. /// A new . public static Image MaskGaussianBand(int width, int height, double frequencyCutoffX, double frequencyCutoffY, double radius, double amplitudeCutoff, bool? uchar = null, bool? nodc = null, bool? reject = null, bool? optical = null) { var options = new VOption(); options.AddIfPresent(nameof(uchar), uchar); options.AddIfPresent(nameof(nodc), nodc); options.AddIfPresent(nameof(reject), reject); options.AddIfPresent(nameof(optical), optical); return Operation.Call("mask_gaussian_band", options, width, height, frequencyCutoffX, frequencyCutoffY, radius, amplitudeCutoff) as Image; } /// /// Make a gaussian ring filter. /// /// /// /// using Image @out = NetVips.Image.MaskGaussianRing(width, height, frequencyCutoff, amplitudeCutoff, ringwidth, uchar: bool, nodc: bool, reject: bool, optical: bool); /// /// /// Image width in pixels. /// Image height in pixels. /// Frequency cutoff. /// Amplitude cutoff. /// Ringwidth. /// Output an unsigned char image. /// Remove DC component. /// Invert the sense of the filter. /// Rotate quadrants to optical space. /// A new . public static Image MaskGaussianRing(int width, int height, double frequencyCutoff, double amplitudeCutoff, double ringwidth, bool? uchar = null, bool? nodc = null, bool? reject = null, bool? optical = null) { var options = new VOption(); options.AddIfPresent(nameof(uchar), uchar); options.AddIfPresent(nameof(nodc), nodc); options.AddIfPresent(nameof(reject), reject); options.AddIfPresent(nameof(optical), optical); return Operation.Call("mask_gaussian_ring", options, width, height, frequencyCutoff, amplitudeCutoff, ringwidth) as Image; } /// /// Make an ideal filter. /// /// /// /// using Image @out = NetVips.Image.MaskIdeal(width, height, frequencyCutoff, uchar: bool, nodc: bool, reject: bool, optical: bool); /// /// /// Image width in pixels. /// Image height in pixels. /// Frequency cutoff. /// Output an unsigned char image. /// Remove DC component. /// Invert the sense of the filter. /// Rotate quadrants to optical space. /// A new . public static Image MaskIdeal(int width, int height, double frequencyCutoff, bool? uchar = null, bool? nodc = null, bool? reject = null, bool? optical = null) { var options = new VOption(); options.AddIfPresent(nameof(uchar), uchar); options.AddIfPresent(nameof(nodc), nodc); options.AddIfPresent(nameof(reject), reject); options.AddIfPresent(nameof(optical), optical); return Operation.Call("mask_ideal", options, width, height, frequencyCutoff) as Image; } /// /// Make an ideal band filter. /// /// /// /// using Image @out = NetVips.Image.MaskIdealBand(width, height, frequencyCutoffX, frequencyCutoffY, radius, uchar: bool, nodc: bool, reject: bool, optical: bool); /// /// /// Image width in pixels. /// Image height in pixels. /// Frequency cutoff x. /// Frequency cutoff y. /// Radius of circle. /// Output an unsigned char image. /// Remove DC component. /// Invert the sense of the filter. /// Rotate quadrants to optical space. /// A new . public static Image MaskIdealBand(int width, int height, double frequencyCutoffX, double frequencyCutoffY, double radius, bool? uchar = null, bool? nodc = null, bool? reject = null, bool? optical = null) { var options = new VOption(); options.AddIfPresent(nameof(uchar), uchar); options.AddIfPresent(nameof(nodc), nodc); options.AddIfPresent(nameof(reject), reject); options.AddIfPresent(nameof(optical), optical); return Operation.Call("mask_ideal_band", options, width, height, frequencyCutoffX, frequencyCutoffY, radius) as Image; } /// /// Make an ideal ring filter. /// /// /// /// using Image @out = NetVips.Image.MaskIdealRing(width, height, frequencyCutoff, ringwidth, uchar: bool, nodc: bool, reject: bool, optical: bool); /// /// /// Image width in pixels. /// Image height in pixels. /// Frequency cutoff. /// Ringwidth. /// Output an unsigned char image. /// Remove DC component. /// Invert the sense of the filter. /// Rotate quadrants to optical space. /// A new . public static Image MaskIdealRing(int width, int height, double frequencyCutoff, double ringwidth, bool? uchar = null, bool? nodc = null, bool? reject = null, bool? optical = null) { var options = new VOption(); options.AddIfPresent(nameof(uchar), uchar); options.AddIfPresent(nameof(nodc), nodc); options.AddIfPresent(nameof(reject), reject); options.AddIfPresent(nameof(optical), optical); return Operation.Call("mask_ideal_ring", options, width, height, frequencyCutoff, ringwidth) as Image; } /// /// First-order match of two images. /// /// /// /// using Image @out = ref.Match(sec, xr1, yr1, xs1, ys1, xr2, yr2, xs2, ys2, hwindow: int, harea: int, search: bool, interpolate: GObject); /// /// /// Secondary image. /// Position of first reference tie-point. /// Position of first reference tie-point. /// Position of first secondary tie-point. /// Position of first secondary tie-point. /// Position of second reference tie-point. /// Position of second reference tie-point. /// Position of second secondary tie-point. /// Position of second secondary tie-point. /// Half window size. /// Half area size. /// Search to improve tie-points. /// Interpolate pixels with this. /// A new . public Image Match(Image sec, int xr1, int yr1, int xs1, int ys1, int xr2, int yr2, int xs2, int ys2, int? hwindow = null, int? harea = null, bool? search = null, GObject interpolate = null) { var options = new VOption(); options.AddIfPresent(nameof(hwindow), hwindow); options.AddIfPresent(nameof(harea), harea); options.AddIfPresent(nameof(search), search); options.AddIfPresent(nameof(interpolate), interpolate); return this.Call("match", options, sec, xr1, yr1, xs1, ys1, xr2, yr2, xs2, ys2) as Image; } /// /// Apply a math operation to an image. /// /// /// /// using Image @out = in.Math(math); /// /// /// Math to perform. /// A new . public Image Math(Enums.OperationMath math) { return this.Call("math", math) as Image; } /// /// Binary math operations. /// /// /// /// using Image @out = left.Math2(right, math2); /// /// /// Right-hand image argument. /// Math to perform. /// A new . public Image Math2(Image right, Enums.OperationMath2 math2) { return this.Call("math2", right, math2) as Image; } /// /// Binary math operations with a constant. /// /// /// /// using Image @out = in.Math2Const(math2, c); /// /// /// Math to perform. /// Array of constants. /// A new . public Image Math2Const(Enums.OperationMath2 math2, double[] c) { return this.Call("math2_const", math2, c) as Image; } /// /// Load mat from file. /// /// /// /// using Image @out = NetVips.Image.Matload(filename, memory: bool, access: Enums.Access, failOn: Enums.FailOn, revalidate: bool); /// /// /// Filename to load from. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// Don't use a cached result for this operation. /// A new . public static Image Matload(string filename, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null, bool? revalidate = null) { var options = new VOption(); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.AddIfPresent(nameof(revalidate), revalidate); return Operation.Call("matload", options, filename) as Image; } /// /// Load mat from file. /// /// /// /// using Image @out = NetVips.Image.Matload(filename, out var flags, memory: bool, access: Enums.Access, failOn: Enums.FailOn, revalidate: bool); /// /// /// Filename to load from. /// Flags for this file. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// Don't use a cached result for this operation. /// A new . public static Image Matload(string filename, out Enums.ForeignFlags flags, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null, bool? revalidate = null) { var options = new VOption(); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.AddIfPresent(nameof(revalidate), revalidate); options.Add("flags", true); var results = Operation.Call("matload", options, filename) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; flags = (Enums.ForeignFlags)opts?["flags"]; return finalResult; } /// /// Invert a matrix. /// /// /// /// using Image @out = in.Matrixinvert(); /// /// /// A new . public Image Matrixinvert() { return this.Call("matrixinvert") as Image; } /// /// Load matrix. /// /// /// /// using Image @out = NetVips.Image.Matrixload(filename, memory: bool, access: Enums.Access, failOn: Enums.FailOn, revalidate: bool); /// /// /// Filename to load from. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// Don't use a cached result for this operation. /// A new . public static Image Matrixload(string filename, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null, bool? revalidate = null) { var options = new VOption(); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.AddIfPresent(nameof(revalidate), revalidate); return Operation.Call("matrixload", options, filename) as Image; } /// /// Load matrix. /// /// /// /// using Image @out = NetVips.Image.Matrixload(filename, out var flags, memory: bool, access: Enums.Access, failOn: Enums.FailOn, revalidate: bool); /// /// /// Filename to load from. /// Flags for this file. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// Don't use a cached result for this operation. /// A new . public static Image Matrixload(string filename, out Enums.ForeignFlags flags, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null, bool? revalidate = null) { var options = new VOption(); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.AddIfPresent(nameof(revalidate), revalidate); options.Add("flags", true); var results = Operation.Call("matrixload", options, filename) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; flags = (Enums.ForeignFlags)opts?["flags"]; return finalResult; } /// /// Load matrix. /// /// /// /// using Image @out = NetVips.Image.MatrixloadSource(source, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Source to load from. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image MatrixloadSource(Source source, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); return Operation.Call("matrixload_source", options, source) as Image; } /// /// Load matrix. /// /// /// /// using Image @out = NetVips.Image.MatrixloadStream(stream, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Stream to load from. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image MatrixloadStream(Stream stream, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var source = SourceStream.NewFromStream(stream); var image = MatrixloadSource(source, memory, access, failOn); image.OnPostClose += () => source.Dispose(); return image; } /// /// Load matrix. /// /// /// /// using Image @out = NetVips.Image.MatrixloadSource(source, out var flags, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Source to load from. /// Flags for this file. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image MatrixloadSource(Source source, out Enums.ForeignFlags flags, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.Add("flags", true); var results = Operation.Call("matrixload_source", options, source) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; flags = (Enums.ForeignFlags)opts?["flags"]; return finalResult; } /// /// Load matrix. /// /// /// /// using Image @out = NetVips.Image.MatrixloadStream(stream, out var flags, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Stream to load from. /// Flags for this file. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image MatrixloadStream(Stream stream, out Enums.ForeignFlags flags, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var source = SourceStream.NewFromStream(stream); var image = MatrixloadSource(source, out flags, memory, access, failOn); image.OnPostClose += () => source.Dispose(); return image; } /// /// Multiply two matrices. /// /// /// /// using Image @out = left.Matrixmultiply(right); /// /// /// Second matrix to multiply. /// A new . public Image Matrixmultiply(Image right) { return this.Call("matrixmultiply", right) as Image; } /// /// Print matrix. /// /// /// /// in.Matrixprint(keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. public void Matrixprint(Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { var options = new VOption(); options.AddForeignKeep(keep); options.AddIfPresent(nameof(background), background); options.AddIfPresent("page_height", pageHeight); options.AddIfPresent(nameof(profile), profile); this.Call("matrixprint", options); } /// /// Save image to matrix. /// /// /// /// in.Matrixsave(filename, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Filename to save to. /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. public void Matrixsave(string filename, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { var options = new VOption(); options.AddForeignKeep(keep); options.AddIfPresent(nameof(background), background); options.AddIfPresent("page_height", pageHeight); options.AddIfPresent(nameof(profile), profile); this.Call("matrixsave", options, filename); } /// /// Save image to matrix. /// /// /// /// in.MatrixsaveTarget(target, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Target to save to. /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. public void MatrixsaveTarget(Target target, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { var options = new VOption(); options.AddForeignKeep(keep); options.AddIfPresent(nameof(background), background); options.AddIfPresent("page_height", pageHeight); options.AddIfPresent(nameof(profile), profile); this.Call("matrixsave_target", options, target); } /// /// Save image to matrix. /// /// /// /// in.MatrixsaveStream(stream, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Stream to save to. /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. public void MatrixsaveStream(Stream stream, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { using var target = TargetStream.NewFromStream(stream); MatrixsaveTarget(target, keep, background, pageHeight, profile); } /// /// Find image maximum. /// /// /// /// double @out = in.Max(size: int); /// /// /// Number of maximum values to find. /// A double. public double Max(int? size = null) { var options = new VOption(); options.AddIfPresent(nameof(size), size); return this.Call("max", options) is double result ? result : 0d; } /// /// Find image maximum. /// /// /// /// double @out = in.Max(out var x, size: int); /// /// /// Horizontal position of maximum. /// Number of maximum values to find. /// A double. public double Max(out int x, int? size = null) { var options = new VOption(); options.AddIfPresent(nameof(size), size); options.Add("x", true); var results = this.Call("max", options) as object[]; var finalResult = results?[0] is double result ? result : 0d; var opts = results?[1] as VOption; x = opts?["x"] is int out1 ? out1 : 0; return finalResult; } /// /// Find image maximum. /// /// /// /// double @out = in.Max(out var x, out var y, size: int); /// /// /// Horizontal position of maximum. /// Vertical position of maximum. /// Number of maximum values to find. /// A double. public double Max(out int x, out int y, int? size = null) { var options = new VOption(); options.AddIfPresent(nameof(size), size); options.Add("x", true); options.Add("y", true); var results = this.Call("max", options) as object[]; var finalResult = results?[0] is double result ? result : 0d; var opts = results?[1] as VOption; x = opts?["x"] is int out1 ? out1 : 0; y = opts?["y"] is int out2 ? out2 : 0; return finalResult; } /// /// Find image maximum. /// /// /// /// double @out = in.Max(out var x, out var y, out var outArray, size: int); /// /// /// Horizontal position of maximum. /// Vertical position of maximum. /// Array of output values. /// Number of maximum values to find. /// A double. public double Max(out int x, out int y, out double[] outArray, int? size = null) { var options = new VOption(); options.AddIfPresent(nameof(size), size); options.Add("x", true); options.Add("y", true); options.Add("out_array", true); var results = this.Call("max", options) as object[]; var finalResult = results?[0] is double result ? result : 0d; var opts = results?[1] as VOption; x = opts?["x"] is int out1 ? out1 : 0; y = opts?["y"] is int out2 ? out2 : 0; outArray = opts?["out_array"] as double[]; return finalResult; } /// /// Find image maximum. /// /// /// /// double @out = in.Max(out var x, out var y, out var outArray, out var xArray, size: int); /// /// /// Horizontal position of maximum. /// Vertical position of maximum. /// Array of output values. /// Array of horizontal positions. /// Number of maximum values to find. /// A double. public double Max(out int x, out int y, out double[] outArray, out int[] xArray, int? size = null) { var options = new VOption(); options.AddIfPresent(nameof(size), size); options.Add("x", true); options.Add("y", true); options.Add("out_array", true); options.Add("x_array", true); var results = this.Call("max", options) as object[]; var finalResult = results?[0] is double result ? result : 0d; var opts = results?[1] as VOption; x = opts?["x"] is int out1 ? out1 : 0; y = opts?["y"] is int out2 ? out2 : 0; outArray = opts?["out_array"] as double[]; xArray = opts?["x_array"] as int[]; return finalResult; } /// /// Find image maximum. /// /// /// /// double @out = in.Max(out var x, out var y, out var outArray, out var xArray, out var yArray, size: int); /// /// /// Horizontal position of maximum. /// Vertical position of maximum. /// Array of output values. /// Array of horizontal positions. /// Array of vertical positions. /// Number of maximum values to find. /// A double. public double Max(out int x, out int y, out double[] outArray, out int[] xArray, out int[] yArray, int? size = null) { var options = new VOption(); options.AddIfPresent(nameof(size), size); options.Add("x", true); options.Add("y", true); options.Add("out_array", true); options.Add("x_array", true); options.Add("y_array", true); var results = this.Call("max", options) as object[]; var finalResult = results?[0] is double result ? result : 0d; var opts = results?[1] as VOption; x = opts?["x"] is int out1 ? out1 : 0; y = opts?["y"] is int out2 ? out2 : 0; outArray = opts?["out_array"] as double[]; xArray = opts?["x_array"] as int[]; yArray = opts?["y_array"] as int[]; return finalResult; } /// /// Maximum of a pair of images. /// /// /// /// using Image @out = left.Maxpair(right); /// /// /// Right-hand image argument. /// A new . public Image Maxpair(Image right) { return this.Call("maxpair", right) as Image; } /// /// Measure a set of patches on a color chart. /// /// /// /// using Image @out = in.Measure(h, v, left: int, top: int, width: int, height: int); /// /// /// Number of patches across chart. /// Number of patches down chart. /// Left edge of extract area. /// Top edge of extract area. /// Width of extract area. /// Height of extract area. /// A new . public Image Measure(int h, int v, int? left = null, int? top = null, int? width = null, int? height = null) { var options = new VOption(); options.AddIfPresent(nameof(left), left); options.AddIfPresent(nameof(top), top); options.AddIfPresent(nameof(width), width); options.AddIfPresent(nameof(height), height); return this.Call("measure", options, h, v) as Image; } /// /// Merge two images. /// /// /// /// using Image @out = ref.Merge(sec, direction, dx, dy, mblend: int); /// /// /// Secondary image. /// Horizontal or vertical merge. /// Horizontal displacement from sec to ref. /// Vertical displacement from sec to ref. /// Maximum blend size. /// A new . public Image Merge(Image sec, Enums.Direction direction, int dx, int dy, int? mblend = null) { var options = new VOption(); options.AddIfPresent(nameof(mblend), mblend); return this.Call("merge", options, sec, direction, dx, dy) as Image; } /// /// Find image minimum. /// /// /// /// double @out = in.Min(size: int); /// /// /// Number of minimum values to find. /// A double. public double Min(int? size = null) { var options = new VOption(); options.AddIfPresent(nameof(size), size); return this.Call("min", options) is double result ? result : 0d; } /// /// Find image minimum. /// /// /// /// double @out = in.Min(out var x, size: int); /// /// /// Horizontal position of minimum. /// Number of minimum values to find. /// A double. public double Min(out int x, int? size = null) { var options = new VOption(); options.AddIfPresent(nameof(size), size); options.Add("x", true); var results = this.Call("min", options) as object[]; var finalResult = results?[0] is double result ? result : 0d; var opts = results?[1] as VOption; x = opts?["x"] is int out1 ? out1 : 0; return finalResult; } /// /// Find image minimum. /// /// /// /// double @out = in.Min(out var x, out var y, size: int); /// /// /// Horizontal position of minimum. /// Vertical position of minimum. /// Number of minimum values to find. /// A double. public double Min(out int x, out int y, int? size = null) { var options = new VOption(); options.AddIfPresent(nameof(size), size); options.Add("x", true); options.Add("y", true); var results = this.Call("min", options) as object[]; var finalResult = results?[0] is double result ? result : 0d; var opts = results?[1] as VOption; x = opts?["x"] is int out1 ? out1 : 0; y = opts?["y"] is int out2 ? out2 : 0; return finalResult; } /// /// Find image minimum. /// /// /// /// double @out = in.Min(out var x, out var y, out var outArray, size: int); /// /// /// Horizontal position of minimum. /// Vertical position of minimum. /// Array of output values. /// Number of minimum values to find. /// A double. public double Min(out int x, out int y, out double[] outArray, int? size = null) { var options = new VOption(); options.AddIfPresent(nameof(size), size); options.Add("x", true); options.Add("y", true); options.Add("out_array", true); var results = this.Call("min", options) as object[]; var finalResult = results?[0] is double result ? result : 0d; var opts = results?[1] as VOption; x = opts?["x"] is int out1 ? out1 : 0; y = opts?["y"] is int out2 ? out2 : 0; outArray = opts?["out_array"] as double[]; return finalResult; } /// /// Find image minimum. /// /// /// /// double @out = in.Min(out var x, out var y, out var outArray, out var xArray, size: int); /// /// /// Horizontal position of minimum. /// Vertical position of minimum. /// Array of output values. /// Array of horizontal positions. /// Number of minimum values to find. /// A double. public double Min(out int x, out int y, out double[] outArray, out int[] xArray, int? size = null) { var options = new VOption(); options.AddIfPresent(nameof(size), size); options.Add("x", true); options.Add("y", true); options.Add("out_array", true); options.Add("x_array", true); var results = this.Call("min", options) as object[]; var finalResult = results?[0] is double result ? result : 0d; var opts = results?[1] as VOption; x = opts?["x"] is int out1 ? out1 : 0; y = opts?["y"] is int out2 ? out2 : 0; outArray = opts?["out_array"] as double[]; xArray = opts?["x_array"] as int[]; return finalResult; } /// /// Find image minimum. /// /// /// /// double @out = in.Min(out var x, out var y, out var outArray, out var xArray, out var yArray, size: int); /// /// /// Horizontal position of minimum. /// Vertical position of minimum. /// Array of output values. /// Array of horizontal positions. /// Array of vertical positions. /// Number of minimum values to find. /// A double. public double Min(out int x, out int y, out double[] outArray, out int[] xArray, out int[] yArray, int? size = null) { var options = new VOption(); options.AddIfPresent(nameof(size), size); options.Add("x", true); options.Add("y", true); options.Add("out_array", true); options.Add("x_array", true); options.Add("y_array", true); var results = this.Call("min", options) as object[]; var finalResult = results?[0] is double result ? result : 0d; var opts = results?[1] as VOption; x = opts?["x"] is int out1 ? out1 : 0; y = opts?["y"] is int out2 ? out2 : 0; outArray = opts?["out_array"] as double[]; xArray = opts?["x_array"] as int[]; yArray = opts?["y_array"] as int[]; return finalResult; } /// /// Minimum of a pair of images. /// /// /// /// using Image @out = left.Minpair(right); /// /// /// Right-hand image argument. /// A new . public Image Minpair(Image right) { return this.Call("minpair", right) as Image; } /// /// Morphology operation. /// /// /// /// using Image @out = in.Morph(mask, morph); /// /// /// Input matrix image. /// Morphological operation to perform. /// A new . public Image Morph(Image mask, Enums.OperationMorphology morph) { return this.Call("morph", mask, morph) as Image; } /// /// Mosaic two images. /// /// /// /// using Image @out = ref.Mosaic(sec, direction, xref, yref, xsec, ysec, hwindow: int, harea: int, mblend: int, bandno: int); /// /// /// Secondary image. /// Horizontal or vertical mosaic. /// Position of reference tie-point. /// Position of reference tie-point. /// Position of secondary tie-point. /// Position of secondary tie-point. /// Half window size. /// Half area size. /// Maximum blend size. /// Band to search for features on. /// A new . public Image Mosaic(Image sec, Enums.Direction direction, int xref, int yref, int xsec, int ysec, int? hwindow = null, int? harea = null, int? mblend = null, int? bandno = null) { var options = new VOption(); options.AddIfPresent(nameof(hwindow), hwindow); options.AddIfPresent(nameof(harea), harea); options.AddIfPresent(nameof(mblend), mblend); options.AddIfPresent(nameof(bandno), bandno); return this.Call("mosaic", options, sec, direction, xref, yref, xsec, ysec) as Image; } /// /// Mosaic two images. /// /// /// /// using Image @out = ref.Mosaic(sec, direction, xref, yref, xsec, ysec, out var dx0, hwindow: int, harea: int, mblend: int, bandno: int); /// /// /// Secondary image. /// Horizontal or vertical mosaic. /// Position of reference tie-point. /// Position of reference tie-point. /// Position of secondary tie-point. /// Position of secondary tie-point. /// Detected integer offset. /// Half window size. /// Half area size. /// Maximum blend size. /// Band to search for features on. /// A new . public Image Mosaic(Image sec, Enums.Direction direction, int xref, int yref, int xsec, int ysec, out int dx0, int? hwindow = null, int? harea = null, int? mblend = null, int? bandno = null) { var options = new VOption(); options.AddIfPresent(nameof(hwindow), hwindow); options.AddIfPresent(nameof(harea), harea); options.AddIfPresent(nameof(mblend), mblend); options.AddIfPresent(nameof(bandno), bandno); options.Add("dx0", true); var results = this.Call("mosaic", options, sec, direction, xref, yref, xsec, ysec) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; dx0 = opts?["dx0"] is int out1 ? out1 : 0; return finalResult; } /// /// Mosaic two images. /// /// /// /// using Image @out = ref.Mosaic(sec, direction, xref, yref, xsec, ysec, out var dx0, out var dy0, hwindow: int, harea: int, mblend: int, bandno: int); /// /// /// Secondary image. /// Horizontal or vertical mosaic. /// Position of reference tie-point. /// Position of reference tie-point. /// Position of secondary tie-point. /// Position of secondary tie-point. /// Detected integer offset. /// Detected integer offset. /// Half window size. /// Half area size. /// Maximum blend size. /// Band to search for features on. /// A new . public Image Mosaic(Image sec, Enums.Direction direction, int xref, int yref, int xsec, int ysec, out int dx0, out int dy0, int? hwindow = null, int? harea = null, int? mblend = null, int? bandno = null) { var options = new VOption(); options.AddIfPresent(nameof(hwindow), hwindow); options.AddIfPresent(nameof(harea), harea); options.AddIfPresent(nameof(mblend), mblend); options.AddIfPresent(nameof(bandno), bandno); options.Add("dx0", true); options.Add("dy0", true); var results = this.Call("mosaic", options, sec, direction, xref, yref, xsec, ysec) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; dx0 = opts?["dx0"] is int out1 ? out1 : 0; dy0 = opts?["dy0"] is int out2 ? out2 : 0; return finalResult; } /// /// Mosaic two images. /// /// /// /// using Image @out = ref.Mosaic(sec, direction, xref, yref, xsec, ysec, out var dx0, out var dy0, out var scale1, hwindow: int, harea: int, mblend: int, bandno: int); /// /// /// Secondary image. /// Horizontal or vertical mosaic. /// Position of reference tie-point. /// Position of reference tie-point. /// Position of secondary tie-point. /// Position of secondary tie-point. /// Detected integer offset. /// Detected integer offset. /// Detected scale. /// Half window size. /// Half area size. /// Maximum blend size. /// Band to search for features on. /// A new . public Image Mosaic(Image sec, Enums.Direction direction, int xref, int yref, int xsec, int ysec, out int dx0, out int dy0, out double scale1, int? hwindow = null, int? harea = null, int? mblend = null, int? bandno = null) { var options = new VOption(); options.AddIfPresent(nameof(hwindow), hwindow); options.AddIfPresent(nameof(harea), harea); options.AddIfPresent(nameof(mblend), mblend); options.AddIfPresent(nameof(bandno), bandno); options.Add("dx0", true); options.Add("dy0", true); options.Add("scale1", true); var results = this.Call("mosaic", options, sec, direction, xref, yref, xsec, ysec) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; dx0 = opts?["dx0"] is int out1 ? out1 : 0; dy0 = opts?["dy0"] is int out2 ? out2 : 0; scale1 = opts?["scale1"] is double out3 ? out3 : 0d; return finalResult; } /// /// Mosaic two images. /// /// /// /// using Image @out = ref.Mosaic(sec, direction, xref, yref, xsec, ysec, out var dx0, out var dy0, out var scale1, out var angle1, hwindow: int, harea: int, mblend: int, bandno: int); /// /// /// Secondary image. /// Horizontal or vertical mosaic. /// Position of reference tie-point. /// Position of reference tie-point. /// Position of secondary tie-point. /// Position of secondary tie-point. /// Detected integer offset. /// Detected integer offset. /// Detected scale. /// Detected rotation. /// Half window size. /// Half area size. /// Maximum blend size. /// Band to search for features on. /// A new . public Image Mosaic(Image sec, Enums.Direction direction, int xref, int yref, int xsec, int ysec, out int dx0, out int dy0, out double scale1, out double angle1, int? hwindow = null, int? harea = null, int? mblend = null, int? bandno = null) { var options = new VOption(); options.AddIfPresent(nameof(hwindow), hwindow); options.AddIfPresent(nameof(harea), harea); options.AddIfPresent(nameof(mblend), mblend); options.AddIfPresent(nameof(bandno), bandno); options.Add("dx0", true); options.Add("dy0", true); options.Add("scale1", true); options.Add("angle1", true); var results = this.Call("mosaic", options, sec, direction, xref, yref, xsec, ysec) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; dx0 = opts?["dx0"] is int out1 ? out1 : 0; dy0 = opts?["dy0"] is int out2 ? out2 : 0; scale1 = opts?["scale1"] is double out3 ? out3 : 0d; angle1 = opts?["angle1"] is double out4 ? out4 : 0d; return finalResult; } /// /// Mosaic two images. /// /// /// /// using Image @out = ref.Mosaic(sec, direction, xref, yref, xsec, ysec, out var dx0, out var dy0, out var scale1, out var angle1, out var dy1, hwindow: int, harea: int, mblend: int, bandno: int); /// /// /// Secondary image. /// Horizontal or vertical mosaic. /// Position of reference tie-point. /// Position of reference tie-point. /// Position of secondary tie-point. /// Position of secondary tie-point. /// Detected integer offset. /// Detected integer offset. /// Detected scale. /// Detected rotation. /// Detected first-order displacement. /// Half window size. /// Half area size. /// Maximum blend size. /// Band to search for features on. /// A new . public Image Mosaic(Image sec, Enums.Direction direction, int xref, int yref, int xsec, int ysec, out int dx0, out int dy0, out double scale1, out double angle1, out double dy1, int? hwindow = null, int? harea = null, int? mblend = null, int? bandno = null) { var options = new VOption(); options.AddIfPresent(nameof(hwindow), hwindow); options.AddIfPresent(nameof(harea), harea); options.AddIfPresent(nameof(mblend), mblend); options.AddIfPresent(nameof(bandno), bandno); options.Add("dx0", true); options.Add("dy0", true); options.Add("scale1", true); options.Add("angle1", true); options.Add("dy1", true); var results = this.Call("mosaic", options, sec, direction, xref, yref, xsec, ysec) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; dx0 = opts?["dx0"] is int out1 ? out1 : 0; dy0 = opts?["dy0"] is int out2 ? out2 : 0; scale1 = opts?["scale1"] is double out3 ? out3 : 0d; angle1 = opts?["angle1"] is double out4 ? out4 : 0d; dy1 = opts?["dy1"] is double out5 ? out5 : 0d; return finalResult; } /// /// Mosaic two images. /// /// /// /// using Image @out = ref.Mosaic(sec, direction, xref, yref, xsec, ysec, out var dx0, out var dy0, out var scale1, out var angle1, out var dy1, out var dx1, hwindow: int, harea: int, mblend: int, bandno: int); /// /// /// Secondary image. /// Horizontal or vertical mosaic. /// Position of reference tie-point. /// Position of reference tie-point. /// Position of secondary tie-point. /// Position of secondary tie-point. /// Detected integer offset. /// Detected integer offset. /// Detected scale. /// Detected rotation. /// Detected first-order displacement. /// Detected first-order displacement. /// Half window size. /// Half area size. /// Maximum blend size. /// Band to search for features on. /// A new . public Image Mosaic(Image sec, Enums.Direction direction, int xref, int yref, int xsec, int ysec, out int dx0, out int dy0, out double scale1, out double angle1, out double dy1, out double dx1, int? hwindow = null, int? harea = null, int? mblend = null, int? bandno = null) { var options = new VOption(); options.AddIfPresent(nameof(hwindow), hwindow); options.AddIfPresent(nameof(harea), harea); options.AddIfPresent(nameof(mblend), mblend); options.AddIfPresent(nameof(bandno), bandno); options.Add("dx0", true); options.Add("dy0", true); options.Add("scale1", true); options.Add("angle1", true); options.Add("dy1", true); options.Add("dx1", true); var results = this.Call("mosaic", options, sec, direction, xref, yref, xsec, ysec) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; dx0 = opts?["dx0"] is int out1 ? out1 : 0; dy0 = opts?["dy0"] is int out2 ? out2 : 0; scale1 = opts?["scale1"] is double out3 ? out3 : 0d; angle1 = opts?["angle1"] is double out4 ? out4 : 0d; dy1 = opts?["dy1"] is double out5 ? out5 : 0d; dx1 = opts?["dx1"] is double out6 ? out6 : 0d; return finalResult; } /// /// First-order mosaic of two images. /// /// /// /// using Image @out = ref.Mosaic1(sec, direction, xr1, yr1, xs1, ys1, xr2, yr2, xs2, ys2, hwindow: int, harea: int, search: bool, interpolate: GObject, mblend: int); /// /// /// Secondary image. /// Horizontal or vertical mosaic. /// Position of first reference tie-point. /// Position of first reference tie-point. /// Position of first secondary tie-point. /// Position of first secondary tie-point. /// Position of second reference tie-point. /// Position of second reference tie-point. /// Position of second secondary tie-point. /// Position of second secondary tie-point. /// Half window size. /// Half area size. /// Search to improve tie-points. /// Interpolate pixels with this. /// Maximum blend size. /// A new . public Image Mosaic1(Image sec, Enums.Direction direction, int xr1, int yr1, int xs1, int ys1, int xr2, int yr2, int xs2, int ys2, int? hwindow = null, int? harea = null, bool? search = null, GObject interpolate = null, int? mblend = null) { var options = new VOption(); options.AddIfPresent(nameof(hwindow), hwindow); options.AddIfPresent(nameof(harea), harea); options.AddIfPresent(nameof(search), search); options.AddIfPresent(nameof(interpolate), interpolate); options.AddIfPresent(nameof(mblend), mblend); return this.Call("mosaic1", options, sec, direction, xr1, yr1, xs1, ys1, xr2, yr2, xs2, ys2) as Image; } /// /// Pick most-significant byte from an image. /// /// /// /// using Image @out = in.Msb(band: int); /// /// /// Band to msb. /// A new . public Image Msb(int? band = null) { var options = new VOption(); options.AddIfPresent(nameof(band), band); return this.Call("msb", options) as Image; } /// /// Multiply two images. /// /// /// /// using Image @out = left.Multiply(right); /// /// /// Right-hand image argument. /// A new . public Image Multiply(Image right) { return this.Call("multiply", right) as Image; } /// /// Load NIfTI volume. /// /// /// /// using Image @out = NetVips.Image.Niftiload(filename, memory: bool, access: Enums.Access, failOn: Enums.FailOn, revalidate: bool); /// /// /// Filename to load from. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// Don't use a cached result for this operation. /// A new . public static Image Niftiload(string filename, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null, bool? revalidate = null) { var options = new VOption(); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.AddIfPresent(nameof(revalidate), revalidate); return Operation.Call("niftiload", options, filename) as Image; } /// /// Load NIfTI volume. /// /// /// /// using Image @out = NetVips.Image.Niftiload(filename, out var flags, memory: bool, access: Enums.Access, failOn: Enums.FailOn, revalidate: bool); /// /// /// Filename to load from. /// Flags for this file. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// Don't use a cached result for this operation. /// A new . public static Image Niftiload(string filename, out Enums.ForeignFlags flags, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null, bool? revalidate = null) { var options = new VOption(); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.AddIfPresent(nameof(revalidate), revalidate); options.Add("flags", true); var results = Operation.Call("niftiload", options, filename) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; flags = (Enums.ForeignFlags)opts?["flags"]; return finalResult; } /// /// Load NIfTI volumes. /// /// /// /// using Image @out = NetVips.Image.NiftiloadSource(source, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Source to load from. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image NiftiloadSource(Source source, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); return Operation.Call("niftiload_source", options, source) as Image; } /// /// Load NIfTI volumes. /// /// /// /// using Image @out = NetVips.Image.NiftiloadStream(stream, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Stream to load from. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image NiftiloadStream(Stream stream, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var source = SourceStream.NewFromStream(stream); var image = NiftiloadSource(source, memory, access, failOn); image.OnPostClose += () => source.Dispose(); return image; } /// /// Load NIfTI volumes. /// /// /// /// using Image @out = NetVips.Image.NiftiloadSource(source, out var flags, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Source to load from. /// Flags for this file. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image NiftiloadSource(Source source, out Enums.ForeignFlags flags, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.Add("flags", true); var results = Operation.Call("niftiload_source", options, source) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; flags = (Enums.ForeignFlags)opts?["flags"]; return finalResult; } /// /// Load NIfTI volumes. /// /// /// /// using Image @out = NetVips.Image.NiftiloadStream(stream, out var flags, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Stream to load from. /// Flags for this file. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image NiftiloadStream(Stream stream, out Enums.ForeignFlags flags, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var source = SourceStream.NewFromStream(stream); var image = NiftiloadSource(source, out flags, memory, access, failOn); image.OnPostClose += () => source.Dispose(); return image; } /// /// Save image to nifti file. /// /// /// /// in.Niftisave(filename, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Filename to save to. /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. public void Niftisave(string filename, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { var options = new VOption(); options.AddForeignKeep(keep); options.AddIfPresent(nameof(background), background); options.AddIfPresent("page_height", pageHeight); options.AddIfPresent(nameof(profile), profile); this.Call("niftisave", options, filename); } /// /// Load an OpenEXR image. /// /// /// /// using Image @out = NetVips.Image.Openexrload(filename, memory: bool, access: Enums.Access, failOn: Enums.FailOn, revalidate: bool); /// /// /// Filename to load from. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// Don't use a cached result for this operation. /// A new . public static Image Openexrload(string filename, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null, bool? revalidate = null) { var options = new VOption(); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.AddIfPresent(nameof(revalidate), revalidate); return Operation.Call("openexrload", options, filename) as Image; } /// /// Load an OpenEXR image. /// /// /// /// using Image @out = NetVips.Image.Openexrload(filename, out var flags, memory: bool, access: Enums.Access, failOn: Enums.FailOn, revalidate: bool); /// /// /// Filename to load from. /// Flags for this file. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// Don't use a cached result for this operation. /// A new . public static Image Openexrload(string filename, out Enums.ForeignFlags flags, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null, bool? revalidate = null) { var options = new VOption(); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.AddIfPresent(nameof(revalidate), revalidate); options.Add("flags", true); var results = Operation.Call("openexrload", options, filename) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; flags = (Enums.ForeignFlags)opts?["flags"]; return finalResult; } /// /// Load file with OpenSlide. /// /// /// /// using Image @out = NetVips.Image.Openslideload(filename, level: int, autocrop: bool, associated: string, attachAssociated: bool, rgb: bool, memory: bool, access: Enums.Access, failOn: Enums.FailOn, revalidate: bool); /// /// /// Filename to load from. /// Load this level from the file. /// Crop to image bounds. /// Load this associated image. /// Attach all associated images. /// Output RGB (not RGBA). /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// Don't use a cached result for this operation. /// A new . public static Image Openslideload(string filename, int? level = null, bool? autocrop = null, string associated = null, bool? attachAssociated = null, bool? rgb = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null, bool? revalidate = null) { var options = new VOption(); options.AddIfPresent(nameof(level), level); options.AddIfPresent(nameof(autocrop), autocrop); options.AddIfPresent(nameof(associated), associated); options.AddIfPresent("attach_associated", attachAssociated); options.AddIfPresent(nameof(rgb), rgb); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.AddIfPresent(nameof(revalidate), revalidate); return Operation.Call("openslideload", options, filename) as Image; } /// /// Load file with OpenSlide. /// /// /// /// using Image @out = NetVips.Image.Openslideload(filename, out var flags, level: int, autocrop: bool, associated: string, attachAssociated: bool, rgb: bool, memory: bool, access: Enums.Access, failOn: Enums.FailOn, revalidate: bool); /// /// /// Filename to load from. /// Flags for this file. /// Load this level from the file. /// Crop to image bounds. /// Load this associated image. /// Attach all associated images. /// Output RGB (not RGBA). /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// Don't use a cached result for this operation. /// A new . public static Image Openslideload(string filename, out Enums.ForeignFlags flags, int? level = null, bool? autocrop = null, string associated = null, bool? attachAssociated = null, bool? rgb = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null, bool? revalidate = null) { var options = new VOption(); options.AddIfPresent(nameof(level), level); options.AddIfPresent(nameof(autocrop), autocrop); options.AddIfPresent(nameof(associated), associated); options.AddIfPresent("attach_associated", attachAssociated); options.AddIfPresent(nameof(rgb), rgb); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.AddIfPresent(nameof(revalidate), revalidate); options.Add("flags", true); var results = Operation.Call("openslideload", options, filename) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; flags = (Enums.ForeignFlags)opts?["flags"]; return finalResult; } /// /// Load source with OpenSlide. /// /// /// /// using Image @out = NetVips.Image.OpenslideloadSource(source, level: int, autocrop: bool, associated: string, attachAssociated: bool, rgb: bool, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Source to load from. /// Load this level from the file. /// Crop to image bounds. /// Load this associated image. /// Attach all associated images. /// Output RGB (not RGBA). /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image OpenslideloadSource(Source source, int? level = null, bool? autocrop = null, string associated = null, bool? attachAssociated = null, bool? rgb = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(level), level); options.AddIfPresent(nameof(autocrop), autocrop); options.AddIfPresent(nameof(associated), associated); options.AddIfPresent("attach_associated", attachAssociated); options.AddIfPresent(nameof(rgb), rgb); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); return Operation.Call("openslideload_source", options, source) as Image; } /// /// Load stream with OpenSlide. /// /// /// /// using Image @out = NetVips.Image.OpenslideloadStream(stream, level: int, autocrop: bool, associated: string, attachAssociated: bool, rgb: bool, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Stream to load from. /// Load this level from the file. /// Crop to image bounds. /// Load this associated image. /// Attach all associated images. /// Output RGB (not RGBA). /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image OpenslideloadStream(Stream stream, int? level = null, bool? autocrop = null, string associated = null, bool? attachAssociated = null, bool? rgb = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var source = SourceStream.NewFromStream(stream); var image = OpenslideloadSource(source, level, autocrop, associated, attachAssociated, rgb, memory, access, failOn); image.OnPostClose += () => source.Dispose(); return image; } /// /// Load source with OpenSlide. /// /// /// /// using Image @out = NetVips.Image.OpenslideloadSource(source, out var flags, level: int, autocrop: bool, associated: string, attachAssociated: bool, rgb: bool, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Source to load from. /// Flags for this file. /// Load this level from the file. /// Crop to image bounds. /// Load this associated image. /// Attach all associated images. /// Output RGB (not RGBA). /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image OpenslideloadSource(Source source, out Enums.ForeignFlags flags, int? level = null, bool? autocrop = null, string associated = null, bool? attachAssociated = null, bool? rgb = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(level), level); options.AddIfPresent(nameof(autocrop), autocrop); options.AddIfPresent(nameof(associated), associated); options.AddIfPresent("attach_associated", attachAssociated); options.AddIfPresent(nameof(rgb), rgb); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.Add("flags", true); var results = Operation.Call("openslideload_source", options, source) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; flags = (Enums.ForeignFlags)opts?["flags"]; return finalResult; } /// /// Load stream with OpenSlide. /// /// /// /// using Image @out = NetVips.Image.OpenslideloadStream(stream, out var flags, level: int, autocrop: bool, associated: string, attachAssociated: bool, rgb: bool, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Stream to load from. /// Flags for this file. /// Load this level from the file. /// Crop to image bounds. /// Load this associated image. /// Attach all associated images. /// Output RGB (not RGBA). /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image OpenslideloadStream(Stream stream, out Enums.ForeignFlags flags, int? level = null, bool? autocrop = null, string associated = null, bool? attachAssociated = null, bool? rgb = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var source = SourceStream.NewFromStream(stream); var image = OpenslideloadSource(source, out flags, level, autocrop, associated, attachAssociated, rgb, memory, access, failOn); image.OnPostClose += () => source.Dispose(); return image; } /// /// Load PDF from file. /// /// /// /// using Image @out = NetVips.Image.Pdfload(filename, page: int, n: int, dpi: double, scale: double, background: double[], password: string, memory: bool, access: Enums.Access, failOn: Enums.FailOn, revalidate: bool); /// /// /// Filename to load from. /// First page to load. /// Number of pages to load, -1 for all. /// DPI to render at. /// Factor to scale by. /// Background colour. /// Password to decrypt with. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// Don't use a cached result for this operation. /// A new . public static Image Pdfload(string filename, int? page = null, int? n = null, double? dpi = null, double? scale = null, double[] background = null, string password = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null, bool? revalidate = null) { var options = new VOption(); options.AddIfPresent(nameof(page), page); options.AddIfPresent(nameof(n), n); options.AddIfPresent(nameof(dpi), dpi); options.AddIfPresent(nameof(scale), scale); options.AddIfPresent(nameof(background), background); options.AddIfPresent(nameof(password), password); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.AddIfPresent(nameof(revalidate), revalidate); return Operation.Call("pdfload", options, filename) as Image; } /// /// Load PDF from file. /// /// /// /// using Image @out = NetVips.Image.Pdfload(filename, out var flags, page: int, n: int, dpi: double, scale: double, background: double[], password: string, memory: bool, access: Enums.Access, failOn: Enums.FailOn, revalidate: bool); /// /// /// Filename to load from. /// Flags for this file. /// First page to load. /// Number of pages to load, -1 for all. /// DPI to render at. /// Factor to scale by. /// Background colour. /// Password to decrypt with. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// Don't use a cached result for this operation. /// A new . public static Image Pdfload(string filename, out Enums.ForeignFlags flags, int? page = null, int? n = null, double? dpi = null, double? scale = null, double[] background = null, string password = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null, bool? revalidate = null) { var options = new VOption(); options.AddIfPresent(nameof(page), page); options.AddIfPresent(nameof(n), n); options.AddIfPresent(nameof(dpi), dpi); options.AddIfPresent(nameof(scale), scale); options.AddIfPresent(nameof(background), background); options.AddIfPresent(nameof(password), password); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.AddIfPresent(nameof(revalidate), revalidate); options.Add("flags", true); var results = Operation.Call("pdfload", options, filename) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; flags = (Enums.ForeignFlags)opts?["flags"]; return finalResult; } /// /// Load PDF from buffer. /// /// /// /// using Image @out = NetVips.Image.PdfloadBuffer(buffer, page: int, n: int, dpi: double, scale: double, background: double[], password: string, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Buffer to load from. /// First page to load. /// Number of pages to load, -1 for all. /// DPI to render at. /// Factor to scale by. /// Background colour. /// Password to decrypt with. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image PdfloadBuffer(byte[] buffer, int? page = null, int? n = null, double? dpi = null, double? scale = null, double[] background = null, string password = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(page), page); options.AddIfPresent(nameof(n), n); options.AddIfPresent(nameof(dpi), dpi); options.AddIfPresent(nameof(scale), scale); options.AddIfPresent(nameof(background), background); options.AddIfPresent(nameof(password), password); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); return Operation.Call("pdfload_buffer", options, buffer) as Image; } /// /// Load PDF from buffer. /// /// /// /// using Image @out = NetVips.Image.PdfloadBuffer(buffer, out var flags, page: int, n: int, dpi: double, scale: double, background: double[], password: string, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Buffer to load from. /// Flags for this file. /// First page to load. /// Number of pages to load, -1 for all. /// DPI to render at. /// Factor to scale by. /// Background colour. /// Password to decrypt with. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image PdfloadBuffer(byte[] buffer, out Enums.ForeignFlags flags, int? page = null, int? n = null, double? dpi = null, double? scale = null, double[] background = null, string password = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(page), page); options.AddIfPresent(nameof(n), n); options.AddIfPresent(nameof(dpi), dpi); options.AddIfPresent(nameof(scale), scale); options.AddIfPresent(nameof(background), background); options.AddIfPresent(nameof(password), password); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.Add("flags", true); var results = Operation.Call("pdfload_buffer", options, buffer) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; flags = (Enums.ForeignFlags)opts?["flags"]; return finalResult; } /// /// Load PDF from source. /// /// /// /// using Image @out = NetVips.Image.PdfloadSource(source, page: int, n: int, dpi: double, scale: double, background: double[], password: string, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Source to load from. /// First page to load. /// Number of pages to load, -1 for all. /// DPI to render at. /// Factor to scale by. /// Background colour. /// Password to decrypt with. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image PdfloadSource(Source source, int? page = null, int? n = null, double? dpi = null, double? scale = null, double[] background = null, string password = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(page), page); options.AddIfPresent(nameof(n), n); options.AddIfPresent(nameof(dpi), dpi); options.AddIfPresent(nameof(scale), scale); options.AddIfPresent(nameof(background), background); options.AddIfPresent(nameof(password), password); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); return Operation.Call("pdfload_source", options, source) as Image; } /// /// Load PDF from stream. /// /// /// /// using Image @out = NetVips.Image.PdfloadStream(stream, page: int, n: int, dpi: double, scale: double, background: double[], password: string, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Stream to load from. /// First page to load. /// Number of pages to load, -1 for all. /// DPI to render at. /// Factor to scale by. /// Background colour. /// Password to decrypt with. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image PdfloadStream(Stream stream, int? page = null, int? n = null, double? dpi = null, double? scale = null, double[] background = null, string password = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var source = SourceStream.NewFromStream(stream); var image = PdfloadSource(source, page, n, dpi, scale, background, password, memory, access, failOn); image.OnPostClose += () => source.Dispose(); return image; } /// /// Load PDF from source. /// /// /// /// using Image @out = NetVips.Image.PdfloadSource(source, out var flags, page: int, n: int, dpi: double, scale: double, background: double[], password: string, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Source to load from. /// Flags for this file. /// First page to load. /// Number of pages to load, -1 for all. /// DPI to render at. /// Factor to scale by. /// Background colour. /// Password to decrypt with. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image PdfloadSource(Source source, out Enums.ForeignFlags flags, int? page = null, int? n = null, double? dpi = null, double? scale = null, double[] background = null, string password = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(page), page); options.AddIfPresent(nameof(n), n); options.AddIfPresent(nameof(dpi), dpi); options.AddIfPresent(nameof(scale), scale); options.AddIfPresent(nameof(background), background); options.AddIfPresent(nameof(password), password); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.Add("flags", true); var results = Operation.Call("pdfload_source", options, source) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; flags = (Enums.ForeignFlags)opts?["flags"]; return finalResult; } /// /// Load PDF from stream. /// /// /// /// using Image @out = NetVips.Image.PdfloadStream(stream, out var flags, page: int, n: int, dpi: double, scale: double, background: double[], password: string, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Stream to load from. /// Flags for this file. /// First page to load. /// Number of pages to load, -1 for all. /// DPI to render at. /// Factor to scale by. /// Background colour. /// Password to decrypt with. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image PdfloadStream(Stream stream, out Enums.ForeignFlags flags, int? page = null, int? n = null, double? dpi = null, double? scale = null, double[] background = null, string password = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var source = SourceStream.NewFromStream(stream); var image = PdfloadSource(source, out flags, page, n, dpi, scale, background, password, memory, access, failOn); image.OnPostClose += () => source.Dispose(); return image; } /// /// Find threshold for percent of pixels. /// /// /// /// int threshold = in.Percent(percent); /// /// /// Percent of pixels. /// A int. public int Percent(double percent) { return this.Call("percent", percent) is int result ? result : 0; } /// /// Make a perlin noise image. /// /// /// /// using Image @out = NetVips.Image.Perlin(width, height, cellSize: int, uchar: bool, seed: int); /// /// /// Image width in pixels. /// Image height in pixels. /// Size of Perlin cells. /// Output an unsigned char image. /// Random number seed. /// A new . public static Image Perlin(int width, int height, int? cellSize = null, bool? uchar = null, int? seed = null) { var options = new VOption(); options.AddIfPresent("cell_size", cellSize); options.AddIfPresent(nameof(uchar), uchar); options.AddIfPresent(nameof(seed), seed); return Operation.Call("perlin", options, width, height) as Image; } /// /// Calculate phase correlation. /// /// /// /// using Image @out = in.Phasecor(in2); /// /// /// Second input image. /// A new . public Image Phasecor(Image in2) { return this.Call("phasecor", in2) as Image; } /// /// Load png from file. /// /// /// /// using Image @out = NetVips.Image.Pngload(filename, unlimited: bool, memory: bool, access: Enums.Access, failOn: Enums.FailOn, revalidate: bool); /// /// /// Filename to load from. /// Remove all denial of service limits. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// Don't use a cached result for this operation. /// A new . public static Image Pngload(string filename, bool? unlimited = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null, bool? revalidate = null) { var options = new VOption(); options.AddIfPresent(nameof(unlimited), unlimited); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.AddIfPresent(nameof(revalidate), revalidate); return Operation.Call("pngload", options, filename) as Image; } /// /// Load png from file. /// /// /// /// using Image @out = NetVips.Image.Pngload(filename, out var flags, unlimited: bool, memory: bool, access: Enums.Access, failOn: Enums.FailOn, revalidate: bool); /// /// /// Filename to load from. /// Flags for this file. /// Remove all denial of service limits. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// Don't use a cached result for this operation. /// A new . public static Image Pngload(string filename, out Enums.ForeignFlags flags, bool? unlimited = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null, bool? revalidate = null) { var options = new VOption(); options.AddIfPresent(nameof(unlimited), unlimited); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.AddIfPresent(nameof(revalidate), revalidate); options.Add("flags", true); var results = Operation.Call("pngload", options, filename) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; flags = (Enums.ForeignFlags)opts?["flags"]; return finalResult; } /// /// Load png from buffer. /// /// /// /// using Image @out = NetVips.Image.PngloadBuffer(buffer, unlimited: bool, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Buffer to load from. /// Remove all denial of service limits. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image PngloadBuffer(byte[] buffer, bool? unlimited = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(unlimited), unlimited); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); return Operation.Call("pngload_buffer", options, buffer) as Image; } /// /// Load png from buffer. /// /// /// /// using Image @out = NetVips.Image.PngloadBuffer(buffer, out var flags, unlimited: bool, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Buffer to load from. /// Flags for this file. /// Remove all denial of service limits. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image PngloadBuffer(byte[] buffer, out Enums.ForeignFlags flags, bool? unlimited = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(unlimited), unlimited); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.Add("flags", true); var results = Operation.Call("pngload_buffer", options, buffer) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; flags = (Enums.ForeignFlags)opts?["flags"]; return finalResult; } /// /// Load png from source. /// /// /// /// using Image @out = NetVips.Image.PngloadSource(source, unlimited: bool, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Source to load from. /// Remove all denial of service limits. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image PngloadSource(Source source, bool? unlimited = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(unlimited), unlimited); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); return Operation.Call("pngload_source", options, source) as Image; } /// /// Load png from stream. /// /// /// /// using Image @out = NetVips.Image.PngloadStream(stream, unlimited: bool, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Stream to load from. /// Remove all denial of service limits. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image PngloadStream(Stream stream, bool? unlimited = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var source = SourceStream.NewFromStream(stream); var image = PngloadSource(source, unlimited, memory, access, failOn); image.OnPostClose += () => source.Dispose(); return image; } /// /// Load png from source. /// /// /// /// using Image @out = NetVips.Image.PngloadSource(source, out var flags, unlimited: bool, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Source to load from. /// Flags for this file. /// Remove all denial of service limits. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image PngloadSource(Source source, out Enums.ForeignFlags flags, bool? unlimited = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(unlimited), unlimited); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.Add("flags", true); var results = Operation.Call("pngload_source", options, source) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; flags = (Enums.ForeignFlags)opts?["flags"]; return finalResult; } /// /// Load png from stream. /// /// /// /// using Image @out = NetVips.Image.PngloadStream(stream, out var flags, unlimited: bool, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Stream to load from. /// Flags for this file. /// Remove all denial of service limits. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image PngloadStream(Stream stream, out Enums.ForeignFlags flags, bool? unlimited = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var source = SourceStream.NewFromStream(stream); var image = PngloadSource(source, out flags, unlimited, memory, access, failOn); image.OnPostClose += () => source.Dispose(); return image; } /// /// Save image to file as PNG. /// /// /// /// in.Pngsave(filename, compression: int, interlace: bool, filter: Enums.ForeignPngFilter, palette: bool, q: int, dither: double, bitdepth: int, effort: int, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Filename to save to. /// Compression factor. /// Interlace image. /// libspng row filter flag(s). /// Quantise to 8bpp palette. /// Quantisation quality. /// Amount of dithering. /// Write as a 1, 2, 4, 8 or 16 bit image. /// Quantisation CPU effort. /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. public void Pngsave(string filename, int? compression = null, bool? interlace = null, Enums.ForeignPngFilter? filter = null, bool? palette = null, int? q = null, double? dither = null, int? bitdepth = null, int? effort = null, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { var options = new VOption(); options.AddIfPresent(nameof(compression), compression); options.AddIfPresent(nameof(interlace), interlace); options.AddIfPresent(nameof(filter), filter); options.AddIfPresent(nameof(palette), palette); options.AddIfPresent("Q", q); options.AddIfPresent(nameof(dither), dither); options.AddIfPresent(nameof(bitdepth), bitdepth); options.AddIfPresent(nameof(effort), effort); options.AddForeignKeep(keep); options.AddIfPresent(nameof(background), background); options.AddIfPresent("page_height", pageHeight); options.AddIfPresent(nameof(profile), profile); this.Call("pngsave", options, filename); } /// /// Save image to buffer as PNG. /// /// /// /// byte[] buffer = in.PngsaveBuffer(compression: int, interlace: bool, filter: Enums.ForeignPngFilter, palette: bool, q: int, dither: double, bitdepth: int, effort: int, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Compression factor. /// Interlace image. /// libspng row filter flag(s). /// Quantise to 8bpp palette. /// Quantisation quality. /// Amount of dithering. /// Write as a 1, 2, 4, 8 or 16 bit image. /// Quantisation CPU effort. /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. /// An array of bytes. public byte[] PngsaveBuffer(int? compression = null, bool? interlace = null, Enums.ForeignPngFilter? filter = null, bool? palette = null, int? q = null, double? dither = null, int? bitdepth = null, int? effort = null, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { var options = new VOption(); options.AddIfPresent(nameof(compression), compression); options.AddIfPresent(nameof(interlace), interlace); options.AddIfPresent(nameof(filter), filter); options.AddIfPresent(nameof(palette), palette); options.AddIfPresent("Q", q); options.AddIfPresent(nameof(dither), dither); options.AddIfPresent(nameof(bitdepth), bitdepth); options.AddIfPresent(nameof(effort), effort); options.AddForeignKeep(keep); options.AddIfPresent(nameof(background), background); options.AddIfPresent("page_height", pageHeight); options.AddIfPresent(nameof(profile), profile); return this.Call("pngsave_buffer", options) as byte[]; } /// /// Save image to target as PNG. /// /// /// /// in.PngsaveTarget(target, compression: int, interlace: bool, filter: Enums.ForeignPngFilter, palette: bool, q: int, dither: double, bitdepth: int, effort: int, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Target to save to. /// Compression factor. /// Interlace image. /// libspng row filter flag(s). /// Quantise to 8bpp palette. /// Quantisation quality. /// Amount of dithering. /// Write as a 1, 2, 4, 8 or 16 bit image. /// Quantisation CPU effort. /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. public void PngsaveTarget(Target target, int? compression = null, bool? interlace = null, Enums.ForeignPngFilter? filter = null, bool? palette = null, int? q = null, double? dither = null, int? bitdepth = null, int? effort = null, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { var options = new VOption(); options.AddIfPresent(nameof(compression), compression); options.AddIfPresent(nameof(interlace), interlace); options.AddIfPresent(nameof(filter), filter); options.AddIfPresent(nameof(palette), palette); options.AddIfPresent("Q", q); options.AddIfPresent(nameof(dither), dither); options.AddIfPresent(nameof(bitdepth), bitdepth); options.AddIfPresent(nameof(effort), effort); options.AddForeignKeep(keep); options.AddIfPresent(nameof(background), background); options.AddIfPresent("page_height", pageHeight); options.AddIfPresent(nameof(profile), profile); this.Call("pngsave_target", options, target); } /// /// Save image to stream as PNG. /// /// /// /// in.PngsaveStream(stream, compression: int, interlace: bool, filter: Enums.ForeignPngFilter, palette: bool, q: int, dither: double, bitdepth: int, effort: int, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Stream to save to. /// Compression factor. /// Interlace image. /// libspng row filter flag(s). /// Quantise to 8bpp palette. /// Quantisation quality. /// Amount of dithering. /// Write as a 1, 2, 4, 8 or 16 bit image. /// Quantisation CPU effort. /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. public void PngsaveStream(Stream stream, int? compression = null, bool? interlace = null, Enums.ForeignPngFilter? filter = null, bool? palette = null, int? q = null, double? dither = null, int? bitdepth = null, int? effort = null, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { using var target = TargetStream.NewFromStream(stream); PngsaveTarget(target, compression, interlace, filter, palette, q, dither, bitdepth, effort, keep, background, pageHeight, profile); } /// /// Load ppm from file. /// /// /// /// using Image @out = NetVips.Image.Ppmload(filename, memory: bool, access: Enums.Access, failOn: Enums.FailOn, revalidate: bool); /// /// /// Filename to load from. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// Don't use a cached result for this operation. /// A new . public static Image Ppmload(string filename, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null, bool? revalidate = null) { var options = new VOption(); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.AddIfPresent(nameof(revalidate), revalidate); return Operation.Call("ppmload", options, filename) as Image; } /// /// Load ppm from file. /// /// /// /// using Image @out = NetVips.Image.Ppmload(filename, out var flags, memory: bool, access: Enums.Access, failOn: Enums.FailOn, revalidate: bool); /// /// /// Filename to load from. /// Flags for this file. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// Don't use a cached result for this operation. /// A new . public static Image Ppmload(string filename, out Enums.ForeignFlags flags, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null, bool? revalidate = null) { var options = new VOption(); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.AddIfPresent(nameof(revalidate), revalidate); options.Add("flags", true); var results = Operation.Call("ppmload", options, filename) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; flags = (Enums.ForeignFlags)opts?["flags"]; return finalResult; } /// /// Load ppm from buffer. /// /// /// /// using Image @out = NetVips.Image.PpmloadBuffer(buffer, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Buffer to load from. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image PpmloadBuffer(byte[] buffer, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); return Operation.Call("ppmload_buffer", options, buffer) as Image; } /// /// Load ppm from buffer. /// /// /// /// using Image @out = NetVips.Image.PpmloadBuffer(buffer, out var flags, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Buffer to load from. /// Flags for this file. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image PpmloadBuffer(byte[] buffer, out Enums.ForeignFlags flags, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.Add("flags", true); var results = Operation.Call("ppmload_buffer", options, buffer) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; flags = (Enums.ForeignFlags)opts?["flags"]; return finalResult; } /// /// Load ppm from source. /// /// /// /// using Image @out = NetVips.Image.PpmloadSource(source, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Source to load from. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image PpmloadSource(Source source, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); return Operation.Call("ppmload_source", options, source) as Image; } /// /// Load ppm from stream. /// /// /// /// using Image @out = NetVips.Image.PpmloadStream(stream, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Stream to load from. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image PpmloadStream(Stream stream, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var source = SourceStream.NewFromStream(stream); var image = PpmloadSource(source, memory, access, failOn); image.OnPostClose += () => source.Dispose(); return image; } /// /// Load ppm from source. /// /// /// /// using Image @out = NetVips.Image.PpmloadSource(source, out var flags, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Source to load from. /// Flags for this file. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image PpmloadSource(Source source, out Enums.ForeignFlags flags, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.Add("flags", true); var results = Operation.Call("ppmload_source", options, source) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; flags = (Enums.ForeignFlags)opts?["flags"]; return finalResult; } /// /// Load ppm from stream. /// /// /// /// using Image @out = NetVips.Image.PpmloadStream(stream, out var flags, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Stream to load from. /// Flags for this file. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image PpmloadStream(Stream stream, out Enums.ForeignFlags flags, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var source = SourceStream.NewFromStream(stream); var image = PpmloadSource(source, out flags, memory, access, failOn); image.OnPostClose += () => source.Dispose(); return image; } /// /// Save image to ppm file. /// /// /// /// in.Ppmsave(filename, format: Enums.ForeignPpmFormat, ascii: bool, bitdepth: int, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Filename to save to. /// Format to save in. /// Save as ascii. /// Set to 1 to write as a 1 bit image. /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. public void Ppmsave(string filename, Enums.ForeignPpmFormat? format = null, bool? ascii = null, int? bitdepth = null, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { var options = new VOption(); options.AddIfPresent(nameof(format), format); options.AddIfPresent(nameof(ascii), ascii); options.AddIfPresent(nameof(bitdepth), bitdepth); options.AddForeignKeep(keep); options.AddIfPresent(nameof(background), background); options.AddIfPresent("page_height", pageHeight); options.AddIfPresent(nameof(profile), profile); this.Call("ppmsave", options, filename); } /// /// Save to ppm. /// /// /// /// in.PpmsaveTarget(target, format: Enums.ForeignPpmFormat, ascii: bool, bitdepth: int, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Target to save to. /// Format to save in. /// Save as ascii. /// Set to 1 to write as a 1 bit image. /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. public void PpmsaveTarget(Target target, Enums.ForeignPpmFormat? format = null, bool? ascii = null, int? bitdepth = null, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { var options = new VOption(); options.AddIfPresent(nameof(format), format); options.AddIfPresent(nameof(ascii), ascii); options.AddIfPresent(nameof(bitdepth), bitdepth); options.AddForeignKeep(keep); options.AddIfPresent(nameof(background), background); options.AddIfPresent("page_height", pageHeight); options.AddIfPresent(nameof(profile), profile); this.Call("ppmsave_target", options, target); } /// /// Save to ppm. /// /// /// /// in.PpmsaveStream(stream, format: Enums.ForeignPpmFormat, ascii: bool, bitdepth: int, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Stream to save to. /// Format to save in. /// Save as ascii. /// Set to 1 to write as a 1 bit image. /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. public void PpmsaveStream(Stream stream, Enums.ForeignPpmFormat? format = null, bool? ascii = null, int? bitdepth = null, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { using var target = TargetStream.NewFromStream(stream); PpmsaveTarget(target, format, ascii, bitdepth, keep, background, pageHeight, profile); } /// /// Premultiply image alpha. /// /// /// /// using Image @out = in.Premultiply(maxAlpha: double); /// /// /// Maximum value of alpha channel. /// A new . public Image Premultiply(double? maxAlpha = null) { var options = new VOption(); options.AddIfPresent("max_alpha", maxAlpha); return this.Call("premultiply", options) as Image; } /// /// Prewitt edge detector. /// /// /// /// using Image @out = in.Prewitt(); /// /// /// A new . public Image Prewitt() { return this.Call("prewitt") as Image; } /// /// Find image profiles. /// /// /// /// var output = in.Profile(); /// /// /// An array of objects. public object[] Profile() { return this.Call("profile") as object[]; } /// /// Load named ICC profile. /// /// /// /// byte[] profile = NetVips.Image.ProfileLoad(name); /// /// /// Profile name. /// An array of bytes. public static byte[] ProfileLoad(string name) { return Operation.Call("profile_load", name) as byte[]; } /// /// Find image projections. /// /// /// /// var output = in.Project(); /// /// /// An array of objects. public object[] Project() { return this.Call("project") as object[]; } /// /// Resample an image with a quadratic transform. /// /// /// /// using Image @out = in.Quadratic(coeff, interpolate: GObject); /// /// /// Coefficient matrix. /// Interpolate values with this. /// A new . public Image Quadratic(Image coeff, GObject interpolate = null) { var options = new VOption(); options.AddIfPresent(nameof(interpolate), interpolate); return this.Call("quadratic", options, coeff) as Image; } /// /// Unpack Radiance coding to float RGB. /// /// /// /// using Image @out = in.Rad2float(); /// /// /// A new . public Image Rad2float() { return this.Call("rad2float") as Image; } /// /// Load a Radiance image from a file. /// /// /// /// using Image @out = NetVips.Image.Radload(filename, memory: bool, access: Enums.Access, failOn: Enums.FailOn, revalidate: bool); /// /// /// Filename to load from. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// Don't use a cached result for this operation. /// A new . public static Image Radload(string filename, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null, bool? revalidate = null) { var options = new VOption(); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.AddIfPresent(nameof(revalidate), revalidate); return Operation.Call("radload", options, filename) as Image; } /// /// Load a Radiance image from a file. /// /// /// /// using Image @out = NetVips.Image.Radload(filename, out var flags, memory: bool, access: Enums.Access, failOn: Enums.FailOn, revalidate: bool); /// /// /// Filename to load from. /// Flags for this file. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// Don't use a cached result for this operation. /// A new . public static Image Radload(string filename, out Enums.ForeignFlags flags, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null, bool? revalidate = null) { var options = new VOption(); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.AddIfPresent(nameof(revalidate), revalidate); options.Add("flags", true); var results = Operation.Call("radload", options, filename) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; flags = (Enums.ForeignFlags)opts?["flags"]; return finalResult; } /// /// Load rad from buffer. /// /// /// /// using Image @out = NetVips.Image.RadloadBuffer(buffer, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Buffer to load from. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image RadloadBuffer(byte[] buffer, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); return Operation.Call("radload_buffer", options, buffer) as Image; } /// /// Load rad from buffer. /// /// /// /// using Image @out = NetVips.Image.RadloadBuffer(buffer, out var flags, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Buffer to load from. /// Flags for this file. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image RadloadBuffer(byte[] buffer, out Enums.ForeignFlags flags, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.Add("flags", true); var results = Operation.Call("radload_buffer", options, buffer) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; flags = (Enums.ForeignFlags)opts?["flags"]; return finalResult; } /// /// Load rad from source. /// /// /// /// using Image @out = NetVips.Image.RadloadSource(source, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Source to load from. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image RadloadSource(Source source, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); return Operation.Call("radload_source", options, source) as Image; } /// /// Load rad from stream. /// /// /// /// using Image @out = NetVips.Image.RadloadStream(stream, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Stream to load from. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image RadloadStream(Stream stream, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var source = SourceStream.NewFromStream(stream); var image = RadloadSource(source, memory, access, failOn); image.OnPostClose += () => source.Dispose(); return image; } /// /// Load rad from source. /// /// /// /// using Image @out = NetVips.Image.RadloadSource(source, out var flags, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Source to load from. /// Flags for this file. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image RadloadSource(Source source, out Enums.ForeignFlags flags, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.Add("flags", true); var results = Operation.Call("radload_source", options, source) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; flags = (Enums.ForeignFlags)opts?["flags"]; return finalResult; } /// /// Load rad from stream. /// /// /// /// using Image @out = NetVips.Image.RadloadStream(stream, out var flags, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Stream to load from. /// Flags for this file. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image RadloadStream(Stream stream, out Enums.ForeignFlags flags, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var source = SourceStream.NewFromStream(stream); var image = RadloadSource(source, out flags, memory, access, failOn); image.OnPostClose += () => source.Dispose(); return image; } /// /// Save image to Radiance file. /// /// /// /// in.Radsave(filename, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Filename to save to. /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. public void Radsave(string filename, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { var options = new VOption(); options.AddForeignKeep(keep); options.AddIfPresent(nameof(background), background); options.AddIfPresent("page_height", pageHeight); options.AddIfPresent(nameof(profile), profile); this.Call("radsave", options, filename); } /// /// Save image to Radiance buffer. /// /// /// /// byte[] buffer = in.RadsaveBuffer(keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. /// An array of bytes. public byte[] RadsaveBuffer(Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { var options = new VOption(); options.AddForeignKeep(keep); options.AddIfPresent(nameof(background), background); options.AddIfPresent("page_height", pageHeight); options.AddIfPresent(nameof(profile), profile); return this.Call("radsave_buffer", options) as byte[]; } /// /// Save image to Radiance target. /// /// /// /// in.RadsaveTarget(target, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Target to save to. /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. public void RadsaveTarget(Target target, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { var options = new VOption(); options.AddForeignKeep(keep); options.AddIfPresent(nameof(background), background); options.AddIfPresent("page_height", pageHeight); options.AddIfPresent(nameof(profile), profile); this.Call("radsave_target", options, target); } /// /// Save image to Radiance stream. /// /// /// /// in.RadsaveStream(stream, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Stream to save to. /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. public void RadsaveStream(Stream stream, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { using var target = TargetStream.NewFromStream(stream); RadsaveTarget(target, keep, background, pageHeight, profile); } /// /// Rank filter. /// /// /// /// using Image @out = in.Rank(width, height, index); /// /// /// Window width in pixels. /// Window height in pixels. /// Select pixel at index. /// A new . public Image Rank(int width, int height, int index) { return this.Call("rank", width, height, index) as Image; } /// /// Load raw data from a file. /// /// /// /// using Image @out = NetVips.Image.Rawload(filename, width, height, bands, offset: ulong, format: Enums.BandFormat, interpretation: Enums.Interpretation, memory: bool, access: Enums.Access, failOn: Enums.FailOn, revalidate: bool); /// /// /// Filename to load from. /// Image width in pixels. /// Image height in pixels. /// Number of bands in image. /// Offset in bytes from start of file. /// Pixel format in image. /// Pixel interpretation. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// Don't use a cached result for this operation. /// A new . public static Image Rawload(string filename, int width, int height, int bands, ulong? offset = null, Enums.BandFormat? format = null, Enums.Interpretation? interpretation = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null, bool? revalidate = null) { var options = new VOption(); options.AddIfPresent(nameof(offset), offset); options.AddIfPresent(nameof(format), format); options.AddIfPresent(nameof(interpretation), interpretation); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.AddIfPresent(nameof(revalidate), revalidate); return Operation.Call("rawload", options, filename, width, height, bands) as Image; } /// /// Load raw data from a file. /// /// /// /// using Image @out = NetVips.Image.Rawload(filename, width, height, bands, out var flags, offset: ulong, format: Enums.BandFormat, interpretation: Enums.Interpretation, memory: bool, access: Enums.Access, failOn: Enums.FailOn, revalidate: bool); /// /// /// Filename to load from. /// Image width in pixels. /// Image height in pixels. /// Number of bands in image. /// Flags for this file. /// Offset in bytes from start of file. /// Pixel format in image. /// Pixel interpretation. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// Don't use a cached result for this operation. /// A new . public static Image Rawload(string filename, int width, int height, int bands, out Enums.ForeignFlags flags, ulong? offset = null, Enums.BandFormat? format = null, Enums.Interpretation? interpretation = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null, bool? revalidate = null) { var options = new VOption(); options.AddIfPresent(nameof(offset), offset); options.AddIfPresent(nameof(format), format); options.AddIfPresent(nameof(interpretation), interpretation); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.AddIfPresent(nameof(revalidate), revalidate); options.Add("flags", true); var results = Operation.Call("rawload", options, filename, width, height, bands) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; flags = (Enums.ForeignFlags)opts?["flags"]; return finalResult; } /// /// Save image to raw file. /// /// /// /// in.Rawsave(filename, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Filename to save to. /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. public void Rawsave(string filename, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { var options = new VOption(); options.AddForeignKeep(keep); options.AddIfPresent(nameof(background), background); options.AddIfPresent("page_height", pageHeight); options.AddIfPresent(nameof(profile), profile); this.Call("rawsave", options, filename); } /// /// Write raw image to buffer. /// /// /// /// byte[] buffer = in.RawsaveBuffer(keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. /// An array of bytes. public byte[] RawsaveBuffer(Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { var options = new VOption(); options.AddForeignKeep(keep); options.AddIfPresent(nameof(background), background); options.AddIfPresent("page_height", pageHeight); options.AddIfPresent(nameof(profile), profile); return this.Call("rawsave_buffer", options) as byte[]; } /// /// Write raw image to target. /// /// /// /// in.RawsaveTarget(target, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Target to save to. /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. public void RawsaveTarget(Target target, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { var options = new VOption(); options.AddForeignKeep(keep); options.AddIfPresent(nameof(background), background); options.AddIfPresent("page_height", pageHeight); options.AddIfPresent(nameof(profile), profile); this.Call("rawsave_target", options, target); } /// /// Write raw image to stream. /// /// /// /// in.RawsaveStream(stream, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Stream to save to. /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. public void RawsaveStream(Stream stream, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { using var target = TargetStream.NewFromStream(stream); RawsaveTarget(target, keep, background, pageHeight, profile); } /// /// Linear recombination with matrix. /// /// /// /// using Image @out = in.Recomb(m); /// /// /// Matrix of coefficients. /// A new . public Image Recomb(Image m) { return this.Call("recomb", m) as Image; } /// /// Reduce an image. /// /// /// /// using Image @out = in.Reduce(hshrink, vshrink, kernel: Enums.Kernel, gap: double); /// /// /// Horizontal shrink factor. /// Vertical shrink factor. /// Resampling kernel. /// Reducing gap. /// A new . public Image Reduce(double hshrink, double vshrink, Enums.Kernel? kernel = null, double? gap = null) { var options = new VOption(); options.AddIfPresent(nameof(kernel), kernel); options.AddIfPresent(nameof(gap), gap); return this.Call("reduce", options, hshrink, vshrink) as Image; } /// /// Shrink an image horizontally. /// /// /// /// using Image @out = in.Reduceh(hshrink, kernel: Enums.Kernel, gap: double); /// /// /// Horizontal shrink factor. /// Resampling kernel. /// Reducing gap. /// A new . public Image Reduceh(double hshrink, Enums.Kernel? kernel = null, double? gap = null) { var options = new VOption(); options.AddIfPresent(nameof(kernel), kernel); options.AddIfPresent(nameof(gap), gap); return this.Call("reduceh", options, hshrink) as Image; } /// /// Shrink an image vertically. /// /// /// /// using Image @out = in.Reducev(vshrink, kernel: Enums.Kernel, gap: double); /// /// /// Vertical shrink factor. /// Resampling kernel. /// Reducing gap. /// A new . public Image Reducev(double vshrink, Enums.Kernel? kernel = null, double? gap = null) { var options = new VOption(); options.AddIfPresent(nameof(kernel), kernel); options.AddIfPresent(nameof(gap), gap); return this.Call("reducev", options, vshrink) as Image; } /// /// Relational operation on two images. /// /// /// /// using Image @out = left.Relational(right, relational); /// /// /// Right-hand image argument. /// Relational to perform. /// A new . public Image Relational(Image right, Enums.OperationRelational relational) { return this.Call("relational", right, relational) as Image; } /// /// Relational operations against a constant. /// /// /// /// using Image @out = in.RelationalConst(relational, c); /// /// /// Relational to perform. /// Array of constants. /// A new . public Image RelationalConst(Enums.OperationRelational relational, double[] c) { return this.Call("relational_const", relational, c) as Image; } /// /// Remainder after integer division of two images. /// /// /// /// using Image @out = left.Remainder(right); /// /// /// Right-hand image argument. /// A new . public Image Remainder(Image right) { return this.Call("remainder", right) as Image; } /// /// Remainder after integer division of an image and a constant. /// /// /// /// using Image @out = in.RemainderConst(c); /// /// /// Array of constants. /// A new . public Image RemainderConst(double[] c) { return this.Call("remainder_const", c) as Image; } /// /// Rebuild an mosaiced image. /// /// /// /// using Image @out = in.Remosaic(oldStr, newStr); /// /// /// Search for this string. /// And swap for this string. /// A new . public Image Remosaic(string oldStr, string newStr) { return this.Call("remosaic", oldStr, newStr) as Image; } /// /// Replicate an image. /// /// /// /// using Image @out = in.Replicate(across, down); /// /// /// Repeat this many times horizontally. /// Repeat this many times vertically. /// A new . public Image Replicate(int across, int down) { return this.Call("replicate", across, down) as Image; } /// /// Resize an image. /// /// /// /// using Image @out = in.Resize(scale, kernel: Enums.Kernel, gap: double, vscale: double); /// /// /// Scale image by this factor. /// Resampling kernel. /// Reducing gap. /// Vertical scale image by this factor. /// A new . public Image Resize(double scale, Enums.Kernel? kernel = null, double? gap = null, double? vscale = null) { var options = new VOption(); options.AddIfPresent(nameof(kernel), kernel); options.AddIfPresent(nameof(gap), gap); options.AddIfPresent(nameof(vscale), vscale); return this.Call("resize", options, scale) as Image; } /// /// Rotate an image. /// /// /// /// using Image @out = in.Rot(angle); /// /// /// Angle to rotate image. /// A new . public Image Rot(Enums.Angle angle) { return this.Call("rot", angle) as Image; } /// /// Rotate an image. /// /// /// /// using Image @out = in.Rot45(angle: Enums.Angle45); /// /// /// Angle to rotate image. /// A new . public Image Rot45(Enums.Angle45? angle = null) { var options = new VOption(); options.AddIfPresent(nameof(angle), angle); return this.Call("rot45", options) as Image; } /// /// Rotate an image by a number of degrees. /// /// /// /// using Image @out = in.Rotate(angle, interpolate: GObject, background: double[], odx: double, ody: double, idx: double, idy: double); /// /// /// Rotate clockwise by this many degrees. /// Interpolate pixels with this. /// Background value. /// Horizontal output displacement. /// Vertical output displacement. /// Horizontal input displacement. /// Vertical input displacement. /// A new . public Image Rotate(double angle, GObject interpolate = null, double[] background = null, double? odx = null, double? ody = null, double? idx = null, double? idy = null) { var options = new VOption(); options.AddIfPresent(nameof(interpolate), interpolate); options.AddIfPresent(nameof(background), background); options.AddIfPresent(nameof(odx), odx); options.AddIfPresent(nameof(ody), ody); options.AddIfPresent(nameof(idx), idx); options.AddIfPresent(nameof(idy), idy); return this.Call("rotate", options, angle) as Image; } /// /// Perform a round function on an image. /// /// /// /// using Image @out = in.Round(round); /// /// /// Rounding operation to perform. /// A new . public Image Round(Enums.OperationRound round) { return this.Call("round", round) as Image; } /// /// Scharr edge detector. /// /// /// /// using Image @out = in.Scharr(); /// /// /// A new . public Image Scharr() { return this.Call("scharr") as Image; } /// /// Convert scRGB to BW. /// /// /// /// using Image @out = in.ScRGB2BW(depth: int); /// /// /// Output device space depth in bits. /// A new . public Image ScRGB2BW(int? depth = null) { var options = new VOption(); options.AddIfPresent(nameof(depth), depth); return this.Call("scRGB2BW", options) as Image; } /// /// Convert scRGB to sRGB. /// /// /// /// using Image @out = in.ScRGB2sRGB(depth: int); /// /// /// Output device space depth in bits. /// A new . public Image ScRGB2sRGB(int? depth = null) { var options = new VOption(); options.AddIfPresent(nameof(depth), depth); return this.Call("scRGB2sRGB", options) as Image; } /// /// Transform scRGB to XYZ. /// /// /// /// using Image @out = in.ScRGB2XYZ(); /// /// /// A new . public Image ScRGB2XYZ() { return this.Call("scRGB2XYZ") as Image; } /// /// Create an SDF image. /// /// /// /// using Image @out = NetVips.Image.Sdf(width, height, shape, r: double, a: double[], b: double[], corners: double[]); /// /// /// Image width in pixels. /// Image height in pixels. /// SDF shape to create. /// Radius. /// Point a. /// Point b. /// Corner radii. /// A new . public static Image Sdf(int width, int height, Enums.SdfShape shape, double? r = null, double[] a = null, double[] b = null, double[] corners = null) { var options = new VOption(); options.AddIfPresent(nameof(r), r); options.AddIfPresent(nameof(a), a); options.AddIfPresent(nameof(b), b); options.AddIfPresent(nameof(corners), corners); return Operation.Call("sdf", options, width, height, shape) as Image; } /// /// Check sequential access. /// /// /// /// using Image @out = in.Sequential(tileHeight: int); /// /// /// Tile height in pixels. /// A new . public Image Sequential(int? tileHeight = null) { var options = new VOption(); options.AddIfPresent("tile_height", tileHeight); return this.Call("sequential", options) as Image; } /// /// Unsharp masking for print. /// /// /// /// using Image @out = in.Sharpen(sigma: double, x1: double, y2: double, y3: double, m1: double, m2: double); /// /// /// Sigma of Gaussian. /// Flat/jaggy threshold. /// Maximum brightening. /// Maximum darkening. /// Slope for flat areas. /// Slope for jaggy areas. /// A new . public Image Sharpen(double? sigma = null, double? x1 = null, double? y2 = null, double? y3 = null, double? m1 = null, double? m2 = null) { var options = new VOption(); options.AddIfPresent(nameof(sigma), sigma); options.AddIfPresent(nameof(x1), x1); options.AddIfPresent(nameof(y2), y2); options.AddIfPresent(nameof(y3), y3); options.AddIfPresent(nameof(m1), m1); options.AddIfPresent(nameof(m2), m2); return this.Call("sharpen", options) as Image; } /// /// Shrink an image. /// /// /// /// using Image @out = in.Shrink(hshrink, vshrink, ceil: bool); /// /// /// Horizontal shrink factor. /// Vertical shrink factor. /// Round-up output dimensions. /// A new . public Image Shrink(double hshrink, double vshrink, bool? ceil = null) { var options = new VOption(); options.AddIfPresent(nameof(ceil), ceil); return this.Call("shrink", options, hshrink, vshrink) as Image; } /// /// Shrink an image horizontally. /// /// /// /// using Image @out = in.Shrinkh(hshrink, ceil: bool); /// /// /// Horizontal shrink factor. /// Round-up output dimensions. /// A new . public Image Shrinkh(int hshrink, bool? ceil = null) { var options = new VOption(); options.AddIfPresent(nameof(ceil), ceil); return this.Call("shrinkh", options, hshrink) as Image; } /// /// Shrink an image vertically. /// /// /// /// using Image @out = in.Shrinkv(vshrink, ceil: bool); /// /// /// Vertical shrink factor. /// Round-up output dimensions. /// A new . public Image Shrinkv(int vshrink, bool? ceil = null) { var options = new VOption(); options.AddIfPresent(nameof(ceil), ceil); return this.Call("shrinkv", options, vshrink) as Image; } /// /// Unit vector of pixel. /// /// /// /// using Image @out = in.Sign(); /// /// /// A new . public Image Sign() { return this.Call("sign") as Image; } /// /// Similarity transform of an image. /// /// /// /// using Image @out = in.Similarity(scale: double, angle: double, interpolate: GObject, background: double[], odx: double, ody: double, idx: double, idy: double); /// /// /// Scale by this factor. /// Rotate clockwise by this many degrees. /// Interpolate pixels with this. /// Background value. /// Horizontal output displacement. /// Vertical output displacement. /// Horizontal input displacement. /// Vertical input displacement. /// A new . public Image Similarity(double? scale = null, double? angle = null, GObject interpolate = null, double[] background = null, double? odx = null, double? ody = null, double? idx = null, double? idy = null) { var options = new VOption(); options.AddIfPresent(nameof(scale), scale); options.AddIfPresent(nameof(angle), angle); options.AddIfPresent(nameof(interpolate), interpolate); options.AddIfPresent(nameof(background), background); options.AddIfPresent(nameof(odx), odx); options.AddIfPresent(nameof(ody), ody); options.AddIfPresent(nameof(idx), idx); options.AddIfPresent(nameof(idy), idy); return this.Call("similarity", options) as Image; } /// /// Make a 2D sine wave. /// /// /// /// using Image @out = NetVips.Image.Sines(width, height, uchar: bool, hfreq: double, vfreq: double); /// /// /// Image width in pixels. /// Image height in pixels. /// Output an unsigned char image. /// Horizontal spatial frequency. /// Vertical spatial frequency. /// A new . public static Image Sines(int width, int height, bool? uchar = null, double? hfreq = null, double? vfreq = null) { var options = new VOption(); options.AddIfPresent(nameof(uchar), uchar); options.AddIfPresent(nameof(hfreq), hfreq); options.AddIfPresent(nameof(vfreq), vfreq); return Operation.Call("sines", options, width, height) as Image; } /// /// Extract an area from an image. /// /// /// /// using Image @out = input.Smartcrop(width, height, interesting: Enums.Interesting, premultiplied: bool); /// /// /// Width of extract area. /// Height of extract area. /// How to measure interestingness. /// Input image already has premultiplied alpha. /// A new . public Image Smartcrop(int width, int height, Enums.Interesting? interesting = null, bool? premultiplied = null) { var options = new VOption(); options.AddIfPresent(nameof(interesting), interesting); options.AddIfPresent(nameof(premultiplied), premultiplied); return this.Call("smartcrop", options, width, height) as Image; } /// /// Extract an area from an image. /// /// /// /// using Image @out = input.Smartcrop(width, height, out var attentionX, interesting: Enums.Interesting, premultiplied: bool); /// /// /// Width of extract area. /// Height of extract area. /// Horizontal position of attention centre. /// How to measure interestingness. /// Input image already has premultiplied alpha. /// A new . public Image Smartcrop(int width, int height, out int attentionX, Enums.Interesting? interesting = null, bool? premultiplied = null) { var options = new VOption(); options.AddIfPresent(nameof(interesting), interesting); options.AddIfPresent(nameof(premultiplied), premultiplied); options.Add("attention_x", true); var results = this.Call("smartcrop", options, width, height) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; attentionX = opts?["attention_x"] is int out1 ? out1 : 0; return finalResult; } /// /// Extract an area from an image. /// /// /// /// using Image @out = input.Smartcrop(width, height, out var attentionX, out var attentionY, interesting: Enums.Interesting, premultiplied: bool); /// /// /// Width of extract area. /// Height of extract area. /// Horizontal position of attention centre. /// Vertical position of attention centre. /// How to measure interestingness. /// Input image already has premultiplied alpha. /// A new . public Image Smartcrop(int width, int height, out int attentionX, out int attentionY, Enums.Interesting? interesting = null, bool? premultiplied = null) { var options = new VOption(); options.AddIfPresent(nameof(interesting), interesting); options.AddIfPresent(nameof(premultiplied), premultiplied); options.Add("attention_x", true); options.Add("attention_y", true); var results = this.Call("smartcrop", options, width, height) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; attentionX = opts?["attention_x"] is int out1 ? out1 : 0; attentionY = opts?["attention_y"] is int out2 ? out2 : 0; return finalResult; } /// /// Sobel edge detector. /// /// /// /// using Image @out = in.Sobel(); /// /// /// A new . public Image Sobel() { return this.Call("sobel") as Image; } /// /// Spatial correlation. /// /// /// /// using Image @out = in.Spcor(@ref); /// /// /// Input reference image. /// A new . public Image Spcor(Image @ref) { return this.Call("spcor", @ref) as Image; } /// /// Make displayable power spectrum. /// /// /// /// using Image @out = in.Spectrum(); /// /// /// A new . public Image Spectrum() { return this.Call("spectrum") as Image; } /// /// Transform sRGB to HSV. /// /// /// /// using Image @out = in.SRGB2HSV(); /// /// /// A new . public Image SRGB2HSV() { return this.Call("sRGB2HSV") as Image; } /// /// Convert an sRGB image to scRGB. /// /// /// /// using Image @out = in.SRGB2scRGB(); /// /// /// A new . public Image SRGB2scRGB() { return this.Call("sRGB2scRGB") as Image; } /// /// Find many image stats. /// /// /// /// using Image @out = in.Stats(); /// /// /// A new . public Image Stats() { return this.Call("stats") as Image; } /// /// Statistical difference. /// /// /// /// using Image @out = in.Stdif(width, height, s0: double, b: double, m0: double, a: double); /// /// /// Window width in pixels. /// Window height in pixels. /// New deviation. /// Weight of new deviation. /// New mean. /// Weight of new mean. /// A new . public Image Stdif(int width, int height, double? s0 = null, double? b = null, double? m0 = null, double? a = null) { var options = new VOption(); options.AddIfPresent(nameof(s0), s0); options.AddIfPresent(nameof(b), b); options.AddIfPresent(nameof(m0), m0); options.AddIfPresent(nameof(a), a); return this.Call("stdif", options, width, height) as Image; } /// /// Subsample an image. /// /// /// /// using Image @out = input.Subsample(xfac, yfac, point: bool); /// /// /// Horizontal subsample factor. /// Vertical subsample factor. /// Point sample. /// A new . public Image Subsample(int xfac, int yfac, bool? point = null) { var options = new VOption(); options.AddIfPresent(nameof(point), point); return this.Call("subsample", options, xfac, yfac) as Image; } /// /// Subtract two images. /// /// /// /// using Image @out = left.Subtract(right); /// /// /// Right-hand image argument. /// A new . public Image Subtract(Image right) { return this.Call("subtract", right) as Image; } /// /// Sum an array of images. /// /// /// /// using Image @out = NetVips.Image.Sum(@in); /// /// /// Array of input images. /// A new . public static Image Sum(params Image[] @in) { return Operation.Call("sum", new object[] { @in }) as Image; } /// /// Load SVG with rsvg. /// /// /// /// using Image @out = NetVips.Image.Svgload(filename, dpi: double, scale: double, unlimited: bool, stylesheet: string, highBitdepth: bool, memory: bool, access: Enums.Access, failOn: Enums.FailOn, revalidate: bool); /// /// /// Filename to load from. /// Render at this DPI. /// Scale output by this factor. /// Allow SVG of any size. /// Custom CSS. /// Enable scRGB 128-bit output (32-bit per channel). /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// Don't use a cached result for this operation. /// A new . public static Image Svgload(string filename, double? dpi = null, double? scale = null, bool? unlimited = null, string stylesheet = null, bool? highBitdepth = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null, bool? revalidate = null) { var options = new VOption(); options.AddIfPresent(nameof(dpi), dpi); options.AddIfPresent(nameof(scale), scale); options.AddIfPresent(nameof(unlimited), unlimited); options.AddIfPresent(nameof(stylesheet), stylesheet); options.AddIfPresent("high_bitdepth", highBitdepth); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.AddIfPresent(nameof(revalidate), revalidate); return Operation.Call("svgload", options, filename) as Image; } /// /// Load SVG with rsvg. /// /// /// /// using Image @out = NetVips.Image.Svgload(filename, out var flags, dpi: double, scale: double, unlimited: bool, stylesheet: string, highBitdepth: bool, memory: bool, access: Enums.Access, failOn: Enums.FailOn, revalidate: bool); /// /// /// Filename to load from. /// Flags for this file. /// Render at this DPI. /// Scale output by this factor. /// Allow SVG of any size. /// Custom CSS. /// Enable scRGB 128-bit output (32-bit per channel). /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// Don't use a cached result for this operation. /// A new . public static Image Svgload(string filename, out Enums.ForeignFlags flags, double? dpi = null, double? scale = null, bool? unlimited = null, string stylesheet = null, bool? highBitdepth = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null, bool? revalidate = null) { var options = new VOption(); options.AddIfPresent(nameof(dpi), dpi); options.AddIfPresent(nameof(scale), scale); options.AddIfPresent(nameof(unlimited), unlimited); options.AddIfPresent(nameof(stylesheet), stylesheet); options.AddIfPresent("high_bitdepth", highBitdepth); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.AddIfPresent(nameof(revalidate), revalidate); options.Add("flags", true); var results = Operation.Call("svgload", options, filename) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; flags = (Enums.ForeignFlags)opts?["flags"]; return finalResult; } /// /// Load SVG with rsvg. /// /// /// /// using Image @out = NetVips.Image.SvgloadBuffer(buffer, dpi: double, scale: double, unlimited: bool, stylesheet: string, highBitdepth: bool, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Buffer to load from. /// Render at this DPI. /// Scale output by this factor. /// Allow SVG of any size. /// Custom CSS. /// Enable scRGB 128-bit output (32-bit per channel). /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image SvgloadBuffer(byte[] buffer, double? dpi = null, double? scale = null, bool? unlimited = null, string stylesheet = null, bool? highBitdepth = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(dpi), dpi); options.AddIfPresent(nameof(scale), scale); options.AddIfPresent(nameof(unlimited), unlimited); options.AddIfPresent(nameof(stylesheet), stylesheet); options.AddIfPresent("high_bitdepth", highBitdepth); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); return Operation.Call("svgload_buffer", options, buffer) as Image; } /// /// Load SVG with rsvg. /// /// /// /// using Image @out = NetVips.Image.SvgloadBuffer(buffer, out var flags, dpi: double, scale: double, unlimited: bool, stylesheet: string, highBitdepth: bool, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Buffer to load from. /// Flags for this file. /// Render at this DPI. /// Scale output by this factor. /// Allow SVG of any size. /// Custom CSS. /// Enable scRGB 128-bit output (32-bit per channel). /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image SvgloadBuffer(byte[] buffer, out Enums.ForeignFlags flags, double? dpi = null, double? scale = null, bool? unlimited = null, string stylesheet = null, bool? highBitdepth = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(dpi), dpi); options.AddIfPresent(nameof(scale), scale); options.AddIfPresent(nameof(unlimited), unlimited); options.AddIfPresent(nameof(stylesheet), stylesheet); options.AddIfPresent("high_bitdepth", highBitdepth); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.Add("flags", true); var results = Operation.Call("svgload_buffer", options, buffer) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; flags = (Enums.ForeignFlags)opts?["flags"]; return finalResult; } /// /// Load svg from source. /// /// /// /// using Image @out = NetVips.Image.SvgloadSource(source, dpi: double, scale: double, unlimited: bool, stylesheet: string, highBitdepth: bool, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Source to load from. /// Render at this DPI. /// Scale output by this factor. /// Allow SVG of any size. /// Custom CSS. /// Enable scRGB 128-bit output (32-bit per channel). /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image SvgloadSource(Source source, double? dpi = null, double? scale = null, bool? unlimited = null, string stylesheet = null, bool? highBitdepth = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(dpi), dpi); options.AddIfPresent(nameof(scale), scale); options.AddIfPresent(nameof(unlimited), unlimited); options.AddIfPresent(nameof(stylesheet), stylesheet); options.AddIfPresent("high_bitdepth", highBitdepth); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); return Operation.Call("svgload_source", options, source) as Image; } /// /// Load svg from stream. /// /// /// /// using Image @out = NetVips.Image.SvgloadStream(stream, dpi: double, scale: double, unlimited: bool, stylesheet: string, highBitdepth: bool, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Stream to load from. /// Render at this DPI. /// Scale output by this factor. /// Allow SVG of any size. /// Custom CSS. /// Enable scRGB 128-bit output (32-bit per channel). /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image SvgloadStream(Stream stream, double? dpi = null, double? scale = null, bool? unlimited = null, string stylesheet = null, bool? highBitdepth = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var source = SourceStream.NewFromStream(stream); var image = SvgloadSource(source, dpi, scale, unlimited, stylesheet, highBitdepth, memory, access, failOn); image.OnPostClose += () => source.Dispose(); return image; } /// /// Load svg from source. /// /// /// /// using Image @out = NetVips.Image.SvgloadSource(source, out var flags, dpi: double, scale: double, unlimited: bool, stylesheet: string, highBitdepth: bool, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Source to load from. /// Flags for this file. /// Render at this DPI. /// Scale output by this factor. /// Allow SVG of any size. /// Custom CSS. /// Enable scRGB 128-bit output (32-bit per channel). /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image SvgloadSource(Source source, out Enums.ForeignFlags flags, double? dpi = null, double? scale = null, bool? unlimited = null, string stylesheet = null, bool? highBitdepth = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(dpi), dpi); options.AddIfPresent(nameof(scale), scale); options.AddIfPresent(nameof(unlimited), unlimited); options.AddIfPresent(nameof(stylesheet), stylesheet); options.AddIfPresent("high_bitdepth", highBitdepth); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.Add("flags", true); var results = Operation.Call("svgload_source", options, source) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; flags = (Enums.ForeignFlags)opts?["flags"]; return finalResult; } /// /// Load svg from stream. /// /// /// /// using Image @out = NetVips.Image.SvgloadStream(stream, out var flags, dpi: double, scale: double, unlimited: bool, stylesheet: string, highBitdepth: bool, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Stream to load from. /// Flags for this file. /// Render at this DPI. /// Scale output by this factor. /// Allow SVG of any size. /// Custom CSS. /// Enable scRGB 128-bit output (32-bit per channel). /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image SvgloadStream(Stream stream, out Enums.ForeignFlags flags, double? dpi = null, double? scale = null, bool? unlimited = null, string stylesheet = null, bool? highBitdepth = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var source = SourceStream.NewFromStream(stream); var image = SvgloadSource(source, out flags, dpi, scale, unlimited, stylesheet, highBitdepth, memory, access, failOn); image.OnPostClose += () => source.Dispose(); return image; } /// /// Find the index of the first non-zero pixel in tests. /// /// /// /// using Image @out = NetVips.Image.Switch(tests); /// /// /// Table of images to test. /// A new . public static Image Switch(params Image[] tests) { return Operation.Call("switch", new object[] { tests }) as Image; } /// /// Run an external command. /// /// /// /// NetVips.Image.System(cmdFormat, @in: Image[], outFormat: string, inFormat: string); /// /// /// Command to run. /// Array of input images. /// Format for output filename. /// Format for input filename. public static void System(string cmdFormat, Image[] @in = null, string outFormat = null, string inFormat = null) { var options = new VOption(); options.AddIfPresent("in", @in); options.AddIfPresent("out_format", outFormat); options.AddIfPresent("in_format", inFormat); Operation.Call("system", options, cmdFormat); } /// /// Run an external command. /// /// /// /// NetVips.Image.System(cmdFormat, out var @out, @in: Image[], outFormat: string, inFormat: string); /// /// /// Command to run. /// Output image. /// Array of input images. /// Format for output filename. /// Format for input filename. public static void System(string cmdFormat, out Image @out, Image[] @in = null, string outFormat = null, string inFormat = null) { var options = new VOption(); options.AddIfPresent("in", @in); options.AddIfPresent("out_format", outFormat); options.AddIfPresent("in_format", inFormat); options.Add("out", true); var results = Operation.Call("system", options, cmdFormat) as object[]; var opts = results?[1] as VOption; @out = opts?["out"] as Image; } /// /// Run an external command. /// /// /// /// NetVips.Image.System(cmdFormat, out var @out, out var log, @in: Image[], outFormat: string, inFormat: string); /// /// /// Command to run. /// Output image. /// Command log. /// Array of input images. /// Format for output filename. /// Format for input filename. public static void System(string cmdFormat, out Image @out, out string log, Image[] @in = null, string outFormat = null, string inFormat = null) { var options = new VOption(); options.AddIfPresent("in", @in); options.AddIfPresent("out_format", outFormat); options.AddIfPresent("in_format", inFormat); options.Add("out", true); options.Add("log", true); var results = Operation.Call("system", options, cmdFormat) as object[]; var opts = results?[1] as VOption; @out = opts?["out"] as Image; log = opts?["log"] is string out2 ? out2 : null; } /// /// Make a text image. /// /// /// /// using Image @out = NetVips.Image.Text(text, font: string, width: int, height: int, align: Enums.Align, justify: bool, dpi: int, spacing: int, fontfile: string, rgba: bool, wrap: Enums.TextWrap); /// /// /// Text to render. /// Font to render with. /// Maximum image width in pixels. /// Maximum image height in pixels. /// Align on the low, centre or high edge. /// Justify lines. /// DPI to render at. /// Line spacing. /// Load this font file. /// Enable RGBA output. /// Wrap lines on word or character boundaries. /// A new . public static Image Text(string text, string font = null, int? width = null, int? height = null, Enums.Align? align = null, bool? justify = null, int? dpi = null, int? spacing = null, string fontfile = null, bool? rgba = null, Enums.TextWrap? wrap = null) { var options = new VOption(); options.AddIfPresent(nameof(font), font); options.AddIfPresent(nameof(width), width); options.AddIfPresent(nameof(height), height); options.AddIfPresent(nameof(align), align); options.AddIfPresent(nameof(justify), justify); options.AddIfPresent(nameof(dpi), dpi); options.AddIfPresent(nameof(spacing), spacing); options.AddIfPresent(nameof(fontfile), fontfile); options.AddIfPresent(nameof(rgba), rgba); options.AddIfPresent(nameof(wrap), wrap); return Operation.Call("text", options, text) as Image; } /// /// Make a text image. /// /// /// /// using Image @out = NetVips.Image.Text(text, out var autofitDpi, font: string, width: int, height: int, align: Enums.Align, justify: bool, dpi: int, spacing: int, fontfile: string, rgba: bool, wrap: Enums.TextWrap); /// /// /// Text to render. /// DPI selected by autofit. /// Font to render with. /// Maximum image width in pixels. /// Maximum image height in pixels. /// Align on the low, centre or high edge. /// Justify lines. /// DPI to render at. /// Line spacing. /// Load this font file. /// Enable RGBA output. /// Wrap lines on word or character boundaries. /// A new . public static Image Text(string text, out int autofitDpi, string font = null, int? width = null, int? height = null, Enums.Align? align = null, bool? justify = null, int? dpi = null, int? spacing = null, string fontfile = null, bool? rgba = null, Enums.TextWrap? wrap = null) { var options = new VOption(); options.AddIfPresent(nameof(font), font); options.AddIfPresent(nameof(width), width); options.AddIfPresent(nameof(height), height); options.AddIfPresent(nameof(align), align); options.AddIfPresent(nameof(justify), justify); options.AddIfPresent(nameof(dpi), dpi); options.AddIfPresent(nameof(spacing), spacing); options.AddIfPresent(nameof(fontfile), fontfile); options.AddIfPresent(nameof(rgba), rgba); options.AddIfPresent(nameof(wrap), wrap); options.Add("autofit_dpi", true); var results = Operation.Call("text", options, text) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; autofitDpi = opts?["autofit_dpi"] is int out1 ? out1 : 0; return finalResult; } /// /// Generate thumbnail from file. /// /// /// /// using Image @out = NetVips.Image.Thumbnail(filename, width, height: int, size: Enums.Size, noRotate: bool, crop: Enums.Interesting, linear: bool, inputProfile: string, outputProfile: string, intent: Enums.Intent, failOn: Enums.FailOn); /// /// /// Filename to read from. /// Size to this width. /// Size to this height. /// Only upsize, only downsize, or both. /// Don't use orientation tags to rotate image upright. /// Reduce to fill target rectangle, then crop. /// Reduce in linear light. /// Fallback input profile. /// Fallback output profile. /// Rendering intent. /// Error level to fail on. /// A new . public static Image Thumbnail(string filename, int width, int? height = null, Enums.Size? size = null, bool? noRotate = null, Enums.Interesting? crop = null, bool? linear = null, string inputProfile = null, string outputProfile = null, Enums.Intent? intent = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(height), height); options.AddIfPresent(nameof(size), size); options.AddIfPresent("no_rotate", noRotate); options.AddIfPresent(nameof(crop), crop); options.AddIfPresent(nameof(linear), linear); options.AddIfPresent("input_profile", inputProfile); options.AddIfPresent("output_profile", outputProfile); options.AddIfPresent(nameof(intent), intent); options.AddFailOn(failOn); return Operation.Call("thumbnail", options, filename, width) as Image; } /// /// Generate thumbnail from buffer. /// /// /// /// using Image @out = NetVips.Image.ThumbnailBuffer(buffer, width, optionString: string, height: int, size: Enums.Size, noRotate: bool, crop: Enums.Interesting, linear: bool, inputProfile: string, outputProfile: string, intent: Enums.Intent, failOn: Enums.FailOn); /// /// /// Buffer to load from. /// Size to this width. /// Options that are passed on to the underlying loader. /// Size to this height. /// Only upsize, only downsize, or both. /// Don't use orientation tags to rotate image upright. /// Reduce to fill target rectangle, then crop. /// Reduce in linear light. /// Fallback input profile. /// Fallback output profile. /// Rendering intent. /// Error level to fail on. /// A new . public static Image ThumbnailBuffer(byte[] buffer, int width, string optionString = null, int? height = null, Enums.Size? size = null, bool? noRotate = null, Enums.Interesting? crop = null, bool? linear = null, string inputProfile = null, string outputProfile = null, Enums.Intent? intent = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent("option_string", optionString); options.AddIfPresent(nameof(height), height); options.AddIfPresent(nameof(size), size); options.AddIfPresent("no_rotate", noRotate); options.AddIfPresent(nameof(crop), crop); options.AddIfPresent(nameof(linear), linear); options.AddIfPresent("input_profile", inputProfile); options.AddIfPresent("output_profile", outputProfile); options.AddIfPresent(nameof(intent), intent); options.AddFailOn(failOn); return Operation.Call("thumbnail_buffer", options, buffer, width) as Image; } /// /// Generate thumbnail from image. /// /// /// /// using Image @out = in.ThumbnailImage(width, height: int, size: Enums.Size, noRotate: bool, crop: Enums.Interesting, linear: bool, inputProfile: string, outputProfile: string, intent: Enums.Intent, failOn: Enums.FailOn); /// /// /// Size to this width. /// Size to this height. /// Only upsize, only downsize, or both. /// Don't use orientation tags to rotate image upright. /// Reduce to fill target rectangle, then crop. /// Reduce in linear light. /// Fallback input profile. /// Fallback output profile. /// Rendering intent. /// Error level to fail on. /// A new . public Image ThumbnailImage(int width, int? height = null, Enums.Size? size = null, bool? noRotate = null, Enums.Interesting? crop = null, bool? linear = null, string inputProfile = null, string outputProfile = null, Enums.Intent? intent = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(height), height); options.AddIfPresent(nameof(size), size); options.AddIfPresent("no_rotate", noRotate); options.AddIfPresent(nameof(crop), crop); options.AddIfPresent(nameof(linear), linear); options.AddIfPresent("input_profile", inputProfile); options.AddIfPresent("output_profile", outputProfile); options.AddIfPresent(nameof(intent), intent); options.AddFailOn(failOn); return this.Call("thumbnail_image", options, width) as Image; } /// /// Generate thumbnail from source. /// /// /// /// using Image @out = NetVips.Image.ThumbnailSource(source, width, optionString: string, height: int, size: Enums.Size, noRotate: bool, crop: Enums.Interesting, linear: bool, inputProfile: string, outputProfile: string, intent: Enums.Intent, failOn: Enums.FailOn); /// /// /// Source to load from. /// Size to this width. /// Options that are passed on to the underlying loader. /// Size to this height. /// Only upsize, only downsize, or both. /// Don't use orientation tags to rotate image upright. /// Reduce to fill target rectangle, then crop. /// Reduce in linear light. /// Fallback input profile. /// Fallback output profile. /// Rendering intent. /// Error level to fail on. /// A new . public static Image ThumbnailSource(Source source, int width, string optionString = null, int? height = null, Enums.Size? size = null, bool? noRotate = null, Enums.Interesting? crop = null, bool? linear = null, string inputProfile = null, string outputProfile = null, Enums.Intent? intent = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent("option_string", optionString); options.AddIfPresent(nameof(height), height); options.AddIfPresent(nameof(size), size); options.AddIfPresent("no_rotate", noRotate); options.AddIfPresent(nameof(crop), crop); options.AddIfPresent(nameof(linear), linear); options.AddIfPresent("input_profile", inputProfile); options.AddIfPresent("output_profile", outputProfile); options.AddIfPresent(nameof(intent), intent); options.AddFailOn(failOn); return Operation.Call("thumbnail_source", options, source, width) as Image; } /// /// Generate thumbnail from stream. /// /// /// /// using Image @out = NetVips.Image.ThumbnailStream(stream, width, optionString: string, height: int, size: Enums.Size, noRotate: bool, crop: Enums.Interesting, linear: bool, inputProfile: string, outputProfile: string, intent: Enums.Intent, failOn: Enums.FailOn); /// /// /// Stream to load from. /// Size to this width. /// Options that are passed on to the underlying loader. /// Size to this height. /// Only upsize, only downsize, or both. /// Don't use orientation tags to rotate image upright. /// Reduce to fill target rectangle, then crop. /// Reduce in linear light. /// Fallback input profile. /// Fallback output profile. /// Rendering intent. /// Error level to fail on. /// A new . public static Image ThumbnailStream(Stream stream, int width, string optionString = null, int? height = null, Enums.Size? size = null, bool? noRotate = null, Enums.Interesting? crop = null, bool? linear = null, string inputProfile = null, string outputProfile = null, Enums.Intent? intent = null, Enums.FailOn? failOn = null) { var source = SourceStream.NewFromStream(stream); var image = ThumbnailSource(source, width, optionString, height, size, noRotate, crop, linear, inputProfile, outputProfile, intent, failOn); image.OnPostClose += () => source.Dispose(); return image; } /// /// Load tiff from file. /// /// /// /// using Image @out = NetVips.Image.Tiffload(filename, page: int, n: int, autorotate: bool, subifd: int, unlimited: bool, memory: bool, access: Enums.Access, failOn: Enums.FailOn, revalidate: bool); /// /// /// Filename to load from. /// First page to load. /// Number of pages to load, -1 for all. /// Rotate image using orientation tag. /// Subifd index. /// Remove all denial of service limits. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// Don't use a cached result for this operation. /// A new . public static Image Tiffload(string filename, int? page = null, int? n = null, bool? autorotate = null, int? subifd = null, bool? unlimited = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null, bool? revalidate = null) { var options = new VOption(); options.AddIfPresent(nameof(page), page); options.AddIfPresent(nameof(n), n); options.AddIfPresent(nameof(autorotate), autorotate); options.AddIfPresent(nameof(subifd), subifd); options.AddIfPresent(nameof(unlimited), unlimited); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.AddIfPresent(nameof(revalidate), revalidate); return Operation.Call("tiffload", options, filename) as Image; } /// /// Load tiff from file. /// /// /// /// using Image @out = NetVips.Image.Tiffload(filename, out var flags, page: int, n: int, autorotate: bool, subifd: int, unlimited: bool, memory: bool, access: Enums.Access, failOn: Enums.FailOn, revalidate: bool); /// /// /// Filename to load from. /// Flags for this file. /// First page to load. /// Number of pages to load, -1 for all. /// Rotate image using orientation tag. /// Subifd index. /// Remove all denial of service limits. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// Don't use a cached result for this operation. /// A new . public static Image Tiffload(string filename, out Enums.ForeignFlags flags, int? page = null, int? n = null, bool? autorotate = null, int? subifd = null, bool? unlimited = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null, bool? revalidate = null) { var options = new VOption(); options.AddIfPresent(nameof(page), page); options.AddIfPresent(nameof(n), n); options.AddIfPresent(nameof(autorotate), autorotate); options.AddIfPresent(nameof(subifd), subifd); options.AddIfPresent(nameof(unlimited), unlimited); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.AddIfPresent(nameof(revalidate), revalidate); options.Add("flags", true); var results = Operation.Call("tiffload", options, filename) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; flags = (Enums.ForeignFlags)opts?["flags"]; return finalResult; } /// /// Load tiff from buffer. /// /// /// /// using Image @out = NetVips.Image.TiffloadBuffer(buffer, page: int, n: int, autorotate: bool, subifd: int, unlimited: bool, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Buffer to load from. /// First page to load. /// Number of pages to load, -1 for all. /// Rotate image using orientation tag. /// Subifd index. /// Remove all denial of service limits. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image TiffloadBuffer(byte[] buffer, int? page = null, int? n = null, bool? autorotate = null, int? subifd = null, bool? unlimited = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(page), page); options.AddIfPresent(nameof(n), n); options.AddIfPresent(nameof(autorotate), autorotate); options.AddIfPresent(nameof(subifd), subifd); options.AddIfPresent(nameof(unlimited), unlimited); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); return Operation.Call("tiffload_buffer", options, buffer) as Image; } /// /// Load tiff from buffer. /// /// /// /// using Image @out = NetVips.Image.TiffloadBuffer(buffer, out var flags, page: int, n: int, autorotate: bool, subifd: int, unlimited: bool, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Buffer to load from. /// Flags for this file. /// First page to load. /// Number of pages to load, -1 for all. /// Rotate image using orientation tag. /// Subifd index. /// Remove all denial of service limits. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image TiffloadBuffer(byte[] buffer, out Enums.ForeignFlags flags, int? page = null, int? n = null, bool? autorotate = null, int? subifd = null, bool? unlimited = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(page), page); options.AddIfPresent(nameof(n), n); options.AddIfPresent(nameof(autorotate), autorotate); options.AddIfPresent(nameof(subifd), subifd); options.AddIfPresent(nameof(unlimited), unlimited); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.Add("flags", true); var results = Operation.Call("tiffload_buffer", options, buffer) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; flags = (Enums.ForeignFlags)opts?["flags"]; return finalResult; } /// /// Load tiff from source. /// /// /// /// using Image @out = NetVips.Image.TiffloadSource(source, page: int, n: int, autorotate: bool, subifd: int, unlimited: bool, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Source to load from. /// First page to load. /// Number of pages to load, -1 for all. /// Rotate image using orientation tag. /// Subifd index. /// Remove all denial of service limits. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image TiffloadSource(Source source, int? page = null, int? n = null, bool? autorotate = null, int? subifd = null, bool? unlimited = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(page), page); options.AddIfPresent(nameof(n), n); options.AddIfPresent(nameof(autorotate), autorotate); options.AddIfPresent(nameof(subifd), subifd); options.AddIfPresent(nameof(unlimited), unlimited); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); return Operation.Call("tiffload_source", options, source) as Image; } /// /// Load tiff from stream. /// /// /// /// using Image @out = NetVips.Image.TiffloadStream(stream, page: int, n: int, autorotate: bool, subifd: int, unlimited: bool, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Stream to load from. /// First page to load. /// Number of pages to load, -1 for all. /// Rotate image using orientation tag. /// Subifd index. /// Remove all denial of service limits. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image TiffloadStream(Stream stream, int? page = null, int? n = null, bool? autorotate = null, int? subifd = null, bool? unlimited = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var source = SourceStream.NewFromStream(stream); var image = TiffloadSource(source, page, n, autorotate, subifd, unlimited, memory, access, failOn); image.OnPostClose += () => source.Dispose(); return image; } /// /// Load tiff from source. /// /// /// /// using Image @out = NetVips.Image.TiffloadSource(source, out var flags, page: int, n: int, autorotate: bool, subifd: int, unlimited: bool, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Source to load from. /// Flags for this file. /// First page to load. /// Number of pages to load, -1 for all. /// Rotate image using orientation tag. /// Subifd index. /// Remove all denial of service limits. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image TiffloadSource(Source source, out Enums.ForeignFlags flags, int? page = null, int? n = null, bool? autorotate = null, int? subifd = null, bool? unlimited = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(page), page); options.AddIfPresent(nameof(n), n); options.AddIfPresent(nameof(autorotate), autorotate); options.AddIfPresent(nameof(subifd), subifd); options.AddIfPresent(nameof(unlimited), unlimited); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.Add("flags", true); var results = Operation.Call("tiffload_source", options, source) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; flags = (Enums.ForeignFlags)opts?["flags"]; return finalResult; } /// /// Load tiff from stream. /// /// /// /// using Image @out = NetVips.Image.TiffloadStream(stream, out var flags, page: int, n: int, autorotate: bool, subifd: int, unlimited: bool, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Stream to load from. /// Flags for this file. /// First page to load. /// Number of pages to load, -1 for all. /// Rotate image using orientation tag. /// Subifd index. /// Remove all denial of service limits. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image TiffloadStream(Stream stream, out Enums.ForeignFlags flags, int? page = null, int? n = null, bool? autorotate = null, int? subifd = null, bool? unlimited = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var source = SourceStream.NewFromStream(stream); var image = TiffloadSource(source, out flags, page, n, autorotate, subifd, unlimited, memory, access, failOn); image.OnPostClose += () => source.Dispose(); return image; } /// /// Save image to tiff file. /// /// /// /// in.Tiffsave(filename, compression: Enums.ForeignTiffCompression, q: int, predictor: Enums.ForeignTiffPredictor, tile: bool, tileWidth: int, tileHeight: int, pyramid: bool, miniswhite: bool, bitdepth: int, resunit: Enums.ForeignTiffResunit, xres: double, yres: double, bigtiff: bool, properties: bool, regionShrink: Enums.RegionShrink, level: int, lossless: bool, depth: Enums.ForeignDzDepth, subifd: bool, premultiply: bool, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Filename to save to. /// Compression for this file. /// Q factor. /// Compression prediction. /// Write a tiled tiff. /// Tile width in pixels. /// Tile height in pixels. /// Write a pyramidal tiff. /// Use 0 for white in 1-bit images. /// Write as a 1, 2, 4 or 8 bit image. /// Resolution unit. /// Horizontal resolution in pixels/mm. /// Vertical resolution in pixels/mm. /// Write a bigtiff image. /// Write a properties document to IMAGEDESCRIPTION. /// Method to shrink regions. /// Deflate (1-9, default 6) or ZSTD (1-22, default 9) compression level. /// Enable WEBP lossless mode. /// Pyramid depth. /// Save pyr layers as sub-IFDs. /// Save with premultiplied alpha. /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. public void Tiffsave(string filename, Enums.ForeignTiffCompression? compression = null, int? q = null, Enums.ForeignTiffPredictor? predictor = null, bool? tile = null, int? tileWidth = null, int? tileHeight = null, bool? pyramid = null, bool? miniswhite = null, int? bitdepth = null, Enums.ForeignTiffResunit? resunit = null, double? xres = null, double? yres = null, bool? bigtiff = null, bool? properties = null, Enums.RegionShrink? regionShrink = null, int? level = null, bool? lossless = null, Enums.ForeignDzDepth? depth = null, bool? subifd = null, bool? premultiply = null, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { var options = new VOption(); options.AddIfPresent(nameof(compression), compression); options.AddIfPresent("Q", q); options.AddIfPresent(nameof(predictor), predictor); options.AddIfPresent(nameof(tile), tile); options.AddIfPresent("tile_width", tileWidth); options.AddIfPresent("tile_height", tileHeight); options.AddIfPresent(nameof(pyramid), pyramid); options.AddIfPresent(nameof(miniswhite), miniswhite); options.AddIfPresent(nameof(bitdepth), bitdepth); options.AddIfPresent(nameof(resunit), resunit); options.AddIfPresent(nameof(xres), xres); options.AddIfPresent(nameof(yres), yres); options.AddIfPresent(nameof(bigtiff), bigtiff); options.AddIfPresent(nameof(properties), properties); options.AddIfPresent("region_shrink", regionShrink); options.AddIfPresent(nameof(level), level); options.AddIfPresent(nameof(lossless), lossless); options.AddIfPresent(nameof(depth), depth); options.AddIfPresent(nameof(subifd), subifd); options.AddIfPresent(nameof(premultiply), premultiply); options.AddForeignKeep(keep); options.AddIfPresent(nameof(background), background); options.AddIfPresent("page_height", pageHeight); options.AddIfPresent(nameof(profile), profile); this.Call("tiffsave", options, filename); } /// /// Save image to tiff buffer. /// /// /// /// byte[] buffer = in.TiffsaveBuffer(compression: Enums.ForeignTiffCompression, q: int, predictor: Enums.ForeignTiffPredictor, tile: bool, tileWidth: int, tileHeight: int, pyramid: bool, miniswhite: bool, bitdepth: int, resunit: Enums.ForeignTiffResunit, xres: double, yres: double, bigtiff: bool, properties: bool, regionShrink: Enums.RegionShrink, level: int, lossless: bool, depth: Enums.ForeignDzDepth, subifd: bool, premultiply: bool, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Compression for this file. /// Q factor. /// Compression prediction. /// Write a tiled tiff. /// Tile width in pixels. /// Tile height in pixels. /// Write a pyramidal tiff. /// Use 0 for white in 1-bit images. /// Write as a 1, 2, 4 or 8 bit image. /// Resolution unit. /// Horizontal resolution in pixels/mm. /// Vertical resolution in pixels/mm. /// Write a bigtiff image. /// Write a properties document to IMAGEDESCRIPTION. /// Method to shrink regions. /// Deflate (1-9, default 6) or ZSTD (1-22, default 9) compression level. /// Enable WEBP lossless mode. /// Pyramid depth. /// Save pyr layers as sub-IFDs. /// Save with premultiplied alpha. /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. /// An array of bytes. public byte[] TiffsaveBuffer(Enums.ForeignTiffCompression? compression = null, int? q = null, Enums.ForeignTiffPredictor? predictor = null, bool? tile = null, int? tileWidth = null, int? tileHeight = null, bool? pyramid = null, bool? miniswhite = null, int? bitdepth = null, Enums.ForeignTiffResunit? resunit = null, double? xres = null, double? yres = null, bool? bigtiff = null, bool? properties = null, Enums.RegionShrink? regionShrink = null, int? level = null, bool? lossless = null, Enums.ForeignDzDepth? depth = null, bool? subifd = null, bool? premultiply = null, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { var options = new VOption(); options.AddIfPresent(nameof(compression), compression); options.AddIfPresent("Q", q); options.AddIfPresent(nameof(predictor), predictor); options.AddIfPresent(nameof(tile), tile); options.AddIfPresent("tile_width", tileWidth); options.AddIfPresent("tile_height", tileHeight); options.AddIfPresent(nameof(pyramid), pyramid); options.AddIfPresent(nameof(miniswhite), miniswhite); options.AddIfPresent(nameof(bitdepth), bitdepth); options.AddIfPresent(nameof(resunit), resunit); options.AddIfPresent(nameof(xres), xres); options.AddIfPresent(nameof(yres), yres); options.AddIfPresent(nameof(bigtiff), bigtiff); options.AddIfPresent(nameof(properties), properties); options.AddIfPresent("region_shrink", regionShrink); options.AddIfPresent(nameof(level), level); options.AddIfPresent(nameof(lossless), lossless); options.AddIfPresent(nameof(depth), depth); options.AddIfPresent(nameof(subifd), subifd); options.AddIfPresent(nameof(premultiply), premultiply); options.AddForeignKeep(keep); options.AddIfPresent(nameof(background), background); options.AddIfPresent("page_height", pageHeight); options.AddIfPresent(nameof(profile), profile); return this.Call("tiffsave_buffer", options) as byte[]; } /// /// Save image to tiff target. /// /// /// /// in.TiffsaveTarget(target, compression: Enums.ForeignTiffCompression, q: int, predictor: Enums.ForeignTiffPredictor, tile: bool, tileWidth: int, tileHeight: int, pyramid: bool, miniswhite: bool, bitdepth: int, resunit: Enums.ForeignTiffResunit, xres: double, yres: double, bigtiff: bool, properties: bool, regionShrink: Enums.RegionShrink, level: int, lossless: bool, depth: Enums.ForeignDzDepth, subifd: bool, premultiply: bool, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Target to save to. /// Compression for this file. /// Q factor. /// Compression prediction. /// Write a tiled tiff. /// Tile width in pixels. /// Tile height in pixels. /// Write a pyramidal tiff. /// Use 0 for white in 1-bit images. /// Write as a 1, 2, 4 or 8 bit image. /// Resolution unit. /// Horizontal resolution in pixels/mm. /// Vertical resolution in pixels/mm. /// Write a bigtiff image. /// Write a properties document to IMAGEDESCRIPTION. /// Method to shrink regions. /// Deflate (1-9, default 6) or ZSTD (1-22, default 9) compression level. /// Enable WEBP lossless mode. /// Pyramid depth. /// Save pyr layers as sub-IFDs. /// Save with premultiplied alpha. /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. public void TiffsaveTarget(Target target, Enums.ForeignTiffCompression? compression = null, int? q = null, Enums.ForeignTiffPredictor? predictor = null, bool? tile = null, int? tileWidth = null, int? tileHeight = null, bool? pyramid = null, bool? miniswhite = null, int? bitdepth = null, Enums.ForeignTiffResunit? resunit = null, double? xres = null, double? yres = null, bool? bigtiff = null, bool? properties = null, Enums.RegionShrink? regionShrink = null, int? level = null, bool? lossless = null, Enums.ForeignDzDepth? depth = null, bool? subifd = null, bool? premultiply = null, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { var options = new VOption(); options.AddIfPresent(nameof(compression), compression); options.AddIfPresent("Q", q); options.AddIfPresent(nameof(predictor), predictor); options.AddIfPresent(nameof(tile), tile); options.AddIfPresent("tile_width", tileWidth); options.AddIfPresent("tile_height", tileHeight); options.AddIfPresent(nameof(pyramid), pyramid); options.AddIfPresent(nameof(miniswhite), miniswhite); options.AddIfPresent(nameof(bitdepth), bitdepth); options.AddIfPresent(nameof(resunit), resunit); options.AddIfPresent(nameof(xres), xres); options.AddIfPresent(nameof(yres), yres); options.AddIfPresent(nameof(bigtiff), bigtiff); options.AddIfPresent(nameof(properties), properties); options.AddIfPresent("region_shrink", regionShrink); options.AddIfPresent(nameof(level), level); options.AddIfPresent(nameof(lossless), lossless); options.AddIfPresent(nameof(depth), depth); options.AddIfPresent(nameof(subifd), subifd); options.AddIfPresent(nameof(premultiply), premultiply); options.AddForeignKeep(keep); options.AddIfPresent(nameof(background), background); options.AddIfPresent("page_height", pageHeight); options.AddIfPresent(nameof(profile), profile); this.Call("tiffsave_target", options, target); } /// /// Save image to tiff stream. /// /// /// /// in.TiffsaveStream(stream, compression: Enums.ForeignTiffCompression, q: int, predictor: Enums.ForeignTiffPredictor, tile: bool, tileWidth: int, tileHeight: int, pyramid: bool, miniswhite: bool, bitdepth: int, resunit: Enums.ForeignTiffResunit, xres: double, yres: double, bigtiff: bool, properties: bool, regionShrink: Enums.RegionShrink, level: int, lossless: bool, depth: Enums.ForeignDzDepth, subifd: bool, premultiply: bool, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Stream to save to. /// Compression for this file. /// Q factor. /// Compression prediction. /// Write a tiled tiff. /// Tile width in pixels. /// Tile height in pixels. /// Write a pyramidal tiff. /// Use 0 for white in 1-bit images. /// Write as a 1, 2, 4 or 8 bit image. /// Resolution unit. /// Horizontal resolution in pixels/mm. /// Vertical resolution in pixels/mm. /// Write a bigtiff image. /// Write a properties document to IMAGEDESCRIPTION. /// Method to shrink regions. /// Deflate (1-9, default 6) or ZSTD (1-22, default 9) compression level. /// Enable WEBP lossless mode. /// Pyramid depth. /// Save pyr layers as sub-IFDs. /// Save with premultiplied alpha. /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. public void TiffsaveStream(Stream stream, Enums.ForeignTiffCompression? compression = null, int? q = null, Enums.ForeignTiffPredictor? predictor = null, bool? tile = null, int? tileWidth = null, int? tileHeight = null, bool? pyramid = null, bool? miniswhite = null, int? bitdepth = null, Enums.ForeignTiffResunit? resunit = null, double? xres = null, double? yres = null, bool? bigtiff = null, bool? properties = null, Enums.RegionShrink? regionShrink = null, int? level = null, bool? lossless = null, Enums.ForeignDzDepth? depth = null, bool? subifd = null, bool? premultiply = null, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { using var target = TargetStream.NewFromStream(stream); TiffsaveTarget(target, compression, q, predictor, tile, tileWidth, tileHeight, pyramid, miniswhite, bitdepth, resunit, xres, yres, bigtiff, properties, regionShrink, level, lossless, depth, subifd, premultiply, keep, background, pageHeight, profile); } /// /// Cache an image as a set of tiles. /// /// /// /// using Image @out = in.Tilecache(tileWidth: int, tileHeight: int, maxTiles: int, access: Enums.Access, threaded: bool, persistent: bool); /// /// /// Tile width in pixels. /// Tile height in pixels. /// Maximum number of tiles to cache. /// Expected access pattern. /// Allow threaded access. /// Keep cache between evaluations. /// A new . public Image Tilecache(int? tileWidth = null, int? tileHeight = null, int? maxTiles = null, Enums.Access? access = null, bool? threaded = null, bool? persistent = null) { var options = new VOption(); options.AddIfPresent("tile_width", tileWidth); options.AddIfPresent("tile_height", tileHeight); options.AddIfPresent("max_tiles", maxTiles); options.AddIfPresent(nameof(access), access); options.AddIfPresent(nameof(threaded), threaded); options.AddIfPresent(nameof(persistent), persistent); return this.Call("tilecache", options) as Image; } /// /// Build a look-up table. /// /// /// /// using Image @out = NetVips.Image.Tonelut(inMax: int, outMax: int, lb: double, lw: double, ps: double, pm: double, ph: double, s: double, m: double, h: double); /// /// /// Size of LUT to build. /// Maximum value in output LUT. /// Lowest value in output. /// Highest value in output. /// Position of shadow. /// Position of mid-tones. /// Position of highlights. /// Adjust shadows by this much. /// Adjust mid-tones by this much. /// Adjust highlights by this much. /// A new . public static Image Tonelut(int? inMax = null, int? outMax = null, double? lb = null, double? lw = null, double? ps = null, double? pm = null, double? ph = null, double? s = null, double? m = null, double? h = null) { var options = new VOption(); options.AddIfPresent("in_max", inMax); options.AddIfPresent("out_max", outMax); options.AddIfPresent("Lb", lb); options.AddIfPresent("Lw", lw); options.AddIfPresent("Ps", ps); options.AddIfPresent("Pm", pm); options.AddIfPresent("Ph", ph); options.AddIfPresent("S", s); options.AddIfPresent("M", m); options.AddIfPresent("H", h); return Operation.Call("tonelut", options) as Image; } /// /// Transpose3d an image. /// /// /// /// using Image @out = in.Transpose3d(pageHeight: int); /// /// /// Height of each input page. /// A new . public Image Transpose3d(int? pageHeight = null) { var options = new VOption(); options.AddIfPresent("page_height", pageHeight); return this.Call("transpose3d", options) as Image; } /// /// Unpremultiply image alpha. /// /// /// /// using Image @out = in.Unpremultiply(maxAlpha: double, alphaBand: int); /// /// /// Maximum value of alpha channel. /// Unpremultiply with this alpha. /// A new . public Image Unpremultiply(double? maxAlpha = null, int? alphaBand = null) { var options = new VOption(); options.AddIfPresent("max_alpha", maxAlpha); options.AddIfPresent("alpha_band", alphaBand); return this.Call("unpremultiply", options) as Image; } /// /// Load vips from file. /// /// /// /// using Image @out = NetVips.Image.Vipsload(filename, memory: bool, access: Enums.Access, failOn: Enums.FailOn, revalidate: bool); /// /// /// Filename to load from. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// Don't use a cached result for this operation. /// A new . public static Image Vipsload(string filename, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null, bool? revalidate = null) { var options = new VOption(); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.AddIfPresent(nameof(revalidate), revalidate); return Operation.Call("vipsload", options, filename) as Image; } /// /// Load vips from file. /// /// /// /// using Image @out = NetVips.Image.Vipsload(filename, out var flags, memory: bool, access: Enums.Access, failOn: Enums.FailOn, revalidate: bool); /// /// /// Filename to load from. /// Flags for this file. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// Don't use a cached result for this operation. /// A new . public static Image Vipsload(string filename, out Enums.ForeignFlags flags, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null, bool? revalidate = null) { var options = new VOption(); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.AddIfPresent(nameof(revalidate), revalidate); options.Add("flags", true); var results = Operation.Call("vipsload", options, filename) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; flags = (Enums.ForeignFlags)opts?["flags"]; return finalResult; } /// /// Load vips from source. /// /// /// /// using Image @out = NetVips.Image.VipsloadSource(source, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Source to load from. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image VipsloadSource(Source source, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); return Operation.Call("vipsload_source", options, source) as Image; } /// /// Load vips from stream. /// /// /// /// using Image @out = NetVips.Image.VipsloadStream(stream, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Stream to load from. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image VipsloadStream(Stream stream, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var source = SourceStream.NewFromStream(stream); var image = VipsloadSource(source, memory, access, failOn); image.OnPostClose += () => source.Dispose(); return image; } /// /// Load vips from source. /// /// /// /// using Image @out = NetVips.Image.VipsloadSource(source, out var flags, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Source to load from. /// Flags for this file. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image VipsloadSource(Source source, out Enums.ForeignFlags flags, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.Add("flags", true); var results = Operation.Call("vipsload_source", options, source) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; flags = (Enums.ForeignFlags)opts?["flags"]; return finalResult; } /// /// Load vips from stream. /// /// /// /// using Image @out = NetVips.Image.VipsloadStream(stream, out var flags, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Stream to load from. /// Flags for this file. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image VipsloadStream(Stream stream, out Enums.ForeignFlags flags, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var source = SourceStream.NewFromStream(stream); var image = VipsloadSource(source, out flags, memory, access, failOn); image.OnPostClose += () => source.Dispose(); return image; } /// /// Save image to file in vips format. /// /// /// /// in.Vipssave(filename, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Filename to save to. /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. public void Vipssave(string filename, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { var options = new VOption(); options.AddForeignKeep(keep); options.AddIfPresent(nameof(background), background); options.AddIfPresent("page_height", pageHeight); options.AddIfPresent(nameof(profile), profile); this.Call("vipssave", options, filename); } /// /// Save image to target in vips format. /// /// /// /// in.VipssaveTarget(target, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Target to save to. /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. public void VipssaveTarget(Target target, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { var options = new VOption(); options.AddForeignKeep(keep); options.AddIfPresent(nameof(background), background); options.AddIfPresent("page_height", pageHeight); options.AddIfPresent(nameof(profile), profile); this.Call("vipssave_target", options, target); } /// /// Save image to stream in vips format. /// /// /// /// in.VipssaveStream(stream, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Stream to save to. /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. public void VipssaveStream(Stream stream, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { using var target = TargetStream.NewFromStream(stream); VipssaveTarget(target, keep, background, pageHeight, profile); } /// /// Load webp from file. /// /// /// /// using Image @out = NetVips.Image.Webpload(filename, page: int, n: int, scale: double, memory: bool, access: Enums.Access, failOn: Enums.FailOn, revalidate: bool); /// /// /// Filename to load from. /// First page to load. /// Number of pages to load, -1 for all. /// Factor to scale by. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// Don't use a cached result for this operation. /// A new . public static Image Webpload(string filename, int? page = null, int? n = null, double? scale = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null, bool? revalidate = null) { var options = new VOption(); options.AddIfPresent(nameof(page), page); options.AddIfPresent(nameof(n), n); options.AddIfPresent(nameof(scale), scale); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.AddIfPresent(nameof(revalidate), revalidate); return Operation.Call("webpload", options, filename) as Image; } /// /// Load webp from file. /// /// /// /// using Image @out = NetVips.Image.Webpload(filename, out var flags, page: int, n: int, scale: double, memory: bool, access: Enums.Access, failOn: Enums.FailOn, revalidate: bool); /// /// /// Filename to load from. /// Flags for this file. /// First page to load. /// Number of pages to load, -1 for all. /// Factor to scale by. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// Don't use a cached result for this operation. /// A new . public static Image Webpload(string filename, out Enums.ForeignFlags flags, int? page = null, int? n = null, double? scale = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null, bool? revalidate = null) { var options = new VOption(); options.AddIfPresent(nameof(page), page); options.AddIfPresent(nameof(n), n); options.AddIfPresent(nameof(scale), scale); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.AddIfPresent(nameof(revalidate), revalidate); options.Add("flags", true); var results = Operation.Call("webpload", options, filename) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; flags = (Enums.ForeignFlags)opts?["flags"]; return finalResult; } /// /// Load webp from buffer. /// /// /// /// using Image @out = NetVips.Image.WebploadBuffer(buffer, page: int, n: int, scale: double, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Buffer to load from. /// First page to load. /// Number of pages to load, -1 for all. /// Factor to scale by. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image WebploadBuffer(byte[] buffer, int? page = null, int? n = null, double? scale = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(page), page); options.AddIfPresent(nameof(n), n); options.AddIfPresent(nameof(scale), scale); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); return Operation.Call("webpload_buffer", options, buffer) as Image; } /// /// Load webp from buffer. /// /// /// /// using Image @out = NetVips.Image.WebploadBuffer(buffer, out var flags, page: int, n: int, scale: double, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Buffer to load from. /// Flags for this file. /// First page to load. /// Number of pages to load, -1 for all. /// Factor to scale by. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image WebploadBuffer(byte[] buffer, out Enums.ForeignFlags flags, int? page = null, int? n = null, double? scale = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(page), page); options.AddIfPresent(nameof(n), n); options.AddIfPresent(nameof(scale), scale); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.Add("flags", true); var results = Operation.Call("webpload_buffer", options, buffer) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; flags = (Enums.ForeignFlags)opts?["flags"]; return finalResult; } /// /// Load webp from source. /// /// /// /// using Image @out = NetVips.Image.WebploadSource(source, page: int, n: int, scale: double, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Source to load from. /// First page to load. /// Number of pages to load, -1 for all. /// Factor to scale by. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image WebploadSource(Source source, int? page = null, int? n = null, double? scale = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(page), page); options.AddIfPresent(nameof(n), n); options.AddIfPresent(nameof(scale), scale); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); return Operation.Call("webpload_source", options, source) as Image; } /// /// Load webp from stream. /// /// /// /// using Image @out = NetVips.Image.WebploadStream(stream, page: int, n: int, scale: double, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Stream to load from. /// First page to load. /// Number of pages to load, -1 for all. /// Factor to scale by. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image WebploadStream(Stream stream, int? page = null, int? n = null, double? scale = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var source = SourceStream.NewFromStream(stream); var image = WebploadSource(source, page, n, scale, memory, access, failOn); image.OnPostClose += () => source.Dispose(); return image; } /// /// Load webp from source. /// /// /// /// using Image @out = NetVips.Image.WebploadSource(source, out var flags, page: int, n: int, scale: double, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Source to load from. /// Flags for this file. /// First page to load. /// Number of pages to load, -1 for all. /// Factor to scale by. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image WebploadSource(Source source, out Enums.ForeignFlags flags, int? page = null, int? n = null, double? scale = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var options = new VOption(); options.AddIfPresent(nameof(page), page); options.AddIfPresent(nameof(n), n); options.AddIfPresent(nameof(scale), scale); options.AddIfPresent(nameof(memory), memory); options.AddIfPresent(nameof(access), access); options.AddFailOn(failOn); options.Add("flags", true); var results = Operation.Call("webpload_source", options, source) as object[]; var finalResult = results?[0] as Image; var opts = results?[1] as VOption; flags = (Enums.ForeignFlags)opts?["flags"]; return finalResult; } /// /// Load webp from stream. /// /// /// /// using Image @out = NetVips.Image.WebploadStream(stream, out var flags, page: int, n: int, scale: double, memory: bool, access: Enums.Access, failOn: Enums.FailOn); /// /// /// Stream to load from. /// Flags for this file. /// First page to load. /// Number of pages to load, -1 for all. /// Factor to scale by. /// Force open via memory. /// Required access pattern for this file. /// Error level to fail on. /// A new . public static Image WebploadStream(Stream stream, out Enums.ForeignFlags flags, int? page = null, int? n = null, double? scale = null, bool? memory = null, Enums.Access? access = null, Enums.FailOn? failOn = null) { var source = SourceStream.NewFromStream(stream); var image = WebploadSource(source, out flags, page, n, scale, memory, access, failOn); image.OnPostClose += () => source.Dispose(); return image; } /// /// Save as WebP. /// /// /// /// in.Webpsave(filename, q: int, lossless: bool, preset: Enums.ForeignWebpPreset, smartSubsample: bool, nearLossless: bool, alphaQ: int, minSize: bool, kmin: int, kmax: int, effort: int, targetSize: int, mixed: bool, smartDeblock: bool, passes: int, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Filename to save to. /// Q factor. /// Enable lossless compression. /// Preset for lossy compression. /// Enable high quality chroma subsampling. /// Enable preprocessing in lossless mode (uses Q). /// Change alpha plane fidelity for lossy compression. /// Optimise for minimum size. /// Minimum number of frames between key frames. /// Maximum number of frames between key frames. /// Level of CPU effort to reduce file size. /// Desired target size in bytes. /// Allow mixed encoding (might reduce file size). /// Enable auto-adjusting of the deblocking filter. /// Number of entropy-analysis passes (in [1..10]). /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. public void Webpsave(string filename, int? q = null, bool? lossless = null, Enums.ForeignWebpPreset? preset = null, bool? smartSubsample = null, bool? nearLossless = null, int? alphaQ = null, bool? minSize = null, int? kmin = null, int? kmax = null, int? effort = null, int? targetSize = null, bool? mixed = null, bool? smartDeblock = null, int? passes = null, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { var options = new VOption(); options.AddIfPresent("Q", q); options.AddIfPresent(nameof(lossless), lossless); options.AddIfPresent(nameof(preset), preset); options.AddIfPresent("smart_subsample", smartSubsample); options.AddIfPresent("near_lossless", nearLossless); options.AddIfPresent("alpha_q", alphaQ); options.AddIfPresent("min_size", minSize); options.AddIfPresent(nameof(kmin), kmin); options.AddIfPresent(nameof(kmax), kmax); options.AddIfPresent(nameof(effort), effort); options.AddIfPresent("target_size", targetSize); options.AddIfPresent(nameof(mixed), mixed); options.AddIfPresent("smart_deblock", smartDeblock); options.AddIfPresent(nameof(passes), passes); options.AddForeignKeep(keep); options.AddIfPresent(nameof(background), background); options.AddIfPresent("page_height", pageHeight); options.AddIfPresent(nameof(profile), profile); this.Call("webpsave", options, filename); } /// /// Save as WebP. /// /// /// /// byte[] buffer = in.WebpsaveBuffer(q: int, lossless: bool, preset: Enums.ForeignWebpPreset, smartSubsample: bool, nearLossless: bool, alphaQ: int, minSize: bool, kmin: int, kmax: int, effort: int, targetSize: int, mixed: bool, smartDeblock: bool, passes: int, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Q factor. /// Enable lossless compression. /// Preset for lossy compression. /// Enable high quality chroma subsampling. /// Enable preprocessing in lossless mode (uses Q). /// Change alpha plane fidelity for lossy compression. /// Optimise for minimum size. /// Minimum number of frames between key frames. /// Maximum number of frames between key frames. /// Level of CPU effort to reduce file size. /// Desired target size in bytes. /// Allow mixed encoding (might reduce file size). /// Enable auto-adjusting of the deblocking filter. /// Number of entropy-analysis passes (in [1..10]). /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. /// An array of bytes. public byte[] WebpsaveBuffer(int? q = null, bool? lossless = null, Enums.ForeignWebpPreset? preset = null, bool? smartSubsample = null, bool? nearLossless = null, int? alphaQ = null, bool? minSize = null, int? kmin = null, int? kmax = null, int? effort = null, int? targetSize = null, bool? mixed = null, bool? smartDeblock = null, int? passes = null, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { var options = new VOption(); options.AddIfPresent("Q", q); options.AddIfPresent(nameof(lossless), lossless); options.AddIfPresent(nameof(preset), preset); options.AddIfPresent("smart_subsample", smartSubsample); options.AddIfPresent("near_lossless", nearLossless); options.AddIfPresent("alpha_q", alphaQ); options.AddIfPresent("min_size", minSize); options.AddIfPresent(nameof(kmin), kmin); options.AddIfPresent(nameof(kmax), kmax); options.AddIfPresent(nameof(effort), effort); options.AddIfPresent("target_size", targetSize); options.AddIfPresent(nameof(mixed), mixed); options.AddIfPresent("smart_deblock", smartDeblock); options.AddIfPresent(nameof(passes), passes); options.AddForeignKeep(keep); options.AddIfPresent(nameof(background), background); options.AddIfPresent("page_height", pageHeight); options.AddIfPresent(nameof(profile), profile); return this.Call("webpsave_buffer", options) as byte[]; } /// /// Save image to webp mime. /// /// /// /// in.WebpsaveMime(q: int, lossless: bool, preset: Enums.ForeignWebpPreset, smartSubsample: bool, nearLossless: bool, alphaQ: int, minSize: bool, kmin: int, kmax: int, effort: int, targetSize: int, mixed: bool, smartDeblock: bool, passes: int, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Q factor. /// Enable lossless compression. /// Preset for lossy compression. /// Enable high quality chroma subsampling. /// Enable preprocessing in lossless mode (uses Q). /// Change alpha plane fidelity for lossy compression. /// Optimise for minimum size. /// Minimum number of frames between key frames. /// Maximum number of frames between key frames. /// Level of CPU effort to reduce file size. /// Desired target size in bytes. /// Allow mixed encoding (might reduce file size). /// Enable auto-adjusting of the deblocking filter. /// Number of entropy-analysis passes (in [1..10]). /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. public void WebpsaveMime(int? q = null, bool? lossless = null, Enums.ForeignWebpPreset? preset = null, bool? smartSubsample = null, bool? nearLossless = null, int? alphaQ = null, bool? minSize = null, int? kmin = null, int? kmax = null, int? effort = null, int? targetSize = null, bool? mixed = null, bool? smartDeblock = null, int? passes = null, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { var options = new VOption(); options.AddIfPresent("Q", q); options.AddIfPresent(nameof(lossless), lossless); options.AddIfPresent(nameof(preset), preset); options.AddIfPresent("smart_subsample", smartSubsample); options.AddIfPresent("near_lossless", nearLossless); options.AddIfPresent("alpha_q", alphaQ); options.AddIfPresent("min_size", minSize); options.AddIfPresent(nameof(kmin), kmin); options.AddIfPresent(nameof(kmax), kmax); options.AddIfPresent(nameof(effort), effort); options.AddIfPresent("target_size", targetSize); options.AddIfPresent(nameof(mixed), mixed); options.AddIfPresent("smart_deblock", smartDeblock); options.AddIfPresent(nameof(passes), passes); options.AddForeignKeep(keep); options.AddIfPresent(nameof(background), background); options.AddIfPresent("page_height", pageHeight); options.AddIfPresent(nameof(profile), profile); this.Call("webpsave_mime", options); } /// /// Save as WebP. /// /// /// /// in.WebpsaveTarget(target, q: int, lossless: bool, preset: Enums.ForeignWebpPreset, smartSubsample: bool, nearLossless: bool, alphaQ: int, minSize: bool, kmin: int, kmax: int, effort: int, targetSize: int, mixed: bool, smartDeblock: bool, passes: int, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Target to save to. /// Q factor. /// Enable lossless compression. /// Preset for lossy compression. /// Enable high quality chroma subsampling. /// Enable preprocessing in lossless mode (uses Q). /// Change alpha plane fidelity for lossy compression. /// Optimise for minimum size. /// Minimum number of frames between key frames. /// Maximum number of frames between key frames. /// Level of CPU effort to reduce file size. /// Desired target size in bytes. /// Allow mixed encoding (might reduce file size). /// Enable auto-adjusting of the deblocking filter. /// Number of entropy-analysis passes (in [1..10]). /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. public void WebpsaveTarget(Target target, int? q = null, bool? lossless = null, Enums.ForeignWebpPreset? preset = null, bool? smartSubsample = null, bool? nearLossless = null, int? alphaQ = null, bool? minSize = null, int? kmin = null, int? kmax = null, int? effort = null, int? targetSize = null, bool? mixed = null, bool? smartDeblock = null, int? passes = null, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { var options = new VOption(); options.AddIfPresent("Q", q); options.AddIfPresent(nameof(lossless), lossless); options.AddIfPresent(nameof(preset), preset); options.AddIfPresent("smart_subsample", smartSubsample); options.AddIfPresent("near_lossless", nearLossless); options.AddIfPresent("alpha_q", alphaQ); options.AddIfPresent("min_size", minSize); options.AddIfPresent(nameof(kmin), kmin); options.AddIfPresent(nameof(kmax), kmax); options.AddIfPresent(nameof(effort), effort); options.AddIfPresent("target_size", targetSize); options.AddIfPresent(nameof(mixed), mixed); options.AddIfPresent("smart_deblock", smartDeblock); options.AddIfPresent(nameof(passes), passes); options.AddForeignKeep(keep); options.AddIfPresent(nameof(background), background); options.AddIfPresent("page_height", pageHeight); options.AddIfPresent(nameof(profile), profile); this.Call("webpsave_target", options, target); } /// /// Save as WebP. /// /// /// /// in.WebpsaveStream(stream, q: int, lossless: bool, preset: Enums.ForeignWebpPreset, smartSubsample: bool, nearLossless: bool, alphaQ: int, minSize: bool, kmin: int, kmax: int, effort: int, targetSize: int, mixed: bool, smartDeblock: bool, passes: int, keep: Enums.ForeignKeep, background: double[], pageHeight: int, profile: string); /// /// /// Stream to save to. /// Q factor. /// Enable lossless compression. /// Preset for lossy compression. /// Enable high quality chroma subsampling. /// Enable preprocessing in lossless mode (uses Q). /// Change alpha plane fidelity for lossy compression. /// Optimise for minimum size. /// Minimum number of frames between key frames. /// Maximum number of frames between key frames. /// Level of CPU effort to reduce file size. /// Desired target size in bytes. /// Allow mixed encoding (might reduce file size). /// Enable auto-adjusting of the deblocking filter. /// Number of entropy-analysis passes (in [1..10]). /// Which metadata to retain. /// Background value. /// Set page height for multipage save. /// Filename of ICC profile to embed. public void WebpsaveStream(Stream stream, int? q = null, bool? lossless = null, Enums.ForeignWebpPreset? preset = null, bool? smartSubsample = null, bool? nearLossless = null, int? alphaQ = null, bool? minSize = null, int? kmin = null, int? kmax = null, int? effort = null, int? targetSize = null, bool? mixed = null, bool? smartDeblock = null, int? passes = null, Enums.ForeignKeep? keep = null, double[] background = null, int? pageHeight = null, string profile = null) { using var target = TargetStream.NewFromStream(stream); WebpsaveTarget(target, q, lossless, preset, smartSubsample, nearLossless, alphaQ, minSize, kmin, kmax, effort, targetSize, mixed, smartDeblock, passes, keep, background, pageHeight, profile); } /// /// Make a worley noise image. /// /// /// /// using Image @out = NetVips.Image.Worley(width, height, cellSize: int, seed: int); /// /// /// Image width in pixels. /// Image height in pixels. /// Size of Worley cells. /// Random number seed. /// A new . public static Image Worley(int width, int height, int? cellSize = null, int? seed = null) { var options = new VOption(); options.AddIfPresent("cell_size", cellSize); options.AddIfPresent(nameof(seed), seed); return Operation.Call("worley", options, width, height) as Image; } /// /// Wrap image origin. /// /// /// /// using Image @out = in.Wrap(x: int, y: int); /// /// /// Left edge of input in output. /// Top edge of input in output. /// A new . public Image Wrap(int? x = null, int? y = null) { var options = new VOption(); options.AddIfPresent(nameof(x), x); options.AddIfPresent(nameof(y), y); return this.Call("wrap", options) as Image; } /// /// Make an image where pixel values are coordinates. /// /// /// /// using Image @out = NetVips.Image.Xyz(width, height, csize: int, dsize: int, esize: int); /// /// /// Image width in pixels. /// Image height in pixels. /// Size of third dimension. /// Size of fourth dimension. /// Size of fifth dimension. /// A new . public static Image Xyz(int width, int height, int? csize = null, int? dsize = null, int? esize = null) { var options = new VOption(); options.AddIfPresent(nameof(csize), csize); options.AddIfPresent(nameof(dsize), dsize); options.AddIfPresent(nameof(esize), esize); return Operation.Call("xyz", options, width, height) as Image; } /// /// Transform XYZ to CMYK. /// /// /// /// using Image @out = in.XYZ2CMYK(); /// /// /// A new . public Image XYZ2CMYK() { return this.Call("XYZ2CMYK") as Image; } /// /// Transform XYZ to Lab. /// /// /// /// using Image @out = in.XYZ2Lab(temp: double[]); /// /// /// Colour temperature. /// A new . public Image XYZ2Lab(double[] temp = null) { var options = new VOption(); options.AddIfPresent(nameof(temp), temp); return this.Call("XYZ2Lab", options) as Image; } /// /// Transform XYZ to scRGB. /// /// /// /// using Image @out = in.XYZ2scRGB(); /// /// /// A new . public Image XYZ2scRGB() { return this.Call("XYZ2scRGB") as Image; } /// /// Transform XYZ to Yxy. /// /// /// /// using Image @out = in.XYZ2Yxy(); /// /// /// A new . public Image XYZ2Yxy() { return this.Call("XYZ2Yxy") as Image; } /// /// Transform Yxy to XYZ. /// /// /// /// using Image @out = in.Yxy2XYZ(); /// /// /// A new . public Image Yxy2XYZ() { return this.Call("Yxy2XYZ") as Image; } /// /// Make a zone plate. /// /// /// /// using Image @out = NetVips.Image.Zone(width, height, uchar: bool); /// /// /// Image width in pixels. /// Image height in pixels. /// Output an unsigned char image. /// A new . public static Image Zone(int width, int height, bool? uchar = null) { var options = new VOption(); options.AddIfPresent(nameof(uchar), uchar); return Operation.Call("zone", options, width, height) as Image; } /// /// Zoom an image. /// /// /// /// using Image @out = input.Zoom(xfac, yfac); /// /// /// Horizontal zoom factor. /// Vertical zoom factor. /// A new . public Image Zoom(int xfac, int yfac) { return this.Call("zoom", xfac, yfac) as Image; } #endregion #region auto-generated properties /// /// Image width in pixels /// public int Width => (int)Get("width"); /// /// Image height in pixels /// public int Height => (int)Get("height"); /// /// Number of bands in image /// public int Bands => (int)Get("bands"); /// /// Pixel format in image /// public Enums.BandFormat Format => (Enums.BandFormat)Get("format"); /// /// Pixel coding /// public Enums.Coding Coding => (Enums.Coding)Get("coding"); /// /// Pixel interpretation /// public Enums.Interpretation Interpretation => (Enums.Interpretation)Get("interpretation"); /// /// Horizontal offset of origin /// public int Xoffset => (int)Get("xoffset"); /// /// Vertical offset of origin /// public int Yoffset => (int)Get("yoffset"); /// /// Horizontal resolution in pixels/mm /// public double Xres => (double)Get("xres"); /// /// Vertical resolution in pixels/mm /// public double Yres => (double)Get("yres"); /// /// Image filename /// public string Filename => (string)Get("filename"); #endregion }