From 26f51e8e3ce118f561e2233537bde4fddfc22148 Mon Sep 17 00:00:00 2001 From: Kleis Auke Wolthuizen Date: Tue, 30 Apr 2024 12:46:40 +0200 Subject: [PATCH] Improve type definitions for enums --- build/gen_cpp_binding.py | 20 +- build/gen_type_declarations.py | 22 +- lib/vips.d.ts | 484 ++++++++++++++++----------------- 3 files changed, 265 insertions(+), 261 deletions(-) diff --git a/build/gen_cpp_binding.py b/build/gen_cpp_binding.py index 55ded42aa..04d0e0937 100644 --- a/build/gen_cpp_binding.py +++ b/build/gen_cpp_binding.py @@ -8,7 +8,7 @@ import re from pyvips import Image, Introspect, GValue, Error, \ - ffi, values_for_enum, values_for_flag, \ + ffi, enum_dict, flags_dict, \ gobject_lib, type_map, type_name, \ type_from_name, nickname_find @@ -244,20 +244,21 @@ def add_flag(gtype, a, b): f.write(f' enum_<{name}>("{remove_prefix(name)}")') - for value in values_for_enum(gtype): - js_value = cppize(value) + values = enum_dict(gtype) + for key, _ in values.items(): + js_key = cppize(key) prefix = to_snake_case(name).upper() if prefix == 'VIPS_BAND_FORMAT': prefix = 'VIPS_FORMAT' elif prefix == 'VIPS_IMAGE_TYPE': prefix = 'VIPS_IMAGE' - cpp_value = prefix + '_' + js_value.upper() + cpp_value = prefix + '_' + js_key.upper() if cpp_value == 'VIPS_INTERPRETATION_SRGB': cpp_value = 'VIPS_INTERPRETATION_sRGB' elif cpp_value == 'VIPS_INTERPRETATION_SCRGB': cpp_value = 'VIPS_INTERPRETATION_scRGB' - f.write(f'\n .value("{js_value}", {cpp_value})') + f.write(f'\n .value("{js_key}", {cpp_value})') f.write(';\n\n') @@ -266,12 +267,13 @@ def add_flag(gtype, a, b): f.write(f' enum_<{name}>("{remove_prefix(name)}")') - for value in values_for_flag(gtype): - js_value = cppize(value) + values = flags_dict(gtype) + for key, _ in values.items(): + js_key = cppize(key) prefix = to_snake_case(name).upper() - cpp_value = prefix + '_' + js_value.upper() + cpp_value = prefix + '_' + js_key.upper() - f.write(f'\n .value("{js_value}", {cpp_value})') + f.write(f'\n .value("{js_key}", {cpp_value})') f.write(';\n\n') diff --git a/build/gen_type_declarations.py b/build/gen_type_declarations.py index 520cc0565..d64bf00ba 100644 --- a/build/gen_type_declarations.py +++ b/build/gen_type_declarations.py @@ -10,7 +10,7 @@ import xml.etree.ElementTree as ET from pyvips import Introspect, GValue, Error, \ - ffi, values_for_enum, values_for_flag, \ + ffi, enum_dict, flags_dict, \ gobject_lib, type_map, type_name, \ type_from_name, nickname_find @@ -271,10 +271,10 @@ def add_flag(gtype, a, b): name = remove_prefix(name) if name in xml_enums: node = xml_enums[name] - values = values_for_enum(gtype) + values = enum_dict(gtype) elif name in xml_flags: node = xml_flags[name] - values = values_for_flag(gtype) + values = flags_dict(gtype) else: continue @@ -289,12 +289,12 @@ def add_flag(gtype, a, b): f.write(f'{indent}enum {name} {{\n') - for i, value in enumerate(values): - js_value = value.replace('-', '_') - if i == 0 and (js_value == 'error' or js_value == 'notset'): + for i, (key, value) in enumerate(values.items()): + js_key = key.replace('-', '_') + if i == 0 and (js_key == 'error' or js_key == 'notset'): continue - member = node.find(f"goi:member[@name='{js_value}']", namespace) + member = node.find(f"goi:member[@name='{js_key}']", namespace) member_doc = member.find('goi:doc', namespace) if member_doc is not None: text = member_doc.text[:1].upper() + member_doc.text[1:] @@ -302,12 +302,14 @@ def add_flag(gtype, a, b): f.write(f'{indent} * {text}\n') f.write(f'{indent} */\n') - f.write(f"{indent} {js_value} = '{value}'") + f.write(f'{indent} {js_key} = {value}') if i != len(values) - 1: - f.write(',\n') + f.write(',') - f.write(f'\n{indent}}}\n\n') + f.write(f" // '{key}'\n") + + f.write(f'{indent}}}\n\n') f.write(f'{indent}//#endregion\n\n') diff --git a/lib/vips.d.ts b/lib/vips.d.ts index feb01a746..932adacda 100644 --- a/lib/vips.d.ts +++ b/lib/vips.d.ts @@ -1490,43 +1490,43 @@ declare module Vips { /** * Unsigned char format */ - uchar = 'uchar', + uchar = 0, // 'uchar' /** * Char format */ - char = 'char', + char = 1, // 'char' /** * Unsigned short format */ - ushort = 'ushort', + ushort = 2, // 'ushort' /** * Short format */ - short = 'short', + short = 3, // 'short' /** * Unsigned int format */ - uint = 'uint', + uint = 4, // 'uint' /** * Int format */ - int = 'int', + int = 5, // 'int' /** * Float format */ - float = 'float', + float = 6, // 'float' /** * Complex (two floats) format */ - complex = 'complex', + complex = 7, // 'complex' /** * Double float format */ - double = 'double', + double = 8, // 'double' /** * Double complex (two double) format */ - dpcomplex = 'dpcomplex' + dpcomplex = 9 // 'dpcomplex' } /** @@ -1543,103 +1543,103 @@ declare module Vips { /** * Where the second object is drawn, the first is removed */ - clear = 'clear', + clear = 0, // 'clear' /** * The second object is drawn as if nothing were below */ - source = 'source', + source = 1, // 'source' /** * The image shows what you would expect if you held two semi-transparent slides on top of each other */ - over = 'over', + over = 2, // 'over' /** * The first object is removed completely, the second is only drawn where the first was */ - in = 'in', + in = 3, // 'in' /** * The second is drawn only where the first isn't */ - out = 'out', + out = 4, // 'out' /** * This leaves the first object mostly intact, but mixes both objects in the overlapping area */ - atop = 'atop', + atop = 5, // 'atop' /** * Leaves the first object untouched, the second is discarded completely */ - dest = 'dest', + dest = 6, // 'dest' /** * Like OVER, but swaps the arguments */ - dest_over = 'dest-over', + dest_over = 7, // 'dest-over' /** * Like IN, but swaps the arguments */ - dest_in = 'dest-in', + dest_in = 8, // 'dest-in' /** * Like OUT, but swaps the arguments */ - dest_out = 'dest-out', + dest_out = 9, // 'dest-out' /** * Like ATOP, but swaps the arguments */ - dest_atop = 'dest-atop', + dest_atop = 10, // 'dest-atop' /** * Something like a difference operator */ - xor = 'xor', + xor = 11, // 'xor' /** * A bit like adding the two images */ - add = 'add', + add = 12, // 'add' /** * A bit like the darker of the two */ - saturate = 'saturate', + saturate = 13, // 'saturate' /** * At least as dark as the darker of the two inputs */ - multiply = 'multiply', + multiply = 14, // 'multiply' /** * At least as light as the lighter of the inputs */ - screen = 'screen', + screen = 15, // 'screen' /** * Multiplies or screens colors, depending on the lightness */ - overlay = 'overlay', + overlay = 16, // 'overlay' /** * The darker of each component */ - darken = 'darken', + darken = 17, // 'darken' /** * The lighter of each component */ - lighten = 'lighten', + lighten = 18, // 'lighten' /** * Brighten first by a factor second */ - colour_dodge = 'colour-dodge', + colour_dodge = 19, // 'colour-dodge' /** * Darken first by a factor of second */ - colour_burn = 'colour-burn', + colour_burn = 20, // 'colour-burn' /** * Multiply or screen, depending on lightness */ - hard_light = 'hard-light', + hard_light = 21, // 'hard-light' /** * Darken or lighten, depending on lightness */ - soft_light = 'soft-light', + soft_light = 22, // 'soft-light' /** * Difference of the two */ - difference = 'difference', + difference = 23, // 'difference' /** * Somewhat like DIFFERENCE, but lower-contrast */ - exclusion = 'exclusion' + exclusion = 24 // 'exclusion' } /** @@ -1656,15 +1656,15 @@ declare module Vips { /** * Pixels are not coded */ - none = 'none', + none = 0, // 'none' /** * Pixels encode 3 float CIELAB values as 4 uchar */ - labq = 'labq', + labq = 2, // 'labq' /** * Pixels encode 3 float RGB as 4 uchar (Radiance coding) */ - rad = 'rad' + rad = 6 // 'rad' } /** @@ -1682,79 +1682,79 @@ declare module Vips { /** * Generic many-band image */ - multiband = 'multiband', + multiband = 0, // 'multiband' /** * Some kind of single-band image */ - b_w = 'b-w', + b_w = 1, // 'b-w' /** * A 1D image, eg. histogram or lookup table */ - histogram = 'histogram', + histogram = 10, // 'histogram' /** * The first three bands are CIE XYZ */ - xyz = 'xyz', + xyz = 12, // 'xyz' /** * Pixels are in CIE Lab space */ - lab = 'lab', + lab = 13, // 'lab' /** * The first four bands are in CMYK space */ - cmyk = 'cmyk', + cmyk = 15, // 'cmyk' /** * Implies #VIPS_CODING_LABQ */ - labq = 'labq', + labq = 16, // 'labq' /** * Generic RGB space */ - rgb = 'rgb', + rgb = 17, // 'rgb' /** * A uniform colourspace based on CMC(1:1) */ - cmc = 'cmc', + cmc = 18, // 'cmc' /** * Pixels are in CIE LCh space */ - lch = 'lch', + lch = 19, // 'lch' /** * CIE LAB coded as three signed 16-bit values */ - labs = 'labs', + labs = 21, // 'labs' /** * Pixels are sRGB */ - srgb = 'srgb', + srgb = 22, // 'srgb' /** * Pixels are CIE Yxy */ - yxy = 'yxy', + yxy = 23, // 'yxy' /** * Image is in fourier space */ - fourier = 'fourier', + fourier = 24, // 'fourier' /** * Generic 16-bit RGB */ - rgb16 = 'rgb16', + rgb16 = 25, // 'rgb16' /** * Generic 16-bit mono */ - grey16 = 'grey16', + grey16 = 26, // 'grey16' /** * A matrix */ - matrix = 'matrix', + matrix = 27, // 'matrix' /** * Pixels are scRGB */ - scrgb = 'scrgb', + scrgb = 28, // 'scrgb' /** * Pixels are HSV */ - hsv = 'hsv' + hsv = 29 // 'hsv' } /** @@ -1791,15 +1791,15 @@ declare module Vips { /** * Demand in small (typically 128x128 pixel) tiles */ - smalltile = 'smalltile', + smalltile = 0, // 'smalltile' /** * Demand in fat (typically 16 pixel high) strips */ - fatstrip = 'fatstrip', + fatstrip = 1, // 'fatstrip' /** * Demand in thin (typically 1 pixel high) strips */ - thinstrip = 'thinstrip' + thinstrip = 2 // 'thinstrip' } /** @@ -1809,27 +1809,27 @@ declare module Vips { /** * == */ - equal = 'equal', + equal = 0, // 'equal' /** * != */ - noteq = 'noteq', + noteq = 1, // 'noteq' /** * < */ - less = 'less', + less = 2, // 'less' /** * <= */ - lesseq = 'lesseq', + lesseq = 3, // 'lesseq' /** * > */ - more = 'more', + more = 4, // 'more' /** * >= */ - moreeq = 'moreeq' + moreeq = 5 // 'moreeq' } /** @@ -1839,23 +1839,23 @@ declare module Vips { /** * & */ - and = 'and', + and = 0, // 'and' /** * | */ - or = 'or', + or = 1, // 'or' /** * ^ */ - eor = 'eor', + eor = 2, // 'eor' /** * >> */ - lshift = 'lshift', + lshift = 3, // 'lshift' /** * << */ - rshift = 'rshift' + rshift = 4 // 'rshift' } /** @@ -1865,15 +1865,15 @@ declare module Vips { /** * Pow(left, right) */ - pow = 'pow', + pow = 0, // 'pow' /** * Pow(right, left) */ - wop = 'wop', + wop = 1, // 'wop' /** * Atan2(left, right) */ - atan2 = 'atan2' + atan2 = 2 // 'atan2' } /** @@ -1883,7 +1883,7 @@ declare module Vips { /** * Convert to polar coordinates */ - cross_phase = 'cross-phase' + cross_phase = 0 // 'cross-phase' } /** @@ -1893,67 +1893,67 @@ declare module Vips { /** * Sin(), angles in degrees */ - sin = 'sin', + sin = 0, // 'sin' /** * Cos(), angles in degrees */ - cos = 'cos', + cos = 1, // 'cos' /** * Tan(), angles in degrees */ - tan = 'tan', + tan = 2, // 'tan' /** * Asin(), angles in degrees */ - asin = 'asin', + asin = 3, // 'asin' /** * Acos(), angles in degrees */ - acos = 'acos', + acos = 4, // 'acos' /** * Atan(), angles in degrees */ - atan = 'atan', + atan = 5, // 'atan' /** * Log base e */ - log = 'log', + log = 6, // 'log' /** * Log base 10 */ - log10 = 'log10', + log10 = 7, // 'log10' /** * E to the something */ - exp = 'exp', + exp = 8, // 'exp' /** * 10 to the something */ - exp10 = 'exp10', + exp10 = 9, // 'exp10' /** * Sinh(), angles in radians */ - sinh = 'sinh', + sinh = 10, // 'sinh' /** * Cosh(), angles in radians */ - cosh = 'cosh', + cosh = 11, // 'cosh' /** * Tanh(), angles in radians */ - tanh = 'tanh', + tanh = 12, // 'tanh' /** * Asinh(), angles in radians */ - asinh = 'asinh', + asinh = 13, // 'asinh' /** * Acosh(), angles in radians */ - acosh = 'acosh', + acosh = 14, // 'acosh' /** * Atanh(), angles in radians */ - atanh = 'atanh' + atanh = 15 // 'atanh' } /** @@ -1963,15 +1963,15 @@ declare module Vips { /** * Round to nearest */ - rint = 'rint', + rint = 0, // 'rint' /** * The smallest integral value not less than */ - ceil = 'ceil', + ceil = 1, // 'ceil' /** * Largest integral value not greater than */ - floor = 'floor' + floor = 2 // 'floor' } /** @@ -1981,15 +1981,15 @@ declare module Vips { /** * Convert to polar coordinates */ - polar = 'polar', + polar = 0, // 'polar' /** * Convert to rectangular coordinates */ - rect = 'rect', + rect = 1, // 'rect' /** * Complex conjugate */ - conj = 'conj' + conj = 2 // 'conj' } /** @@ -1999,11 +1999,11 @@ declare module Vips { /** * Get real component */ - real = 'real', + real = 0, // 'real' /** * Get imaginary component */ - imag = 'imag' + imag = 1 // 'imag' } /** @@ -2013,15 +2013,15 @@ declare module Vips { /** * Take the maximum of the possible values */ - max = 'max', + max = 0, // 'max' /** * Sum all the values */ - sum = 'sum', + sum = 1, // 'sum' /** * Take the minimum value */ - min = 'min' + min = 2 // 'min' } /** @@ -2037,12 +2037,12 @@ declare module Vips { /** * Can read anywhere */ - random = 'random', + random = 0, // 'random' /** * Top-to-bottom reading only, but with a small buffer */ - sequential = 'sequential', - sequential_unbuffered = 'sequential-unbuffered' + sequential = 1, // 'sequential' + sequential_unbuffered = 2 // 'sequential-unbuffered' } /** @@ -2074,27 +2074,27 @@ declare module Vips { /** * Extend with black (all 0) pixels */ - black = 'black', + black = 0, // 'black' /** * Copy the image edges */ - copy = 'copy', + copy = 1, // 'copy' /** * Repeat the whole image */ - repeat = 'repeat', + repeat = 2, // 'repeat' /** * Mirror the whole image */ - mirror = 'mirror', + mirror = 3, // 'mirror' /** * Extend with white (all bits set) pixels */ - white = 'white', + white = 4, // 'white' /** * Extend with colour from the @background property */ - background = 'background' + background = 5 // 'background' } /** @@ -2104,39 +2104,39 @@ declare module Vips { /** * Centre */ - centre = 'centre', + centre = 0, // 'centre' /** * North */ - north = 'north', + north = 1, // 'north' /** * East */ - east = 'east', + east = 2, // 'east' /** * South */ - south = 'south', + south = 3, // 'south' /** * West */ - west = 'west', + west = 4, // 'west' /** * North-east */ - north_east = 'north-east', + north_east = 5, // 'north-east' /** * South-east */ - south_east = 'south-east', + south_east = 6, // 'south-east' /** * South-west */ - south_west = 'south-west', + south_west = 7, // 'south-west' /** * North-west */ - north_west = 'north-west' + north_west = 8 // 'north-west' } /** @@ -2151,11 +2151,11 @@ declare module Vips { /** * Left-right */ - horizontal = 'horizontal', + horizontal = 0, // 'horizontal' /** * Top-bottom */ - vertical = 'vertical' + vertical = 1 // 'vertical' } /** @@ -2170,15 +2170,15 @@ declare module Vips { /** * Align low coordinate edge */ - low = 'low', + low = 0, // 'low' /** * Align centre */ - centre = 'centre', + centre = 1, // 'centre' /** * Align high coordinate edge */ - high = 'high' + high = 2 // 'high' } /** @@ -2196,31 +2196,31 @@ declare module Vips { /** * Do nothing */ - none = 'none', + none = 0, // 'none' /** * Just take the centre */ - centre = 'centre', + centre = 1, // 'centre' /** * Use an entropy measure */ - entropy = 'entropy', + entropy = 2, // 'entropy' /** * Look for features likely to draw human attention */ - attention = 'attention', + attention = 3, // 'attention' /** * Position the crop towards the low coordinate */ - low = 'low', + low = 4, // 'low' /** * Position the crop towards the high coordinate */ - high = 'high', + high = 5, // 'high' /** * Everything is interesting */ - all = 'all' + all = 6 // 'all' } /** @@ -2234,19 +2234,19 @@ declare module Vips { /** * No rotate */ - d0 = 'd0', + d0 = 0, // 'd0' /** * 90 degrees clockwise */ - d90 = 'd90', + d90 = 1, // 'd90' /** * 180 degree rotate */ - d180 = 'd180', + d180 = 2, // 'd180' /** * 90 degrees anti-clockwise */ - d270 = 'd270' + d270 = 3 // 'd270' } /** @@ -2260,35 +2260,35 @@ declare module Vips { /** * No rotate */ - d0 = 'd0', + d0 = 0, // 'd0' /** * 45 degrees clockwise */ - d45 = 'd45', + d45 = 1, // 'd45' /** * 90 degrees clockwise */ - d90 = 'd90', + d90 = 2, // 'd90' /** * 135 degrees clockwise */ - d135 = 'd135', + d135 = 3, // 'd135' /** * 180 degrees */ - d180 = 'd180', + d180 = 4, // 'd180' /** * 135 degrees anti-clockwise */ - d225 = 'd225', + d225 = 5, // 'd225' /** * 90 degrees anti-clockwise */ - d270 = 'd270', + d270 = 6, // 'd270' /** * 45 degrees anti-clockwise */ - d315 = 'd315' + d315 = 7 // 'd315' } /** @@ -2298,15 +2298,15 @@ declare module Vips { /** * Int everywhere */ - integer = 'integer', + integer = 0, // 'integer' /** * Float everywhere */ - float = 'float', + float = 1, // 'float' /** * Approximate integer output */ - approximate = 'approximate' + approximate = 2 // 'approximate' } /** @@ -2319,19 +2319,19 @@ declare module Vips { /** * Wrap at word boundaries */ - word = 'word', + word = 0, // 'word' /** * Wrap at character boundaries */ - char = 'char', + char = 1, // 'char' /** * Wrap at word boundaries, but fall back to character boundaries if there is not enough space for a full word */ - word_char = 'word-char', + word_char = 2, // 'word-char' /** * No wrapping */ - none = 'none' + none = 3 // 'none' } /** @@ -2345,19 +2345,19 @@ declare module Vips { /** * Never stop */ - none = 'none', + none = 0, // 'none' /** * Stop on image truncated, nothing else */ - truncated = 'truncated', + truncated = 1, // 'truncated' /** * Stop on serious error or truncation */ - error = 'error', + error = 2, // 'error' /** * Stop on anything, even warnings */ - warning = 'warning' + warning = 3 // 'warning' } /** @@ -2378,23 +2378,23 @@ declare module Vips { /** * Portable bitmap */ - pbm = 'pbm', + pbm = 0, // 'pbm' /** * Portable greymap */ - pgm = 'pgm', + pgm = 1, // 'pgm' /** * Portable pixmap */ - ppm = 'ppm', + ppm = 2, // 'ppm' /** * Portable float map */ - pfm = 'pfm', + pfm = 3, // 'pfm' /** * Portable anymap */ - pnm = 'pnm' + pnm = 4 // 'pnm' } /** @@ -2404,15 +2404,15 @@ declare module Vips { /** * Prevent subsampling when quality >= 90 */ - auto = 'auto', + auto = 0, // 'auto' /** * Always perform subsampling */ - on = 'on', + on = 1, // 'on' /** * Never perform subsampling */ - off = 'off' + off = 2 // 'off' } /** @@ -2422,23 +2422,23 @@ declare module Vips { /** * Use DeepZoom directory layout */ - dz = 'dz', + dz = 0, // 'dz' /** * Use Zoomify directory layout */ - zoomify = 'zoomify', + zoomify = 1, // 'zoomify' /** * Use Google maps directory layout */ - google = 'google', + google = 2, // 'google' /** * Use IIIF v2 directory layout */ - iiif = 'iiif', + iiif = 3, // 'iiif' /** * Use IIIF v3 directory layout */ - iiif3 = 'iiif3' + iiif3 = 4 // 'iiif3' } /** @@ -2448,15 +2448,15 @@ declare module Vips { /** * Create layers down to 1x1 pixel */ - onepixel = 'onepixel', + onepixel = 0, // 'onepixel' /** * Create layers down to 1x1 tile */ - onetile = 'onetile', + onetile = 1, // 'onetile' /** * Only create a single layer */ - one = 'one' + one = 2 // 'one' } /** @@ -2466,15 +2466,15 @@ declare module Vips { /** * Write tiles to the filesystem */ - fs = 'fs', + fs = 0, // 'fs' /** * Write tiles to a zip file */ - zip = 'zip', + zip = 1, // 'zip' /** * Write to a szi file */ - szi = 'szi' + szi = 2 // 'szi' } /** @@ -2484,27 +2484,27 @@ declare module Vips { /** * Use the average */ - mean = 'mean', + mean = 0, // 'mean' /** * Use the median */ - median = 'median', + median = 1, // 'median' /** * Use the mode */ - mode = 'mode', + mode = 2, // 'mode' /** * Use the maximum */ - max = 'max', + max = 3, // 'max' /** * Use the minimum */ - min = 'min', + min = 4, // 'min' /** * Use the top-left pixel */ - nearest = 'nearest' + nearest = 5 // 'nearest' } /** @@ -2514,27 +2514,27 @@ declare module Vips { /** * Default preset */ - default = 'default', + default = 0, // 'default' /** * Digital picture, like portrait, inner shot */ - picture = 'picture', + picture = 1, // 'picture' /** * Outdoor photograph, with natural lighting */ - photo = 'photo', + photo = 2, // 'photo' /** * Hand or line drawing, with high-contrast details */ - drawing = 'drawing', + drawing = 3, // 'drawing' /** * Small-sized colorful images */ - icon = 'icon', + icon = 4, // 'icon' /** * Text-like */ - text = 'text' + text = 5 // 'text' } /** @@ -2552,39 +2552,39 @@ declare module Vips { /** * No compression */ - none = 'none', + none = 0, // 'none' /** * Jpeg compression */ - jpeg = 'jpeg', + jpeg = 1, // 'jpeg' /** * Deflate (zip) compression */ - deflate = 'deflate', + deflate = 2, // 'deflate' /** * Packbits compression */ - packbits = 'packbits', + packbits = 3, // 'packbits' /** * Fax4 compression */ - ccittfax4 = 'ccittfax4', + ccittfax4 = 4, // 'ccittfax4' /** * LZW compression */ - lzw = 'lzw', + lzw = 5, // 'lzw' /** * WEBP compression */ - webp = 'webp', + webp = 6, // 'webp' /** * ZSTD compression */ - zstd = 'zstd', + zstd = 7, // 'zstd' /** * JP2K compression */ - jp2k = 'jp2k' + jp2k = 8 // 'jp2k' } /** @@ -2595,15 +2595,15 @@ declare module Vips { /** * No prediction */ - none = 'none', + none = 1, // 'none' /** * Horizontal differencing */ - horizontal = 'horizontal', + horizontal = 2, // 'horizontal' /** * Float predictor */ - float = 'float' + float = 3 // 'float' } /** @@ -2613,11 +2613,11 @@ declare module Vips { /** * Use centimeters */ - cm = 'cm', + cm = 0, // 'cm' /** * Use inches */ - inch = 'inch' + inch = 1 // 'inch' } /** @@ -2629,19 +2629,19 @@ declare module Vips { /** * X265 */ - hevc = 'hevc', + hevc = 1, // 'hevc' /** * X264 */ - avc = 'avc', + avc = 2, // 'avc' /** * Jpeg */ - jpeg = 'jpeg', + jpeg = 3, // 'jpeg' /** * Aom */ - av1 = 'av1' + av1 = 4 // 'av1' } /** @@ -2653,23 +2653,23 @@ declare module Vips { /** * Auto */ - auto = 'auto', + auto = 0, // 'auto' /** * Aom */ - aom = 'aom', + aom = 1, // 'aom' /** * RAV1E */ - rav1e = 'rav1e', + rav1e = 2, // 'rav1e' /** * SVT-AV1 */ - svt = 'svt', + svt = 3, // 'svt' /** * X265 */ - x265 = 'x265' + x265 = 4 // 'x265' } /** @@ -2682,19 +2682,19 @@ declare module Vips { /** * Size both up and down */ - both = 'both', + both = 0, // 'both' /** * Only upsize */ - up = 'up', + up = 1, // 'up' /** * Only downsize */ - down = 'down', + down = 2, // 'down' /** * Force size, that is, break aspect ratio */ - force = 'force' + force = 3 // 'force' } /** @@ -2706,19 +2706,19 @@ declare module Vips { /** * Perceptual rendering intent */ - perceptual = 'perceptual', + perceptual = 0, // 'perceptual' /** * Relative colorimetric rendering intent */ - relative = 'relative', + relative = 1, // 'relative' /** * Saturation rendering intent */ - saturation = 'saturation', + saturation = 2, // 'saturation' /** * Absolute colorimetric rendering intent */ - absolute = 'absolute' + absolute = 3 // 'absolute' } /** @@ -2728,27 +2728,27 @@ declare module Vips { /** * The nearest pixel to the point. */ - nearest = 'nearest', + nearest = 0, // 'nearest' /** * Convolve with a triangle filter. */ - linear = 'linear', + linear = 1, // 'linear' /** * Convolve with a cubic filter. */ - cubic = 'cubic', + cubic = 2, // 'cubic' /** * Convolve with a Mitchell kernel. */ - mitchell = 'mitchell', + mitchell = 3, // 'mitchell' /** * Convolve with a two-lobe Lanczos kernel. */ - lanczos2 = 'lanczos2', + lanczos2 = 4, // 'lanczos2' /** * Convolve with a three-lobe Lanczos kernel. */ - lanczos3 = 'lanczos3' + lanczos3 = 5 // 'lanczos3' } /** @@ -2760,11 +2760,11 @@ declare module Vips { /** * Use CIELAB D65 as the Profile Connection Space */ - lab = 'lab', + lab = 0, // 'lab' /** * Use XYZ as the Profile Connection Space */ - xyz = 'xyz' + xyz = 1 // 'xyz' } /** @@ -2776,11 +2776,11 @@ declare module Vips { /** * True if all set */ - erode = 'erode', + erode = 0, // 'erode' /** * True if one set */ - dilate = 'dilate' + dilate = 1 // 'dilate' } /** @@ -2795,11 +2795,11 @@ declare module Vips { /** * Set pixels to the new value */ - set = 'set', + set = 0, // 'set' /** * Add pixels */ - add = 'add' + add = 1 // 'add' } /** @@ -2809,31 +2809,31 @@ declare module Vips { /** * Don't attach metadata */ - none = 'none', + none = 0, // 'none' /** * Keep Exif metadata */ - exif = 'exif', + exif = 1, // 'exif' /** * Keep XMP metadata */ - xmp = 'xmp', + xmp = 2, // 'xmp' /** * Keep IPTC metadata */ - iptc = 'iptc', + iptc = 4, // 'iptc' /** * Keep ICC metadata */ - icc = 'icc', + icc = 8, // 'icc' /** * Keep other metadata (e.g. PNG comments and some TIFF tags) */ - other = 'other', + other = 16, // 'other' /** * Keep all metadata */ - all = 'all' + all = 31 // 'all' } /** @@ -2844,27 +2844,27 @@ declare module Vips { /** * No filtering */ - none = 'none', + none = 8, // 'none' /** * Difference to the left */ - sub = 'sub', + sub = 16, // 'sub' /** * Difference up */ - up = 'up', + up = 32, // 'up' /** * Average of left and up */ - avg = 'avg', + avg = 64, // 'avg' /** * Pick best neighbor predictor automatically */ - paeth = 'paeth', + paeth = 128, // 'paeth' /** * Adaptive */ - all = 'all' + all = 248 // 'all' } //#endregion