using System; namespace NetVips; /// /// This module contains the various libvips enums. /// public static class Enums { #region semi-generated enums /// /// The type of access an operation has to supply. /// /// /// See for example . /// public enum Access { /// Requests can come in any order. Random = 0, // "random" /// /// Means requests will be top-to-bottom, but with some /// amount of buffering behind the read point for small non-local /// accesses. /// Sequential = 1, // "sequential" /// Top-to-bottom without a buffer. SequentialUnbuffered = 2 // "sequential-unbuffered" } /// /// Various types of alignment. /// /// /// See for example . /// public enum Align { /// Align on the low coordinate edge. Low = 0, // "low" /// Align on the centre. Centre = 1, // "centre" /// Align on the high coordinate edge. High = 2 // "high" } /// /// Various fixed 90 degree rotation angles. /// /// /// See for example . /// public enum Angle { /// No rotate. D0 = 0, // "d0" /// 90 degrees clockwise. D90 = 1, // "d90" /// 180 degrees. D180 = 2, // "d180" /// 90 degrees anti-clockwise. D270 = 3 // "d270" } /// /// Various fixed 45 degree rotation angles. /// /// /// See for example . /// public enum Angle45 { /// No rotate. D0 = 0, // "d0" /// 45 degrees clockwise. D45 = 1, // "d45" /// 90 degrees clockwise. D90 = 2, // "d90" /// 135 degrees clockwise. D135 = 3, // "d135" /// 180 degrees. D180 = 4, // "d180" /// 135 degrees anti-clockwise. D225 = 5, // "d225" /// 90 degrees anti-clockwise. D270 = 6, // "d270" /// 45 degrees anti-clockwise. D315 = 7 // "d315" } /// /// The format of image bands. /// /// /// The format used for each band element. Each corresponds to a native C type /// for the current machine. /// public enum BandFormat { /// Invalid setting. Notset = -1, // "notset" /// unsigned char format. Uchar = 0, // "uchar" /// char format. Char = 1, // "char" /// unsigned short format. Ushort = 2, // "ushort" /// short format. Short = 3, // "short" /// unsigned int format. Uint = 4, // "uint" /// int format. Int = 5, // "int" /// float format. Float = 6, // "float" /// complex (two floats) format. Complex = 7, // "complex" /// double float format. Double = 8, // "double" /// double complex (two double) format. Dpcomplex = 9 // "dpcomplex" } /// /// The various Porter-Duff and PDF blend modes. See . /// /// /// The Cairo docs have a nice explanation of all the blend modes: /// https://www.cairographics.org/operators /// /// The non-separable modes are not implemented. /// public enum BlendMode { /// Where the second object is drawn, the first is removed. Clear = 0, // "clear" /// The second object is drawn as if nothing were below. Source = 1, // "source" /// The image shows what you would expect if you held two semi-transparent slides on top of each other. Over = 2, // "over" /// The first object is removed completely, the second is only drawn where the first was. In = 3, // "in" /// The second is drawn only where the first isn't. Out = 4, // "out" /// This leaves the first object mostly intact, but mixes both objects in the overlapping area. Atop = 5, // "atop" /// Leaves the first object untouched, the second is discarded completely. Dest = 6, // "dest" /// Like Over, but swaps the arguments. DestOver = 7, // "dest-over" /// Like In, but swaps the arguments. DestIn = 8, // "dest-in" /// Like Out, but swaps the arguments. DestOut = 9, // "dest-out" /// Like Atop, but swaps the arguments. DestAtop = 10, // "dest-atop" /// Something like a difference operator. Xor = 11, // "xor" /// A bit like adding the two images. Add = 12, // "add" /// A bit like the darker of the two. Saturate = 13, // "saturate" /// At least as dark as the darker of the two inputs. Multiply = 14, // "multiply" /// At least as light as the lighter of the inputs. Screen = 15, // "screen" /// Multiplies or screens colors, depending on the lightness. Overlay = 16, // "overlay" /// The darker of each component. Darken = 17, // "darken" /// The lighter of each component. Lighten = 18, // "lighten" /// Brighten first by a factor second. ColourDodge = 19, // "colour-dodge" /// Darken first by a factor of second. ColourBurn = 20, // "colour-burn" /// Multiply or screen, depending on lightness. HardLight = 21, // "hard-light" /// Darken or lighten, depending on lightness. SoftLight = 22, // "soft-light" /// Difference of the two. Difference = 23, // "difference" /// Somewhat like Difference, but lower-contrast. Exclusion = 24 // "exclusion" } /// /// How pixels are coded. /// /// /// Normally, pixels are uncoded and can be manipulated as you would expect. /// However some file formats code pixels for compression, and sometimes it's /// useful to be able to manipulate images in the coded format. /// public enum Coding { /// Invalid setting. Error = -1, // "error" /// Pixels are not coded. None = 0, // "none" /// Pixels encode 3 float CIELAB values as 4 uchar. Labq = 2, // "labq" /// Pixels encode 3 float RGB as 4 uchar (Radiance coding). Rad = 6 // "rad" } /// /// How to combine passes. /// /// /// See for example . /// public enum Combine { /// Take the maximum of all values. Max = 0, // "max" /// Take the sum of all values. Sum = 1, // "sum" /// Take the minimum value. Min = 2 // "min" } /// /// How to combine pixels. /// /// /// Operations like need to be told how to /// combine images from two sources. See also . /// public enum CombineMode { /// Set pixels to the new value. Set = 0, // "set" /// Add pixels. Add = 1 // "add" } /// /// A direction on a compass. Used for , for example. /// public enum CompassDirection { /// Centre Centre = 0, // "centre" /// North North = 1, // "north" /// East East = 2, // "east" /// South South = 3, // "south" /// West West = 4, // "west" /// North-east NorthEast = 5, // "north-east" /// South-east SouthEast = 6, // "south-east" /// South-west SouthWest = 7, // "south-west" /// North-west NorthWest = 8 // "north-west" } /// /// A direction. /// /// /// Operations like need to be told whether to flip /// left-right or top-bottom. /// public enum Direction { /// left-right. Horizontal = 0, // "horizontal" /// top-bottom. Vertical = 1 // "vertical" } /// /// How to extend image edges. /// /// /// When the edges of an image are extended, you can specify how you want /// the extension done. See , , /// and so on. /// public enum Extend { /// New pixels are black, ie. all bits are zero. Black = 0, // "black" /// Each new pixel takes the value of the nearest edge pixel. Copy = 1, // "copy" /// The image is tiled to fill the new area. Repeat = 2, // "repeat" /// The image is reflected and tiled to reduce hash edges. Mirror = 3, // "mirror" /// New pixels are white, ie. all bits are set. White = 4, // "white" /// Colour set from the @background property. Background = 5 // "background" } /// /// How sensitive loaders are to errors, from never stop (very insensitive), to /// stop on the smallest warning (very sensitive). /// /// Each one implies the ones before it, so implies /// . /// public enum FailOn { /// Never stop, None = 0, // "none" /// Stop on image truncated, nothing else. Truncated = 1, // "truncated" /// Stop on serious error or truncation. Error = 2, // "error" /// Stop on anything, even warnings. Warning = 3 // "warning" } /// /// The container type of the pyramid. /// /// /// See for example . /// public enum ForeignDzContainer { /// Write tiles to the filesystem. Fs = 0, // "fs" /// Write tiles to a zip file. Zip = 1, // "zip" /// Write to a szi file. Szi = 2 // "szi" } /// /// How many pyramid layers to create. /// /// /// See for example . /// public enum ForeignDzDepth { /// Create layers down to 1x1 pixel. Onepixel = 0, // "onepixel" /// Create layers down to 1x1 tile. Onetile = 1, // "onetile" /// Only create a single layer. One = 2 // "one" } /// /// What directory layout and metadata standard to use. /// public enum ForeignDzLayout { /// Use DeepZoom directory layout. Dz = 0, // "dz" /// Use Zoomify directory layout. Zoomify = 1, // "zoomify" /// Use Google maps directory layout. Google = 2, // "google" /// Use IIIF v2 directory layout. Iiif = 3, // "iiif" /// Use IIIF v3 directory layout Iiif3 = 4 // "iiif3" } /// /// The compression format to use inside a HEIF container. /// public enum ForeignHeifCompression { /// x265 Hevc = 1, // "hevc" /// x264 Avc = 2, // "avc" /// JPEG Jpeg = 3, // "jpeg" /// AOM Av1 = 4 // "av1" } /// /// The PNG filter to use. /// [Flags] public enum ForeignPngFilter { /// No filtering. None = 0x08, // "none" /// Difference to the left. Sub = 0x10, // "sub" /// Difference up. Up = 0x20, // "up" /// Average of left and up. Avg = 0x40, // "avg" /// Pick best neighbor predictor automatically. Paeth = 0x80, // "paeth" /// Adaptive. All = None | Sub | Up | Avg | Paeth // "all" } /// /// Which metadata to retain. /// [Flags] public enum ForeignKeep { /// Don't attach metadata. None = 0, // "none" /// Keep Exif metadata. Exif = 1 << 0, // "exif" /// Keep XMP metadata. Xmp = 1 << 1, // "xmp" /// Keep IPTC metadata. Iptc = 1 << 2, // "iptc" /// Keep ICC metadata. Icc = 1 << 3, // "icc" /// Keep other metadata (e.g. PNG comments and some TIFF tags) Other = 1 << 4, // "other" /// Keep all metadata. All = Exif | Xmp | Iptc | Icc | Other // "all" } /// /// The selected encoder to use. /// /// /// If libheif hasn't been compiled with the selected encoder, it will /// fallback to the default encoder based on . /// public enum ForeignHeifEncoder { /// Pick encoder automatically. Auto = 0, // "auto" /// AOM Aom = 1, // "aom" /// RAV1E Rav1e = 2, // "rav1e" /// SVT-AV1 Svt = 3, // "svt" /// x265 X265 = 4 // "x265" } /// /// The netpbm file format to save as. /// public enum ForeignPpmFormat { /// Images are single bit. Pbm = 0, // "pbm" /// Images are 8, 16, or 32-bits, one band. Pgm = 1, // "pgm" /// Images are 8, 16, or 32-bits, three bands. Ppm = 2, // "ppm" /// Images are 32-bit float pixels. Pfm = 3, // "pfm" /// Images are anymap images -- the image format is used to pick the saver. Pnm = 4 // "pnm" } /// /// Set JPEG/HEIF subsampling mode. /// public enum ForeignSubsample { /// Prevent subsampling when quality > 90. Auto = 0, // "auto" /// Always perform subsampling. On = 1, // "on" /// Never perform subsampling. Off = 2 // "off" } /// /// The compression types supported by the tiff writer. /// public enum ForeignTiffCompression { /// No compression. None = 0, // "none" /// JPEG compression. Jpeg = 1, // "jpeg" /// Deflate (zip) compression. Deflate = 2, // "deflate" /// Packbits compression. Packbits = 3, // "packbits" /// Fax4 compression. Ccittfax4 = 4, // "ccittfax4" /// LZW compression. Lzw = 5, // "lzw" /// WebP compression. Webp = 6, // "webp" /// ZSTD compression. Zstd = 7, // "zstd" /// JP2K compression. Jp2k = 8 // "jp2k" } /// /// The predictor can help deflate and lzw compression. /// The values are fixed by the tiff library. /// public enum ForeignTiffPredictor { /// No prediction. None = 1, // "none" /// Horizontal differencing. Horizontal = 2, // "horizontal" /// Float predictor. Float = 3 // "float" } /// /// Use inches or centimeters as the resolution unit for a tiff file. /// public enum ForeignTiffResunit { /// Use centimeters. Cm = 0, // "cm" /// Use inches. Inch = 1 // "inch" } /// /// Tune lossy encoder settings for different image types. /// public enum ForeignWebpPreset { /// Default preset. Default = 0, // "default" /// Digital picture, like portrait, inner shot. Picture = 1, // "picture" /// Outdoor photograph, with natural lighting. Photo = 2, // "photo" /// Hand or line drawing, with high-contrast details. Drawing = 3, // "drawing" /// Small-sized colorful images/ Icon = 4, // "icon" /// Text-like. Text = 5 // "text" } /// /// The rendering intent. /// /// /// See . /// public enum Intent { /// Perceptual rendering intent. Perceptual = 0, // "perceptual" /// Relative colorimetric rendering intent. Relative = 1, // "relative" /// Saturation rendering intent. Saturation = 2, // "saturation" /// Absolute colorimetric rendering intent. Absolute = 3, // "absolute" /// The rendering intent that the profile suggests. Auto = 32 // "auto" } /// /// Pick the algorithm vips uses to decide image "interestingness". /// This is used by , for example, to decide what parts of the image to keep. /// public enum Interesting { /// Do nothing. None = 0, // "none" /// Just take the centre. Centre = 1, // "centre" /// Use an entropy measure. Entropy = 2, // "entropy" /// Look for features likely to draw human attention. Attention = 3, // "attention" /// Position the crop towards the low coordinate. Low = 4, // "low" /// Position the crop towards the high coordinate. High = 5, // "high" /// Everything is interesting. All = 6 // "all" } /// /// How the values in an image should be interpreted. /// /// /// For example, a three-band float image of type LAB should have its /// pixels interpreted as coordinates in CIE Lab space. /// public enum Interpretation { /// Invalid setting. Error = -1, // "error" /// Generic many-band image. Multiband = 0, // "multiband" /// Some kind of single-band image. Bw = 1, // "b-w" /// A 1D image, eg. histogram or lookup table. Histogram = 10, // "histogram" /// The first three bands are CIE XYZ. Xyz = 12, // "xyz" /// Pixels are in CIE Lab space. Lab = 13, // "lab" /// The first four bands are in CMYK space. Cmyk = 15, // "cmyk" /// Implies . Labq = 16, // "labq" /// Generic RGB space. Rgb = 17, // "rgb" /// A uniform colourspace based on CMC(1:1). Cmc = 18, // "cmc" /// Pixels are in CIE LCh space. Lch = 19, // "lch" /// CIE LAB coded as three signed 16-bit values. Labs = 21, // "labs" /// Pixels are sRGB. Srgb = 22, // "srgb" /// Pixels are CIE Yxy. Yxy = 23, // "yxy" /// Image is in fourier space. Fourier = 24, // "fourier" /// Generic 16-bit RGB. Rgb16 = 25, // "rgb16" /// Generic 16-bit mono. Grey16 = 26, // "grey16" /// A matrix. Matrix = 27, // "matrix" /// Pixels are scRGB. Scrgb = 28, // "scrgb" /// Pixels are HSV. Hsv = 29 // "hsv" } /// /// A resizing kernel. One of these can be given to operations like /// or to select the resizing kernel to use. /// public enum Kernel { /// Nearest-neighbour interpolation. Nearest = 0, // "nearest" /// Linear interpolation. Linear = 1, // "linear" /// Cubic interpolation. Cubic = 2, // "cubic" /// Mitchell Mitchell = 3, // "mitchell" /// Two-lobe Lanczos. Lanczos2 = 4, // "lanczos2" /// Three-lobe Lanczos. Lanczos3 = 5, // "lanczos3" /// Magic Kernel Sharp 2013. Mks2013 = 6, // "mks2013" /// Magic Kernel Sharp 2021. Mks2021 = 7 // "mks2021" } /// /// Boolean operations. /// /// /// See . /// public enum OperationBoolean { /// & And = 0, // "and" /// | Or = 1, // "or" /// ^ Eor = 2, // "eor" /// << Lshift = 3, // "lshift" /// >> Rshift = 4 // "rshift" } /// /// Operations on complex images. /// /// /// See . /// public enum OperationComplex { /// Convert to polar coordinates. Polar = 0, // "polar" /// Convert to rectangular coordinates. Rect = 1, // "rect" /// Complex conjugate. Conj = 2 // "conj" } /// /// Binary operations on complex images. /// /// /// See . /// public enum OperationComplex2 { /// Convert to polar coordinates. CrossPhase = 0 // "cross-phase" } /// /// Components of complex images. /// /// /// See . /// public enum OperationComplexget { /// Get real component. Real = 0, // "real" /// Get imaginary component. Imag = 1 // "imag" } /// /// Various math functions on images. /// /// /// See . /// public enum OperationMath { /// sin(), angles in degrees. Sin = 0, // "sin" /// cos(), angles in degrees. Cos = 1, // "cos" /// tan(), angles in degrees. Tan = 2, // "tan" /// asin(), angles in degrees. Asin = 3, // "asin" /// acos(), angles in degrees. Acos = 4, // "acos" /// atan(), angles in degrees. Atan = 5, // "atan" /// log base e. Log = 6, // "log" /// log base 10. Log10 = 7, // "log10" /// e to the something. Exp = 8, // "exp" /// 10 to the something. Exp10 = 9, // "exp10" /// sinh(), angles in radians. Sinh = 10, // "sinh" /// cosh(), angles in radians. Cosh = 11, // "cosh" /// tanh(), angles in radians. Tanh = 12, // "tanh" /// asinh(), angles in radians. Asinh = 13, // "asinh" /// acosh(), angles in radians. Acosh = 14, // "acosh" /// atanh(), angles in radians. Atanh = 15 // "atanh" } /// /// Various math functions on images. /// /// /// See . /// public enum OperationMath2 { /// pow( left, right ). Pow = 0, // "pow" /// pow( right, left ). Wop = 1, // "wop" /// atan2( left, right ) Atan2 = 2 // "atan2" } /// /// Morphological operations. /// /// /// See . /// public enum OperationMorphology { /// true if all set. Erode = 0, // "erode" /// true if one set. Dilate = 1 // "dilate" } /// /// Various relational operations. /// /// /// See . /// public enum OperationRelational { /// == Equal = 0, // "equal" /// != Noteq = 1, // "noteq" /// < Less = 2, // "less" /// <= Lesseq = 3, // "lesseq" /// > More = 4, // "more" /// >= Moreeq = 5 // "moreeq" } /// /// Round operations. /// public enum OperationRound { /// Round to nearest. Rint = 0, // "rint" /// The smallest integral value not less than. Ceil = 1, // "ceil" /// Largest integral value not greater than. Floor = 2 // "floor" } /// /// Set Profile Connection Space. /// /// /// See for example . /// public enum PCS { /// CIE Lab space. Lab = 0, // "lab" /// CIE XYZ space. Xyz = 1 // "xyz" } /// /// Computation precision. /// /// /// See for example . /// public enum Precision { /// Integer. Integer = 0, // "integer" /// Floating point. Float = 1, // "float" /// Compute approximate result. Approximate = 2 // "approximate" } /// /// How to calculate the output pixels when shrinking a 2x2 region. /// public enum RegionShrink { /// Use the average. Mean = 0, // "mean" /// Use the median. Median = 1, // "median" /// Use the mode. Mode = 2, // "mode" /// Use the maximum. Max = 3, // "max" /// Use the minimum. Min = 4, // "min" /// Use the top-left pixel. Nearest = 5 // "nearest" } /// /// The SDF to generate. /// /// /// See for example . /// public enum SdfShape { /// A circle at @a, radius @r. Circle = 0, // "circle" /// A box from @a to @b. Box = 1, // "box" /// A box with rounded @corners from @a to @b. RoundedBox = 2, // "rounded-box" /// A line from @a to @b. Line = 3 // "line" } /// /// Controls whether an operation should upsize, downsize, both up and downsize, or force a size. /// /// /// See for example . /// public enum Size { /// Size both up and down. Both = 0, // "both" /// Only upsize. Up = 1, // "up" /// Only downsize. Down = 2, // "down" /// Force size, that is, break aspect ratio. Force = 3 // "force" } /// /// Sets the word wrapping style for when used with a maximum width. /// public enum TextWrap { /// Wrap at word boundaries. Word = 0, // "word" /// Wrap at character boundaries. Char = 1, // "char" /// Wrap at word boundaries, but fall back to character boundaries if there is not enough space for a full word. WordChar = 2, // "word-char" /// No wrapping. None = 3 // "none" } #endregion /// /// Flags specifying the level of log messages. /// [Flags] public enum LogLevelFlags { #region Internal log flags /// Internal flag. FlagRecursion = 1 << 0, /// Internal flag. FlagFatal = 1 << 1, #endregion #region GLib log levels /// Log level for errors. Error = 1 << 2, // always fatal /// Log level for critical warning messages. Critical = 1 << 3, /// Log level for warnings. Warning = 1 << 4, /// Log level for messages. Message = 1 << 5, /// Log level for informational messages. Info = 1 << 6, /// Log level for debug messages. Debug = 1 << 7, #endregion #region Convenience values /// All log levels except fatal. AllButFatal = All & ~FlagFatal, /// All log levels except recursion. AllButRecursion = All & ~FlagRecursion, /// All log levels. All = FlagMask | Error | Critical | Warning | Message | Info | Debug, /// Flag mask. FlagMask = ~LevelMask, /// A mask including all log levels. LevelMask = ~(FlagRecursion | FlagFatal), /// A mask with log levels that are considered fatal by default. FatalMask = FlagRecursion | Error #endregion } /// /// Flags we associate with each object argument. /// [Flags] public enum ArgumentFlags { /// No flags. NONE = 0, /// Must be set in the constructor. REQUIRED = 1 << 0, /// Can only be set in the constructor. CONSTRUCT = 1 << 1, /// Can only be set once. SET_ONCE = 1 << 2, /// Don't do use-before-set checks. SET_ALWAYS = 1 << 3, /// Is an input argument (one we depend on). INPUT = 1 << 4, /// Is an output argument (depends on us). OUTPUT = 1 << 5, /// Just there for back-compat, hide. DEPRECATED = 1 << 6, /// The input argument will be modified. MODIFY = 1 << 7 } /// /// Flags we associate with an . /// [Flags] public enum OperationFlags : uint { /// No flags. NONE = 0, /// Can work sequentially with a small buffer. SEQUENTIAL = 1 << 0, /// Can work sequentially without a buffer. SEQUENTIAL_UNBUFFERED = 1 << 1, /// Must not be cached. NOCACHE = 1 << 2, /// A compatibility thing. DEPRECATED = 1 << 3, /// Not hardened for untrusted input. UNTRUSTED = 1 << 4, /// Prevent this operation from running. BLOCKED = 1 << 5 } /// /// Flags we associate with a file load operation. /// [Flags] public enum ForeignFlags : uint { /// No flags set. NONE = 0, /// Lazy read OK (eg. tiled tiff). PARTIAL = 1 << 0, /// Most-significant byte first. BIGENDIAN = 1 << 1, /// Top-to-bottom lazy read OK. SEQUENTIAL = 1 << 2, /// All flags set. ALL = 1 << 3 } /// /// Signals that can be used on an . See . /// public enum Signals { /// Evaluation is starting. /// /// The preeval signal is emitted once before computation of /// starts. It's a good place to set up evaluation feedback. /// PreEval = 0, // "preeval" /// Evaluation progress. /// /// The eval signal is emitted once per work unit (typically a 128 x /// 128 area of pixels) during image computation. /// /// You can use this signal to update user-interfaces with progress /// feedback. Beware of updating too frequently: you will usually /// need some throttling mechanism. /// Eval = 1, // "eval" /// Evaluation is ending. /// /// The posteval signal is emitted once at the end of the computation /// of . It's a good place to shut down evaluation feedback. /// PostEval = 2 // "posteval" } }