rs_vips/
ops.rs

1// (c) Copyright 2019-2025 OLX
2// (c) Copyright 2025 mrdkprj
3#![allow(clippy::too_many_arguments)]
4#![allow(clippy::upper_case_acronyms)]
5use crate::bindings::{vips_area_unref, vips_blob_new};
6use crate::connection::VipsSource;
7use crate::connection::VipsTarget;
8use crate::error::*;
9use crate::region::VipsBlob;
10use crate::utils;
11use crate::voption::{call, Setter, VOption};
12use crate::Result;
13use crate::VipsImage;
14use std::ffi::c_void;
15use std::ptr::null_mut;
16
17const NULL: *const c_void = null_mut();
18
19#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
20pub enum Access {
21    ///  `Random` -> VIPS_ACCESS_RANDOM = 0
22    Random = 0,
23    ///  `Sequential` -> VIPS_ACCESS_SEQUENTIAL = 1
24    Sequential = 1,
25    ///  `SequentialUnbuffered` -> VIPS_ACCESS_SEQUENTIAL_UNBUFFERED = 2
26    SequentialUnbuffered = 2,
27    ///  `Last` -> VIPS_ACCESS_LAST = 3
28    Last = 3,
29}
30
31#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
32pub enum Align {
33    ///  `Low` -> VIPS_ALIGN_LOW = 0
34    Low = 0,
35    ///  `Centre` -> VIPS_ALIGN_CENTRE = 1
36    Centre = 1,
37    ///  `High` -> VIPS_ALIGN_HIGH = 2
38    High = 2,
39    ///  `Last` -> VIPS_ALIGN_LAST = 3
40    Last = 3,
41}
42
43#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
44pub enum Angle {
45    ///  `D0` -> VIPS_ANGLE_D0 = 0
46    D0 = 0,
47    ///  `D90` -> VIPS_ANGLE_D90 = 1
48    D90 = 1,
49    ///  `D180` -> VIPS_ANGLE_D180 = 2
50    D180 = 2,
51    ///  `D270` -> VIPS_ANGLE_D270 = 3
52    D270 = 3,
53    ///  `Last` -> VIPS_ANGLE_LAST = 4
54    Last = 4,
55}
56
57#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
58pub enum Angle45 {
59    ///  `D0` -> VIPS_ANGLE45_D0 = 0
60    D0 = 0,
61    ///  `D45` -> VIPS_ANGLE45_D45 = 1
62    D45 = 1,
63    ///  `D90` -> VIPS_ANGLE45_D90 = 2
64    D90 = 2,
65    ///  `D135` -> VIPS_ANGLE45_D135 = 3
66    D135 = 3,
67    ///  `D180` -> VIPS_ANGLE45_D180 = 4
68    D180 = 4,
69    ///  `D225` -> VIPS_ANGLE45_D225 = 5
70    D225 = 5,
71    ///  `D270` -> VIPS_ANGLE45_D270 = 6
72    D270 = 6,
73    ///  `D315` -> VIPS_ANGLE45_D315 = 7
74    D315 = 7,
75    ///  `Last` -> VIPS_ANGLE45_LAST = 8
76    Last = 8,
77}
78
79#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
80pub enum BandFormat {
81    ///  `Notset` -> VIPS_FORMAT_NOTSET = -1
82    Notset = -1,
83    ///  `Uchar` -> VIPS_FORMAT_UCHAR = 0
84    Uchar = 0,
85    ///  `Char` -> VIPS_FORMAT_CHAR = 1
86    Char = 1,
87    ///  `Ushort` -> VIPS_FORMAT_USHORT = 2
88    Ushort = 2,
89    ///  `Short` -> VIPS_FORMAT_SHORT = 3
90    Short = 3,
91    ///  `Uint` -> VIPS_FORMAT_UINT = 4
92    Uint = 4,
93    ///  `Int` -> VIPS_FORMAT_INT = 5
94    Int = 5,
95    ///  `Float` -> VIPS_FORMAT_FLOAT = 6
96    Float = 6,
97    ///  `Complex` -> VIPS_FORMAT_COMPLEX = 7
98    Complex = 7,
99    ///  `Double` -> VIPS_FORMAT_DOUBLE = 8
100    Double = 8,
101    ///  `Dpcomplex` -> VIPS_FORMAT_DPCOMPLEX = 9
102    Dpcomplex = 9,
103    ///  `Last` -> VIPS_FORMAT_LAST = 10
104    Last = 10,
105}
106
107#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
108pub enum BlendMode {
109    ///  `Clear` -> VIPS_BLEND_MODE_CLEAR = 0
110    Clear = 0,
111    ///  `Source` -> VIPS_BLEND_MODE_SOURCE = 1
112    Source = 1,
113    ///  `Over` -> VIPS_BLEND_MODE_OVER = 2
114    Over = 2,
115    ///  `In` -> VIPS_BLEND_MODE_IN = 3
116    In = 3,
117    ///  `Out` -> VIPS_BLEND_MODE_OUT = 4
118    Out = 4,
119    ///  `Atop` -> VIPS_BLEND_MODE_ATOP = 5
120    Atop = 5,
121    ///  `Dest` -> VIPS_BLEND_MODE_DEST = 6
122    Dest = 6,
123    ///  `DestOver` -> VIPS_BLEND_MODE_DEST_OVER = 7
124    DestOver = 7,
125    ///  `DestIn` -> VIPS_BLEND_MODE_DEST_IN = 8
126    DestIn = 8,
127    ///  `DestOut` -> VIPS_BLEND_MODE_DEST_OUT = 9
128    DestOut = 9,
129    ///  `DestAtop` -> VIPS_BLEND_MODE_DEST_ATOP = 10
130    DestAtop = 10,
131    ///  `Xor` -> VIPS_BLEND_MODE_XOR = 11
132    Xor = 11,
133    ///  `Add` -> VIPS_BLEND_MODE_ADD = 12
134    Add = 12,
135    ///  `Saturate` -> VIPS_BLEND_MODE_SATURATE = 13
136    Saturate = 13,
137    ///  `Multiply` -> VIPS_BLEND_MODE_MULTIPLY = 14
138    Multiply = 14,
139    ///  `Screen` -> VIPS_BLEND_MODE_SCREEN = 15
140    Screen = 15,
141    ///  `Overlay` -> VIPS_BLEND_MODE_OVERLAY = 16
142    Overlay = 16,
143    ///  `Darken` -> VIPS_BLEND_MODE_DARKEN = 17
144    Darken = 17,
145    ///  `Lighten` -> VIPS_BLEND_MODE_LIGHTEN = 18
146    Lighten = 18,
147    ///  `ColourDodge` -> VIPS_BLEND_MODE_COLOUR_DODGE = 19
148    ColourDodge = 19,
149    ///  `ColourBurn` -> VIPS_BLEND_MODE_COLOUR_BURN = 20
150    ColourBurn = 20,
151    ///  `HardLight` -> VIPS_BLEND_MODE_HARD_LIGHT = 21
152    HardLight = 21,
153    ///  `SoftLight` -> VIPS_BLEND_MODE_SOFT_LIGHT = 22
154    SoftLight = 22,
155    ///  `Difference` -> VIPS_BLEND_MODE_DIFFERENCE = 23
156    Difference = 23,
157    ///  `Exclusion` -> VIPS_BLEND_MODE_EXCLUSION = 24
158    Exclusion = 24,
159    ///  `Last` -> VIPS_BLEND_MODE_LAST = 25
160    Last = 25,
161}
162
163#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
164pub enum Coding {
165    ///  `Error` -> VIPS_CODING_ERROR = -1
166    Error = -1,
167    ///  `None` -> VIPS_CODING_NONE = 0
168    None = 0,
169    ///  `Labq` -> VIPS_CODING_LABQ = 2
170    Labq = 2,
171    ///  `Rad` -> VIPS_CODING_RAD = 6
172    Rad = 6,
173    ///  `Last` -> VIPS_CODING_LAST = 7
174    Last = 7,
175}
176
177#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
178pub enum Combine {
179    ///  `Max` -> VIPS_COMBINE_MAX = 0
180    Max = 0,
181    ///  `Sum` -> VIPS_COMBINE_SUM = 1
182    Sum = 1,
183    ///  `Min` -> VIPS_COMBINE_MIN = 2
184    Min = 2,
185    ///  `Last` -> VIPS_COMBINE_LAST = 3
186    Last = 3,
187}
188
189#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
190pub enum CombineMode {
191    ///  `Set` -> VIPS_COMBINE_MODE_SET = 0
192    Set = 0,
193    ///  `Add` -> VIPS_COMBINE_MODE_ADD = 1
194    Add = 1,
195    ///  `Last` -> VIPS_COMBINE_MODE_LAST = 2
196    Last = 2,
197}
198
199#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
200pub enum CompassDirection {
201    ///  `Centre` -> VIPS_COMPASS_DIRECTION_CENTRE = 0
202    Centre = 0,
203    ///  `North` -> VIPS_COMPASS_DIRECTION_NORTH = 1
204    North = 1,
205    ///  `East` -> VIPS_COMPASS_DIRECTION_EAST = 2
206    East = 2,
207    ///  `South` -> VIPS_COMPASS_DIRECTION_SOUTH = 3
208    South = 3,
209    ///  `West` -> VIPS_COMPASS_DIRECTION_WEST = 4
210    West = 4,
211    ///  `NorthEast` -> VIPS_COMPASS_DIRECTION_NORTH_EAST = 5
212    NorthEast = 5,
213    ///  `SouthEast` -> VIPS_COMPASS_DIRECTION_SOUTH_EAST = 6
214    SouthEast = 6,
215    ///  `SouthWest` -> VIPS_COMPASS_DIRECTION_SOUTH_WEST = 7
216    SouthWest = 7,
217    ///  `NorthWest` -> VIPS_COMPASS_DIRECTION_NORTH_WEST = 8
218    NorthWest = 8,
219    ///  `Last` -> VIPS_COMPASS_DIRECTION_LAST = 9
220    Last = 9,
221}
222
223#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
224pub enum Direction {
225    ///  `Horizontal` -> VIPS_DIRECTION_HORIZONTAL = 0
226    Horizontal = 0,
227    ///  `Vertical` -> VIPS_DIRECTION_VERTICAL = 1
228    Vertical = 1,
229    ///  `Last` -> VIPS_DIRECTION_LAST = 2
230    Last = 2,
231}
232
233#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
234pub enum Extend {
235    ///  `Black` -> VIPS_EXTEND_BLACK = 0
236    Black = 0,
237    ///  `Copy` -> VIPS_EXTEND_COPY = 1
238    Copy = 1,
239    ///  `Repeat` -> VIPS_EXTEND_REPEAT = 2
240    Repeat = 2,
241    ///  `Mirror` -> VIPS_EXTEND_MIRROR = 3
242    Mirror = 3,
243    ///  `White` -> VIPS_EXTEND_WHITE = 4
244    White = 4,
245    ///  `Background` -> VIPS_EXTEND_BACKGROUND = 5
246    Background = 5,
247    ///  `Last` -> VIPS_EXTEND_LAST = 6
248    Last = 6,
249}
250
251#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
252pub enum FailOn {
253    ///  `None` -> VIPS_FAIL_ON_NONE = 0
254    None = 0,
255    ///  `Truncated` -> VIPS_FAIL_ON_TRUNCATED = 1
256    Truncated = 1,
257    ///  `Error` -> VIPS_FAIL_ON_ERROR = 2
258    Error = 2,
259    ///  `Warning` -> VIPS_FAIL_ON_WARNING = 3
260    Warning = 3,
261    ///  `Last` -> VIPS_FAIL_ON_LAST = 4
262    Last = 4,
263}
264
265#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
266pub enum ForeignDzContainer {
267    ///  `Fs` -> VIPS_FOREIGN_DZ_CONTAINER_FS = 0
268    Fs = 0,
269    ///  `Zip` -> VIPS_FOREIGN_DZ_CONTAINER_ZIP = 1
270    Zip = 1,
271    ///  `Szi` -> VIPS_FOREIGN_DZ_CONTAINER_SZI = 2
272    Szi = 2,
273    ///  `Last` -> VIPS_FOREIGN_DZ_CONTAINER_LAST = 3
274    Last = 3,
275}
276
277#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
278pub enum ForeignDzDepth {
279    ///  `Onepixel` -> VIPS_FOREIGN_DZ_DEPTH_ONEPIXEL = 0
280    Onepixel = 0,
281    ///  `Onetile` -> VIPS_FOREIGN_DZ_DEPTH_ONETILE = 1
282    Onetile = 1,
283    ///  `One` -> VIPS_FOREIGN_DZ_DEPTH_ONE = 2
284    One = 2,
285    ///  `Last` -> VIPS_FOREIGN_DZ_DEPTH_LAST = 3
286    Last = 3,
287}
288
289#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
290pub enum ForeignDzLayout {
291    ///  `Dz` -> VIPS_FOREIGN_DZ_LAYOUT_DZ = 0
292    Dz = 0,
293    ///  `Zoomify` -> VIPS_FOREIGN_DZ_LAYOUT_ZOOMIFY = 1
294    Zoomify = 1,
295    ///  `Google` -> VIPS_FOREIGN_DZ_LAYOUT_GOOGLE = 2
296    Google = 2,
297    ///  `Iiif` -> VIPS_FOREIGN_DZ_LAYOUT_IIIF = 3
298    Iiif = 3,
299    ///  `Iiif3` -> VIPS_FOREIGN_DZ_LAYOUT_IIIF3 = 4
300    Iiif3 = 4,
301    ///  `Last` -> VIPS_FOREIGN_DZ_LAYOUT_LAST = 5
302    Last = 5,
303}
304
305#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
306pub enum ForeignFlags {
307    ///  `None` -> VIPS_FOREIGN_NONE = 0
308    None = 0,
309    ///  `Partial` -> VIPS_FOREIGN_PARTIAL = 1
310    Partial = 1,
311    ///  `Bigendian` -> VIPS_FOREIGN_BIGENDIAN = 2
312    Bigendian = 2,
313    ///  `Sequential` -> VIPS_FOREIGN_SEQUENTIAL = 4
314    Sequential = 4,
315    ///  `All` -> VIPS_FOREIGN_ALL = 7
316    All = 7,
317}
318
319#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
320pub enum ForeignHeifCompression {
321    ///  `Hevc` -> VIPS_FOREIGN_HEIF_COMPRESSION_HEVC = 1
322    Hevc = 1,
323    ///  `Avc` -> VIPS_FOREIGN_HEIF_COMPRESSION_AVC = 2
324    Avc = 2,
325    ///  `Jpeg` -> VIPS_FOREIGN_HEIF_COMPRESSION_JPEG = 3
326    Jpeg = 3,
327    ///  `Av1` -> VIPS_FOREIGN_HEIF_COMPRESSION_AV1 = 4
328    Av1 = 4,
329    ///  `Last` -> VIPS_FOREIGN_HEIF_COMPRESSION_LAST = 5
330    Last = 5,
331}
332
333#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
334pub enum ForeignHeifEncoder {
335    ///  `Auto` -> VIPS_FOREIGN_HEIF_ENCODER_AUTO = 0
336    Auto = 0,
337    ///  `Aom` -> VIPS_FOREIGN_HEIF_ENCODER_AOM = 1
338    Aom = 1,
339    ///  `Rav1E` -> VIPS_FOREIGN_HEIF_ENCODER_RAV1E = 2
340    Rav1E = 2,
341    ///  `Svt` -> VIPS_FOREIGN_HEIF_ENCODER_SVT = 3
342    Svt = 3,
343    ///  `X265` -> VIPS_FOREIGN_HEIF_ENCODER_X265 = 4
344    X265 = 4,
345    ///  `Last` -> VIPS_FOREIGN_HEIF_ENCODER_LAST = 5
346    Last = 5,
347}
348
349#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
350pub enum ForeignKeep {
351    ///  `None` -> VIPS_FOREIGN_KEEP_NONE = 0
352    None = 0,
353    ///  `Exif` -> VIPS_FOREIGN_KEEP_EXIF = 1
354    Exif = 1,
355    ///  `Xmp` -> VIPS_FOREIGN_KEEP_XMP = 2
356    Xmp = 2,
357    ///  `Iptc` -> VIPS_FOREIGN_KEEP_IPTC = 4
358    Iptc = 4,
359    ///  `Icc` -> VIPS_FOREIGN_KEEP_ICC = 8
360    Icc = 8,
361    ///  `Other` -> VIPS_FOREIGN_KEEP_OTHER = 16
362    Other = 16,
363    ///  `All` -> VIPS_FOREIGN_KEEP_ALL = 31
364    All = 31,
365}
366
367#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
368pub enum ForeignPngFilter {
369    ///  `None` -> VIPS_FOREIGN_PNG_FILTER_NONE = 8
370    None = 8,
371    ///  `Sub` -> VIPS_FOREIGN_PNG_FILTER_SUB = 16
372    Sub = 16,
373    ///  `Up` -> VIPS_FOREIGN_PNG_FILTER_UP = 32
374    Up = 32,
375    ///  `Avg` -> VIPS_FOREIGN_PNG_FILTER_AVG = 64
376    Avg = 64,
377    ///  `Paeth` -> VIPS_FOREIGN_PNG_FILTER_PAETH = 128
378    Paeth = 128,
379    ///  `All` -> VIPS_FOREIGN_PNG_FILTER_ALL = 248
380    All = 248,
381}
382
383#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
384pub enum ForeignPpmFormat {
385    ///  `Pbm` -> VIPS_FOREIGN_PPM_FORMAT_PBM = 0
386    Pbm = 0,
387    ///  `Pgm` -> VIPS_FOREIGN_PPM_FORMAT_PGM = 1
388    Pgm = 1,
389    ///  `Ppm` -> VIPS_FOREIGN_PPM_FORMAT_PPM = 2
390    Ppm = 2,
391    ///  `Pfm` -> VIPS_FOREIGN_PPM_FORMAT_PFM = 3
392    Pfm = 3,
393    ///  `Pnm` -> VIPS_FOREIGN_PPM_FORMAT_PNM = 4
394    Pnm = 4,
395    ///  `Last` -> VIPS_FOREIGN_PPM_FORMAT_LAST = 5
396    Last = 5,
397}
398
399#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
400pub enum ForeignSubsample {
401    ///  `Auto` -> VIPS_FOREIGN_SUBSAMPLE_AUTO = 0
402    Auto = 0,
403    ///  `On` -> VIPS_FOREIGN_SUBSAMPLE_ON = 1
404    On = 1,
405    ///  `Off` -> VIPS_FOREIGN_SUBSAMPLE_OFF = 2
406    Off = 2,
407    ///  `Last` -> VIPS_FOREIGN_SUBSAMPLE_LAST = 3
408    Last = 3,
409}
410
411#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
412pub enum ForeignTiffCompression {
413    ///  `None` -> VIPS_FOREIGN_TIFF_COMPRESSION_NONE = 0
414    None = 0,
415    ///  `Jpeg` -> VIPS_FOREIGN_TIFF_COMPRESSION_JPEG = 1
416    Jpeg = 1,
417    ///  `Deflate` -> VIPS_FOREIGN_TIFF_COMPRESSION_DEFLATE = 2
418    Deflate = 2,
419    ///  `Packbits` -> VIPS_FOREIGN_TIFF_COMPRESSION_PACKBITS = 3
420    Packbits = 3,
421    ///  `Ccittfax4` -> VIPS_FOREIGN_TIFF_COMPRESSION_CCITTFAX4 = 4
422    Ccittfax4 = 4,
423    ///  `Lzw` -> VIPS_FOREIGN_TIFF_COMPRESSION_LZW = 5
424    Lzw = 5,
425    ///  `Webp` -> VIPS_FOREIGN_TIFF_COMPRESSION_WEBP = 6
426    Webp = 6,
427    ///  `Zstd` -> VIPS_FOREIGN_TIFF_COMPRESSION_ZSTD = 7
428    Zstd = 7,
429    ///  `Jp2K` -> VIPS_FOREIGN_TIFF_COMPRESSION_JP2K = 8
430    Jp2K = 8,
431    ///  `Last` -> VIPS_FOREIGN_TIFF_COMPRESSION_LAST = 9
432    Last = 9,
433}
434
435#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
436pub enum ForeignTiffPredictor {
437    ///  `None` -> VIPS_FOREIGN_TIFF_PREDICTOR_NONE = 1
438    None = 1,
439    ///  `Horizontal` -> VIPS_FOREIGN_TIFF_PREDICTOR_HORIZONTAL = 2
440    Horizontal = 2,
441    ///  `Float` -> VIPS_FOREIGN_TIFF_PREDICTOR_FLOAT = 3
442    Float = 3,
443    ///  `Last` -> VIPS_FOREIGN_TIFF_PREDICTOR_LAST = 4
444    Last = 4,
445}
446
447#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
448pub enum ForeignTiffResunit {
449    ///  `Cm` -> VIPS_FOREIGN_TIFF_RESUNIT_CM = 0
450    Cm = 0,
451    ///  `Inch` -> VIPS_FOREIGN_TIFF_RESUNIT_INCH = 1
452    Inch = 1,
453    ///  `Last` -> VIPS_FOREIGN_TIFF_RESUNIT_LAST = 2
454    Last = 2,
455}
456
457#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
458pub enum ForeignWebpPreset {
459    ///  `Default` -> VIPS_FOREIGN_WEBP_PRESET_DEFAULT = 0
460    Default = 0,
461    ///  `Picture` -> VIPS_FOREIGN_WEBP_PRESET_PICTURE = 1
462    Picture = 1,
463    ///  `Photo` -> VIPS_FOREIGN_WEBP_PRESET_PHOTO = 2
464    Photo = 2,
465    ///  `Drawing` -> VIPS_FOREIGN_WEBP_PRESET_DRAWING = 3
466    Drawing = 3,
467    ///  `Icon` -> VIPS_FOREIGN_WEBP_PRESET_ICON = 4
468    Icon = 4,
469    ///  `Text` -> VIPS_FOREIGN_WEBP_PRESET_TEXT = 5
470    Text = 5,
471    ///  `Last` -> VIPS_FOREIGN_WEBP_PRESET_LAST = 6
472    Last = 6,
473}
474
475#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
476pub enum Intent {
477    ///  `Perceptual` -> VIPS_INTENT_PERCEPTUAL = 0
478    Perceptual = 0,
479    ///  `Relative` -> VIPS_INTENT_RELATIVE = 1
480    Relative = 1,
481    ///  `Saturation` -> VIPS_INTENT_SATURATION = 2
482    Saturation = 2,
483    ///  `Absolute` -> VIPS_INTENT_ABSOLUTE = 3
484    Absolute = 3,
485    ///  `Auto` -> VIPS_INTENT_AUTO = 32
486    Auto = 32,
487    ///  `Last` -> VIPS_INTENT_LAST = 33
488    Last = 33,
489}
490
491#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
492pub enum Interesting {
493    ///  `None` -> VIPS_INTERESTING_NONE = 0
494    None = 0,
495    ///  `Centre` -> VIPS_INTERESTING_CENTRE = 1
496    Centre = 1,
497    ///  `Entropy` -> VIPS_INTERESTING_ENTROPY = 2
498    Entropy = 2,
499    ///  `Attention` -> VIPS_INTERESTING_ATTENTION = 3
500    Attention = 3,
501    ///  `Low` -> VIPS_INTERESTING_LOW = 4
502    Low = 4,
503    ///  `High` -> VIPS_INTERESTING_HIGH = 5
504    High = 5,
505    ///  `All` -> VIPS_INTERESTING_ALL = 6
506    All = 6,
507    ///  `Last` -> VIPS_INTERESTING_LAST = 7
508    Last = 7,
509}
510
511#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
512pub enum Interpretation {
513    ///  `Error` -> VIPS_INTERPRETATION_ERROR = -1
514    Error = -1,
515    ///  `Multiband` -> VIPS_INTERPRETATION_MULTIBAND = 0
516    Multiband = 0,
517    ///  `BW` -> VIPS_INTERPRETATION_B_W = 1
518    BW = 1,
519    ///  `Histogram` -> VIPS_INTERPRETATION_HISTOGRAM = 10
520    Histogram = 10,
521    ///  `Xyz` -> VIPS_INTERPRETATION_XYZ = 12
522    Xyz = 12,
523    ///  `Lab` -> VIPS_INTERPRETATION_LAB = 13
524    Lab = 13,
525    ///  `Cmyk` -> VIPS_INTERPRETATION_CMYK = 15
526    Cmyk = 15,
527    ///  `Labq` -> VIPS_INTERPRETATION_LABQ = 16
528    Labq = 16,
529    ///  `Rgb` -> VIPS_INTERPRETATION_RGB = 17
530    Rgb = 17,
531    ///  `Cmc` -> VIPS_INTERPRETATION_CMC = 18
532    Cmc = 18,
533    ///  `Lch` -> VIPS_INTERPRETATION_LCH = 19
534    Lch = 19,
535    ///  `Labs` -> VIPS_INTERPRETATION_LABS = 21
536    Labs = 21,
537    ///  `Srgb` -> VIPS_INTERPRETATION_sRGB = 22
538    Srgb = 22,
539    ///  `Yxy` -> VIPS_INTERPRETATION_YXY = 23
540    Yxy = 23,
541    ///  `Fourier` -> VIPS_INTERPRETATION_FOURIER = 24
542    Fourier = 24,
543    ///  `Rgb16` -> VIPS_INTERPRETATION_RGB16 = 25
544    Rgb16 = 25,
545    ///  `Grey16` -> VIPS_INTERPRETATION_GREY16 = 26
546    Grey16 = 26,
547    ///  `Matrix` -> VIPS_INTERPRETATION_MATRIX = 27
548    Matrix = 27,
549    ///  `Scrgb` -> VIPS_INTERPRETATION_scRGB = 28
550    Scrgb = 28,
551    ///  `Hsv` -> VIPS_INTERPRETATION_HSV = 29
552    Hsv = 29,
553    ///  `Last` -> VIPS_INTERPRETATION_LAST = 30
554    Last = 30,
555}
556
557#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
558pub enum Kernel {
559    ///  `Nearest` -> VIPS_KERNEL_NEAREST = 0
560    Nearest = 0,
561    ///  `Linear` -> VIPS_KERNEL_LINEAR = 1
562    Linear = 1,
563    ///  `Cubic` -> VIPS_KERNEL_CUBIC = 2
564    Cubic = 2,
565    ///  `Mitchell` -> VIPS_KERNEL_MITCHELL = 3
566    Mitchell = 3,
567    ///  `Lanczos2` -> VIPS_KERNEL_LANCZOS2 = 4
568    Lanczos2 = 4,
569    ///  `Lanczos3` -> VIPS_KERNEL_LANCZOS3 = 5
570    Lanczos3 = 5,
571    ///  `Mks2013` -> VIPS_KERNEL_MKS2013 = 6
572    Mks2013 = 6,
573    ///  `Mks2021` -> VIPS_KERNEL_MKS2021 = 7
574    Mks2021 = 7,
575    ///  `Last` -> VIPS_KERNEL_LAST = 8
576    Last = 8,
577}
578
579#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
580pub enum OperationBoolean {
581    ///  `And` -> VIPS_OPERATION_BOOLEAN_AND = 0
582    And = 0,
583    ///  `Or` -> VIPS_OPERATION_BOOLEAN_OR = 1
584    Or = 1,
585    ///  `Eor` -> VIPS_OPERATION_BOOLEAN_EOR = 2
586    Eor = 2,
587    ///  `Lshift` -> VIPS_OPERATION_BOOLEAN_LSHIFT = 3
588    Lshift = 3,
589    ///  `Rshift` -> VIPS_OPERATION_BOOLEAN_RSHIFT = 4
590    Rshift = 4,
591    ///  `Last` -> VIPS_OPERATION_BOOLEAN_LAST = 5
592    Last = 5,
593}
594
595#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
596pub enum OperationComplex {
597    ///  `Polar` -> VIPS_OPERATION_COMPLEX_POLAR = 0
598    Polar = 0,
599    ///  `Rect` -> VIPS_OPERATION_COMPLEX_RECT = 1
600    Rect = 1,
601    ///  `Conj` -> VIPS_OPERATION_COMPLEX_CONJ = 2
602    Conj = 2,
603    ///  `Last` -> VIPS_OPERATION_COMPLEX_LAST = 3
604    Last = 3,
605}
606
607#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
608pub enum OperationComplex2 {
609    ///  `CrossPhase` -> VIPS_OPERATION_COMPLEX2_CROSS_PHASE = 0
610    CrossPhase = 0,
611    ///  `Last` -> VIPS_OPERATION_COMPLEX2_LAST = 1
612    Last = 1,
613}
614
615#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
616pub enum OperationComplexget {
617    ///  `Real` -> VIPS_OPERATION_COMPLEXGET_REAL = 0
618    Real = 0,
619    ///  `Imag` -> VIPS_OPERATION_COMPLEXGET_IMAG = 1
620    Imag = 1,
621    ///  `Last` -> VIPS_OPERATION_COMPLEXGET_LAST = 2
622    Last = 2,
623}
624
625#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
626pub enum OperationMath {
627    ///  `Sin` -> VIPS_OPERATION_MATH_SIN = 0
628    Sin = 0,
629    ///  `Cos` -> VIPS_OPERATION_MATH_COS = 1
630    Cos = 1,
631    ///  `Tan` -> VIPS_OPERATION_MATH_TAN = 2
632    Tan = 2,
633    ///  `Asin` -> VIPS_OPERATION_MATH_ASIN = 3
634    Asin = 3,
635    ///  `Acos` -> VIPS_OPERATION_MATH_ACOS = 4
636    Acos = 4,
637    ///  `Atan` -> VIPS_OPERATION_MATH_ATAN = 5
638    Atan = 5,
639    ///  `Log` -> VIPS_OPERATION_MATH_LOG = 6
640    Log = 6,
641    ///  `Log10` -> VIPS_OPERATION_MATH_LOG10 = 7
642    Log10 = 7,
643    ///  `Exp` -> VIPS_OPERATION_MATH_EXP = 8
644    Exp = 8,
645    ///  `Exp10` -> VIPS_OPERATION_MATH_EXP10 = 9
646    Exp10 = 9,
647    ///  `Sinh` -> VIPS_OPERATION_MATH_SINH = 10
648    Sinh = 10,
649    ///  `Cosh` -> VIPS_OPERATION_MATH_COSH = 11
650    Cosh = 11,
651    ///  `Tanh` -> VIPS_OPERATION_MATH_TANH = 12
652    Tanh = 12,
653    ///  `Asinh` -> VIPS_OPERATION_MATH_ASINH = 13
654    Asinh = 13,
655    ///  `Acosh` -> VIPS_OPERATION_MATH_ACOSH = 14
656    Acosh = 14,
657    ///  `Atanh` -> VIPS_OPERATION_MATH_ATANH = 15
658    Atanh = 15,
659    ///  `Last` -> VIPS_OPERATION_MATH_LAST = 16
660    Last = 16,
661}
662
663#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
664pub enum OperationMath2 {
665    ///  `Pow` -> VIPS_OPERATION_MATH2_POW = 0
666    Pow = 0,
667    ///  `Wop` -> VIPS_OPERATION_MATH2_WOP = 1
668    Wop = 1,
669    ///  `Atan2` -> VIPS_OPERATION_MATH2_ATAN2 = 2
670    Atan2 = 2,
671    ///  `Last` -> VIPS_OPERATION_MATH2_LAST = 3
672    Last = 3,
673}
674
675#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
676pub enum OperationMorphology {
677    ///  `Erode` -> VIPS_OPERATION_MORPHOLOGY_ERODE = 0
678    Erode = 0,
679    ///  `Dilate` -> VIPS_OPERATION_MORPHOLOGY_DILATE = 1
680    Dilate = 1,
681    ///  `Last` -> VIPS_OPERATION_MORPHOLOGY_LAST = 2
682    Last = 2,
683}
684
685#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
686pub enum OperationRelational {
687    ///  `Equal` -> VIPS_OPERATION_RELATIONAL_EQUAL = 0
688    Equal = 0,
689    ///  `Noteq` -> VIPS_OPERATION_RELATIONAL_NOTEQ = 1
690    Noteq = 1,
691    ///  `Less` -> VIPS_OPERATION_RELATIONAL_LESS = 2
692    Less = 2,
693    ///  `Lesseq` -> VIPS_OPERATION_RELATIONAL_LESSEQ = 3
694    Lesseq = 3,
695    ///  `More` -> VIPS_OPERATION_RELATIONAL_MORE = 4
696    More = 4,
697    ///  `Moreeq` -> VIPS_OPERATION_RELATIONAL_MOREEQ = 5
698    Moreeq = 5,
699    ///  `Last` -> VIPS_OPERATION_RELATIONAL_LAST = 6
700    Last = 6,
701}
702
703#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
704pub enum OperationRound {
705    ///  `Rint` -> VIPS_OPERATION_ROUND_RINT = 0
706    Rint = 0,
707    ///  `Ceil` -> VIPS_OPERATION_ROUND_CEIL = 1
708    Ceil = 1,
709    ///  `Floor` -> VIPS_OPERATION_ROUND_FLOOR = 2
710    Floor = 2,
711    ///  `Last` -> VIPS_OPERATION_ROUND_LAST = 3
712    Last = 3,
713}
714
715#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
716pub enum PCS {
717    ///  `Lab` -> VIPS_PCS_LAB = 0
718    Lab = 0,
719    ///  `Xyz` -> VIPS_PCS_XYZ = 1
720    Xyz = 1,
721    ///  `Last` -> VIPS_PCS_LAST = 2
722    Last = 2,
723}
724
725#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
726pub enum Precision {
727    ///  `Integer` -> VIPS_PRECISION_INTEGER = 0
728    Integer = 0,
729    ///  `Float` -> VIPS_PRECISION_FLOAT = 1
730    Float = 1,
731    ///  `Approximate` -> VIPS_PRECISION_APPROXIMATE = 2
732    Approximate = 2,
733    ///  `Last` -> VIPS_PRECISION_LAST = 3
734    Last = 3,
735}
736
737#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
738pub enum RegionShrink {
739    ///  `Mean` -> VIPS_REGION_SHRINK_MEAN = 0
740    Mean = 0,
741    ///  `Median` -> VIPS_REGION_SHRINK_MEDIAN = 1
742    Median = 1,
743    ///  `Mode` -> VIPS_REGION_SHRINK_MODE = 2
744    Mode = 2,
745    ///  `Max` -> VIPS_REGION_SHRINK_MAX = 3
746    Max = 3,
747    ///  `Min` -> VIPS_REGION_SHRINK_MIN = 4
748    Min = 4,
749    ///  `Nearest` -> VIPS_REGION_SHRINK_NEAREST = 5
750    Nearest = 5,
751    ///  `Last` -> VIPS_REGION_SHRINK_LAST = 6
752    Last = 6,
753}
754
755#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
756pub enum SdfShape {
757    ///  `Circle` -> VIPS_SDF_SHAPE_CIRCLE = 0
758    Circle = 0,
759    ///  `Box` -> VIPS_SDF_SHAPE_BOX = 1
760    Box = 1,
761    ///  `RoundedBox` -> VIPS_SDF_SHAPE_ROUNDED_BOX = 2
762    RoundedBox = 2,
763    ///  `Line` -> VIPS_SDF_SHAPE_LINE = 3
764    Line = 3,
765    ///  `Last` -> VIPS_SDF_SHAPE_LAST = 4
766    Last = 4,
767}
768
769#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
770pub enum Size {
771    ///  `Both` -> VIPS_SIZE_BOTH = 0
772    Both = 0,
773    ///  `Up` -> VIPS_SIZE_UP = 1
774    Up = 1,
775    ///  `Down` -> VIPS_SIZE_DOWN = 2
776    Down = 2,
777    ///  `Force` -> VIPS_SIZE_FORCE = 3
778    Force = 3,
779    ///  `Last` -> VIPS_SIZE_LAST = 4
780    Last = 4,
781}
782
783#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
784pub enum TextWrap {
785    ///  `Word` -> VIPS_TEXT_WRAP_WORD = 0
786    Word = 0,
787    ///  `Char` -> VIPS_TEXT_WRAP_CHAR = 1
788    Char = 1,
789    ///  `WordChar` -> VIPS_TEXT_WRAP_WORD_CHAR = 2
790    WordChar = 2,
791    ///  `None` -> VIPS_TEXT_WRAP_NONE = 3
792    None = 3,
793    ///  `Last` -> VIPS_TEXT_WRAP_LAST = 4
794    Last = 4,
795}
796
797impl VipsImage {
798    /// VipsCMC2LCh (CMC2LCh), transform LCh to CMC
799    /// returns `VipsImage` - Output image
800    pub fn CMC2LCh(&self) -> Result<VipsImage> {
801        let mut out_out = VipsImage::from(null_mut());
802        let vips_op_response = call(
803            "CMC2LCh",
804            VOption::new()
805                .set("in", self)
806                .set(
807                    "out",
808                    &mut out_out,
809                ),
810        );
811
812        utils::result(
813            vips_op_response,
814            out_out,
815            Error::OperationError("Cmc2LCh (vips_CMC2LCh) failed".to_string()),
816        )
817    }
818
819    /// VipsCMYK2XYZ (CMYK2XYZ), transform CMYK to XYZ
820    /// returns `VipsImage` - Output image
821    pub fn CMYK2XYZ(&self) -> Result<VipsImage> {
822        let mut out_out = VipsImage::from(null_mut());
823        let vips_op_response = call(
824            "CMYK2XYZ",
825            VOption::new()
826                .set("in", self)
827                .set(
828                    "out",
829                    &mut out_out,
830                ),
831        );
832
833        utils::result(
834            vips_op_response,
835            out_out,
836            Error::OperationError("Cmyk2Xyz (vips_CMYK2XYZ) failed".to_string()),
837        )
838    }
839
840    /// VipsHSV2sRGB (HSV2sRGB), transform HSV to sRGB
841    /// returns `VipsImage` - Output image
842    pub fn HSV2sRGB(&self) -> Result<VipsImage> {
843        let mut out_out = VipsImage::from(null_mut());
844        let vips_op_response = call(
845            "HSV2sRGB",
846            VOption::new()
847                .set("in", self)
848                .set(
849                    "out",
850                    &mut out_out,
851                ),
852        );
853
854        utils::result(
855            vips_op_response,
856            out_out,
857            Error::OperationError("Hsv2SRgb (vips_HSV2sRGB) failed".to_string()),
858        )
859    }
860
861    /// VipsLCh2CMC (LCh2CMC), transform LCh to CMC
862    /// returns `VipsImage` - Output image
863    pub fn LCh2CMC(&self) -> Result<VipsImage> {
864        let mut out_out = VipsImage::from(null_mut());
865        let vips_op_response = call(
866            "LCh2CMC",
867            VOption::new()
868                .set("in", self)
869                .set(
870                    "out",
871                    &mut out_out,
872                ),
873        );
874
875        utils::result(
876            vips_op_response,
877            out_out,
878            Error::OperationError("LCh2Cmc (vips_LCh2CMC) failed".to_string()),
879        )
880    }
881
882    /// VipsLCh2Lab (LCh2Lab), transform LCh to Lab
883    /// returns `VipsImage` - Output image
884    pub fn LCh2Lab(&self) -> Result<VipsImage> {
885        let mut out_out = VipsImage::from(null_mut());
886        let vips_op_response = call(
887            "LCh2Lab",
888            VOption::new()
889                .set("in", self)
890                .set(
891                    "out",
892                    &mut out_out,
893                ),
894        );
895
896        utils::result(
897            vips_op_response,
898            out_out,
899            Error::OperationError("LCh2Lab (vips_LCh2Lab) failed".to_string()),
900        )
901    }
902
903    /// VipsLab2LCh (Lab2LCh), transform Lab to LCh
904    /// returns `VipsImage` - Output image
905    pub fn Lab2LCh(&self) -> Result<VipsImage> {
906        let mut out_out = VipsImage::from(null_mut());
907        let vips_op_response = call(
908            "Lab2LCh",
909            VOption::new()
910                .set("in", self)
911                .set(
912                    "out",
913                    &mut out_out,
914                ),
915        );
916
917        utils::result(
918            vips_op_response,
919            out_out,
920            Error::OperationError("Lab2LCh (vips_Lab2LCh) failed".to_string()),
921        )
922    }
923
924    /// VipsLab2LabQ (Lab2LabQ), transform float Lab to LabQ coding
925    /// returns `VipsImage` - Output image
926    pub fn Lab2LabQ(&self) -> Result<VipsImage> {
927        let mut out_out = VipsImage::from(null_mut());
928        let vips_op_response = call(
929            "Lab2LabQ",
930            VOption::new()
931                .set("in", self)
932                .set(
933                    "out",
934                    &mut out_out,
935                ),
936        );
937
938        utils::result(
939            vips_op_response,
940            out_out,
941            Error::OperationError("Lab2LabQ (vips_Lab2LabQ) failed".to_string()),
942        )
943    }
944
945    /// VipsLab2LabS (Lab2LabS), transform float Lab to signed short
946    /// returns `VipsImage` - Output image
947    pub fn Lab2LabS(&self) -> Result<VipsImage> {
948        let mut out_out = VipsImage::from(null_mut());
949        let vips_op_response = call(
950            "Lab2LabS",
951            VOption::new()
952                .set("in", self)
953                .set(
954                    "out",
955                    &mut out_out,
956                ),
957        );
958
959        utils::result(
960            vips_op_response,
961            out_out,
962            Error::OperationError("Lab2LabSs (vips_Lab2LabS) failed".to_string()),
963        )
964    }
965
966    /// VipsLab2XYZ (Lab2XYZ), transform CIELAB to XYZ
967    /// returns `VipsImage` - Output image
968    pub fn Lab2XYZ(&self) -> Result<VipsImage> {
969        let mut out_out = VipsImage::from(null_mut());
970        let vips_op_response = call(
971            "Lab2XYZ",
972            VOption::new()
973                .set("in", self)
974                .set(
975                    "out",
976                    &mut out_out,
977                ),
978        );
979
980        utils::result(
981            vips_op_response,
982            out_out,
983            Error::OperationError("Lab2Xyz (vips_Lab2XYZ) failed".to_string()),
984        )
985    }
986
987    /// VipsLab2XYZ (Lab2XYZ), transform CIELAB to XYZ
988    /// returns `VipsImage` - Output image
989    ///
990    /// <ins>Optional arguments</ins>
991    ///
992    /// temp: `&[f64]` -> Color temperature
993    pub fn Lab2XYZ_with_opts(&self, option: VOption) -> Result<VipsImage> {
994        let mut out_out = VipsImage::from(null_mut());
995        let vips_op_response = call(
996            "Lab2XYZ",
997            option
998                .set("in", self)
999                .set(
1000                    "out",
1001                    &mut out_out,
1002                ),
1003        );
1004
1005        utils::result(
1006            vips_op_response,
1007            out_out,
1008            Error::OperationError("Lab2Xyz (vips_Lab2XYZ) failed".to_string()),
1009        )
1010    }
1011
1012    /// VipsLabQ2Lab (LabQ2Lab), unpack a LabQ image to float Lab
1013    /// returns `VipsImage` - Output image
1014    pub fn LabQ2Lab(&self) -> Result<VipsImage> {
1015        let mut out_out = VipsImage::from(null_mut());
1016        let vips_op_response = call(
1017            "LabQ2Lab",
1018            VOption::new()
1019                .set("in", self)
1020                .set(
1021                    "out",
1022                    &mut out_out,
1023                ),
1024        );
1025
1026        utils::result(
1027            vips_op_response,
1028            out_out,
1029            Error::OperationError("LabQ2Lab (vips_LabQ2Lab) failed".to_string()),
1030        )
1031    }
1032
1033    /// VipsLabQ2LabS (LabQ2LabS), unpack a LabQ image to short Lab
1034    /// returns `VipsImage` - Output image
1035    pub fn LabQ2LabS(&self) -> Result<VipsImage> {
1036        let mut out_out = VipsImage::from(null_mut());
1037        let vips_op_response = call(
1038            "LabQ2LabS",
1039            VOption::new()
1040                .set("in", self)
1041                .set(
1042                    "out",
1043                    &mut out_out,
1044                ),
1045        );
1046
1047        utils::result(
1048            vips_op_response,
1049            out_out,
1050            Error::OperationError("LabQ2LabSs (vips_LabQ2LabS) failed".to_string()),
1051        )
1052    }
1053
1054    /// VipsLabQ2sRGB (LabQ2sRGB), convert a LabQ image to sRGB
1055    /// returns `VipsImage` - Output image
1056    pub fn LabQ2sRGB(&self) -> Result<VipsImage> {
1057        let mut out_out = VipsImage::from(null_mut());
1058        let vips_op_response = call(
1059            "LabQ2sRGB",
1060            VOption::new()
1061                .set("in", self)
1062                .set(
1063                    "out",
1064                    &mut out_out,
1065                ),
1066        );
1067
1068        utils::result(
1069            vips_op_response,
1070            out_out,
1071            Error::OperationError("LabQ2SRgb (vips_LabQ2sRGB) failed".to_string()),
1072        )
1073    }
1074
1075    /// VipsLabS2Lab (LabS2Lab), transform signed short Lab to float
1076    /// returns `VipsImage` - Output image
1077    pub fn LabS2Lab(&self) -> Result<VipsImage> {
1078        let mut out_out = VipsImage::from(null_mut());
1079        let vips_op_response = call(
1080            "LabS2Lab",
1081            VOption::new()
1082                .set("in", self)
1083                .set(
1084                    "out",
1085                    &mut out_out,
1086                ),
1087        );
1088
1089        utils::result(
1090            vips_op_response,
1091            out_out,
1092            Error::OperationError("LabS2Lab (vips_LabS2Lab) failed".to_string()),
1093        )
1094    }
1095
1096    /// VipsLabS2LabQ (LabS2LabQ), transform short Lab to LabQ coding
1097    /// returns `VipsImage` - Output image
1098    pub fn LabS2LabQ(&self) -> Result<VipsImage> {
1099        let mut out_out = VipsImage::from(null_mut());
1100        let vips_op_response = call(
1101            "LabS2LabQ",
1102            VOption::new()
1103                .set("in", self)
1104                .set(
1105                    "out",
1106                    &mut out_out,
1107                ),
1108        );
1109
1110        utils::result(
1111            vips_op_response,
1112            out_out,
1113            Error::OperationError("LabS2LabQ (vips_LabS2LabQ) failed".to_string()),
1114        )
1115    }
1116
1117    /// VipsXYZ2CMYK (XYZ2CMYK), transform XYZ to CMYK
1118    /// returns `VipsImage` - Output image
1119    pub fn XYZ2CMYK(&self) -> Result<VipsImage> {
1120        let mut out_out = VipsImage::from(null_mut());
1121        let vips_op_response = call(
1122            "XYZ2CMYK",
1123            VOption::new()
1124                .set("in", self)
1125                .set(
1126                    "out",
1127                    &mut out_out,
1128                ),
1129        );
1130
1131        utils::result(
1132            vips_op_response,
1133            out_out,
1134            Error::OperationError("Xyz2Cmyk (vips_XYZ2CMYK) failed".to_string()),
1135        )
1136    }
1137
1138    /// VipsXYZ2Lab (XYZ2Lab), transform XYZ to Lab
1139    /// returns `VipsImage` - Output image
1140    pub fn XYZ2Lab(&self) -> Result<VipsImage> {
1141        let mut out_out = VipsImage::from(null_mut());
1142        let vips_op_response = call(
1143            "XYZ2Lab",
1144            VOption::new()
1145                .set("in", self)
1146                .set(
1147                    "out",
1148                    &mut out_out,
1149                ),
1150        );
1151
1152        utils::result(
1153            vips_op_response,
1154            out_out,
1155            Error::OperationError("Xyz2Lab (vips_XYZ2Lab) failed".to_string()),
1156        )
1157    }
1158
1159    /// VipsXYZ2Lab (XYZ2Lab), transform XYZ to Lab
1160    /// returns `VipsImage` - Output image
1161    ///
1162    /// <ins>Optional arguments</ins>
1163    ///
1164    /// temp: `&[f64]` -> Colour temperature
1165    pub fn XYZ2Lab_with_opts(&self, option: VOption) -> Result<VipsImage> {
1166        let mut out_out = VipsImage::from(null_mut());
1167        let vips_op_response = call(
1168            "XYZ2Lab",
1169            option
1170                .set("in", self)
1171                .set(
1172                    "out",
1173                    &mut out_out,
1174                ),
1175        );
1176
1177        utils::result(
1178            vips_op_response,
1179            out_out,
1180            Error::OperationError("Xyz2Lab (vips_XYZ2Lab) failed".to_string()),
1181        )
1182    }
1183
1184    /// VipsXYZ2Yxy (XYZ2Yxy), transform XYZ to Yxy
1185    /// returns `VipsImage` - Output image
1186    pub fn XYZ2Yxy(&self) -> Result<VipsImage> {
1187        let mut out_out = VipsImage::from(null_mut());
1188        let vips_op_response = call(
1189            "XYZ2Yxy",
1190            VOption::new()
1191                .set("in", self)
1192                .set(
1193                    "out",
1194                    &mut out_out,
1195                ),
1196        );
1197
1198        utils::result(
1199            vips_op_response,
1200            out_out,
1201            Error::OperationError("Xyz2Yxy (vips_XYZ2Yxy) failed".to_string()),
1202        )
1203    }
1204
1205    /// VipsXYZ2scRGB (XYZ2scRGB), transform XYZ to scRGB
1206    /// returns `VipsImage` - Output image
1207    pub fn XYZ2scRGB(&self) -> Result<VipsImage> {
1208        let mut out_out = VipsImage::from(null_mut());
1209        let vips_op_response = call(
1210            "XYZ2scRGB",
1211            VOption::new()
1212                .set("in", self)
1213                .set(
1214                    "out",
1215                    &mut out_out,
1216                ),
1217        );
1218
1219        utils::result(
1220            vips_op_response,
1221            out_out,
1222            Error::OperationError("Xyz2ScRgb (vips_XYZ2scRGB) failed".to_string()),
1223        )
1224    }
1225
1226    /// VipsYxy2XYZ (Yxy2XYZ), transform Yxy to XYZ
1227    /// returns `VipsImage` - Output image
1228    pub fn Yxy2XYZ(&self) -> Result<VipsImage> {
1229        let mut out_out = VipsImage::from(null_mut());
1230        let vips_op_response = call(
1231            "Yxy2XYZ",
1232            VOption::new()
1233                .set("in", self)
1234                .set(
1235                    "out",
1236                    &mut out_out,
1237                ),
1238        );
1239
1240        utils::result(
1241            vips_op_response,
1242            out_out,
1243            Error::OperationError("Yxy2Xyz (vips_Yxy2XYZ) failed".to_string()),
1244        )
1245    }
1246
1247    /// VipsAbs (abs), absolute value of an image
1248    /// returns `VipsImage` - Output image
1249    pub fn abs(&self) -> Result<VipsImage> {
1250        let mut out_out = VipsImage::from(null_mut());
1251        let vips_op_response = call(
1252            "abs",
1253            VOption::new()
1254                .set("in", self)
1255                .set(
1256                    "out",
1257                    &mut out_out,
1258                ),
1259        );
1260
1261        utils::result(
1262            vips_op_response,
1263            out_out,
1264            Error::OperationError("Abs (vips_abs) failed".to_string()),
1265        )
1266    }
1267
1268    /// VipsAdd (add), add two images
1269    /// returns `VipsImage` - Output image
1270    ///
1271    /// right: `&VipsImage` -> Right-hand image argument
1272    pub fn add(&self, right: &VipsImage) -> Result<VipsImage> {
1273        let mut out_out = VipsImage::from(null_mut());
1274        let vips_op_response = call(
1275            "add",
1276            VOption::new()
1277                .set(
1278                    "left",
1279                    self,
1280                )
1281                .set(
1282                    "right",
1283                    right,
1284                )
1285                .set(
1286                    "out",
1287                    &mut out_out,
1288                ),
1289        );
1290
1291        utils::result(
1292            vips_op_response,
1293            out_out,
1294            Error::OperationError("Add (vips_add) failed".to_string()),
1295        )
1296    }
1297
1298    /// VipsAddAlpha (addalpha), append an alpha channel
1299    /// returns `VipsImage` - Output image
1300    pub fn addalpha(&self) -> Result<VipsImage> {
1301        let mut out_out = VipsImage::from(null_mut());
1302        let vips_op_response = call(
1303            "addalpha",
1304            VOption::new()
1305                .set("in", self)
1306                .set(
1307                    "out",
1308                    &mut out_out,
1309                ),
1310        );
1311
1312        utils::result(
1313            vips_op_response,
1314            out_out,
1315            Error::OperationError("Addalpha (vips_addalpha) failed".to_string()),
1316        )
1317    }
1318
1319    /// VipsAffine (affine), affine transform of an image
1320    /// returns `VipsImage` - Output image
1321    ///
1322    /// matrix: `&[f64]` -> Transformation matrix
1323    pub fn affine(&self, matrix: &[f64]) -> Result<VipsImage> {
1324        let mut out_out = VipsImage::from(null_mut());
1325        let vips_op_response = call(
1326            "affine",
1327            VOption::new()
1328                .set("in", self)
1329                .set(
1330                    "out",
1331                    &mut out_out,
1332                )
1333                .set(
1334                    "matrix",
1335                    matrix,
1336                ),
1337        );
1338
1339        utils::result(
1340            vips_op_response,
1341            out_out,
1342            Error::OperationError("Affine (vips_affine) failed".to_string()),
1343        )
1344    }
1345
1346    /// VipsAffine (affine), affine transform of an image
1347    /// returns `VipsImage` - Output image
1348    ///
1349    /// matrix: `&[f64]` -> Transformation matrix
1350    ///
1351    /// <ins>Optional arguments</ins>
1352    ///
1353    /// interpolate: `&VipsInterpolate` -> Interpolate pixels with this
1354    ///
1355    /// oarea: `&[i32]` -> Area of output to generate
1356    ///
1357    /// odx: `f64` -> Horizontal output displacement
1358    ///
1359    /// ody: `f64` -> Vertical output displacement
1360    ///
1361    /// idx: `f64` -> Horizontal input displacement
1362    ///
1363    /// idy: `f64` -> Vertical input displacement
1364    ///
1365    /// background: `&[f64]` -> Background value
1366    ///
1367    /// premultiplied: `bool` -> Images have premultiplied alpha
1368    ///
1369    /// extend: [`Extend`] -> How to generate the extra pixels
1370    pub fn affine_with_opts(&self, matrix: &[f64], option: VOption) -> Result<VipsImage> {
1371        let mut out_out = VipsImage::from(null_mut());
1372        let vips_op_response = call(
1373            "affine",
1374            option
1375                .set("in", self)
1376                .set(
1377                    "out",
1378                    &mut out_out,
1379                )
1380                .set(
1381                    "matrix",
1382                    matrix,
1383                ),
1384        );
1385
1386        utils::result(
1387            vips_op_response,
1388            out_out,
1389            Error::OperationError("Affine (vips_affine) failed".to_string()),
1390        )
1391    }
1392
1393    /// VipsForeignLoadAnalyze (analyzeload), load an Analyze6 image (.img, .hdr), priority=-50, untrusted, is_a, get_flags, get_flags_filename, header, load
1394    /// returns `VipsImage` - Output image
1395    ///
1396    /// filename: `&str` -> Filename to load from
1397    pub fn analyzeload(filename: &str) -> Result<VipsImage> {
1398        let mut out_out = VipsImage::from(null_mut());
1399        let vips_op_response = call(
1400            "analyzeload",
1401            VOption::new()
1402                .set(
1403                    "filename",
1404                    filename,
1405                )
1406                .set(
1407                    "out",
1408                    &mut out_out,
1409                ),
1410        );
1411
1412        utils::result(
1413            vips_op_response,
1414            out_out,
1415            Error::OperationError("Analyzeload (vips_analyzeload) failed".to_string()),
1416        )
1417    }
1418
1419    /// VipsForeignLoadAnalyze (analyzeload), load an Analyze6 image (.img, .hdr), priority=-50, untrusted, is_a, get_flags, get_flags_filename, header, load
1420    /// returns `VipsImage` - Output image
1421    ///
1422    /// filename: `&str` -> Filename to load from
1423    ///
1424    /// <ins>Optional arguments</ins>
1425    ///
1426    /// flags: [`ForeignFlags`] -> Flags for this file
1427    ///
1428    /// memory: `bool` -> Force open via memory
1429    ///
1430    /// access: [`Access`] -> Required access pattern for this file
1431    ///
1432    /// fail_on: [`FailOn`] -> Error level to fail on
1433    ///
1434    /// revalidate: `bool` -> Don't use a cached result for this operation
1435    pub fn analyzeload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
1436        let mut out_out = VipsImage::from(null_mut());
1437        let vips_op_response = call(
1438            "analyzeload",
1439            option
1440                .set(
1441                    "filename",
1442                    filename,
1443                )
1444                .set(
1445                    "out",
1446                    &mut out_out,
1447                ),
1448        );
1449
1450        utils::result(
1451            vips_op_response,
1452            out_out,
1453            Error::OperationError("Analyzeload (vips_analyzeload) failed".to_string()),
1454        )
1455    }
1456
1457    /// VipsArrayjoin (arrayjoin), join an array of images
1458    /// returns `VipsImage` - Output image
1459    ///
1460    /// inp: `&[VipsImage]` -> Array of input images
1461    pub fn arrayjoin(inp: &[VipsImage]) -> Result<VipsImage> {
1462        let mut out_out = VipsImage::from(null_mut());
1463        let vips_op_response = call(
1464            "arrayjoin",
1465            VOption::new()
1466                .set("in", inp)
1467                .set(
1468                    "out",
1469                    &mut out_out,
1470                ),
1471        );
1472
1473        utils::result(
1474            vips_op_response,
1475            out_out,
1476            Error::OperationError("Arrayjoin (vips_arrayjoin) failed".to_string()),
1477        )
1478    }
1479
1480    /// VipsArrayjoin (arrayjoin), join an array of images
1481    /// returns `VipsImage` - Output image
1482    ///
1483    /// inp: `&[VipsImage]` -> Array of input images
1484    ///
1485    /// <ins>Optional arguments</ins>
1486    ///
1487    /// across: `i32` -> Number of images across grid
1488    ///
1489    /// shim: `i32` -> Pixels between images
1490    ///
1491    /// background: `&[f64]` -> Colour for new pixels
1492    ///
1493    /// halign: [`Align`] -> Align on the left, centre or right
1494    ///
1495    /// valign: [`Align`] -> Align on the top, centre or bottom
1496    ///
1497    /// hspacing: `i32` -> Horizontal spacing between images
1498    ///
1499    /// vspacing: `i32` -> Vertical spacing between images
1500    pub fn arrayjoin_with_opts(inp: &[VipsImage], option: VOption) -> Result<VipsImage> {
1501        let mut out_out = VipsImage::from(null_mut());
1502        let vips_op_response = call(
1503            "arrayjoin",
1504            option
1505                .set("in", inp)
1506                .set(
1507                    "out",
1508                    &mut out_out,
1509                ),
1510        );
1511
1512        utils::result(
1513            vips_op_response,
1514            out_out,
1515            Error::OperationError("Arrayjoin (vips_arrayjoin) failed".to_string()),
1516        )
1517    }
1518
1519    /// VipsAutorot (autorot), autorotate image by exif tag
1520    /// returns `VipsImage` - Output image
1521    pub fn autorot(&self) -> Result<VipsImage> {
1522        let mut out_out = VipsImage::from(null_mut());
1523        let vips_op_response = call(
1524            "autorot",
1525            VOption::new()
1526                .set("in", self)
1527                .set(
1528                    "out",
1529                    &mut out_out,
1530                ),
1531        );
1532
1533        utils::result(
1534            vips_op_response,
1535            out_out,
1536            Error::OperationError("Autorot (vips_autorot) failed".to_string()),
1537        )
1538    }
1539
1540    /// VipsAutorot (autorot), autorotate image by exif tag
1541    /// returns `VipsImage` - Output image
1542    ///
1543    /// <ins>Optional arguments</ins>
1544    ///
1545    /// angle: [`Angle`] -> Angle image was rotated by
1546    ///
1547    /// flip: `&mut bool` -> Whether the image was flipped or not
1548    pub fn autorot_with_opts(&self, option: VOption) -> Result<VipsImage> {
1549        let mut out_out = VipsImage::from(null_mut());
1550        let vips_op_response = call(
1551            "autorot",
1552            option
1553                .set("in", self)
1554                .set(
1555                    "out",
1556                    &mut out_out,
1557                ),
1558        );
1559
1560        utils::result(
1561            vips_op_response,
1562            out_out,
1563            Error::OperationError("Autorot (vips_autorot) failed".to_string()),
1564        )
1565    }
1566
1567    /// VipsAvg (avg), find image average
1568    /// returns `f64` - Output value
1569    pub fn avg(&self) -> Result<f64> {
1570        let mut out_out: f64 = 0.0;
1571        let vips_op_response = call(
1572            "avg",
1573            VOption::new()
1574                .set("in", self)
1575                .set(
1576                    "out",
1577                    &mut out_out,
1578                ),
1579        );
1580
1581        utils::result(
1582            vips_op_response,
1583            out_out,
1584            Error::OperationError("Avg (vips_avg) failed".to_string()),
1585        )
1586    }
1587
1588    /// VipsBandbool (bandbool), boolean operation across image bands
1589    /// returns `VipsImage` - Output image
1590    ///
1591    /// boolean: `OperationBoolean` -> Boolean to perform
1592    pub fn bandbool(&self, boolean: OperationBoolean) -> Result<VipsImage> {
1593        let mut out_out = VipsImage::from(null_mut());
1594        let vips_op_response = call(
1595            "bandbool",
1596            VOption::new()
1597                .set("in", self)
1598                .set(
1599                    "out",
1600                    &mut out_out,
1601                )
1602                .set(
1603                    "boolean",
1604                    boolean as i32,
1605                ),
1606        );
1607
1608        utils::result(
1609            vips_op_response,
1610            out_out,
1611            Error::OperationError("Bandbool (vips_bandbool) failed".to_string()),
1612        )
1613    }
1614
1615    /// VipsBandfold (bandfold), fold up x axis into bands
1616    /// returns `VipsImage` - Output image
1617    pub fn bandfold(&self) -> Result<VipsImage> {
1618        let mut out_out = VipsImage::from(null_mut());
1619        let vips_op_response = call(
1620            "bandfold",
1621            VOption::new()
1622                .set("in", self)
1623                .set(
1624                    "out",
1625                    &mut out_out,
1626                ),
1627        );
1628
1629        utils::result(
1630            vips_op_response,
1631            out_out,
1632            Error::OperationError("Bandfold (vips_bandfold) failed".to_string()),
1633        )
1634    }
1635
1636    /// VipsBandfold (bandfold), fold up x axis into bands
1637    /// returns `VipsImage` - Output image
1638    ///
1639    /// <ins>Optional arguments</ins>
1640    ///
1641    /// factor: `i32` -> Fold by this factor
1642    pub fn bandfold_with_opts(&self, option: VOption) -> Result<VipsImage> {
1643        let mut out_out = VipsImage::from(null_mut());
1644        let vips_op_response = call(
1645            "bandfold",
1646            option
1647                .set("in", self)
1648                .set(
1649                    "out",
1650                    &mut out_out,
1651                ),
1652        );
1653
1654        utils::result(
1655            vips_op_response,
1656            out_out,
1657            Error::OperationError("Bandfold (vips_bandfold) failed".to_string()),
1658        )
1659    }
1660
1661    /// VipsBandjoin (bandjoin), bandwise join a set of images
1662    /// returns `VipsImage` - Output image
1663    ///
1664    /// inp: `&[VipsImage]` -> Array of input images
1665    pub fn bandjoin(inp: &[VipsImage]) -> Result<VipsImage> {
1666        let mut out_out = VipsImage::from(null_mut());
1667        let vips_op_response = call(
1668            "bandjoin",
1669            VOption::new()
1670                .set("in", inp)
1671                .set(
1672                    "out",
1673                    &mut out_out,
1674                ),
1675        );
1676
1677        utils::result(
1678            vips_op_response,
1679            out_out,
1680            Error::OperationError("Bandjoin (vips_bandjoin) failed".to_string()),
1681        )
1682    }
1683
1684    /// VipsBandjoinConst (bandjoin_const), append a constant band to an image
1685    /// returns `VipsImage` - Output image
1686    ///
1687    /// c: `&[f64]` -> Array of constants to add
1688    pub fn bandjoin_const(&self, c: &[f64]) -> Result<VipsImage> {
1689        let mut out_out = VipsImage::from(null_mut());
1690        let vips_op_response = call(
1691            "bandjoin_const",
1692            VOption::new()
1693                .set("in", self)
1694                .set(
1695                    "out",
1696                    &mut out_out,
1697                )
1698                .set("c", c),
1699        );
1700
1701        utils::result(
1702            vips_op_response,
1703            out_out,
1704            Error::OperationError("BandjoinConst (vips_bandjoin_const) failed".to_string()),
1705        )
1706    }
1707
1708    /// VipsBandmean (bandmean), band-wise average
1709    /// returns `VipsImage` - Output image
1710    pub fn bandmean(&self) -> Result<VipsImage> {
1711        let mut out_out = VipsImage::from(null_mut());
1712        let vips_op_response = call(
1713            "bandmean",
1714            VOption::new()
1715                .set("in", self)
1716                .set(
1717                    "out",
1718                    &mut out_out,
1719                ),
1720        );
1721
1722        utils::result(
1723            vips_op_response,
1724            out_out,
1725            Error::OperationError("Bandmean (vips_bandmean) failed".to_string()),
1726        )
1727    }
1728
1729    /// VipsBandrank (bandrank), band-wise rank of a set of images
1730    /// returns `VipsImage` - Output image
1731    ///
1732    /// inp: `&[VipsImage]` -> Array of input images
1733    pub fn bandrank(inp: &[VipsImage]) -> Result<VipsImage> {
1734        let mut out_out = VipsImage::from(null_mut());
1735        let vips_op_response = call(
1736            "bandrank",
1737            VOption::new()
1738                .set("in", inp)
1739                .set(
1740                    "out",
1741                    &mut out_out,
1742                ),
1743        );
1744
1745        utils::result(
1746            vips_op_response,
1747            out_out,
1748            Error::OperationError("Bandrank (vips_bandrank) failed".to_string()),
1749        )
1750    }
1751
1752    /// VipsBandrank (bandrank), band-wise rank of a set of images
1753    /// returns `VipsImage` - Output image
1754    ///
1755    /// inp: `&[VipsImage]` -> Array of input images
1756    ///
1757    /// <ins>Optional arguments</ins>
1758    ///
1759    /// index: `i32` -> Select this band element from sorted list
1760    pub fn bandrank_with_opts(inp: &[VipsImage], option: VOption) -> Result<VipsImage> {
1761        let mut out_out = VipsImage::from(null_mut());
1762        let vips_op_response = call(
1763            "bandrank",
1764            option
1765                .set("in", inp)
1766                .set(
1767                    "out",
1768                    &mut out_out,
1769                ),
1770        );
1771
1772        utils::result(
1773            vips_op_response,
1774            out_out,
1775            Error::OperationError("Bandrank (vips_bandrank) failed".to_string()),
1776        )
1777    }
1778
1779    /// VipsBandunfold (bandunfold), unfold image bands into x axis
1780    /// returns `VipsImage` - Output image
1781    pub fn bandunfold(&self) -> Result<VipsImage> {
1782        let mut out_out = VipsImage::from(null_mut());
1783        let vips_op_response = call(
1784            "bandunfold",
1785            VOption::new()
1786                .set("in", self)
1787                .set(
1788                    "out",
1789                    &mut out_out,
1790                ),
1791        );
1792
1793        utils::result(
1794            vips_op_response,
1795            out_out,
1796            Error::OperationError("Bandunfold (vips_bandunfold) failed".to_string()),
1797        )
1798    }
1799
1800    /// VipsBandunfold (bandunfold), unfold image bands into x axis
1801    /// returns `VipsImage` - Output image
1802    ///
1803    /// <ins>Optional arguments</ins>
1804    ///
1805    /// factor: `i32` -> Unfold by this factor
1806    pub fn bandunfold_with_opts(&self, option: VOption) -> Result<VipsImage> {
1807        let mut out_out = VipsImage::from(null_mut());
1808        let vips_op_response = call(
1809            "bandunfold",
1810            option
1811                .set("in", self)
1812                .set(
1813                    "out",
1814                    &mut out_out,
1815                ),
1816        );
1817
1818        utils::result(
1819            vips_op_response,
1820            out_out,
1821            Error::OperationError("Bandunfold (vips_bandunfold) failed".to_string()),
1822        )
1823    }
1824
1825    /// VipsBlack (black), make a black image
1826    /// returns `VipsImage` - Output image
1827    ///
1828    /// width: `i32` -> Image width in pixels
1829    ///
1830    /// height: `i32` -> Image height in pixels
1831    pub fn black(width: i32, height: i32) -> Result<VipsImage> {
1832        let mut out_out = VipsImage::from(null_mut());
1833        let vips_op_response = call(
1834            "black",
1835            VOption::new()
1836                .set(
1837                    "out",
1838                    &mut out_out,
1839                )
1840                .set(
1841                    "width",
1842                    width,
1843                )
1844                .set(
1845                    "height",
1846                    height,
1847                ),
1848        );
1849
1850        utils::result(
1851            vips_op_response,
1852            out_out,
1853            Error::OperationError("Black (vips_black) failed".to_string()),
1854        )
1855    }
1856
1857    /// VipsBlack (black), make a black image
1858    /// returns `VipsImage` - Output image
1859    ///
1860    /// width: `i32` -> Image width in pixels
1861    ///
1862    /// height: `i32` -> Image height in pixels
1863    ///
1864    /// <ins>Optional arguments</ins>
1865    ///
1866    /// bands: `i32` -> Number of bands in image
1867    pub fn black_with_opts(width: i32, height: i32, option: VOption) -> Result<VipsImage> {
1868        let mut out_out = VipsImage::from(null_mut());
1869        let vips_op_response = call(
1870            "black",
1871            option
1872                .set(
1873                    "out",
1874                    &mut out_out,
1875                )
1876                .set(
1877                    "width",
1878                    width,
1879                )
1880                .set(
1881                    "height",
1882                    height,
1883                ),
1884        );
1885
1886        utils::result(
1887            vips_op_response,
1888            out_out,
1889            Error::OperationError("Black (vips_black) failed".to_string()),
1890        )
1891    }
1892
1893    /// VipsBoolean (boolean), boolean operation on two images
1894    /// returns `VipsImage` - Output image
1895    ///
1896    /// right: `&VipsImage` -> Right-hand image argument
1897    ///
1898    /// boolean: `OperationBoolean` -> Boolean to perform
1899    pub fn boolean(&self, right: &VipsImage, boolean: OperationBoolean) -> Result<VipsImage> {
1900        let mut out_out = VipsImage::from(null_mut());
1901        let vips_op_response = call(
1902            "boolean",
1903            VOption::new()
1904                .set(
1905                    "left",
1906                    self,
1907                )
1908                .set(
1909                    "right",
1910                    right,
1911                )
1912                .set(
1913                    "out",
1914                    &mut out_out,
1915                )
1916                .set(
1917                    "boolean",
1918                    boolean as i32,
1919                ),
1920        );
1921
1922        utils::result(
1923            vips_op_response,
1924            out_out,
1925            Error::OperationError("Boolean (vips_boolean) failed".to_string()),
1926        )
1927    }
1928
1929    /// VipsBooleanConst (boolean_const), boolean operations against a constant
1930    /// returns `VipsImage` - Output image
1931    ///
1932    /// boolean: `OperationBoolean` -> Boolean to perform
1933    ///
1934    /// c: `&[f64]` -> Array of constants
1935    pub fn boolean_const(&self, boolean: OperationBoolean, c: &[f64]) -> Result<VipsImage> {
1936        let mut out_out = VipsImage::from(null_mut());
1937        let vips_op_response = call(
1938            "boolean_const",
1939            VOption::new()
1940                .set("in", self)
1941                .set(
1942                    "out",
1943                    &mut out_out,
1944                )
1945                .set(
1946                    "boolean",
1947                    boolean as i32,
1948                )
1949                .set("c", c),
1950        );
1951
1952        utils::result(
1953            vips_op_response,
1954            out_out,
1955            Error::OperationError("BooleanConst (vips_boolean_const) failed".to_string()),
1956        )
1957    }
1958
1959    /// VipsBuildlut (buildlut), build a look-up table
1960    /// returns `VipsImage` - Output image
1961    pub fn buildlut(&self) -> Result<VipsImage> {
1962        let mut out_out = VipsImage::from(null_mut());
1963        let vips_op_response = call(
1964            "buildlut",
1965            VOption::new()
1966                .set("in", self)
1967                .set(
1968                    "out",
1969                    &mut out_out,
1970                ),
1971        );
1972
1973        utils::result(
1974            vips_op_response,
1975            out_out,
1976            Error::OperationError("Buildlut (vips_buildlut) failed".to_string()),
1977        )
1978    }
1979
1980    /// VipsByteswap (byteswap), byteswap an image
1981    /// returns `VipsImage` - Output image
1982    pub fn byteswap(&self) -> Result<VipsImage> {
1983        let mut out_out = VipsImage::from(null_mut());
1984        let vips_op_response = call(
1985            "byteswap",
1986            VOption::new()
1987                .set("in", self)
1988                .set(
1989                    "out",
1990                    &mut out_out,
1991                ),
1992        );
1993
1994        utils::result(
1995            vips_op_response,
1996            out_out,
1997            Error::OperationError("Byteswap (vips_byteswap) failed".to_string()),
1998        )
1999    }
2000
2001    /// VipsCanny (canny), Canny edge detector
2002    /// returns `VipsImage` - Output image
2003    pub fn canny(&self) -> Result<VipsImage> {
2004        let mut out_out = VipsImage::from(null_mut());
2005        let vips_op_response = call(
2006            "canny",
2007            VOption::new()
2008                .set("in", self)
2009                .set(
2010                    "out",
2011                    &mut out_out,
2012                ),
2013        );
2014
2015        utils::result(
2016            vips_op_response,
2017            out_out,
2018            Error::OperationError("Canny (vips_canny) failed".to_string()),
2019        )
2020    }
2021
2022    /// VipsCanny (canny), Canny edge detector
2023    /// returns `VipsImage` - Output image
2024    ///
2025    /// <ins>Optional arguments</ins>
2026    ///
2027    /// sigma: `f64` -> Sigma of Gaussian
2028    ///
2029    /// precision: [`Precision`] -> Convolve with this precision
2030    pub fn canny_with_opts(&self, option: VOption) -> Result<VipsImage> {
2031        let mut out_out = VipsImage::from(null_mut());
2032        let vips_op_response = call(
2033            "canny",
2034            option
2035                .set("in", self)
2036                .set(
2037                    "out",
2038                    &mut out_out,
2039                ),
2040        );
2041
2042        utils::result(
2043            vips_op_response,
2044            out_out,
2045            Error::OperationError("Canny (vips_canny) failed".to_string()),
2046        )
2047    }
2048
2049    /// VipsCase (case), use pixel values to pick cases from an array of images
2050    /// returns `VipsImage` - Output image
2051    ///
2052    /// cases: `&[VipsImage]` -> Array of case images
2053    pub fn case(&self, cases: &[VipsImage]) -> Result<VipsImage> {
2054        let mut out_out = VipsImage::from(null_mut());
2055        let vips_op_response = call(
2056            "case",
2057            VOption::new()
2058                .set(
2059                    "index",
2060                    self,
2061                )
2062                .set(
2063                    "cases",
2064                    cases,
2065                )
2066                .set(
2067                    "out",
2068                    &mut out_out,
2069                ),
2070        );
2071
2072        utils::result(
2073            vips_op_response,
2074            out_out,
2075            Error::OperationError("Case (vips_case) failed".to_string()),
2076        )
2077    }
2078
2079    /// VipsCast (cast), cast an image
2080    /// returns `VipsImage` - Output image
2081    ///
2082    /// format: `BandFormat` -> Format to cast to
2083    pub fn cast(&self, format: BandFormat) -> Result<VipsImage> {
2084        let mut out_out = VipsImage::from(null_mut());
2085        let vips_op_response = call(
2086            "cast",
2087            VOption::new()
2088                .set("in", self)
2089                .set(
2090                    "out",
2091                    &mut out_out,
2092                )
2093                .set(
2094                    "format",
2095                    format as i32,
2096                ),
2097        );
2098
2099        utils::result(
2100            vips_op_response,
2101            out_out,
2102            Error::OperationError("Cast (vips_cast) failed".to_string()),
2103        )
2104    }
2105
2106    /// VipsCast (cast), cast an image
2107    /// returns `VipsImage` - Output image
2108    ///
2109    /// format: `BandFormat` -> Format to cast to
2110    ///
2111    /// <ins>Optional arguments</ins>
2112    ///
2113    /// shift: `bool` -> Shift integer values up and down
2114    pub fn cast_with_opts(&self, format: BandFormat, option: VOption) -> Result<VipsImage> {
2115        let mut out_out = VipsImage::from(null_mut());
2116        let vips_op_response = call(
2117            "cast",
2118            option
2119                .set("in", self)
2120                .set(
2121                    "out",
2122                    &mut out_out,
2123                )
2124                .set(
2125                    "format",
2126                    format as i32,
2127                ),
2128        );
2129
2130        utils::result(
2131            vips_op_response,
2132            out_out,
2133            Error::OperationError("Cast (vips_cast) failed".to_string()),
2134        )
2135    }
2136
2137    /// VipsClamp (clamp), clamp values of an image
2138    /// returns `VipsImage` - Output image
2139    pub fn clamp(&self) -> Result<VipsImage> {
2140        let mut out_out = VipsImage::from(null_mut());
2141        let vips_op_response = call(
2142            "clamp",
2143            VOption::new()
2144                .set("in", self)
2145                .set(
2146                    "out",
2147                    &mut out_out,
2148                ),
2149        );
2150
2151        utils::result(
2152            vips_op_response,
2153            out_out,
2154            Error::OperationError("Clamp (vips_clamp) failed".to_string()),
2155        )
2156    }
2157
2158    /// VipsClamp (clamp), clamp values of an image
2159    /// returns `VipsImage` - Output image
2160    ///
2161    /// <ins>Optional arguments</ins>
2162    ///
2163    /// min: `f64` -> Minimum value
2164    ///
2165    /// max: `f64` -> Maximum value
2166    pub fn clamp_with_opts(&self, option: VOption) -> Result<VipsImage> {
2167        let mut out_out = VipsImage::from(null_mut());
2168        let vips_op_response = call(
2169            "clamp",
2170            option
2171                .set("in", self)
2172                .set(
2173                    "out",
2174                    &mut out_out,
2175                ),
2176        );
2177
2178        utils::result(
2179            vips_op_response,
2180            out_out,
2181            Error::OperationError("Clamp (vips_clamp) failed".to_string()),
2182        )
2183    }
2184
2185    /// VipsColourspace (colourspace), convert to a new colorspace
2186    /// returns `VipsImage` - Output image
2187    ///
2188    /// space: `Interpretation` -> Destination color space
2189    pub fn colourspace(&self, space: Interpretation) -> Result<VipsImage> {
2190        let mut out_out = VipsImage::from(null_mut());
2191        let vips_op_response = call(
2192            "colourspace",
2193            VOption::new()
2194                .set("in", self)
2195                .set(
2196                    "out",
2197                    &mut out_out,
2198                )
2199                .set(
2200                    "space",
2201                    space as i32,
2202                ),
2203        );
2204
2205        utils::result(
2206            vips_op_response,
2207            out_out,
2208            Error::OperationError("Colourspace (vips_colourspace) failed".to_string()),
2209        )
2210    }
2211
2212    /// VipsColourspace (colourspace), convert to a new colorspace
2213    /// returns `VipsImage` - Output image
2214    ///
2215    /// space: `Interpretation` -> Destination color space
2216    ///
2217    /// <ins>Optional arguments</ins>
2218    ///
2219    /// source_space: [`Interpretation`] -> Source color space
2220    pub fn colourspace_with_opts(
2221        &self,
2222        space: Interpretation,
2223        option: VOption,
2224    ) -> Result<VipsImage> {
2225        let mut out_out = VipsImage::from(null_mut());
2226        let vips_op_response = call(
2227            "colourspace",
2228            option
2229                .set("in", self)
2230                .set(
2231                    "out",
2232                    &mut out_out,
2233                )
2234                .set(
2235                    "space",
2236                    space as i32,
2237                ),
2238        );
2239
2240        utils::result(
2241            vips_op_response,
2242            out_out,
2243            Error::OperationError("Colourspace (vips_colourspace) failed".to_string()),
2244        )
2245    }
2246
2247    /// VipsCompass (compass), convolve with rotating mask
2248    /// returns `VipsImage` - Output image
2249    ///
2250    /// mask: `&VipsImage` -> Input matrix image
2251    pub fn compass(&self, mask: &VipsImage) -> Result<VipsImage> {
2252        let mut out_out = VipsImage::from(null_mut());
2253        let vips_op_response = call(
2254            "compass",
2255            VOption::new()
2256                .set("in", self)
2257                .set(
2258                    "out",
2259                    &mut out_out,
2260                )
2261                .set(
2262                    "mask",
2263                    mask,
2264                ),
2265        );
2266
2267        utils::result(
2268            vips_op_response,
2269            out_out,
2270            Error::OperationError("Compass (vips_compass) failed".to_string()),
2271        )
2272    }
2273
2274    /// VipsCompass (compass), convolve with rotating mask
2275    /// returns `VipsImage` - Output image
2276    ///
2277    /// mask: `&VipsImage` -> Input matrix image
2278    ///
2279    /// <ins>Optional arguments</ins>
2280    ///
2281    /// times: `i32` -> Rotate and convolve this many times
2282    ///
2283    /// angle: [`Angle45`] -> Rotate mask by this much between convolutions
2284    ///
2285    /// combine: [`Combine`] -> Combine convolution results like this
2286    ///
2287    /// precision: [`Precision`] -> Convolve with this precision
2288    ///
2289    /// layers: `i32` -> Use this many layers in approximation
2290    ///
2291    /// cluster: `i32` -> Cluster lines closer than this in approximation
2292    pub fn compass_with_opts(&self, mask: &VipsImage, option: VOption) -> Result<VipsImage> {
2293        let mut out_out = VipsImage::from(null_mut());
2294        let vips_op_response = call(
2295            "compass",
2296            option
2297                .set("in", self)
2298                .set(
2299                    "out",
2300                    &mut out_out,
2301                )
2302                .set(
2303                    "mask",
2304                    mask,
2305                ),
2306        );
2307
2308        utils::result(
2309            vips_op_response,
2310            out_out,
2311            Error::OperationError("Compass (vips_compass) failed".to_string()),
2312        )
2313    }
2314
2315    /// VipsComplex2 (complex2), complex binary operations on two images
2316    /// returns `VipsImage` - Output image
2317    ///
2318    /// right: `&VipsImage` -> Right-hand image argument
2319    ///
2320    /// cmplx: `OperationComplex2` -> Binary complex operation to perform
2321    pub fn complex2(&self, right: &VipsImage, cmplx: OperationComplex2) -> Result<VipsImage> {
2322        let mut out_out = VipsImage::from(null_mut());
2323        let vips_op_response = call(
2324            "complex2",
2325            VOption::new()
2326                .set(
2327                    "left",
2328                    self,
2329                )
2330                .set(
2331                    "right",
2332                    right,
2333                )
2334                .set(
2335                    "out",
2336                    &mut out_out,
2337                )
2338                .set(
2339                    "cmplx",
2340                    cmplx as i32,
2341                ),
2342        );
2343
2344        utils::result(
2345            vips_op_response,
2346            out_out,
2347            Error::OperationError("Complex2 (vips_complex2) failed".to_string()),
2348        )
2349    }
2350
2351    /// VipsComplex (complex), perform a complex operation on an image
2352    /// returns `VipsImage` - Output image
2353    ///
2354    /// cmplx: `OperationComplex` -> Complex to perform
2355    pub fn complex(&self, cmplx: OperationComplex) -> Result<VipsImage> {
2356        let mut out_out = VipsImage::from(null_mut());
2357        let vips_op_response = call(
2358            "complex",
2359            VOption::new()
2360                .set("in", self)
2361                .set(
2362                    "out",
2363                    &mut out_out,
2364                )
2365                .set(
2366                    "cmplx",
2367                    cmplx as i32,
2368                ),
2369        );
2370
2371        utils::result(
2372            vips_op_response,
2373            out_out,
2374            Error::OperationError("Complex (vips_complex) failed".to_string()),
2375        )
2376    }
2377
2378    /// VipsComplexform (complexform), form a complex image from two real images
2379    /// returns `VipsImage` - Output image
2380    ///
2381    /// right: `&VipsImage` -> Right-hand image argument
2382    pub fn complexform(&self, right: &VipsImage) -> Result<VipsImage> {
2383        let mut out_out = VipsImage::from(null_mut());
2384        let vips_op_response = call(
2385            "complexform",
2386            VOption::new()
2387                .set(
2388                    "left",
2389                    self,
2390                )
2391                .set(
2392                    "right",
2393                    right,
2394                )
2395                .set(
2396                    "out",
2397                    &mut out_out,
2398                ),
2399        );
2400
2401        utils::result(
2402            vips_op_response,
2403            out_out,
2404            Error::OperationError("Complexform (vips_complexform) failed".to_string()),
2405        )
2406    }
2407
2408    /// VipsComplexget (complexget), get a component from a complex image
2409    /// returns `VipsImage` - Output image
2410    ///
2411    /// get: `OperationComplexget` -> Complex to perform
2412    pub fn complexget(&self, get: OperationComplexget) -> Result<VipsImage> {
2413        let mut out_out = VipsImage::from(null_mut());
2414        let vips_op_response = call(
2415            "complexget",
2416            VOption::new()
2417                .set("in", self)
2418                .set(
2419                    "out",
2420                    &mut out_out,
2421                )
2422                .set(
2423                    "get",
2424                    get as i32,
2425                ),
2426        );
2427
2428        utils::result(
2429            vips_op_response,
2430            out_out,
2431            Error::OperationError("Complexget (vips_complexget) failed".to_string()),
2432        )
2433    }
2434
2435    /// VipsComposite2 (composite2), blend a pair of images with a blend mode
2436    /// returns `VipsImage` - Output image
2437    ///
2438    /// overlay: `&VipsImage` -> Overlay image
2439    ///
2440    /// mode: `BlendMode` -> VipsBlendMode to join with
2441    pub fn composite2(&self, overlay: &VipsImage, mode: BlendMode) -> Result<VipsImage> {
2442        let mut out_out = VipsImage::from(null_mut());
2443        let vips_op_response = call(
2444            "composite2",
2445            VOption::new()
2446                .set(
2447                    "base",
2448                    self,
2449                )
2450                .set(
2451                    "overlay",
2452                    overlay,
2453                )
2454                .set(
2455                    "out",
2456                    &mut out_out,
2457                )
2458                .set(
2459                    "mode",
2460                    mode as i32,
2461                ),
2462        );
2463
2464        utils::result(
2465            vips_op_response,
2466            out_out,
2467            Error::OperationError("Composite2 (vips_composite2) failed".to_string()),
2468        )
2469    }
2470
2471    /// VipsComposite2 (composite2), blend a pair of images with a blend mode
2472    /// returns `VipsImage` - Output image
2473    ///
2474    /// overlay: `&VipsImage` -> Overlay image
2475    ///
2476    /// mode: `BlendMode` -> VipsBlendMode to join with
2477    ///
2478    /// <ins>Optional arguments</ins>
2479    ///
2480    /// x: `i32` -> x position of overlay
2481    ///
2482    /// y: `i32` -> y position of overlay
2483    ///
2484    /// compositing_space: [`Interpretation`] -> Composite images in this colour space
2485    ///
2486    /// premultiplied: `bool` -> Images have premultiplied alpha
2487    pub fn composite2_with_opts(
2488        &self,
2489        overlay: &VipsImage,
2490        mode: BlendMode,
2491        option: VOption,
2492    ) -> Result<VipsImage> {
2493        let mut out_out = VipsImage::from(null_mut());
2494        let vips_op_response = call(
2495            "composite2",
2496            option
2497                .set(
2498                    "base",
2499                    self,
2500                )
2501                .set(
2502                    "overlay",
2503                    overlay,
2504                )
2505                .set(
2506                    "out",
2507                    &mut out_out,
2508                )
2509                .set(
2510                    "mode",
2511                    mode as i32,
2512                ),
2513        );
2514
2515        utils::result(
2516            vips_op_response,
2517            out_out,
2518            Error::OperationError("Composite2 (vips_composite2) failed".to_string()),
2519        )
2520    }
2521
2522    /// VipsComposite (composite), blend an array of images with an array of blend modes
2523    /// returns `VipsImage` - Output image
2524    ///
2525    /// inp: `&[VipsImage]` -> Array of input images
2526    ///
2527    /// mode: `&[i32]` -> Array of VipsBlendMode to join with
2528    pub fn composite(inp: &[VipsImage], mode: &[i32]) -> Result<VipsImage> {
2529        let mut out_out = VipsImage::from(null_mut());
2530        let vips_op_response = call(
2531            "composite",
2532            VOption::new()
2533                .set("in", inp)
2534                .set(
2535                    "out",
2536                    &mut out_out,
2537                )
2538                .set(
2539                    "mode",
2540                    mode,
2541                ),
2542        );
2543
2544        utils::result(
2545            vips_op_response,
2546            out_out,
2547            Error::OperationError("Composite (vips_composite) failed".to_string()),
2548        )
2549    }
2550
2551    /// VipsComposite (composite), blend an array of images with an array of blend modes
2552    /// returns `VipsImage` - Output image
2553    ///
2554    /// inp: `&[VipsImage]` -> Array of input images
2555    ///
2556    /// mode: `&[i32]` -> Array of VipsBlendMode to join with
2557    ///
2558    /// <ins>Optional arguments</ins>
2559    ///
2560    /// x: `&[i32]` -> Array of x coordinates to join at
2561    ///
2562    /// y: `&[i32]` -> Array of y coordinates to join at
2563    ///
2564    /// compositing_space: [`Interpretation`] -> Composite images in this colour space
2565    ///
2566    /// premultiplied: `bool` -> Images have premultiplied alpha
2567    pub fn composite_with_opts(
2568        inp: &[VipsImage],
2569        mode: &[i32],
2570        option: VOption,
2571    ) -> Result<VipsImage> {
2572        let mut out_out = VipsImage::from(null_mut());
2573        let vips_op_response = call(
2574            "composite",
2575            option
2576                .set("in", inp)
2577                .set(
2578                    "out",
2579                    &mut out_out,
2580                )
2581                .set(
2582                    "mode",
2583                    mode,
2584                ),
2585        );
2586
2587        utils::result(
2588            vips_op_response,
2589            out_out,
2590            Error::OperationError("Composite (vips_composite) failed".to_string()),
2591        )
2592    }
2593
2594    /// VipsConv (conv), convolution operation
2595    /// returns `VipsImage` - Output image
2596    ///
2597    /// mask: `&VipsImage` -> Input matrix image
2598    pub fn conv(&self, mask: &VipsImage) -> Result<VipsImage> {
2599        let mut out_out = VipsImage::from(null_mut());
2600        let vips_op_response = call(
2601            "conv",
2602            VOption::new()
2603                .set("in", self)
2604                .set(
2605                    "out",
2606                    &mut out_out,
2607                )
2608                .set(
2609                    "mask",
2610                    mask,
2611                ),
2612        );
2613
2614        utils::result(
2615            vips_op_response,
2616            out_out,
2617            Error::OperationError("Conv (vips_conv) failed".to_string()),
2618        )
2619    }
2620
2621    /// VipsConv (conv), convolution operation
2622    /// returns `VipsImage` - Output image
2623    ///
2624    /// mask: `&VipsImage` -> Input matrix image
2625    ///
2626    /// <ins>Optional arguments</ins>
2627    ///
2628    /// precision: [`Precision`] -> Convolve with this precision
2629    ///
2630    /// layers: `i32` -> Use this many layers in approximation
2631    ///
2632    /// cluster: `i32` -> Cluster lines closer than this in approximation
2633    pub fn conv_with_opts(&self, mask: &VipsImage, option: VOption) -> Result<VipsImage> {
2634        let mut out_out = VipsImage::from(null_mut());
2635        let vips_op_response = call(
2636            "conv",
2637            option
2638                .set("in", self)
2639                .set(
2640                    "out",
2641                    &mut out_out,
2642                )
2643                .set(
2644                    "mask",
2645                    mask,
2646                ),
2647        );
2648
2649        utils::result(
2650            vips_op_response,
2651            out_out,
2652            Error::OperationError("Conv (vips_conv) failed".to_string()),
2653        )
2654    }
2655
2656    /// VipsConva (conva), approximate integer convolution
2657    /// returns `VipsImage` - Output image
2658    ///
2659    /// mask: `&VipsImage` -> Input matrix image
2660    pub fn conva(&self, mask: &VipsImage) -> Result<VipsImage> {
2661        let mut out_out = VipsImage::from(null_mut());
2662        let vips_op_response = call(
2663            "conva",
2664            VOption::new()
2665                .set("in", self)
2666                .set(
2667                    "out",
2668                    &mut out_out,
2669                )
2670                .set(
2671                    "mask",
2672                    mask,
2673                ),
2674        );
2675
2676        utils::result(
2677            vips_op_response,
2678            out_out,
2679            Error::OperationError("Conva (vips_conva) failed".to_string()),
2680        )
2681    }
2682
2683    /// VipsConva (conva), approximate integer convolution
2684    /// returns `VipsImage` - Output image
2685    ///
2686    /// mask: `&VipsImage` -> Input matrix image
2687    ///
2688    /// <ins>Optional arguments</ins>
2689    ///
2690    /// layers: `i32` -> Use this many layers in approximation
2691    ///
2692    /// cluster: `i32` -> Cluster lines closer than this in approximation
2693    pub fn conva_with_opts(&self, mask: &VipsImage, option: VOption) -> Result<VipsImage> {
2694        let mut out_out = VipsImage::from(null_mut());
2695        let vips_op_response = call(
2696            "conva",
2697            option
2698                .set("in", self)
2699                .set(
2700                    "out",
2701                    &mut out_out,
2702                )
2703                .set(
2704                    "mask",
2705                    mask,
2706                ),
2707        );
2708
2709        utils::result(
2710            vips_op_response,
2711            out_out,
2712            Error::OperationError("Conva (vips_conva) failed".to_string()),
2713        )
2714    }
2715
2716    /// VipsConvasep (convasep), approximate separable integer convolution
2717    /// returns `VipsImage` - Output image
2718    ///
2719    /// mask: `&VipsImage` -> Input matrix image
2720    pub fn convasep(&self, mask: &VipsImage) -> Result<VipsImage> {
2721        let mut out_out = VipsImage::from(null_mut());
2722        let vips_op_response = call(
2723            "convasep",
2724            VOption::new()
2725                .set("in", self)
2726                .set(
2727                    "out",
2728                    &mut out_out,
2729                )
2730                .set(
2731                    "mask",
2732                    mask,
2733                ),
2734        );
2735
2736        utils::result(
2737            vips_op_response,
2738            out_out,
2739            Error::OperationError("Convasep (vips_convasep) failed".to_string()),
2740        )
2741    }
2742
2743    /// VipsConvasep (convasep), approximate separable integer convolution
2744    /// returns `VipsImage` - Output image
2745    ///
2746    /// mask: `&VipsImage` -> Input matrix image
2747    ///
2748    /// <ins>Optional arguments</ins>
2749    ///
2750    /// layers: `i32` -> Use this many layers in approximation
2751    pub fn convasep_with_opts(&self, mask: &VipsImage, option: VOption) -> Result<VipsImage> {
2752        let mut out_out = VipsImage::from(null_mut());
2753        let vips_op_response = call(
2754            "convasep",
2755            option
2756                .set("in", self)
2757                .set(
2758                    "out",
2759                    &mut out_out,
2760                )
2761                .set(
2762                    "mask",
2763                    mask,
2764                ),
2765        );
2766
2767        utils::result(
2768            vips_op_response,
2769            out_out,
2770            Error::OperationError("Convasep (vips_convasep) failed".to_string()),
2771        )
2772    }
2773
2774    /// VipsConvf (convf), float convolution operation
2775    /// returns `VipsImage` - Output image
2776    ///
2777    /// mask: `&VipsImage` -> Input matrix image
2778    pub fn convf(&self, mask: &VipsImage) -> Result<VipsImage> {
2779        let mut out_out = VipsImage::from(null_mut());
2780        let vips_op_response = call(
2781            "convf",
2782            VOption::new()
2783                .set("in", self)
2784                .set(
2785                    "out",
2786                    &mut out_out,
2787                )
2788                .set(
2789                    "mask",
2790                    mask,
2791                ),
2792        );
2793
2794        utils::result(
2795            vips_op_response,
2796            out_out,
2797            Error::OperationError("Convf (vips_convf) failed".to_string()),
2798        )
2799    }
2800
2801    /// VipsConvi (convi), int convolution operation
2802    /// returns `VipsImage` - Output image
2803    ///
2804    /// mask: `&VipsImage` -> Input matrix image
2805    pub fn convi(&self, mask: &VipsImage) -> Result<VipsImage> {
2806        let mut out_out = VipsImage::from(null_mut());
2807        let vips_op_response = call(
2808            "convi",
2809            VOption::new()
2810                .set("in", self)
2811                .set(
2812                    "out",
2813                    &mut out_out,
2814                )
2815                .set(
2816                    "mask",
2817                    mask,
2818                ),
2819        );
2820
2821        utils::result(
2822            vips_op_response,
2823            out_out,
2824            Error::OperationError("Convi (vips_convi) failed".to_string()),
2825        )
2826    }
2827
2828    /// VipsConvsep (convsep), separable convolution operation
2829    /// returns `VipsImage` - Output image
2830    ///
2831    /// mask: `&VipsImage` -> Input matrix image
2832    pub fn convsep(&self, mask: &VipsImage) -> Result<VipsImage> {
2833        let mut out_out = VipsImage::from(null_mut());
2834        let vips_op_response = call(
2835            "convsep",
2836            VOption::new()
2837                .set("in", self)
2838                .set(
2839                    "out",
2840                    &mut out_out,
2841                )
2842                .set(
2843                    "mask",
2844                    mask,
2845                ),
2846        );
2847
2848        utils::result(
2849            vips_op_response,
2850            out_out,
2851            Error::OperationError("Convsep (vips_convsep) failed".to_string()),
2852        )
2853    }
2854
2855    /// VipsConvsep (convsep), separable convolution operation
2856    /// returns `VipsImage` - Output image
2857    ///
2858    /// mask: `&VipsImage` -> Input matrix image
2859    ///
2860    /// <ins>Optional arguments</ins>
2861    ///
2862    /// precision: [`Precision`] -> Convolve with this precision
2863    ///
2864    /// layers: `i32` -> Use this many layers in approximation
2865    ///
2866    /// cluster: `i32` -> Cluster lines closer than this in approximation
2867    pub fn convsep_with_opts(&self, mask: &VipsImage, option: VOption) -> Result<VipsImage> {
2868        let mut out_out = VipsImage::from(null_mut());
2869        let vips_op_response = call(
2870            "convsep",
2871            option
2872                .set("in", self)
2873                .set(
2874                    "out",
2875                    &mut out_out,
2876                )
2877                .set(
2878                    "mask",
2879                    mask,
2880                ),
2881        );
2882
2883        utils::result(
2884            vips_op_response,
2885            out_out,
2886            Error::OperationError("Convsep (vips_convsep) failed".to_string()),
2887        )
2888    }
2889
2890    /// VipsCopy (copy), copy an image
2891    /// returns `VipsImage` - Output image
2892    pub fn copy(&self) -> Result<VipsImage> {
2893        let mut out_out = VipsImage::from(null_mut());
2894        let vips_op_response = call(
2895            "copy",
2896            VOption::new()
2897                .set("in", self)
2898                .set(
2899                    "out",
2900                    &mut out_out,
2901                ),
2902        );
2903
2904        utils::result(
2905            vips_op_response,
2906            out_out,
2907            Error::OperationError("Copy (vips_copy) failed".to_string()),
2908        )
2909    }
2910
2911    /// VipsCopy (copy), copy an image
2912    /// returns `VipsImage` - Output image
2913    ///
2914    /// <ins>Optional arguments</ins>
2915    ///
2916    /// width: `i32` -> Image width in pixels
2917    ///
2918    /// height: `i32` -> Image height in pixels
2919    ///
2920    /// bands: `i32` -> Number of bands in image
2921    ///
2922    /// format: [`BandFormat`] -> Pixel format in image
2923    ///
2924    /// coding: [`Coding`] -> Pixel coding
2925    ///
2926    /// interpretation: [`Interpretation`] -> Pixel interpretation
2927    ///
2928    /// xres: `f64` -> Horizontal resolution in pixels/mm
2929    ///
2930    /// yres: `f64` -> Vertical resolution in pixels/mm
2931    ///
2932    /// xoffset: `i32` -> Horizontal offset of origin
2933    ///
2934    /// yoffset: `i32` -> Vertical offset of origin
2935    pub fn copy_with_opts(&self, option: VOption) -> Result<VipsImage> {
2936        let mut out_out = VipsImage::from(null_mut());
2937        let vips_op_response = call(
2938            "copy",
2939            option
2940                .set("in", self)
2941                .set(
2942                    "out",
2943                    &mut out_out,
2944                ),
2945        );
2946
2947        utils::result(
2948            vips_op_response,
2949            out_out,
2950            Error::OperationError("Copy (vips_copy) failed".to_string()),
2951        )
2952    }
2953
2954    /// VipsCountlines (countlines), count lines in an image
2955    /// returns `f64` - Number of lines
2956    ///
2957    /// direction: `Direction` -> Countlines left-right or up-down
2958    pub fn countlines(&self, direction: Direction) -> Result<f64> {
2959        let mut nolines_out: f64 = 0.0;
2960        let vips_op_response = call(
2961            "countlines",
2962            VOption::new()
2963                .set("in", self)
2964                .set(
2965                    "nolines",
2966                    &mut nolines_out,
2967                )
2968                .set(
2969                    "direction",
2970                    direction as i32,
2971                ),
2972        );
2973
2974        utils::result(
2975            vips_op_response,
2976            nolines_out,
2977            Error::OperationError("Countlines (vips_countlines) failed".to_string()),
2978        )
2979    }
2980
2981    /// VipsForeignLoadCsvFile (csvload), load csv (.csv), priority=0, untrusted, get_flags, get_flags_filename, header, load
2982    /// returns `VipsImage` - Output image
2983    ///
2984    /// filename: `&str` -> Filename to load from
2985    pub fn csvload(filename: &str) -> Result<VipsImage> {
2986        let mut out_out = VipsImage::from(null_mut());
2987        let vips_op_response = call(
2988            "csvload",
2989            VOption::new()
2990                .set(
2991                    "filename",
2992                    filename,
2993                )
2994                .set(
2995                    "out",
2996                    &mut out_out,
2997                ),
2998        );
2999
3000        utils::result(
3001            vips_op_response,
3002            out_out,
3003            Error::OperationError("Csvload (vips_csvload) failed".to_string()),
3004        )
3005    }
3006
3007    /// VipsForeignLoadCsvFile (csvload), load csv (.csv), priority=0, untrusted, get_flags, get_flags_filename, header, load
3008    /// returns `VipsImage` - Output image
3009    ///
3010    /// filename: `&str` -> Filename to load from
3011    ///
3012    /// <ins>Optional arguments</ins>
3013    ///
3014    /// skip: `i32` -> Skip this many lines at the start of the file
3015    ///
3016    /// lines: `i32` -> Read this many lines from the file
3017    ///
3018    /// whitespace: `&str` -> Set of whitespace characters
3019    ///
3020    /// separator: `&str` -> Set of separator characters
3021    ///
3022    /// flags: [`ForeignFlags`] -> Flags for this file
3023    ///
3024    /// memory: `bool` -> Force open via memory
3025    ///
3026    /// access: [`Access`] -> Required access pattern for this file
3027    ///
3028    /// fail_on: [`FailOn`] -> Error level to fail on
3029    ///
3030    /// revalidate: `bool` -> Don't use a cached result for this operation
3031    pub fn csvload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
3032        let mut out_out = VipsImage::from(null_mut());
3033        let vips_op_response = call(
3034            "csvload",
3035            option
3036                .set(
3037                    "filename",
3038                    filename,
3039                )
3040                .set(
3041                    "out",
3042                    &mut out_out,
3043                ),
3044        );
3045
3046        utils::result(
3047            vips_op_response,
3048            out_out,
3049            Error::OperationError("Csvload (vips_csvload) failed".to_string()),
3050        )
3051    }
3052
3053    /// VipsForeignLoadCsvSource (csvload_source), load csv, priority=0, untrusted, is_a_source, get_flags, header, load
3054    /// returns `VipsImage` - Output image
3055    ///
3056    /// source: `&VipsSource` -> Source to load from
3057    pub fn csvload_source(source: &VipsSource) -> Result<VipsImage> {
3058        let mut out_out = VipsImage::from(null_mut());
3059        let vips_op_response = call(
3060            "csvload_source",
3061            VOption::new()
3062                .set(
3063                    "source",
3064                    source,
3065                )
3066                .set(
3067                    "out",
3068                    &mut out_out,
3069                ),
3070        );
3071
3072        utils::result(
3073            vips_op_response,
3074            out_out,
3075            Error::OperationError("CsvloadSource (vips_csvload_source) failed".to_string()),
3076        )
3077    }
3078
3079    /// VipsForeignLoadCsvSource (csvload_source), load csv, priority=0, untrusted, is_a_source, get_flags, header, load
3080    /// returns `VipsImage` - Output image
3081    ///
3082    /// source: `&VipsSource` -> Source to load from
3083    ///
3084    /// <ins>Optional arguments</ins>
3085    ///
3086    /// skip: `i32` -> Skip this many lines at the start of the file
3087    ///
3088    /// lines: `i32` -> Read this many lines from the file
3089    ///
3090    /// whitespace: `&str` -> Set of whitespace characters
3091    ///
3092    /// separator: `&str` -> Set of separator characters
3093    ///
3094    /// flags: [`ForeignFlags`] -> Flags for this file
3095    ///
3096    /// memory: `bool` -> Force open via memory
3097    ///
3098    /// access: [`Access`] -> Required access pattern for this file
3099    ///
3100    /// fail_on: [`FailOn`] -> Error level to fail on
3101    ///
3102    /// revalidate: `bool` -> Don't use a cached result for this operation
3103    pub fn csvload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
3104        let mut out_out = VipsImage::from(null_mut());
3105        let vips_op_response = call(
3106            "csvload_source",
3107            option
3108                .set(
3109                    "source",
3110                    source,
3111                )
3112                .set(
3113                    "out",
3114                    &mut out_out,
3115                ),
3116        );
3117
3118        utils::result(
3119            vips_op_response,
3120            out_out,
3121            Error::OperationError("CsvloadSource (vips_csvload_source) failed".to_string()),
3122        )
3123    }
3124
3125    /// VipsForeignSaveCsvFile (csvsave), save image to csv (.csv), priority=0, mono
3126    ///
3127    /// filename: `&str` -> Filename to save to
3128    pub fn csvsave(&self, filename: &str) -> Result<()> {
3129        let vips_op_response = call(
3130            "csvsave",
3131            VOption::new()
3132                .set("in", self)
3133                .set(
3134                    "filename",
3135                    filename,
3136                ),
3137        );
3138
3139        utils::result(
3140            vips_op_response,
3141            (),
3142            Error::OperationError("Csvsave (vips_csvsave) failed".to_string()),
3143        )
3144    }
3145
3146    /// VipsForeignSaveCsvFile (csvsave), save image to csv (.csv), priority=0, mono
3147    ///
3148    /// filename: `&str` -> Filename to save to
3149    ///
3150    /// <ins>Optional arguments</ins>
3151    ///
3152    /// separator: `&str` -> Separator characters
3153    ///
3154    /// keep: [`ForeignKeep`] -> Which metadata to retain
3155    ///
3156    /// background: `&[f64]` -> Background value
3157    ///
3158    /// page_height: `i32` -> Set page height for multipage save
3159    ///
3160    /// profile: `&str` -> Filename of ICC profile to embed
3161    pub fn csvsave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
3162        let vips_op_response = call(
3163            "csvsave",
3164            option
3165                .set("in", self)
3166                .set(
3167                    "filename",
3168                    filename,
3169                ),
3170        );
3171
3172        utils::result(
3173            vips_op_response,
3174            (),
3175            Error::OperationError("Csvsave (vips_csvsave) failed".to_string()),
3176        )
3177    }
3178
3179    /// VipsForeignSaveCsvTarget (csvsave_target), save image to csv (.csv), priority=0, mono
3180    ///
3181    /// target: `&VipsTarget` -> Target to save to
3182    pub fn csvsave_target(&self, target: &VipsTarget) -> Result<()> {
3183        let vips_op_response = call(
3184            "csvsave_target",
3185            VOption::new()
3186                .set("in", self)
3187                .set(
3188                    "target",
3189                    target,
3190                ),
3191        );
3192
3193        utils::result(
3194            vips_op_response,
3195            (),
3196            Error::OperationError("CsvsaveTarget (vips_csvsave_target) failed".to_string()),
3197        )
3198    }
3199
3200    /// VipsForeignSaveCsvTarget (csvsave_target), save image to csv (.csv), priority=0, mono
3201    ///
3202    /// target: `&VipsTarget` -> Target to save to
3203    ///
3204    /// <ins>Optional arguments</ins>
3205    ///
3206    /// separator: `&str` -> Separator characters
3207    ///
3208    /// keep: [`ForeignKeep`] -> Which metadata to retain
3209    ///
3210    /// background: `&[f64]` -> Background value
3211    ///
3212    /// page_height: `i32` -> Set page height for multipage save
3213    ///
3214    /// profile: `&str` -> Filename of ICC profile to embed
3215    pub fn csvsave_target_with_opts(&self, target: &VipsTarget, option: VOption) -> Result<()> {
3216        let vips_op_response = call(
3217            "csvsave_target",
3218            option
3219                .set("in", self)
3220                .set(
3221                    "target",
3222                    target,
3223                ),
3224        );
3225
3226        utils::result(
3227            vips_op_response,
3228            (),
3229            Error::OperationError("CsvsaveTarget (vips_csvsave_target) failed".to_string()),
3230        )
3231    }
3232
3233    /// VipsdE00 (dE00), calculate dE00
3234    /// returns `VipsImage` - Output image
3235    ///
3236    /// right: `&VipsImage` -> Right-hand input image
3237    pub fn dE00(&self, right: &VipsImage) -> Result<VipsImage> {
3238        let mut out_out = VipsImage::from(null_mut());
3239        let vips_op_response = call(
3240            "dE00",
3241            VOption::new()
3242                .set(
3243                    "left",
3244                    self,
3245                )
3246                .set(
3247                    "right",
3248                    right,
3249                )
3250                .set(
3251                    "out",
3252                    &mut out_out,
3253                ),
3254        );
3255
3256        utils::result(
3257            vips_op_response,
3258            out_out,
3259            Error::OperationError("DE00 (vips_dE00) failed".to_string()),
3260        )
3261    }
3262
3263    /// VipsdE76 (dE76), calculate dE76
3264    /// returns `VipsImage` - Output image
3265    ///
3266    /// right: `&VipsImage` -> Right-hand input image
3267    pub fn dE76(&self, right: &VipsImage) -> Result<VipsImage> {
3268        let mut out_out = VipsImage::from(null_mut());
3269        let vips_op_response = call(
3270            "dE76",
3271            VOption::new()
3272                .set(
3273                    "left",
3274                    self,
3275                )
3276                .set(
3277                    "right",
3278                    right,
3279                )
3280                .set(
3281                    "out",
3282                    &mut out_out,
3283                ),
3284        );
3285
3286        utils::result(
3287            vips_op_response,
3288            out_out,
3289            Error::OperationError("DE76 (vips_dE76) failed".to_string()),
3290        )
3291    }
3292
3293    /// VipsdECMC (dECMC), calculate dECMC
3294    /// returns `VipsImage` - Output image
3295    ///
3296    /// right: `&VipsImage` -> Right-hand input image
3297    pub fn dECMC(&self, right: &VipsImage) -> Result<VipsImage> {
3298        let mut out_out = VipsImage::from(null_mut());
3299        let vips_op_response = call(
3300            "dECMC",
3301            VOption::new()
3302                .set(
3303                    "left",
3304                    self,
3305                )
3306                .set(
3307                    "right",
3308                    right,
3309                )
3310                .set(
3311                    "out",
3312                    &mut out_out,
3313                ),
3314        );
3315
3316        utils::result(
3317            vips_op_response,
3318            out_out,
3319            Error::OperationError("DEcmc (vips_dECMC) failed".to_string()),
3320        )
3321    }
3322
3323    /// VipsDeviate (deviate), find image standard deviation
3324    /// returns `f64` - Output value
3325    pub fn deviate(&self) -> Result<f64> {
3326        let mut out_out: f64 = 0.0;
3327        let vips_op_response = call(
3328            "deviate",
3329            VOption::new()
3330                .set("in", self)
3331                .set(
3332                    "out",
3333                    &mut out_out,
3334                ),
3335        );
3336
3337        utils::result(
3338            vips_op_response,
3339            out_out,
3340            Error::OperationError("Deviate (vips_deviate) failed".to_string()),
3341        )
3342    }
3343
3344    /// VipsDivide (divide), divide two images
3345    /// returns `VipsImage` - Output image
3346    ///
3347    /// right: `&VipsImage` -> Right-hand image argument
3348    pub fn divide(&self, right: &VipsImage) -> Result<VipsImage> {
3349        let mut out_out = VipsImage::from(null_mut());
3350        let vips_op_response = call(
3351            "divide",
3352            VOption::new()
3353                .set(
3354                    "left",
3355                    self,
3356                )
3357                .set(
3358                    "right",
3359                    right,
3360                )
3361                .set(
3362                    "out",
3363                    &mut out_out,
3364                ),
3365        );
3366
3367        utils::result(
3368            vips_op_response,
3369            out_out,
3370            Error::OperationError("Divide (vips_divide) failed".to_string()),
3371        )
3372    }
3373
3374    /// VipsDrawCircle (draw_circle), draw a circle on an image
3375    ///
3376    /// ink: `&[f64]` -> Color for pixels
3377    ///
3378    /// cx: `i32` -> Centre of draw_circle
3379    ///
3380    /// cy: `i32` -> Centre of draw_circle
3381    ///
3382    /// radius: `i32` -> Radius in pixels
3383    pub fn draw_circle(&self, ink: &[f64], cx: i32, cy: i32, radius: i32) -> Result<()> {
3384        let vips_op_response = call(
3385            "draw_circle",
3386            VOption::new()
3387                .set(
3388                    "image",
3389                    self,
3390                )
3391                .set("ink", ink)
3392                .set("cx", cx)
3393                .set("cy", cy)
3394                .set(
3395                    "radius",
3396                    radius,
3397                ),
3398        );
3399
3400        utils::result(
3401            vips_op_response,
3402            (),
3403            Error::OperationError("DrawCircle (vips_draw_circle) failed".to_string()),
3404        )
3405    }
3406
3407    /// VipsDrawCircle (draw_circle), draw a circle on an image
3408    ///
3409    /// ink: `&[f64]` -> Color for pixels
3410    ///
3411    /// cx: `i32` -> Centre of draw_circle
3412    ///
3413    /// cy: `i32` -> Centre of draw_circle
3414    ///
3415    /// radius: `i32` -> Radius in pixels
3416    ///
3417    /// <ins>Optional arguments</ins>
3418    ///
3419    /// fill: `bool` -> Draw a solid object
3420    pub fn draw_circle_with_opts(
3421        &self,
3422        ink: &[f64],
3423        cx: i32,
3424        cy: i32,
3425        radius: i32,
3426        option: VOption,
3427    ) -> Result<()> {
3428        let vips_op_response = call(
3429            "draw_circle",
3430            option
3431                .set(
3432                    "image",
3433                    self,
3434                )
3435                .set("ink", ink)
3436                .set("cx", cx)
3437                .set("cy", cy)
3438                .set(
3439                    "radius",
3440                    radius,
3441                ),
3442        );
3443
3444        utils::result(
3445            vips_op_response,
3446            (),
3447            Error::OperationError("DrawCircle (vips_draw_circle) failed".to_string()),
3448        )
3449    }
3450
3451    /// VipsDrawFlood (draw_flood), flood-fill an area
3452    ///
3453    /// ink: `&[f64]` -> Color for pixels
3454    ///
3455    /// x: `i32` -> DrawFlood start point
3456    ///
3457    /// y: `i32` -> DrawFlood start point
3458    pub fn draw_flood(&self, ink: &[f64], x: i32, y: i32) -> Result<()> {
3459        let vips_op_response = call(
3460            "draw_flood",
3461            VOption::new()
3462                .set(
3463                    "image",
3464                    self,
3465                )
3466                .set("ink", ink)
3467                .set("x", x)
3468                .set("y", y),
3469        );
3470
3471        utils::result(
3472            vips_op_response,
3473            (),
3474            Error::OperationError("DrawFlood (vips_draw_flood) failed".to_string()),
3475        )
3476    }
3477
3478    /// VipsDrawFlood (draw_flood), flood-fill an area
3479    ///
3480    /// ink: `&[f64]` -> Color for pixels
3481    ///
3482    /// x: `i32` -> DrawFlood start point
3483    ///
3484    /// y: `i32` -> DrawFlood start point
3485    ///
3486    /// <ins>Optional arguments</ins>
3487    ///
3488    /// test: `` -> Test pixels in this image
3489    ///
3490    /// equal: `bool` -> DrawFlood while equal to edge
3491    ///
3492    /// left: `&mut i32` -> Left edge of modified area
3493    ///
3494    /// top: `&mut i32` -> Top edge of modified area
3495    ///
3496    /// width: `&mut i32` -> Width of modified area
3497    ///
3498    /// height: `&mut i32` -> Height of modified area
3499    pub fn draw_flood_with_opts(&self, ink: &[f64], x: i32, y: i32, option: VOption) -> Result<()> {
3500        let vips_op_response = call(
3501            "draw_flood",
3502            option
3503                .set(
3504                    "image",
3505                    self,
3506                )
3507                .set("ink", ink)
3508                .set("x", x)
3509                .set("y", y),
3510        );
3511
3512        utils::result(
3513            vips_op_response,
3514            (),
3515            Error::OperationError("DrawFlood (vips_draw_flood) failed".to_string()),
3516        )
3517    }
3518
3519    /// VipsDrawImage (draw_image), paint an image into another image
3520    ///
3521    /// sub: `&VipsImage` -> Sub-image to insert into main image
3522    ///
3523    /// x: `i32` -> Draw image here
3524    ///
3525    /// y: `i32` -> Draw image here
3526    pub fn draw_image(&self, sub: &VipsImage, x: i32, y: i32) -> Result<()> {
3527        let vips_op_response = call(
3528            "draw_image",
3529            VOption::new()
3530                .set(
3531                    "image",
3532                    self,
3533                )
3534                .set("sub", sub)
3535                .set("x", x)
3536                .set("y", y),
3537        );
3538
3539        utils::result(
3540            vips_op_response,
3541            (),
3542            Error::OperationError("DrawImage (vips_draw_image) failed".to_string()),
3543        )
3544    }
3545
3546    /// VipsDrawImage (draw_image), paint an image into another image
3547    ///
3548    /// sub: `&VipsImage` -> Sub-image to insert into main image
3549    ///
3550    /// x: `i32` -> Draw image here
3551    ///
3552    /// y: `i32` -> Draw image here
3553    ///
3554    /// <ins>Optional arguments</ins>
3555    ///
3556    /// mode: [`CombineMode`] -> Combining mode
3557    pub fn draw_image_with_opts(
3558        &self,
3559        sub: &VipsImage,
3560        x: i32,
3561        y: i32,
3562        option: VOption,
3563    ) -> Result<()> {
3564        let vips_op_response = call(
3565            "draw_image",
3566            option
3567                .set(
3568                    "image",
3569                    self,
3570                )
3571                .set("sub", sub)
3572                .set("x", x)
3573                .set("y", y),
3574        );
3575
3576        utils::result(
3577            vips_op_response,
3578            (),
3579            Error::OperationError("DrawImage (vips_draw_image) failed".to_string()),
3580        )
3581    }
3582
3583    /// VipsDrawLine (draw_line), draw a line on an image
3584    ///
3585    /// ink: `&[f64]` -> Color for pixels
3586    ///
3587    /// x1: `i32` -> Start of draw_line
3588    ///
3589    /// y1: `i32` -> Start of draw_line
3590    ///
3591    /// x2: `i32` -> End of draw_line
3592    ///
3593    /// y2: `i32` -> End of draw_line
3594    pub fn draw_line(&self, ink: &[f64], x1: i32, y1: i32, x2: i32, y2: i32) -> Result<()> {
3595        let vips_op_response = call(
3596            "draw_line",
3597            VOption::new()
3598                .set(
3599                    "image",
3600                    self,
3601                )
3602                .set("ink", ink)
3603                .set("x1", x1)
3604                .set("y1", y1)
3605                .set("x2", x2)
3606                .set("y2", y2),
3607        );
3608
3609        utils::result(
3610            vips_op_response,
3611            (),
3612            Error::OperationError("DrawLine (vips_draw_line) failed".to_string()),
3613        )
3614    }
3615
3616    /// VipsDrawMask (draw_mask), draw a mask on an image
3617    ///
3618    /// ink: `&[f64]` -> Color for pixels
3619    ///
3620    /// mask: `&VipsImage` -> Mask of pixels to draw
3621    ///
3622    /// x: `i32` -> Draw mask here
3623    ///
3624    /// y: `i32` -> Draw mask here
3625    pub fn draw_mask(&self, ink: &[f64], mask: &VipsImage, x: i32, y: i32) -> Result<()> {
3626        let vips_op_response = call(
3627            "draw_mask",
3628            VOption::new()
3629                .set(
3630                    "image",
3631                    self,
3632                )
3633                .set("ink", ink)
3634                .set(
3635                    "mask",
3636                    mask,
3637                )
3638                .set("x", x)
3639                .set("y", y),
3640        );
3641
3642        utils::result(
3643            vips_op_response,
3644            (),
3645            Error::OperationError("DrawMask (vips_draw_mask) failed".to_string()),
3646        )
3647    }
3648
3649    /// VipsDrawRect (draw_rect), paint a rectangle on an image
3650    ///
3651    /// ink: `&[f64]` -> Color for pixels
3652    ///
3653    /// left: `i32` -> Rect to fill
3654    ///
3655    /// top: `i32` -> Rect to fill
3656    ///
3657    /// width: `i32` -> Rect to fill
3658    ///
3659    /// height: `i32` -> Rect to fill
3660    pub fn draw_rect(
3661        &self,
3662        ink: &[f64],
3663        left: i32,
3664        top: i32,
3665        width: i32,
3666        height: i32,
3667    ) -> Result<()> {
3668        let vips_op_response = call(
3669            "draw_rect",
3670            VOption::new()
3671                .set(
3672                    "image",
3673                    self,
3674                )
3675                .set("ink", ink)
3676                .set(
3677                    "left",
3678                    left,
3679                )
3680                .set("top", top)
3681                .set(
3682                    "width",
3683                    width,
3684                )
3685                .set(
3686                    "height",
3687                    height,
3688                ),
3689        );
3690
3691        utils::result(
3692            vips_op_response,
3693            (),
3694            Error::OperationError("DrawRect (vips_draw_rect) failed".to_string()),
3695        )
3696    }
3697
3698    /// VipsDrawRect (draw_rect), paint a rectangle on an image
3699    ///
3700    /// ink: `&[f64]` -> Color for pixels
3701    ///
3702    /// left: `i32` -> Rect to fill
3703    ///
3704    /// top: `i32` -> Rect to fill
3705    ///
3706    /// width: `i32` -> Rect to fill
3707    ///
3708    /// height: `i32` -> Rect to fill
3709    ///
3710    /// <ins>Optional arguments</ins>
3711    ///
3712    /// fill: `bool` -> Draw a solid object
3713    pub fn draw_rect_with_opts(
3714        &self,
3715        ink: &[f64],
3716        left: i32,
3717        top: i32,
3718        width: i32,
3719        height: i32,
3720        option: VOption,
3721    ) -> Result<()> {
3722        let vips_op_response = call(
3723            "draw_rect",
3724            option
3725                .set(
3726                    "image",
3727                    self,
3728                )
3729                .set("ink", ink)
3730                .set(
3731                    "left",
3732                    left,
3733                )
3734                .set("top", top)
3735                .set(
3736                    "width",
3737                    width,
3738                )
3739                .set(
3740                    "height",
3741                    height,
3742                ),
3743        );
3744
3745        utils::result(
3746            vips_op_response,
3747            (),
3748            Error::OperationError("DrawRect (vips_draw_rect) failed".to_string()),
3749        )
3750    }
3751
3752    /// VipsDrawSmudge (draw_smudge), blur a rectangle on an image
3753    ///
3754    /// left: `i32` -> Rect to fill
3755    ///
3756    /// top: `i32` -> Rect to fill
3757    ///
3758    /// width: `i32` -> Rect to fill
3759    ///
3760    /// height: `i32` -> Rect to fill
3761    pub fn draw_smudge(&self, left: i32, top: i32, width: i32, height: i32) -> Result<()> {
3762        let vips_op_response = call(
3763            "draw_smudge",
3764            VOption::new()
3765                .set(
3766                    "image",
3767                    self,
3768                )
3769                .set(
3770                    "left",
3771                    left,
3772                )
3773                .set("top", top)
3774                .set(
3775                    "width",
3776                    width,
3777                )
3778                .set(
3779                    "height",
3780                    height,
3781                ),
3782        );
3783
3784        utils::result(
3785            vips_op_response,
3786            (),
3787            Error::OperationError("DrawSmudge (vips_draw_smudge) failed".to_string()),
3788        )
3789    }
3790
3791    /// VipsForeignSaveDzFile (dzsave), save image to deepzoom file (.dz, .szi), priority=0,
3792    ///
3793    /// filename: `&str` -> Filename to save to
3794    pub fn dzsave(&self, filename: &str) -> Result<()> {
3795        let vips_op_response = call(
3796            "dzsave",
3797            VOption::new()
3798                .set("in", self)
3799                .set(
3800                    "filename",
3801                    filename,
3802                ),
3803        );
3804
3805        utils::result(
3806            vips_op_response,
3807            (),
3808            Error::OperationError("Dzsave (vips_dzsave) failed".to_string()),
3809        )
3810    }
3811
3812    /// VipsForeignSaveDzFile (dzsave), save image to deepzoom file (.dz, .szi), priority=0,
3813    ///
3814    /// filename: `&str` -> Filename to save to
3815    ///
3816    /// <ins>Optional arguments</ins>
3817    ///
3818    /// imagename: `&str` -> Image name
3819    ///
3820    /// layout: [`ForeignDzLayout`] -> Directory layout
3821    ///
3822    /// suffix: `&str` -> Filename suffix for tiles
3823    ///
3824    /// overlap: `i32` -> Tile overlap in pixels
3825    ///
3826    /// tile_size: `i32` -> Tile size in pixels
3827    ///
3828    /// centre: `bool` -> Center image in tile
3829    ///
3830    /// depth: [`ForeignDzDepth`] -> Pyramid depth
3831    ///
3832    /// angle: [`Angle`] -> Rotate image during save
3833    ///
3834    /// container: [`ForeignDzContainer`] -> Pyramid container type
3835    ///
3836    /// compression: `i32` -> ZIP deflate compression level
3837    ///
3838    /// region_shrink: [`RegionShrink`] -> Method to shrink regions
3839    ///
3840    /// skip_blanks: `i32` -> Skip tiles which are nearly equal to the background
3841    ///
3842    /// id: `&str` -> Resource ID
3843    ///
3844    /// Q: `i32` -> Q factor
3845    ///
3846    /// keep: [`ForeignKeep`] -> Which metadata to retain
3847    ///
3848    /// background: `&[f64]` -> Background value
3849    ///
3850    /// page_height: `i32` -> Set page height for multipage save
3851    ///
3852    /// profile: `&str` -> Filename of ICC profile to embed
3853    pub fn dzsave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
3854        let vips_op_response = call(
3855            "dzsave",
3856            option
3857                .set("in", self)
3858                .set(
3859                    "filename",
3860                    filename,
3861                ),
3862        );
3863
3864        utils::result(
3865            vips_op_response,
3866            (),
3867            Error::OperationError("Dzsave (vips_dzsave) failed".to_string()),
3868        )
3869    }
3870
3871    /// VipsForeignSaveDzBuffer (dzsave_buffer), save image to dz buffer (.dz, .szi), priority=0,
3872    /// returns `Vec<u8>` - Buffer to save to
3873    pub fn dzsave_buffer(&self) -> Result<Vec<u8>> {
3874        let mut buffer_out = VipsBlob::from(null_mut());
3875        let vips_op_response = call(
3876            "dzsave_buffer",
3877            VOption::new()
3878                .set("in", self)
3879                .set(
3880                    "buffer",
3881                    &mut buffer_out,
3882                ),
3883        );
3884
3885        utils::result(
3886            vips_op_response,
3887            buffer_out.into(),
3888            Error::OperationError("DzsaveBuffer (vips_dzsave_buffer) failed".to_string()),
3889        )
3890    }
3891
3892    /// VipsForeignSaveDzBuffer (dzsave_buffer), save image to dz buffer (.dz, .szi), priority=0,
3893    /// returns `Vec<u8>` - Buffer to save to
3894    ///
3895    /// <ins>Optional arguments</ins>
3896    ///
3897    /// imagename: `&str` -> Image name
3898    ///
3899    /// layout: [`ForeignDzLayout`] -> Directory layout
3900    ///
3901    /// suffix: `&str` -> Filename suffix for tiles
3902    ///
3903    /// overlap: `i32` -> Tile overlap in pixels
3904    ///
3905    /// tile_size: `i32` -> Tile size in pixels
3906    ///
3907    /// centre: `bool` -> Center image in tile
3908    ///
3909    /// depth: [`ForeignDzDepth`] -> Pyramid depth
3910    ///
3911    /// angle: [`Angle`] -> Rotate image during save
3912    ///
3913    /// container: [`ForeignDzContainer`] -> Pyramid container type
3914    ///
3915    /// compression: `i32` -> ZIP deflate compression level
3916    ///
3917    /// region_shrink: [`RegionShrink`] -> Method to shrink regions
3918    ///
3919    /// skip_blanks: `i32` -> Skip tiles which are nearly equal to the background
3920    ///
3921    /// id: `&str` -> Resource ID
3922    ///
3923    /// Q: `i32` -> Q factor
3924    ///
3925    /// keep: [`ForeignKeep`] -> Which metadata to retain
3926    ///
3927    /// background: `&[f64]` -> Background value
3928    ///
3929    /// page_height: `i32` -> Set page height for multipage save
3930    ///
3931    /// profile: `&str` -> Filename of ICC profile to embed
3932    pub fn dzsave_buffer_with_opts(&self, option: VOption) -> Result<Vec<u8>> {
3933        let mut buffer_out = VipsBlob::from(null_mut());
3934        let vips_op_response = call(
3935            "dzsave_buffer",
3936            option
3937                .set("in", self)
3938                .set(
3939                    "buffer",
3940                    &mut buffer_out,
3941                ),
3942        );
3943
3944        utils::result(
3945            vips_op_response,
3946            buffer_out.into(),
3947            Error::OperationError("DzsaveBuffer (vips_dzsave_buffer) failed".to_string()),
3948        )
3949    }
3950
3951    /// VipsForeignSaveDzTarget (dzsave_target), save image to deepzoom target (.dz, .szi), priority=0,
3952    ///
3953    /// target: `&VipsTarget` -> Target to save to
3954    pub fn dzsave_target(&self, target: &VipsTarget) -> Result<()> {
3955        let vips_op_response = call(
3956            "dzsave_target",
3957            VOption::new()
3958                .set("in", self)
3959                .set(
3960                    "target",
3961                    target,
3962                ),
3963        );
3964
3965        utils::result(
3966            vips_op_response,
3967            (),
3968            Error::OperationError("DzsaveTarget (vips_dzsave_target) failed".to_string()),
3969        )
3970    }
3971
3972    /// VipsForeignSaveDzTarget (dzsave_target), save image to deepzoom target (.dz, .szi), priority=0,
3973    ///
3974    /// target: `&VipsTarget` -> Target to save to
3975    ///
3976    /// <ins>Optional arguments</ins>
3977    ///
3978    /// imagename: `&str` -> Image name
3979    ///
3980    /// layout: [`ForeignDzLayout`] -> Directory layout
3981    ///
3982    /// suffix: `&str` -> Filename suffix for tiles
3983    ///
3984    /// overlap: `i32` -> Tile overlap in pixels
3985    ///
3986    /// tile_size: `i32` -> Tile size in pixels
3987    ///
3988    /// centre: `bool` -> Center image in tile
3989    ///
3990    /// depth: [`ForeignDzDepth`] -> Pyramid depth
3991    ///
3992    /// angle: [`Angle`] -> Rotate image during save
3993    ///
3994    /// container: [`ForeignDzContainer`] -> Pyramid container type
3995    ///
3996    /// compression: `i32` -> ZIP deflate compression level
3997    ///
3998    /// region_shrink: [`RegionShrink`] -> Method to shrink regions
3999    ///
4000    /// skip_blanks: `i32` -> Skip tiles which are nearly equal to the background
4001    ///
4002    /// id: `&str` -> Resource ID
4003    ///
4004    /// Q: `i32` -> Q factor
4005    ///
4006    /// keep: [`ForeignKeep`] -> Which metadata to retain
4007    ///
4008    /// background: `&[f64]` -> Background value
4009    ///
4010    /// page_height: `i32` -> Set page height for multipage save
4011    ///
4012    /// profile: `&str` -> Filename of ICC profile to embed
4013    pub fn dzsave_target_with_opts(&self, target: &VipsTarget, option: VOption) -> Result<()> {
4014        let vips_op_response = call(
4015            "dzsave_target",
4016            option
4017                .set("in", self)
4018                .set(
4019                    "target",
4020                    target,
4021                ),
4022        );
4023
4024        utils::result(
4025            vips_op_response,
4026            (),
4027            Error::OperationError("DzsaveTarget (vips_dzsave_target) failed".to_string()),
4028        )
4029    }
4030
4031    /// VipsEmbed (embed), embed an image in a larger image
4032    /// returns `VipsImage` - Output image
4033    ///
4034    /// x: `i32` -> Left edge of input in output
4035    ///
4036    /// y: `i32` -> Top edge of input in output
4037    ///
4038    /// width: `i32` -> Image width in pixels
4039    ///
4040    /// height: `i32` -> Image height in pixels
4041    pub fn embed(&self, x: i32, y: i32, width: i32, height: i32) -> Result<VipsImage> {
4042        let mut out_out = VipsImage::from(null_mut());
4043        let vips_op_response = call(
4044            "embed",
4045            VOption::new()
4046                .set("in", self)
4047                .set(
4048                    "out",
4049                    &mut out_out,
4050                )
4051                .set("x", x)
4052                .set("y", y)
4053                .set(
4054                    "width",
4055                    width,
4056                )
4057                .set(
4058                    "height",
4059                    height,
4060                ),
4061        );
4062
4063        utils::result(
4064            vips_op_response,
4065            out_out,
4066            Error::OperationError("Embed (vips_embed) failed".to_string()),
4067        )
4068    }
4069
4070    /// VipsEmbed (embed), embed an image in a larger image
4071    /// returns `VipsImage` - Output image
4072    ///
4073    /// x: `i32` -> Left edge of input in output
4074    ///
4075    /// y: `i32` -> Top edge of input in output
4076    ///
4077    /// width: `i32` -> Image width in pixels
4078    ///
4079    /// height: `i32` -> Image height in pixels
4080    ///
4081    /// <ins>Optional arguments</ins>
4082    ///
4083    /// extend: [`Extend`] -> How to generate the extra pixels
4084    ///
4085    /// background: `&[f64]` -> Color for background pixels
4086    pub fn embed_with_opts(
4087        &self,
4088        x: i32,
4089        y: i32,
4090        width: i32,
4091        height: i32,
4092        option: VOption,
4093    ) -> Result<VipsImage> {
4094        let mut out_out = VipsImage::from(null_mut());
4095        let vips_op_response = call(
4096            "embed",
4097            option
4098                .set("in", self)
4099                .set(
4100                    "out",
4101                    &mut out_out,
4102                )
4103                .set("x", x)
4104                .set("y", y)
4105                .set(
4106                    "width",
4107                    width,
4108                )
4109                .set(
4110                    "height",
4111                    height,
4112                ),
4113        );
4114
4115        utils::result(
4116            vips_op_response,
4117            out_out,
4118            Error::OperationError("Embed (vips_embed) failed".to_string()),
4119        )
4120    }
4121
4122    /// VipsExtractArea (extract_area), extract an area from an image
4123    /// returns `VipsImage` - Output image
4124    ///
4125    /// left: `i32` -> Left edge of extract area
4126    ///
4127    /// top: `i32` -> Top edge of extract area
4128    ///
4129    /// width: `i32` -> Width of extract area
4130    ///
4131    /// height: `i32` -> Height of extract area
4132    pub fn extract_area(&self, left: i32, top: i32, width: i32, height: i32) -> Result<VipsImage> {
4133        let mut out_out = VipsImage::from(null_mut());
4134        let vips_op_response = call(
4135            "extract_area",
4136            VOption::new()
4137                .set(
4138                    "input",
4139                    self,
4140                )
4141                .set(
4142                    "out",
4143                    &mut out_out,
4144                )
4145                .set(
4146                    "left",
4147                    left,
4148                )
4149                .set("top", top)
4150                .set(
4151                    "width",
4152                    width,
4153                )
4154                .set(
4155                    "height",
4156                    height,
4157                ),
4158        );
4159
4160        utils::result(
4161            vips_op_response,
4162            out_out,
4163            Error::OperationError("ExtractArea (vips_extract_area) failed".to_string()),
4164        )
4165    }
4166
4167    /// crop (extract_area), extract an area from an image
4168    /// returns `VipsImage` - Output image
4169    ///
4170    /// left: `i32` -> Left edge of extract area
4171    ///
4172    /// top: `i32` -> Top edge of extract area
4173    ///
4174    /// width: `i32` -> Width of extract area
4175    ///
4176    /// height: `i32` -> Height of extract area
4177    pub fn crop(&self, left: i32, top: i32, width: i32, height: i32) -> Result<VipsImage> {
4178        let mut out_out = VipsImage::from(null_mut());
4179        let vips_op_response = call(
4180            "crop",
4181            VOption::new()
4182                .set(
4183                    "input",
4184                    self,
4185                )
4186                .set(
4187                    "out",
4188                    &mut out_out,
4189                )
4190                .set(
4191                    "left",
4192                    left,
4193                )
4194                .set("top", top)
4195                .set(
4196                    "width",
4197                    width,
4198                )
4199                .set(
4200                    "height",
4201                    height,
4202                ),
4203        );
4204
4205        utils::result(
4206            vips_op_response,
4207            out_out,
4208            Error::OperationError("Crop (vips_crop) failed".to_string()),
4209        )
4210    }
4211
4212    /// VipsExtractBand (extract_band), extract band from an image
4213    /// returns `VipsImage` - Output image
4214    ///
4215    /// band: `i32` -> Band to extract
4216    pub fn extract_band(&self, band: i32) -> Result<VipsImage> {
4217        let mut out_out = VipsImage::from(null_mut());
4218        let vips_op_response = call(
4219            "extract_band",
4220            VOption::new()
4221                .set("in", self)
4222                .set(
4223                    "out",
4224                    &mut out_out,
4225                )
4226                .set(
4227                    "band",
4228                    band,
4229                ),
4230        );
4231
4232        utils::result(
4233            vips_op_response,
4234            out_out,
4235            Error::OperationError("ExtractBand (vips_extract_band) failed".to_string()),
4236        )
4237    }
4238
4239    /// VipsExtractBand (extract_band), extract band from an image
4240    /// returns `VipsImage` - Output image
4241    ///
4242    /// band: `i32` -> Band to extract
4243    ///
4244    /// <ins>Optional arguments</ins>
4245    ///
4246    /// n: `i32` -> Number of bands to extract
4247    pub fn extract_band_with_opts(&self, band: i32, option: VOption) -> Result<VipsImage> {
4248        let mut out_out = VipsImage::from(null_mut());
4249        let vips_op_response = call(
4250            "extract_band",
4251            option
4252                .set("in", self)
4253                .set(
4254                    "out",
4255                    &mut out_out,
4256                )
4257                .set(
4258                    "band",
4259                    band,
4260                ),
4261        );
4262
4263        utils::result(
4264            vips_op_response,
4265            out_out,
4266            Error::OperationError("ExtractBand (vips_extract_band) failed".to_string()),
4267        )
4268    }
4269
4270    /// VipsEye (eye), make an image showing the eye's spatial response
4271    /// returns `VipsImage` - Output image
4272    ///
4273    /// width: `i32` -> Image width in pixels
4274    ///
4275    /// height: `i32` -> Image height in pixels
4276    pub fn eye(width: i32, height: i32) -> Result<VipsImage> {
4277        let mut out_out = VipsImage::from(null_mut());
4278        let vips_op_response = call(
4279            "eye",
4280            VOption::new()
4281                .set(
4282                    "out",
4283                    &mut out_out,
4284                )
4285                .set(
4286                    "width",
4287                    width,
4288                )
4289                .set(
4290                    "height",
4291                    height,
4292                ),
4293        );
4294
4295        utils::result(
4296            vips_op_response,
4297            out_out,
4298            Error::OperationError("Eye (vips_eye) failed".to_string()),
4299        )
4300    }
4301
4302    /// VipsEye (eye), make an image showing the eye's spatial response
4303    /// returns `VipsImage` - Output image
4304    ///
4305    /// width: `i32` -> Image width in pixels
4306    ///
4307    /// height: `i32` -> Image height in pixels
4308    ///
4309    /// <ins>Optional arguments</ins>
4310    ///
4311    /// uchar: `bool` -> Output an unsigned char image
4312    ///
4313    /// factor: `f64` -> Maximum spatial frequency
4314    pub fn eye_with_opts(width: i32, height: i32, option: VOption) -> Result<VipsImage> {
4315        let mut out_out = VipsImage::from(null_mut());
4316        let vips_op_response = call(
4317            "eye",
4318            option
4319                .set(
4320                    "out",
4321                    &mut out_out,
4322                )
4323                .set(
4324                    "width",
4325                    width,
4326                )
4327                .set(
4328                    "height",
4329                    height,
4330                ),
4331        );
4332
4333        utils::result(
4334            vips_op_response,
4335            out_out,
4336            Error::OperationError("Eye (vips_eye) failed".to_string()),
4337        )
4338    }
4339
4340    /// VipsFalsecolour (falsecolour), false-color an image
4341    /// returns `VipsImage` - Output image
4342    pub fn falsecolour(&self) -> Result<VipsImage> {
4343        let mut out_out = VipsImage::from(null_mut());
4344        let vips_op_response = call(
4345            "falsecolour",
4346            VOption::new()
4347                .set("in", self)
4348                .set(
4349                    "out",
4350                    &mut out_out,
4351                ),
4352        );
4353
4354        utils::result(
4355            vips_op_response,
4356            out_out,
4357            Error::OperationError("Falsecolour (vips_falsecolour) failed".to_string()),
4358        )
4359    }
4360
4361    /// VipsFastcor (fastcor), fast correlation
4362    /// returns `VipsImage` - Output image
4363    ///
4364    /// refp: `&VipsImage` -> Input reference image
4365    pub fn fastcor(&self, refp: &VipsImage) -> Result<VipsImage> {
4366        let mut out_out = VipsImage::from(null_mut());
4367        let vips_op_response = call(
4368            "fastcor",
4369            VOption::new()
4370                .set("in", self)
4371                .set(
4372                    "ref", refp,
4373                )
4374                .set(
4375                    "out",
4376                    &mut out_out,
4377                ),
4378        );
4379
4380        utils::result(
4381            vips_op_response,
4382            out_out,
4383            Error::OperationError("Fastcor (vips_fastcor) failed".to_string()),
4384        )
4385    }
4386
4387    /// VipsFillNearest (fill_nearest), fill image zeros with nearest non-zero pixel
4388    /// returns `VipsImage` - Value of nearest non-zero pixel
4389    pub fn fill_nearest(&self) -> Result<VipsImage> {
4390        let mut out_out = VipsImage::from(null_mut());
4391        let vips_op_response = call(
4392            "fill_nearest",
4393            VOption::new()
4394                .set("in", self)
4395                .set(
4396                    "out",
4397                    &mut out_out,
4398                ),
4399        );
4400
4401        utils::result(
4402            vips_op_response,
4403            out_out,
4404            Error::OperationError("FillNearest (vips_fill_nearest) failed".to_string()),
4405        )
4406    }
4407
4408    /// VipsFillNearest (fill_nearest), fill image zeros with nearest non-zero pixel
4409    /// returns `VipsImage` - Value of nearest non-zero pixel
4410    ///
4411    /// <ins>Optional arguments</ins>
4412    ///
4413    /// distance: `&mut VipsImage` -> Distance to nearest non-zero pixel
4414    pub fn fill_nearest_with_opts(&self, option: VOption) -> Result<VipsImage> {
4415        let mut out_out = VipsImage::from(null_mut());
4416        let vips_op_response = call(
4417            "fill_nearest",
4418            option
4419                .set("in", self)
4420                .set(
4421                    "out",
4422                    &mut out_out,
4423                ),
4424        );
4425
4426        utils::result(
4427            vips_op_response,
4428            out_out,
4429            Error::OperationError("FillNearest (vips_fill_nearest) failed".to_string()),
4430        )
4431    }
4432
4433    /// VipsFindTrim (find_trim), search an image for non-edge areas
4434    /// Tuple (
4435    /// i32 - Left edge of image
4436    /// i32 - Top edge of extract area
4437    /// i32 - Width of extract area
4438    /// i32 - Height of extract area
4439    ///)
4440    pub fn find_trim(
4441        &self,
4442    ) -> Result<(
4443        i32,
4444        i32,
4445        i32,
4446        i32,
4447    )> {
4448        let mut left_out: i32 = 1;
4449        let mut top_out: i32 = 0;
4450        let mut width_out: i32 = 1;
4451        let mut height_out: i32 = 1;
4452        let vips_op_response = call(
4453            "find_trim",
4454            VOption::new()
4455                .set("in", self)
4456                .set(
4457                    "left",
4458                    &mut left_out,
4459                )
4460                .set(
4461                    "top",
4462                    &mut top_out,
4463                )
4464                .set(
4465                    "width",
4466                    &mut width_out,
4467                )
4468                .set(
4469                    "height",
4470                    &mut height_out,
4471                ),
4472        );
4473
4474        utils::result(
4475            vips_op_response,
4476            (
4477                left_out,
4478                top_out,
4479                width_out,
4480                height_out,
4481            ),
4482            Error::OperationError("FindTrim (vips_find_trim) failed".to_string()),
4483        )
4484    }
4485
4486    /// VipsFindTrim (find_trim), search an image for non-edge areas
4487    /// Tuple (
4488    /// i32 - Left edge of image
4489    /// i32 - Top edge of extract area
4490    /// i32 - Width of extract area
4491    /// i32 - Height of extract area
4492    ///)
4493    ///
4494    /// <ins>Optional arguments</ins>
4495    ///
4496    /// threshold: `f64` -> Object threshold
4497    ///
4498    /// background: `&[f64]` -> Color for background pixels
4499    ///
4500    /// line_art: `bool` -> Enable line art mode
4501    pub fn find_trim_with_opts(
4502        &self,
4503        option: VOption,
4504    ) -> Result<(
4505        i32,
4506        i32,
4507        i32,
4508        i32,
4509    )> {
4510        let mut left_out: i32 = 1;
4511        let mut top_out: i32 = 0;
4512        let mut width_out: i32 = 1;
4513        let mut height_out: i32 = 1;
4514        let vips_op_response = call(
4515            "find_trim",
4516            option
4517                .set("in", self)
4518                .set(
4519                    "left",
4520                    &mut left_out,
4521                )
4522                .set(
4523                    "top",
4524                    &mut top_out,
4525                )
4526                .set(
4527                    "width",
4528                    &mut width_out,
4529                )
4530                .set(
4531                    "height",
4532                    &mut height_out,
4533                ),
4534        );
4535
4536        utils::result(
4537            vips_op_response,
4538            (
4539                left_out,
4540                top_out,
4541                width_out,
4542                height_out,
4543            ),
4544            Error::OperationError("FindTrim (vips_find_trim) failed".to_string()),
4545        )
4546    }
4547
4548    /// VipsForeignLoadFitsFile (fitsload), load a FITS image (.fits, .fit, .fts), priority=-50, untrusted, is_a, get_flags, get_flags_filename, header, load
4549    /// returns `VipsImage` - Output image
4550    ///
4551    /// filename: `&str` -> Filename to load from
4552    pub fn fitsload(filename: &str) -> Result<VipsImage> {
4553        let mut out_out = VipsImage::from(null_mut());
4554        let vips_op_response = call(
4555            "fitsload",
4556            VOption::new()
4557                .set(
4558                    "filename",
4559                    filename,
4560                )
4561                .set(
4562                    "out",
4563                    &mut out_out,
4564                ),
4565        );
4566
4567        utils::result(
4568            vips_op_response,
4569            out_out,
4570            Error::OperationError("Fitsload (vips_fitsload) failed".to_string()),
4571        )
4572    }
4573
4574    /// VipsForeignLoadFitsFile (fitsload), load a FITS image (.fits, .fit, .fts), priority=-50, untrusted, is_a, get_flags, get_flags_filename, header, load
4575    /// returns `VipsImage` - Output image
4576    ///
4577    /// filename: `&str` -> Filename to load from
4578    ///
4579    /// <ins>Optional arguments</ins>
4580    ///
4581    /// flags: [`ForeignFlags`] -> Flags for this file
4582    ///
4583    /// memory: `bool` -> Force open via memory
4584    ///
4585    /// access: [`Access`] -> Required access pattern for this file
4586    ///
4587    /// fail_on: [`FailOn`] -> Error level to fail on
4588    ///
4589    /// revalidate: `bool` -> Don't use a cached result for this operation
4590    pub fn fitsload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
4591        let mut out_out = VipsImage::from(null_mut());
4592        let vips_op_response = call(
4593            "fitsload",
4594            option
4595                .set(
4596                    "filename",
4597                    filename,
4598                )
4599                .set(
4600                    "out",
4601                    &mut out_out,
4602                ),
4603        );
4604
4605        utils::result(
4606            vips_op_response,
4607            out_out,
4608            Error::OperationError("Fitsload (vips_fitsload) failed".to_string()),
4609        )
4610    }
4611
4612    /// VipsForeignLoadFitsSource (fitsload_source), load FITS from a source, priority=-50, untrusted, is_a, is_a_source, get_flags, get_flags_filename, header, load
4613    /// returns `VipsImage` - Output image
4614    ///
4615    /// source: `&VipsSource` -> Source to load from
4616    pub fn fitsload_source(source: &VipsSource) -> Result<VipsImage> {
4617        let mut out_out = VipsImage::from(null_mut());
4618        let vips_op_response = call(
4619            "fitsload_source",
4620            VOption::new()
4621                .set(
4622                    "source",
4623                    source,
4624                )
4625                .set(
4626                    "out",
4627                    &mut out_out,
4628                ),
4629        );
4630
4631        utils::result(
4632            vips_op_response,
4633            out_out,
4634            Error::OperationError("FitsloadSource (vips_fitsload_source) failed".to_string()),
4635        )
4636    }
4637
4638    /// VipsForeignLoadFitsSource (fitsload_source), load FITS from a source, priority=-50, untrusted, is_a, is_a_source, get_flags, get_flags_filename, header, load
4639    /// returns `VipsImage` - Output image
4640    ///
4641    /// source: `&VipsSource` -> Source to load from
4642    ///
4643    /// <ins>Optional arguments</ins>
4644    ///
4645    /// flags: [`ForeignFlags`] -> Flags for this file
4646    ///
4647    /// memory: `bool` -> Force open via memory
4648    ///
4649    /// access: [`Access`] -> Required access pattern for this file
4650    ///
4651    /// fail_on: [`FailOn`] -> Error level to fail on
4652    ///
4653    /// revalidate: `bool` -> Don't use a cached result for this operation
4654    pub fn fitsload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
4655        let mut out_out = VipsImage::from(null_mut());
4656        let vips_op_response = call(
4657            "fitsload_source",
4658            option
4659                .set(
4660                    "source",
4661                    source,
4662                )
4663                .set(
4664                    "out",
4665                    &mut out_out,
4666                ),
4667        );
4668
4669        utils::result(
4670            vips_op_response,
4671            out_out,
4672            Error::OperationError("FitsloadSource (vips_fitsload_source) failed".to_string()),
4673        )
4674    }
4675
4676    /// VipsForeignSaveFits (fitssave), save image to fits file (.fits, .fit, .fts), priority=0, untrusted,
4677    ///
4678    /// filename: `&str` -> Filename to save to
4679    pub fn fitssave(&self, filename: &str) -> Result<()> {
4680        let vips_op_response = call(
4681            "fitssave",
4682            VOption::new()
4683                .set("in", self)
4684                .set(
4685                    "filename",
4686                    filename,
4687                ),
4688        );
4689
4690        utils::result(
4691            vips_op_response,
4692            (),
4693            Error::OperationError("Fitssave (vips_fitssave) failed".to_string()),
4694        )
4695    }
4696
4697    /// VipsForeignSaveFits (fitssave), save image to fits file (.fits, .fit, .fts), priority=0, untrusted,
4698    ///
4699    /// filename: `&str` -> Filename to save to
4700    ///
4701    /// <ins>Optional arguments</ins>
4702    ///
4703    /// keep: [`ForeignKeep`] -> Which metadata to retain
4704    ///
4705    /// background: `&[f64]` -> Background value
4706    ///
4707    /// page_height: `i32` -> Set page height for multipage save
4708    ///
4709    /// profile: `&str` -> Filename of ICC profile to embed
4710    pub fn fitssave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
4711        let vips_op_response = call(
4712            "fitssave",
4713            option
4714                .set("in", self)
4715                .set(
4716                    "filename",
4717                    filename,
4718                ),
4719        );
4720
4721        utils::result(
4722            vips_op_response,
4723            (),
4724            Error::OperationError("Fitssave (vips_fitssave) failed".to_string()),
4725        )
4726    }
4727
4728    /// VipsFlatten (flatten), flatten alpha out of an image
4729    /// returns `VipsImage` - Output image
4730    pub fn flatten(&self) -> Result<VipsImage> {
4731        let mut out_out = VipsImage::from(null_mut());
4732        let vips_op_response = call(
4733            "flatten",
4734            VOption::new()
4735                .set("in", self)
4736                .set(
4737                    "out",
4738                    &mut out_out,
4739                ),
4740        );
4741
4742        utils::result(
4743            vips_op_response,
4744            out_out,
4745            Error::OperationError("Flatten (vips_flatten) failed".to_string()),
4746        )
4747    }
4748
4749    /// VipsFlatten (flatten), flatten alpha out of an image
4750    /// returns `VipsImage` - Output image
4751    ///
4752    /// <ins>Optional arguments</ins>
4753    ///
4754    /// background: `&[f64]` -> Background value
4755    ///
4756    /// max_alpha: `f64` -> Maximum value of alpha channel
4757    pub fn flatten_with_opts(&self, option: VOption) -> Result<VipsImage> {
4758        let mut out_out = VipsImage::from(null_mut());
4759        let vips_op_response = call(
4760            "flatten",
4761            option
4762                .set("in", self)
4763                .set(
4764                    "out",
4765                    &mut out_out,
4766                ),
4767        );
4768
4769        utils::result(
4770            vips_op_response,
4771            out_out,
4772            Error::OperationError("Flatten (vips_flatten) failed".to_string()),
4773        )
4774    }
4775
4776    /// VipsFlip (flip), flip an image
4777    /// returns `VipsImage` - Output image
4778    ///
4779    /// direction: `Direction` -> Direction to flip image
4780    pub fn flip(&self, direction: Direction) -> Result<VipsImage> {
4781        let mut out_out = VipsImage::from(null_mut());
4782        let vips_op_response = call(
4783            "flip",
4784            VOption::new()
4785                .set("in", self)
4786                .set(
4787                    "out",
4788                    &mut out_out,
4789                )
4790                .set(
4791                    "direction",
4792                    direction as i32,
4793                ),
4794        );
4795
4796        utils::result(
4797            vips_op_response,
4798            out_out,
4799            Error::OperationError("Flip (vips_flip) failed".to_string()),
4800        )
4801    }
4802
4803    /// VipsFloat2rad (float2rad), transform float RGB to Radiance coding
4804    /// returns `VipsImage` - Output image
4805    pub fn float2rad(&self) -> Result<VipsImage> {
4806        let mut out_out = VipsImage::from(null_mut());
4807        let vips_op_response = call(
4808            "float2rad",
4809            VOption::new()
4810                .set("in", self)
4811                .set(
4812                    "out",
4813                    &mut out_out,
4814                ),
4815        );
4816
4817        utils::result(
4818            vips_op_response,
4819            out_out,
4820            Error::OperationError("Float2Rad (vips_float2rad) failed".to_string()),
4821        )
4822    }
4823
4824    /// VipsFractsurf (fractsurf), make a fractal surface
4825    /// returns `VipsImage` - Output image
4826    ///
4827    /// width: `i32` -> Image width in pixels
4828    ///
4829    /// height: `i32` -> Image height in pixels
4830    ///
4831    /// fractal_dimension: `f64` -> Fractal dimension
4832    pub fn fractsurf(width: i32, height: i32, fractal_dimension: f64) -> Result<VipsImage> {
4833        let mut out_out = VipsImage::from(null_mut());
4834        let vips_op_response = call(
4835            "fractsurf",
4836            VOption::new()
4837                .set(
4838                    "out",
4839                    &mut out_out,
4840                )
4841                .set(
4842                    "width",
4843                    width,
4844                )
4845                .set(
4846                    "height",
4847                    height,
4848                )
4849                .set(
4850                    "fractal-dimension",
4851                    fractal_dimension,
4852                ),
4853        );
4854
4855        utils::result(
4856            vips_op_response,
4857            out_out,
4858            Error::OperationError("Fractsurf (vips_fractsurf) failed".to_string()),
4859        )
4860    }
4861
4862    /// VipsFreqmult (freqmult), frequency-domain filtering
4863    /// returns `VipsImage` - Output image
4864    ///
4865    /// mask: `&VipsImage` -> Input mask image
4866    pub fn freqmult(&self, mask: &VipsImage) -> Result<VipsImage> {
4867        let mut out_out = VipsImage::from(null_mut());
4868        let vips_op_response = call(
4869            "freqmult",
4870            VOption::new()
4871                .set("in", self)
4872                .set(
4873                    "mask",
4874                    mask,
4875                )
4876                .set(
4877                    "out",
4878                    &mut out_out,
4879                ),
4880        );
4881
4882        utils::result(
4883            vips_op_response,
4884            out_out,
4885            Error::OperationError("Freqmult (vips_freqmult) failed".to_string()),
4886        )
4887    }
4888
4889    /// VipsFwfft (fwfft), forward FFT
4890    /// returns `VipsImage` - Output image
4891    pub fn fwfft(&self) -> Result<VipsImage> {
4892        let mut out_out = VipsImage::from(null_mut());
4893        let vips_op_response = call(
4894            "fwfft",
4895            VOption::new()
4896                .set("in", self)
4897                .set(
4898                    "out",
4899                    &mut out_out,
4900                ),
4901        );
4902
4903        utils::result(
4904            vips_op_response,
4905            out_out,
4906            Error::OperationError("Fwfft (vips_fwfft) failed".to_string()),
4907        )
4908    }
4909
4910    /// VipsGamma (gamma), gamma an image
4911    /// returns `VipsImage` - Output image
4912    pub fn gamma(&self) -> Result<VipsImage> {
4913        let mut out_out = VipsImage::from(null_mut());
4914        let vips_op_response = call(
4915            "gamma",
4916            VOption::new()
4917                .set("in", self)
4918                .set(
4919                    "out",
4920                    &mut out_out,
4921                ),
4922        );
4923
4924        utils::result(
4925            vips_op_response,
4926            out_out,
4927            Error::OperationError("Gamma (vips_gamma) failed".to_string()),
4928        )
4929    }
4930
4931    /// VipsGamma (gamma), gamma an image
4932    /// returns `VipsImage` - Output image
4933    ///
4934    /// <ins>Optional arguments</ins>
4935    ///
4936    /// exponent: `f64` -> Gamma factor
4937    pub fn gamma_with_opts(&self, option: VOption) -> Result<VipsImage> {
4938        let mut out_out = VipsImage::from(null_mut());
4939        let vips_op_response = call(
4940            "gamma",
4941            option
4942                .set("in", self)
4943                .set(
4944                    "out",
4945                    &mut out_out,
4946                ),
4947        );
4948
4949        utils::result(
4950            vips_op_response,
4951            out_out,
4952            Error::OperationError("Gamma (vips_gamma) failed".to_string()),
4953        )
4954    }
4955
4956    /// VipsGaussblur (gaussblur), gaussian blur
4957    /// returns `VipsImage` - Output image
4958    ///
4959    /// sigma: `f64` -> Sigma of Gaussian
4960    pub fn gaussblur(&self, sigma: f64) -> Result<VipsImage> {
4961        let mut out_out = VipsImage::from(null_mut());
4962        let vips_op_response = call(
4963            "gaussblur",
4964            VOption::new()
4965                .set("in", self)
4966                .set(
4967                    "out",
4968                    &mut out_out,
4969                )
4970                .set(
4971                    "sigma",
4972                    sigma,
4973                ),
4974        );
4975
4976        utils::result(
4977            vips_op_response,
4978            out_out,
4979            Error::OperationError("Gaussblur (vips_gaussblur) failed".to_string()),
4980        )
4981    }
4982
4983    /// VipsGaussblur (gaussblur), gaussian blur
4984    /// returns `VipsImage` - Output image
4985    ///
4986    /// sigma: `f64` -> Sigma of Gaussian
4987    ///
4988    /// <ins>Optional arguments</ins>
4989    ///
4990    /// min_ampl: `f64` -> Minimum amplitude of Gaussian
4991    ///
4992    /// precision: [`Precision`] -> Convolve with this precision
4993    pub fn gaussblur_with_opts(&self, sigma: f64, option: VOption) -> Result<VipsImage> {
4994        let mut out_out = VipsImage::from(null_mut());
4995        let vips_op_response = call(
4996            "gaussblur",
4997            option
4998                .set("in", self)
4999                .set(
5000                    "out",
5001                    &mut out_out,
5002                )
5003                .set(
5004                    "sigma",
5005                    sigma,
5006                ),
5007        );
5008
5009        utils::result(
5010            vips_op_response,
5011            out_out,
5012            Error::OperationError("Gaussblur (vips_gaussblur) failed".to_string()),
5013        )
5014    }
5015
5016    /// VipsGaussmat (gaussmat), make a gaussian image
5017    /// returns `VipsImage` - Output image
5018    ///
5019    /// sigma: `f64` -> Sigma of Gaussian
5020    ///
5021    /// min_ampl: `f64` -> Minimum amplitude of Gaussian
5022    pub fn gaussmat(sigma: f64, min_ampl: f64) -> Result<VipsImage> {
5023        let mut out_out = VipsImage::from(null_mut());
5024        let vips_op_response = call(
5025            "gaussmat",
5026            VOption::new()
5027                .set(
5028                    "out",
5029                    &mut out_out,
5030                )
5031                .set(
5032                    "sigma",
5033                    sigma,
5034                )
5035                .set(
5036                    "min-ampl",
5037                    min_ampl,
5038                ),
5039        );
5040
5041        utils::result(
5042            vips_op_response,
5043            out_out,
5044            Error::OperationError("Gaussmat (vips_gaussmat) failed".to_string()),
5045        )
5046    }
5047
5048    /// VipsGaussmat (gaussmat), make a gaussian image
5049    /// returns `VipsImage` - Output image
5050    ///
5051    /// sigma: `f64` -> Sigma of Gaussian
5052    ///
5053    /// min_ampl: `f64` -> Minimum amplitude of Gaussian
5054    ///
5055    /// <ins>Optional arguments</ins>
5056    ///
5057    /// separable: `bool` -> Generate separable Gaussian
5058    ///
5059    /// precision: [`Precision`] -> Generate with this precision
5060    pub fn gaussmat_with_opts(sigma: f64, min_ampl: f64, option: VOption) -> Result<VipsImage> {
5061        let mut out_out = VipsImage::from(null_mut());
5062        let vips_op_response = call(
5063            "gaussmat",
5064            option
5065                .set(
5066                    "out",
5067                    &mut out_out,
5068                )
5069                .set(
5070                    "sigma",
5071                    sigma,
5072                )
5073                .set(
5074                    "min-ampl",
5075                    min_ampl,
5076                ),
5077        );
5078
5079        utils::result(
5080            vips_op_response,
5081            out_out,
5082            Error::OperationError("Gaussmat (vips_gaussmat) failed".to_string()),
5083        )
5084    }
5085
5086    /// VipsGaussnoise (gaussnoise), make a gaussnoise image
5087    /// returns `VipsImage` - Output image
5088    ///
5089    /// width: `i32` -> Image width in pixels
5090    ///
5091    /// height: `i32` -> Image height in pixels
5092    pub fn gaussnoise(width: i32, height: i32) -> Result<VipsImage> {
5093        let mut out_out = VipsImage::from(null_mut());
5094        let vips_op_response = call(
5095            "gaussnoise",
5096            VOption::new()
5097                .set(
5098                    "out",
5099                    &mut out_out,
5100                )
5101                .set(
5102                    "width",
5103                    width,
5104                )
5105                .set(
5106                    "height",
5107                    height,
5108                ),
5109        );
5110
5111        utils::result(
5112            vips_op_response,
5113            out_out,
5114            Error::OperationError("Gaussnoise (vips_gaussnoise) failed".to_string()),
5115        )
5116    }
5117
5118    /// VipsGaussnoise (gaussnoise), make a gaussnoise image
5119    /// returns `VipsImage` - Output image
5120    ///
5121    /// width: `i32` -> Image width in pixels
5122    ///
5123    /// height: `i32` -> Image height in pixels
5124    ///
5125    /// <ins>Optional arguments</ins>
5126    ///
5127    /// sigma: `f64` -> Standard deviation of pixels in generated image
5128    ///
5129    /// mean: `f64` -> Mean of pixels in generated image
5130    ///
5131    /// seed: `i32` -> Random number seed
5132    pub fn gaussnoise_with_opts(width: i32, height: i32, option: VOption) -> Result<VipsImage> {
5133        let mut out_out = VipsImage::from(null_mut());
5134        let vips_op_response = call(
5135            "gaussnoise",
5136            option
5137                .set(
5138                    "out",
5139                    &mut out_out,
5140                )
5141                .set(
5142                    "width",
5143                    width,
5144                )
5145                .set(
5146                    "height",
5147                    height,
5148                ),
5149        );
5150
5151        utils::result(
5152            vips_op_response,
5153            out_out,
5154            Error::OperationError("Gaussnoise (vips_gaussnoise) failed".to_string()),
5155        )
5156    }
5157
5158    /// VipsGetpoint (getpoint), read a point from an image
5159    /// returns `Vec<f64>` - Array of output values
5160    ///
5161    /// x: `i32` -> Point to read
5162    ///
5163    /// y: `i32` -> Point to read
5164    pub fn getpoint(&self, x: i32, y: i32) -> Result<Vec<f64>> {
5165        let mut out_array_out: Vec<f64> = Vec::new();
5166        let vips_op_response = call(
5167            "getpoint",
5168            VOption::new()
5169                .set("in", self)
5170                .set(
5171                    "out-array",
5172                    &mut out_array_out,
5173                )
5174                .set("x", x)
5175                .set("y", y),
5176        );
5177
5178        utils::result(
5179            vips_op_response,
5180            out_array_out,
5181            Error::OperationError("Getpoint (vips_getpoint) failed".to_string()),
5182        )
5183    }
5184
5185    /// VipsGetpoint (getpoint), read a point from an image
5186    /// returns `Vec<f64>` - Array of output values
5187    ///
5188    /// x: `i32` -> Point to read
5189    ///
5190    /// y: `i32` -> Point to read
5191    ///
5192    /// <ins>Optional arguments</ins>
5193    ///
5194    /// unpack_complex: `bool` -> Complex pixels should be unpacked
5195    pub fn getpoint_with_opts(&self, x: i32, y: i32, option: VOption) -> Result<Vec<f64>> {
5196        let mut out_array_out: Vec<f64> = Vec::new();
5197        let vips_op_response = call(
5198            "getpoint",
5199            option
5200                .set("in", self)
5201                .set(
5202                    "out-array",
5203                    &mut out_array_out,
5204                )
5205                .set("x", x)
5206                .set("y", y),
5207        );
5208
5209        utils::result(
5210            vips_op_response,
5211            out_array_out,
5212            Error::OperationError("Getpoint (vips_getpoint) failed".to_string()),
5213        )
5214    }
5215
5216    /// VipsForeignLoadNsgifFile (gifload), load GIF with libnsgif (.gif), priority=50, is_a, get_flags, get_flags_filename, header, load
5217    /// returns `VipsImage` - Output image
5218    ///
5219    /// filename: `&str` -> Filename to load from
5220    pub fn gifload(filename: &str) -> Result<VipsImage> {
5221        let mut out_out = VipsImage::from(null_mut());
5222        let vips_op_response = call(
5223            "gifload",
5224            VOption::new()
5225                .set(
5226                    "filename",
5227                    filename,
5228                )
5229                .set(
5230                    "out",
5231                    &mut out_out,
5232                ),
5233        );
5234
5235        utils::result(
5236            vips_op_response,
5237            out_out,
5238            Error::OperationError("Gifload (vips_gifload) failed".to_string()),
5239        )
5240    }
5241
5242    /// VipsForeignLoadNsgifFile (gifload), load GIF with libnsgif (.gif), priority=50, is_a, get_flags, get_flags_filename, header, load
5243    /// returns `VipsImage` - Output image
5244    ///
5245    /// filename: `&str` -> Filename to load from
5246    ///
5247    /// <ins>Optional arguments</ins>
5248    ///
5249    /// n: `i32` -> Number of pages to load, -1 for all
5250    ///
5251    /// page: `i32` -> First page to load
5252    ///
5253    /// flags: [`ForeignFlags`] -> Flags for this file
5254    ///
5255    /// memory: `bool` -> Force open via memory
5256    ///
5257    /// access: [`Access`] -> Required access pattern for this file
5258    ///
5259    /// fail_on: [`FailOn`] -> Error level to fail on
5260    ///
5261    /// revalidate: `bool` -> Don't use a cached result for this operation
5262    pub fn gifload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
5263        let mut out_out = VipsImage::from(null_mut());
5264        let vips_op_response = call(
5265            "gifload",
5266            option
5267                .set(
5268                    "filename",
5269                    filename,
5270                )
5271                .set(
5272                    "out",
5273                    &mut out_out,
5274                ),
5275        );
5276
5277        utils::result(
5278            vips_op_response,
5279            out_out,
5280            Error::OperationError("Gifload (vips_gifload) failed".to_string()),
5281        )
5282    }
5283
5284    /// VipsForeignLoadNsgifBuffer (gifload_buffer), load GIF with libnsgif, priority=50, is_a_buffer, get_flags, get_flags_filename, header, load
5285    /// returns `VipsImage` - Output image
5286    ///
5287    /// buffer: `&[u8]` -> Buffer to load from
5288    pub fn gifload_buffer(buffer: &[u8]) -> Result<VipsImage> {
5289        let blob = unsafe {
5290            vips_blob_new(
5291                None,
5292                buffer.as_ptr() as _,
5293                buffer.len() as _,
5294            )
5295        };
5296        let mut out_out = VipsImage::from(null_mut());
5297        let vips_op_response = call(
5298            "gifload_buffer",
5299            VOption::new()
5300                .set(
5301                    "buffer",
5302                    &VipsBlob::from(blob),
5303                )
5304                .set(
5305                    "out",
5306                    &mut out_out,
5307                ),
5308        );
5309        unsafe { vips_area_unref(&mut (*blob).area) };
5310        utils::result(
5311            vips_op_response,
5312            out_out,
5313            Error::OperationError("GifloadBuffer (vips_gifload_buffer) failed".to_string()),
5314        )
5315    }
5316
5317    /// VipsForeignLoadNsgifBuffer (gifload_buffer), load GIF with libnsgif, priority=50, is_a_buffer, get_flags, get_flags_filename, header, load
5318    /// returns `VipsImage` - Output image
5319    ///
5320    /// buffer: `&[u8]` -> Buffer to load from
5321    ///
5322    /// <ins>Optional arguments</ins>
5323    ///
5324    /// n: `i32` -> Number of pages to load, -1 for all
5325    ///
5326    /// page: `i32` -> First page to load
5327    ///
5328    /// flags: [`ForeignFlags`] -> Flags for this file
5329    ///
5330    /// memory: `bool` -> Force open via memory
5331    ///
5332    /// access: [`Access`] -> Required access pattern for this file
5333    ///
5334    /// fail_on: [`FailOn`] -> Error level to fail on
5335    ///
5336    /// revalidate: `bool` -> Don't use a cached result for this operation
5337    pub fn gifload_buffer_with_opts(buffer: &[u8], option: VOption) -> Result<VipsImage> {
5338        let blob = unsafe {
5339            vips_blob_new(
5340                None,
5341                buffer.as_ptr() as _,
5342                buffer.len() as _,
5343            )
5344        };
5345        let mut out_out = VipsImage::from(null_mut());
5346        let vips_op_response = call(
5347            "gifload_buffer",
5348            option
5349                .set(
5350                    "buffer",
5351                    &VipsBlob::from(blob),
5352                )
5353                .set(
5354                    "out",
5355                    &mut out_out,
5356                ),
5357        );
5358        unsafe { vips_area_unref(&mut (*blob).area) };
5359        utils::result(
5360            vips_op_response,
5361            out_out,
5362            Error::OperationError("GifloadBuffer (vips_gifload_buffer) failed".to_string()),
5363        )
5364    }
5365
5366    /// VipsForeignLoadNsgifSource (gifload_source), load gif from source, priority=50, is_a_source, get_flags, get_flags_filename, header, load
5367    /// returns `VipsImage` - Output image
5368    ///
5369    /// source: `&VipsSource` -> Source to load from
5370    pub fn gifload_source(source: &VipsSource) -> Result<VipsImage> {
5371        let mut out_out = VipsImage::from(null_mut());
5372        let vips_op_response = call(
5373            "gifload_source",
5374            VOption::new()
5375                .set(
5376                    "source",
5377                    source,
5378                )
5379                .set(
5380                    "out",
5381                    &mut out_out,
5382                ),
5383        );
5384
5385        utils::result(
5386            vips_op_response,
5387            out_out,
5388            Error::OperationError("GifloadSource (vips_gifload_source) failed".to_string()),
5389        )
5390    }
5391
5392    /// VipsForeignLoadNsgifSource (gifload_source), load gif from source, priority=50, is_a_source, get_flags, get_flags_filename, header, load
5393    /// returns `VipsImage` - Output image
5394    ///
5395    /// source: `&VipsSource` -> Source to load from
5396    ///
5397    /// <ins>Optional arguments</ins>
5398    ///
5399    /// n: `i32` -> Number of pages to load, -1 for all
5400    ///
5401    /// page: `i32` -> First page to load
5402    ///
5403    /// flags: [`ForeignFlags`] -> Flags for this file
5404    ///
5405    /// memory: `bool` -> Force open via memory
5406    ///
5407    /// access: [`Access`] -> Required access pattern for this file
5408    ///
5409    /// fail_on: [`FailOn`] -> Error level to fail on
5410    ///
5411    /// revalidate: `bool` -> Don't use a cached result for this operation
5412    pub fn gifload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
5413        let mut out_out = VipsImage::from(null_mut());
5414        let vips_op_response = call(
5415            "gifload_source",
5416            option
5417                .set(
5418                    "source",
5419                    source,
5420                )
5421                .set(
5422                    "out",
5423                    &mut out_out,
5424                ),
5425        );
5426
5427        utils::result(
5428            vips_op_response,
5429            out_out,
5430            Error::OperationError("GifloadSource (vips_gifload_source) failed".to_string()),
5431        )
5432    }
5433
5434    /// VipsForeignSaveCgifFile (gifsave), save as gif (.gif), priority=0, rgb alpha
5435    ///
5436    /// filename: `&str` -> Filename to save to
5437    pub fn gifsave(&self, filename: &str) -> Result<()> {
5438        let vips_op_response = call(
5439            "gifsave",
5440            VOption::new()
5441                .set("in", self)
5442                .set(
5443                    "filename",
5444                    filename,
5445                ),
5446        );
5447
5448        utils::result(
5449            vips_op_response,
5450            (),
5451            Error::OperationError("Gifsave (vips_gifsave) failed".to_string()),
5452        )
5453    }
5454
5455    /// VipsForeignSaveCgifFile (gifsave), save as gif (.gif), priority=0, rgb alpha
5456    ///
5457    /// filename: `&str` -> Filename to save to
5458    ///
5459    /// <ins>Optional arguments</ins>
5460    ///
5461    /// dither: `f64` -> Amount of dithering
5462    ///
5463    /// effort: `i32` -> Quantisation effort
5464    ///
5465    /// bitdepth: `i32` -> Number of bits per pixel
5466    ///
5467    /// interframe_maxerror: `f64` -> Maximum inter-frame error for transparency
5468    ///
5469    /// reuse: `bool` -> Reuse palette from input
5470    ///
5471    /// interpalette_maxerror: `f64` -> Maximum inter-palette error for palette reusage
5472    ///
5473    /// interlace: `bool` -> Generate an interlaced (progressive) GIF
5474    ///
5475    /// keep_duplicate_frames: `bool` -> Keep duplicate frames in the output instead of combining them
5476    ///
5477    /// keep: [`ForeignKeep`] -> Which metadata to retain
5478    ///
5479    /// background: `&[f64]` -> Background value
5480    ///
5481    /// page_height: `i32` -> Set page height for multipage save
5482    ///
5483    /// profile: `&str` -> Filename of ICC profile to embed
5484    pub fn gifsave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
5485        let vips_op_response = call(
5486            "gifsave",
5487            option
5488                .set("in", self)
5489                .set(
5490                    "filename",
5491                    filename,
5492                ),
5493        );
5494
5495        utils::result(
5496            vips_op_response,
5497            (),
5498            Error::OperationError("Gifsave (vips_gifsave) failed".to_string()),
5499        )
5500    }
5501
5502    /// VipsForeignSaveCgifBuffer (gifsave_buffer), save as gif (.gif), priority=0, rgb alpha
5503    /// returns `Vec<u8>` - Buffer to save to
5504    pub fn gifsave_buffer(&self) -> Result<Vec<u8>> {
5505        let mut buffer_out = VipsBlob::from(null_mut());
5506        let vips_op_response = call(
5507            "gifsave_buffer",
5508            VOption::new()
5509                .set("in", self)
5510                .set(
5511                    "buffer",
5512                    &mut buffer_out,
5513                ),
5514        );
5515
5516        utils::result(
5517            vips_op_response,
5518            buffer_out.into(),
5519            Error::OperationError("GifsaveBuffer (vips_gifsave_buffer) failed".to_string()),
5520        )
5521    }
5522
5523    /// VipsForeignSaveCgifBuffer (gifsave_buffer), save as gif (.gif), priority=0, rgb alpha
5524    /// returns `Vec<u8>` - Buffer to save to
5525    ///
5526    /// <ins>Optional arguments</ins>
5527    ///
5528    /// dither: `f64` -> Amount of dithering
5529    ///
5530    /// effort: `i32` -> Quantisation effort
5531    ///
5532    /// bitdepth: `i32` -> Number of bits per pixel
5533    ///
5534    /// interframe_maxerror: `f64` -> Maximum inter-frame error for transparency
5535    ///
5536    /// reuse: `bool` -> Reuse palette from input
5537    ///
5538    /// interpalette_maxerror: `f64` -> Maximum inter-palette error for palette reusage
5539    ///
5540    /// interlace: `bool` -> Generate an interlaced (progressive) GIF
5541    ///
5542    /// keep_duplicate_frames: `bool` -> Keep duplicate frames in the output instead of combining them
5543    ///
5544    /// keep: [`ForeignKeep`] -> Which metadata to retain
5545    ///
5546    /// background: `&[f64]` -> Background value
5547    ///
5548    /// page_height: `i32` -> Set page height for multipage save
5549    ///
5550    /// profile: `&str` -> Filename of ICC profile to embed
5551    pub fn gifsave_buffer_with_opts(&self, option: VOption) -> Result<Vec<u8>> {
5552        let mut buffer_out = VipsBlob::from(null_mut());
5553        let vips_op_response = call(
5554            "gifsave_buffer",
5555            option
5556                .set("in", self)
5557                .set(
5558                    "buffer",
5559                    &mut buffer_out,
5560                ),
5561        );
5562
5563        utils::result(
5564            vips_op_response,
5565            buffer_out.into(),
5566            Error::OperationError("GifsaveBuffer (vips_gifsave_buffer) failed".to_string()),
5567        )
5568    }
5569
5570    /// VipsForeignSaveCgifTarget (gifsave_target), save as gif (.gif), priority=0, rgb alpha
5571    ///
5572    /// target: `&VipsTarget` -> Target to save to
5573    pub fn gifsave_target(&self, target: &VipsTarget) -> Result<()> {
5574        let vips_op_response = call(
5575            "gifsave_target",
5576            VOption::new()
5577                .set("in", self)
5578                .set(
5579                    "target",
5580                    target,
5581                ),
5582        );
5583
5584        utils::result(
5585            vips_op_response,
5586            (),
5587            Error::OperationError("GifsaveTarget (vips_gifsave_target) failed".to_string()),
5588        )
5589    }
5590
5591    /// VipsForeignSaveCgifTarget (gifsave_target), save as gif (.gif), priority=0, rgb alpha
5592    ///
5593    /// target: `&VipsTarget` -> Target to save to
5594    ///
5595    /// <ins>Optional arguments</ins>
5596    ///
5597    /// dither: `f64` -> Amount of dithering
5598    ///
5599    /// effort: `i32` -> Quantisation effort
5600    ///
5601    /// bitdepth: `i32` -> Number of bits per pixel
5602    ///
5603    /// interframe_maxerror: `f64` -> Maximum inter-frame error for transparency
5604    ///
5605    /// reuse: `bool` -> Reuse palette from input
5606    ///
5607    /// interpalette_maxerror: `f64` -> Maximum inter-palette error for palette reusage
5608    ///
5609    /// interlace: `bool` -> Generate an interlaced (progressive) GIF
5610    ///
5611    /// keep_duplicate_frames: `bool` -> Keep duplicate frames in the output instead of combining them
5612    ///
5613    /// keep: [`ForeignKeep`] -> Which metadata to retain
5614    ///
5615    /// background: `&[f64]` -> Background value
5616    ///
5617    /// page_height: `i32` -> Set page height for multipage save
5618    ///
5619    /// profile: `&str` -> Filename of ICC profile to embed
5620    pub fn gifsave_target_with_opts(&self, target: &VipsTarget, option: VOption) -> Result<()> {
5621        let vips_op_response = call(
5622            "gifsave_target",
5623            option
5624                .set("in", self)
5625                .set(
5626                    "target",
5627                    target,
5628                ),
5629        );
5630
5631        utils::result(
5632            vips_op_response,
5633            (),
5634            Error::OperationError("GifsaveTarget (vips_gifsave_target) failed".to_string()),
5635        )
5636    }
5637
5638    /// VipsGlobalbalance (globalbalance), global balance an image mosaic
5639    /// returns `VipsImage` - Output image
5640    pub fn globalbalance(&self) -> Result<VipsImage> {
5641        let mut out_out = VipsImage::from(null_mut());
5642        let vips_op_response = call(
5643            "globalbalance",
5644            VOption::new()
5645                .set("in", self)
5646                .set(
5647                    "out",
5648                    &mut out_out,
5649                ),
5650        );
5651
5652        utils::result(
5653            vips_op_response,
5654            out_out,
5655            Error::OperationError("Globalbalance (vips_globalbalance) failed".to_string()),
5656        )
5657    }
5658
5659    /// VipsGlobalbalance (globalbalance), global balance an image mosaic
5660    /// returns `VipsImage` - Output image
5661    ///
5662    /// <ins>Optional arguments</ins>
5663    ///
5664    /// gamma: `f64` -> Image gamma
5665    ///
5666    /// int_output: `bool` -> Integer output
5667    pub fn globalbalance_with_opts(&self, option: VOption) -> Result<VipsImage> {
5668        let mut out_out = VipsImage::from(null_mut());
5669        let vips_op_response = call(
5670            "globalbalance",
5671            option
5672                .set("in", self)
5673                .set(
5674                    "out",
5675                    &mut out_out,
5676                ),
5677        );
5678
5679        utils::result(
5680            vips_op_response,
5681            out_out,
5682            Error::OperationError("Globalbalance (vips_globalbalance) failed".to_string()),
5683        )
5684    }
5685
5686    /// VipsGravity (gravity), place an image within a larger image with a certain gravity
5687    /// returns `VipsImage` - Output image
5688    ///
5689    /// direction: `CompassDirection` -> Direction to place image within width/height
5690    ///
5691    /// width: `i32` -> Image width in pixels
5692    ///
5693    /// height: `i32` -> Image height in pixels
5694    pub fn gravity(
5695        &self,
5696        direction: CompassDirection,
5697        width: i32,
5698        height: i32,
5699    ) -> Result<VipsImage> {
5700        let mut out_out = VipsImage::from(null_mut());
5701        let vips_op_response = call(
5702            "gravity",
5703            VOption::new()
5704                .set("in", self)
5705                .set(
5706                    "out",
5707                    &mut out_out,
5708                )
5709                .set(
5710                    "direction",
5711                    direction as i32,
5712                )
5713                .set(
5714                    "width",
5715                    width,
5716                )
5717                .set(
5718                    "height",
5719                    height,
5720                ),
5721        );
5722
5723        utils::result(
5724            vips_op_response,
5725            out_out,
5726            Error::OperationError("Gravity (vips_gravity) failed".to_string()),
5727        )
5728    }
5729
5730    /// VipsGravity (gravity), place an image within a larger image with a certain gravity
5731    /// returns `VipsImage` - Output image
5732    ///
5733    /// direction: `CompassDirection` -> Direction to place image within width/height
5734    ///
5735    /// width: `i32` -> Image width in pixels
5736    ///
5737    /// height: `i32` -> Image height in pixels
5738    ///
5739    /// <ins>Optional arguments</ins>
5740    ///
5741    /// extend: [`Extend`] -> How to generate the extra pixels
5742    ///
5743    /// background: `&[f64]` -> Color for background pixels
5744    pub fn gravity_with_opts(
5745        &self,
5746        direction: CompassDirection,
5747        width: i32,
5748        height: i32,
5749        option: VOption,
5750    ) -> Result<VipsImage> {
5751        let mut out_out = VipsImage::from(null_mut());
5752        let vips_op_response = call(
5753            "gravity",
5754            option
5755                .set("in", self)
5756                .set(
5757                    "out",
5758                    &mut out_out,
5759                )
5760                .set(
5761                    "direction",
5762                    direction as i32,
5763                )
5764                .set(
5765                    "width",
5766                    width,
5767                )
5768                .set(
5769                    "height",
5770                    height,
5771                ),
5772        );
5773
5774        utils::result(
5775            vips_op_response,
5776            out_out,
5777            Error::OperationError("Gravity (vips_gravity) failed".to_string()),
5778        )
5779    }
5780
5781    /// VipsGrey (grey), make a grey ramp image
5782    /// returns `VipsImage` - Output image
5783    ///
5784    /// width: `i32` -> Image width in pixels
5785    ///
5786    /// height: `i32` -> Image height in pixels
5787    pub fn grey(width: i32, height: i32) -> Result<VipsImage> {
5788        let mut out_out = VipsImage::from(null_mut());
5789        let vips_op_response = call(
5790            "grey",
5791            VOption::new()
5792                .set(
5793                    "out",
5794                    &mut out_out,
5795                )
5796                .set(
5797                    "width",
5798                    width,
5799                )
5800                .set(
5801                    "height",
5802                    height,
5803                ),
5804        );
5805
5806        utils::result(
5807            vips_op_response,
5808            out_out,
5809            Error::OperationError("Grey (vips_grey) failed".to_string()),
5810        )
5811    }
5812
5813    /// VipsGrey (grey), make a grey ramp image
5814    /// returns `VipsImage` - Output image
5815    ///
5816    /// width: `i32` -> Image width in pixels
5817    ///
5818    /// height: `i32` -> Image height in pixels
5819    ///
5820    /// <ins>Optional arguments</ins>
5821    ///
5822    /// uchar: `bool` -> Output an unsigned char image
5823    pub fn grey_with_opts(width: i32, height: i32, option: VOption) -> Result<VipsImage> {
5824        let mut out_out = VipsImage::from(null_mut());
5825        let vips_op_response = call(
5826            "grey",
5827            option
5828                .set(
5829                    "out",
5830                    &mut out_out,
5831                )
5832                .set(
5833                    "width",
5834                    width,
5835                )
5836                .set(
5837                    "height",
5838                    height,
5839                ),
5840        );
5841
5842        utils::result(
5843            vips_op_response,
5844            out_out,
5845            Error::OperationError("Grey (vips_grey) failed".to_string()),
5846        )
5847    }
5848
5849    /// VipsGrid (grid), grid an image
5850    /// returns `VipsImage` - Output image
5851    ///
5852    /// tile_height: `i32` -> Chop into tiles this high
5853    ///
5854    /// across: `i32` -> Number of tiles across
5855    ///
5856    /// down: `i32` -> Number of tiles down
5857    pub fn grid(&self, tile_height: i32, across: i32, down: i32) -> Result<VipsImage> {
5858        let mut out_out = VipsImage::from(null_mut());
5859        let vips_op_response = call(
5860            "grid",
5861            VOption::new()
5862                .set("in", self)
5863                .set(
5864                    "out",
5865                    &mut out_out,
5866                )
5867                .set(
5868                    "tile-height",
5869                    tile_height,
5870                )
5871                .set(
5872                    "across",
5873                    across,
5874                )
5875                .set(
5876                    "down",
5877                    down,
5878                ),
5879        );
5880
5881        utils::result(
5882            vips_op_response,
5883            out_out,
5884            Error::OperationError("Grid (vips_grid) failed".to_string()),
5885        )
5886    }
5887
5888    /// VipsForeignLoadHeifFile (heifload), load a HEIF image (.heic, .heif, .avif), priority=0, is_a, get_flags, header, load
5889    /// returns `VipsImage` - Output image
5890    ///
5891    /// filename: `&str` -> Filename to load from
5892    pub fn heifload(filename: &str) -> Result<VipsImage> {
5893        let mut out_out = VipsImage::from(null_mut());
5894        let vips_op_response = call(
5895            "heifload",
5896            VOption::new()
5897                .set(
5898                    "filename",
5899                    filename,
5900                )
5901                .set(
5902                    "out",
5903                    &mut out_out,
5904                ),
5905        );
5906
5907        utils::result(
5908            vips_op_response,
5909            out_out,
5910            Error::OperationError("Heifload (vips_heifload) failed".to_string()),
5911        )
5912    }
5913
5914    /// VipsForeignLoadHeifFile (heifload), load a HEIF image (.heic, .heif, .avif), priority=0, is_a, get_flags, header, load
5915    /// returns `VipsImage` - Output image
5916    ///
5917    /// filename: `&str` -> Filename to load from
5918    ///
5919    /// <ins>Optional arguments</ins>
5920    ///
5921    /// page: `i32` -> First page to load
5922    ///
5923    /// n: `i32` -> Number of pages to load, -1 for all
5924    ///
5925    /// thumbnail: `bool` -> Fetch thumbnail image
5926    ///
5927    /// unlimited: `bool` -> Remove all denial of service limits
5928    ///
5929    /// flags: [`ForeignFlags`] -> Flags for this file
5930    ///
5931    /// memory: `bool` -> Force open via memory
5932    ///
5933    /// access: [`Access`] -> Required access pattern for this file
5934    ///
5935    /// fail_on: [`FailOn`] -> Error level to fail on
5936    ///
5937    /// revalidate: `bool` -> Don't use a cached result for this operation
5938    pub fn heifload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
5939        let mut out_out = VipsImage::from(null_mut());
5940        let vips_op_response = call(
5941            "heifload",
5942            option
5943                .set(
5944                    "filename",
5945                    filename,
5946                )
5947                .set(
5948                    "out",
5949                    &mut out_out,
5950                ),
5951        );
5952
5953        utils::result(
5954            vips_op_response,
5955            out_out,
5956            Error::OperationError("Heifload (vips_heifload) failed".to_string()),
5957        )
5958    }
5959
5960    /// VipsForeignLoadHeifBuffer (heifload_buffer), load a HEIF image, priority=0, is_a_buffer, get_flags, header, load
5961    /// returns `VipsImage` - Output image
5962    ///
5963    /// buffer: `&[u8]` -> Buffer to load from
5964    pub fn heifload_buffer(buffer: &[u8]) -> Result<VipsImage> {
5965        let blob = unsafe {
5966            vips_blob_new(
5967                None,
5968                buffer.as_ptr() as _,
5969                buffer.len() as _,
5970            )
5971        };
5972        let mut out_out = VipsImage::from(null_mut());
5973        let vips_op_response = call(
5974            "heifload_buffer",
5975            VOption::new()
5976                .set(
5977                    "buffer",
5978                    &VipsBlob::from(blob),
5979                )
5980                .set(
5981                    "out",
5982                    &mut out_out,
5983                ),
5984        );
5985        unsafe { vips_area_unref(&mut (*blob).area) };
5986        utils::result(
5987            vips_op_response,
5988            out_out,
5989            Error::OperationError("HeifloadBuffer (vips_heifload_buffer) failed".to_string()),
5990        )
5991    }
5992
5993    /// VipsForeignLoadHeifBuffer (heifload_buffer), load a HEIF image, priority=0, is_a_buffer, get_flags, header, load
5994    /// returns `VipsImage` - Output image
5995    ///
5996    /// buffer: `&[u8]` -> Buffer to load from
5997    ///
5998    /// <ins>Optional arguments</ins>
5999    ///
6000    /// page: `i32` -> First page to load
6001    ///
6002    /// n: `i32` -> Number of pages to load, -1 for all
6003    ///
6004    /// thumbnail: `bool` -> Fetch thumbnail image
6005    ///
6006    /// unlimited: `bool` -> Remove all denial of service limits
6007    ///
6008    /// flags: [`ForeignFlags`] -> Flags for this file
6009    ///
6010    /// memory: `bool` -> Force open via memory
6011    ///
6012    /// access: [`Access`] -> Required access pattern for this file
6013    ///
6014    /// fail_on: [`FailOn`] -> Error level to fail on
6015    ///
6016    /// revalidate: `bool` -> Don't use a cached result for this operation
6017    pub fn heifload_buffer_with_opts(buffer: &[u8], option: VOption) -> Result<VipsImage> {
6018        let blob = unsafe {
6019            vips_blob_new(
6020                None,
6021                buffer.as_ptr() as _,
6022                buffer.len() as _,
6023            )
6024        };
6025        let mut out_out = VipsImage::from(null_mut());
6026        let vips_op_response = call(
6027            "heifload_buffer",
6028            option
6029                .set(
6030                    "buffer",
6031                    &VipsBlob::from(blob),
6032                )
6033                .set(
6034                    "out",
6035                    &mut out_out,
6036                ),
6037        );
6038        unsafe { vips_area_unref(&mut (*blob).area) };
6039        utils::result(
6040            vips_op_response,
6041            out_out,
6042            Error::OperationError("HeifloadBuffer (vips_heifload_buffer) failed".to_string()),
6043        )
6044    }
6045
6046    /// VipsForeignLoadHeifSource (heifload_source), load a HEIF image, priority=0, is_a_source, get_flags, header, load
6047    /// returns `VipsImage` - Output image
6048    ///
6049    /// source: `&VipsSource` -> Source to load from
6050    pub fn heifload_source(source: &VipsSource) -> Result<VipsImage> {
6051        let mut out_out = VipsImage::from(null_mut());
6052        let vips_op_response = call(
6053            "heifload_source",
6054            VOption::new()
6055                .set(
6056                    "source",
6057                    source,
6058                )
6059                .set(
6060                    "out",
6061                    &mut out_out,
6062                ),
6063        );
6064
6065        utils::result(
6066            vips_op_response,
6067            out_out,
6068            Error::OperationError("HeifloadSource (vips_heifload_source) failed".to_string()),
6069        )
6070    }
6071
6072    /// VipsForeignLoadHeifSource (heifload_source), load a HEIF image, priority=0, is_a_source, get_flags, header, load
6073    /// returns `VipsImage` - Output image
6074    ///
6075    /// source: `&VipsSource` -> Source to load from
6076    ///
6077    /// <ins>Optional arguments</ins>
6078    ///
6079    /// page: `i32` -> First page to load
6080    ///
6081    /// n: `i32` -> Number of pages to load, -1 for all
6082    ///
6083    /// thumbnail: `bool` -> Fetch thumbnail image
6084    ///
6085    /// unlimited: `bool` -> Remove all denial of service limits
6086    ///
6087    /// flags: [`ForeignFlags`] -> Flags for this file
6088    ///
6089    /// memory: `bool` -> Force open via memory
6090    ///
6091    /// access: [`Access`] -> Required access pattern for this file
6092    ///
6093    /// fail_on: [`FailOn`] -> Error level to fail on
6094    ///
6095    /// revalidate: `bool` -> Don't use a cached result for this operation
6096    pub fn heifload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
6097        let mut out_out = VipsImage::from(null_mut());
6098        let vips_op_response = call(
6099            "heifload_source",
6100            option
6101                .set(
6102                    "source",
6103                    source,
6104                )
6105                .set(
6106                    "out",
6107                    &mut out_out,
6108                ),
6109        );
6110
6111        utils::result(
6112            vips_op_response,
6113            out_out,
6114            Error::OperationError("HeifloadSource (vips_heifload_source) failed".to_string()),
6115        )
6116    }
6117
6118    /// VipsForeignSaveHeifFile (heifsave), save image in HEIF format (.heic, .heif, .avif), priority=0, rgb alpha
6119    ///
6120    /// filename: `&str` -> Filename to save to
6121    pub fn heifsave(&self, filename: &str) -> Result<()> {
6122        let vips_op_response = call(
6123            "heifsave",
6124            VOption::new()
6125                .set("in", self)
6126                .set(
6127                    "filename",
6128                    filename,
6129                ),
6130        );
6131
6132        utils::result(
6133            vips_op_response,
6134            (),
6135            Error::OperationError("Heifsave (vips_heifsave) failed".to_string()),
6136        )
6137    }
6138
6139    /// VipsForeignSaveHeifFile (heifsave), save image in HEIF format (.heic, .heif, .avif), priority=0, rgb alpha
6140    ///
6141    /// filename: `&str` -> Filename to save to
6142    ///
6143    /// <ins>Optional arguments</ins>
6144    ///
6145    /// Q: `i32` -> Q factor
6146    ///
6147    /// bitdepth: `i32` -> Number of bits per pixel
6148    ///
6149    /// lossless: `bool` -> Enable lossless compression
6150    ///
6151    /// compression: [`ForeignHeifCompression`] -> Compression format
6152    ///
6153    /// effort: `i32` -> CPU effort
6154    ///
6155    /// subsample_mode: [`ForeignSubsample`] -> Select chroma subsample operation mode
6156    ///
6157    /// encoder: [`ForeignHeifEncoder`] -> Select encoder to use
6158    ///
6159    /// keep: [`ForeignKeep`] -> Which metadata to retain
6160    ///
6161    /// background: `&[f64]` -> Background value
6162    ///
6163    /// page_height: `i32` -> Set page height for multipage save
6164    ///
6165    /// profile: `&str` -> Filename of ICC profile to embed
6166    pub fn heifsave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
6167        let vips_op_response = call(
6168            "heifsave",
6169            option
6170                .set("in", self)
6171                .set(
6172                    "filename",
6173                    filename,
6174                ),
6175        );
6176
6177        utils::result(
6178            vips_op_response,
6179            (),
6180            Error::OperationError("Heifsave (vips_heifsave) failed".to_string()),
6181        )
6182    }
6183
6184    /// VipsForeignSaveHeifBuffer (heifsave_buffer), save image in HEIF format (.heic, .heif), priority=0, rgb alpha
6185    /// returns `Vec<u8>` - Buffer to save to
6186    pub fn heifsave_buffer(&self) -> Result<Vec<u8>> {
6187        let mut buffer_out = VipsBlob::from(null_mut());
6188        let vips_op_response = call(
6189            "heifsave_buffer",
6190            VOption::new()
6191                .set("in", self)
6192                .set(
6193                    "buffer",
6194                    &mut buffer_out,
6195                ),
6196        );
6197
6198        utils::result(
6199            vips_op_response,
6200            buffer_out.into(),
6201            Error::OperationError("HeifsaveBuffer (vips_heifsave_buffer) failed".to_string()),
6202        )
6203    }
6204
6205    /// VipsForeignSaveHeifBuffer (heifsave_buffer), save image in HEIF format (.heic, .heif), priority=0, rgb alpha
6206    /// returns `Vec<u8>` - Buffer to save to
6207    ///
6208    /// <ins>Optional arguments</ins>
6209    ///
6210    /// Q: `i32` -> Q factor
6211    ///
6212    /// bitdepth: `i32` -> Number of bits per pixel
6213    ///
6214    /// lossless: `bool` -> Enable lossless compression
6215    ///
6216    /// compression: [`ForeignHeifCompression`] -> Compression format
6217    ///
6218    /// effort: `i32` -> CPU effort
6219    ///
6220    /// subsample_mode: [`ForeignSubsample`] -> Select chroma subsample operation mode
6221    ///
6222    /// encoder: [`ForeignHeifEncoder`] -> Select encoder to use
6223    ///
6224    /// keep: [`ForeignKeep`] -> Which metadata to retain
6225    ///
6226    /// background: `&[f64]` -> Background value
6227    ///
6228    /// page_height: `i32` -> Set page height for multipage save
6229    ///
6230    /// profile: `&str` -> Filename of ICC profile to embed
6231    pub fn heifsave_buffer_with_opts(&self, option: VOption) -> Result<Vec<u8>> {
6232        let mut buffer_out = VipsBlob::from(null_mut());
6233        let vips_op_response = call(
6234            "heifsave_buffer",
6235            option
6236                .set("in", self)
6237                .set(
6238                    "buffer",
6239                    &mut buffer_out,
6240                ),
6241        );
6242
6243        utils::result(
6244            vips_op_response,
6245            buffer_out.into(),
6246            Error::OperationError("HeifsaveBuffer (vips_heifsave_buffer) failed".to_string()),
6247        )
6248    }
6249
6250    /// VipsForeignSaveHeifTarget (heifsave_target), save image in HEIF format (.heic, .heif), priority=0, rgb alpha
6251    ///
6252    /// target: `&VipsTarget` -> Target to save to
6253    pub fn heifsave_target(&self, target: &VipsTarget) -> Result<()> {
6254        let vips_op_response = call(
6255            "heifsave_target",
6256            VOption::new()
6257                .set("in", self)
6258                .set(
6259                    "target",
6260                    target,
6261                ),
6262        );
6263
6264        utils::result(
6265            vips_op_response,
6266            (),
6267            Error::OperationError("HeifsaveTarget (vips_heifsave_target) failed".to_string()),
6268        )
6269    }
6270
6271    /// VipsForeignSaveHeifTarget (heifsave_target), save image in HEIF format (.heic, .heif), priority=0, rgb alpha
6272    ///
6273    /// target: `&VipsTarget` -> Target to save to
6274    ///
6275    /// <ins>Optional arguments</ins>
6276    ///
6277    /// Q: `i32` -> Q factor
6278    ///
6279    /// bitdepth: `i32` -> Number of bits per pixel
6280    ///
6281    /// lossless: `bool` -> Enable lossless compression
6282    ///
6283    /// compression: [`ForeignHeifCompression`] -> Compression format
6284    ///
6285    /// effort: `i32` -> CPU effort
6286    ///
6287    /// subsample_mode: [`ForeignSubsample`] -> Select chroma subsample operation mode
6288    ///
6289    /// encoder: [`ForeignHeifEncoder`] -> Select encoder to use
6290    ///
6291    /// keep: [`ForeignKeep`] -> Which metadata to retain
6292    ///
6293    /// background: `&[f64]` -> Background value
6294    ///
6295    /// page_height: `i32` -> Set page height for multipage save
6296    ///
6297    /// profile: `&str` -> Filename of ICC profile to embed
6298    pub fn heifsave_target_with_opts(&self, target: &VipsTarget, option: VOption) -> Result<()> {
6299        let vips_op_response = call(
6300            "heifsave_target",
6301            option
6302                .set("in", self)
6303                .set(
6304                    "target",
6305                    target,
6306                ),
6307        );
6308
6309        utils::result(
6310            vips_op_response,
6311            (),
6312            Error::OperationError("HeifsaveTarget (vips_heifsave_target) failed".to_string()),
6313        )
6314    }
6315
6316    /// VipsHistCum (hist_cum), form cumulative histogram
6317    /// returns `VipsImage` - Output image
6318    pub fn hist_cum(&self) -> Result<VipsImage> {
6319        let mut out_out = VipsImage::from(null_mut());
6320        let vips_op_response = call(
6321            "hist_cum",
6322            VOption::new()
6323                .set("in", self)
6324                .set(
6325                    "out",
6326                    &mut out_out,
6327                ),
6328        );
6329
6330        utils::result(
6331            vips_op_response,
6332            out_out,
6333            Error::OperationError("HistCum (vips_hist_cum) failed".to_string()),
6334        )
6335    }
6336
6337    /// VipsHistEntropy (hist_entropy), estimate image entropy
6338    /// returns `f64` - Output value
6339    pub fn hist_entropy(&self) -> Result<f64> {
6340        let mut out_out: f64 = 0.0;
6341        let vips_op_response = call(
6342            "hist_entropy",
6343            VOption::new()
6344                .set("in", self)
6345                .set(
6346                    "out",
6347                    &mut out_out,
6348                ),
6349        );
6350
6351        utils::result(
6352            vips_op_response,
6353            out_out,
6354            Error::OperationError("HistEntropy (vips_hist_entropy) failed".to_string()),
6355        )
6356    }
6357
6358    /// VipsHistEqual (hist_equal), histogram equalisation
6359    /// returns `VipsImage` - Output image
6360    pub fn hist_equal(&self) -> Result<VipsImage> {
6361        let mut out_out = VipsImage::from(null_mut());
6362        let vips_op_response = call(
6363            "hist_equal",
6364            VOption::new()
6365                .set("in", self)
6366                .set(
6367                    "out",
6368                    &mut out_out,
6369                ),
6370        );
6371
6372        utils::result(
6373            vips_op_response,
6374            out_out,
6375            Error::OperationError("HistEqual (vips_hist_equal) failed".to_string()),
6376        )
6377    }
6378
6379    /// VipsHistEqual (hist_equal), histogram equalisation
6380    /// returns `VipsImage` - Output image
6381    ///
6382    /// <ins>Optional arguments</ins>
6383    ///
6384    /// band: `i32` -> Equalise with this band
6385    pub fn hist_equal_with_opts(&self, option: VOption) -> Result<VipsImage> {
6386        let mut out_out = VipsImage::from(null_mut());
6387        let vips_op_response = call(
6388            "hist_equal",
6389            option
6390                .set("in", self)
6391                .set(
6392                    "out",
6393                    &mut out_out,
6394                ),
6395        );
6396
6397        utils::result(
6398            vips_op_response,
6399            out_out,
6400            Error::OperationError("HistEqual (vips_hist_equal) failed".to_string()),
6401        )
6402    }
6403
6404    /// VipsHistFind (hist_find), find image histogram
6405    /// returns `VipsImage` - Output histogram
6406    pub fn hist_find(&self) -> Result<VipsImage> {
6407        let mut out_out = VipsImage::from(null_mut());
6408        let vips_op_response = call(
6409            "hist_find",
6410            VOption::new()
6411                .set("in", self)
6412                .set(
6413                    "out",
6414                    &mut out_out,
6415                ),
6416        );
6417
6418        utils::result(
6419            vips_op_response,
6420            out_out,
6421            Error::OperationError("HistFind (vips_hist_find) failed".to_string()),
6422        )
6423    }
6424
6425    /// VipsHistFind (hist_find), find image histogram
6426    /// returns `VipsImage` - Output histogram
6427    ///
6428    /// <ins>Optional arguments</ins>
6429    ///
6430    /// band: `i32` -> Find histogram of band
6431    pub fn hist_find_with_opts(&self, option: VOption) -> Result<VipsImage> {
6432        let mut out_out = VipsImage::from(null_mut());
6433        let vips_op_response = call(
6434            "hist_find",
6435            option
6436                .set("in", self)
6437                .set(
6438                    "out",
6439                    &mut out_out,
6440                ),
6441        );
6442
6443        utils::result(
6444            vips_op_response,
6445            out_out,
6446            Error::OperationError("HistFind (vips_hist_find) failed".to_string()),
6447        )
6448    }
6449
6450    /// VipsHistFindIndexed (hist_find_indexed), find indexed image histogram
6451    /// returns `VipsImage` - Output histogram
6452    ///
6453    /// index: `&VipsImage` -> Index image
6454    pub fn hist_find_indexed(&self, index: &VipsImage) -> Result<VipsImage> {
6455        let mut out_out = VipsImage::from(null_mut());
6456        let vips_op_response = call(
6457            "hist_find_indexed",
6458            VOption::new()
6459                .set("in", self)
6460                .set(
6461                    "index",
6462                    index,
6463                )
6464                .set(
6465                    "out",
6466                    &mut out_out,
6467                ),
6468        );
6469
6470        utils::result(
6471            vips_op_response,
6472            out_out,
6473            Error::OperationError("HistFindIndexed (vips_hist_find_indexed) failed".to_string()),
6474        )
6475    }
6476
6477    /// VipsHistFindIndexed (hist_find_indexed), find indexed image histogram
6478    /// returns `VipsImage` - Output histogram
6479    ///
6480    /// index: `&VipsImage` -> Index image
6481    ///
6482    /// <ins>Optional arguments</ins>
6483    ///
6484    /// combine: [`Combine`] -> Combine bins like this
6485    pub fn hist_find_indexed_with_opts(
6486        &self,
6487        index: &VipsImage,
6488        option: VOption,
6489    ) -> Result<VipsImage> {
6490        let mut out_out = VipsImage::from(null_mut());
6491        let vips_op_response = call(
6492            "hist_find_indexed",
6493            option
6494                .set("in", self)
6495                .set(
6496                    "index",
6497                    index,
6498                )
6499                .set(
6500                    "out",
6501                    &mut out_out,
6502                ),
6503        );
6504
6505        utils::result(
6506            vips_op_response,
6507            out_out,
6508            Error::OperationError("HistFindIndexed (vips_hist_find_indexed) failed".to_string()),
6509        )
6510    }
6511
6512    /// VipsHistFindNDim (hist_find_ndim), find n-dimensional image histogram
6513    /// returns `VipsImage` - Output histogram
6514    pub fn hist_find_ndim(&self) -> Result<VipsImage> {
6515        let mut out_out = VipsImage::from(null_mut());
6516        let vips_op_response = call(
6517            "hist_find_ndim",
6518            VOption::new()
6519                .set("in", self)
6520                .set(
6521                    "out",
6522                    &mut out_out,
6523                ),
6524        );
6525
6526        utils::result(
6527            vips_op_response,
6528            out_out,
6529            Error::OperationError("HistFindNdim (vips_hist_find_ndim) failed".to_string()),
6530        )
6531    }
6532
6533    /// VipsHistFindNDim (hist_find_ndim), find n-dimensional image histogram
6534    /// returns `VipsImage` - Output histogram
6535    ///
6536    /// <ins>Optional arguments</ins>
6537    ///
6538    /// bins: `i32` -> Number of bins in each dimension
6539    pub fn hist_find_ndim_with_opts(&self, option: VOption) -> Result<VipsImage> {
6540        let mut out_out = VipsImage::from(null_mut());
6541        let vips_op_response = call(
6542            "hist_find_ndim",
6543            option
6544                .set("in", self)
6545                .set(
6546                    "out",
6547                    &mut out_out,
6548                ),
6549        );
6550
6551        utils::result(
6552            vips_op_response,
6553            out_out,
6554            Error::OperationError("HistFindNdim (vips_hist_find_ndim) failed".to_string()),
6555        )
6556    }
6557
6558    /// VipsHistIsmonotonic (hist_ismonotonic), test for monotonicity
6559    /// returns `bool` - true if in is monotonic
6560    pub fn hist_ismonotonic(&self) -> Result<bool> {
6561        let mut monotonic_out: bool = false;
6562        let vips_op_response = call(
6563            "hist_ismonotonic",
6564            VOption::new()
6565                .set("in", self)
6566                .set(
6567                    "monotonic",
6568                    &mut monotonic_out,
6569                ),
6570        );
6571
6572        utils::result(
6573            vips_op_response,
6574            monotonic_out,
6575            Error::OperationError("HistIsmonotonic (vips_hist_ismonotonic) failed".to_string()),
6576        )
6577    }
6578
6579    /// VipsHistLocal (hist_local), local histogram equalisation
6580    /// returns `VipsImage` - Output image
6581    ///
6582    /// width: `i32` -> Window width in pixels
6583    ///
6584    /// height: `i32` -> Window height in pixels
6585    pub fn hist_local(&self, width: i32, height: i32) -> Result<VipsImage> {
6586        let mut out_out = VipsImage::from(null_mut());
6587        let vips_op_response = call(
6588            "hist_local",
6589            VOption::new()
6590                .set("in", self)
6591                .set(
6592                    "out",
6593                    &mut out_out,
6594                )
6595                .set(
6596                    "width",
6597                    width,
6598                )
6599                .set(
6600                    "height",
6601                    height,
6602                ),
6603        );
6604
6605        utils::result(
6606            vips_op_response,
6607            out_out,
6608            Error::OperationError("HistLocal (vips_hist_local) failed".to_string()),
6609        )
6610    }
6611
6612    /// VipsHistLocal (hist_local), local histogram equalisation
6613    /// returns `VipsImage` - Output image
6614    ///
6615    /// width: `i32` -> Window width in pixels
6616    ///
6617    /// height: `i32` -> Window height in pixels
6618    ///
6619    /// <ins>Optional arguments</ins>
6620    ///
6621    /// max_slope: `i32` -> Maximum slope (CLAHE)
6622    pub fn hist_local_with_opts(
6623        &self,
6624        width: i32,
6625        height: i32,
6626        option: VOption,
6627    ) -> Result<VipsImage> {
6628        let mut out_out = VipsImage::from(null_mut());
6629        let vips_op_response = call(
6630            "hist_local",
6631            option
6632                .set("in", self)
6633                .set(
6634                    "out",
6635                    &mut out_out,
6636                )
6637                .set(
6638                    "width",
6639                    width,
6640                )
6641                .set(
6642                    "height",
6643                    height,
6644                ),
6645        );
6646
6647        utils::result(
6648            vips_op_response,
6649            out_out,
6650            Error::OperationError("HistLocal (vips_hist_local) failed".to_string()),
6651        )
6652    }
6653
6654    /// VipsHistMatch (hist_match), match two histograms
6655    /// returns `VipsImage` - Output image
6656    ///
6657    /// refp: `&VipsImage` -> Reference histogram
6658    pub fn hist_match(&self, refp: &VipsImage) -> Result<VipsImage> {
6659        let mut out_out = VipsImage::from(null_mut());
6660        let vips_op_response = call(
6661            "hist_match",
6662            VOption::new()
6663                .set("in", self)
6664                .set(
6665                    "ref", refp,
6666                )
6667                .set(
6668                    "out",
6669                    &mut out_out,
6670                ),
6671        );
6672
6673        utils::result(
6674            vips_op_response,
6675            out_out,
6676            Error::OperationError("HistMatch (vips_hist_match) failed".to_string()),
6677        )
6678    }
6679
6680    /// VipsHistNorm (hist_norm), normalise histogram
6681    /// returns `VipsImage` - Output image
6682    pub fn hist_norm(&self) -> Result<VipsImage> {
6683        let mut out_out = VipsImage::from(null_mut());
6684        let vips_op_response = call(
6685            "hist_norm",
6686            VOption::new()
6687                .set("in", self)
6688                .set(
6689                    "out",
6690                    &mut out_out,
6691                ),
6692        );
6693
6694        utils::result(
6695            vips_op_response,
6696            out_out,
6697            Error::OperationError("HistNorm (vips_hist_norm) failed".to_string()),
6698        )
6699    }
6700
6701    /// VipsHistPlot (hist_plot), plot histogram
6702    /// returns `VipsImage` - Output image
6703    pub fn hist_plot(&self) -> Result<VipsImage> {
6704        let mut out_out = VipsImage::from(null_mut());
6705        let vips_op_response = call(
6706            "hist_plot",
6707            VOption::new()
6708                .set("in", self)
6709                .set(
6710                    "out",
6711                    &mut out_out,
6712                ),
6713        );
6714
6715        utils::result(
6716            vips_op_response,
6717            out_out,
6718            Error::OperationError("HistPlot (vips_hist_plot) failed".to_string()),
6719        )
6720    }
6721
6722    /// VipsHoughCircle (hough_circle), find hough circle transform
6723    /// returns `VipsImage` - Output image
6724    pub fn hough_circle(&self) -> Result<VipsImage> {
6725        let mut out_out = VipsImage::from(null_mut());
6726        let vips_op_response = call(
6727            "hough_circle",
6728            VOption::new()
6729                .set("in", self)
6730                .set(
6731                    "out",
6732                    &mut out_out,
6733                ),
6734        );
6735
6736        utils::result(
6737            vips_op_response,
6738            out_out,
6739            Error::OperationError("HoughCircle (vips_hough_circle) failed".to_string()),
6740        )
6741    }
6742
6743    /// VipsHoughCircle (hough_circle), find hough circle transform
6744    /// returns `VipsImage` - Output image
6745    ///
6746    /// <ins>Optional arguments</ins>
6747    ///
6748    /// scale: `i32` -> Scale down dimensions by this factor
6749    ///
6750    /// min_radius: `i32` -> Smallest radius to search for
6751    ///
6752    /// max_radius: `i32` -> Largest radius to search for
6753    pub fn hough_circle_with_opts(&self, option: VOption) -> Result<VipsImage> {
6754        let mut out_out = VipsImage::from(null_mut());
6755        let vips_op_response = call(
6756            "hough_circle",
6757            option
6758                .set("in", self)
6759                .set(
6760                    "out",
6761                    &mut out_out,
6762                ),
6763        );
6764
6765        utils::result(
6766            vips_op_response,
6767            out_out,
6768            Error::OperationError("HoughCircle (vips_hough_circle) failed".to_string()),
6769        )
6770    }
6771
6772    /// VipsHoughLine (hough_line), find hough line transform
6773    /// returns `VipsImage` - Output image
6774    pub fn hough_line(&self) -> Result<VipsImage> {
6775        let mut out_out = VipsImage::from(null_mut());
6776        let vips_op_response = call(
6777            "hough_line",
6778            VOption::new()
6779                .set("in", self)
6780                .set(
6781                    "out",
6782                    &mut out_out,
6783                ),
6784        );
6785
6786        utils::result(
6787            vips_op_response,
6788            out_out,
6789            Error::OperationError("HoughLine (vips_hough_line) failed".to_string()),
6790        )
6791    }
6792
6793    /// VipsHoughLine (hough_line), find hough line transform
6794    /// returns `VipsImage` - Output image
6795    ///
6796    /// <ins>Optional arguments</ins>
6797    ///
6798    /// width: `i32` -> Horizontal size of parameter space
6799    ///
6800    /// height: `i32` -> Vertical size of parameter space
6801    pub fn hough_line_with_opts(&self, option: VOption) -> Result<VipsImage> {
6802        let mut out_out = VipsImage::from(null_mut());
6803        let vips_op_response = call(
6804            "hough_line",
6805            option
6806                .set("in", self)
6807                .set(
6808                    "out",
6809                    &mut out_out,
6810                ),
6811        );
6812
6813        utils::result(
6814            vips_op_response,
6815            out_out,
6816            Error::OperationError("HoughLine (vips_hough_line) failed".to_string()),
6817        )
6818    }
6819
6820    /// VipsIccExport (icc_export), output to device with ICC profile
6821    /// returns `VipsImage` - Output image
6822    pub fn icc_export(&self) -> Result<VipsImage> {
6823        let mut out_out = VipsImage::from(null_mut());
6824        let vips_op_response = call(
6825            "icc_export",
6826            VOption::new()
6827                .set("in", self)
6828                .set(
6829                    "out",
6830                    &mut out_out,
6831                ),
6832        );
6833
6834        utils::result(
6835            vips_op_response,
6836            out_out,
6837            Error::OperationError("IccExport (vips_icc_export) failed".to_string()),
6838        )
6839    }
6840
6841    /// VipsIccExport (icc_export), output to device with ICC profile
6842    /// returns `VipsImage` - Output image
6843    ///
6844    /// <ins>Optional arguments</ins>
6845    ///
6846    /// pcs: [`PCS`] -> Set Profile Connection Space
6847    ///
6848    /// intent: [`Intent`] -> Rendering intent
6849    ///
6850    /// black_point_compensation: `bool` -> Enable black point compensation
6851    ///
6852    /// output_profile: `&str` -> Filename to load output profile from
6853    ///
6854    /// depth: `i32` -> Output device space depth in bits
6855    pub fn icc_export_with_opts(&self, option: VOption) -> Result<VipsImage> {
6856        let mut out_out = VipsImage::from(null_mut());
6857        let vips_op_response = call(
6858            "icc_export",
6859            option
6860                .set("in", self)
6861                .set(
6862                    "out",
6863                    &mut out_out,
6864                ),
6865        );
6866
6867        utils::result(
6868            vips_op_response,
6869            out_out,
6870            Error::OperationError("IccExport (vips_icc_export) failed".to_string()),
6871        )
6872    }
6873
6874    /// VipsIccImport (icc_import), import from device with ICC profile
6875    /// returns `VipsImage` - Output image
6876    pub fn icc_import(&self) -> Result<VipsImage> {
6877        let mut out_out = VipsImage::from(null_mut());
6878        let vips_op_response = call(
6879            "icc_import",
6880            VOption::new()
6881                .set("in", self)
6882                .set(
6883                    "out",
6884                    &mut out_out,
6885                ),
6886        );
6887
6888        utils::result(
6889            vips_op_response,
6890            out_out,
6891            Error::OperationError("IccImport (vips_icc_import) failed".to_string()),
6892        )
6893    }
6894
6895    /// VipsIccImport (icc_import), import from device with ICC profile
6896    /// returns `VipsImage` - Output image
6897    ///
6898    /// <ins>Optional arguments</ins>
6899    ///
6900    /// pcs: [`PCS`] -> Set Profile Connection Space
6901    ///
6902    /// intent: [`Intent`] -> Rendering intent
6903    ///
6904    /// black_point_compensation: `bool` -> Enable black point compensation
6905    ///
6906    /// embedded: `bool` -> Use embedded input profile, if available
6907    ///
6908    /// input_profile: `&str` -> Filename to load input profile from
6909    pub fn icc_import_with_opts(&self, option: VOption) -> Result<VipsImage> {
6910        let mut out_out = VipsImage::from(null_mut());
6911        let vips_op_response = call(
6912            "icc_import",
6913            option
6914                .set("in", self)
6915                .set(
6916                    "out",
6917                    &mut out_out,
6918                ),
6919        );
6920
6921        utils::result(
6922            vips_op_response,
6923            out_out,
6924            Error::OperationError("IccImport (vips_icc_import) failed".to_string()),
6925        )
6926    }
6927
6928    /// VipsIccTransform (icc_transform), transform between devices with ICC profiles
6929    /// returns `VipsImage` - Output image
6930    ///
6931    /// output_profile: `&str` -> Filename to load output profile from
6932    pub fn icc_transform(&self, output_profile: &str) -> Result<VipsImage> {
6933        let mut out_out = VipsImage::from(null_mut());
6934        let vips_op_response = call(
6935            "icc_transform",
6936            VOption::new()
6937                .set("in", self)
6938                .set(
6939                    "out",
6940                    &mut out_out,
6941                )
6942                .set(
6943                    "output-profile",
6944                    output_profile,
6945                ),
6946        );
6947
6948        utils::result(
6949            vips_op_response,
6950            out_out,
6951            Error::OperationError("IccTransform (vips_icc_transform) failed".to_string()),
6952        )
6953    }
6954
6955    /// VipsIccTransform (icc_transform), transform between devices with ICC profiles
6956    /// returns `VipsImage` - Output image
6957    ///
6958    /// output_profile: `&str` -> Filename to load output profile from
6959    ///
6960    /// <ins>Optional arguments</ins>
6961    ///
6962    /// pcs: [`PCS`] -> Set Profile Connection Space
6963    ///
6964    /// intent: [`Intent`] -> Rendering intent
6965    ///
6966    /// black_point_compensation: `bool` -> Enable black point compensation
6967    ///
6968    /// embedded: `bool` -> Use embedded input profile, if available
6969    ///
6970    /// input_profile: `&str` -> Filename to load input profile from
6971    ///
6972    /// depth: `i32` -> Output device space depth in bits
6973    pub fn icc_transform_with_opts(
6974        &self,
6975        output_profile: &str,
6976        option: VOption,
6977    ) -> Result<VipsImage> {
6978        let mut out_out = VipsImage::from(null_mut());
6979        let vips_op_response = call(
6980            "icc_transform",
6981            option
6982                .set("in", self)
6983                .set(
6984                    "out",
6985                    &mut out_out,
6986                )
6987                .set(
6988                    "output-profile",
6989                    output_profile,
6990                ),
6991        );
6992
6993        utils::result(
6994            vips_op_response,
6995            out_out,
6996            Error::OperationError("IccTransform (vips_icc_transform) failed".to_string()),
6997        )
6998    }
6999
7000    /// VipsIdentity (identity), make a 1D image where pixel values are indexes
7001    /// returns `VipsImage` - Output image
7002    pub fn identity() -> Result<VipsImage> {
7003        let mut out_out = VipsImage::from(null_mut());
7004        let vips_op_response = call(
7005            "identity",
7006            VOption::new().set(
7007                "out",
7008                &mut out_out,
7009            ),
7010        );
7011
7012        utils::result(
7013            vips_op_response,
7014            out_out,
7015            Error::OperationError("Identity (vips_identity) failed".to_string()),
7016        )
7017    }
7018
7019    /// VipsIdentity (identity), make a 1D image where pixel values are indexes
7020    /// returns `VipsImage` - Output image
7021    ///
7022    /// <ins>Optional arguments</ins>
7023    ///
7024    /// bands: `i32` -> Number of bands in LUT
7025    ///
7026    /// ushort: `bool` -> Create a 16-bit LUT
7027    ///
7028    /// size: `i32` -> Size of 16-bit LUT
7029    pub fn identity_with_opts(option: VOption) -> Result<VipsImage> {
7030        let mut out_out = VipsImage::from(null_mut());
7031        let vips_op_response = call(
7032            "identity",
7033            option.set(
7034                "out",
7035                &mut out_out,
7036            ),
7037        );
7038
7039        utils::result(
7040            vips_op_response,
7041            out_out,
7042            Error::OperationError("Identity (vips_identity) failed".to_string()),
7043        )
7044    }
7045
7046    /// VipsIfthenelse (ifthenelse), ifthenelse an image
7047    /// returns `VipsImage` - Output image
7048    ///
7049    /// in1: `&VipsImage` -> Source for TRUE pixels
7050    ///
7051    /// in2: `&VipsImage` -> Source for FALSE pixels
7052    pub fn ifthenelse(&self, in1: &VipsImage, in2: &VipsImage) -> Result<VipsImage> {
7053        let mut out_out = VipsImage::from(null_mut());
7054        let vips_op_response = call(
7055            "ifthenelse",
7056            VOption::new()
7057                .set(
7058                    "cond",
7059                    self,
7060                )
7061                .set("in1", in1)
7062                .set("in2", in2)
7063                .set(
7064                    "out",
7065                    &mut out_out,
7066                ),
7067        );
7068
7069        utils::result(
7070            vips_op_response,
7071            out_out,
7072            Error::OperationError("Ifthenelse (vips_ifthenelse) failed".to_string()),
7073        )
7074    }
7075
7076    /// VipsIfthenelse (ifthenelse), ifthenelse an image
7077    /// returns `VipsImage` - Output image
7078    ///
7079    /// in1: `&VipsImage` -> Source for TRUE pixels
7080    ///
7081    /// in2: `&VipsImage` -> Source for FALSE pixels
7082    ///
7083    /// <ins>Optional arguments</ins>
7084    ///
7085    /// blend: `bool` -> Blend smoothly between then and else parts
7086    pub fn ifthenelse_with_opts(
7087        &self,
7088        in1: &VipsImage,
7089        in2: &VipsImage,
7090        option: VOption,
7091    ) -> Result<VipsImage> {
7092        let mut out_out = VipsImage::from(null_mut());
7093        let vips_op_response = call(
7094            "ifthenelse",
7095            option
7096                .set(
7097                    "cond",
7098                    self,
7099                )
7100                .set("in1", in1)
7101                .set("in2", in2)
7102                .set(
7103                    "out",
7104                    &mut out_out,
7105                ),
7106        );
7107
7108        utils::result(
7109            vips_op_response,
7110            out_out,
7111            Error::OperationError("Ifthenelse (vips_ifthenelse) failed".to_string()),
7112        )
7113    }
7114
7115    /// VipsInsert (insert), insert image @sub into @main at @x, @y
7116    /// returns `VipsImage` - Output image
7117    ///
7118    /// sub: `&VipsImage` -> Sub-image to insert into main image
7119    ///
7120    /// x: `i32` -> Left edge of sub in main
7121    ///
7122    /// y: `i32` -> Top edge of sub in main
7123    pub fn insert(&self, sub: &VipsImage, x: i32, y: i32) -> Result<VipsImage> {
7124        let mut out_out = VipsImage::from(null_mut());
7125        let vips_op_response = call(
7126            "insert",
7127            VOption::new()
7128                .set(
7129                    "main",
7130                    self,
7131                )
7132                .set("sub", sub)
7133                .set(
7134                    "out",
7135                    &mut out_out,
7136                )
7137                .set("x", x)
7138                .set("y", y),
7139        );
7140
7141        utils::result(
7142            vips_op_response,
7143            out_out,
7144            Error::OperationError("Insert (vips_insert) failed".to_string()),
7145        )
7146    }
7147
7148    /// VipsInsert (insert), insert image @sub into @main at @x, @y
7149    /// returns `VipsImage` - Output image
7150    ///
7151    /// sub: `&VipsImage` -> Sub-image to insert into main image
7152    ///
7153    /// x: `i32` -> Left edge of sub in main
7154    ///
7155    /// y: `i32` -> Top edge of sub in main
7156    ///
7157    /// <ins>Optional arguments</ins>
7158    ///
7159    /// expand: `bool` -> Expand output to hold all of both inputs
7160    ///
7161    /// background: `&[f64]` -> Color for new pixels
7162    pub fn insert_with_opts(
7163        &self,
7164        sub: &VipsImage,
7165        x: i32,
7166        y: i32,
7167        option: VOption,
7168    ) -> Result<VipsImage> {
7169        let mut out_out = VipsImage::from(null_mut());
7170        let vips_op_response = call(
7171            "insert",
7172            option
7173                .set(
7174                    "main",
7175                    self,
7176                )
7177                .set("sub", sub)
7178                .set(
7179                    "out",
7180                    &mut out_out,
7181                )
7182                .set("x", x)
7183                .set("y", y),
7184        );
7185
7186        utils::result(
7187            vips_op_response,
7188            out_out,
7189            Error::OperationError("Insert (vips_insert) failed".to_string()),
7190        )
7191    }
7192
7193    /// VipsInvert (invert), invert an image
7194    /// returns `VipsImage` - Output image
7195    pub fn invert(&self) -> Result<VipsImage> {
7196        let mut out_out = VipsImage::from(null_mut());
7197        let vips_op_response = call(
7198            "invert",
7199            VOption::new()
7200                .set("in", self)
7201                .set(
7202                    "out",
7203                    &mut out_out,
7204                ),
7205        );
7206
7207        utils::result(
7208            vips_op_response,
7209            out_out,
7210            Error::OperationError("Invert (vips_invert) failed".to_string()),
7211        )
7212    }
7213
7214    /// VipsInvertlut (invertlut), build an inverted look-up table
7215    /// returns `VipsImage` - Output image
7216    pub fn invertlut(&self) -> Result<VipsImage> {
7217        let mut out_out = VipsImage::from(null_mut());
7218        let vips_op_response = call(
7219            "invertlut",
7220            VOption::new()
7221                .set("in", self)
7222                .set(
7223                    "out",
7224                    &mut out_out,
7225                ),
7226        );
7227
7228        utils::result(
7229            vips_op_response,
7230            out_out,
7231            Error::OperationError("Invertlut (vips_invertlut) failed".to_string()),
7232        )
7233    }
7234
7235    /// VipsInvertlut (invertlut), build an inverted look-up table
7236    /// returns `VipsImage` - Output image
7237    ///
7238    /// <ins>Optional arguments</ins>
7239    ///
7240    /// size: `i32` -> LUT size to generate
7241    pub fn invertlut_with_opts(&self, option: VOption) -> Result<VipsImage> {
7242        let mut out_out = VipsImage::from(null_mut());
7243        let vips_op_response = call(
7244            "invertlut",
7245            option
7246                .set("in", self)
7247                .set(
7248                    "out",
7249                    &mut out_out,
7250                ),
7251        );
7252
7253        utils::result(
7254            vips_op_response,
7255            out_out,
7256            Error::OperationError("Invertlut (vips_invertlut) failed".to_string()),
7257        )
7258    }
7259
7260    /// VipsInvfft (invfft), inverse FFT
7261    /// returns `VipsImage` - Output image
7262    pub fn invfft(&self) -> Result<VipsImage> {
7263        let mut out_out = VipsImage::from(null_mut());
7264        let vips_op_response = call(
7265            "invfft",
7266            VOption::new()
7267                .set("in", self)
7268                .set(
7269                    "out",
7270                    &mut out_out,
7271                ),
7272        );
7273
7274        utils::result(
7275            vips_op_response,
7276            out_out,
7277            Error::OperationError("Invfft (vips_invfft) failed".to_string()),
7278        )
7279    }
7280
7281    /// VipsInvfft (invfft), inverse FFT
7282    /// returns `VipsImage` - Output image
7283    ///
7284    /// <ins>Optional arguments</ins>
7285    ///
7286    /// real: `bool` -> Output only the real part of the transform
7287    pub fn invfft_with_opts(&self, option: VOption) -> Result<VipsImage> {
7288        let mut out_out = VipsImage::from(null_mut());
7289        let vips_op_response = call(
7290            "invfft",
7291            option
7292                .set("in", self)
7293                .set(
7294                    "out",
7295                    &mut out_out,
7296                ),
7297        );
7298
7299        utils::result(
7300            vips_op_response,
7301            out_out,
7302            Error::OperationError("Invfft (vips_invfft) failed".to_string()),
7303        )
7304    }
7305
7306    /// VipsJoin (join), join a pair of images
7307    /// returns `VipsImage` - Output image
7308    ///
7309    /// in2: `&VipsImage` -> Second input image
7310    ///
7311    /// direction: `Direction` -> Join left-right or up-down
7312    pub fn join(&self, in2: &VipsImage, direction: Direction) -> Result<VipsImage> {
7313        let mut out_out = VipsImage::from(null_mut());
7314        let vips_op_response = call(
7315            "join",
7316            VOption::new()
7317                .set(
7318                    "in1", self,
7319                )
7320                .set("in2", in2)
7321                .set(
7322                    "out",
7323                    &mut out_out,
7324                )
7325                .set(
7326                    "direction",
7327                    direction as i32,
7328                ),
7329        );
7330
7331        utils::result(
7332            vips_op_response,
7333            out_out,
7334            Error::OperationError("Join (vips_join) failed".to_string()),
7335        )
7336    }
7337
7338    /// VipsJoin (join), join a pair of images
7339    /// returns `VipsImage` - Output image
7340    ///
7341    /// in2: `&VipsImage` -> Second input image
7342    ///
7343    /// direction: `Direction` -> Join left-right or up-down
7344    ///
7345    /// <ins>Optional arguments</ins>
7346    ///
7347    /// expand: `bool` -> Expand output to hold all of both inputs
7348    ///
7349    /// shim: `i32` -> Pixels between images
7350    ///
7351    /// background: `&[f64]` -> Colour for new pixels
7352    ///
7353    /// align: [`Align`] -> Align on the low, centre or high coordinate edge
7354    pub fn join_with_opts(
7355        &self,
7356        in2: &VipsImage,
7357        direction: Direction,
7358        option: VOption,
7359    ) -> Result<VipsImage> {
7360        let mut out_out = VipsImage::from(null_mut());
7361        let vips_op_response = call(
7362            "join",
7363            option
7364                .set(
7365                    "in1", self,
7366                )
7367                .set("in2", in2)
7368                .set(
7369                    "out",
7370                    &mut out_out,
7371                )
7372                .set(
7373                    "direction",
7374                    direction as i32,
7375                ),
7376        );
7377
7378        utils::result(
7379            vips_op_response,
7380            out_out,
7381            Error::OperationError("Join (vips_join) failed".to_string()),
7382        )
7383    }
7384
7385    /// VipsForeignLoadJp2kFile (jp2kload), load JPEG2000 image (.j2k, .jp2, .jpt, .j2c, .jpc), priority=0, untrusted, is_a, get_flags, header, load
7386    /// returns `VipsImage` - Output image
7387    ///
7388    /// filename: `&str` -> Filename to load from
7389    pub fn jp2kload(filename: &str) -> Result<VipsImage> {
7390        let mut out_out = VipsImage::from(null_mut());
7391        let vips_op_response = call(
7392            "jp2kload",
7393            VOption::new()
7394                .set(
7395                    "filename",
7396                    filename,
7397                )
7398                .set(
7399                    "out",
7400                    &mut out_out,
7401                ),
7402        );
7403
7404        utils::result(
7405            vips_op_response,
7406            out_out,
7407            Error::OperationError("Jp2Kload (vips_jp2kload) failed".to_string()),
7408        )
7409    }
7410
7411    /// VipsForeignLoadJp2kFile (jp2kload), load JPEG2000 image (.j2k, .jp2, .jpt, .j2c, .jpc), priority=0, untrusted, is_a, get_flags, header, load
7412    /// returns `VipsImage` - Output image
7413    ///
7414    /// filename: `&str` -> Filename to load from
7415    ///
7416    /// <ins>Optional arguments</ins>
7417    ///
7418    /// page: `i32` -> Load this page from the image
7419    ///
7420    /// oneshot: `bool` -> Load images a frame at a time
7421    ///
7422    /// flags: [`ForeignFlags`] -> Flags for this file
7423    ///
7424    /// memory: `bool` -> Force open via memory
7425    ///
7426    /// access: [`Access`] -> Required access pattern for this file
7427    ///
7428    /// fail_on: [`FailOn`] -> Error level to fail on
7429    ///
7430    /// revalidate: `bool` -> Don't use a cached result for this operation
7431    pub fn jp2kload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
7432        let mut out_out = VipsImage::from(null_mut());
7433        let vips_op_response = call(
7434            "jp2kload",
7435            option
7436                .set(
7437                    "filename",
7438                    filename,
7439                )
7440                .set(
7441                    "out",
7442                    &mut out_out,
7443                ),
7444        );
7445
7446        utils::result(
7447            vips_op_response,
7448            out_out,
7449            Error::OperationError("Jp2Kload (vips_jp2kload) failed".to_string()),
7450        )
7451    }
7452
7453    /// VipsForeignLoadJp2kBuffer (jp2kload_buffer), load JPEG2000 image, priority=0, untrusted, is_a_buffer, get_flags, header, load
7454    /// returns `VipsImage` - Output image
7455    ///
7456    /// buffer: `&[u8]` -> Buffer to load from
7457    pub fn jp2kload_buffer(buffer: &[u8]) -> Result<VipsImage> {
7458        let blob = unsafe {
7459            vips_blob_new(
7460                None,
7461                buffer.as_ptr() as _,
7462                buffer.len() as _,
7463            )
7464        };
7465        let mut out_out = VipsImage::from(null_mut());
7466        let vips_op_response = call(
7467            "jp2kload_buffer",
7468            VOption::new()
7469                .set(
7470                    "buffer",
7471                    &VipsBlob::from(blob),
7472                )
7473                .set(
7474                    "out",
7475                    &mut out_out,
7476                ),
7477        );
7478        unsafe { vips_area_unref(&mut (*blob).area) };
7479        utils::result(
7480            vips_op_response,
7481            out_out,
7482            Error::OperationError("Jp2KloadBuffer (vips_jp2kload_buffer) failed".to_string()),
7483        )
7484    }
7485
7486    /// VipsForeignLoadJp2kBuffer (jp2kload_buffer), load JPEG2000 image, priority=0, untrusted, is_a_buffer, get_flags, header, load
7487    /// returns `VipsImage` - Output image
7488    ///
7489    /// buffer: `&[u8]` -> Buffer to load from
7490    ///
7491    /// <ins>Optional arguments</ins>
7492    ///
7493    /// page: `i32` -> Load this page from the image
7494    ///
7495    /// oneshot: `bool` -> Load images a frame at a time
7496    ///
7497    /// flags: [`ForeignFlags`] -> Flags for this file
7498    ///
7499    /// memory: `bool` -> Force open via memory
7500    ///
7501    /// access: [`Access`] -> Required access pattern for this file
7502    ///
7503    /// fail_on: [`FailOn`] -> Error level to fail on
7504    ///
7505    /// revalidate: `bool` -> Don't use a cached result for this operation
7506    pub fn jp2kload_buffer_with_opts(buffer: &[u8], option: VOption) -> Result<VipsImage> {
7507        let blob = unsafe {
7508            vips_blob_new(
7509                None,
7510                buffer.as_ptr() as _,
7511                buffer.len() as _,
7512            )
7513        };
7514        let mut out_out = VipsImage::from(null_mut());
7515        let vips_op_response = call(
7516            "jp2kload_buffer",
7517            option
7518                .set(
7519                    "buffer",
7520                    &VipsBlob::from(blob),
7521                )
7522                .set(
7523                    "out",
7524                    &mut out_out,
7525                ),
7526        );
7527        unsafe { vips_area_unref(&mut (*blob).area) };
7528        utils::result(
7529            vips_op_response,
7530            out_out,
7531            Error::OperationError("Jp2KloadBuffer (vips_jp2kload_buffer) failed".to_string()),
7532        )
7533    }
7534
7535    /// VipsForeignLoadJp2kSource (jp2kload_source), load JPEG2000 image, priority=0, untrusted, is_a_source, get_flags, header, load
7536    /// returns `VipsImage` - Output image
7537    ///
7538    /// source: `&VipsSource` -> Source to load from
7539    pub fn jp2kload_source(source: &VipsSource) -> Result<VipsImage> {
7540        let mut out_out = VipsImage::from(null_mut());
7541        let vips_op_response = call(
7542            "jp2kload_source",
7543            VOption::new()
7544                .set(
7545                    "source",
7546                    source,
7547                )
7548                .set(
7549                    "out",
7550                    &mut out_out,
7551                ),
7552        );
7553
7554        utils::result(
7555            vips_op_response,
7556            out_out,
7557            Error::OperationError("Jp2KloadSource (vips_jp2kload_source) failed".to_string()),
7558        )
7559    }
7560
7561    /// VipsForeignLoadJp2kSource (jp2kload_source), load JPEG2000 image, priority=0, untrusted, is_a_source, get_flags, header, load
7562    /// returns `VipsImage` - Output image
7563    ///
7564    /// source: `&VipsSource` -> Source to load from
7565    ///
7566    /// <ins>Optional arguments</ins>
7567    ///
7568    /// page: `i32` -> Load this page from the image
7569    ///
7570    /// oneshot: `bool` -> Load images a frame at a time
7571    ///
7572    /// flags: [`ForeignFlags`] -> Flags for this file
7573    ///
7574    /// memory: `bool` -> Force open via memory
7575    ///
7576    /// access: [`Access`] -> Required access pattern for this file
7577    ///
7578    /// fail_on: [`FailOn`] -> Error level to fail on
7579    ///
7580    /// revalidate: `bool` -> Don't use a cached result for this operation
7581    pub fn jp2kload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
7582        let mut out_out = VipsImage::from(null_mut());
7583        let vips_op_response = call(
7584            "jp2kload_source",
7585            option
7586                .set(
7587                    "source",
7588                    source,
7589                )
7590                .set(
7591                    "out",
7592                    &mut out_out,
7593                ),
7594        );
7595
7596        utils::result(
7597            vips_op_response,
7598            out_out,
7599            Error::OperationError("Jp2KloadSource (vips_jp2kload_source) failed".to_string()),
7600        )
7601    }
7602
7603    /// VipsForeignSaveJp2kFile (jp2ksave), save image in JPEG2000 format (.j2k, .jp2, .jpt, .j2c, .jpc), priority=0,
7604    ///
7605    /// filename: `&str` -> Filename to save to
7606    pub fn jp2ksave(&self, filename: &str) -> Result<()> {
7607        let vips_op_response = call(
7608            "jp2ksave",
7609            VOption::new()
7610                .set("in", self)
7611                .set(
7612                    "filename",
7613                    filename,
7614                ),
7615        );
7616
7617        utils::result(
7618            vips_op_response,
7619            (),
7620            Error::OperationError("Jp2Ksave (vips_jp2ksave) failed".to_string()),
7621        )
7622    }
7623
7624    /// VipsForeignSaveJp2kFile (jp2ksave), save image in JPEG2000 format (.j2k, .jp2, .jpt, .j2c, .jpc), priority=0,
7625    ///
7626    /// filename: `&str` -> Filename to save to
7627    ///
7628    /// <ins>Optional arguments</ins>
7629    ///
7630    /// tile_width: `i32` -> Tile width in pixels
7631    ///
7632    /// tile_height: `i32` -> Tile height in pixels
7633    ///
7634    /// lossless: `bool` -> Enable lossless compression
7635    ///
7636    /// Q: `i32` -> Q factor
7637    ///
7638    /// subsample_mode: [`ForeignSubsample`] -> Select chroma subsample operation mode
7639    ///
7640    /// keep: [`ForeignKeep`] -> Which metadata to retain
7641    ///
7642    /// background: `&[f64]` -> Background value
7643    ///
7644    /// page_height: `i32` -> Set page height for multipage save
7645    ///
7646    /// profile: `&str` -> Filename of ICC profile to embed
7647    pub fn jp2ksave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
7648        let vips_op_response = call(
7649            "jp2ksave",
7650            option
7651                .set("in", self)
7652                .set(
7653                    "filename",
7654                    filename,
7655                ),
7656        );
7657
7658        utils::result(
7659            vips_op_response,
7660            (),
7661            Error::OperationError("Jp2Ksave (vips_jp2ksave) failed".to_string()),
7662        )
7663    }
7664
7665    /// VipsForeignSaveJp2kBuffer (jp2ksave_buffer), save image in JPEG2000 format (.j2k, .jp2, .jpt, .j2c, .jpc), priority=0,
7666    /// returns `Vec<u8>` - Buffer to save to
7667    pub fn jp2ksave_buffer(&self) -> Result<Vec<u8>> {
7668        let mut buffer_out = VipsBlob::from(null_mut());
7669        let vips_op_response = call(
7670            "jp2ksave_buffer",
7671            VOption::new()
7672                .set("in", self)
7673                .set(
7674                    "buffer",
7675                    &mut buffer_out,
7676                ),
7677        );
7678
7679        utils::result(
7680            vips_op_response,
7681            buffer_out.into(),
7682            Error::OperationError("Jp2KsaveBuffer (vips_jp2ksave_buffer) failed".to_string()),
7683        )
7684    }
7685
7686    /// VipsForeignSaveJp2kBuffer (jp2ksave_buffer), save image in JPEG2000 format (.j2k, .jp2, .jpt, .j2c, .jpc), priority=0,
7687    /// returns `Vec<u8>` - Buffer to save to
7688    ///
7689    /// <ins>Optional arguments</ins>
7690    ///
7691    /// tile_width: `i32` -> Tile width in pixels
7692    ///
7693    /// tile_height: `i32` -> Tile height in pixels
7694    ///
7695    /// lossless: `bool` -> Enable lossless compression
7696    ///
7697    /// Q: `i32` -> Q factor
7698    ///
7699    /// subsample_mode: [`ForeignSubsample`] -> Select chroma subsample operation mode
7700    ///
7701    /// keep: [`ForeignKeep`] -> Which metadata to retain
7702    ///
7703    /// background: `&[f64]` -> Background value
7704    ///
7705    /// page_height: `i32` -> Set page height for multipage save
7706    ///
7707    /// profile: `&str` -> Filename of ICC profile to embed
7708    pub fn jp2ksave_buffer_with_opts(&self, option: VOption) -> Result<Vec<u8>> {
7709        let mut buffer_out = VipsBlob::from(null_mut());
7710        let vips_op_response = call(
7711            "jp2ksave_buffer",
7712            option
7713                .set("in", self)
7714                .set(
7715                    "buffer",
7716                    &mut buffer_out,
7717                ),
7718        );
7719
7720        utils::result(
7721            vips_op_response,
7722            buffer_out.into(),
7723            Error::OperationError("Jp2KsaveBuffer (vips_jp2ksave_buffer) failed".to_string()),
7724        )
7725    }
7726
7727    /// VipsForeignSaveJp2kTarget (jp2ksave_target), save image in JPEG2000 format (.j2k, .jp2, .jpt, .j2c, .jpc), priority=0,
7728    ///
7729    /// target: `&VipsTarget` -> Target to save to
7730    pub fn jp2ksave_target(&self, target: &VipsTarget) -> Result<()> {
7731        let vips_op_response = call(
7732            "jp2ksave_target",
7733            VOption::new()
7734                .set("in", self)
7735                .set(
7736                    "target",
7737                    target,
7738                ),
7739        );
7740
7741        utils::result(
7742            vips_op_response,
7743            (),
7744            Error::OperationError("Jp2KsaveTarget (vips_jp2ksave_target) failed".to_string()),
7745        )
7746    }
7747
7748    /// VipsForeignSaveJp2kTarget (jp2ksave_target), save image in JPEG2000 format (.j2k, .jp2, .jpt, .j2c, .jpc), priority=0,
7749    ///
7750    /// target: `&VipsTarget` -> Target to save to
7751    ///
7752    /// <ins>Optional arguments</ins>
7753    ///
7754    /// tile_width: `i32` -> Tile width in pixels
7755    ///
7756    /// tile_height: `i32` -> Tile height in pixels
7757    ///
7758    /// lossless: `bool` -> Enable lossless compression
7759    ///
7760    /// Q: `i32` -> Q factor
7761    ///
7762    /// subsample_mode: [`ForeignSubsample`] -> Select chroma subsample operation mode
7763    ///
7764    /// keep: [`ForeignKeep`] -> Which metadata to retain
7765    ///
7766    /// background: `&[f64]` -> Background value
7767    ///
7768    /// page_height: `i32` -> Set page height for multipage save
7769    ///
7770    /// profile: `&str` -> Filename of ICC profile to embed
7771    pub fn jp2ksave_target_with_opts(&self, target: &VipsTarget, option: VOption) -> Result<()> {
7772        let vips_op_response = call(
7773            "jp2ksave_target",
7774            option
7775                .set("in", self)
7776                .set(
7777                    "target",
7778                    target,
7779                ),
7780        );
7781
7782        utils::result(
7783            vips_op_response,
7784            (),
7785            Error::OperationError("Jp2KsaveTarget (vips_jp2ksave_target) failed".to_string()),
7786        )
7787    }
7788
7789    /// VipsForeignLoadJpegFile (jpegload), load jpeg from file (.jpg, .jpeg, .jpe, .jfif), priority=50, is_a, get_flags, get_flags_filename, header, load
7790    /// returns `VipsImage` - Output image
7791    ///
7792    /// filename: `&str` -> Filename to load from
7793    pub fn jpegload(filename: &str) -> Result<VipsImage> {
7794        let mut out_out = VipsImage::from(null_mut());
7795        let vips_op_response = call(
7796            "jpegload",
7797            VOption::new()
7798                .set(
7799                    "filename",
7800                    filename,
7801                )
7802                .set(
7803                    "out",
7804                    &mut out_out,
7805                ),
7806        );
7807
7808        utils::result(
7809            vips_op_response,
7810            out_out,
7811            Error::OperationError("Jpegload (vips_jpegload) failed".to_string()),
7812        )
7813    }
7814
7815    /// VipsForeignLoadJpegFile (jpegload), load jpeg from file (.jpg, .jpeg, .jpe, .jfif), priority=50, is_a, get_flags, get_flags_filename, header, load
7816    /// returns `VipsImage` - Output image
7817    ///
7818    /// filename: `&str` -> Filename to load from
7819    ///
7820    /// <ins>Optional arguments</ins>
7821    ///
7822    /// shrink: `i32` -> Shrink factor on load
7823    ///
7824    /// autorotate: `bool` -> Rotate image using exif orientation
7825    ///
7826    /// unlimited: `bool` -> Remove all denial of service limits
7827    ///
7828    /// flags: [`ForeignFlags`] -> Flags for this file
7829    ///
7830    /// memory: `bool` -> Force open via memory
7831    ///
7832    /// access: [`Access`] -> Required access pattern for this file
7833    ///
7834    /// fail_on: [`FailOn`] -> Error level to fail on
7835    ///
7836    /// revalidate: `bool` -> Don't use a cached result for this operation
7837    pub fn jpegload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
7838        let mut out_out = VipsImage::from(null_mut());
7839        let vips_op_response = call(
7840            "jpegload",
7841            option
7842                .set(
7843                    "filename",
7844                    filename,
7845                )
7846                .set(
7847                    "out",
7848                    &mut out_out,
7849                ),
7850        );
7851
7852        utils::result(
7853            vips_op_response,
7854            out_out,
7855            Error::OperationError("Jpegload (vips_jpegload) failed".to_string()),
7856        )
7857    }
7858
7859    /// VipsForeignLoadJpegBuffer (jpegload_buffer), load jpeg from buffer, priority=50, is_a_buffer, get_flags, get_flags_filename, header, load
7860    /// returns `VipsImage` - Output image
7861    ///
7862    /// buffer: `&[u8]` -> Buffer to load from
7863    pub fn jpegload_buffer(buffer: &[u8]) -> Result<VipsImage> {
7864        let blob = unsafe {
7865            vips_blob_new(
7866                None,
7867                buffer.as_ptr() as _,
7868                buffer.len() as _,
7869            )
7870        };
7871        let mut out_out = VipsImage::from(null_mut());
7872        let vips_op_response = call(
7873            "jpegload_buffer",
7874            VOption::new()
7875                .set(
7876                    "buffer",
7877                    &VipsBlob::from(blob),
7878                )
7879                .set(
7880                    "out",
7881                    &mut out_out,
7882                ),
7883        );
7884        unsafe { vips_area_unref(&mut (*blob).area) };
7885        utils::result(
7886            vips_op_response,
7887            out_out,
7888            Error::OperationError("JpegloadBuffer (vips_jpegload_buffer) failed".to_string()),
7889        )
7890    }
7891
7892    /// VipsForeignLoadJpegBuffer (jpegload_buffer), load jpeg from buffer, priority=50, is_a_buffer, get_flags, get_flags_filename, header, load
7893    /// returns `VipsImage` - Output image
7894    ///
7895    /// buffer: `&[u8]` -> Buffer to load from
7896    ///
7897    /// <ins>Optional arguments</ins>
7898    ///
7899    /// shrink: `i32` -> Shrink factor on load
7900    ///
7901    /// autorotate: `bool` -> Rotate image using exif orientation
7902    ///
7903    /// unlimited: `bool` -> Remove all denial of service limits
7904    ///
7905    /// flags: [`ForeignFlags`] -> Flags for this file
7906    ///
7907    /// memory: `bool` -> Force open via memory
7908    ///
7909    /// access: [`Access`] -> Required access pattern for this file
7910    ///
7911    /// fail_on: [`FailOn`] -> Error level to fail on
7912    ///
7913    /// revalidate: `bool` -> Don't use a cached result for this operation
7914    pub fn jpegload_buffer_with_opts(buffer: &[u8], option: VOption) -> Result<VipsImage> {
7915        let blob = unsafe {
7916            vips_blob_new(
7917                None,
7918                buffer.as_ptr() as _,
7919                buffer.len() as _,
7920            )
7921        };
7922        let mut out_out = VipsImage::from(null_mut());
7923        let vips_op_response = call(
7924            "jpegload_buffer",
7925            option
7926                .set(
7927                    "buffer",
7928                    &VipsBlob::from(blob),
7929                )
7930                .set(
7931                    "out",
7932                    &mut out_out,
7933                ),
7934        );
7935        unsafe { vips_area_unref(&mut (*blob).area) };
7936        utils::result(
7937            vips_op_response,
7938            out_out,
7939            Error::OperationError("JpegloadBuffer (vips_jpegload_buffer) failed".to_string()),
7940        )
7941    }
7942
7943    /// VipsForeignLoadJpegSource (jpegload_source), load image from jpeg source, priority=50, is_a_source, get_flags, get_flags_filename, header, load
7944    /// returns `VipsImage` - Output image
7945    ///
7946    /// source: `&VipsSource` -> Source to load from
7947    pub fn jpegload_source(source: &VipsSource) -> Result<VipsImage> {
7948        let mut out_out = VipsImage::from(null_mut());
7949        let vips_op_response = call(
7950            "jpegload_source",
7951            VOption::new()
7952                .set(
7953                    "source",
7954                    source,
7955                )
7956                .set(
7957                    "out",
7958                    &mut out_out,
7959                ),
7960        );
7961
7962        utils::result(
7963            vips_op_response,
7964            out_out,
7965            Error::OperationError("JpegloadSource (vips_jpegload_source) failed".to_string()),
7966        )
7967    }
7968
7969    /// VipsForeignLoadJpegSource (jpegload_source), load image from jpeg source, priority=50, is_a_source, get_flags, get_flags_filename, header, load
7970    /// returns `VipsImage` - Output image
7971    ///
7972    /// source: `&VipsSource` -> Source to load from
7973    ///
7974    /// <ins>Optional arguments</ins>
7975    ///
7976    /// shrink: `i32` -> Shrink factor on load
7977    ///
7978    /// autorotate: `bool` -> Rotate image using exif orientation
7979    ///
7980    /// unlimited: `bool` -> Remove all denial of service limits
7981    ///
7982    /// flags: [`ForeignFlags`] -> Flags for this file
7983    ///
7984    /// memory: `bool` -> Force open via memory
7985    ///
7986    /// access: [`Access`] -> Required access pattern for this file
7987    ///
7988    /// fail_on: [`FailOn`] -> Error level to fail on
7989    ///
7990    /// revalidate: `bool` -> Don't use a cached result for this operation
7991    pub fn jpegload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
7992        let mut out_out = VipsImage::from(null_mut());
7993        let vips_op_response = call(
7994            "jpegload_source",
7995            option
7996                .set(
7997                    "source",
7998                    source,
7999                )
8000                .set(
8001                    "out",
8002                    &mut out_out,
8003                ),
8004        );
8005
8006        utils::result(
8007            vips_op_response,
8008            out_out,
8009            Error::OperationError("JpegloadSource (vips_jpegload_source) failed".to_string()),
8010        )
8011    }
8012
8013    /// VipsForeignSaveJpegFile (jpegsave), save image to jpeg file (.jpg, .jpeg, .jpe, .jfif), priority=0, mono rgb cmyk
8014    ///
8015    /// filename: `&str` -> Filename to save to
8016    pub fn jpegsave(&self, filename: &str) -> Result<()> {
8017        let vips_op_response = call(
8018            "jpegsave",
8019            VOption::new()
8020                .set("in", self)
8021                .set(
8022                    "filename",
8023                    filename,
8024                ),
8025        );
8026
8027        utils::result(
8028            vips_op_response,
8029            (),
8030            Error::OperationError("Jpegsave (vips_jpegsave) failed".to_string()),
8031        )
8032    }
8033
8034    /// VipsForeignSaveJpegFile (jpegsave), save image to jpeg file (.jpg, .jpeg, .jpe, .jfif), priority=0, mono rgb cmyk
8035    ///
8036    /// filename: `&str` -> Filename to save to
8037    ///
8038    /// <ins>Optional arguments</ins>
8039    ///
8040    /// Q: `i32` -> Q factor
8041    ///
8042    /// optimize_coding: `bool` -> Compute optimal Huffman coding tables
8043    ///
8044    /// interlace: `bool` -> Generate an interlaced (progressive) jpeg
8045    ///
8046    /// trellis_quant: `bool` -> Apply trellis quantisation to each 8x8 block
8047    ///
8048    /// overshoot_deringing: `bool` -> Apply overshooting to samples with extreme values
8049    ///
8050    /// optimize_scans: `bool` -> Split spectrum of DCT coefficients into separate scans
8051    ///
8052    /// quant_table: `i32` -> Use predefined quantization table with given index
8053    ///
8054    /// subsample_mode: [`ForeignSubsample`] -> Select chroma subsample operation mode
8055    ///
8056    /// restart_interval: `i32` -> Add restart markers every specified number of mcu
8057    ///
8058    /// keep: [`ForeignKeep`] -> Which metadata to retain
8059    ///
8060    /// background: `&[f64]` -> Background value
8061    ///
8062    /// page_height: `i32` -> Set page height for multipage save
8063    ///
8064    /// profile: `&str` -> Filename of ICC profile to embed
8065    pub fn jpegsave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
8066        let vips_op_response = call(
8067            "jpegsave",
8068            option
8069                .set("in", self)
8070                .set(
8071                    "filename",
8072                    filename,
8073                ),
8074        );
8075
8076        utils::result(
8077            vips_op_response,
8078            (),
8079            Error::OperationError("Jpegsave (vips_jpegsave) failed".to_string()),
8080        )
8081    }
8082
8083    /// VipsForeignSaveJpegBuffer (jpegsave_buffer), save image to jpeg buffer (.jpg, .jpeg, .jpe, .jfif), priority=0, mono rgb cmyk
8084    /// returns `Vec<u8>` - Buffer to save to
8085    pub fn jpegsave_buffer(&self) -> Result<Vec<u8>> {
8086        let mut buffer_out = VipsBlob::from(null_mut());
8087        let vips_op_response = call(
8088            "jpegsave_buffer",
8089            VOption::new()
8090                .set("in", self)
8091                .set(
8092                    "buffer",
8093                    &mut buffer_out,
8094                ),
8095        );
8096
8097        utils::result(
8098            vips_op_response,
8099            buffer_out.into(),
8100            Error::OperationError("JpegsaveBuffer (vips_jpegsave_buffer) failed".to_string()),
8101        )
8102    }
8103
8104    /// VipsForeignSaveJpegBuffer (jpegsave_buffer), save image to jpeg buffer (.jpg, .jpeg, .jpe, .jfif), priority=0, mono rgb cmyk
8105    /// returns `Vec<u8>` - Buffer to save to
8106    ///
8107    /// <ins>Optional arguments</ins>
8108    ///
8109    /// Q: `i32` -> Q factor
8110    ///
8111    /// optimize_coding: `bool` -> Compute optimal Huffman coding tables
8112    ///
8113    /// interlace: `bool` -> Generate an interlaced (progressive) jpeg
8114    ///
8115    /// trellis_quant: `bool` -> Apply trellis quantisation to each 8x8 block
8116    ///
8117    /// overshoot_deringing: `bool` -> Apply overshooting to samples with extreme values
8118    ///
8119    /// optimize_scans: `bool` -> Split spectrum of DCT coefficients into separate scans
8120    ///
8121    /// quant_table: `i32` -> Use predefined quantization table with given index
8122    ///
8123    /// subsample_mode: [`ForeignSubsample`] -> Select chroma subsample operation mode
8124    ///
8125    /// restart_interval: `i32` -> Add restart markers every specified number of mcu
8126    ///
8127    /// keep: [`ForeignKeep`] -> Which metadata to retain
8128    ///
8129    /// background: `&[f64]` -> Background value
8130    ///
8131    /// page_height: `i32` -> Set page height for multipage save
8132    ///
8133    /// profile: `&str` -> Filename of ICC profile to embed
8134    pub fn jpegsave_buffer_with_opts(&self, option: VOption) -> Result<Vec<u8>> {
8135        let mut buffer_out = VipsBlob::from(null_mut());
8136        let vips_op_response = call(
8137            "jpegsave_buffer",
8138            option
8139                .set("in", self)
8140                .set(
8141                    "buffer",
8142                    &mut buffer_out,
8143                ),
8144        );
8145
8146        utils::result(
8147            vips_op_response,
8148            buffer_out.into(),
8149            Error::OperationError("JpegsaveBuffer (vips_jpegsave_buffer) failed".to_string()),
8150        )
8151    }
8152
8153    /// VipsForeignSaveJpegMime (jpegsave_mime), save image to jpeg mime (.jpg, .jpeg, .jpe, .jfif), priority=0, mono rgb cmyk
8154    pub fn jpegsave_mime(&self) -> Result<()> {
8155        let vips_op_response = call(
8156            "jpegsave_mime",
8157            VOption::new().set("in", self),
8158        );
8159
8160        utils::result(
8161            vips_op_response,
8162            (),
8163            Error::OperationError("JpegsaveMime (vips_jpegsave_mime) failed".to_string()),
8164        )
8165    }
8166
8167    /// VipsForeignSaveJpegMime (jpegsave_mime), save image to jpeg mime (.jpg, .jpeg, .jpe, .jfif), priority=0, mono rgb cmyk
8168    ///
8169    /// <ins>Optional arguments</ins>
8170    ///
8171    /// Q: `i32` -> Q factor
8172    ///
8173    /// optimize_coding: `bool` -> Compute optimal Huffman coding tables
8174    ///
8175    /// interlace: `bool` -> Generate an interlaced (progressive) jpeg
8176    ///
8177    /// trellis_quant: `bool` -> Apply trellis quantisation to each 8x8 block
8178    ///
8179    /// overshoot_deringing: `bool` -> Apply overshooting to samples with extreme values
8180    ///
8181    /// optimize_scans: `bool` -> Split spectrum of DCT coefficients into separate scans
8182    ///
8183    /// quant_table: `i32` -> Use predefined quantization table with given index
8184    ///
8185    /// subsample_mode: [`ForeignSubsample`] -> Select chroma subsample operation mode
8186    ///
8187    /// restart_interval: `i32` -> Add restart markers every specified number of mcu
8188    ///
8189    /// keep: [`ForeignKeep`] -> Which metadata to retain
8190    ///
8191    /// background: `&[f64]` -> Background value
8192    ///
8193    /// page_height: `i32` -> Set page height for multipage save
8194    ///
8195    /// profile: `&str` -> Filename of ICC profile to embed
8196    pub fn jpegsave_mime_with_opts(&self, option: VOption) -> Result<()> {
8197        let vips_op_response = call(
8198            "jpegsave_mime",
8199            option.set("in", self),
8200        );
8201
8202        utils::result(
8203            vips_op_response,
8204            (),
8205            Error::OperationError("JpegsaveMime (vips_jpegsave_mime) failed".to_string()),
8206        )
8207    }
8208
8209    /// VipsForeignSaveJpegTarget (jpegsave_target), save image to jpeg target (.jpg, .jpeg, .jpe, .jfif), priority=0, mono rgb cmyk
8210    ///
8211    /// target: `&VipsTarget` -> Target to save to
8212    pub fn jpegsave_target(&self, target: &VipsTarget) -> Result<()> {
8213        let vips_op_response = call(
8214            "jpegsave_target",
8215            VOption::new()
8216                .set("in", self)
8217                .set(
8218                    "target",
8219                    target,
8220                ),
8221        );
8222
8223        utils::result(
8224            vips_op_response,
8225            (),
8226            Error::OperationError("JpegsaveTarget (vips_jpegsave_target) failed".to_string()),
8227        )
8228    }
8229
8230    /// VipsForeignSaveJpegTarget (jpegsave_target), save image to jpeg target (.jpg, .jpeg, .jpe, .jfif), priority=0, mono rgb cmyk
8231    ///
8232    /// target: `&VipsTarget` -> Target to save to
8233    ///
8234    /// <ins>Optional arguments</ins>
8235    ///
8236    /// Q: `i32` -> Q factor
8237    ///
8238    /// optimize_coding: `bool` -> Compute optimal Huffman coding tables
8239    ///
8240    /// interlace: `bool` -> Generate an interlaced (progressive) jpeg
8241    ///
8242    /// trellis_quant: `bool` -> Apply trellis quantisation to each 8x8 block
8243    ///
8244    /// overshoot_deringing: `bool` -> Apply overshooting to samples with extreme values
8245    ///
8246    /// optimize_scans: `bool` -> Split spectrum of DCT coefficients into separate scans
8247    ///
8248    /// quant_table: `i32` -> Use predefined quantization table with given index
8249    ///
8250    /// subsample_mode: [`ForeignSubsample`] -> Select chroma subsample operation mode
8251    ///
8252    /// restart_interval: `i32` -> Add restart markers every specified number of mcu
8253    ///
8254    /// keep: [`ForeignKeep`] -> Which metadata to retain
8255    ///
8256    /// background: `&[f64]` -> Background value
8257    ///
8258    /// page_height: `i32` -> Set page height for multipage save
8259    ///
8260    /// profile: `&str` -> Filename of ICC profile to embed
8261    pub fn jpegsave_target_with_opts(&self, target: &VipsTarget, option: VOption) -> Result<()> {
8262        let vips_op_response = call(
8263            "jpegsave_target",
8264            option
8265                .set("in", self)
8266                .set(
8267                    "target",
8268                    target,
8269                ),
8270        );
8271
8272        utils::result(
8273            vips_op_response,
8274            (),
8275            Error::OperationError("JpegsaveTarget (vips_jpegsave_target) failed".to_string()),
8276        )
8277    }
8278
8279    /// VipsForeignLoadJxlFile (jxlload), load JPEG-XL image (.jxl), priority=0, untrusted, is_a, get_flags, header, load
8280    /// returns `VipsImage` - Output image
8281    ///
8282    /// filename: `&str` -> Filename to load from
8283    pub fn jxlload(filename: &str) -> Result<VipsImage> {
8284        let mut out_out = VipsImage::from(null_mut());
8285        let vips_op_response = call(
8286            "jxlload",
8287            VOption::new()
8288                .set(
8289                    "filename",
8290                    filename,
8291                )
8292                .set(
8293                    "out",
8294                    &mut out_out,
8295                ),
8296        );
8297
8298        utils::result(
8299            vips_op_response,
8300            out_out,
8301            Error::OperationError("Jxlload (vips_jxlload) failed".to_string()),
8302        )
8303    }
8304
8305    /// VipsForeignLoadJxlFile (jxlload), load JPEG-XL image (.jxl), priority=0, untrusted, is_a, get_flags, header, load
8306    /// returns `VipsImage` - Output image
8307    ///
8308    /// filename: `&str` -> Filename to load from
8309    ///
8310    /// <ins>Optional arguments</ins>
8311    ///
8312    /// page: `i32` -> First page to load
8313    ///
8314    /// n: `i32` -> Number of pages to load, -1 for all
8315    ///
8316    /// flags: [`ForeignFlags`] -> Flags for this file
8317    ///
8318    /// memory: `bool` -> Force open via memory
8319    ///
8320    /// access: [`Access`] -> Required access pattern for this file
8321    ///
8322    /// fail_on: [`FailOn`] -> Error level to fail on
8323    ///
8324    /// revalidate: `bool` -> Don't use a cached result for this operation
8325    pub fn jxlload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
8326        let mut out_out = VipsImage::from(null_mut());
8327        let vips_op_response = call(
8328            "jxlload",
8329            option
8330                .set(
8331                    "filename",
8332                    filename,
8333                )
8334                .set(
8335                    "out",
8336                    &mut out_out,
8337                ),
8338        );
8339
8340        utils::result(
8341            vips_op_response,
8342            out_out,
8343            Error::OperationError("Jxlload (vips_jxlload) failed".to_string()),
8344        )
8345    }
8346
8347    /// VipsForeignLoadJxlBuffer (jxlload_buffer), load JPEG-XL image, priority=0, untrusted, is_a_buffer, get_flags, header, load
8348    /// returns `VipsImage` - Output image
8349    ///
8350    /// buffer: `&[u8]` -> Buffer to load from
8351    pub fn jxlload_buffer(buffer: &[u8]) -> Result<VipsImage> {
8352        let blob = unsafe {
8353            vips_blob_new(
8354                None,
8355                buffer.as_ptr() as _,
8356                buffer.len() as _,
8357            )
8358        };
8359        let mut out_out = VipsImage::from(null_mut());
8360        let vips_op_response = call(
8361            "jxlload_buffer",
8362            VOption::new()
8363                .set(
8364                    "buffer",
8365                    &VipsBlob::from(blob),
8366                )
8367                .set(
8368                    "out",
8369                    &mut out_out,
8370                ),
8371        );
8372        unsafe { vips_area_unref(&mut (*blob).area) };
8373        utils::result(
8374            vips_op_response,
8375            out_out,
8376            Error::OperationError("JxlloadBuffer (vips_jxlload_buffer) failed".to_string()),
8377        )
8378    }
8379
8380    /// VipsForeignLoadJxlBuffer (jxlload_buffer), load JPEG-XL image, priority=0, untrusted, is_a_buffer, get_flags, header, load
8381    /// returns `VipsImage` - Output image
8382    ///
8383    /// buffer: `&[u8]` -> Buffer to load from
8384    ///
8385    /// <ins>Optional arguments</ins>
8386    ///
8387    /// page: `i32` -> First page to load
8388    ///
8389    /// n: `i32` -> Number of pages to load, -1 for all
8390    ///
8391    /// flags: [`ForeignFlags`] -> Flags for this file
8392    ///
8393    /// memory: `bool` -> Force open via memory
8394    ///
8395    /// access: [`Access`] -> Required access pattern for this file
8396    ///
8397    /// fail_on: [`FailOn`] -> Error level to fail on
8398    ///
8399    /// revalidate: `bool` -> Don't use a cached result for this operation
8400    pub fn jxlload_buffer_with_opts(buffer: &[u8], option: VOption) -> Result<VipsImage> {
8401        let blob = unsafe {
8402            vips_blob_new(
8403                None,
8404                buffer.as_ptr() as _,
8405                buffer.len() as _,
8406            )
8407        };
8408        let mut out_out = VipsImage::from(null_mut());
8409        let vips_op_response = call(
8410            "jxlload_buffer",
8411            option
8412                .set(
8413                    "buffer",
8414                    &VipsBlob::from(blob),
8415                )
8416                .set(
8417                    "out",
8418                    &mut out_out,
8419                ),
8420        );
8421        unsafe { vips_area_unref(&mut (*blob).area) };
8422        utils::result(
8423            vips_op_response,
8424            out_out,
8425            Error::OperationError("JxlloadBuffer (vips_jxlload_buffer) failed".to_string()),
8426        )
8427    }
8428
8429    /// VipsForeignLoadJxlSource (jxlload_source), load JPEG-XL image, priority=0, untrusted, is_a_source, get_flags, header, load
8430    /// returns `VipsImage` - Output image
8431    ///
8432    /// source: `&VipsSource` -> Source to load from
8433    pub fn jxlload_source(source: &VipsSource) -> Result<VipsImage> {
8434        let mut out_out = VipsImage::from(null_mut());
8435        let vips_op_response = call(
8436            "jxlload_source",
8437            VOption::new()
8438                .set(
8439                    "source",
8440                    source,
8441                )
8442                .set(
8443                    "out",
8444                    &mut out_out,
8445                ),
8446        );
8447
8448        utils::result(
8449            vips_op_response,
8450            out_out,
8451            Error::OperationError("JxlloadSource (vips_jxlload_source) failed".to_string()),
8452        )
8453    }
8454
8455    /// VipsForeignLoadJxlSource (jxlload_source), load JPEG-XL image, priority=0, untrusted, is_a_source, get_flags, header, load
8456    /// returns `VipsImage` - Output image
8457    ///
8458    /// source: `&VipsSource` -> Source to load from
8459    ///
8460    /// <ins>Optional arguments</ins>
8461    ///
8462    /// page: `i32` -> First page to load
8463    ///
8464    /// n: `i32` -> Number of pages to load, -1 for all
8465    ///
8466    /// flags: [`ForeignFlags`] -> Flags for this file
8467    ///
8468    /// memory: `bool` -> Force open via memory
8469    ///
8470    /// access: [`Access`] -> Required access pattern for this file
8471    ///
8472    /// fail_on: [`FailOn`] -> Error level to fail on
8473    ///
8474    /// revalidate: `bool` -> Don't use a cached result for this operation
8475    pub fn jxlload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
8476        let mut out_out = VipsImage::from(null_mut());
8477        let vips_op_response = call(
8478            "jxlload_source",
8479            option
8480                .set(
8481                    "source",
8482                    source,
8483                )
8484                .set(
8485                    "out",
8486                    &mut out_out,
8487                ),
8488        );
8489
8490        utils::result(
8491            vips_op_response,
8492            out_out,
8493            Error::OperationError("JxlloadSource (vips_jxlload_source) failed".to_string()),
8494        )
8495    }
8496
8497    /// VipsForeignSaveJxlFile (jxlsave), save image in JPEG-XL format (.jxl), priority=0, untrusted,
8498    ///
8499    /// filename: `&str` -> Filename to save to
8500    pub fn jxlsave(&self, filename: &str) -> Result<()> {
8501        let vips_op_response = call(
8502            "jxlsave",
8503            VOption::new()
8504                .set("in", self)
8505                .set(
8506                    "filename",
8507                    filename,
8508                ),
8509        );
8510
8511        utils::result(
8512            vips_op_response,
8513            (),
8514            Error::OperationError("Jxlsave (vips_jxlsave) failed".to_string()),
8515        )
8516    }
8517
8518    /// VipsForeignSaveJxlFile (jxlsave), save image in JPEG-XL format (.jxl), priority=0, untrusted,
8519    ///
8520    /// filename: `&str` -> Filename to save to
8521    ///
8522    /// <ins>Optional arguments</ins>
8523    ///
8524    /// tier: `i32` -> Decode speed tier
8525    ///
8526    /// distance: `f64` -> Target butteraugli distance
8527    ///
8528    /// effort: `i32` -> Encoding effort
8529    ///
8530    /// lossless: `bool` -> Enable lossless compression
8531    ///
8532    /// Q: `i32` -> Quality factor
8533    ///
8534    /// keep: [`ForeignKeep`] -> Which metadata to retain
8535    ///
8536    /// background: `&[f64]` -> Background value
8537    ///
8538    /// page_height: `i32` -> Set page height for multipage save
8539    ///
8540    /// profile: `&str` -> Filename of ICC profile to embed
8541    pub fn jxlsave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
8542        let vips_op_response = call(
8543            "jxlsave",
8544            option
8545                .set("in", self)
8546                .set(
8547                    "filename",
8548                    filename,
8549                ),
8550        );
8551
8552        utils::result(
8553            vips_op_response,
8554            (),
8555            Error::OperationError("Jxlsave (vips_jxlsave) failed".to_string()),
8556        )
8557    }
8558
8559    /// VipsForeignSaveJxlBuffer (jxlsave_buffer), save image in JPEG-XL format (.jxl), priority=0, untrusted,
8560    /// returns `Vec<u8>` - Buffer to save to
8561    pub fn jxlsave_buffer(&self) -> Result<Vec<u8>> {
8562        let mut buffer_out = VipsBlob::from(null_mut());
8563        let vips_op_response = call(
8564            "jxlsave_buffer",
8565            VOption::new()
8566                .set("in", self)
8567                .set(
8568                    "buffer",
8569                    &mut buffer_out,
8570                ),
8571        );
8572
8573        utils::result(
8574            vips_op_response,
8575            buffer_out.into(),
8576            Error::OperationError("JxlsaveBuffer (vips_jxlsave_buffer) failed".to_string()),
8577        )
8578    }
8579
8580    /// VipsForeignSaveJxlBuffer (jxlsave_buffer), save image in JPEG-XL format (.jxl), priority=0, untrusted,
8581    /// returns `Vec<u8>` - Buffer to save to
8582    ///
8583    /// <ins>Optional arguments</ins>
8584    ///
8585    /// tier: `i32` -> Decode speed tier
8586    ///
8587    /// distance: `f64` -> Target butteraugli distance
8588    ///
8589    /// effort: `i32` -> Encoding effort
8590    ///
8591    /// lossless: `bool` -> Enable lossless compression
8592    ///
8593    /// Q: `i32` -> Quality factor
8594    ///
8595    /// keep: [`ForeignKeep`] -> Which metadata to retain
8596    ///
8597    /// background: `&[f64]` -> Background value
8598    ///
8599    /// page_height: `i32` -> Set page height for multipage save
8600    ///
8601    /// profile: `&str` -> Filename of ICC profile to embed
8602    pub fn jxlsave_buffer_with_opts(&self, option: VOption) -> Result<Vec<u8>> {
8603        let mut buffer_out = VipsBlob::from(null_mut());
8604        let vips_op_response = call(
8605            "jxlsave_buffer",
8606            option
8607                .set("in", self)
8608                .set(
8609                    "buffer",
8610                    &mut buffer_out,
8611                ),
8612        );
8613
8614        utils::result(
8615            vips_op_response,
8616            buffer_out.into(),
8617            Error::OperationError("JxlsaveBuffer (vips_jxlsave_buffer) failed".to_string()),
8618        )
8619    }
8620
8621    /// VipsForeignSaveJxlTarget (jxlsave_target), save image in JPEG-XL format (.jxl), priority=0, untrusted,
8622    ///
8623    /// target: `&VipsTarget` -> Target to save to
8624    pub fn jxlsave_target(&self, target: &VipsTarget) -> Result<()> {
8625        let vips_op_response = call(
8626            "jxlsave_target",
8627            VOption::new()
8628                .set("in", self)
8629                .set(
8630                    "target",
8631                    target,
8632                ),
8633        );
8634
8635        utils::result(
8636            vips_op_response,
8637            (),
8638            Error::OperationError("JxlsaveTarget (vips_jxlsave_target) failed".to_string()),
8639        )
8640    }
8641
8642    /// VipsForeignSaveJxlTarget (jxlsave_target), save image in JPEG-XL format (.jxl), priority=0, untrusted,
8643    ///
8644    /// target: `&VipsTarget` -> Target to save to
8645    ///
8646    /// <ins>Optional arguments</ins>
8647    ///
8648    /// tier: `i32` -> Decode speed tier
8649    ///
8650    /// distance: `f64` -> Target butteraugli distance
8651    ///
8652    /// effort: `i32` -> Encoding effort
8653    ///
8654    /// lossless: `bool` -> Enable lossless compression
8655    ///
8656    /// Q: `i32` -> Quality factor
8657    ///
8658    /// keep: [`ForeignKeep`] -> Which metadata to retain
8659    ///
8660    /// background: `&[f64]` -> Background value
8661    ///
8662    /// page_height: `i32` -> Set page height for multipage save
8663    ///
8664    /// profile: `&str` -> Filename of ICC profile to embed
8665    pub fn jxlsave_target_with_opts(&self, target: &VipsTarget, option: VOption) -> Result<()> {
8666        let vips_op_response = call(
8667            "jxlsave_target",
8668            option
8669                .set("in", self)
8670                .set(
8671                    "target",
8672                    target,
8673                ),
8674        );
8675
8676        utils::result(
8677            vips_op_response,
8678            (),
8679            Error::OperationError("JxlsaveTarget (vips_jxlsave_target) failed".to_string()),
8680        )
8681    }
8682
8683    /// VipsLabelregions (labelregions), label regions in an image
8684    /// returns `VipsImage` - Mask of region labels
8685    pub fn labelregions(&self) -> Result<VipsImage> {
8686        let mut mask_out = VipsImage::from(null_mut());
8687        let vips_op_response = call(
8688            "labelregions",
8689            VOption::new()
8690                .set("in", self)
8691                .set(
8692                    "mask",
8693                    &mut mask_out,
8694                ),
8695        );
8696
8697        utils::result(
8698            vips_op_response,
8699            mask_out,
8700            Error::OperationError("Labelregions (vips_labelregions) failed".to_string()),
8701        )
8702    }
8703
8704    /// VipsLabelregions (labelregions), label regions in an image
8705    /// returns `VipsImage` - Mask of region labels
8706    ///
8707    /// <ins>Optional arguments</ins>
8708    ///
8709    /// segments: `&mut i32` -> Number of discrete contiguous regions
8710    pub fn labelregions_with_opts(&self, option: VOption) -> Result<VipsImage> {
8711        let mut mask_out = VipsImage::from(null_mut());
8712        let vips_op_response = call(
8713            "labelregions",
8714            option
8715                .set("in", self)
8716                .set(
8717                    "mask",
8718                    &mut mask_out,
8719                ),
8720        );
8721
8722        utils::result(
8723            vips_op_response,
8724            mask_out,
8725            Error::OperationError("Labelregions (vips_labelregions) failed".to_string()),
8726        )
8727    }
8728
8729    /// VipsLinear (linear), calculate (a * in + b)
8730    /// returns `VipsImage` - Output image
8731    ///
8732    /// a: `&[f64]` -> Multiply by this
8733    ///
8734    /// b: `&[f64]` -> Add this
8735    pub fn linear(&self, a: &[f64], b: &[f64]) -> Result<VipsImage> {
8736        let mut out_out = VipsImage::from(null_mut());
8737        let vips_op_response = call(
8738            "linear",
8739            VOption::new()
8740                .set("in", self)
8741                .set(
8742                    "out",
8743                    &mut out_out,
8744                )
8745                .set("a", a)
8746                .set("b", b),
8747        );
8748
8749        utils::result(
8750            vips_op_response,
8751            out_out,
8752            Error::OperationError("Linear (vips_linear) failed".to_string()),
8753        )
8754    }
8755
8756    /// VipsLinear (linear), calculate (a * in + b)
8757    /// returns `VipsImage` - Output image
8758    ///
8759    /// a: `&[f64]` -> Multiply by this
8760    ///
8761    /// b: `&[f64]` -> Add this
8762    ///
8763    /// <ins>Optional arguments</ins>
8764    ///
8765    /// uchar: `bool` -> Output should be uchar
8766    pub fn linear_with_opts(&self, a: &[f64], b: &[f64], option: VOption) -> Result<VipsImage> {
8767        let mut out_out = VipsImage::from(null_mut());
8768        let vips_op_response = call(
8769            "linear",
8770            option
8771                .set("in", self)
8772                .set(
8773                    "out",
8774                    &mut out_out,
8775                )
8776                .set("a", a)
8777                .set("b", b),
8778        );
8779
8780        utils::result(
8781            vips_op_response,
8782            out_out,
8783            Error::OperationError("Linear (vips_linear) failed".to_string()),
8784        )
8785    }
8786
8787    /// VipsLineCache (linecache), cache an image as a set of lines
8788    /// returns `VipsImage` - Output image
8789    pub fn linecache(&self) -> Result<VipsImage> {
8790        let mut out_out = VipsImage::from(null_mut());
8791        let vips_op_response = call(
8792            "linecache",
8793            VOption::new()
8794                .set("in", self)
8795                .set(
8796                    "out",
8797                    &mut out_out,
8798                ),
8799        );
8800
8801        utils::result(
8802            vips_op_response,
8803            out_out,
8804            Error::OperationError("Linecache (vips_linecache) failed".to_string()),
8805        )
8806    }
8807
8808    /// VipsLineCache (linecache), cache an image as a set of lines
8809    /// returns `VipsImage` - Output image
8810    ///
8811    /// <ins>Optional arguments</ins>
8812    ///
8813    /// tile_height: `i32` -> Tile height in pixels
8814    ///
8815    /// access: [`Access`] -> Expected access pattern
8816    ///
8817    /// threaded: `bool` -> Allow threaded access
8818    ///
8819    /// persistent: `bool` -> Keep cache between evaluations
8820    pub fn linecache_with_opts(&self, option: VOption) -> Result<VipsImage> {
8821        let mut out_out = VipsImage::from(null_mut());
8822        let vips_op_response = call(
8823            "linecache",
8824            option
8825                .set("in", self)
8826                .set(
8827                    "out",
8828                    &mut out_out,
8829                ),
8830        );
8831
8832        utils::result(
8833            vips_op_response,
8834            out_out,
8835            Error::OperationError("Linecache (vips_linecache) failed".to_string()),
8836        )
8837    }
8838
8839    /// VipsLogmat (logmat), make a Laplacian of Gaussian image
8840    /// returns `VipsImage` - Output image
8841    ///
8842    /// sigma: `f64` -> Radius of Gaussian
8843    ///
8844    /// min_ampl: `f64` -> Minimum amplitude of Gaussian
8845    pub fn logmat(sigma: f64, min_ampl: f64) -> Result<VipsImage> {
8846        let mut out_out = VipsImage::from(null_mut());
8847        let vips_op_response = call(
8848            "logmat",
8849            VOption::new()
8850                .set(
8851                    "out",
8852                    &mut out_out,
8853                )
8854                .set(
8855                    "sigma",
8856                    sigma,
8857                )
8858                .set(
8859                    "min-ampl",
8860                    min_ampl,
8861                ),
8862        );
8863
8864        utils::result(
8865            vips_op_response,
8866            out_out,
8867            Error::OperationError("Logmat (vips_logmat) failed".to_string()),
8868        )
8869    }
8870
8871    /// VipsLogmat (logmat), make a Laplacian of Gaussian image
8872    /// returns `VipsImage` - Output image
8873    ///
8874    /// sigma: `f64` -> Radius of Gaussian
8875    ///
8876    /// min_ampl: `f64` -> Minimum amplitude of Gaussian
8877    ///
8878    /// <ins>Optional arguments</ins>
8879    ///
8880    /// separable: `bool` -> Generate separable Gaussian
8881    ///
8882    /// precision: [`Precision`] -> Generate with this precision
8883    pub fn logmat_with_opts(sigma: f64, min_ampl: f64, option: VOption) -> Result<VipsImage> {
8884        let mut out_out = VipsImage::from(null_mut());
8885        let vips_op_response = call(
8886            "logmat",
8887            option
8888                .set(
8889                    "out",
8890                    &mut out_out,
8891                )
8892                .set(
8893                    "sigma",
8894                    sigma,
8895                )
8896                .set(
8897                    "min-ampl",
8898                    min_ampl,
8899                ),
8900        );
8901
8902        utils::result(
8903            vips_op_response,
8904            out_out,
8905            Error::OperationError("Logmat (vips_logmat) failed".to_string()),
8906        )
8907    }
8908
8909    /// VipsForeignLoadMagickFile (magickload), load file with ImageMagick, priority=-100, untrusted, is_a, get_flags, get_flags_filename, header
8910    /// returns `VipsImage` - Output image
8911    ///
8912    /// filename: `&str` -> Filename to load from
8913    pub fn magickload(filename: &str) -> Result<VipsImage> {
8914        let mut out_out = VipsImage::from(null_mut());
8915        let vips_op_response = call(
8916            "magickload",
8917            VOption::new()
8918                .set(
8919                    "filename",
8920                    filename,
8921                )
8922                .set(
8923                    "out",
8924                    &mut out_out,
8925                ),
8926        );
8927
8928        utils::result(
8929            vips_op_response,
8930            out_out,
8931            Error::OperationError("Magickload (vips_magickload) failed".to_string()),
8932        )
8933    }
8934
8935    /// VipsForeignLoadMagickFile (magickload), load file with ImageMagick, priority=-100, untrusted, is_a, get_flags, get_flags_filename, header
8936    /// returns `VipsImage` - Output image
8937    ///
8938    /// filename: `&str` -> Filename to load from
8939    ///
8940    /// <ins>Optional arguments</ins>
8941    ///
8942    /// density: `&str` -> Canvas resolution for rendering vector formats like SVG
8943    ///
8944    /// page: `i32` -> First page to load
8945    ///
8946    /// n: `i32` -> Number of pages to load, -1 for all
8947    ///
8948    /// flags: [`ForeignFlags`] -> Flags for this file
8949    ///
8950    /// memory: `bool` -> Force open via memory
8951    ///
8952    /// access: [`Access`] -> Required access pattern for this file
8953    ///
8954    /// fail_on: [`FailOn`] -> Error level to fail on
8955    ///
8956    /// revalidate: `bool` -> Don't use a cached result for this operation
8957    pub fn magickload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
8958        let mut out_out = VipsImage::from(null_mut());
8959        let vips_op_response = call(
8960            "magickload",
8961            option
8962                .set(
8963                    "filename",
8964                    filename,
8965                )
8966                .set(
8967                    "out",
8968                    &mut out_out,
8969                ),
8970        );
8971
8972        utils::result(
8973            vips_op_response,
8974            out_out,
8975            Error::OperationError("Magickload (vips_magickload) failed".to_string()),
8976        )
8977    }
8978
8979    /// VipsForeignLoadMagickBuffer (magickload_buffer), load buffer with ImageMagick, priority=-100, untrusted, is_a_buffer, get_flags, get_flags_filename, header
8980    /// returns `VipsImage` - Output image
8981    ///
8982    /// buffer: `&[u8]` -> Buffer to load from
8983    pub fn magickload_buffer(buffer: &[u8]) -> Result<VipsImage> {
8984        let blob = unsafe {
8985            vips_blob_new(
8986                None,
8987                buffer.as_ptr() as _,
8988                buffer.len() as _,
8989            )
8990        };
8991        let mut out_out = VipsImage::from(null_mut());
8992        let vips_op_response = call(
8993            "magickload_buffer",
8994            VOption::new()
8995                .set(
8996                    "buffer",
8997                    &VipsBlob::from(blob),
8998                )
8999                .set(
9000                    "out",
9001                    &mut out_out,
9002                ),
9003        );
9004        unsafe { vips_area_unref(&mut (*blob).area) };
9005        utils::result(
9006            vips_op_response,
9007            out_out,
9008            Error::OperationError("MagickloadBuffer (vips_magickload_buffer) failed".to_string()),
9009        )
9010    }
9011
9012    /// VipsForeignLoadMagickBuffer (magickload_buffer), load buffer with ImageMagick, priority=-100, untrusted, is_a_buffer, get_flags, get_flags_filename, header
9013    /// returns `VipsImage` - Output image
9014    ///
9015    /// buffer: `&[u8]` -> Buffer to load from
9016    ///
9017    /// <ins>Optional arguments</ins>
9018    ///
9019    /// density: `&str` -> Canvas resolution for rendering vector formats like SVG
9020    ///
9021    /// page: `i32` -> First page to load
9022    ///
9023    /// n: `i32` -> Number of pages to load, -1 for all
9024    ///
9025    /// flags: [`ForeignFlags`] -> Flags for this file
9026    ///
9027    /// memory: `bool` -> Force open via memory
9028    ///
9029    /// access: [`Access`] -> Required access pattern for this file
9030    ///
9031    /// fail_on: [`FailOn`] -> Error level to fail on
9032    ///
9033    /// revalidate: `bool` -> Don't use a cached result for this operation
9034    pub fn magickload_buffer_with_opts(buffer: &[u8], option: VOption) -> Result<VipsImage> {
9035        let blob = unsafe {
9036            vips_blob_new(
9037                None,
9038                buffer.as_ptr() as _,
9039                buffer.len() as _,
9040            )
9041        };
9042        let mut out_out = VipsImage::from(null_mut());
9043        let vips_op_response = call(
9044            "magickload_buffer",
9045            option
9046                .set(
9047                    "buffer",
9048                    &VipsBlob::from(blob),
9049                )
9050                .set(
9051                    "out",
9052                    &mut out_out,
9053                ),
9054        );
9055        unsafe { vips_area_unref(&mut (*blob).area) };
9056        utils::result(
9057            vips_op_response,
9058            out_out,
9059            Error::OperationError("MagickloadBuffer (vips_magickload_buffer) failed".to_string()),
9060        )
9061    }
9062
9063    /// VipsForeignSaveMagickFile (magicksave), save file with ImageMagick (), priority=-100, untrusted,
9064    ///
9065    /// filename: `&str` -> Filename to save to
9066    pub fn magicksave(&self, filename: &str) -> Result<()> {
9067        let vips_op_response = call(
9068            "magicksave",
9069            VOption::new()
9070                .set("in", self)
9071                .set(
9072                    "filename",
9073                    filename,
9074                ),
9075        );
9076
9077        utils::result(
9078            vips_op_response,
9079            (),
9080            Error::OperationError("Magicksave (vips_magicksave) failed".to_string()),
9081        )
9082    }
9083
9084    /// VipsForeignSaveMagickFile (magicksave), save file with ImageMagick (), priority=-100, untrusted,
9085    ///
9086    /// filename: `&str` -> Filename to save to
9087    ///
9088    /// <ins>Optional arguments</ins>
9089    ///
9090    /// format: `&str` -> Format to save in
9091    ///
9092    /// quality: `i32` -> Quality to use
9093    ///
9094    /// optimize_gif_frames: `bool` -> Apply GIF frames optimization
9095    ///
9096    /// optimize_gif_transparency: `bool` -> Apply GIF transparency optimization
9097    ///
9098    /// bitdepth: `i32` -> Number of bits per pixel
9099    ///
9100    /// keep: [`ForeignKeep`] -> Which metadata to retain
9101    ///
9102    /// background: `&[f64]` -> Background value
9103    ///
9104    /// page_height: `i32` -> Set page height for multipage save
9105    ///
9106    /// profile: `&str` -> Filename of ICC profile to embed
9107    pub fn magicksave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
9108        let vips_op_response = call(
9109            "magicksave",
9110            option
9111                .set("in", self)
9112                .set(
9113                    "filename",
9114                    filename,
9115                ),
9116        );
9117
9118        utils::result(
9119            vips_op_response,
9120            (),
9121            Error::OperationError("Magicksave (vips_magicksave) failed".to_string()),
9122        )
9123    }
9124
9125    /// VipsForeignSaveMagickBuffer (magicksave_buffer), save image to magick buffer (), priority=-100, untrusted,
9126    /// returns `Vec<u8>` - Buffer to save to
9127    pub fn magicksave_buffer(&self) -> Result<Vec<u8>> {
9128        let mut buffer_out = VipsBlob::from(null_mut());
9129        let vips_op_response = call(
9130            "magicksave_buffer",
9131            VOption::new()
9132                .set("in", self)
9133                .set(
9134                    "buffer",
9135                    &mut buffer_out,
9136                ),
9137        );
9138
9139        utils::result(
9140            vips_op_response,
9141            buffer_out.into(),
9142            Error::OperationError("MagicksaveBuffer (vips_magicksave_buffer) failed".to_string()),
9143        )
9144    }
9145
9146    /// VipsForeignSaveMagickBuffer (magicksave_buffer), save image to magick buffer (), priority=-100, untrusted,
9147    /// returns `Vec<u8>` - Buffer to save to
9148    ///
9149    /// <ins>Optional arguments</ins>
9150    ///
9151    /// format: `&str` -> Format to save in
9152    ///
9153    /// quality: `i32` -> Quality to use
9154    ///
9155    /// optimize_gif_frames: `bool` -> Apply GIF frames optimization
9156    ///
9157    /// optimize_gif_transparency: `bool` -> Apply GIF transparency optimization
9158    ///
9159    /// bitdepth: `i32` -> Number of bits per pixel
9160    ///
9161    /// keep: [`ForeignKeep`] -> Which metadata to retain
9162    ///
9163    /// background: `&[f64]` -> Background value
9164    ///
9165    /// page_height: `i32` -> Set page height for multipage save
9166    ///
9167    /// profile: `&str` -> Filename of ICC profile to embed
9168    pub fn magicksave_buffer_with_opts(&self, option: VOption) -> Result<Vec<u8>> {
9169        let mut buffer_out = VipsBlob::from(null_mut());
9170        let vips_op_response = call(
9171            "magicksave_buffer",
9172            option
9173                .set("in", self)
9174                .set(
9175                    "buffer",
9176                    &mut buffer_out,
9177                ),
9178        );
9179
9180        utils::result(
9181            vips_op_response,
9182            buffer_out.into(),
9183            Error::OperationError("MagicksaveBuffer (vips_magicksave_buffer) failed".to_string()),
9184        )
9185    }
9186
9187    /// VipsMapim (mapim), resample with a map image
9188    /// returns `VipsImage` - Output image
9189    ///
9190    /// index: `&VipsImage` -> Index pixels with this
9191    pub fn mapim(&self, index: &VipsImage) -> Result<VipsImage> {
9192        let mut out_out = VipsImage::from(null_mut());
9193        let vips_op_response = call(
9194            "mapim",
9195            VOption::new()
9196                .set("in", self)
9197                .set(
9198                    "out",
9199                    &mut out_out,
9200                )
9201                .set(
9202                    "index",
9203                    index,
9204                ),
9205        );
9206
9207        utils::result(
9208            vips_op_response,
9209            out_out,
9210            Error::OperationError("Mapim (vips_mapim) failed".to_string()),
9211        )
9212    }
9213
9214    /// VipsMapim (mapim), resample with a map image
9215    /// returns `VipsImage` - Output image
9216    ///
9217    /// index: `&VipsImage` -> Index pixels with this
9218    ///
9219    /// <ins>Optional arguments</ins>
9220    ///
9221    /// interpolate: `&VipsInterpolate` -> Interpolate pixels with this
9222    ///
9223    /// background: `&[f64]` -> Background value
9224    ///
9225    /// premultiplied: `bool` -> Images have premultiplied alpha
9226    ///
9227    /// extend: [`Extend`] -> How to generate the extra pixels
9228    pub fn mapim_with_opts(&self, index: &VipsImage, option: VOption) -> Result<VipsImage> {
9229        let mut out_out = VipsImage::from(null_mut());
9230        let vips_op_response = call(
9231            "mapim",
9232            option
9233                .set("in", self)
9234                .set(
9235                    "out",
9236                    &mut out_out,
9237                )
9238                .set(
9239                    "index",
9240                    index,
9241                ),
9242        );
9243
9244        utils::result(
9245            vips_op_response,
9246            out_out,
9247            Error::OperationError("Mapim (vips_mapim) failed".to_string()),
9248        )
9249    }
9250
9251    /// VipsMaplut (maplut), map an image though a lut
9252    /// returns `VipsImage` - Output image
9253    ///
9254    /// lut: `&VipsImage` -> Look-up table image
9255    pub fn maplut(&self, lut: &VipsImage) -> Result<VipsImage> {
9256        let mut out_out = VipsImage::from(null_mut());
9257        let vips_op_response = call(
9258            "maplut",
9259            VOption::new()
9260                .set("in", self)
9261                .set(
9262                    "out",
9263                    &mut out_out,
9264                )
9265                .set("lut", lut),
9266        );
9267
9268        utils::result(
9269            vips_op_response,
9270            out_out,
9271            Error::OperationError("Maplut (vips_maplut) failed".to_string()),
9272        )
9273    }
9274
9275    /// VipsMaplut (maplut), map an image though a lut
9276    /// returns `VipsImage` - Output image
9277    ///
9278    /// lut: `&VipsImage` -> Look-up table image
9279    ///
9280    /// <ins>Optional arguments</ins>
9281    ///
9282    /// band: `i32` -> Apply one-band lut to this band of in
9283    pub fn maplut_with_opts(&self, lut: &VipsImage, option: VOption) -> Result<VipsImage> {
9284        let mut out_out = VipsImage::from(null_mut());
9285        let vips_op_response = call(
9286            "maplut",
9287            option
9288                .set("in", self)
9289                .set(
9290                    "out",
9291                    &mut out_out,
9292                )
9293                .set("lut", lut),
9294        );
9295
9296        utils::result(
9297            vips_op_response,
9298            out_out,
9299            Error::OperationError("Maplut (vips_maplut) failed".to_string()),
9300        )
9301    }
9302
9303    /// VipsMaskButterworth (mask_butterworth), make a butterworth filter
9304    /// returns `VipsImage` - Output image
9305    ///
9306    /// width: `i32` -> Image width in pixels
9307    ///
9308    /// height: `i32` -> Image height in pixels
9309    ///
9310    /// order: `f64` -> Filter order
9311    ///
9312    /// frequency_cutoff: `f64` -> Frequency cutoff
9313    ///
9314    /// amplitude_cutoff: `f64` -> Amplitude cutoff
9315    pub fn mask_butterworth(
9316        width: i32,
9317        height: i32,
9318        order: f64,
9319        frequency_cutoff: f64,
9320        amplitude_cutoff: f64,
9321    ) -> Result<VipsImage> {
9322        let mut out_out = VipsImage::from(null_mut());
9323        let vips_op_response = call(
9324            "mask_butterworth",
9325            VOption::new()
9326                .set(
9327                    "out",
9328                    &mut out_out,
9329                )
9330                .set(
9331                    "width",
9332                    width,
9333                )
9334                .set(
9335                    "height",
9336                    height,
9337                )
9338                .set(
9339                    "order",
9340                    order,
9341                )
9342                .set(
9343                    "frequency-cutoff",
9344                    frequency_cutoff,
9345                )
9346                .set(
9347                    "amplitude-cutoff",
9348                    amplitude_cutoff,
9349                ),
9350        );
9351
9352        utils::result(
9353            vips_op_response,
9354            out_out,
9355            Error::OperationError("MaskButterworth (vips_mask_butterworth) failed".to_string()),
9356        )
9357    }
9358
9359    /// VipsMaskButterworth (mask_butterworth), make a butterworth filter
9360    /// returns `VipsImage` - Output image
9361    ///
9362    /// width: `i32` -> Image width in pixels
9363    ///
9364    /// height: `i32` -> Image height in pixels
9365    ///
9366    /// order: `f64` -> Filter order
9367    ///
9368    /// frequency_cutoff: `f64` -> Frequency cutoff
9369    ///
9370    /// amplitude_cutoff: `f64` -> Amplitude cutoff
9371    ///
9372    /// <ins>Optional arguments</ins>
9373    ///
9374    /// uchar: `bool` -> Output an unsigned char image
9375    ///
9376    /// nodc: `bool` -> Remove DC component
9377    ///
9378    /// reject: `bool` -> Invert the sense of the filter
9379    ///
9380    /// optical: `bool` -> Rotate quadrants to optical space
9381    pub fn mask_butterworth_with_opts(
9382        width: i32,
9383        height: i32,
9384        order: f64,
9385        frequency_cutoff: f64,
9386        amplitude_cutoff: f64,
9387        option: VOption,
9388    ) -> Result<VipsImage> {
9389        let mut out_out = VipsImage::from(null_mut());
9390        let vips_op_response = call(
9391            "mask_butterworth",
9392            option
9393                .set(
9394                    "out",
9395                    &mut out_out,
9396                )
9397                .set(
9398                    "width",
9399                    width,
9400                )
9401                .set(
9402                    "height",
9403                    height,
9404                )
9405                .set(
9406                    "order",
9407                    order,
9408                )
9409                .set(
9410                    "frequency-cutoff",
9411                    frequency_cutoff,
9412                )
9413                .set(
9414                    "amplitude-cutoff",
9415                    amplitude_cutoff,
9416                ),
9417        );
9418
9419        utils::result(
9420            vips_op_response,
9421            out_out,
9422            Error::OperationError("MaskButterworth (vips_mask_butterworth) failed".to_string()),
9423        )
9424    }
9425
9426    /// VipsMaskButterworthBand (mask_butterworth_band), make a butterworth_band filter
9427    /// returns `VipsImage` - Output image
9428    ///
9429    /// width: `i32` -> Image width in pixels
9430    ///
9431    /// height: `i32` -> Image height in pixels
9432    ///
9433    /// order: `f64` -> Filter order
9434    ///
9435    /// frequency_cutoff_x: `f64` -> Frequency cutoff x
9436    ///
9437    /// frequency_cutoff_y: `f64` -> Frequency cutoff y
9438    ///
9439    /// radius: `f64` -> Radius of circle
9440    ///
9441    /// amplitude_cutoff: `f64` -> Amplitude cutoff
9442    pub fn mask_butterworth_band(
9443        width: i32,
9444        height: i32,
9445        order: f64,
9446        frequency_cutoff_x: f64,
9447        frequency_cutoff_y: f64,
9448        radius: f64,
9449        amplitude_cutoff: f64,
9450    ) -> Result<VipsImage> {
9451        let mut out_out = VipsImage::from(null_mut());
9452        let vips_op_response = call(
9453            "mask_butterworth_band",
9454            VOption::new()
9455                .set(
9456                    "out",
9457                    &mut out_out,
9458                )
9459                .set(
9460                    "width",
9461                    width,
9462                )
9463                .set(
9464                    "height",
9465                    height,
9466                )
9467                .set(
9468                    "order",
9469                    order,
9470                )
9471                .set(
9472                    "frequency-cutoff-x",
9473                    frequency_cutoff_x,
9474                )
9475                .set(
9476                    "frequency-cutoff-y",
9477                    frequency_cutoff_y,
9478                )
9479                .set(
9480                    "radius",
9481                    radius,
9482                )
9483                .set(
9484                    "amplitude-cutoff",
9485                    amplitude_cutoff,
9486                ),
9487        );
9488
9489        utils::result(
9490            vips_op_response,
9491            out_out,
9492            Error::OperationError(
9493                "MaskButterworthBand (vips_mask_butterworth_band) failed".to_string(),
9494            ),
9495        )
9496    }
9497
9498    /// VipsMaskButterworthBand (mask_butterworth_band), make a butterworth_band filter
9499    /// returns `VipsImage` - Output image
9500    ///
9501    /// width: `i32` -> Image width in pixels
9502    ///
9503    /// height: `i32` -> Image height in pixels
9504    ///
9505    /// order: `f64` -> Filter order
9506    ///
9507    /// frequency_cutoff_x: `f64` -> Frequency cutoff x
9508    ///
9509    /// frequency_cutoff_y: `f64` -> Frequency cutoff y
9510    ///
9511    /// radius: `f64` -> Radius of circle
9512    ///
9513    /// amplitude_cutoff: `f64` -> Amplitude cutoff
9514    ///
9515    /// <ins>Optional arguments</ins>
9516    ///
9517    /// uchar: `bool` -> Output an unsigned char image
9518    ///
9519    /// nodc: `bool` -> Remove DC component
9520    ///
9521    /// reject: `bool` -> Invert the sense of the filter
9522    ///
9523    /// optical: `bool` -> Rotate quadrants to optical space
9524    pub fn mask_butterworth_band_with_opts(
9525        width: i32,
9526        height: i32,
9527        order: f64,
9528        frequency_cutoff_x: f64,
9529        frequency_cutoff_y: f64,
9530        radius: f64,
9531        amplitude_cutoff: f64,
9532        option: VOption,
9533    ) -> Result<VipsImage> {
9534        let mut out_out = VipsImage::from(null_mut());
9535        let vips_op_response = call(
9536            "mask_butterworth_band",
9537            option
9538                .set(
9539                    "out",
9540                    &mut out_out,
9541                )
9542                .set(
9543                    "width",
9544                    width,
9545                )
9546                .set(
9547                    "height",
9548                    height,
9549                )
9550                .set(
9551                    "order",
9552                    order,
9553                )
9554                .set(
9555                    "frequency-cutoff-x",
9556                    frequency_cutoff_x,
9557                )
9558                .set(
9559                    "frequency-cutoff-y",
9560                    frequency_cutoff_y,
9561                )
9562                .set(
9563                    "radius",
9564                    radius,
9565                )
9566                .set(
9567                    "amplitude-cutoff",
9568                    amplitude_cutoff,
9569                ),
9570        );
9571
9572        utils::result(
9573            vips_op_response,
9574            out_out,
9575            Error::OperationError(
9576                "MaskButterworthBand (vips_mask_butterworth_band) failed".to_string(),
9577            ),
9578        )
9579    }
9580
9581    /// VipsMaskButterworthRing (mask_butterworth_ring), make a butterworth ring filter
9582    /// returns `VipsImage` - Output image
9583    ///
9584    /// width: `i32` -> Image width in pixels
9585    ///
9586    /// height: `i32` -> Image height in pixels
9587    ///
9588    /// order: `f64` -> Filter order
9589    ///
9590    /// frequency_cutoff: `f64` -> Frequency cutoff
9591    ///
9592    /// amplitude_cutoff: `f64` -> Amplitude cutoff
9593    ///
9594    /// ringwidth: `f64` -> Ringwidth
9595    pub fn mask_butterworth_ring(
9596        width: i32,
9597        height: i32,
9598        order: f64,
9599        frequency_cutoff: f64,
9600        amplitude_cutoff: f64,
9601        ringwidth: f64,
9602    ) -> Result<VipsImage> {
9603        let mut out_out = VipsImage::from(null_mut());
9604        let vips_op_response = call(
9605            "mask_butterworth_ring",
9606            VOption::new()
9607                .set(
9608                    "out",
9609                    &mut out_out,
9610                )
9611                .set(
9612                    "width",
9613                    width,
9614                )
9615                .set(
9616                    "height",
9617                    height,
9618                )
9619                .set(
9620                    "order",
9621                    order,
9622                )
9623                .set(
9624                    "frequency-cutoff",
9625                    frequency_cutoff,
9626                )
9627                .set(
9628                    "amplitude-cutoff",
9629                    amplitude_cutoff,
9630                )
9631                .set(
9632                    "ringwidth",
9633                    ringwidth,
9634                ),
9635        );
9636
9637        utils::result(
9638            vips_op_response,
9639            out_out,
9640            Error::OperationError(
9641                "MaskButterworthRing (vips_mask_butterworth_ring) failed".to_string(),
9642            ),
9643        )
9644    }
9645
9646    /// VipsMaskButterworthRing (mask_butterworth_ring), make a butterworth ring filter
9647    /// returns `VipsImage` - Output image
9648    ///
9649    /// width: `i32` -> Image width in pixels
9650    ///
9651    /// height: `i32` -> Image height in pixels
9652    ///
9653    /// order: `f64` -> Filter order
9654    ///
9655    /// frequency_cutoff: `f64` -> Frequency cutoff
9656    ///
9657    /// amplitude_cutoff: `f64` -> Amplitude cutoff
9658    ///
9659    /// ringwidth: `f64` -> Ringwidth
9660    ///
9661    /// <ins>Optional arguments</ins>
9662    ///
9663    /// uchar: `bool` -> Output an unsigned char image
9664    ///
9665    /// nodc: `bool` -> Remove DC component
9666    ///
9667    /// reject: `bool` -> Invert the sense of the filter
9668    ///
9669    /// optical: `bool` -> Rotate quadrants to optical space
9670    pub fn mask_butterworth_ring_with_opts(
9671        width: i32,
9672        height: i32,
9673        order: f64,
9674        frequency_cutoff: f64,
9675        amplitude_cutoff: f64,
9676        ringwidth: f64,
9677        option: VOption,
9678    ) -> Result<VipsImage> {
9679        let mut out_out = VipsImage::from(null_mut());
9680        let vips_op_response = call(
9681            "mask_butterworth_ring",
9682            option
9683                .set(
9684                    "out",
9685                    &mut out_out,
9686                )
9687                .set(
9688                    "width",
9689                    width,
9690                )
9691                .set(
9692                    "height",
9693                    height,
9694                )
9695                .set(
9696                    "order",
9697                    order,
9698                )
9699                .set(
9700                    "frequency-cutoff",
9701                    frequency_cutoff,
9702                )
9703                .set(
9704                    "amplitude-cutoff",
9705                    amplitude_cutoff,
9706                )
9707                .set(
9708                    "ringwidth",
9709                    ringwidth,
9710                ),
9711        );
9712
9713        utils::result(
9714            vips_op_response,
9715            out_out,
9716            Error::OperationError(
9717                "MaskButterworthRing (vips_mask_butterworth_ring) failed".to_string(),
9718            ),
9719        )
9720    }
9721
9722    /// VipsMaskFractal (mask_fractal), make fractal filter
9723    /// returns `VipsImage` - Output image
9724    ///
9725    /// width: `i32` -> Image width in pixels
9726    ///
9727    /// height: `i32` -> Image height in pixels
9728    ///
9729    /// fractal_dimension: `f64` -> Fractal dimension
9730    pub fn mask_fractal(width: i32, height: i32, fractal_dimension: f64) -> Result<VipsImage> {
9731        let mut out_out = VipsImage::from(null_mut());
9732        let vips_op_response = call(
9733            "mask_fractal",
9734            VOption::new()
9735                .set(
9736                    "out",
9737                    &mut out_out,
9738                )
9739                .set(
9740                    "width",
9741                    width,
9742                )
9743                .set(
9744                    "height",
9745                    height,
9746                )
9747                .set(
9748                    "fractal-dimension",
9749                    fractal_dimension,
9750                ),
9751        );
9752
9753        utils::result(
9754            vips_op_response,
9755            out_out,
9756            Error::OperationError("MaskFractal (vips_mask_fractal) failed".to_string()),
9757        )
9758    }
9759
9760    /// VipsMaskFractal (mask_fractal), make fractal filter
9761    /// returns `VipsImage` - Output image
9762    ///
9763    /// width: `i32` -> Image width in pixels
9764    ///
9765    /// height: `i32` -> Image height in pixels
9766    ///
9767    /// fractal_dimension: `f64` -> Fractal dimension
9768    ///
9769    /// <ins>Optional arguments</ins>
9770    ///
9771    /// uchar: `bool` -> Output an unsigned char image
9772    ///
9773    /// nodc: `bool` -> Remove DC component
9774    ///
9775    /// reject: `bool` -> Invert the sense of the filter
9776    ///
9777    /// optical: `bool` -> Rotate quadrants to optical space
9778    pub fn mask_fractal_with_opts(
9779        width: i32,
9780        height: i32,
9781        fractal_dimension: f64,
9782        option: VOption,
9783    ) -> Result<VipsImage> {
9784        let mut out_out = VipsImage::from(null_mut());
9785        let vips_op_response = call(
9786            "mask_fractal",
9787            option
9788                .set(
9789                    "out",
9790                    &mut out_out,
9791                )
9792                .set(
9793                    "width",
9794                    width,
9795                )
9796                .set(
9797                    "height",
9798                    height,
9799                )
9800                .set(
9801                    "fractal-dimension",
9802                    fractal_dimension,
9803                ),
9804        );
9805
9806        utils::result(
9807            vips_op_response,
9808            out_out,
9809            Error::OperationError("MaskFractal (vips_mask_fractal) failed".to_string()),
9810        )
9811    }
9812
9813    /// VipsMaskGaussian (mask_gaussian), make a gaussian filter
9814    /// returns `VipsImage` - Output image
9815    ///
9816    /// width: `i32` -> Image width in pixels
9817    ///
9818    /// height: `i32` -> Image height in pixels
9819    ///
9820    /// frequency_cutoff: `f64` -> Frequency cutoff
9821    ///
9822    /// amplitude_cutoff: `f64` -> Amplitude cutoff
9823    pub fn mask_gaussian(
9824        width: i32,
9825        height: i32,
9826        frequency_cutoff: f64,
9827        amplitude_cutoff: f64,
9828    ) -> Result<VipsImage> {
9829        let mut out_out = VipsImage::from(null_mut());
9830        let vips_op_response = call(
9831            "mask_gaussian",
9832            VOption::new()
9833                .set(
9834                    "out",
9835                    &mut out_out,
9836                )
9837                .set(
9838                    "width",
9839                    width,
9840                )
9841                .set(
9842                    "height",
9843                    height,
9844                )
9845                .set(
9846                    "frequency-cutoff",
9847                    frequency_cutoff,
9848                )
9849                .set(
9850                    "amplitude-cutoff",
9851                    amplitude_cutoff,
9852                ),
9853        );
9854
9855        utils::result(
9856            vips_op_response,
9857            out_out,
9858            Error::OperationError("MaskGaussian (vips_mask_gaussian) failed".to_string()),
9859        )
9860    }
9861
9862    /// VipsMaskGaussian (mask_gaussian), make a gaussian filter
9863    /// returns `VipsImage` - Output image
9864    ///
9865    /// width: `i32` -> Image width in pixels
9866    ///
9867    /// height: `i32` -> Image height in pixels
9868    ///
9869    /// frequency_cutoff: `f64` -> Frequency cutoff
9870    ///
9871    /// amplitude_cutoff: `f64` -> Amplitude cutoff
9872    ///
9873    /// <ins>Optional arguments</ins>
9874    ///
9875    /// uchar: `bool` -> Output an unsigned char image
9876    ///
9877    /// nodc: `bool` -> Remove DC component
9878    ///
9879    /// reject: `bool` -> Invert the sense of the filter
9880    ///
9881    /// optical: `bool` -> Rotate quadrants to optical space
9882    pub fn mask_gaussian_with_opts(
9883        width: i32,
9884        height: i32,
9885        frequency_cutoff: f64,
9886        amplitude_cutoff: f64,
9887        option: VOption,
9888    ) -> Result<VipsImage> {
9889        let mut out_out = VipsImage::from(null_mut());
9890        let vips_op_response = call(
9891            "mask_gaussian",
9892            option
9893                .set(
9894                    "out",
9895                    &mut out_out,
9896                )
9897                .set(
9898                    "width",
9899                    width,
9900                )
9901                .set(
9902                    "height",
9903                    height,
9904                )
9905                .set(
9906                    "frequency-cutoff",
9907                    frequency_cutoff,
9908                )
9909                .set(
9910                    "amplitude-cutoff",
9911                    amplitude_cutoff,
9912                ),
9913        );
9914
9915        utils::result(
9916            vips_op_response,
9917            out_out,
9918            Error::OperationError("MaskGaussian (vips_mask_gaussian) failed".to_string()),
9919        )
9920    }
9921
9922    /// VipsMaskGaussianBand (mask_gaussian_band), make a gaussian filter
9923    /// returns `VipsImage` - Output image
9924    ///
9925    /// width: `i32` -> Image width in pixels
9926    ///
9927    /// height: `i32` -> Image height in pixels
9928    ///
9929    /// frequency_cutoff_x: `f64` -> Frequency cutoff x
9930    ///
9931    /// frequency_cutoff_y: `f64` -> Frequency cutoff y
9932    ///
9933    /// radius: `f64` -> Radius of circle
9934    ///
9935    /// amplitude_cutoff: `f64` -> Amplitude cutoff
9936    pub fn mask_gaussian_band(
9937        width: i32,
9938        height: i32,
9939        frequency_cutoff_x: f64,
9940        frequency_cutoff_y: f64,
9941        radius: f64,
9942        amplitude_cutoff: f64,
9943    ) -> Result<VipsImage> {
9944        let mut out_out = VipsImage::from(null_mut());
9945        let vips_op_response = call(
9946            "mask_gaussian_band",
9947            VOption::new()
9948                .set(
9949                    "out",
9950                    &mut out_out,
9951                )
9952                .set(
9953                    "width",
9954                    width,
9955                )
9956                .set(
9957                    "height",
9958                    height,
9959                )
9960                .set(
9961                    "frequency-cutoff-x",
9962                    frequency_cutoff_x,
9963                )
9964                .set(
9965                    "frequency-cutoff-y",
9966                    frequency_cutoff_y,
9967                )
9968                .set(
9969                    "radius",
9970                    radius,
9971                )
9972                .set(
9973                    "amplitude-cutoff",
9974                    amplitude_cutoff,
9975                ),
9976        );
9977
9978        utils::result(
9979            vips_op_response,
9980            out_out,
9981            Error::OperationError("MaskGaussianBand (vips_mask_gaussian_band) failed".to_string()),
9982        )
9983    }
9984
9985    /// VipsMaskGaussianBand (mask_gaussian_band), make a gaussian filter
9986    /// returns `VipsImage` - Output image
9987    ///
9988    /// width: `i32` -> Image width in pixels
9989    ///
9990    /// height: `i32` -> Image height in pixels
9991    ///
9992    /// frequency_cutoff_x: `f64` -> Frequency cutoff x
9993    ///
9994    /// frequency_cutoff_y: `f64` -> Frequency cutoff y
9995    ///
9996    /// radius: `f64` -> Radius of circle
9997    ///
9998    /// amplitude_cutoff: `f64` -> Amplitude cutoff
9999    ///
10000    /// <ins>Optional arguments</ins>
10001    ///
10002    /// uchar: `bool` -> Output an unsigned char image
10003    ///
10004    /// nodc: `bool` -> Remove DC component
10005    ///
10006    /// reject: `bool` -> Invert the sense of the filter
10007    ///
10008    /// optical: `bool` -> Rotate quadrants to optical space
10009    pub fn mask_gaussian_band_with_opts(
10010        width: i32,
10011        height: i32,
10012        frequency_cutoff_x: f64,
10013        frequency_cutoff_y: f64,
10014        radius: f64,
10015        amplitude_cutoff: f64,
10016        option: VOption,
10017    ) -> Result<VipsImage> {
10018        let mut out_out = VipsImage::from(null_mut());
10019        let vips_op_response = call(
10020            "mask_gaussian_band",
10021            option
10022                .set(
10023                    "out",
10024                    &mut out_out,
10025                )
10026                .set(
10027                    "width",
10028                    width,
10029                )
10030                .set(
10031                    "height",
10032                    height,
10033                )
10034                .set(
10035                    "frequency-cutoff-x",
10036                    frequency_cutoff_x,
10037                )
10038                .set(
10039                    "frequency-cutoff-y",
10040                    frequency_cutoff_y,
10041                )
10042                .set(
10043                    "radius",
10044                    radius,
10045                )
10046                .set(
10047                    "amplitude-cutoff",
10048                    amplitude_cutoff,
10049                ),
10050        );
10051
10052        utils::result(
10053            vips_op_response,
10054            out_out,
10055            Error::OperationError("MaskGaussianBand (vips_mask_gaussian_band) failed".to_string()),
10056        )
10057    }
10058
10059    /// VipsMaskGaussianRing (mask_gaussian_ring), make a gaussian ring filter
10060    /// returns `VipsImage` - Output image
10061    ///
10062    /// width: `i32` -> Image width in pixels
10063    ///
10064    /// height: `i32` -> Image height in pixels
10065    ///
10066    /// frequency_cutoff: `f64` -> Frequency cutoff
10067    ///
10068    /// amplitude_cutoff: `f64` -> Amplitude cutoff
10069    ///
10070    /// ringwidth: `f64` -> Ringwidth
10071    pub fn mask_gaussian_ring(
10072        width: i32,
10073        height: i32,
10074        frequency_cutoff: f64,
10075        amplitude_cutoff: f64,
10076        ringwidth: f64,
10077    ) -> Result<VipsImage> {
10078        let mut out_out = VipsImage::from(null_mut());
10079        let vips_op_response = call(
10080            "mask_gaussian_ring",
10081            VOption::new()
10082                .set(
10083                    "out",
10084                    &mut out_out,
10085                )
10086                .set(
10087                    "width",
10088                    width,
10089                )
10090                .set(
10091                    "height",
10092                    height,
10093                )
10094                .set(
10095                    "frequency-cutoff",
10096                    frequency_cutoff,
10097                )
10098                .set(
10099                    "amplitude-cutoff",
10100                    amplitude_cutoff,
10101                )
10102                .set(
10103                    "ringwidth",
10104                    ringwidth,
10105                ),
10106        );
10107
10108        utils::result(
10109            vips_op_response,
10110            out_out,
10111            Error::OperationError("MaskGaussianRing (vips_mask_gaussian_ring) failed".to_string()),
10112        )
10113    }
10114
10115    /// VipsMaskGaussianRing (mask_gaussian_ring), make a gaussian ring filter
10116    /// returns `VipsImage` - Output image
10117    ///
10118    /// width: `i32` -> Image width in pixels
10119    ///
10120    /// height: `i32` -> Image height in pixels
10121    ///
10122    /// frequency_cutoff: `f64` -> Frequency cutoff
10123    ///
10124    /// amplitude_cutoff: `f64` -> Amplitude cutoff
10125    ///
10126    /// ringwidth: `f64` -> Ringwidth
10127    ///
10128    /// <ins>Optional arguments</ins>
10129    ///
10130    /// uchar: `bool` -> Output an unsigned char image
10131    ///
10132    /// nodc: `bool` -> Remove DC component
10133    ///
10134    /// reject: `bool` -> Invert the sense of the filter
10135    ///
10136    /// optical: `bool` -> Rotate quadrants to optical space
10137    pub fn mask_gaussian_ring_with_opts(
10138        width: i32,
10139        height: i32,
10140        frequency_cutoff: f64,
10141        amplitude_cutoff: f64,
10142        ringwidth: f64,
10143        option: VOption,
10144    ) -> Result<VipsImage> {
10145        let mut out_out = VipsImage::from(null_mut());
10146        let vips_op_response = call(
10147            "mask_gaussian_ring",
10148            option
10149                .set(
10150                    "out",
10151                    &mut out_out,
10152                )
10153                .set(
10154                    "width",
10155                    width,
10156                )
10157                .set(
10158                    "height",
10159                    height,
10160                )
10161                .set(
10162                    "frequency-cutoff",
10163                    frequency_cutoff,
10164                )
10165                .set(
10166                    "amplitude-cutoff",
10167                    amplitude_cutoff,
10168                )
10169                .set(
10170                    "ringwidth",
10171                    ringwidth,
10172                ),
10173        );
10174
10175        utils::result(
10176            vips_op_response,
10177            out_out,
10178            Error::OperationError("MaskGaussianRing (vips_mask_gaussian_ring) failed".to_string()),
10179        )
10180    }
10181
10182    /// VipsMaskIdeal (mask_ideal), make an ideal filter
10183    /// returns `VipsImage` - Output image
10184    ///
10185    /// width: `i32` -> Image width in pixels
10186    ///
10187    /// height: `i32` -> Image height in pixels
10188    ///
10189    /// frequency_cutoff: `f64` -> Frequency cutoff
10190    pub fn mask_ideal(width: i32, height: i32, frequency_cutoff: f64) -> Result<VipsImage> {
10191        let mut out_out = VipsImage::from(null_mut());
10192        let vips_op_response = call(
10193            "mask_ideal",
10194            VOption::new()
10195                .set(
10196                    "out",
10197                    &mut out_out,
10198                )
10199                .set(
10200                    "width",
10201                    width,
10202                )
10203                .set(
10204                    "height",
10205                    height,
10206                )
10207                .set(
10208                    "frequency-cutoff",
10209                    frequency_cutoff,
10210                ),
10211        );
10212
10213        utils::result(
10214            vips_op_response,
10215            out_out,
10216            Error::OperationError("MaskIdeal (vips_mask_ideal) failed".to_string()),
10217        )
10218    }
10219
10220    /// VipsMaskIdeal (mask_ideal), make an ideal filter
10221    /// returns `VipsImage` - Output image
10222    ///
10223    /// width: `i32` -> Image width in pixels
10224    ///
10225    /// height: `i32` -> Image height in pixels
10226    ///
10227    /// frequency_cutoff: `f64` -> Frequency cutoff
10228    ///
10229    /// <ins>Optional arguments</ins>
10230    ///
10231    /// uchar: `bool` -> Output an unsigned char image
10232    ///
10233    /// nodc: `bool` -> Remove DC component
10234    ///
10235    /// reject: `bool` -> Invert the sense of the filter
10236    ///
10237    /// optical: `bool` -> Rotate quadrants to optical space
10238    pub fn mask_ideal_with_opts(
10239        width: i32,
10240        height: i32,
10241        frequency_cutoff: f64,
10242        option: VOption,
10243    ) -> Result<VipsImage> {
10244        let mut out_out = VipsImage::from(null_mut());
10245        let vips_op_response = call(
10246            "mask_ideal",
10247            option
10248                .set(
10249                    "out",
10250                    &mut out_out,
10251                )
10252                .set(
10253                    "width",
10254                    width,
10255                )
10256                .set(
10257                    "height",
10258                    height,
10259                )
10260                .set(
10261                    "frequency-cutoff",
10262                    frequency_cutoff,
10263                ),
10264        );
10265
10266        utils::result(
10267            vips_op_response,
10268            out_out,
10269            Error::OperationError("MaskIdeal (vips_mask_ideal) failed".to_string()),
10270        )
10271    }
10272
10273    /// VipsMaskIdealBand (mask_ideal_band), make an ideal band filter
10274    /// returns `VipsImage` - Output image
10275    ///
10276    /// width: `i32` -> Image width in pixels
10277    ///
10278    /// height: `i32` -> Image height in pixels
10279    ///
10280    /// frequency_cutoff_x: `f64` -> Frequency cutoff x
10281    ///
10282    /// frequency_cutoff_y: `f64` -> Frequency cutoff y
10283    ///
10284    /// radius: `f64` -> Radius of circle
10285    pub fn mask_ideal_band(
10286        width: i32,
10287        height: i32,
10288        frequency_cutoff_x: f64,
10289        frequency_cutoff_y: f64,
10290        radius: f64,
10291    ) -> Result<VipsImage> {
10292        let mut out_out = VipsImage::from(null_mut());
10293        let vips_op_response = call(
10294            "mask_ideal_band",
10295            VOption::new()
10296                .set(
10297                    "out",
10298                    &mut out_out,
10299                )
10300                .set(
10301                    "width",
10302                    width,
10303                )
10304                .set(
10305                    "height",
10306                    height,
10307                )
10308                .set(
10309                    "frequency-cutoff-x",
10310                    frequency_cutoff_x,
10311                )
10312                .set(
10313                    "frequency-cutoff-y",
10314                    frequency_cutoff_y,
10315                )
10316                .set(
10317                    "radius",
10318                    radius,
10319                ),
10320        );
10321
10322        utils::result(
10323            vips_op_response,
10324            out_out,
10325            Error::OperationError("MaskIdealBand (vips_mask_ideal_band) failed".to_string()),
10326        )
10327    }
10328
10329    /// VipsMaskIdealBand (mask_ideal_band), make an ideal band filter
10330    /// returns `VipsImage` - Output image
10331    ///
10332    /// width: `i32` -> Image width in pixels
10333    ///
10334    /// height: `i32` -> Image height in pixels
10335    ///
10336    /// frequency_cutoff_x: `f64` -> Frequency cutoff x
10337    ///
10338    /// frequency_cutoff_y: `f64` -> Frequency cutoff y
10339    ///
10340    /// radius: `f64` -> Radius of circle
10341    ///
10342    /// <ins>Optional arguments</ins>
10343    ///
10344    /// uchar: `bool` -> Output an unsigned char image
10345    ///
10346    /// nodc: `bool` -> Remove DC component
10347    ///
10348    /// reject: `bool` -> Invert the sense of the filter
10349    ///
10350    /// optical: `bool` -> Rotate quadrants to optical space
10351    pub fn mask_ideal_band_with_opts(
10352        width: i32,
10353        height: i32,
10354        frequency_cutoff_x: f64,
10355        frequency_cutoff_y: f64,
10356        radius: f64,
10357        option: VOption,
10358    ) -> Result<VipsImage> {
10359        let mut out_out = VipsImage::from(null_mut());
10360        let vips_op_response = call(
10361            "mask_ideal_band",
10362            option
10363                .set(
10364                    "out",
10365                    &mut out_out,
10366                )
10367                .set(
10368                    "width",
10369                    width,
10370                )
10371                .set(
10372                    "height",
10373                    height,
10374                )
10375                .set(
10376                    "frequency-cutoff-x",
10377                    frequency_cutoff_x,
10378                )
10379                .set(
10380                    "frequency-cutoff-y",
10381                    frequency_cutoff_y,
10382                )
10383                .set(
10384                    "radius",
10385                    radius,
10386                ),
10387        );
10388
10389        utils::result(
10390            vips_op_response,
10391            out_out,
10392            Error::OperationError("MaskIdealBand (vips_mask_ideal_band) failed".to_string()),
10393        )
10394    }
10395
10396    /// VipsMaskIdealRing (mask_ideal_ring), make an ideal ring filter
10397    /// returns `VipsImage` - Output image
10398    ///
10399    /// width: `i32` -> Image width in pixels
10400    ///
10401    /// height: `i32` -> Image height in pixels
10402    ///
10403    /// frequency_cutoff: `f64` -> Frequency cutoff
10404    ///
10405    /// ringwidth: `f64` -> Ringwidth
10406    pub fn mask_ideal_ring(
10407        width: i32,
10408        height: i32,
10409        frequency_cutoff: f64,
10410        ringwidth: f64,
10411    ) -> Result<VipsImage> {
10412        let mut out_out = VipsImage::from(null_mut());
10413        let vips_op_response = call(
10414            "mask_ideal_ring",
10415            VOption::new()
10416                .set(
10417                    "out",
10418                    &mut out_out,
10419                )
10420                .set(
10421                    "width",
10422                    width,
10423                )
10424                .set(
10425                    "height",
10426                    height,
10427                )
10428                .set(
10429                    "frequency-cutoff",
10430                    frequency_cutoff,
10431                )
10432                .set(
10433                    "ringwidth",
10434                    ringwidth,
10435                ),
10436        );
10437
10438        utils::result(
10439            vips_op_response,
10440            out_out,
10441            Error::OperationError("MaskIdealRing (vips_mask_ideal_ring) failed".to_string()),
10442        )
10443    }
10444
10445    /// VipsMaskIdealRing (mask_ideal_ring), make an ideal ring filter
10446    /// returns `VipsImage` - Output image
10447    ///
10448    /// width: `i32` -> Image width in pixels
10449    ///
10450    /// height: `i32` -> Image height in pixels
10451    ///
10452    /// frequency_cutoff: `f64` -> Frequency cutoff
10453    ///
10454    /// ringwidth: `f64` -> Ringwidth
10455    ///
10456    /// <ins>Optional arguments</ins>
10457    ///
10458    /// uchar: `bool` -> Output an unsigned char image
10459    ///
10460    /// nodc: `bool` -> Remove DC component
10461    ///
10462    /// reject: `bool` -> Invert the sense of the filter
10463    ///
10464    /// optical: `bool` -> Rotate quadrants to optical space
10465    pub fn mask_ideal_ring_with_opts(
10466        width: i32,
10467        height: i32,
10468        frequency_cutoff: f64,
10469        ringwidth: f64,
10470        option: VOption,
10471    ) -> Result<VipsImage> {
10472        let mut out_out = VipsImage::from(null_mut());
10473        let vips_op_response = call(
10474            "mask_ideal_ring",
10475            option
10476                .set(
10477                    "out",
10478                    &mut out_out,
10479                )
10480                .set(
10481                    "width",
10482                    width,
10483                )
10484                .set(
10485                    "height",
10486                    height,
10487                )
10488                .set(
10489                    "frequency-cutoff",
10490                    frequency_cutoff,
10491                )
10492                .set(
10493                    "ringwidth",
10494                    ringwidth,
10495                ),
10496        );
10497
10498        utils::result(
10499            vips_op_response,
10500            out_out,
10501            Error::OperationError("MaskIdealRing (vips_mask_ideal_ring) failed".to_string()),
10502        )
10503    }
10504
10505    /// VipsMatch (match), first-order match of two images
10506    /// returns `VipsImage` - Output image
10507    ///
10508    /// sec: `&VipsImage` -> Secondary image
10509    ///
10510    /// xr1: `i32` -> Position of first reference tie-point
10511    ///
10512    /// yr1: `i32` -> Position of first reference tie-point
10513    ///
10514    /// xs1: `i32` -> Position of first secondary tie-point
10515    ///
10516    /// ys1: `i32` -> Position of first secondary tie-point
10517    ///
10518    /// xr2: `i32` -> Position of second reference tie-point
10519    ///
10520    /// yr2: `i32` -> Position of second reference tie-point
10521    ///
10522    /// xs2: `i32` -> Position of second secondary tie-point
10523    ///
10524    /// ys2: `i32` -> Position of second secondary tie-point
10525    pub fn matches(
10526        &self,
10527        sec: &VipsImage,
10528        xr1: i32,
10529        yr1: i32,
10530        xs1: i32,
10531        ys1: i32,
10532        xr2: i32,
10533        yr2: i32,
10534        xs2: i32,
10535        ys2: i32,
10536    ) -> Result<VipsImage> {
10537        let mut out_out = VipsImage::from(null_mut());
10538        let vips_op_response = call(
10539            "match",
10540            VOption::new()
10541                .set(
10542                    "ref", self,
10543                )
10544                .set("sec", sec)
10545                .set(
10546                    "out",
10547                    &mut out_out,
10548                )
10549                .set("xr1", xr1)
10550                .set("yr1", yr1)
10551                .set("xs1", xs1)
10552                .set("ys1", ys1)
10553                .set("xr2", xr2)
10554                .set("yr2", yr2)
10555                .set("xs2", xs2)
10556                .set("ys2", ys2),
10557        );
10558
10559        utils::result(
10560            vips_op_response,
10561            out_out,
10562            Error::OperationError("Matchs (vips_match) failed".to_string()),
10563        )
10564    }
10565
10566    /// VipsMatch (match), first-order match of two images
10567    /// returns `VipsImage` - Output image
10568    ///
10569    /// sec: `&VipsImage` -> Secondary image
10570    ///
10571    /// xr1: `i32` -> Position of first reference tie-point
10572    ///
10573    /// yr1: `i32` -> Position of first reference tie-point
10574    ///
10575    /// xs1: `i32` -> Position of first secondary tie-point
10576    ///
10577    /// ys1: `i32` -> Position of first secondary tie-point
10578    ///
10579    /// xr2: `i32` -> Position of second reference tie-point
10580    ///
10581    /// yr2: `i32` -> Position of second reference tie-point
10582    ///
10583    /// xs2: `i32` -> Position of second secondary tie-point
10584    ///
10585    /// ys2: `i32` -> Position of second secondary tie-point
10586    ///
10587    /// <ins>Optional arguments</ins>
10588    ///
10589    /// hwindow: `i32` -> Half window size
10590    ///
10591    /// harea: `i32` -> Half area size
10592    ///
10593    /// search: `bool` -> Search to improve tie-points
10594    ///
10595    /// interpolate: `&VipsInterpolate` -> Interpolate pixels with this
10596    pub fn matches_with_opts(
10597        &self,
10598        sec: &VipsImage,
10599        xr1: i32,
10600        yr1: i32,
10601        xs1: i32,
10602        ys1: i32,
10603        xr2: i32,
10604        yr2: i32,
10605        xs2: i32,
10606        ys2: i32,
10607        option: VOption,
10608    ) -> Result<VipsImage> {
10609        let mut out_out = VipsImage::from(null_mut());
10610        let vips_op_response = call(
10611            "match",
10612            option
10613                .set(
10614                    "ref", self,
10615                )
10616                .set("sec", sec)
10617                .set(
10618                    "out",
10619                    &mut out_out,
10620                )
10621                .set("xr1", xr1)
10622                .set("yr1", yr1)
10623                .set("xs1", xs1)
10624                .set("ys1", ys1)
10625                .set("xr2", xr2)
10626                .set("yr2", yr2)
10627                .set("xs2", xs2)
10628                .set("ys2", ys2),
10629        );
10630
10631        utils::result(
10632            vips_op_response,
10633            out_out,
10634            Error::OperationError("Matchs (vips_match) failed".to_string()),
10635        )
10636    }
10637
10638    /// VipsMath2 (math2), binary math operations
10639    /// returns `VipsImage` - Output image
10640    ///
10641    /// right: `&VipsImage` -> Right-hand image argument
10642    ///
10643    /// math2: `OperationMath2` -> Math to perform
10644    pub fn math2(&self, right: &VipsImage, math2: OperationMath2) -> Result<VipsImage> {
10645        let mut out_out = VipsImage::from(null_mut());
10646        let vips_op_response = call(
10647            "math2",
10648            VOption::new()
10649                .set(
10650                    "left",
10651                    self,
10652                )
10653                .set(
10654                    "right",
10655                    right,
10656                )
10657                .set(
10658                    "out",
10659                    &mut out_out,
10660                )
10661                .set(
10662                    "math2",
10663                    math2 as i32,
10664                ),
10665        );
10666
10667        utils::result(
10668            vips_op_response,
10669            out_out,
10670            Error::OperationError("Math2 (vips_math2) failed".to_string()),
10671        )
10672    }
10673
10674    /// VipsMath2Const (math2_const), binary math operations with a constant
10675    /// returns `VipsImage` - Output image
10676    ///
10677    /// math2: `OperationMath2` -> Math to perform
10678    ///
10679    /// c: `&[f64]` -> Array of constants
10680    pub fn math2_const(&self, math2: OperationMath2, c: &[f64]) -> Result<VipsImage> {
10681        let mut out_out = VipsImage::from(null_mut());
10682        let vips_op_response = call(
10683            "math2_const",
10684            VOption::new()
10685                .set("in", self)
10686                .set(
10687                    "out",
10688                    &mut out_out,
10689                )
10690                .set(
10691                    "math2",
10692                    math2 as i32,
10693                )
10694                .set("c", c),
10695        );
10696
10697        utils::result(
10698            vips_op_response,
10699            out_out,
10700            Error::OperationError("Math2Const (vips_math2_const) failed".to_string()),
10701        )
10702    }
10703
10704    /// VipsMath (math), apply a math operation to an image
10705    /// returns `VipsImage` - Output image
10706    ///
10707    /// math: `OperationMath` -> Math to perform
10708    pub fn math(&self, math: OperationMath) -> Result<VipsImage> {
10709        let mut out_out = VipsImage::from(null_mut());
10710        let vips_op_response = call(
10711            "math",
10712            VOption::new()
10713                .set("in", self)
10714                .set(
10715                    "out",
10716                    &mut out_out,
10717                )
10718                .set(
10719                    "math",
10720                    math as i32,
10721                ),
10722        );
10723
10724        utils::result(
10725            vips_op_response,
10726            out_out,
10727            Error::OperationError("Math (vips_math) failed".to_string()),
10728        )
10729    }
10730
10731    /// VipsForeignLoadMat (matload), load mat from file (.mat), priority=0, untrusted, is_a, get_flags, get_flags_filename, header, load
10732    /// returns `VipsImage` - Output image
10733    ///
10734    /// filename: `&str` -> Filename to load from
10735    pub fn matload(filename: &str) -> Result<VipsImage> {
10736        let mut out_out = VipsImage::from(null_mut());
10737        let vips_op_response = call(
10738            "matload",
10739            VOption::new()
10740                .set(
10741                    "filename",
10742                    filename,
10743                )
10744                .set(
10745                    "out",
10746                    &mut out_out,
10747                ),
10748        );
10749
10750        utils::result(
10751            vips_op_response,
10752            out_out,
10753            Error::OperationError("Matload (vips_matload) failed".to_string()),
10754        )
10755    }
10756
10757    /// VipsForeignLoadMat (matload), load mat from file (.mat), priority=0, untrusted, is_a, get_flags, get_flags_filename, header, load
10758    /// returns `VipsImage` - Output image
10759    ///
10760    /// filename: `&str` -> Filename to load from
10761    ///
10762    /// <ins>Optional arguments</ins>
10763    ///
10764    /// flags: [`ForeignFlags`] -> Flags for this file
10765    ///
10766    /// memory: `bool` -> Force open via memory
10767    ///
10768    /// access: [`Access`] -> Required access pattern for this file
10769    ///
10770    /// fail_on: [`FailOn`] -> Error level to fail on
10771    ///
10772    /// revalidate: `bool` -> Don't use a cached result for this operation
10773    pub fn matload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
10774        let mut out_out = VipsImage::from(null_mut());
10775        let vips_op_response = call(
10776            "matload",
10777            option
10778                .set(
10779                    "filename",
10780                    filename,
10781                )
10782                .set(
10783                    "out",
10784                    &mut out_out,
10785                ),
10786        );
10787
10788        utils::result(
10789            vips_op_response,
10790            out_out,
10791            Error::OperationError("Matload (vips_matload) failed".to_string()),
10792        )
10793    }
10794
10795    /// VipsMatrixinvert (matrixinvert), invert a matrix
10796    /// returns `VipsImage` - Output matrix
10797    pub fn matrixinvert(&self) -> Result<VipsImage> {
10798        let mut out_out = VipsImage::from(null_mut());
10799        let vips_op_response = call(
10800            "matrixinvert",
10801            VOption::new()
10802                .set("in", self)
10803                .set(
10804                    "out",
10805                    &mut out_out,
10806                ),
10807        );
10808
10809        utils::result(
10810            vips_op_response,
10811            out_out,
10812            Error::OperationError("Matrixinvert (vips_matrixinvert) failed".to_string()),
10813        )
10814    }
10815
10816    /// VipsForeignLoadMatrixFile (matrixload), load matrix (.mat), priority=0, is_a, get_flags, get_flags_filename, header, load
10817    /// returns `VipsImage` - Output image
10818    ///
10819    /// filename: `&str` -> Filename to load from
10820    pub fn matrixload(filename: &str) -> Result<VipsImage> {
10821        let mut out_out = VipsImage::from(null_mut());
10822        let vips_op_response = call(
10823            "matrixload",
10824            VOption::new()
10825                .set(
10826                    "filename",
10827                    filename,
10828                )
10829                .set(
10830                    "out",
10831                    &mut out_out,
10832                ),
10833        );
10834
10835        utils::result(
10836            vips_op_response,
10837            out_out,
10838            Error::OperationError("Matrixload (vips_matrixload) failed".to_string()),
10839        )
10840    }
10841
10842    /// VipsForeignLoadMatrixFile (matrixload), load matrix (.mat), priority=0, is_a, get_flags, get_flags_filename, header, load
10843    /// returns `VipsImage` - Output image
10844    ///
10845    /// filename: `&str` -> Filename to load from
10846    ///
10847    /// <ins>Optional arguments</ins>
10848    ///
10849    /// flags: [`ForeignFlags`] -> Flags for this file
10850    ///
10851    /// memory: `bool` -> Force open via memory
10852    ///
10853    /// access: [`Access`] -> Required access pattern for this file
10854    ///
10855    /// fail_on: [`FailOn`] -> Error level to fail on
10856    ///
10857    /// revalidate: `bool` -> Don't use a cached result for this operation
10858    pub fn matrixload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
10859        let mut out_out = VipsImage::from(null_mut());
10860        let vips_op_response = call(
10861            "matrixload",
10862            option
10863                .set(
10864                    "filename",
10865                    filename,
10866                )
10867                .set(
10868                    "out",
10869                    &mut out_out,
10870                ),
10871        );
10872
10873        utils::result(
10874            vips_op_response,
10875            out_out,
10876            Error::OperationError("Matrixload (vips_matrixload) failed".to_string()),
10877        )
10878    }
10879
10880    /// VipsForeignLoadMatrixSource (matrixload_source), load matrix, priority=0, is_a_source, get_flags, header, load
10881    /// returns `VipsImage` - Output image
10882    ///
10883    /// source: `&VipsSource` -> Source to load from
10884    pub fn matrixload_source(source: &VipsSource) -> Result<VipsImage> {
10885        let mut out_out = VipsImage::from(null_mut());
10886        let vips_op_response = call(
10887            "matrixload_source",
10888            VOption::new()
10889                .set(
10890                    "source",
10891                    source,
10892                )
10893                .set(
10894                    "out",
10895                    &mut out_out,
10896                ),
10897        );
10898
10899        utils::result(
10900            vips_op_response,
10901            out_out,
10902            Error::OperationError("MatrixloadSource (vips_matrixload_source) failed".to_string()),
10903        )
10904    }
10905
10906    /// VipsForeignLoadMatrixSource (matrixload_source), load matrix, priority=0, is_a_source, get_flags, header, load
10907    /// returns `VipsImage` - Output image
10908    ///
10909    /// source: `&VipsSource` -> Source to load from
10910    ///
10911    /// <ins>Optional arguments</ins>
10912    ///
10913    /// flags: [`ForeignFlags`] -> Flags for this file
10914    ///
10915    /// memory: `bool` -> Force open via memory
10916    ///
10917    /// access: [`Access`] -> Required access pattern for this file
10918    ///
10919    /// fail_on: [`FailOn`] -> Error level to fail on
10920    ///
10921    /// revalidate: `bool` -> Don't use a cached result for this operation
10922    pub fn matrixload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
10923        let mut out_out = VipsImage::from(null_mut());
10924        let vips_op_response = call(
10925            "matrixload_source",
10926            option
10927                .set(
10928                    "source",
10929                    source,
10930                )
10931                .set(
10932                    "out",
10933                    &mut out_out,
10934                ),
10935        );
10936
10937        utils::result(
10938            vips_op_response,
10939            out_out,
10940            Error::OperationError("MatrixloadSource (vips_matrixload_source) failed".to_string()),
10941        )
10942    }
10943
10944    /// VipsMatrixmultiply (matrixmultiply), multiply two matrices
10945    /// returns `VipsImage` - Output matrix
10946    ///
10947    /// right: `&VipsImage` -> Second matrix to multiply
10948    pub fn matrixmultiply(&self, right: &VipsImage) -> Result<VipsImage> {
10949        let mut out_out = VipsImage::from(null_mut());
10950        let vips_op_response = call(
10951            "matrixmultiply",
10952            VOption::new()
10953                .set(
10954                    "left",
10955                    self,
10956                )
10957                .set(
10958                    "right",
10959                    right,
10960                )
10961                .set(
10962                    "out",
10963                    &mut out_out,
10964                ),
10965        );
10966
10967        utils::result(
10968            vips_op_response,
10969            out_out,
10970            Error::OperationError("Matrixmultiply (vips_matrixmultiply) failed".to_string()),
10971        )
10972    }
10973
10974    /// VipsForeignPrintMatrix (matrixprint), print matrix (.mat), priority=0, mono
10975    pub fn matrixprint(&self) -> Result<()> {
10976        let vips_op_response = call(
10977            "matrixprint",
10978            VOption::new().set("in", self),
10979        );
10980
10981        utils::result(
10982            vips_op_response,
10983            (),
10984            Error::OperationError("Matrixprint (vips_matrixprint) failed".to_string()),
10985        )
10986    }
10987
10988    /// VipsForeignPrintMatrix (matrixprint), print matrix (.mat), priority=0, mono
10989    ///
10990    /// <ins>Optional arguments</ins>
10991    ///
10992    /// keep: [`ForeignKeep`] -> Which metadata to retain
10993    ///
10994    /// background: `&[f64]` -> Background value
10995    ///
10996    /// page_height: `i32` -> Set page height for multipage save
10997    ///
10998    /// profile: `&str` -> Filename of ICC profile to embed
10999    pub fn matrixprint_with_opts(&self, option: VOption) -> Result<()> {
11000        let vips_op_response = call(
11001            "matrixprint",
11002            option.set("in", self),
11003        );
11004
11005        utils::result(
11006            vips_op_response,
11007            (),
11008            Error::OperationError("Matrixprint (vips_matrixprint) failed".to_string()),
11009        )
11010    }
11011
11012    /// VipsForeignSaveMatrixFile (matrixsave), save image to matrix (.mat), priority=0, mono
11013    ///
11014    /// filename: `&str` -> Filename to save to
11015    pub fn matrixsave(&self, filename: &str) -> Result<()> {
11016        let vips_op_response = call(
11017            "matrixsave",
11018            VOption::new()
11019                .set("in", self)
11020                .set(
11021                    "filename",
11022                    filename,
11023                ),
11024        );
11025
11026        utils::result(
11027            vips_op_response,
11028            (),
11029            Error::OperationError("Matrixsave (vips_matrixsave) failed".to_string()),
11030        )
11031    }
11032
11033    /// VipsForeignSaveMatrixFile (matrixsave), save image to matrix (.mat), priority=0, mono
11034    ///
11035    /// filename: `&str` -> Filename to save to
11036    ///
11037    /// <ins>Optional arguments</ins>
11038    ///
11039    /// keep: [`ForeignKeep`] -> Which metadata to retain
11040    ///
11041    /// background: `&[f64]` -> Background value
11042    ///
11043    /// page_height: `i32` -> Set page height for multipage save
11044    ///
11045    /// profile: `&str` -> Filename of ICC profile to embed
11046    pub fn matrixsave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
11047        let vips_op_response = call(
11048            "matrixsave",
11049            option
11050                .set("in", self)
11051                .set(
11052                    "filename",
11053                    filename,
11054                ),
11055        );
11056
11057        utils::result(
11058            vips_op_response,
11059            (),
11060            Error::OperationError("Matrixsave (vips_matrixsave) failed".to_string()),
11061        )
11062    }
11063
11064    /// VipsForeignSaveMatrixTarget (matrixsave_target), save image to matrix (.mat), priority=0, mono
11065    ///
11066    /// target: `&VipsTarget` -> Target to save to
11067    pub fn matrixsave_target(&self, target: &VipsTarget) -> Result<()> {
11068        let vips_op_response = call(
11069            "matrixsave_target",
11070            VOption::new()
11071                .set("in", self)
11072                .set(
11073                    "target",
11074                    target,
11075                ),
11076        );
11077
11078        utils::result(
11079            vips_op_response,
11080            (),
11081            Error::OperationError("MatrixsaveTarget (vips_matrixsave_target) failed".to_string()),
11082        )
11083    }
11084
11085    /// VipsForeignSaveMatrixTarget (matrixsave_target), save image to matrix (.mat), priority=0, mono
11086    ///
11087    /// target: `&VipsTarget` -> Target to save to
11088    ///
11089    /// <ins>Optional arguments</ins>
11090    ///
11091    /// keep: [`ForeignKeep`] -> Which metadata to retain
11092    ///
11093    /// background: `&[f64]` -> Background value
11094    ///
11095    /// page_height: `i32` -> Set page height for multipage save
11096    ///
11097    /// profile: `&str` -> Filename of ICC profile to embed
11098    pub fn matrixsave_target_with_opts(&self, target: &VipsTarget, option: VOption) -> Result<()> {
11099        let vips_op_response = call(
11100            "matrixsave_target",
11101            option
11102                .set("in", self)
11103                .set(
11104                    "target",
11105                    target,
11106                ),
11107        );
11108
11109        utils::result(
11110            vips_op_response,
11111            (),
11112            Error::OperationError("MatrixsaveTarget (vips_matrixsave_target) failed".to_string()),
11113        )
11114    }
11115
11116    /// VipsMax (max), find image maximum
11117    /// returns `f64` - Output value
11118    pub fn max(&self) -> Result<f64> {
11119        let mut out_out: f64 = 0.0;
11120        let vips_op_response = call(
11121            "max",
11122            VOption::new()
11123                .set("in", self)
11124                .set(
11125                    "out",
11126                    &mut out_out,
11127                ),
11128        );
11129
11130        utils::result(
11131            vips_op_response,
11132            out_out,
11133            Error::OperationError("Max (vips_max) failed".to_string()),
11134        )
11135    }
11136
11137    /// VipsMax (max), find image maximum
11138    /// returns `f64` - Output value
11139    ///
11140    /// <ins>Optional arguments</ins>
11141    ///
11142    /// x: `&mut i32` -> Horizontal position of maximum
11143    ///
11144    /// y: `&mut i32` -> Vertical position of maximum
11145    ///
11146    /// size: `i32` -> Number of maximum values to find
11147    ///
11148    /// out_array: `&mut Vec<f64>` -> Array of output values
11149    ///
11150    /// x_array: `&[i32]` -> Array of horizontal positions
11151    ///
11152    /// y_array: `&[i32]` -> Array of vertical positions
11153    pub fn max_with_opts(&self, option: VOption) -> Result<f64> {
11154        let mut out_out: f64 = 0.0;
11155        let vips_op_response = call(
11156            "max",
11157            option
11158                .set("in", self)
11159                .set(
11160                    "out",
11161                    &mut out_out,
11162                ),
11163        );
11164
11165        utils::result(
11166            vips_op_response,
11167            out_out,
11168            Error::OperationError("Max (vips_max) failed".to_string()),
11169        )
11170    }
11171
11172    /// VipsMaxpair (maxpair), maximum of a pair of images
11173    /// returns `VipsImage` - Output image
11174    ///
11175    /// right: `&VipsImage` -> Right-hand image argument
11176    pub fn maxpair(&self, right: &VipsImage) -> Result<VipsImage> {
11177        let mut out_out = VipsImage::from(null_mut());
11178        let vips_op_response = call(
11179            "maxpair",
11180            VOption::new()
11181                .set(
11182                    "left",
11183                    self,
11184                )
11185                .set(
11186                    "right",
11187                    right,
11188                )
11189                .set(
11190                    "out",
11191                    &mut out_out,
11192                ),
11193        );
11194
11195        utils::result(
11196            vips_op_response,
11197            out_out,
11198            Error::OperationError("Maxpair (vips_maxpair) failed".to_string()),
11199        )
11200    }
11201
11202    /// VipsMeasure (measure), measure a set of patches on a color chart
11203    /// returns `VipsImage` - Output array of statistics
11204    ///
11205    /// h: `i32` -> Number of patches across chart
11206    ///
11207    /// v: `i32` -> Number of patches down chart
11208    pub fn measure(&self, h: i32, v: i32) -> Result<VipsImage> {
11209        let mut out_out = VipsImage::from(null_mut());
11210        let vips_op_response = call(
11211            "measure",
11212            VOption::new()
11213                .set("in", self)
11214                .set(
11215                    "out",
11216                    &mut out_out,
11217                )
11218                .set("h", h)
11219                .set("v", v),
11220        );
11221
11222        utils::result(
11223            vips_op_response,
11224            out_out,
11225            Error::OperationError("Measure (vips_measure) failed".to_string()),
11226        )
11227    }
11228
11229    /// VipsMeasure (measure), measure a set of patches on a color chart
11230    /// returns `VipsImage` - Output array of statistics
11231    ///
11232    /// h: `i32` -> Number of patches across chart
11233    ///
11234    /// v: `i32` -> Number of patches down chart
11235    ///
11236    /// <ins>Optional arguments</ins>
11237    ///
11238    /// left: `i32` -> Left edge of extract area
11239    ///
11240    /// top: `i32` -> Top edge of extract area
11241    ///
11242    /// width: `i32` -> Width of extract area
11243    ///
11244    /// height: `i32` -> Height of extract area
11245    pub fn measure_with_opts(&self, h: i32, v: i32, option: VOption) -> Result<VipsImage> {
11246        let mut out_out = VipsImage::from(null_mut());
11247        let vips_op_response = call(
11248            "measure",
11249            option
11250                .set("in", self)
11251                .set(
11252                    "out",
11253                    &mut out_out,
11254                )
11255                .set("h", h)
11256                .set("v", v),
11257        );
11258
11259        utils::result(
11260            vips_op_response,
11261            out_out,
11262            Error::OperationError("Measure (vips_measure) failed".to_string()),
11263        )
11264    }
11265
11266    /// VipsMerge (merge), merge two images
11267    /// returns `VipsImage` - Output image
11268    ///
11269    /// sec: `&VipsImage` -> Secondary image
11270    ///
11271    /// direction: `Direction` -> Horizontal or vertical merge
11272    ///
11273    /// dx: `i32` -> Horizontal displacement from sec to ref
11274    ///
11275    /// dy: `i32` -> Vertical displacement from sec to ref
11276    pub fn merge(
11277        &self,
11278        sec: &VipsImage,
11279        direction: Direction,
11280        dx: i32,
11281        dy: i32,
11282    ) -> Result<VipsImage> {
11283        let mut out_out = VipsImage::from(null_mut());
11284        let vips_op_response = call(
11285            "merge",
11286            VOption::new()
11287                .set(
11288                    "ref", self,
11289                )
11290                .set("sec", sec)
11291                .set(
11292                    "out",
11293                    &mut out_out,
11294                )
11295                .set(
11296                    "direction",
11297                    direction as i32,
11298                )
11299                .set("dx", dx)
11300                .set("dy", dy),
11301        );
11302
11303        utils::result(
11304            vips_op_response,
11305            out_out,
11306            Error::OperationError("Merge (vips_merge) failed".to_string()),
11307        )
11308    }
11309
11310    /// VipsMerge (merge), merge two images
11311    /// returns `VipsImage` - Output image
11312    ///
11313    /// sec: `&VipsImage` -> Secondary image
11314    ///
11315    /// direction: `Direction` -> Horizontal or vertical merge
11316    ///
11317    /// dx: `i32` -> Horizontal displacement from sec to ref
11318    ///
11319    /// dy: `i32` -> Vertical displacement from sec to ref
11320    ///
11321    /// <ins>Optional arguments</ins>
11322    ///
11323    /// mblend: `i32` -> Maximum blend size
11324    pub fn merge_with_opts(
11325        &self,
11326        sec: &VipsImage,
11327        direction: Direction,
11328        dx: i32,
11329        dy: i32,
11330        option: VOption,
11331    ) -> Result<VipsImage> {
11332        let mut out_out = VipsImage::from(null_mut());
11333        let vips_op_response = call(
11334            "merge",
11335            option
11336                .set(
11337                    "ref", self,
11338                )
11339                .set("sec", sec)
11340                .set(
11341                    "out",
11342                    &mut out_out,
11343                )
11344                .set(
11345                    "direction",
11346                    direction as i32,
11347                )
11348                .set("dx", dx)
11349                .set("dy", dy),
11350        );
11351
11352        utils::result(
11353            vips_op_response,
11354            out_out,
11355            Error::OperationError("Merge (vips_merge) failed".to_string()),
11356        )
11357    }
11358
11359    /// VipsMin (min), find image minimum
11360    /// returns `f64` - Output value
11361    pub fn min(&self) -> Result<f64> {
11362        let mut out_out: f64 = 0.0;
11363        let vips_op_response = call(
11364            "min",
11365            VOption::new()
11366                .set("in", self)
11367                .set(
11368                    "out",
11369                    &mut out_out,
11370                ),
11371        );
11372
11373        utils::result(
11374            vips_op_response,
11375            out_out,
11376            Error::OperationError("Min (vips_min) failed".to_string()),
11377        )
11378    }
11379
11380    /// VipsMin (min), find image minimum
11381    /// returns `f64` - Output value
11382    ///
11383    /// <ins>Optional arguments</ins>
11384    ///
11385    /// x: `&mut i32` -> Horizontal position of minimum
11386    ///
11387    /// y: `&mut i32` -> Vertical position of minimum
11388    ///
11389    /// size: `i32` -> Number of minimum values to find
11390    ///
11391    /// out_array: `&mut Vec<f64>` -> Array of output values
11392    ///
11393    /// x_array: `&[i32]` -> Array of horizontal positions
11394    ///
11395    /// y_array: `&[i32]` -> Array of vertical positions
11396    pub fn min_with_opts(&self, option: VOption) -> Result<f64> {
11397        let mut out_out: f64 = 0.0;
11398        let vips_op_response = call(
11399            "min",
11400            option
11401                .set("in", self)
11402                .set(
11403                    "out",
11404                    &mut out_out,
11405                ),
11406        );
11407
11408        utils::result(
11409            vips_op_response,
11410            out_out,
11411            Error::OperationError("Min (vips_min) failed".to_string()),
11412        )
11413    }
11414
11415    /// VipsMinpair (minpair), minimum of a pair of images
11416    /// returns `VipsImage` - Output image
11417    ///
11418    /// right: `&VipsImage` -> Right-hand image argument
11419    pub fn minpair(&self, right: &VipsImage) -> Result<VipsImage> {
11420        let mut out_out = VipsImage::from(null_mut());
11421        let vips_op_response = call(
11422            "minpair",
11423            VOption::new()
11424                .set(
11425                    "left",
11426                    self,
11427                )
11428                .set(
11429                    "right",
11430                    right,
11431                )
11432                .set(
11433                    "out",
11434                    &mut out_out,
11435                ),
11436        );
11437
11438        utils::result(
11439            vips_op_response,
11440            out_out,
11441            Error::OperationError("Minpair (vips_minpair) failed".to_string()),
11442        )
11443    }
11444
11445    /// VipsMorph (morph), morphology operation
11446    /// returns `VipsImage` - Output image
11447    ///
11448    /// mask: `&VipsImage` -> Input matrix image
11449    ///
11450    /// morph: `OperationMorphology` -> Morphological operation to perform
11451    pub fn morph(&self, mask: &VipsImage, morph: OperationMorphology) -> Result<VipsImage> {
11452        let mut out_out = VipsImage::from(null_mut());
11453        let vips_op_response = call(
11454            "morph",
11455            VOption::new()
11456                .set("in", self)
11457                .set(
11458                    "out",
11459                    &mut out_out,
11460                )
11461                .set(
11462                    "mask",
11463                    mask,
11464                )
11465                .set(
11466                    "morph",
11467                    morph as i32,
11468                ),
11469        );
11470
11471        utils::result(
11472            vips_op_response,
11473            out_out,
11474            Error::OperationError("Morph (vips_morph) failed".to_string()),
11475        )
11476    }
11477
11478    /// VipsMosaic1 (mosaic1), first-order mosaic of two images
11479    /// returns `VipsImage` - Output image
11480    ///
11481    /// sec: `&VipsImage` -> Secondary image
11482    ///
11483    /// direction: `Direction` -> Horizontal or vertical mosaic
11484    ///
11485    /// xr1: `i32` -> Position of first reference tie-point
11486    ///
11487    /// yr1: `i32` -> Position of first reference tie-point
11488    ///
11489    /// xs1: `i32` -> Position of first secondary tie-point
11490    ///
11491    /// ys1: `i32` -> Position of first secondary tie-point
11492    ///
11493    /// xr2: `i32` -> Position of second reference tie-point
11494    ///
11495    /// yr2: `i32` -> Position of second reference tie-point
11496    ///
11497    /// xs2: `i32` -> Position of second secondary tie-point
11498    ///
11499    /// ys2: `i32` -> Position of second secondary tie-point
11500    pub fn mosaic1(
11501        &self,
11502        sec: &VipsImage,
11503        direction: Direction,
11504        xr1: i32,
11505        yr1: i32,
11506        xs1: i32,
11507        ys1: i32,
11508        xr2: i32,
11509        yr2: i32,
11510        xs2: i32,
11511        ys2: i32,
11512    ) -> Result<VipsImage> {
11513        let mut out_out = VipsImage::from(null_mut());
11514        let vips_op_response = call(
11515            "mosaic1",
11516            VOption::new()
11517                .set(
11518                    "ref", self,
11519                )
11520                .set("sec", sec)
11521                .set(
11522                    "out",
11523                    &mut out_out,
11524                )
11525                .set(
11526                    "direction",
11527                    direction as i32,
11528                )
11529                .set("xr1", xr1)
11530                .set("yr1", yr1)
11531                .set("xs1", xs1)
11532                .set("ys1", ys1)
11533                .set("xr2", xr2)
11534                .set("yr2", yr2)
11535                .set("xs2", xs2)
11536                .set("ys2", ys2),
11537        );
11538
11539        utils::result(
11540            vips_op_response,
11541            out_out,
11542            Error::OperationError("Mosaic1 (vips_mosaic1) failed".to_string()),
11543        )
11544    }
11545
11546    /// VipsMosaic1 (mosaic1), first-order mosaic of two images
11547    /// returns `VipsImage` - Output image
11548    ///
11549    /// sec: `&VipsImage` -> Secondary image
11550    ///
11551    /// direction: `Direction` -> Horizontal or vertical mosaic
11552    ///
11553    /// xr1: `i32` -> Position of first reference tie-point
11554    ///
11555    /// yr1: `i32` -> Position of first reference tie-point
11556    ///
11557    /// xs1: `i32` -> Position of first secondary tie-point
11558    ///
11559    /// ys1: `i32` -> Position of first secondary tie-point
11560    ///
11561    /// xr2: `i32` -> Position of second reference tie-point
11562    ///
11563    /// yr2: `i32` -> Position of second reference tie-point
11564    ///
11565    /// xs2: `i32` -> Position of second secondary tie-point
11566    ///
11567    /// ys2: `i32` -> Position of second secondary tie-point
11568    ///
11569    /// <ins>Optional arguments</ins>
11570    ///
11571    /// hwindow: `i32` -> Half window size
11572    ///
11573    /// harea: `i32` -> Half area size
11574    ///
11575    /// search: `bool` -> Search to improve tie-points
11576    ///
11577    /// interpolate: `&VipsInterpolate` -> Interpolate pixels with this
11578    ///
11579    /// mblend: `i32` -> Maximum blend size
11580    pub fn mosaic1_with_opts(
11581        &self,
11582        sec: &VipsImage,
11583        direction: Direction,
11584        xr1: i32,
11585        yr1: i32,
11586        xs1: i32,
11587        ys1: i32,
11588        xr2: i32,
11589        yr2: i32,
11590        xs2: i32,
11591        ys2: i32,
11592        option: VOption,
11593    ) -> Result<VipsImage> {
11594        let mut out_out = VipsImage::from(null_mut());
11595        let vips_op_response = call(
11596            "mosaic1",
11597            option
11598                .set(
11599                    "ref", self,
11600                )
11601                .set("sec", sec)
11602                .set(
11603                    "out",
11604                    &mut out_out,
11605                )
11606                .set(
11607                    "direction",
11608                    direction as i32,
11609                )
11610                .set("xr1", xr1)
11611                .set("yr1", yr1)
11612                .set("xs1", xs1)
11613                .set("ys1", ys1)
11614                .set("xr2", xr2)
11615                .set("yr2", yr2)
11616                .set("xs2", xs2)
11617                .set("ys2", ys2),
11618        );
11619
11620        utils::result(
11621            vips_op_response,
11622            out_out,
11623            Error::OperationError("Mosaic1 (vips_mosaic1) failed".to_string()),
11624        )
11625    }
11626
11627    /// VipsMosaic (mosaic), mosaic two images
11628    /// returns `VipsImage` - Output image
11629    ///
11630    /// sec: `&VipsImage` -> Secondary image
11631    ///
11632    /// direction: `Direction` -> Horizontal or vertical mosaic
11633    ///
11634    /// xref: `i32` -> Position of reference tie-point
11635    ///
11636    /// yref: `i32` -> Position of reference tie-point
11637    ///
11638    /// xsec: `i32` -> Position of secondary tie-point
11639    ///
11640    /// ysec: `i32` -> Position of secondary tie-point
11641    pub fn mosaic(
11642        &self,
11643        sec: &VipsImage,
11644        direction: Direction,
11645        xref: i32,
11646        yref: i32,
11647        xsec: i32,
11648        ysec: i32,
11649    ) -> Result<VipsImage> {
11650        let mut out_out = VipsImage::from(null_mut());
11651        let vips_op_response = call(
11652            "mosaic",
11653            VOption::new()
11654                .set(
11655                    "ref", self,
11656                )
11657                .set("sec", sec)
11658                .set(
11659                    "out",
11660                    &mut out_out,
11661                )
11662                .set(
11663                    "direction",
11664                    direction as i32,
11665                )
11666                .set(
11667                    "xref",
11668                    xref,
11669                )
11670                .set(
11671                    "yref",
11672                    yref,
11673                )
11674                .set(
11675                    "xsec",
11676                    xsec,
11677                )
11678                .set(
11679                    "ysec",
11680                    ysec,
11681                ),
11682        );
11683
11684        utils::result(
11685            vips_op_response,
11686            out_out,
11687            Error::OperationError("Mosaic (vips_mosaic) failed".to_string()),
11688        )
11689    }
11690
11691    /// VipsMosaic (mosaic), mosaic two images
11692    /// returns `VipsImage` - Output image
11693    ///
11694    /// sec: `&VipsImage` -> Secondary image
11695    ///
11696    /// direction: `Direction` -> Horizontal or vertical mosaic
11697    ///
11698    /// xref: `i32` -> Position of reference tie-point
11699    ///
11700    /// yref: `i32` -> Position of reference tie-point
11701    ///
11702    /// xsec: `i32` -> Position of secondary tie-point
11703    ///
11704    /// ysec: `i32` -> Position of secondary tie-point
11705    ///
11706    /// <ins>Optional arguments</ins>
11707    ///
11708    /// hwindow: `i32` -> Half window size
11709    ///
11710    /// harea: `i32` -> Half area size
11711    ///
11712    /// mblend: `i32` -> Maximum blend size
11713    ///
11714    /// bandno: `i32` -> Band to search for features on
11715    ///
11716    /// dx0: `&mut i32` -> Detected integer offset
11717    ///
11718    /// dy0: `&mut i32` -> Detected integer offset
11719    ///
11720    /// scale1: `&mut f64` -> Detected scale
11721    ///
11722    /// angle1: `&mut f64` -> Detected rotation
11723    ///
11724    /// dy1: `&mut f64` -> Detected first-order displacement
11725    ///
11726    /// dx1: `&mut f64` -> Detected first-order displacement
11727    pub fn mosaic_with_opts(
11728        &self,
11729        sec: &VipsImage,
11730        direction: Direction,
11731        xref: i32,
11732        yref: i32,
11733        xsec: i32,
11734        ysec: i32,
11735        option: VOption,
11736    ) -> Result<VipsImage> {
11737        let mut out_out = VipsImage::from(null_mut());
11738        let vips_op_response = call(
11739            "mosaic",
11740            option
11741                .set(
11742                    "ref", self,
11743                )
11744                .set("sec", sec)
11745                .set(
11746                    "out",
11747                    &mut out_out,
11748                )
11749                .set(
11750                    "direction",
11751                    direction as i32,
11752                )
11753                .set(
11754                    "xref",
11755                    xref,
11756                )
11757                .set(
11758                    "yref",
11759                    yref,
11760                )
11761                .set(
11762                    "xsec",
11763                    xsec,
11764                )
11765                .set(
11766                    "ysec",
11767                    ysec,
11768                ),
11769        );
11770
11771        utils::result(
11772            vips_op_response,
11773            out_out,
11774            Error::OperationError("Mosaic (vips_mosaic) failed".to_string()),
11775        )
11776    }
11777
11778    /// VipsMsb (msb), pick most-significant byte from an image
11779    /// returns `VipsImage` - Output image
11780    pub fn msb(&self) -> Result<VipsImage> {
11781        let mut out_out = VipsImage::from(null_mut());
11782        let vips_op_response = call(
11783            "msb",
11784            VOption::new()
11785                .set("in", self)
11786                .set(
11787                    "out",
11788                    &mut out_out,
11789                ),
11790        );
11791
11792        utils::result(
11793            vips_op_response,
11794            out_out,
11795            Error::OperationError("Msb (vips_msb) failed".to_string()),
11796        )
11797    }
11798
11799    /// VipsMsb (msb), pick most-significant byte from an image
11800    /// returns `VipsImage` - Output image
11801    ///
11802    /// <ins>Optional arguments</ins>
11803    ///
11804    /// band: `i32` -> Band to msb
11805    pub fn msb_with_opts(&self, option: VOption) -> Result<VipsImage> {
11806        let mut out_out = VipsImage::from(null_mut());
11807        let vips_op_response = call(
11808            "msb",
11809            option
11810                .set("in", self)
11811                .set(
11812                    "out",
11813                    &mut out_out,
11814                ),
11815        );
11816
11817        utils::result(
11818            vips_op_response,
11819            out_out,
11820            Error::OperationError("Msb (vips_msb) failed".to_string()),
11821        )
11822    }
11823
11824    /// VipsMultiply (multiply), multiply two images
11825    /// returns `VipsImage` - Output image
11826    ///
11827    /// right: `&VipsImage` -> Right-hand image argument
11828    pub fn multiply(&self, right: &VipsImage) -> Result<VipsImage> {
11829        let mut out_out = VipsImage::from(null_mut());
11830        let vips_op_response = call(
11831            "multiply",
11832            VOption::new()
11833                .set(
11834                    "left",
11835                    self,
11836                )
11837                .set(
11838                    "right",
11839                    right,
11840                )
11841                .set(
11842                    "out",
11843                    &mut out_out,
11844                ),
11845        );
11846
11847        utils::result(
11848            vips_op_response,
11849            out_out,
11850            Error::OperationError("Multiply (vips_multiply) failed".to_string()),
11851        )
11852    }
11853
11854    /// VipsForeignLoadOpenexr (openexrload), load an OpenEXR image (.exr), priority=200, untrusted, is_a, get_flags, get_flags_filename, header, load
11855    /// returns `VipsImage` - Output image
11856    ///
11857    /// filename: `&str` -> Filename to load from
11858    pub fn openexrload(filename: &str) -> Result<VipsImage> {
11859        let mut out_out = VipsImage::from(null_mut());
11860        let vips_op_response = call(
11861            "openexrload",
11862            VOption::new()
11863                .set(
11864                    "filename",
11865                    filename,
11866                )
11867                .set(
11868                    "out",
11869                    &mut out_out,
11870                ),
11871        );
11872
11873        utils::result(
11874            vips_op_response,
11875            out_out,
11876            Error::OperationError("Openexrload (vips_openexrload) failed".to_string()),
11877        )
11878    }
11879
11880    /// VipsForeignLoadOpenexr (openexrload), load an OpenEXR image (.exr), priority=200, untrusted, is_a, get_flags, get_flags_filename, header, load
11881    /// returns `VipsImage` - Output image
11882    ///
11883    /// filename: `&str` -> Filename to load from
11884    ///
11885    /// <ins>Optional arguments</ins>
11886    ///
11887    /// flags: [`ForeignFlags`] -> Flags for this file
11888    ///
11889    /// memory: `bool` -> Force open via memory
11890    ///
11891    /// access: [`Access`] -> Required access pattern for this file
11892    ///
11893    /// fail_on: [`FailOn`] -> Error level to fail on
11894    ///
11895    /// revalidate: `bool` -> Don't use a cached result for this operation
11896    pub fn openexrload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
11897        let mut out_out = VipsImage::from(null_mut());
11898        let vips_op_response = call(
11899            "openexrload",
11900            option
11901                .set(
11902                    "filename",
11903                    filename,
11904                )
11905                .set(
11906                    "out",
11907                    &mut out_out,
11908                ),
11909        );
11910
11911        utils::result(
11912            vips_op_response,
11913            out_out,
11914            Error::OperationError("Openexrload (vips_openexrload) failed".to_string()),
11915        )
11916    }
11917
11918    /// VipsForeignLoadOpenslideFile (openslideload), load file with OpenSlide (.svs, .vms, .vmu, .ndpi, .scn, .mrxs, .svslide, .tif, .bif), priority=100, untrusted, is_a, get_flags, get_flags_filename, header, load
11919    /// returns `VipsImage` - Output image
11920    ///
11921    /// filename: `&str` -> Filename to load from
11922    pub fn openslideload(filename: &str) -> Result<VipsImage> {
11923        let mut out_out = VipsImage::from(null_mut());
11924        let vips_op_response = call(
11925            "openslideload",
11926            VOption::new()
11927                .set(
11928                    "filename",
11929                    filename,
11930                )
11931                .set(
11932                    "out",
11933                    &mut out_out,
11934                ),
11935        );
11936
11937        utils::result(
11938            vips_op_response,
11939            out_out,
11940            Error::OperationError("Openslideload (vips_openslideload) failed".to_string()),
11941        )
11942    }
11943
11944    /// VipsForeignLoadOpenslideFile (openslideload), load file with OpenSlide (.svs, .vms, .vmu, .ndpi, .scn, .mrxs, .svslide, .tif, .bif), priority=100, untrusted, is_a, get_flags, get_flags_filename, header, load
11945    /// returns `VipsImage` - Output image
11946    ///
11947    /// filename: `&str` -> Filename to load from
11948    ///
11949    /// <ins>Optional arguments</ins>
11950    ///
11951    /// level: `i32` -> Load this level from the file
11952    ///
11953    /// autocrop: `bool` -> Crop to image bounds
11954    ///
11955    /// associated: `&str` -> Load this associated image
11956    ///
11957    /// attach_associated: `bool` -> Attach all associated images
11958    ///
11959    /// rgb: `bool` -> Output RGB (not RGBA)
11960    ///
11961    /// flags: [`ForeignFlags`] -> Flags for this file
11962    ///
11963    /// memory: `bool` -> Force open via memory
11964    ///
11965    /// access: [`Access`] -> Required access pattern for this file
11966    ///
11967    /// fail_on: [`FailOn`] -> Error level to fail on
11968    ///
11969    /// revalidate: `bool` -> Don't use a cached result for this operation
11970    pub fn openslideload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
11971        let mut out_out = VipsImage::from(null_mut());
11972        let vips_op_response = call(
11973            "openslideload",
11974            option
11975                .set(
11976                    "filename",
11977                    filename,
11978                )
11979                .set(
11980                    "out",
11981                    &mut out_out,
11982                ),
11983        );
11984
11985        utils::result(
11986            vips_op_response,
11987            out_out,
11988            Error::OperationError("Openslideload (vips_openslideload) failed".to_string()),
11989        )
11990    }
11991
11992    /// VipsForeignLoadOpenslideSource (openslideload_source), load source with OpenSlide, priority=100, untrusted, is_a_source, get_flags, get_flags_filename, header, load
11993    /// returns `VipsImage` - Output image
11994    ///
11995    /// source: `&VipsSource` -> Source to load from
11996    pub fn openslideload_source(source: &VipsSource) -> Result<VipsImage> {
11997        let mut out_out = VipsImage::from(null_mut());
11998        let vips_op_response = call(
11999            "openslideload_source",
12000            VOption::new()
12001                .set(
12002                    "source",
12003                    source,
12004                )
12005                .set(
12006                    "out",
12007                    &mut out_out,
12008                ),
12009        );
12010
12011        utils::result(
12012            vips_op_response,
12013            out_out,
12014            Error::OperationError(
12015                "OpenslideloadSource (vips_openslideload_source) failed".to_string(),
12016            ),
12017        )
12018    }
12019
12020    /// VipsForeignLoadOpenslideSource (openslideload_source), load source with OpenSlide, priority=100, untrusted, is_a_source, get_flags, get_flags_filename, header, load
12021    /// returns `VipsImage` - Output image
12022    ///
12023    /// source: `&VipsSource` -> Source to load from
12024    ///
12025    /// <ins>Optional arguments</ins>
12026    ///
12027    /// level: `i32` -> Load this level from the file
12028    ///
12029    /// autocrop: `bool` -> Crop to image bounds
12030    ///
12031    /// associated: `&str` -> Load this associated image
12032    ///
12033    /// attach_associated: `bool` -> Attach all associated images
12034    ///
12035    /// rgb: `bool` -> Output RGB (not RGBA)
12036    ///
12037    /// flags: [`ForeignFlags`] -> Flags for this file
12038    ///
12039    /// memory: `bool` -> Force open via memory
12040    ///
12041    /// access: [`Access`] -> Required access pattern for this file
12042    ///
12043    /// fail_on: [`FailOn`] -> Error level to fail on
12044    ///
12045    /// revalidate: `bool` -> Don't use a cached result for this operation
12046    pub fn openslideload_source_with_opts(
12047        source: &VipsSource,
12048        option: VOption,
12049    ) -> Result<VipsImage> {
12050        let mut out_out = VipsImage::from(null_mut());
12051        let vips_op_response = call(
12052            "openslideload_source",
12053            option
12054                .set(
12055                    "source",
12056                    source,
12057                )
12058                .set(
12059                    "out",
12060                    &mut out_out,
12061                ),
12062        );
12063
12064        utils::result(
12065            vips_op_response,
12066            out_out,
12067            Error::OperationError(
12068                "OpenslideloadSource (vips_openslideload_source) failed".to_string(),
12069            ),
12070        )
12071    }
12072
12073    /// VipsForeignLoadPdfFile (pdfload), load PDF from file (.pdf), priority=0, untrusted, is_a, get_flags, get_flags_filename, header, load
12074    /// returns `VipsImage` - Output image
12075    ///
12076    /// filename: `&str` -> Filename to load from
12077    pub fn pdfload(filename: &str) -> Result<VipsImage> {
12078        let mut out_out = VipsImage::from(null_mut());
12079        let vips_op_response = call(
12080            "pdfload",
12081            VOption::new()
12082                .set(
12083                    "filename",
12084                    filename,
12085                )
12086                .set(
12087                    "out",
12088                    &mut out_out,
12089                ),
12090        );
12091
12092        utils::result(
12093            vips_op_response,
12094            out_out,
12095            Error::OperationError("Pdfload (vips_pdfload) failed".to_string()),
12096        )
12097    }
12098
12099    /// VipsForeignLoadPdfFile (pdfload), load PDF from file (.pdf), priority=0, untrusted, is_a, get_flags, get_flags_filename, header, load
12100    /// returns `VipsImage` - Output image
12101    ///
12102    /// filename: `&str` -> Filename to load from
12103    ///
12104    /// <ins>Optional arguments</ins>
12105    ///
12106    /// page: `i32` -> First page to load
12107    ///
12108    /// n: `i32` -> Number of pages to load, -1 for all
12109    ///
12110    /// dpi: `f64` -> DPI to render at
12111    ///
12112    /// scale: `f64` -> Factor to scale by
12113    ///
12114    /// background: `&[f64]` -> Background colour
12115    ///
12116    /// password: `&str` -> Password to decrypt with
12117    ///
12118    /// flags: [`ForeignFlags`] -> Flags for this file
12119    ///
12120    /// memory: `bool` -> Force open via memory
12121    ///
12122    /// access: [`Access`] -> Required access pattern for this file
12123    ///
12124    /// fail_on: [`FailOn`] -> Error level to fail on
12125    ///
12126    /// revalidate: `bool` -> Don't use a cached result for this operation
12127    pub fn pdfload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
12128        let mut out_out = VipsImage::from(null_mut());
12129        let vips_op_response = call(
12130            "pdfload",
12131            option
12132                .set(
12133                    "filename",
12134                    filename,
12135                )
12136                .set(
12137                    "out",
12138                    &mut out_out,
12139                ),
12140        );
12141
12142        utils::result(
12143            vips_op_response,
12144            out_out,
12145            Error::OperationError("Pdfload (vips_pdfload) failed".to_string()),
12146        )
12147    }
12148
12149    /// VipsForeignLoadPdfBuffer (pdfload_buffer), load PDF from buffer, priority=0, untrusted, is_a_buffer, get_flags, get_flags_filename, header, load
12150    /// returns `VipsImage` - Output image
12151    ///
12152    /// buffer: `&[u8]` -> Buffer to load from
12153    pub fn pdfload_buffer(buffer: &[u8]) -> Result<VipsImage> {
12154        let blob = unsafe {
12155            vips_blob_new(
12156                None,
12157                buffer.as_ptr() as _,
12158                buffer.len() as _,
12159            )
12160        };
12161        let mut out_out = VipsImage::from(null_mut());
12162        let vips_op_response = call(
12163            "pdfload_buffer",
12164            VOption::new()
12165                .set(
12166                    "buffer",
12167                    &VipsBlob::from(blob),
12168                )
12169                .set(
12170                    "out",
12171                    &mut out_out,
12172                ),
12173        );
12174        unsafe { vips_area_unref(&mut (*blob).area) };
12175        utils::result(
12176            vips_op_response,
12177            out_out,
12178            Error::OperationError("PdfloadBuffer (vips_pdfload_buffer) failed".to_string()),
12179        )
12180    }
12181
12182    /// VipsForeignLoadPdfBuffer (pdfload_buffer), load PDF from buffer, priority=0, untrusted, is_a_buffer, get_flags, get_flags_filename, header, load
12183    /// returns `VipsImage` - Output image
12184    ///
12185    /// buffer: `&[u8]` -> Buffer to load from
12186    ///
12187    /// <ins>Optional arguments</ins>
12188    ///
12189    /// page: `i32` -> First page to load
12190    ///
12191    /// n: `i32` -> Number of pages to load, -1 for all
12192    ///
12193    /// dpi: `f64` -> DPI to render at
12194    ///
12195    /// scale: `f64` -> Factor to scale by
12196    ///
12197    /// background: `&[f64]` -> Background colour
12198    ///
12199    /// password: `&str` -> Password to decrypt with
12200    ///
12201    /// flags: [`ForeignFlags`] -> Flags for this file
12202    ///
12203    /// memory: `bool` -> Force open via memory
12204    ///
12205    /// access: [`Access`] -> Required access pattern for this file
12206    ///
12207    /// fail_on: [`FailOn`] -> Error level to fail on
12208    ///
12209    /// revalidate: `bool` -> Don't use a cached result for this operation
12210    pub fn pdfload_buffer_with_opts(buffer: &[u8], option: VOption) -> Result<VipsImage> {
12211        let blob = unsafe {
12212            vips_blob_new(
12213                None,
12214                buffer.as_ptr() as _,
12215                buffer.len() as _,
12216            )
12217        };
12218        let mut out_out = VipsImage::from(null_mut());
12219        let vips_op_response = call(
12220            "pdfload_buffer",
12221            option
12222                .set(
12223                    "buffer",
12224                    &VipsBlob::from(blob),
12225                )
12226                .set(
12227                    "out",
12228                    &mut out_out,
12229                ),
12230        );
12231        unsafe { vips_area_unref(&mut (*blob).area) };
12232        utils::result(
12233            vips_op_response,
12234            out_out,
12235            Error::OperationError("PdfloadBuffer (vips_pdfload_buffer) failed".to_string()),
12236        )
12237    }
12238
12239    /// VipsForeignLoadPdfSource (pdfload_source), load PDF from source, priority=0, untrusted, is_a_source, get_flags, get_flags_filename, header, load
12240    /// returns `VipsImage` - Output image
12241    ///
12242    /// source: `&VipsSource` -> Source to load from
12243    pub fn pdfload_source(source: &VipsSource) -> Result<VipsImage> {
12244        let mut out_out = VipsImage::from(null_mut());
12245        let vips_op_response = call(
12246            "pdfload_source",
12247            VOption::new()
12248                .set(
12249                    "source",
12250                    source,
12251                )
12252                .set(
12253                    "out",
12254                    &mut out_out,
12255                ),
12256        );
12257
12258        utils::result(
12259            vips_op_response,
12260            out_out,
12261            Error::OperationError("PdfloadSource (vips_pdfload_source) failed".to_string()),
12262        )
12263    }
12264
12265    /// VipsForeignLoadPdfSource (pdfload_source), load PDF from source, priority=0, untrusted, is_a_source, get_flags, get_flags_filename, header, load
12266    /// returns `VipsImage` - Output image
12267    ///
12268    /// source: `&VipsSource` -> Source to load from
12269    ///
12270    /// <ins>Optional arguments</ins>
12271    ///
12272    /// page: `i32` -> First page to load
12273    ///
12274    /// n: `i32` -> Number of pages to load, -1 for all
12275    ///
12276    /// dpi: `f64` -> DPI to render at
12277    ///
12278    /// scale: `f64` -> Factor to scale by
12279    ///
12280    /// background: `&[f64]` -> Background colour
12281    ///
12282    /// password: `&str` -> Password to decrypt with
12283    ///
12284    /// flags: [`ForeignFlags`] -> Flags for this file
12285    ///
12286    /// memory: `bool` -> Force open via memory
12287    ///
12288    /// access: [`Access`] -> Required access pattern for this file
12289    ///
12290    /// fail_on: [`FailOn`] -> Error level to fail on
12291    ///
12292    /// revalidate: `bool` -> Don't use a cached result for this operation
12293    pub fn pdfload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
12294        let mut out_out = VipsImage::from(null_mut());
12295        let vips_op_response = call(
12296            "pdfload_source",
12297            option
12298                .set(
12299                    "source",
12300                    source,
12301                )
12302                .set(
12303                    "out",
12304                    &mut out_out,
12305                ),
12306        );
12307
12308        utils::result(
12309            vips_op_response,
12310            out_out,
12311            Error::OperationError("PdfloadSource (vips_pdfload_source) failed".to_string()),
12312        )
12313    }
12314
12315    /// VipsPercent (percent), find threshold for percent of pixels
12316    /// returns `i32` - Threshold above which lie percent of pixels
12317    ///
12318    /// percent: `f64` -> Percent of pixels
12319    pub fn percent(&self, percent: f64) -> Result<i32> {
12320        let mut threshold_out: i32 = 0;
12321        let vips_op_response = call(
12322            "percent",
12323            VOption::new()
12324                .set("in", self)
12325                .set(
12326                    "percent",
12327                    percent,
12328                )
12329                .set(
12330                    "threshold",
12331                    &mut threshold_out,
12332                ),
12333        );
12334
12335        utils::result(
12336            vips_op_response,
12337            threshold_out,
12338            Error::OperationError("Percent (vips_percent) failed".to_string()),
12339        )
12340    }
12341
12342    /// VipsPerlin (perlin), make a perlin noise image
12343    /// returns `VipsImage` - Output image
12344    ///
12345    /// width: `i32` -> Image width in pixels
12346    ///
12347    /// height: `i32` -> Image height in pixels
12348    pub fn perlin(width: i32, height: i32) -> Result<VipsImage> {
12349        let mut out_out = VipsImage::from(null_mut());
12350        let vips_op_response = call(
12351            "perlin",
12352            VOption::new()
12353                .set(
12354                    "out",
12355                    &mut out_out,
12356                )
12357                .set(
12358                    "width",
12359                    width,
12360                )
12361                .set(
12362                    "height",
12363                    height,
12364                ),
12365        );
12366
12367        utils::result(
12368            vips_op_response,
12369            out_out,
12370            Error::OperationError("Perlin (vips_perlin) failed".to_string()),
12371        )
12372    }
12373
12374    /// VipsPerlin (perlin), make a perlin noise image
12375    /// returns `VipsImage` - Output image
12376    ///
12377    /// width: `i32` -> Image width in pixels
12378    ///
12379    /// height: `i32` -> Image height in pixels
12380    ///
12381    /// <ins>Optional arguments</ins>
12382    ///
12383    /// cell_size: `i32` -> Size of Perlin cells
12384    ///
12385    /// uchar: `bool` -> Output an unsigned char image
12386    ///
12387    /// seed: `i32` -> Random number seed
12388    pub fn perlin_with_opts(width: i32, height: i32, option: VOption) -> Result<VipsImage> {
12389        let mut out_out = VipsImage::from(null_mut());
12390        let vips_op_response = call(
12391            "perlin",
12392            option
12393                .set(
12394                    "out",
12395                    &mut out_out,
12396                )
12397                .set(
12398                    "width",
12399                    width,
12400                )
12401                .set(
12402                    "height",
12403                    height,
12404                ),
12405        );
12406
12407        utils::result(
12408            vips_op_response,
12409            out_out,
12410            Error::OperationError("Perlin (vips_perlin) failed".to_string()),
12411        )
12412    }
12413
12414    /// VipsPhasecor (phasecor), calculate phase correlation
12415    /// returns `VipsImage` - Output image
12416    ///
12417    /// in2: `&VipsImage` -> Second input image
12418    pub fn phasecor(&self, in2: &VipsImage) -> Result<VipsImage> {
12419        let mut out_out = VipsImage::from(null_mut());
12420        let vips_op_response = call(
12421            "phasecor",
12422            VOption::new()
12423                .set("in", self)
12424                .set("in2", in2)
12425                .set(
12426                    "out",
12427                    &mut out_out,
12428                ),
12429        );
12430
12431        utils::result(
12432            vips_op_response,
12433            out_out,
12434            Error::OperationError("Phasecor (vips_phasecor) failed".to_string()),
12435        )
12436    }
12437
12438    /// VipsForeignLoadPngFile (pngload), load png from file (.png), priority=200, is_a, get_flags, get_flags_filename, header, load
12439    /// returns `VipsImage` - Output image
12440    ///
12441    /// filename: `&str` -> Filename to load from
12442    pub fn pngload(filename: &str) -> Result<VipsImage> {
12443        let mut out_out = VipsImage::from(null_mut());
12444        let vips_op_response = call(
12445            "pngload",
12446            VOption::new()
12447                .set(
12448                    "filename",
12449                    filename,
12450                )
12451                .set(
12452                    "out",
12453                    &mut out_out,
12454                ),
12455        );
12456
12457        utils::result(
12458            vips_op_response,
12459            out_out,
12460            Error::OperationError("Pngload (vips_pngload) failed".to_string()),
12461        )
12462    }
12463
12464    /// VipsForeignLoadPngFile (pngload), load png from file (.png), priority=200, is_a, get_flags, get_flags_filename, header, load
12465    /// returns `VipsImage` - Output image
12466    ///
12467    /// filename: `&str` -> Filename to load from
12468    ///
12469    /// <ins>Optional arguments</ins>
12470    ///
12471    /// unlimited: `bool` -> Remove all denial of service limits
12472    ///
12473    /// flags: [`ForeignFlags`] -> Flags for this file
12474    ///
12475    /// memory: `bool` -> Force open via memory
12476    ///
12477    /// access: [`Access`] -> Required access pattern for this file
12478    ///
12479    /// fail_on: [`FailOn`] -> Error level to fail on
12480    ///
12481    /// revalidate: `bool` -> Don't use a cached result for this operation
12482    pub fn pngload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
12483        let mut out_out = VipsImage::from(null_mut());
12484        let vips_op_response = call(
12485            "pngload",
12486            option
12487                .set(
12488                    "filename",
12489                    filename,
12490                )
12491                .set(
12492                    "out",
12493                    &mut out_out,
12494                ),
12495        );
12496
12497        utils::result(
12498            vips_op_response,
12499            out_out,
12500            Error::OperationError("Pngload (vips_pngload) failed".to_string()),
12501        )
12502    }
12503
12504    /// VipsForeignLoadPngBuffer (pngload_buffer), load png from buffer, priority=200, is_a_buffer, get_flags, get_flags_filename, header, load
12505    /// returns `VipsImage` - Output image
12506    ///
12507    /// buffer: `&[u8]` -> Buffer to load from
12508    pub fn pngload_buffer(buffer: &[u8]) -> Result<VipsImage> {
12509        let blob = unsafe {
12510            vips_blob_new(
12511                None,
12512                buffer.as_ptr() as _,
12513                buffer.len() as _,
12514            )
12515        };
12516        let mut out_out = VipsImage::from(null_mut());
12517        let vips_op_response = call(
12518            "pngload_buffer",
12519            VOption::new()
12520                .set(
12521                    "buffer",
12522                    &VipsBlob::from(blob),
12523                )
12524                .set(
12525                    "out",
12526                    &mut out_out,
12527                ),
12528        );
12529        unsafe { vips_area_unref(&mut (*blob).area) };
12530        utils::result(
12531            vips_op_response,
12532            out_out,
12533            Error::OperationError("PngloadBuffer (vips_pngload_buffer) failed".to_string()),
12534        )
12535    }
12536
12537    /// VipsForeignLoadPngBuffer (pngload_buffer), load png from buffer, priority=200, is_a_buffer, get_flags, get_flags_filename, header, load
12538    /// returns `VipsImage` - Output image
12539    ///
12540    /// buffer: `&[u8]` -> Buffer to load from
12541    ///
12542    /// <ins>Optional arguments</ins>
12543    ///
12544    /// unlimited: `bool` -> Remove all denial of service limits
12545    ///
12546    /// flags: [`ForeignFlags`] -> Flags for this file
12547    ///
12548    /// memory: `bool` -> Force open via memory
12549    ///
12550    /// access: [`Access`] -> Required access pattern for this file
12551    ///
12552    /// fail_on: [`FailOn`] -> Error level to fail on
12553    ///
12554    /// revalidate: `bool` -> Don't use a cached result for this operation
12555    pub fn pngload_buffer_with_opts(buffer: &[u8], option: VOption) -> Result<VipsImage> {
12556        let blob = unsafe {
12557            vips_blob_new(
12558                None,
12559                buffer.as_ptr() as _,
12560                buffer.len() as _,
12561            )
12562        };
12563        let mut out_out = VipsImage::from(null_mut());
12564        let vips_op_response = call(
12565            "pngload_buffer",
12566            option
12567                .set(
12568                    "buffer",
12569                    &VipsBlob::from(blob),
12570                )
12571                .set(
12572                    "out",
12573                    &mut out_out,
12574                ),
12575        );
12576        unsafe { vips_area_unref(&mut (*blob).area) };
12577        utils::result(
12578            vips_op_response,
12579            out_out,
12580            Error::OperationError("PngloadBuffer (vips_pngload_buffer) failed".to_string()),
12581        )
12582    }
12583
12584    /// VipsForeignLoadPngSource (pngload_source), load png from source, priority=200, is_a_source, get_flags, get_flags_filename, header, load
12585    /// returns `VipsImage` - Output image
12586    ///
12587    /// source: `&VipsSource` -> Source to load from
12588    pub fn pngload_source(source: &VipsSource) -> Result<VipsImage> {
12589        let mut out_out = VipsImage::from(null_mut());
12590        let vips_op_response = call(
12591            "pngload_source",
12592            VOption::new()
12593                .set(
12594                    "source",
12595                    source,
12596                )
12597                .set(
12598                    "out",
12599                    &mut out_out,
12600                ),
12601        );
12602
12603        utils::result(
12604            vips_op_response,
12605            out_out,
12606            Error::OperationError("PngloadSource (vips_pngload_source) failed".to_string()),
12607        )
12608    }
12609
12610    /// VipsForeignLoadPngSource (pngload_source), load png from source, priority=200, is_a_source, get_flags, get_flags_filename, header, load
12611    /// returns `VipsImage` - Output image
12612    ///
12613    /// source: `&VipsSource` -> Source to load from
12614    ///
12615    /// <ins>Optional arguments</ins>
12616    ///
12617    /// unlimited: `bool` -> Remove all denial of service limits
12618    ///
12619    /// flags: [`ForeignFlags`] -> Flags for this file
12620    ///
12621    /// memory: `bool` -> Force open via memory
12622    ///
12623    /// access: [`Access`] -> Required access pattern for this file
12624    ///
12625    /// fail_on: [`FailOn`] -> Error level to fail on
12626    ///
12627    /// revalidate: `bool` -> Don't use a cached result for this operation
12628    pub fn pngload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
12629        let mut out_out = VipsImage::from(null_mut());
12630        let vips_op_response = call(
12631            "pngload_source",
12632            option
12633                .set(
12634                    "source",
12635                    source,
12636                )
12637                .set(
12638                    "out",
12639                    &mut out_out,
12640                ),
12641        );
12642
12643        utils::result(
12644            vips_op_response,
12645            out_out,
12646            Error::OperationError("PngloadSource (vips_pngload_source) failed".to_string()),
12647        )
12648    }
12649
12650    /// VipsForeignSaveSpngFile (pngsave), save image to file as PNG (.png), priority=0, mono rgb alpha
12651    ///
12652    /// filename: `&str` -> Filename to save to
12653    pub fn pngsave(&self, filename: &str) -> Result<()> {
12654        let vips_op_response = call(
12655            "pngsave",
12656            VOption::new()
12657                .set("in", self)
12658                .set(
12659                    "filename",
12660                    filename,
12661                ),
12662        );
12663
12664        utils::result(
12665            vips_op_response,
12666            (),
12667            Error::OperationError("Pngsave (vips_pngsave) failed".to_string()),
12668        )
12669    }
12670
12671    /// VipsForeignSaveSpngFile (pngsave), save image to file as PNG (.png), priority=0, mono rgb alpha
12672    ///
12673    /// filename: `&str` -> Filename to save to
12674    ///
12675    /// <ins>Optional arguments</ins>
12676    ///
12677    /// compression: `i32` -> Compression factor
12678    ///
12679    /// interlace: `bool` -> Interlace image
12680    ///
12681    /// filter: [`ForeignPngFilter`] -> libspng row filter flag(s)
12682    ///
12683    /// palette: `bool` -> Quantise to 8bpp palette
12684    ///
12685    /// Q: `i32` -> Quantisation quality
12686    ///
12687    /// dither: `f64` -> Amount of dithering
12688    ///
12689    /// bitdepth: `i32` -> Write as a 1, 2, 4, 8 or 16 bit image
12690    ///
12691    /// effort: `i32` -> Quantisation CPU effort
12692    ///
12693    /// keep: [`ForeignKeep`] -> Which metadata to retain
12694    ///
12695    /// background: `&[f64]` -> Background value
12696    ///
12697    /// page_height: `i32` -> Set page height for multipage save
12698    ///
12699    /// profile: `&str` -> Filename of ICC profile to embed
12700    pub fn pngsave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
12701        let vips_op_response = call(
12702            "pngsave",
12703            option
12704                .set("in", self)
12705                .set(
12706                    "filename",
12707                    filename,
12708                ),
12709        );
12710
12711        utils::result(
12712            vips_op_response,
12713            (),
12714            Error::OperationError("Pngsave (vips_pngsave) failed".to_string()),
12715        )
12716    }
12717
12718    /// VipsForeignSaveSpngBuffer (pngsave_buffer), save image to buffer as PNG (.png), priority=0, mono rgb alpha
12719    /// returns `Vec<u8>` - Buffer to save to
12720    pub fn pngsave_buffer(&self) -> Result<Vec<u8>> {
12721        let mut buffer_out = VipsBlob::from(null_mut());
12722        let vips_op_response = call(
12723            "pngsave_buffer",
12724            VOption::new()
12725                .set("in", self)
12726                .set(
12727                    "buffer",
12728                    &mut buffer_out,
12729                ),
12730        );
12731
12732        utils::result(
12733            vips_op_response,
12734            buffer_out.into(),
12735            Error::OperationError("PngsaveBuffer (vips_pngsave_buffer) failed".to_string()),
12736        )
12737    }
12738
12739    /// VipsForeignSaveSpngBuffer (pngsave_buffer), save image to buffer as PNG (.png), priority=0, mono rgb alpha
12740    /// returns `Vec<u8>` - Buffer to save to
12741    ///
12742    /// <ins>Optional arguments</ins>
12743    ///
12744    /// compression: `i32` -> Compression factor
12745    ///
12746    /// interlace: `bool` -> Interlace image
12747    ///
12748    /// filter: [`ForeignPngFilter`] -> libspng row filter flag(s)
12749    ///
12750    /// palette: `bool` -> Quantise to 8bpp palette
12751    ///
12752    /// Q: `i32` -> Quantisation quality
12753    ///
12754    /// dither: `f64` -> Amount of dithering
12755    ///
12756    /// bitdepth: `i32` -> Write as a 1, 2, 4, 8 or 16 bit image
12757    ///
12758    /// effort: `i32` -> Quantisation CPU effort
12759    ///
12760    /// keep: [`ForeignKeep`] -> Which metadata to retain
12761    ///
12762    /// background: `&[f64]` -> Background value
12763    ///
12764    /// page_height: `i32` -> Set page height for multipage save
12765    ///
12766    /// profile: `&str` -> Filename of ICC profile to embed
12767    pub fn pngsave_buffer_with_opts(&self, option: VOption) -> Result<Vec<u8>> {
12768        let mut buffer_out = VipsBlob::from(null_mut());
12769        let vips_op_response = call(
12770            "pngsave_buffer",
12771            option
12772                .set("in", self)
12773                .set(
12774                    "buffer",
12775                    &mut buffer_out,
12776                ),
12777        );
12778
12779        utils::result(
12780            vips_op_response,
12781            buffer_out.into(),
12782            Error::OperationError("PngsaveBuffer (vips_pngsave_buffer) failed".to_string()),
12783        )
12784    }
12785
12786    /// VipsForeignSaveSpngTarget (pngsave_target), save image to target as PNG (.png), priority=0, mono rgb alpha
12787    ///
12788    /// target: `&VipsTarget` -> Target to save to
12789    pub fn pngsave_target(&self, target: &VipsTarget) -> Result<()> {
12790        let vips_op_response = call(
12791            "pngsave_target",
12792            VOption::new()
12793                .set("in", self)
12794                .set(
12795                    "target",
12796                    target,
12797                ),
12798        );
12799
12800        utils::result(
12801            vips_op_response,
12802            (),
12803            Error::OperationError("PngsaveTarget (vips_pngsave_target) failed".to_string()),
12804        )
12805    }
12806
12807    /// VipsForeignSaveSpngTarget (pngsave_target), save image to target as PNG (.png), priority=0, mono rgb alpha
12808    ///
12809    /// target: `&VipsTarget` -> Target to save to
12810    ///
12811    /// <ins>Optional arguments</ins>
12812    ///
12813    /// compression: `i32` -> Compression factor
12814    ///
12815    /// interlace: `bool` -> Interlace image
12816    ///
12817    /// filter: [`ForeignPngFilter`] -> libspng row filter flag(s)
12818    ///
12819    /// palette: `bool` -> Quantise to 8bpp palette
12820    ///
12821    /// Q: `i32` -> Quantisation quality
12822    ///
12823    /// dither: `f64` -> Amount of dithering
12824    ///
12825    /// bitdepth: `i32` -> Write as a 1, 2, 4, 8 or 16 bit image
12826    ///
12827    /// effort: `i32` -> Quantisation CPU effort
12828    ///
12829    /// keep: [`ForeignKeep`] -> Which metadata to retain
12830    ///
12831    /// background: `&[f64]` -> Background value
12832    ///
12833    /// page_height: `i32` -> Set page height for multipage save
12834    ///
12835    /// profile: `&str` -> Filename of ICC profile to embed
12836    pub fn pngsave_target_with_opts(&self, target: &VipsTarget, option: VOption) -> Result<()> {
12837        let vips_op_response = call(
12838            "pngsave_target",
12839            option
12840                .set("in", self)
12841                .set(
12842                    "target",
12843                    target,
12844                ),
12845        );
12846
12847        utils::result(
12848            vips_op_response,
12849            (),
12850            Error::OperationError("PngsaveTarget (vips_pngsave_target) failed".to_string()),
12851        )
12852    }
12853
12854    /// VipsForeignLoadPpmFile (ppmload), load ppm from file (.pbm, .pgm, .ppm, .pfm, .pnm), priority=200, untrusted, is_a, get_flags, header, load
12855    /// returns `VipsImage` - Output image
12856    ///
12857    /// filename: `&str` -> Filename to load from
12858    pub fn ppmload(filename: &str) -> Result<VipsImage> {
12859        let mut out_out = VipsImage::from(null_mut());
12860        let vips_op_response = call(
12861            "ppmload",
12862            VOption::new()
12863                .set(
12864                    "filename",
12865                    filename,
12866                )
12867                .set(
12868                    "out",
12869                    &mut out_out,
12870                ),
12871        );
12872
12873        utils::result(
12874            vips_op_response,
12875            out_out,
12876            Error::OperationError("Ppmload (vips_ppmload) failed".to_string()),
12877        )
12878    }
12879
12880    /// VipsForeignLoadPpmFile (ppmload), load ppm from file (.pbm, .pgm, .ppm, .pfm, .pnm), priority=200, untrusted, is_a, get_flags, header, load
12881    /// returns `VipsImage` - Output image
12882    ///
12883    /// filename: `&str` -> Filename to load from
12884    ///
12885    /// <ins>Optional arguments</ins>
12886    ///
12887    /// flags: [`ForeignFlags`] -> Flags for this file
12888    ///
12889    /// memory: `bool` -> Force open via memory
12890    ///
12891    /// access: [`Access`] -> Required access pattern for this file
12892    ///
12893    /// fail_on: [`FailOn`] -> Error level to fail on
12894    ///
12895    /// revalidate: `bool` -> Don't use a cached result for this operation
12896    pub fn ppmload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
12897        let mut out_out = VipsImage::from(null_mut());
12898        let vips_op_response = call(
12899            "ppmload",
12900            option
12901                .set(
12902                    "filename",
12903                    filename,
12904                )
12905                .set(
12906                    "out",
12907                    &mut out_out,
12908                ),
12909        );
12910
12911        utils::result(
12912            vips_op_response,
12913            out_out,
12914            Error::OperationError("Ppmload (vips_ppmload) failed".to_string()),
12915        )
12916    }
12917
12918    /// VipsForeignLoadPpmBuffer (ppmload_buffer), load ppm from buffer (.pbm, .pgm, .ppm, .pfm, .pnm), priority=200, untrusted, is_a_buffer, get_flags, header, load
12919    /// returns `VipsImage` - Output image
12920    ///
12921    /// buffer: `&[u8]` -> Buffer to load from
12922    pub fn ppmload_buffer(buffer: &[u8]) -> Result<VipsImage> {
12923        let blob = unsafe {
12924            vips_blob_new(
12925                None,
12926                buffer.as_ptr() as _,
12927                buffer.len() as _,
12928            )
12929        };
12930        let mut out_out = VipsImage::from(null_mut());
12931        let vips_op_response = call(
12932            "ppmload_buffer",
12933            VOption::new()
12934                .set(
12935                    "buffer",
12936                    &VipsBlob::from(blob),
12937                )
12938                .set(
12939                    "out",
12940                    &mut out_out,
12941                ),
12942        );
12943        unsafe { vips_area_unref(&mut (*blob).area) };
12944        utils::result(
12945            vips_op_response,
12946            out_out,
12947            Error::OperationError("PpmloadBuffer (vips_ppmload_buffer) failed".to_string()),
12948        )
12949    }
12950
12951    /// VipsForeignLoadPpmBuffer (ppmload_buffer), load ppm from buffer (.pbm, .pgm, .ppm, .pfm, .pnm), priority=200, untrusted, is_a_buffer, get_flags, header, load
12952    /// returns `VipsImage` - Output image
12953    ///
12954    /// buffer: `&[u8]` -> Buffer to load from
12955    ///
12956    /// <ins>Optional arguments</ins>
12957    ///
12958    /// flags: [`ForeignFlags`] -> Flags for this file
12959    ///
12960    /// memory: `bool` -> Force open via memory
12961    ///
12962    /// access: [`Access`] -> Required access pattern for this file
12963    ///
12964    /// fail_on: [`FailOn`] -> Error level to fail on
12965    ///
12966    /// revalidate: `bool` -> Don't use a cached result for this operation
12967    pub fn ppmload_buffer_with_opts(buffer: &[u8], option: VOption) -> Result<VipsImage> {
12968        let blob = unsafe {
12969            vips_blob_new(
12970                None,
12971                buffer.as_ptr() as _,
12972                buffer.len() as _,
12973            )
12974        };
12975        let mut out_out = VipsImage::from(null_mut());
12976        let vips_op_response = call(
12977            "ppmload_buffer",
12978            option
12979                .set(
12980                    "buffer",
12981                    &VipsBlob::from(blob),
12982                )
12983                .set(
12984                    "out",
12985                    &mut out_out,
12986                ),
12987        );
12988        unsafe { vips_area_unref(&mut (*blob).area) };
12989        utils::result(
12990            vips_op_response,
12991            out_out,
12992            Error::OperationError("PpmloadBuffer (vips_ppmload_buffer) failed".to_string()),
12993        )
12994    }
12995
12996    /// VipsForeignLoadPpmSource (ppmload_source), load ppm from source (.pbm, .pgm, .ppm, .pfm, .pnm), priority=200, untrusted, is_a_source, get_flags, header, load
12997    /// returns `VipsImage` - Output image
12998    ///
12999    /// source: `&VipsSource` -> Source to load from
13000    pub fn ppmload_source(source: &VipsSource) -> Result<VipsImage> {
13001        let mut out_out = VipsImage::from(null_mut());
13002        let vips_op_response = call(
13003            "ppmload_source",
13004            VOption::new()
13005                .set(
13006                    "source",
13007                    source,
13008                )
13009                .set(
13010                    "out",
13011                    &mut out_out,
13012                ),
13013        );
13014
13015        utils::result(
13016            vips_op_response,
13017            out_out,
13018            Error::OperationError("PpmloadSource (vips_ppmload_source) failed".to_string()),
13019        )
13020    }
13021
13022    /// VipsForeignLoadPpmSource (ppmload_source), load ppm from source (.pbm, .pgm, .ppm, .pfm, .pnm), priority=200, untrusted, is_a_source, get_flags, header, load
13023    /// returns `VipsImage` - Output image
13024    ///
13025    /// source: `&VipsSource` -> Source to load from
13026    ///
13027    /// <ins>Optional arguments</ins>
13028    ///
13029    /// flags: [`ForeignFlags`] -> Flags for this file
13030    ///
13031    /// memory: `bool` -> Force open via memory
13032    ///
13033    /// access: [`Access`] -> Required access pattern for this file
13034    ///
13035    /// fail_on: [`FailOn`] -> Error level to fail on
13036    ///
13037    /// revalidate: `bool` -> Don't use a cached result for this operation
13038    pub fn ppmload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
13039        let mut out_out = VipsImage::from(null_mut());
13040        let vips_op_response = call(
13041            "ppmload_source",
13042            option
13043                .set(
13044                    "source",
13045                    source,
13046                )
13047                .set(
13048                    "out",
13049                    &mut out_out,
13050                ),
13051        );
13052
13053        utils::result(
13054            vips_op_response,
13055            out_out,
13056            Error::OperationError("PpmloadSource (vips_ppmload_source) failed".to_string()),
13057        )
13058    }
13059
13060    /// VipsForeignSavePpmFile (ppmsave), save image to ppm file (.pbm, .pgm, .ppm, .pfm, .pnm), priority=0,
13061    ///
13062    /// filename: `&str` -> Filename to save to
13063    pub fn ppmsave(&self, filename: &str) -> Result<()> {
13064        let vips_op_response = call(
13065            "ppmsave",
13066            VOption::new()
13067                .set("in", self)
13068                .set(
13069                    "filename",
13070                    filename,
13071                ),
13072        );
13073
13074        utils::result(
13075            vips_op_response,
13076            (),
13077            Error::OperationError("Ppmsave (vips_ppmsave) failed".to_string()),
13078        )
13079    }
13080
13081    /// VipsForeignSavePpmFile (ppmsave), save image to ppm file (.pbm, .pgm, .ppm, .pfm, .pnm), priority=0,
13082    ///
13083    /// filename: `&str` -> Filename to save to
13084    ///
13085    /// <ins>Optional arguments</ins>
13086    ///
13087    /// format: [`ForeignPpmFormat`] -> Format to save in
13088    ///
13089    /// ascii: `bool` -> Save as ascii
13090    ///
13091    /// bitdepth: `i32` -> Set to 1 to write as a 1 bit image
13092    ///
13093    /// keep: [`ForeignKeep`] -> Which metadata to retain
13094    ///
13095    /// background: `&[f64]` -> Background value
13096    ///
13097    /// page_height: `i32` -> Set page height for multipage save
13098    ///
13099    /// profile: `&str` -> Filename of ICC profile to embed
13100    pub fn ppmsave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
13101        let vips_op_response = call(
13102            "ppmsave",
13103            option
13104                .set("in", self)
13105                .set(
13106                    "filename",
13107                    filename,
13108                ),
13109        );
13110
13111        utils::result(
13112            vips_op_response,
13113            (),
13114            Error::OperationError("Ppmsave (vips_ppmsave) failed".to_string()),
13115        )
13116    }
13117
13118    /// VipsForeignSavePpmTarget (ppmsave_target), save to ppm (.ppm), priority=0,
13119    ///
13120    /// target: `&VipsTarget` -> Target to save to
13121    pub fn ppmsave_target(&self, target: &VipsTarget) -> Result<()> {
13122        let vips_op_response = call(
13123            "ppmsave_target",
13124            VOption::new()
13125                .set("in", self)
13126                .set(
13127                    "target",
13128                    target,
13129                ),
13130        );
13131
13132        utils::result(
13133            vips_op_response,
13134            (),
13135            Error::OperationError("PpmsaveTarget (vips_ppmsave_target) failed".to_string()),
13136        )
13137    }
13138
13139    /// VipsForeignSavePpmTarget (ppmsave_target), save to ppm (.ppm), priority=0,
13140    ///
13141    /// target: `&VipsTarget` -> Target to save to
13142    ///
13143    /// <ins>Optional arguments</ins>
13144    ///
13145    /// format: [`ForeignPpmFormat`] -> Format to save in
13146    ///
13147    /// ascii: `bool` -> Save as ascii
13148    ///
13149    /// bitdepth: `i32` -> Set to 1 to write as a 1 bit image
13150    ///
13151    /// keep: [`ForeignKeep`] -> Which metadata to retain
13152    ///
13153    /// background: `&[f64]` -> Background value
13154    ///
13155    /// page_height: `i32` -> Set page height for multipage save
13156    ///
13157    /// profile: `&str` -> Filename of ICC profile to embed
13158    pub fn ppmsave_target_with_opts(&self, target: &VipsTarget, option: VOption) -> Result<()> {
13159        let vips_op_response = call(
13160            "ppmsave_target",
13161            option
13162                .set("in", self)
13163                .set(
13164                    "target",
13165                    target,
13166                ),
13167        );
13168
13169        utils::result(
13170            vips_op_response,
13171            (),
13172            Error::OperationError("PpmsaveTarget (vips_ppmsave_target) failed".to_string()),
13173        )
13174    }
13175
13176    /// VipsPremultiply (premultiply), premultiply image alpha
13177    /// returns `VipsImage` - Output image
13178    pub fn premultiply(&self) -> Result<VipsImage> {
13179        let mut out_out = VipsImage::from(null_mut());
13180        let vips_op_response = call(
13181            "premultiply",
13182            VOption::new()
13183                .set("in", self)
13184                .set(
13185                    "out",
13186                    &mut out_out,
13187                ),
13188        );
13189
13190        utils::result(
13191            vips_op_response,
13192            out_out,
13193            Error::OperationError("Premultiply (vips_premultiply) failed".to_string()),
13194        )
13195    }
13196
13197    /// VipsPremultiply (premultiply), premultiply image alpha
13198    /// returns `VipsImage` - Output image
13199    ///
13200    /// <ins>Optional arguments</ins>
13201    ///
13202    /// max_alpha: `f64` -> Maximum value of alpha channel
13203    pub fn premultiply_with_opts(&self, option: VOption) -> Result<VipsImage> {
13204        let mut out_out = VipsImage::from(null_mut());
13205        let vips_op_response = call(
13206            "premultiply",
13207            option
13208                .set("in", self)
13209                .set(
13210                    "out",
13211                    &mut out_out,
13212                ),
13213        );
13214
13215        utils::result(
13216            vips_op_response,
13217            out_out,
13218            Error::OperationError("Premultiply (vips_premultiply) failed".to_string()),
13219        )
13220    }
13221
13222    /// VipsPrewitt (prewitt), Prewitt edge detector
13223    /// returns `VipsImage` - Output image
13224    pub fn prewitt(&self) -> Result<VipsImage> {
13225        let mut out_out = VipsImage::from(null_mut());
13226        let vips_op_response = call(
13227            "prewitt",
13228            VOption::new()
13229                .set("in", self)
13230                .set(
13231                    "out",
13232                    &mut out_out,
13233                ),
13234        );
13235
13236        utils::result(
13237            vips_op_response,
13238            out_out,
13239            Error::OperationError("Prewitt (vips_prewitt) failed".to_string()),
13240        )
13241    }
13242
13243    /// VipsProfile (profile), find image profiles
13244    /// Tuple (
13245    /// VipsImage - First non-zero pixel in column
13246    /// VipsImage - First non-zero pixel in row
13247    ///)
13248    pub fn profile(
13249        &self,
13250    ) -> Result<(
13251        VipsImage,
13252        VipsImage,
13253    )> {
13254        let mut columns_out = VipsImage::from(null_mut());
13255        let mut rows_out = VipsImage::from(null_mut());
13256        let vips_op_response = call(
13257            "profile",
13258            VOption::new()
13259                .set("in", self)
13260                .set(
13261                    "columns",
13262                    &mut columns_out,
13263                )
13264                .set(
13265                    "rows",
13266                    &mut rows_out,
13267                ),
13268        );
13269
13270        utils::result(
13271            vips_op_response,
13272            (
13273                columns_out,
13274                rows_out,
13275            ),
13276            Error::OperationError("Profile (vips_profile) failed".to_string()),
13277        )
13278    }
13279
13280    /// VipsProfileLoad (profile_load), load named ICC profile
13281    /// returns `Vec<u8>` - Loaded profile
13282    ///
13283    /// name: `&str` -> Profile name
13284    pub fn profile_load(name: &str) -> Result<Vec<u8>> {
13285        let mut profile_out = VipsBlob::from(null_mut());
13286        let vips_op_response = call(
13287            "profile_load",
13288            VOption::new()
13289                .set(
13290                    "name",
13291                    name,
13292                )
13293                .set(
13294                    "profile",
13295                    &mut profile_out,
13296                ),
13297        );
13298
13299        utils::result(
13300            vips_op_response,
13301            profile_out.into(),
13302            Error::OperationError("ProfileLoad (vips_profile_load) failed".to_string()),
13303        )
13304    }
13305
13306    /// VipsProject (project), find image projections
13307    /// Tuple (
13308    /// VipsImage - Sums of columns
13309    /// VipsImage - Sums of rows
13310    ///)
13311    pub fn project(
13312        &self,
13313    ) -> Result<(
13314        VipsImage,
13315        VipsImage,
13316    )> {
13317        let mut columns_out = VipsImage::from(null_mut());
13318        let mut rows_out = VipsImage::from(null_mut());
13319        let vips_op_response = call(
13320            "project",
13321            VOption::new()
13322                .set("in", self)
13323                .set(
13324                    "columns",
13325                    &mut columns_out,
13326                )
13327                .set(
13328                    "rows",
13329                    &mut rows_out,
13330                ),
13331        );
13332
13333        utils::result(
13334            vips_op_response,
13335            (
13336                columns_out,
13337                rows_out,
13338            ),
13339            Error::OperationError("Project (vips_project) failed".to_string()),
13340        )
13341    }
13342
13343    /// VipsQuadratic (quadratic), resample an image with a quadratic transform
13344    /// returns `VipsImage` - Output image
13345    ///
13346    /// coeff: `&VipsImage` -> Coefficient matrix
13347    pub fn quadratic(&self, coeff: &VipsImage) -> Result<VipsImage> {
13348        let mut out_out = VipsImage::from(null_mut());
13349        let vips_op_response = call(
13350            "quadratic",
13351            VOption::new()
13352                .set("in", self)
13353                .set(
13354                    "out",
13355                    &mut out_out,
13356                )
13357                .set(
13358                    "coeff",
13359                    coeff,
13360                ),
13361        );
13362
13363        utils::result(
13364            vips_op_response,
13365            out_out,
13366            Error::OperationError("Quadratic (vips_quadratic) failed".to_string()),
13367        )
13368    }
13369
13370    /// VipsQuadratic (quadratic), resample an image with a quadratic transform
13371    /// returns `VipsImage` - Output image
13372    ///
13373    /// coeff: `&VipsImage` -> Coefficient matrix
13374    ///
13375    /// <ins>Optional arguments</ins>
13376    ///
13377    /// interpolate: `&VipsInterpolate` -> Interpolate values with this
13378    pub fn quadratic_with_opts(&self, coeff: &VipsImage, option: VOption) -> Result<VipsImage> {
13379        let mut out_out = VipsImage::from(null_mut());
13380        let vips_op_response = call(
13381            "quadratic",
13382            option
13383                .set("in", self)
13384                .set(
13385                    "out",
13386                    &mut out_out,
13387                )
13388                .set(
13389                    "coeff",
13390                    coeff,
13391                ),
13392        );
13393
13394        utils::result(
13395            vips_op_response,
13396            out_out,
13397            Error::OperationError("Quadratic (vips_quadratic) failed".to_string()),
13398        )
13399    }
13400
13401    /// VipsRad2float (rad2float), unpack Radiance coding to float RGB
13402    /// returns `VipsImage` - Output image
13403    pub fn rad2float(&self) -> Result<VipsImage> {
13404        let mut out_out = VipsImage::from(null_mut());
13405        let vips_op_response = call(
13406            "rad2float",
13407            VOption::new()
13408                .set("in", self)
13409                .set(
13410                    "out",
13411                    &mut out_out,
13412                ),
13413        );
13414
13415        utils::result(
13416            vips_op_response,
13417            out_out,
13418            Error::OperationError("Rad2Float (vips_rad2float) failed".to_string()),
13419        )
13420    }
13421
13422    /// VipsForeignLoadRadFile (radload), load a Radiance image from a file (.hdr), priority=-50, untrusted, is_a, get_flags, get_flags_filename, header, load
13423    /// returns `VipsImage` - Output image
13424    ///
13425    /// filename: `&str` -> Filename to load from
13426    pub fn radload(filename: &str) -> Result<VipsImage> {
13427        let mut out_out = VipsImage::from(null_mut());
13428        let vips_op_response = call(
13429            "radload",
13430            VOption::new()
13431                .set(
13432                    "filename",
13433                    filename,
13434                )
13435                .set(
13436                    "out",
13437                    &mut out_out,
13438                ),
13439        );
13440
13441        utils::result(
13442            vips_op_response,
13443            out_out,
13444            Error::OperationError("Radload (vips_radload) failed".to_string()),
13445        )
13446    }
13447
13448    /// VipsForeignLoadRadFile (radload), load a Radiance image from a file (.hdr), priority=-50, untrusted, is_a, get_flags, get_flags_filename, header, load
13449    /// returns `VipsImage` - Output image
13450    ///
13451    /// filename: `&str` -> Filename to load from
13452    ///
13453    /// <ins>Optional arguments</ins>
13454    ///
13455    /// flags: [`ForeignFlags`] -> Flags for this file
13456    ///
13457    /// memory: `bool` -> Force open via memory
13458    ///
13459    /// access: [`Access`] -> Required access pattern for this file
13460    ///
13461    /// fail_on: [`FailOn`] -> Error level to fail on
13462    ///
13463    /// revalidate: `bool` -> Don't use a cached result for this operation
13464    pub fn radload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
13465        let mut out_out = VipsImage::from(null_mut());
13466        let vips_op_response = call(
13467            "radload",
13468            option
13469                .set(
13470                    "filename",
13471                    filename,
13472                )
13473                .set(
13474                    "out",
13475                    &mut out_out,
13476                ),
13477        );
13478
13479        utils::result(
13480            vips_op_response,
13481            out_out,
13482            Error::OperationError("Radload (vips_radload) failed".to_string()),
13483        )
13484    }
13485
13486    /// VipsForeignLoadRadBuffer (radload_buffer), load rad from buffer, priority=-50, untrusted, is_a_buffer, get_flags, get_flags_filename, header, load
13487    /// returns `VipsImage` - Output image
13488    ///
13489    /// buffer: `&[u8]` -> Buffer to load from
13490    pub fn radload_buffer(buffer: &[u8]) -> Result<VipsImage> {
13491        let blob = unsafe {
13492            vips_blob_new(
13493                None,
13494                buffer.as_ptr() as _,
13495                buffer.len() as _,
13496            )
13497        };
13498        let mut out_out = VipsImage::from(null_mut());
13499        let vips_op_response = call(
13500            "radload_buffer",
13501            VOption::new()
13502                .set(
13503                    "buffer",
13504                    &VipsBlob::from(blob),
13505                )
13506                .set(
13507                    "out",
13508                    &mut out_out,
13509                ),
13510        );
13511        unsafe { vips_area_unref(&mut (*blob).area) };
13512        utils::result(
13513            vips_op_response,
13514            out_out,
13515            Error::OperationError("RadloadBuffer (vips_radload_buffer) failed".to_string()),
13516        )
13517    }
13518
13519    /// VipsForeignLoadRadBuffer (radload_buffer), load rad from buffer, priority=-50, untrusted, is_a_buffer, get_flags, get_flags_filename, header, load
13520    /// returns `VipsImage` - Output image
13521    ///
13522    /// buffer: `&[u8]` -> Buffer to load from
13523    ///
13524    /// <ins>Optional arguments</ins>
13525    ///
13526    /// flags: [`ForeignFlags`] -> Flags for this file
13527    ///
13528    /// memory: `bool` -> Force open via memory
13529    ///
13530    /// access: [`Access`] -> Required access pattern for this file
13531    ///
13532    /// fail_on: [`FailOn`] -> Error level to fail on
13533    ///
13534    /// revalidate: `bool` -> Don't use a cached result for this operation
13535    pub fn radload_buffer_with_opts(buffer: &[u8], option: VOption) -> Result<VipsImage> {
13536        let blob = unsafe {
13537            vips_blob_new(
13538                None,
13539                buffer.as_ptr() as _,
13540                buffer.len() as _,
13541            )
13542        };
13543        let mut out_out = VipsImage::from(null_mut());
13544        let vips_op_response = call(
13545            "radload_buffer",
13546            option
13547                .set(
13548                    "buffer",
13549                    &VipsBlob::from(blob),
13550                )
13551                .set(
13552                    "out",
13553                    &mut out_out,
13554                ),
13555        );
13556        unsafe { vips_area_unref(&mut (*blob).area) };
13557        utils::result(
13558            vips_op_response,
13559            out_out,
13560            Error::OperationError("RadloadBuffer (vips_radload_buffer) failed".to_string()),
13561        )
13562    }
13563
13564    /// VipsForeignLoadRadSource (radload_source), load rad from source, priority=-50, untrusted, is_a_source, get_flags, get_flags_filename, header, load
13565    /// returns `VipsImage` - Output image
13566    ///
13567    /// source: `&VipsSource` -> Source to load from
13568    pub fn radload_source(source: &VipsSource) -> Result<VipsImage> {
13569        let mut out_out = VipsImage::from(null_mut());
13570        let vips_op_response = call(
13571            "radload_source",
13572            VOption::new()
13573                .set(
13574                    "source",
13575                    source,
13576                )
13577                .set(
13578                    "out",
13579                    &mut out_out,
13580                ),
13581        );
13582
13583        utils::result(
13584            vips_op_response,
13585            out_out,
13586            Error::OperationError("RadloadSource (vips_radload_source) failed".to_string()),
13587        )
13588    }
13589
13590    /// VipsForeignLoadRadSource (radload_source), load rad from source, priority=-50, untrusted, is_a_source, get_flags, get_flags_filename, header, load
13591    /// returns `VipsImage` - Output image
13592    ///
13593    /// source: `&VipsSource` -> Source to load from
13594    ///
13595    /// <ins>Optional arguments</ins>
13596    ///
13597    /// flags: [`ForeignFlags`] -> Flags for this file
13598    ///
13599    /// memory: `bool` -> Force open via memory
13600    ///
13601    /// access: [`Access`] -> Required access pattern for this file
13602    ///
13603    /// fail_on: [`FailOn`] -> Error level to fail on
13604    ///
13605    /// revalidate: `bool` -> Don't use a cached result for this operation
13606    pub fn radload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
13607        let mut out_out = VipsImage::from(null_mut());
13608        let vips_op_response = call(
13609            "radload_source",
13610            option
13611                .set(
13612                    "source",
13613                    source,
13614                )
13615                .set(
13616                    "out",
13617                    &mut out_out,
13618                ),
13619        );
13620
13621        utils::result(
13622            vips_op_response,
13623            out_out,
13624            Error::OperationError("RadloadSource (vips_radload_source) failed".to_string()),
13625        )
13626    }
13627
13628    /// VipsForeignSaveRadFile (radsave), save image to Radiance file (.hdr), priority=0, mono rgb
13629    ///
13630    /// filename: `&str` -> Filename to save to
13631    pub fn radsave(&self, filename: &str) -> Result<()> {
13632        let vips_op_response = call(
13633            "radsave",
13634            VOption::new()
13635                .set("in", self)
13636                .set(
13637                    "filename",
13638                    filename,
13639                ),
13640        );
13641
13642        utils::result(
13643            vips_op_response,
13644            (),
13645            Error::OperationError("Radsave (vips_radsave) failed".to_string()),
13646        )
13647    }
13648
13649    /// VipsForeignSaveRadFile (radsave), save image to Radiance file (.hdr), priority=0, mono rgb
13650    ///
13651    /// filename: `&str` -> Filename to save to
13652    ///
13653    /// <ins>Optional arguments</ins>
13654    ///
13655    /// keep: [`ForeignKeep`] -> Which metadata to retain
13656    ///
13657    /// background: `&[f64]` -> Background value
13658    ///
13659    /// page_height: `i32` -> Set page height for multipage save
13660    ///
13661    /// profile: `&str` -> Filename of ICC profile to embed
13662    pub fn radsave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
13663        let vips_op_response = call(
13664            "radsave",
13665            option
13666                .set("in", self)
13667                .set(
13668                    "filename",
13669                    filename,
13670                ),
13671        );
13672
13673        utils::result(
13674            vips_op_response,
13675            (),
13676            Error::OperationError("Radsave (vips_radsave) failed".to_string()),
13677        )
13678    }
13679
13680    /// VipsForeignSaveRadBuffer (radsave_buffer), save image to Radiance buffer (.hdr), priority=0, mono rgb
13681    /// returns `Vec<u8>` - Buffer to save to
13682    pub fn radsave_buffer(&self) -> Result<Vec<u8>> {
13683        let mut buffer_out = VipsBlob::from(null_mut());
13684        let vips_op_response = call(
13685            "radsave_buffer",
13686            VOption::new()
13687                .set("in", self)
13688                .set(
13689                    "buffer",
13690                    &mut buffer_out,
13691                ),
13692        );
13693
13694        utils::result(
13695            vips_op_response,
13696            buffer_out.into(),
13697            Error::OperationError("RadsaveBuffer (vips_radsave_buffer) failed".to_string()),
13698        )
13699    }
13700
13701    /// VipsForeignSaveRadBuffer (radsave_buffer), save image to Radiance buffer (.hdr), priority=0, mono rgb
13702    /// returns `Vec<u8>` - Buffer to save to
13703    ///
13704    /// <ins>Optional arguments</ins>
13705    ///
13706    /// keep: [`ForeignKeep`] -> Which metadata to retain
13707    ///
13708    /// background: `&[f64]` -> Background value
13709    ///
13710    /// page_height: `i32` -> Set page height for multipage save
13711    ///
13712    /// profile: `&str` -> Filename of ICC profile to embed
13713    pub fn radsave_buffer_with_opts(&self, option: VOption) -> Result<Vec<u8>> {
13714        let mut buffer_out = VipsBlob::from(null_mut());
13715        let vips_op_response = call(
13716            "radsave_buffer",
13717            option
13718                .set("in", self)
13719                .set(
13720                    "buffer",
13721                    &mut buffer_out,
13722                ),
13723        );
13724
13725        utils::result(
13726            vips_op_response,
13727            buffer_out.into(),
13728            Error::OperationError("RadsaveBuffer (vips_radsave_buffer) failed".to_string()),
13729        )
13730    }
13731
13732    /// VipsForeignSaveRadTarget (radsave_target), save image to Radiance target (.hdr), priority=0, mono rgb
13733    ///
13734    /// target: `&VipsTarget` -> Target to save to
13735    pub fn radsave_target(&self, target: &VipsTarget) -> Result<()> {
13736        let vips_op_response = call(
13737            "radsave_target",
13738            VOption::new()
13739                .set("in", self)
13740                .set(
13741                    "target",
13742                    target,
13743                ),
13744        );
13745
13746        utils::result(
13747            vips_op_response,
13748            (),
13749            Error::OperationError("RadsaveTarget (vips_radsave_target) failed".to_string()),
13750        )
13751    }
13752
13753    /// VipsForeignSaveRadTarget (radsave_target), save image to Radiance target (.hdr), priority=0, mono rgb
13754    ///
13755    /// target: `&VipsTarget` -> Target to save to
13756    ///
13757    /// <ins>Optional arguments</ins>
13758    ///
13759    /// keep: [`ForeignKeep`] -> Which metadata to retain
13760    ///
13761    /// background: `&[f64]` -> Background value
13762    ///
13763    /// page_height: `i32` -> Set page height for multipage save
13764    ///
13765    /// profile: `&str` -> Filename of ICC profile to embed
13766    pub fn radsave_target_with_opts(&self, target: &VipsTarget, option: VOption) -> Result<()> {
13767        let vips_op_response = call(
13768            "radsave_target",
13769            option
13770                .set("in", self)
13771                .set(
13772                    "target",
13773                    target,
13774                ),
13775        );
13776
13777        utils::result(
13778            vips_op_response,
13779            (),
13780            Error::OperationError("RadsaveTarget (vips_radsave_target) failed".to_string()),
13781        )
13782    }
13783
13784    /// VipsRank (rank), rank filter
13785    /// returns `VipsImage` - Output image
13786    ///
13787    /// width: `i32` -> Window width in pixels
13788    ///
13789    /// height: `i32` -> Window height in pixels
13790    ///
13791    /// index: `i32` -> Select pixel at index
13792    pub fn rank(&self, width: i32, height: i32, index: i32) -> Result<VipsImage> {
13793        let mut out_out = VipsImage::from(null_mut());
13794        let vips_op_response = call(
13795            "rank",
13796            VOption::new()
13797                .set("in", self)
13798                .set(
13799                    "out",
13800                    &mut out_out,
13801                )
13802                .set(
13803                    "width",
13804                    width,
13805                )
13806                .set(
13807                    "height",
13808                    height,
13809                )
13810                .set(
13811                    "index",
13812                    index,
13813                ),
13814        );
13815
13816        utils::result(
13817            vips_op_response,
13818            out_out,
13819            Error::OperationError("Rank (vips_rank) failed".to_string()),
13820        )
13821    }
13822
13823    /// VipsForeignLoadRaw (rawload), load raw data from a file, priority=0, untrusted, get_flags, get_flags_filename, header
13824    /// returns `VipsImage` - Output image
13825    ///
13826    /// filename: `&str` -> Filename to load from
13827    ///
13828    /// width: `i32` -> Image width in pixels
13829    ///
13830    /// height: `i32` -> Image height in pixels
13831    ///
13832    /// bands: `i32` -> Number of bands in image
13833    pub fn rawload(filename: &str, width: i32, height: i32, bands: i32) -> Result<VipsImage> {
13834        let mut out_out = VipsImage::from(null_mut());
13835        let vips_op_response = call(
13836            "rawload",
13837            VOption::new()
13838                .set(
13839                    "filename",
13840                    filename,
13841                )
13842                .set(
13843                    "out",
13844                    &mut out_out,
13845                )
13846                .set(
13847                    "width",
13848                    width,
13849                )
13850                .set(
13851                    "height",
13852                    height,
13853                )
13854                .set(
13855                    "bands",
13856                    bands,
13857                ),
13858        );
13859
13860        utils::result(
13861            vips_op_response,
13862            out_out,
13863            Error::OperationError("Rawload (vips_rawload) failed".to_string()),
13864        )
13865    }
13866
13867    /// VipsForeignLoadRaw (rawload), load raw data from a file, priority=0, untrusted, get_flags, get_flags_filename, header
13868    /// returns `VipsImage` - Output image
13869    ///
13870    /// filename: `&str` -> Filename to load from
13871    ///
13872    /// width: `i32` -> Image width in pixels
13873    ///
13874    /// height: `i32` -> Image height in pixels
13875    ///
13876    /// bands: `i32` -> Number of bands in image
13877    ///
13878    /// <ins>Optional arguments</ins>
13879    ///
13880    /// offset: `u64` -> Offset in bytes from start of file
13881    ///
13882    /// format: [`BandFormat`] -> Pixel format in image
13883    ///
13884    /// interpretation: [`Interpretation`] -> Pixel interpretation
13885    ///
13886    /// flags: [`ForeignFlags`] -> Flags for this file
13887    ///
13888    /// memory: `bool` -> Force open via memory
13889    ///
13890    /// access: [`Access`] -> Required access pattern for this file
13891    ///
13892    /// fail_on: [`FailOn`] -> Error level to fail on
13893    ///
13894    /// revalidate: `bool` -> Don't use a cached result for this operation
13895    pub fn rawload_with_opts(
13896        filename: &str,
13897        width: i32,
13898        height: i32,
13899        bands: i32,
13900        option: VOption,
13901    ) -> Result<VipsImage> {
13902        let mut out_out = VipsImage::from(null_mut());
13903        let vips_op_response = call(
13904            "rawload",
13905            option
13906                .set(
13907                    "filename",
13908                    filename,
13909                )
13910                .set(
13911                    "out",
13912                    &mut out_out,
13913                )
13914                .set(
13915                    "width",
13916                    width,
13917                )
13918                .set(
13919                    "height",
13920                    height,
13921                )
13922                .set(
13923                    "bands",
13924                    bands,
13925                ),
13926        );
13927
13928        utils::result(
13929            vips_op_response,
13930            out_out,
13931            Error::OperationError("Rawload (vips_rawload) failed".to_string()),
13932        )
13933    }
13934
13935    /// VipsForeignSaveRawFile (rawsave), save image to raw file (.raw), priority=0,
13936    ///
13937    /// filename: `&str` -> Filename to save to
13938    pub fn rawsave(&self, filename: &str) -> Result<()> {
13939        let vips_op_response = call(
13940            "rawsave",
13941            VOption::new()
13942                .set("in", self)
13943                .set(
13944                    "filename",
13945                    filename,
13946                ),
13947        );
13948
13949        utils::result(
13950            vips_op_response,
13951            (),
13952            Error::OperationError("Rawsave (vips_rawsave) failed".to_string()),
13953        )
13954    }
13955
13956    /// VipsForeignSaveRawFile (rawsave), save image to raw file (.raw), priority=0,
13957    ///
13958    /// filename: `&str` -> Filename to save to
13959    ///
13960    /// <ins>Optional arguments</ins>
13961    ///
13962    /// keep: [`ForeignKeep`] -> Which metadata to retain
13963    ///
13964    /// background: `&[f64]` -> Background value
13965    ///
13966    /// page_height: `i32` -> Set page height for multipage save
13967    ///
13968    /// profile: `&str` -> Filename of ICC profile to embed
13969    pub fn rawsave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
13970        let vips_op_response = call(
13971            "rawsave",
13972            option
13973                .set("in", self)
13974                .set(
13975                    "filename",
13976                    filename,
13977                ),
13978        );
13979
13980        utils::result(
13981            vips_op_response,
13982            (),
13983            Error::OperationError("Rawsave (vips_rawsave) failed".to_string()),
13984        )
13985    }
13986
13987    /// VipsForeignSaveRawBuffer (rawsave_buffer), write raw image to buffer (.raw), priority=0,
13988    /// returns `Vec<u8>` - Buffer to save to
13989    pub fn rawsave_buffer(&self) -> Result<Vec<u8>> {
13990        let mut buffer_out = VipsBlob::from(null_mut());
13991        let vips_op_response = call(
13992            "rawsave_buffer",
13993            VOption::new()
13994                .set("in", self)
13995                .set(
13996                    "buffer",
13997                    &mut buffer_out,
13998                ),
13999        );
14000
14001        utils::result(
14002            vips_op_response,
14003            buffer_out.into(),
14004            Error::OperationError("RawsaveBuffer (vips_rawsave_buffer) failed".to_string()),
14005        )
14006    }
14007
14008    /// VipsForeignSaveRawBuffer (rawsave_buffer), write raw image to buffer (.raw), priority=0,
14009    /// returns `Vec<u8>` - Buffer to save to
14010    ///
14011    /// <ins>Optional arguments</ins>
14012    ///
14013    /// keep: [`ForeignKeep`] -> Which metadata to retain
14014    ///
14015    /// background: `&[f64]` -> Background value
14016    ///
14017    /// page_height: `i32` -> Set page height for multipage save
14018    ///
14019    /// profile: `&str` -> Filename of ICC profile to embed
14020    pub fn rawsave_buffer_with_opts(&self, option: VOption) -> Result<Vec<u8>> {
14021        let mut buffer_out = VipsBlob::from(null_mut());
14022        let vips_op_response = call(
14023            "rawsave_buffer",
14024            option
14025                .set("in", self)
14026                .set(
14027                    "buffer",
14028                    &mut buffer_out,
14029                ),
14030        );
14031
14032        utils::result(
14033            vips_op_response,
14034            buffer_out.into(),
14035            Error::OperationError("RawsaveBuffer (vips_rawsave_buffer) failed".to_string()),
14036        )
14037    }
14038
14039    /// VipsForeignSaveRawTarget (rawsave_target), write raw image to target (.raw), priority=0,
14040    ///
14041    /// target: `&VipsTarget` -> Target to save to
14042    pub fn rawsave_target(&self, target: &VipsTarget) -> Result<()> {
14043        let vips_op_response = call(
14044            "rawsave_target",
14045            VOption::new()
14046                .set("in", self)
14047                .set(
14048                    "target",
14049                    target,
14050                ),
14051        );
14052
14053        utils::result(
14054            vips_op_response,
14055            (),
14056            Error::OperationError("RawsaveTarget (vips_rawsave_target) failed".to_string()),
14057        )
14058    }
14059
14060    /// VipsForeignSaveRawTarget (rawsave_target), write raw image to target (.raw), priority=0,
14061    ///
14062    /// target: `&VipsTarget` -> Target to save to
14063    ///
14064    /// <ins>Optional arguments</ins>
14065    ///
14066    /// keep: [`ForeignKeep`] -> Which metadata to retain
14067    ///
14068    /// background: `&[f64]` -> Background value
14069    ///
14070    /// page_height: `i32` -> Set page height for multipage save
14071    ///
14072    /// profile: `&str` -> Filename of ICC profile to embed
14073    pub fn rawsave_target_with_opts(&self, target: &VipsTarget, option: VOption) -> Result<()> {
14074        let vips_op_response = call(
14075            "rawsave_target",
14076            option
14077                .set("in", self)
14078                .set(
14079                    "target",
14080                    target,
14081                ),
14082        );
14083
14084        utils::result(
14085            vips_op_response,
14086            (),
14087            Error::OperationError("RawsaveTarget (vips_rawsave_target) failed".to_string()),
14088        )
14089    }
14090
14091    /// VipsRecomb (recomb), linear recombination with matrix
14092    /// returns `VipsImage` - Output image
14093    ///
14094    /// m: `&VipsImage` -> Matrix of coefficients
14095    pub fn recomb(&self, m: &VipsImage) -> Result<VipsImage> {
14096        let mut out_out = VipsImage::from(null_mut());
14097        let vips_op_response = call(
14098            "recomb",
14099            VOption::new()
14100                .set("in", self)
14101                .set(
14102                    "out",
14103                    &mut out_out,
14104                )
14105                .set("m", m),
14106        );
14107
14108        utils::result(
14109            vips_op_response,
14110            out_out,
14111            Error::OperationError("Recomb (vips_recomb) failed".to_string()),
14112        )
14113    }
14114
14115    /// VipsReduce (reduce), reduce an image
14116    /// returns `VipsImage` - Output image
14117    ///
14118    /// hshrink: `f64` -> Horizontal shrink factor
14119    ///
14120    /// vshrink: `f64` -> Vertical shrink factor
14121    pub fn reduce(&self, hshrink: f64, vshrink: f64) -> Result<VipsImage> {
14122        let mut out_out = VipsImage::from(null_mut());
14123        let vips_op_response = call(
14124            "reduce",
14125            VOption::new()
14126                .set("in", self)
14127                .set(
14128                    "out",
14129                    &mut out_out,
14130                )
14131                .set(
14132                    "hshrink",
14133                    hshrink,
14134                )
14135                .set(
14136                    "vshrink",
14137                    vshrink,
14138                ),
14139        );
14140
14141        utils::result(
14142            vips_op_response,
14143            out_out,
14144            Error::OperationError("Reduce (vips_reduce) failed".to_string()),
14145        )
14146    }
14147
14148    /// VipsReduce (reduce), reduce an image
14149    /// returns `VipsImage` - Output image
14150    ///
14151    /// hshrink: `f64` -> Horizontal shrink factor
14152    ///
14153    /// vshrink: `f64` -> Vertical shrink factor
14154    ///
14155    /// <ins>Optional arguments</ins>
14156    ///
14157    /// kernel: [`Kernel`] -> Resampling kernel
14158    ///
14159    /// gap: `f64` -> Reducing gap
14160    pub fn reduce_with_opts(
14161        &self,
14162        hshrink: f64,
14163        vshrink: f64,
14164        option: VOption,
14165    ) -> Result<VipsImage> {
14166        let mut out_out = VipsImage::from(null_mut());
14167        let vips_op_response = call(
14168            "reduce",
14169            option
14170                .set("in", self)
14171                .set(
14172                    "out",
14173                    &mut out_out,
14174                )
14175                .set(
14176                    "hshrink",
14177                    hshrink,
14178                )
14179                .set(
14180                    "vshrink",
14181                    vshrink,
14182                ),
14183        );
14184
14185        utils::result(
14186            vips_op_response,
14187            out_out,
14188            Error::OperationError("Reduce (vips_reduce) failed".to_string()),
14189        )
14190    }
14191
14192    /// VipsReduceh (reduceh), shrink an image horizontally
14193    /// returns `VipsImage` - Output image
14194    ///
14195    /// hshrink: `f64` -> Horizontal shrink factor
14196    pub fn reduceh(&self, hshrink: f64) -> Result<VipsImage> {
14197        let mut out_out = VipsImage::from(null_mut());
14198        let vips_op_response = call(
14199            "reduceh",
14200            VOption::new()
14201                .set("in", self)
14202                .set(
14203                    "out",
14204                    &mut out_out,
14205                )
14206                .set(
14207                    "hshrink",
14208                    hshrink,
14209                ),
14210        );
14211
14212        utils::result(
14213            vips_op_response,
14214            out_out,
14215            Error::OperationError("Reduceh (vips_reduceh) failed".to_string()),
14216        )
14217    }
14218
14219    /// VipsReduceh (reduceh), shrink an image horizontally
14220    /// returns `VipsImage` - Output image
14221    ///
14222    /// hshrink: `f64` -> Horizontal shrink factor
14223    ///
14224    /// <ins>Optional arguments</ins>
14225    ///
14226    /// kernel: [`Kernel`] -> Resampling kernel
14227    ///
14228    /// gap: `f64` -> Reducing gap
14229    pub fn reduceh_with_opts(&self, hshrink: f64, option: VOption) -> Result<VipsImage> {
14230        let mut out_out = VipsImage::from(null_mut());
14231        let vips_op_response = call(
14232            "reduceh",
14233            option
14234                .set("in", self)
14235                .set(
14236                    "out",
14237                    &mut out_out,
14238                )
14239                .set(
14240                    "hshrink",
14241                    hshrink,
14242                ),
14243        );
14244
14245        utils::result(
14246            vips_op_response,
14247            out_out,
14248            Error::OperationError("Reduceh (vips_reduceh) failed".to_string()),
14249        )
14250    }
14251
14252    /// VipsReducev (reducev), shrink an image vertically
14253    /// returns `VipsImage` - Output image
14254    ///
14255    /// vshrink: `f64` -> Vertical shrink factor
14256    pub fn reducev(&self, vshrink: f64) -> Result<VipsImage> {
14257        let mut out_out = VipsImage::from(null_mut());
14258        let vips_op_response = call(
14259            "reducev",
14260            VOption::new()
14261                .set("in", self)
14262                .set(
14263                    "out",
14264                    &mut out_out,
14265                )
14266                .set(
14267                    "vshrink",
14268                    vshrink,
14269                ),
14270        );
14271
14272        utils::result(
14273            vips_op_response,
14274            out_out,
14275            Error::OperationError("Reducev (vips_reducev) failed".to_string()),
14276        )
14277    }
14278
14279    /// VipsReducev (reducev), shrink an image vertically
14280    /// returns `VipsImage` - Output image
14281    ///
14282    /// vshrink: `f64` -> Vertical shrink factor
14283    ///
14284    /// <ins>Optional arguments</ins>
14285    ///
14286    /// kernel: [`Kernel`] -> Resampling kernel
14287    ///
14288    /// gap: `f64` -> Reducing gap
14289    pub fn reducev_with_opts(&self, vshrink: f64, option: VOption) -> Result<VipsImage> {
14290        let mut out_out = VipsImage::from(null_mut());
14291        let vips_op_response = call(
14292            "reducev",
14293            option
14294                .set("in", self)
14295                .set(
14296                    "out",
14297                    &mut out_out,
14298                )
14299                .set(
14300                    "vshrink",
14301                    vshrink,
14302                ),
14303        );
14304
14305        utils::result(
14306            vips_op_response,
14307            out_out,
14308            Error::OperationError("Reducev (vips_reducev) failed".to_string()),
14309        )
14310    }
14311
14312    /// VipsRelational (relational), relational operation on two images
14313    /// returns `VipsImage` - Output image
14314    ///
14315    /// right: `&VipsImage` -> Right-hand image argument
14316    ///
14317    /// relational: `OperationRelational` -> Relational to perform
14318    pub fn relational(
14319        &self,
14320        right: &VipsImage,
14321        relational: OperationRelational,
14322    ) -> Result<VipsImage> {
14323        let mut out_out = VipsImage::from(null_mut());
14324        let vips_op_response = call(
14325            "relational",
14326            VOption::new()
14327                .set(
14328                    "left",
14329                    self,
14330                )
14331                .set(
14332                    "right",
14333                    right,
14334                )
14335                .set(
14336                    "out",
14337                    &mut out_out,
14338                )
14339                .set(
14340                    "relational",
14341                    relational as i32,
14342                ),
14343        );
14344
14345        utils::result(
14346            vips_op_response,
14347            out_out,
14348            Error::OperationError("Relational (vips_relational) failed".to_string()),
14349        )
14350    }
14351
14352    /// VipsRelationalConst (relational_const), relational operations against a constant
14353    /// returns `VipsImage` - Output image
14354    ///
14355    /// relational: `OperationRelational` -> Relational to perform
14356    ///
14357    /// c: `&[f64]` -> Array of constants
14358    pub fn relational_const(
14359        &self,
14360        relational: OperationRelational,
14361        c: &[f64],
14362    ) -> Result<VipsImage> {
14363        let mut out_out = VipsImage::from(null_mut());
14364        let vips_op_response = call(
14365            "relational_const",
14366            VOption::new()
14367                .set("in", self)
14368                .set(
14369                    "out",
14370                    &mut out_out,
14371                )
14372                .set(
14373                    "relational",
14374                    relational as i32,
14375                )
14376                .set("c", c),
14377        );
14378
14379        utils::result(
14380            vips_op_response,
14381            out_out,
14382            Error::OperationError("RelationalConst (vips_relational_const) failed".to_string()),
14383        )
14384    }
14385
14386    /// VipsRemainder (remainder), remainder after integer division of two images
14387    /// returns `VipsImage` - Output image
14388    ///
14389    /// right: `&VipsImage` -> Right-hand image argument
14390    pub fn remainder(&self, right: &VipsImage) -> Result<VipsImage> {
14391        let mut out_out = VipsImage::from(null_mut());
14392        let vips_op_response = call(
14393            "remainder",
14394            VOption::new()
14395                .set(
14396                    "left",
14397                    self,
14398                )
14399                .set(
14400                    "right",
14401                    right,
14402                )
14403                .set(
14404                    "out",
14405                    &mut out_out,
14406                ),
14407        );
14408
14409        utils::result(
14410            vips_op_response,
14411            out_out,
14412            Error::OperationError("Remainder (vips_remainder) failed".to_string()),
14413        )
14414    }
14415
14416    /// VipsRemainderConst (remainder_const), remainder after integer division of an image and a constant
14417    /// returns `VipsImage` - Output image
14418    ///
14419    /// c: `&[f64]` -> Array of constants
14420    pub fn remainder_const(&self, c: &[f64]) -> Result<VipsImage> {
14421        let mut out_out = VipsImage::from(null_mut());
14422        let vips_op_response = call(
14423            "remainder_const",
14424            VOption::new()
14425                .set("in", self)
14426                .set(
14427                    "out",
14428                    &mut out_out,
14429                )
14430                .set("c", c),
14431        );
14432
14433        utils::result(
14434            vips_op_response,
14435            out_out,
14436            Error::OperationError("RemainderConst (vips_remainder_const) failed".to_string()),
14437        )
14438    }
14439
14440    /// VipsRemosaic (remosaic), rebuild an mosaiced image
14441    /// returns `VipsImage` - Output image
14442    ///
14443    /// old_str: `&str` -> Search for this string
14444    ///
14445    /// new_str: `&str` -> And swap for this string
14446    pub fn remosaic(&self, old_str: &str, new_str: &str) -> Result<VipsImage> {
14447        let mut out_out = VipsImage::from(null_mut());
14448        let vips_op_response = call(
14449            "remosaic",
14450            VOption::new()
14451                .set("in", self)
14452                .set(
14453                    "out",
14454                    &mut out_out,
14455                )
14456                .set(
14457                    "old-str",
14458                    old_str,
14459                )
14460                .set(
14461                    "new-str",
14462                    new_str,
14463                ),
14464        );
14465
14466        utils::result(
14467            vips_op_response,
14468            out_out,
14469            Error::OperationError("Remosaic (vips_remosaic) failed".to_string()),
14470        )
14471    }
14472
14473    /// VipsReplicate (replicate), replicate an image
14474    /// returns `VipsImage` - Output image
14475    ///
14476    /// across: `i32` -> Repeat this many times horizontally
14477    ///
14478    /// down: `i32` -> Repeat this many times vertically
14479    pub fn replicate(&self, across: i32, down: i32) -> Result<VipsImage> {
14480        let mut out_out = VipsImage::from(null_mut());
14481        let vips_op_response = call(
14482            "replicate",
14483            VOption::new()
14484                .set("in", self)
14485                .set(
14486                    "out",
14487                    &mut out_out,
14488                )
14489                .set(
14490                    "across",
14491                    across,
14492                )
14493                .set(
14494                    "down",
14495                    down,
14496                ),
14497        );
14498
14499        utils::result(
14500            vips_op_response,
14501            out_out,
14502            Error::OperationError("Replicate (vips_replicate) failed".to_string()),
14503        )
14504    }
14505
14506    /// VipsResize (resize), resize an image
14507    /// returns `VipsImage` - Output image
14508    ///
14509    /// scale: `f64` -> Scale image by this factor
14510    pub fn resize(&self, scale: f64) -> Result<VipsImage> {
14511        let mut out_out = VipsImage::from(null_mut());
14512        let vips_op_response = call(
14513            "resize",
14514            VOption::new()
14515                .set("in", self)
14516                .set(
14517                    "out",
14518                    &mut out_out,
14519                )
14520                .set(
14521                    "scale",
14522                    scale,
14523                ),
14524        );
14525
14526        utils::result(
14527            vips_op_response,
14528            out_out,
14529            Error::OperationError("Resize (vips_resize) failed".to_string()),
14530        )
14531    }
14532
14533    /// VipsResize (resize), resize an image
14534    /// returns `VipsImage` - Output image
14535    ///
14536    /// scale: `f64` -> Scale image by this factor
14537    ///
14538    /// <ins>Optional arguments</ins>
14539    ///
14540    /// kernel: [`Kernel`] -> Resampling kernel
14541    ///
14542    /// gap: `f64` -> Reducing gap
14543    ///
14544    /// vscale: `f64` -> Vertical scale image by this factor
14545    pub fn resize_with_opts(&self, scale: f64, option: VOption) -> Result<VipsImage> {
14546        let mut out_out = VipsImage::from(null_mut());
14547        let vips_op_response = call(
14548            "resize",
14549            option
14550                .set("in", self)
14551                .set(
14552                    "out",
14553                    &mut out_out,
14554                )
14555                .set(
14556                    "scale",
14557                    scale,
14558                ),
14559        );
14560
14561        utils::result(
14562            vips_op_response,
14563            out_out,
14564            Error::OperationError("Resize (vips_resize) failed".to_string()),
14565        )
14566    }
14567
14568    /// VipsRot45 (rot45), rotate an image
14569    /// returns `VipsImage` - Output image
14570    pub fn rot45(&self) -> Result<VipsImage> {
14571        let mut out_out = VipsImage::from(null_mut());
14572        let vips_op_response = call(
14573            "rot45",
14574            VOption::new()
14575                .set("in", self)
14576                .set(
14577                    "out",
14578                    &mut out_out,
14579                ),
14580        );
14581
14582        utils::result(
14583            vips_op_response,
14584            out_out,
14585            Error::OperationError("Rot45 (vips_rot45) failed".to_string()),
14586        )
14587    }
14588
14589    /// VipsRot45 (rot45), rotate an image
14590    /// returns `VipsImage` - Output image
14591    ///
14592    /// <ins>Optional arguments</ins>
14593    ///
14594    /// angle: [`Angle45`] -> Angle to rotate image
14595    pub fn rot45_with_opts(&self, option: VOption) -> Result<VipsImage> {
14596        let mut out_out = VipsImage::from(null_mut());
14597        let vips_op_response = call(
14598            "rot45",
14599            option
14600                .set("in", self)
14601                .set(
14602                    "out",
14603                    &mut out_out,
14604                ),
14605        );
14606
14607        utils::result(
14608            vips_op_response,
14609            out_out,
14610            Error::OperationError("Rot45 (vips_rot45) failed".to_string()),
14611        )
14612    }
14613
14614    /// VipsRot (rot), rotate an image
14615    /// returns `VipsImage` - Output image
14616    ///
14617    /// angle: `Angle` -> Angle to rotate image
14618    pub fn rot(&self, angle: Angle) -> Result<VipsImage> {
14619        let mut out_out = VipsImage::from(null_mut());
14620        let vips_op_response = call(
14621            "rot",
14622            VOption::new()
14623                .set("in", self)
14624                .set(
14625                    "out",
14626                    &mut out_out,
14627                )
14628                .set(
14629                    "angle",
14630                    angle as i32,
14631                ),
14632        );
14633
14634        utils::result(
14635            vips_op_response,
14636            out_out,
14637            Error::OperationError("Rot (vips_rot) failed".to_string()),
14638        )
14639    }
14640
14641    /// VipsRotate (rotate), rotate an image by a number of degrees
14642    /// returns `VipsImage` - Output image
14643    ///
14644    /// angle: `f64` -> Rotate clockwise by this many degrees
14645    pub fn rotate(&self, angle: f64) -> Result<VipsImage> {
14646        let mut out_out = VipsImage::from(null_mut());
14647        let vips_op_response = call(
14648            "rotate",
14649            VOption::new()
14650                .set("in", self)
14651                .set(
14652                    "out",
14653                    &mut out_out,
14654                )
14655                .set(
14656                    "angle",
14657                    angle,
14658                ),
14659        );
14660
14661        utils::result(
14662            vips_op_response,
14663            out_out,
14664            Error::OperationError("Rotate (vips_rotate) failed".to_string()),
14665        )
14666    }
14667
14668    /// VipsRotate (rotate), rotate an image by a number of degrees
14669    /// returns `VipsImage` - Output image
14670    ///
14671    /// angle: `f64` -> Rotate clockwise by this many degrees
14672    ///
14673    /// <ins>Optional arguments</ins>
14674    ///
14675    /// interpolate: `&VipsInterpolate` -> Interpolate pixels with this
14676    ///
14677    /// background: `&[f64]` -> Background value
14678    ///
14679    /// odx: `f64` -> Horizontal output displacement
14680    ///
14681    /// ody: `f64` -> Vertical output displacement
14682    ///
14683    /// idx: `f64` -> Horizontal input displacement
14684    ///
14685    /// idy: `f64` -> Vertical input displacement
14686    pub fn rotate_with_opts(&self, angle: f64, option: VOption) -> Result<VipsImage> {
14687        let mut out_out = VipsImage::from(null_mut());
14688        let vips_op_response = call(
14689            "rotate",
14690            option
14691                .set("in", self)
14692                .set(
14693                    "out",
14694                    &mut out_out,
14695                )
14696                .set(
14697                    "angle",
14698                    angle,
14699                ),
14700        );
14701
14702        utils::result(
14703            vips_op_response,
14704            out_out,
14705            Error::OperationError("Rotate (vips_rotate) failed".to_string()),
14706        )
14707    }
14708
14709    /// VipsRound (round), perform a round function on an image
14710    /// returns `VipsImage` - Output image
14711    ///
14712    /// round: `OperationRound` -> Rounding operation to perform
14713    pub fn round(&self, round: OperationRound) -> Result<VipsImage> {
14714        let mut out_out = VipsImage::from(null_mut());
14715        let vips_op_response = call(
14716            "round",
14717            VOption::new()
14718                .set("in", self)
14719                .set(
14720                    "out",
14721                    &mut out_out,
14722                )
14723                .set(
14724                    "round",
14725                    round as i32,
14726                ),
14727        );
14728
14729        utils::result(
14730            vips_op_response,
14731            out_out,
14732            Error::OperationError("Round (vips_round) failed".to_string()),
14733        )
14734    }
14735
14736    /// VipssRGB2HSV (sRGB2HSV), transform sRGB to HSV
14737    /// returns `VipsImage` - Output image
14738    pub fn sRGB2HSV(&self) -> Result<VipsImage> {
14739        let mut out_out = VipsImage::from(null_mut());
14740        let vips_op_response = call(
14741            "sRGB2HSV",
14742            VOption::new()
14743                .set("in", self)
14744                .set(
14745                    "out",
14746                    &mut out_out,
14747                ),
14748        );
14749
14750        utils::result(
14751            vips_op_response,
14752            out_out,
14753            Error::OperationError("SRgb2Hsv (vips_sRGB2HSV) failed".to_string()),
14754        )
14755    }
14756
14757    /// VipssRGB2scRGB (sRGB2scRGB), convert an sRGB image to scRGB
14758    /// returns `VipsImage` - Output image
14759    pub fn sRGB2scRGB(&self) -> Result<VipsImage> {
14760        let mut out_out = VipsImage::from(null_mut());
14761        let vips_op_response = call(
14762            "sRGB2scRGB",
14763            VOption::new()
14764                .set("in", self)
14765                .set(
14766                    "out",
14767                    &mut out_out,
14768                ),
14769        );
14770
14771        utils::result(
14772            vips_op_response,
14773            out_out,
14774            Error::OperationError("SRgb2ScRgb (vips_sRGB2scRGB) failed".to_string()),
14775        )
14776    }
14777
14778    /// VipsscRGB2BW (scRGB2BW), convert scRGB to BW
14779    /// returns `VipsImage` - Output image
14780    pub fn scRGB2BW(&self) -> Result<VipsImage> {
14781        let mut out_out = VipsImage::from(null_mut());
14782        let vips_op_response = call(
14783            "scRGB2BW",
14784            VOption::new()
14785                .set("in", self)
14786                .set(
14787                    "out",
14788                    &mut out_out,
14789                ),
14790        );
14791
14792        utils::result(
14793            vips_op_response,
14794            out_out,
14795            Error::OperationError("ScRgb2Bw (vips_scRGB2BW) failed".to_string()),
14796        )
14797    }
14798
14799    /// VipsscRGB2BW (scRGB2BW), convert scRGB to BW
14800    /// returns `VipsImage` - Output image
14801    ///
14802    /// <ins>Optional arguments</ins>
14803    ///
14804    /// depth: `i32` -> Output device space depth in bits
14805    pub fn scRGB2BW_with_opts(&self, option: VOption) -> Result<VipsImage> {
14806        let mut out_out = VipsImage::from(null_mut());
14807        let vips_op_response = call(
14808            "scRGB2BW",
14809            option
14810                .set("in", self)
14811                .set(
14812                    "out",
14813                    &mut out_out,
14814                ),
14815        );
14816
14817        utils::result(
14818            vips_op_response,
14819            out_out,
14820            Error::OperationError("ScRgb2Bw (vips_scRGB2BW) failed".to_string()),
14821        )
14822    }
14823
14824    /// VipsscRGB2XYZ (scRGB2XYZ), transform scRGB to XYZ
14825    /// returns `VipsImage` - Output image
14826    pub fn scRGB2XYZ(&self) -> Result<VipsImage> {
14827        let mut out_out = VipsImage::from(null_mut());
14828        let vips_op_response = call(
14829            "scRGB2XYZ",
14830            VOption::new()
14831                .set("in", self)
14832                .set(
14833                    "out",
14834                    &mut out_out,
14835                ),
14836        );
14837
14838        utils::result(
14839            vips_op_response,
14840            out_out,
14841            Error::OperationError("ScRgb2Xyz (vips_scRGB2XYZ) failed".to_string()),
14842        )
14843    }
14844
14845    /// VipsscRGB2sRGB (scRGB2sRGB), convert scRGB to sRGB
14846    /// returns `VipsImage` - Output image
14847    pub fn scRGB2sRGB(&self) -> Result<VipsImage> {
14848        let mut out_out = VipsImage::from(null_mut());
14849        let vips_op_response = call(
14850            "scRGB2sRGB",
14851            VOption::new()
14852                .set("in", self)
14853                .set(
14854                    "out",
14855                    &mut out_out,
14856                ),
14857        );
14858
14859        utils::result(
14860            vips_op_response,
14861            out_out,
14862            Error::OperationError("ScRgb2SRgb (vips_scRGB2sRGB) failed".to_string()),
14863        )
14864    }
14865
14866    /// VipsscRGB2sRGB (scRGB2sRGB), convert scRGB to sRGB
14867    /// returns `VipsImage` - Output image
14868    ///
14869    /// <ins>Optional arguments</ins>
14870    ///
14871    /// depth: `i32` -> Output device space depth in bits
14872    pub fn scRGB2sRGB_with_opts(&self, option: VOption) -> Result<VipsImage> {
14873        let mut out_out = VipsImage::from(null_mut());
14874        let vips_op_response = call(
14875            "scRGB2sRGB",
14876            option
14877                .set("in", self)
14878                .set(
14879                    "out",
14880                    &mut out_out,
14881                ),
14882        );
14883
14884        utils::result(
14885            vips_op_response,
14886            out_out,
14887            Error::OperationError("ScRgb2SRgb (vips_scRGB2sRGB) failed".to_string()),
14888        )
14889    }
14890
14891    /// VipsScale (scale), scale an image to uchar
14892    /// returns `VipsImage` - Output image
14893    pub fn scale(&self) -> Result<VipsImage> {
14894        let mut out_out = VipsImage::from(null_mut());
14895        let vips_op_response = call(
14896            "scale",
14897            VOption::new()
14898                .set("in", self)
14899                .set(
14900                    "out",
14901                    &mut out_out,
14902                ),
14903        );
14904
14905        utils::result(
14906            vips_op_response,
14907            out_out,
14908            Error::OperationError("Scale (vips_scale) failed".to_string()),
14909        )
14910    }
14911
14912    /// VipsScale (scale), scale an image to uchar
14913    /// returns `VipsImage` - Output image
14914    ///
14915    /// <ins>Optional arguments</ins>
14916    ///
14917    /// exp: `f64` -> Exponent for log scale
14918    ///
14919    /// log: `bool` -> Log scale
14920    pub fn scale_with_opts(&self, option: VOption) -> Result<VipsImage> {
14921        let mut out_out = VipsImage::from(null_mut());
14922        let vips_op_response = call(
14923            "scale",
14924            option
14925                .set("in", self)
14926                .set(
14927                    "out",
14928                    &mut out_out,
14929                ),
14930        );
14931
14932        utils::result(
14933            vips_op_response,
14934            out_out,
14935            Error::OperationError("Scale (vips_scale) failed".to_string()),
14936        )
14937    }
14938
14939    /// VipsScharr (scharr), Scharr edge detector
14940    /// returns `VipsImage` - Output image
14941    pub fn scharr(&self) -> Result<VipsImage> {
14942        let mut out_out = VipsImage::from(null_mut());
14943        let vips_op_response = call(
14944            "scharr",
14945            VOption::new()
14946                .set("in", self)
14947                .set(
14948                    "out",
14949                    &mut out_out,
14950                ),
14951        );
14952
14953        utils::result(
14954            vips_op_response,
14955            out_out,
14956            Error::OperationError("Scharr (vips_scharr) failed".to_string()),
14957        )
14958    }
14959
14960    /// VipsSdf (sdf), create an SDF image
14961    /// returns `VipsImage` - Output image
14962    ///
14963    /// width: `i32` -> Image width in pixels
14964    ///
14965    /// height: `i32` -> Image height in pixels
14966    ///
14967    /// shape: `SdfShape` -> SDF shape to create
14968    pub fn sdf(width: i32, height: i32, shape: SdfShape) -> Result<VipsImage> {
14969        let mut out_out = VipsImage::from(null_mut());
14970        let vips_op_response = call(
14971            "sdf",
14972            VOption::new()
14973                .set(
14974                    "out",
14975                    &mut out_out,
14976                )
14977                .set(
14978                    "width",
14979                    width,
14980                )
14981                .set(
14982                    "height",
14983                    height,
14984                )
14985                .set(
14986                    "shape",
14987                    shape as i32,
14988                ),
14989        );
14990
14991        utils::result(
14992            vips_op_response,
14993            out_out,
14994            Error::OperationError("Sdf (vips_sdf) failed".to_string()),
14995        )
14996    }
14997
14998    /// VipsSdf (sdf), create an SDF image
14999    /// returns `VipsImage` - Output image
15000    ///
15001    /// width: `i32` -> Image width in pixels
15002    ///
15003    /// height: `i32` -> Image height in pixels
15004    ///
15005    /// shape: `SdfShape` -> SDF shape to create
15006    ///
15007    /// <ins>Optional arguments</ins>
15008    ///
15009    /// r: `f64` -> Radius
15010    ///
15011    /// a: `&[f64]` -> Point a
15012    ///
15013    /// b: `&[f64]` -> Point b
15014    ///
15015    /// corners: `&[f64]` -> Corner radii
15016    pub fn sdf_with_opts(
15017        width: i32,
15018        height: i32,
15019        shape: SdfShape,
15020        option: VOption,
15021    ) -> Result<VipsImage> {
15022        let mut out_out = VipsImage::from(null_mut());
15023        let vips_op_response = call(
15024            "sdf",
15025            option
15026                .set(
15027                    "out",
15028                    &mut out_out,
15029                )
15030                .set(
15031                    "width",
15032                    width,
15033                )
15034                .set(
15035                    "height",
15036                    height,
15037                )
15038                .set(
15039                    "shape",
15040                    shape as i32,
15041                ),
15042        );
15043
15044        utils::result(
15045            vips_op_response,
15046            out_out,
15047            Error::OperationError("Sdf (vips_sdf) failed".to_string()),
15048        )
15049    }
15050
15051    /// VipsSequential (sequential), check sequential access
15052    /// returns `VipsImage` - Output image
15053    pub fn sequential(&self) -> Result<VipsImage> {
15054        let mut out_out = VipsImage::from(null_mut());
15055        let vips_op_response = call(
15056            "sequential",
15057            VOption::new()
15058                .set("in", self)
15059                .set(
15060                    "out",
15061                    &mut out_out,
15062                ),
15063        );
15064
15065        utils::result(
15066            vips_op_response,
15067            out_out,
15068            Error::OperationError("Sequential (vips_sequential) failed".to_string()),
15069        )
15070    }
15071
15072    /// VipsSequential (sequential), check sequential access
15073    /// returns `VipsImage` - Output image
15074    ///
15075    /// <ins>Optional arguments</ins>
15076    ///
15077    /// tile_height: `i32` -> Tile height in pixels
15078    pub fn sequential_with_opts(&self, option: VOption) -> Result<VipsImage> {
15079        let mut out_out = VipsImage::from(null_mut());
15080        let vips_op_response = call(
15081            "sequential",
15082            option
15083                .set("in", self)
15084                .set(
15085                    "out",
15086                    &mut out_out,
15087                ),
15088        );
15089
15090        utils::result(
15091            vips_op_response,
15092            out_out,
15093            Error::OperationError("Sequential (vips_sequential) failed".to_string()),
15094        )
15095    }
15096
15097    /// VipsSharpen (sharpen), unsharp masking for print
15098    /// returns `VipsImage` - Output image
15099    pub fn sharpen(&self) -> Result<VipsImage> {
15100        let mut out_out = VipsImage::from(null_mut());
15101        let vips_op_response = call(
15102            "sharpen",
15103            VOption::new()
15104                .set("in", self)
15105                .set(
15106                    "out",
15107                    &mut out_out,
15108                ),
15109        );
15110
15111        utils::result(
15112            vips_op_response,
15113            out_out,
15114            Error::OperationError("Sharpen (vips_sharpen) failed".to_string()),
15115        )
15116    }
15117
15118    /// VipsSharpen (sharpen), unsharp masking for print
15119    /// returns `VipsImage` - Output image
15120    ///
15121    /// <ins>Optional arguments</ins>
15122    ///
15123    /// sigma: `f64` -> Sigma of Gaussian
15124    ///
15125    /// x1: `f64` -> Flat/jaggy threshold
15126    ///
15127    /// y2: `f64` -> Maximum brightening
15128    ///
15129    /// y3: `f64` -> Maximum darkening
15130    ///
15131    /// m1: `f64` -> Slope for flat areas
15132    ///
15133    /// m2: `f64` -> Slope for jaggy areas
15134    pub fn sharpen_with_opts(&self, option: VOption) -> Result<VipsImage> {
15135        let mut out_out = VipsImage::from(null_mut());
15136        let vips_op_response = call(
15137            "sharpen",
15138            option
15139                .set("in", self)
15140                .set(
15141                    "out",
15142                    &mut out_out,
15143                ),
15144        );
15145
15146        utils::result(
15147            vips_op_response,
15148            out_out,
15149            Error::OperationError("Sharpen (vips_sharpen) failed".to_string()),
15150        )
15151    }
15152
15153    /// VipsShrink (shrink), shrink an image
15154    /// returns `VipsImage` - Output image
15155    ///
15156    /// hshrink: `f64` -> Horizontal shrink factor
15157    ///
15158    /// vshrink: `f64` -> Vertical shrink factor
15159    pub fn shrink(&self, hshrink: f64, vshrink: f64) -> Result<VipsImage> {
15160        let mut out_out = VipsImage::from(null_mut());
15161        let vips_op_response = call(
15162            "shrink",
15163            VOption::new()
15164                .set("in", self)
15165                .set(
15166                    "out",
15167                    &mut out_out,
15168                )
15169                .set(
15170                    "hshrink",
15171                    hshrink,
15172                )
15173                .set(
15174                    "vshrink",
15175                    vshrink,
15176                ),
15177        );
15178
15179        utils::result(
15180            vips_op_response,
15181            out_out,
15182            Error::OperationError("Shrink (vips_shrink) failed".to_string()),
15183        )
15184    }
15185
15186    /// VipsShrink (shrink), shrink an image
15187    /// returns `VipsImage` - Output image
15188    ///
15189    /// hshrink: `f64` -> Horizontal shrink factor
15190    ///
15191    /// vshrink: `f64` -> Vertical shrink factor
15192    ///
15193    /// <ins>Optional arguments</ins>
15194    ///
15195    /// ceil: `bool` -> Round-up output dimensions
15196    pub fn shrink_with_opts(
15197        &self,
15198        hshrink: f64,
15199        vshrink: f64,
15200        option: VOption,
15201    ) -> Result<VipsImage> {
15202        let mut out_out = VipsImage::from(null_mut());
15203        let vips_op_response = call(
15204            "shrink",
15205            option
15206                .set("in", self)
15207                .set(
15208                    "out",
15209                    &mut out_out,
15210                )
15211                .set(
15212                    "hshrink",
15213                    hshrink,
15214                )
15215                .set(
15216                    "vshrink",
15217                    vshrink,
15218                ),
15219        );
15220
15221        utils::result(
15222            vips_op_response,
15223            out_out,
15224            Error::OperationError("Shrink (vips_shrink) failed".to_string()),
15225        )
15226    }
15227
15228    /// VipsShrinkh (shrinkh), shrink an image horizontally
15229    /// returns `VipsImage` - Output image
15230    ///
15231    /// hshrink: `i32` -> Horizontal shrink factor
15232    pub fn shrinkh(&self, hshrink: i32) -> Result<VipsImage> {
15233        let mut out_out = VipsImage::from(null_mut());
15234        let vips_op_response = call(
15235            "shrinkh",
15236            VOption::new()
15237                .set("in", self)
15238                .set(
15239                    "out",
15240                    &mut out_out,
15241                )
15242                .set(
15243                    "hshrink",
15244                    hshrink,
15245                ),
15246        );
15247
15248        utils::result(
15249            vips_op_response,
15250            out_out,
15251            Error::OperationError("Shrinkh (vips_shrinkh) failed".to_string()),
15252        )
15253    }
15254
15255    /// VipsShrinkh (shrinkh), shrink an image horizontally
15256    /// returns `VipsImage` - Output image
15257    ///
15258    /// hshrink: `i32` -> Horizontal shrink factor
15259    ///
15260    /// <ins>Optional arguments</ins>
15261    ///
15262    /// ceil: `bool` -> Round-up output dimensions
15263    pub fn shrinkh_with_opts(&self, hshrink: i32, option: VOption) -> Result<VipsImage> {
15264        let mut out_out = VipsImage::from(null_mut());
15265        let vips_op_response = call(
15266            "shrinkh",
15267            option
15268                .set("in", self)
15269                .set(
15270                    "out",
15271                    &mut out_out,
15272                )
15273                .set(
15274                    "hshrink",
15275                    hshrink,
15276                ),
15277        );
15278
15279        utils::result(
15280            vips_op_response,
15281            out_out,
15282            Error::OperationError("Shrinkh (vips_shrinkh) failed".to_string()),
15283        )
15284    }
15285
15286    /// VipsShrinkv (shrinkv), shrink an image vertically
15287    /// returns `VipsImage` - Output image
15288    ///
15289    /// vshrink: `i32` -> Vertical shrink factor
15290    pub fn shrinkv(&self, vshrink: i32) -> Result<VipsImage> {
15291        let mut out_out = VipsImage::from(null_mut());
15292        let vips_op_response = call(
15293            "shrinkv",
15294            VOption::new()
15295                .set("in", self)
15296                .set(
15297                    "out",
15298                    &mut out_out,
15299                )
15300                .set(
15301                    "vshrink",
15302                    vshrink,
15303                ),
15304        );
15305
15306        utils::result(
15307            vips_op_response,
15308            out_out,
15309            Error::OperationError("Shrinkv (vips_shrinkv) failed".to_string()),
15310        )
15311    }
15312
15313    /// VipsShrinkv (shrinkv), shrink an image vertically
15314    /// returns `VipsImage` - Output image
15315    ///
15316    /// vshrink: `i32` -> Vertical shrink factor
15317    ///
15318    /// <ins>Optional arguments</ins>
15319    ///
15320    /// ceil: `bool` -> Round-up output dimensions
15321    pub fn shrinkv_with_opts(&self, vshrink: i32, option: VOption) -> Result<VipsImage> {
15322        let mut out_out = VipsImage::from(null_mut());
15323        let vips_op_response = call(
15324            "shrinkv",
15325            option
15326                .set("in", self)
15327                .set(
15328                    "out",
15329                    &mut out_out,
15330                )
15331                .set(
15332                    "vshrink",
15333                    vshrink,
15334                ),
15335        );
15336
15337        utils::result(
15338            vips_op_response,
15339            out_out,
15340            Error::OperationError("Shrinkv (vips_shrinkv) failed".to_string()),
15341        )
15342    }
15343
15344    /// VipsSign (sign), unit vector of pixel
15345    /// returns `VipsImage` - Output image
15346    pub fn sign(&self) -> Result<VipsImage> {
15347        let mut out_out = VipsImage::from(null_mut());
15348        let vips_op_response = call(
15349            "sign",
15350            VOption::new()
15351                .set("in", self)
15352                .set(
15353                    "out",
15354                    &mut out_out,
15355                ),
15356        );
15357
15358        utils::result(
15359            vips_op_response,
15360            out_out,
15361            Error::OperationError("Sign (vips_sign) failed".to_string()),
15362        )
15363    }
15364
15365    /// VipsSimilarity (similarity), similarity transform of an image
15366    /// returns `VipsImage` - Output image
15367    pub fn similarity(&self) -> Result<VipsImage> {
15368        let mut out_out = VipsImage::from(null_mut());
15369        let vips_op_response = call(
15370            "similarity",
15371            VOption::new()
15372                .set("in", self)
15373                .set(
15374                    "out",
15375                    &mut out_out,
15376                ),
15377        );
15378
15379        utils::result(
15380            vips_op_response,
15381            out_out,
15382            Error::OperationError("Similarity (vips_similarity) failed".to_string()),
15383        )
15384    }
15385
15386    /// VipsSimilarity (similarity), similarity transform of an image
15387    /// returns `VipsImage` - Output image
15388    ///
15389    /// <ins>Optional arguments</ins>
15390    ///
15391    /// scale: `f64` -> Scale by this factor
15392    ///
15393    /// angle: `f64` -> Rotate clockwise by this many degrees
15394    ///
15395    /// interpolate: `&VipsInterpolate` -> Interpolate pixels with this
15396    ///
15397    /// background: `&[f64]` -> Background value
15398    ///
15399    /// odx: `f64` -> Horizontal output displacement
15400    ///
15401    /// ody: `f64` -> Vertical output displacement
15402    ///
15403    /// idx: `f64` -> Horizontal input displacement
15404    ///
15405    /// idy: `f64` -> Vertical input displacement
15406    pub fn similarity_with_opts(&self, option: VOption) -> Result<VipsImage> {
15407        let mut out_out = VipsImage::from(null_mut());
15408        let vips_op_response = call(
15409            "similarity",
15410            option
15411                .set("in", self)
15412                .set(
15413                    "out",
15414                    &mut out_out,
15415                ),
15416        );
15417
15418        utils::result(
15419            vips_op_response,
15420            out_out,
15421            Error::OperationError("Similarity (vips_similarity) failed".to_string()),
15422        )
15423    }
15424
15425    /// VipsSines (sines), make a 2D sine wave
15426    /// returns `VipsImage` - Output image
15427    ///
15428    /// width: `i32` -> Image width in pixels
15429    ///
15430    /// height: `i32` -> Image height in pixels
15431    pub fn sines(width: i32, height: i32) -> Result<VipsImage> {
15432        let mut out_out = VipsImage::from(null_mut());
15433        let vips_op_response = call(
15434            "sines",
15435            VOption::new()
15436                .set(
15437                    "out",
15438                    &mut out_out,
15439                )
15440                .set(
15441                    "width",
15442                    width,
15443                )
15444                .set(
15445                    "height",
15446                    height,
15447                ),
15448        );
15449
15450        utils::result(
15451            vips_op_response,
15452            out_out,
15453            Error::OperationError("Sines (vips_sines) failed".to_string()),
15454        )
15455    }
15456
15457    /// VipsSines (sines), make a 2D sine wave
15458    /// returns `VipsImage` - Output image
15459    ///
15460    /// width: `i32` -> Image width in pixels
15461    ///
15462    /// height: `i32` -> Image height in pixels
15463    ///
15464    /// <ins>Optional arguments</ins>
15465    ///
15466    /// uchar: `bool` -> Output an unsigned char image
15467    ///
15468    /// hfreq: `f64` -> Horizontal spatial frequency
15469    ///
15470    /// vfreq: `f64` -> Vertical spatial frequency
15471    pub fn sines_with_opts(width: i32, height: i32, option: VOption) -> Result<VipsImage> {
15472        let mut out_out = VipsImage::from(null_mut());
15473        let vips_op_response = call(
15474            "sines",
15475            option
15476                .set(
15477                    "out",
15478                    &mut out_out,
15479                )
15480                .set(
15481                    "width",
15482                    width,
15483                )
15484                .set(
15485                    "height",
15486                    height,
15487                ),
15488        );
15489
15490        utils::result(
15491            vips_op_response,
15492            out_out,
15493            Error::OperationError("Sines (vips_sines) failed".to_string()),
15494        )
15495    }
15496
15497    /// VipsSmartcrop (smartcrop), extract an area from an image
15498    /// returns `VipsImage` - Output image
15499    ///
15500    /// width: `i32` -> Width of extract area
15501    ///
15502    /// height: `i32` -> Height of extract area
15503    pub fn smartcrop(&self, width: i32, height: i32) -> Result<VipsImage> {
15504        let mut out_out = VipsImage::from(null_mut());
15505        let vips_op_response = call(
15506            "smartcrop",
15507            VOption::new()
15508                .set(
15509                    "input",
15510                    self,
15511                )
15512                .set(
15513                    "out",
15514                    &mut out_out,
15515                )
15516                .set(
15517                    "width",
15518                    width,
15519                )
15520                .set(
15521                    "height",
15522                    height,
15523                ),
15524        );
15525
15526        utils::result(
15527            vips_op_response,
15528            out_out,
15529            Error::OperationError("Smartcrop (vips_smartcrop) failed".to_string()),
15530        )
15531    }
15532
15533    /// VipsSmartcrop (smartcrop), extract an area from an image
15534    /// returns `VipsImage` - Output image
15535    ///
15536    /// width: `i32` -> Width of extract area
15537    ///
15538    /// height: `i32` -> Height of extract area
15539    ///
15540    /// <ins>Optional arguments</ins>
15541    ///
15542    /// attention_x: `&mut i32` -> Horizontal position of attention centre
15543    ///
15544    /// attention_y: `&mut i32` -> Vertical position of attention centre
15545    ///
15546    /// interesting: [`Interesting`] -> How to measure interestingness
15547    ///
15548    /// premultiplied: `bool` -> Input image already has premultiplied alpha
15549    pub fn smartcrop_with_opts(
15550        &self,
15551        width: i32,
15552        height: i32,
15553        option: VOption,
15554    ) -> Result<VipsImage> {
15555        let mut out_out = VipsImage::from(null_mut());
15556        let vips_op_response = call(
15557            "smartcrop",
15558            option
15559                .set(
15560                    "input",
15561                    self,
15562                )
15563                .set(
15564                    "out",
15565                    &mut out_out,
15566                )
15567                .set(
15568                    "width",
15569                    width,
15570                )
15571                .set(
15572                    "height",
15573                    height,
15574                ),
15575        );
15576
15577        utils::result(
15578            vips_op_response,
15579            out_out,
15580            Error::OperationError("Smartcrop (vips_smartcrop) failed".to_string()),
15581        )
15582    }
15583
15584    /// VipsSobel (sobel), Sobel edge detector
15585    /// returns `VipsImage` - Output image
15586    pub fn sobel(&self) -> Result<VipsImage> {
15587        let mut out_out = VipsImage::from(null_mut());
15588        let vips_op_response = call(
15589            "sobel",
15590            VOption::new()
15591                .set("in", self)
15592                .set(
15593                    "out",
15594                    &mut out_out,
15595                ),
15596        );
15597
15598        utils::result(
15599            vips_op_response,
15600            out_out,
15601            Error::OperationError("Sobel (vips_sobel) failed".to_string()),
15602        )
15603    }
15604
15605    /// VipsSpcor (spcor), spatial correlation
15606    /// returns `VipsImage` - Output image
15607    ///
15608    /// refp: `&VipsImage` -> Input reference image
15609    pub fn spcor(&self, refp: &VipsImage) -> Result<VipsImage> {
15610        let mut out_out = VipsImage::from(null_mut());
15611        let vips_op_response = call(
15612            "spcor",
15613            VOption::new()
15614                .set("in", self)
15615                .set(
15616                    "ref", refp,
15617                )
15618                .set(
15619                    "out",
15620                    &mut out_out,
15621                ),
15622        );
15623
15624        utils::result(
15625            vips_op_response,
15626            out_out,
15627            Error::OperationError("Spcor (vips_spcor) failed".to_string()),
15628        )
15629    }
15630
15631    /// VipsSpectrum (spectrum), make displayable power spectrum
15632    /// returns `VipsImage` - Output image
15633    pub fn spectrum(&self) -> Result<VipsImage> {
15634        let mut out_out = VipsImage::from(null_mut());
15635        let vips_op_response = call(
15636            "spectrum",
15637            VOption::new()
15638                .set("in", self)
15639                .set(
15640                    "out",
15641                    &mut out_out,
15642                ),
15643        );
15644
15645        utils::result(
15646            vips_op_response,
15647            out_out,
15648            Error::OperationError("Spectrum (vips_spectrum) failed".to_string()),
15649        )
15650    }
15651
15652    /// VipsStats (stats), find many image stats
15653    /// returns `VipsImage` - Output array of statistics
15654    pub fn stats(&self) -> Result<VipsImage> {
15655        let mut out_out = VipsImage::from(null_mut());
15656        let vips_op_response = call(
15657            "stats",
15658            VOption::new()
15659                .set("in", self)
15660                .set(
15661                    "out",
15662                    &mut out_out,
15663                ),
15664        );
15665
15666        utils::result(
15667            vips_op_response,
15668            out_out,
15669            Error::OperationError("Stats (vips_stats) failed".to_string()),
15670        )
15671    }
15672
15673    /// VipsStdif (stdif), statistical difference
15674    /// returns `VipsImage` - Output image
15675    ///
15676    /// width: `i32` -> Window width in pixels
15677    ///
15678    /// height: `i32` -> Window height in pixels
15679    pub fn stdif(&self, width: i32, height: i32) -> Result<VipsImage> {
15680        let mut out_out = VipsImage::from(null_mut());
15681        let vips_op_response = call(
15682            "stdif",
15683            VOption::new()
15684                .set("in", self)
15685                .set(
15686                    "out",
15687                    &mut out_out,
15688                )
15689                .set(
15690                    "width",
15691                    width,
15692                )
15693                .set(
15694                    "height",
15695                    height,
15696                ),
15697        );
15698
15699        utils::result(
15700            vips_op_response,
15701            out_out,
15702            Error::OperationError("Stdif (vips_stdif) failed".to_string()),
15703        )
15704    }
15705
15706    /// VipsStdif (stdif), statistical difference
15707    /// returns `VipsImage` - Output image
15708    ///
15709    /// width: `i32` -> Window width in pixels
15710    ///
15711    /// height: `i32` -> Window height in pixels
15712    ///
15713    /// <ins>Optional arguments</ins>
15714    ///
15715    /// s0: `f64` -> New deviation
15716    ///
15717    /// b: `f64` -> Weight of new deviation
15718    ///
15719    /// m0: `f64` -> New mean
15720    ///
15721    /// a: `f64` -> Weight of new mean
15722    pub fn stdif_with_opts(&self, width: i32, height: i32, option: VOption) -> Result<VipsImage> {
15723        let mut out_out = VipsImage::from(null_mut());
15724        let vips_op_response = call(
15725            "stdif",
15726            option
15727                .set("in", self)
15728                .set(
15729                    "out",
15730                    &mut out_out,
15731                )
15732                .set(
15733                    "width",
15734                    width,
15735                )
15736                .set(
15737                    "height",
15738                    height,
15739                ),
15740        );
15741
15742        utils::result(
15743            vips_op_response,
15744            out_out,
15745            Error::OperationError("Stdif (vips_stdif) failed".to_string()),
15746        )
15747    }
15748
15749    /// VipsSubsample (subsample), subsample an image
15750    /// returns `VipsImage` - Output image
15751    ///
15752    /// xfac: `i32` -> Horizontal subsample factor
15753    ///
15754    /// yfac: `i32` -> Vertical subsample factor
15755    pub fn subsample(&self, xfac: i32, yfac: i32) -> Result<VipsImage> {
15756        let mut out_out = VipsImage::from(null_mut());
15757        let vips_op_response = call(
15758            "subsample",
15759            VOption::new()
15760                .set(
15761                    "input",
15762                    self,
15763                )
15764                .set(
15765                    "out",
15766                    &mut out_out,
15767                )
15768                .set(
15769                    "xfac",
15770                    xfac,
15771                )
15772                .set(
15773                    "yfac",
15774                    yfac,
15775                ),
15776        );
15777
15778        utils::result(
15779            vips_op_response,
15780            out_out,
15781            Error::OperationError("Subsample (vips_subsample) failed".to_string()),
15782        )
15783    }
15784
15785    /// VipsSubsample (subsample), subsample an image
15786    /// returns `VipsImage` - Output image
15787    ///
15788    /// xfac: `i32` -> Horizontal subsample factor
15789    ///
15790    /// yfac: `i32` -> Vertical subsample factor
15791    ///
15792    /// <ins>Optional arguments</ins>
15793    ///
15794    /// point: `bool` -> Point sample
15795    pub fn subsample_with_opts(&self, xfac: i32, yfac: i32, option: VOption) -> Result<VipsImage> {
15796        let mut out_out = VipsImage::from(null_mut());
15797        let vips_op_response = call(
15798            "subsample",
15799            option
15800                .set(
15801                    "input",
15802                    self,
15803                )
15804                .set(
15805                    "out",
15806                    &mut out_out,
15807                )
15808                .set(
15809                    "xfac",
15810                    xfac,
15811                )
15812                .set(
15813                    "yfac",
15814                    yfac,
15815                ),
15816        );
15817
15818        utils::result(
15819            vips_op_response,
15820            out_out,
15821            Error::OperationError("Subsample (vips_subsample) failed".to_string()),
15822        )
15823    }
15824
15825    /// VipsSubtract (subtract), subtract two images
15826    /// returns `VipsImage` - Output image
15827    ///
15828    /// right: `&VipsImage` -> Right-hand image argument
15829    pub fn subtract(&self, right: &VipsImage) -> Result<VipsImage> {
15830        let mut out_out = VipsImage::from(null_mut());
15831        let vips_op_response = call(
15832            "subtract",
15833            VOption::new()
15834                .set(
15835                    "left",
15836                    self,
15837                )
15838                .set(
15839                    "right",
15840                    right,
15841                )
15842                .set(
15843                    "out",
15844                    &mut out_out,
15845                ),
15846        );
15847
15848        utils::result(
15849            vips_op_response,
15850            out_out,
15851            Error::OperationError("Subtract (vips_subtract) failed".to_string()),
15852        )
15853    }
15854
15855    /// VipsSum (sum), sum an array of images
15856    /// returns `VipsImage` - Output image
15857    ///
15858    /// inp: `&[VipsImage]` -> Array of input images
15859    pub fn sum(inp: &[VipsImage]) -> Result<VipsImage> {
15860        let mut out_out = VipsImage::from(null_mut());
15861        let vips_op_response = call(
15862            "sum",
15863            VOption::new()
15864                .set("in", inp)
15865                .set(
15866                    "out",
15867                    &mut out_out,
15868                ),
15869        );
15870
15871        utils::result(
15872            vips_op_response,
15873            out_out,
15874            Error::OperationError("Sum (vips_sum) failed".to_string()),
15875        )
15876    }
15877
15878    /// VipsForeignLoadSvgFile (svgload), load SVG with rsvg (.svg, .svgz, .svg.gz), priority=-5, untrusted, is_a, get_flags, get_flags_filename, header, load
15879    /// returns `VipsImage` - Output image
15880    ///
15881    /// filename: `&str` -> Filename to load from
15882    pub fn svgload(filename: &str) -> Result<VipsImage> {
15883        let mut out_out = VipsImage::from(null_mut());
15884        let vips_op_response = call(
15885            "svgload",
15886            VOption::new()
15887                .set(
15888                    "filename",
15889                    filename,
15890                )
15891                .set(
15892                    "out",
15893                    &mut out_out,
15894                ),
15895        );
15896
15897        utils::result(
15898            vips_op_response,
15899            out_out,
15900            Error::OperationError("Svgload (vips_svgload) failed".to_string()),
15901        )
15902    }
15903
15904    /// VipsForeignLoadSvgFile (svgload), load SVG with rsvg (.svg, .svgz, .svg.gz), priority=-5, untrusted, is_a, get_flags, get_flags_filename, header, load
15905    /// returns `VipsImage` - Output image
15906    ///
15907    /// filename: `&str` -> Filename to load from
15908    ///
15909    /// <ins>Optional arguments</ins>
15910    ///
15911    /// dpi: `f64` -> Render at this DPI
15912    ///
15913    /// scale: `f64` -> Scale output by this factor
15914    ///
15915    /// unlimited: `bool` -> Allow SVG of any size
15916    ///
15917    /// stylesheet: `&str` -> Custom CSS
15918    ///
15919    /// high_bitdepth: `bool` -> Enable scRGB 128-bit output (32-bit per channel)
15920    ///
15921    /// flags: [`ForeignFlags`] -> Flags for this file
15922    ///
15923    /// memory: `bool` -> Force open via memory
15924    ///
15925    /// access: [`Access`] -> Required access pattern for this file
15926    ///
15927    /// fail_on: [`FailOn`] -> Error level to fail on
15928    ///
15929    /// revalidate: `bool` -> Don't use a cached result for this operation
15930    pub fn svgload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
15931        let mut out_out = VipsImage::from(null_mut());
15932        let vips_op_response = call(
15933            "svgload",
15934            option
15935                .set(
15936                    "filename",
15937                    filename,
15938                )
15939                .set(
15940                    "out",
15941                    &mut out_out,
15942                ),
15943        );
15944
15945        utils::result(
15946            vips_op_response,
15947            out_out,
15948            Error::OperationError("Svgload (vips_svgload) failed".to_string()),
15949        )
15950    }
15951
15952    /// VipsForeignLoadSvgBuffer (svgload_buffer), load SVG with rsvg, priority=-5, untrusted, is_a_buffer, get_flags, get_flags_filename, header, load
15953    /// returns `VipsImage` - Output image
15954    ///
15955    /// buffer: `&[u8]` -> Buffer to load from
15956    pub fn svgload_buffer(buffer: &[u8]) -> Result<VipsImage> {
15957        let blob = unsafe {
15958            vips_blob_new(
15959                None,
15960                buffer.as_ptr() as _,
15961                buffer.len() as _,
15962            )
15963        };
15964        let mut out_out = VipsImage::from(null_mut());
15965        let vips_op_response = call(
15966            "svgload_buffer",
15967            VOption::new()
15968                .set(
15969                    "buffer",
15970                    &VipsBlob::from(blob),
15971                )
15972                .set(
15973                    "out",
15974                    &mut out_out,
15975                ),
15976        );
15977        unsafe { vips_area_unref(&mut (*blob).area) };
15978        utils::result(
15979            vips_op_response,
15980            out_out,
15981            Error::OperationError("SvgloadBuffer (vips_svgload_buffer) failed".to_string()),
15982        )
15983    }
15984
15985    /// VipsForeignLoadSvgBuffer (svgload_buffer), load SVG with rsvg, priority=-5, untrusted, is_a_buffer, get_flags, get_flags_filename, header, load
15986    /// returns `VipsImage` - Output image
15987    ///
15988    /// buffer: `&[u8]` -> Buffer to load from
15989    ///
15990    /// <ins>Optional arguments</ins>
15991    ///
15992    /// dpi: `f64` -> Render at this DPI
15993    ///
15994    /// scale: `f64` -> Scale output by this factor
15995    ///
15996    /// unlimited: `bool` -> Allow SVG of any size
15997    ///
15998    /// stylesheet: `&str` -> Custom CSS
15999    ///
16000    /// high_bitdepth: `bool` -> Enable scRGB 128-bit output (32-bit per channel)
16001    ///
16002    /// flags: [`ForeignFlags`] -> Flags for this file
16003    ///
16004    /// memory: `bool` -> Force open via memory
16005    ///
16006    /// access: [`Access`] -> Required access pattern for this file
16007    ///
16008    /// fail_on: [`FailOn`] -> Error level to fail on
16009    ///
16010    /// revalidate: `bool` -> Don't use a cached result for this operation
16011    pub fn svgload_buffer_with_opts(buffer: &[u8], option: VOption) -> Result<VipsImage> {
16012        let blob = unsafe {
16013            vips_blob_new(
16014                None,
16015                buffer.as_ptr() as _,
16016                buffer.len() as _,
16017            )
16018        };
16019        let mut out_out = VipsImage::from(null_mut());
16020        let vips_op_response = call(
16021            "svgload_buffer",
16022            option
16023                .set(
16024                    "buffer",
16025                    &VipsBlob::from(blob),
16026                )
16027                .set(
16028                    "out",
16029                    &mut out_out,
16030                ),
16031        );
16032        unsafe { vips_area_unref(&mut (*blob).area) };
16033        utils::result(
16034            vips_op_response,
16035            out_out,
16036            Error::OperationError("SvgloadBuffer (vips_svgload_buffer) failed".to_string()),
16037        )
16038    }
16039
16040    /// VipsForeignLoadSvgSource (svgload_source), load svg from source, priority=-5, untrusted, is_a_source, get_flags, get_flags_filename, header, load
16041    /// returns `VipsImage` - Output image
16042    ///
16043    /// source: `&VipsSource` -> Source to load from
16044    pub fn svgload_source(source: &VipsSource) -> Result<VipsImage> {
16045        let mut out_out = VipsImage::from(null_mut());
16046        let vips_op_response = call(
16047            "svgload_source",
16048            VOption::new()
16049                .set(
16050                    "source",
16051                    source,
16052                )
16053                .set(
16054                    "out",
16055                    &mut out_out,
16056                ),
16057        );
16058
16059        utils::result(
16060            vips_op_response,
16061            out_out,
16062            Error::OperationError("SvgloadSource (vips_svgload_source) failed".to_string()),
16063        )
16064    }
16065
16066    /// VipsForeignLoadSvgSource (svgload_source), load svg from source, priority=-5, untrusted, is_a_source, get_flags, get_flags_filename, header, load
16067    /// returns `VipsImage` - Output image
16068    ///
16069    /// source: `&VipsSource` -> Source to load from
16070    ///
16071    /// <ins>Optional arguments</ins>
16072    ///
16073    /// dpi: `f64` -> Render at this DPI
16074    ///
16075    /// scale: `f64` -> Scale output by this factor
16076    ///
16077    /// unlimited: `bool` -> Allow SVG of any size
16078    ///
16079    /// stylesheet: `&str` -> Custom CSS
16080    ///
16081    /// high_bitdepth: `bool` -> Enable scRGB 128-bit output (32-bit per channel)
16082    ///
16083    /// flags: [`ForeignFlags`] -> Flags for this file
16084    ///
16085    /// memory: `bool` -> Force open via memory
16086    ///
16087    /// access: [`Access`] -> Required access pattern for this file
16088    ///
16089    /// fail_on: [`FailOn`] -> Error level to fail on
16090    ///
16091    /// revalidate: `bool` -> Don't use a cached result for this operation
16092    pub fn svgload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
16093        let mut out_out = VipsImage::from(null_mut());
16094        let vips_op_response = call(
16095            "svgload_source",
16096            option
16097                .set(
16098                    "source",
16099                    source,
16100                )
16101                .set(
16102                    "out",
16103                    &mut out_out,
16104                ),
16105        );
16106
16107        utils::result(
16108            vips_op_response,
16109            out_out,
16110            Error::OperationError("SvgloadSource (vips_svgload_source) failed".to_string()),
16111        )
16112    }
16113
16114    /// VipsSwitch (switch), find the index of the first non-zero pixel in tests
16115    /// returns `VipsImage` - Output image
16116    ///
16117    /// tests: `&[VipsImage]` -> Table of images to test
16118    pub fn switch(tests: &[VipsImage]) -> Result<VipsImage> {
16119        let mut out_out = VipsImage::from(null_mut());
16120        let vips_op_response = call(
16121            "switch",
16122            VOption::new()
16123                .set(
16124                    "tests",
16125                    tests,
16126                )
16127                .set(
16128                    "out",
16129                    &mut out_out,
16130                ),
16131        );
16132
16133        utils::result(
16134            vips_op_response,
16135            out_out,
16136            Error::OperationError("Switch (vips_switch) failed".to_string()),
16137        )
16138    }
16139
16140    /// VipsSystem (system), run an external command
16141    ///
16142    /// cmd_format: `&str` -> Command to run
16143    pub fn system(cmd_format: &str) -> Result<()> {
16144        let vips_op_response = call(
16145            "system",
16146            VOption::new().set(
16147                "cmd-format",
16148                cmd_format,
16149            ),
16150        );
16151
16152        utils::result(
16153            vips_op_response,
16154            (),
16155            Error::OperationError("System (vips_system) failed".to_string()),
16156        )
16157    }
16158
16159    /// VipsSystem (system), run an external command
16160    ///
16161    /// cmd_format: `&str` -> Command to run
16162    ///
16163    /// <ins>Optional arguments</ins>
16164    ///
16165    /// inp: `&[VipsImage]` -> Array of input images
16166    ///
16167    /// out: `&mut VipsImage` -> Output image
16168    ///
16169    /// log: `&str` -> Command log
16170    ///
16171    /// out_format: `&str` -> Format for output filename
16172    ///
16173    /// in_format: `&str` -> Format for input filename
16174    pub fn system_with_opts(cmd_format: &str, option: VOption) -> Result<()> {
16175        let vips_op_response = call(
16176            "system",
16177            option.set(
16178                "cmd-format",
16179                cmd_format,
16180            ),
16181        );
16182
16183        utils::result(
16184            vips_op_response,
16185            (),
16186            Error::OperationError("System (vips_system) failed".to_string()),
16187        )
16188    }
16189
16190    /// VipsText (text), make a text image
16191    /// returns `VipsImage` - Output image
16192    ///
16193    /// text: `&str` -> Text to render
16194    pub fn text(text: &str) -> Result<VipsImage> {
16195        let mut out_out = VipsImage::from(null_mut());
16196        let vips_op_response = call(
16197            "text",
16198            VOption::new()
16199                .set(
16200                    "out",
16201                    &mut out_out,
16202                )
16203                .set(
16204                    "text",
16205                    text,
16206                ),
16207        );
16208
16209        utils::result(
16210            vips_op_response,
16211            out_out,
16212            Error::OperationError("Text (vips_text) failed".to_string()),
16213        )
16214    }
16215
16216    /// VipsText (text), make a text image
16217    /// returns `VipsImage` - Output image
16218    ///
16219    /// text: `&str` -> Text to render
16220    ///
16221    /// <ins>Optional arguments</ins>
16222    ///
16223    /// font: `&str` -> Font to render with
16224    ///
16225    /// width: `i32` -> Maximum image width in pixels
16226    ///
16227    /// height: `i32` -> Maximum image height in pixels
16228    ///
16229    /// align: [`Align`] -> Align on the low, centre or high edge
16230    ///
16231    /// justify: `bool` -> Justify lines
16232    ///
16233    /// dpi: `i32` -> DPI to render at
16234    ///
16235    /// autofit_dpi: `&mut i32` -> DPI selected by autofit
16236    ///
16237    /// spacing: `i32` -> Line spacing
16238    ///
16239    /// fontfile: `&str` -> Load this font file
16240    ///
16241    /// rgba: `bool` -> Enable RGBA output
16242    ///
16243    /// wrap: [`TextWrap`] -> Wrap lines on word or character boundaries
16244    pub fn text_with_opts(text: &str, option: VOption) -> Result<VipsImage> {
16245        let mut out_out = VipsImage::from(null_mut());
16246        let vips_op_response = call(
16247            "text",
16248            option
16249                .set(
16250                    "out",
16251                    &mut out_out,
16252                )
16253                .set(
16254                    "text",
16255                    text,
16256                ),
16257        );
16258
16259        utils::result(
16260            vips_op_response,
16261            out_out,
16262            Error::OperationError("Text (vips_text) failed".to_string()),
16263        )
16264    }
16265
16266    /// VipsThumbnailFile (thumbnail), generate thumbnail from file
16267    /// returns `VipsImage` - Output image
16268    ///
16269    /// filename: `&str` -> Filename to read from
16270    ///
16271    /// width: `i32` -> Size to this width
16272    pub fn thumbnail(filename: &str, width: i32) -> Result<VipsImage> {
16273        let mut out_out = VipsImage::from(null_mut());
16274        let vips_op_response = call(
16275            "thumbnail",
16276            VOption::new()
16277                .set(
16278                    "filename",
16279                    filename,
16280                )
16281                .set(
16282                    "out",
16283                    &mut out_out,
16284                )
16285                .set(
16286                    "width",
16287                    width,
16288                ),
16289        );
16290
16291        utils::result(
16292            vips_op_response,
16293            out_out,
16294            Error::OperationError("Thumbnail (vips_thumbnail) failed".to_string()),
16295        )
16296    }
16297
16298    /// VipsThumbnailFile (thumbnail), generate thumbnail from file
16299    /// returns `VipsImage` - Output image
16300    ///
16301    /// filename: `&str` -> Filename to read from
16302    ///
16303    /// width: `i32` -> Size to this width
16304    ///
16305    /// <ins>Optional arguments</ins>
16306    ///
16307    /// height: `i32` -> Size to this height
16308    ///
16309    /// size: [`Size`] -> Only upsize, only downsize, or both
16310    ///
16311    /// no_rotate: `bool` -> Don't use orientation tags to rotate image upright
16312    ///
16313    /// crop: [`Interesting`] -> Reduce to fill target rectangle, then crop
16314    ///
16315    /// linear: `bool` -> Reduce in linear light
16316    ///
16317    /// input_profile: `&str` -> Fallback input profile
16318    ///
16319    /// output_profile: `&str` -> Fallback output profile
16320    ///
16321    /// intent: [`Intent`] -> Rendering intent
16322    ///
16323    /// fail_on: [`FailOn`] -> Error level to fail on
16324    pub fn thumbnail_with_opts(filename: &str, width: i32, option: VOption) -> Result<VipsImage> {
16325        let mut out_out = VipsImage::from(null_mut());
16326        let vips_op_response = call(
16327            "thumbnail",
16328            option
16329                .set(
16330                    "filename",
16331                    filename,
16332                )
16333                .set(
16334                    "out",
16335                    &mut out_out,
16336                )
16337                .set(
16338                    "width",
16339                    width,
16340                ),
16341        );
16342
16343        utils::result(
16344            vips_op_response,
16345            out_out,
16346            Error::OperationError("Thumbnail (vips_thumbnail) failed".to_string()),
16347        )
16348    }
16349
16350    /// VipsThumbnailBuffer (thumbnail_buffer), generate thumbnail from buffer
16351    /// returns `VipsImage` - Output image
16352    ///
16353    /// buffer: `&[u8]` -> Buffer to load from
16354    ///
16355    /// width: `i32` -> Size to this width
16356    pub fn thumbnail_buffer(buffer: &[u8], width: i32) -> Result<VipsImage> {
16357        let blob = unsafe {
16358            vips_blob_new(
16359                None,
16360                buffer.as_ptr() as _,
16361                buffer.len() as _,
16362            )
16363        };
16364        let mut out_out = VipsImage::from(null_mut());
16365        let vips_op_response = call(
16366            "thumbnail_buffer",
16367            VOption::new()
16368                .set(
16369                    "buffer",
16370                    &VipsBlob::from(blob),
16371                )
16372                .set(
16373                    "out",
16374                    &mut out_out,
16375                )
16376                .set(
16377                    "width",
16378                    width,
16379                ),
16380        );
16381        unsafe { vips_area_unref(&mut (*blob).area) };
16382        utils::result(
16383            vips_op_response,
16384            out_out,
16385            Error::OperationError("ThumbnailBuffer (vips_thumbnail_buffer) failed".to_string()),
16386        )
16387    }
16388
16389    /// VipsThumbnailBuffer (thumbnail_buffer), generate thumbnail from buffer
16390    /// returns `VipsImage` - Output image
16391    ///
16392    /// buffer: `&[u8]` -> Buffer to load from
16393    ///
16394    /// width: `i32` -> Size to this width
16395    ///
16396    /// <ins>Optional arguments</ins>
16397    ///
16398    /// option_string: `&str` -> Options that are passed on to the underlying loader
16399    ///
16400    /// height: `i32` -> Size to this height
16401    ///
16402    /// size: [`Size`] -> Only upsize, only downsize, or both
16403    ///
16404    /// no_rotate: `bool` -> Don't use orientation tags to rotate image upright
16405    ///
16406    /// crop: [`Interesting`] -> Reduce to fill target rectangle, then crop
16407    ///
16408    /// linear: `bool` -> Reduce in linear light
16409    ///
16410    /// input_profile: `&str` -> Fallback input profile
16411    ///
16412    /// output_profile: `&str` -> Fallback output profile
16413    ///
16414    /// intent: [`Intent`] -> Rendering intent
16415    ///
16416    /// fail_on: [`FailOn`] -> Error level to fail on
16417    pub fn thumbnail_buffer_with_opts(
16418        buffer: &[u8],
16419        width: i32,
16420        option: VOption,
16421    ) -> Result<VipsImage> {
16422        let blob = unsafe {
16423            vips_blob_new(
16424                None,
16425                buffer.as_ptr() as _,
16426                buffer.len() as _,
16427            )
16428        };
16429        let mut out_out = VipsImage::from(null_mut());
16430        let vips_op_response = call(
16431            "thumbnail_buffer",
16432            option
16433                .set(
16434                    "buffer",
16435                    &VipsBlob::from(blob),
16436                )
16437                .set(
16438                    "out",
16439                    &mut out_out,
16440                )
16441                .set(
16442                    "width",
16443                    width,
16444                ),
16445        );
16446        unsafe { vips_area_unref(&mut (*blob).area) };
16447        utils::result(
16448            vips_op_response,
16449            out_out,
16450            Error::OperationError("ThumbnailBuffer (vips_thumbnail_buffer) failed".to_string()),
16451        )
16452    }
16453
16454    /// VipsThumbnailImage (thumbnail_image), generate thumbnail from image
16455    /// returns `VipsImage` - Output image
16456    ///
16457    /// width: `i32` -> Size to this width
16458    pub fn thumbnail_image(&self, width: i32) -> Result<VipsImage> {
16459        let mut out_out = VipsImage::from(null_mut());
16460        let vips_op_response = call(
16461            "thumbnail_image",
16462            VOption::new()
16463                .set("in", self)
16464                .set(
16465                    "out",
16466                    &mut out_out,
16467                )
16468                .set(
16469                    "width",
16470                    width,
16471                ),
16472        );
16473
16474        utils::result(
16475            vips_op_response,
16476            out_out,
16477            Error::OperationError("ThumbnailImage (vips_thumbnail_image) failed".to_string()),
16478        )
16479    }
16480
16481    /// VipsThumbnailImage (thumbnail_image), generate thumbnail from image
16482    /// returns `VipsImage` - Output image
16483    ///
16484    /// width: `i32` -> Size to this width
16485    ///
16486    /// <ins>Optional arguments</ins>
16487    ///
16488    /// height: `i32` -> Size to this height
16489    ///
16490    /// size: [`Size`] -> Only upsize, only downsize, or both
16491    ///
16492    /// no_rotate: `bool` -> Don't use orientation tags to rotate image upright
16493    ///
16494    /// crop: [`Interesting`] -> Reduce to fill target rectangle, then crop
16495    ///
16496    /// linear: `bool` -> Reduce in linear light
16497    ///
16498    /// input_profile: `&str` -> Fallback input profile
16499    ///
16500    /// output_profile: `&str` -> Fallback output profile
16501    ///
16502    /// intent: [`Intent`] -> Rendering intent
16503    ///
16504    /// fail_on: [`FailOn`] -> Error level to fail on
16505    pub fn thumbnail_image_with_opts(&self, width: i32, option: VOption) -> Result<VipsImage> {
16506        let mut out_out = VipsImage::from(null_mut());
16507        let vips_op_response = call(
16508            "thumbnail_image",
16509            option
16510                .set("in", self)
16511                .set(
16512                    "out",
16513                    &mut out_out,
16514                )
16515                .set(
16516                    "width",
16517                    width,
16518                ),
16519        );
16520
16521        utils::result(
16522            vips_op_response,
16523            out_out,
16524            Error::OperationError("ThumbnailImage (vips_thumbnail_image) failed".to_string()),
16525        )
16526    }
16527
16528    /// VipsThumbnailSource (thumbnail_source), generate thumbnail from source
16529    /// returns `VipsImage` - Output image
16530    ///
16531    /// source: `&VipsSource` -> Source to load from
16532    ///
16533    /// width: `i32` -> Size to this width
16534    pub fn thumbnail_source(source: &VipsSource, width: i32) -> Result<VipsImage> {
16535        let mut out_out = VipsImage::from(null_mut());
16536        let vips_op_response = call(
16537            "thumbnail_source",
16538            VOption::new()
16539                .set(
16540                    "source",
16541                    source,
16542                )
16543                .set(
16544                    "out",
16545                    &mut out_out,
16546                )
16547                .set(
16548                    "width",
16549                    width,
16550                ),
16551        );
16552
16553        utils::result(
16554            vips_op_response,
16555            out_out,
16556            Error::OperationError("ThumbnailSource (vips_thumbnail_source) failed".to_string()),
16557        )
16558    }
16559
16560    /// VipsThumbnailSource (thumbnail_source), generate thumbnail from source
16561    /// returns `VipsImage` - Output image
16562    ///
16563    /// source: `&VipsSource` -> Source to load from
16564    ///
16565    /// width: `i32` -> Size to this width
16566    ///
16567    /// <ins>Optional arguments</ins>
16568    ///
16569    /// option_string: `&str` -> Options that are passed on to the underlying loader
16570    ///
16571    /// height: `i32` -> Size to this height
16572    ///
16573    /// size: [`Size`] -> Only upsize, only downsize, or both
16574    ///
16575    /// no_rotate: `bool` -> Don't use orientation tags to rotate image upright
16576    ///
16577    /// crop: [`Interesting`] -> Reduce to fill target rectangle, then crop
16578    ///
16579    /// linear: `bool` -> Reduce in linear light
16580    ///
16581    /// input_profile: `&str` -> Fallback input profile
16582    ///
16583    /// output_profile: `&str` -> Fallback output profile
16584    ///
16585    /// intent: [`Intent`] -> Rendering intent
16586    ///
16587    /// fail_on: [`FailOn`] -> Error level to fail on
16588    pub fn thumbnail_source_with_opts(
16589        source: &VipsSource,
16590        width: i32,
16591        option: VOption,
16592    ) -> Result<VipsImage> {
16593        let mut out_out = VipsImage::from(null_mut());
16594        let vips_op_response = call(
16595            "thumbnail_source",
16596            option
16597                .set(
16598                    "source",
16599                    source,
16600                )
16601                .set(
16602                    "out",
16603                    &mut out_out,
16604                )
16605                .set(
16606                    "width",
16607                    width,
16608                ),
16609        );
16610
16611        utils::result(
16612            vips_op_response,
16613            out_out,
16614            Error::OperationError("ThumbnailSource (vips_thumbnail_source) failed".to_string()),
16615        )
16616    }
16617
16618    /// VipsForeignLoadTiffFile (tiffload), load tiff from file (.tif, .tiff), priority=50, is_a, get_flags, get_flags_filename, header, load
16619    /// returns `VipsImage` - Output image
16620    ///
16621    /// filename: `&str` -> Filename to load from
16622    pub fn tiffload(filename: &str) -> Result<VipsImage> {
16623        let mut out_out = VipsImage::from(null_mut());
16624        let vips_op_response = call(
16625            "tiffload",
16626            VOption::new()
16627                .set(
16628                    "filename",
16629                    filename,
16630                )
16631                .set(
16632                    "out",
16633                    &mut out_out,
16634                ),
16635        );
16636
16637        utils::result(
16638            vips_op_response,
16639            out_out,
16640            Error::OperationError("Tiffload (vips_tiffload) failed".to_string()),
16641        )
16642    }
16643
16644    /// VipsForeignLoadTiffFile (tiffload), load tiff from file (.tif, .tiff), priority=50, is_a, get_flags, get_flags_filename, header, load
16645    /// returns `VipsImage` - Output image
16646    ///
16647    /// filename: `&str` -> Filename to load from
16648    ///
16649    /// <ins>Optional arguments</ins>
16650    ///
16651    /// page: `i32` -> First page to load
16652    ///
16653    /// n: `i32` -> Number of pages to load, -1 for all
16654    ///
16655    /// autorotate: `bool` -> Rotate image using orientation tag
16656    ///
16657    /// subifd: `i32` -> Subifd index
16658    ///
16659    /// unlimited: `bool` -> Remove all denial of service limits
16660    ///
16661    /// flags: [`ForeignFlags`] -> Flags for this file
16662    ///
16663    /// memory: `bool` -> Force open via memory
16664    ///
16665    /// access: [`Access`] -> Required access pattern for this file
16666    ///
16667    /// fail_on: [`FailOn`] -> Error level to fail on
16668    ///
16669    /// revalidate: `bool` -> Don't use a cached result for this operation
16670    pub fn tiffload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
16671        let mut out_out = VipsImage::from(null_mut());
16672        let vips_op_response = call(
16673            "tiffload",
16674            option
16675                .set(
16676                    "filename",
16677                    filename,
16678                )
16679                .set(
16680                    "out",
16681                    &mut out_out,
16682                ),
16683        );
16684
16685        utils::result(
16686            vips_op_response,
16687            out_out,
16688            Error::OperationError("Tiffload (vips_tiffload) failed".to_string()),
16689        )
16690    }
16691
16692    /// VipsForeignLoadTiffBuffer (tiffload_buffer), load tiff from buffer, priority=50, is_a_buffer, get_flags, get_flags_filename, header, load
16693    /// returns `VipsImage` - Output image
16694    ///
16695    /// buffer: `&[u8]` -> Buffer to load from
16696    pub fn tiffload_buffer(buffer: &[u8]) -> Result<VipsImage> {
16697        let blob = unsafe {
16698            vips_blob_new(
16699                None,
16700                buffer.as_ptr() as _,
16701                buffer.len() as _,
16702            )
16703        };
16704        let mut out_out = VipsImage::from(null_mut());
16705        let vips_op_response = call(
16706            "tiffload_buffer",
16707            VOption::new()
16708                .set(
16709                    "buffer",
16710                    &VipsBlob::from(blob),
16711                )
16712                .set(
16713                    "out",
16714                    &mut out_out,
16715                ),
16716        );
16717        unsafe { vips_area_unref(&mut (*blob).area) };
16718        utils::result(
16719            vips_op_response,
16720            out_out,
16721            Error::OperationError("TiffloadBuffer (vips_tiffload_buffer) failed".to_string()),
16722        )
16723    }
16724
16725    /// VipsForeignLoadTiffBuffer (tiffload_buffer), load tiff from buffer, priority=50, is_a_buffer, get_flags, get_flags_filename, header, load
16726    /// returns `VipsImage` - Output image
16727    ///
16728    /// buffer: `&[u8]` -> Buffer to load from
16729    ///
16730    /// <ins>Optional arguments</ins>
16731    ///
16732    /// page: `i32` -> First page to load
16733    ///
16734    /// n: `i32` -> Number of pages to load, -1 for all
16735    ///
16736    /// autorotate: `bool` -> Rotate image using orientation tag
16737    ///
16738    /// subifd: `i32` -> Subifd index
16739    ///
16740    /// unlimited: `bool` -> Remove all denial of service limits
16741    ///
16742    /// flags: [`ForeignFlags`] -> Flags for this file
16743    ///
16744    /// memory: `bool` -> Force open via memory
16745    ///
16746    /// access: [`Access`] -> Required access pattern for this file
16747    ///
16748    /// fail_on: [`FailOn`] -> Error level to fail on
16749    ///
16750    /// revalidate: `bool` -> Don't use a cached result for this operation
16751    pub fn tiffload_buffer_with_opts(buffer: &[u8], option: VOption) -> Result<VipsImage> {
16752        let blob = unsafe {
16753            vips_blob_new(
16754                None,
16755                buffer.as_ptr() as _,
16756                buffer.len() as _,
16757            )
16758        };
16759        let mut out_out = VipsImage::from(null_mut());
16760        let vips_op_response = call(
16761            "tiffload_buffer",
16762            option
16763                .set(
16764                    "buffer",
16765                    &VipsBlob::from(blob),
16766                )
16767                .set(
16768                    "out",
16769                    &mut out_out,
16770                ),
16771        );
16772        unsafe { vips_area_unref(&mut (*blob).area) };
16773        utils::result(
16774            vips_op_response,
16775            out_out,
16776            Error::OperationError("TiffloadBuffer (vips_tiffload_buffer) failed".to_string()),
16777        )
16778    }
16779
16780    /// VipsForeignLoadTiffSource (tiffload_source), load tiff from source, priority=50, is_a_source, get_flags, get_flags_filename, header, load
16781    /// returns `VipsImage` - Output image
16782    ///
16783    /// source: `&VipsSource` -> Source to load from
16784    pub fn tiffload_source(source: &VipsSource) -> Result<VipsImage> {
16785        let mut out_out = VipsImage::from(null_mut());
16786        let vips_op_response = call(
16787            "tiffload_source",
16788            VOption::new()
16789                .set(
16790                    "source",
16791                    source,
16792                )
16793                .set(
16794                    "out",
16795                    &mut out_out,
16796                ),
16797        );
16798
16799        utils::result(
16800            vips_op_response,
16801            out_out,
16802            Error::OperationError("TiffloadSource (vips_tiffload_source) failed".to_string()),
16803        )
16804    }
16805
16806    /// VipsForeignLoadTiffSource (tiffload_source), load tiff from source, priority=50, is_a_source, get_flags, get_flags_filename, header, load
16807    /// returns `VipsImage` - Output image
16808    ///
16809    /// source: `&VipsSource` -> Source to load from
16810    ///
16811    /// <ins>Optional arguments</ins>
16812    ///
16813    /// page: `i32` -> First page to load
16814    ///
16815    /// n: `i32` -> Number of pages to load, -1 for all
16816    ///
16817    /// autorotate: `bool` -> Rotate image using orientation tag
16818    ///
16819    /// subifd: `i32` -> Subifd index
16820    ///
16821    /// unlimited: `bool` -> Remove all denial of service limits
16822    ///
16823    /// flags: [`ForeignFlags`] -> Flags for this file
16824    ///
16825    /// memory: `bool` -> Force open via memory
16826    ///
16827    /// access: [`Access`] -> Required access pattern for this file
16828    ///
16829    /// fail_on: [`FailOn`] -> Error level to fail on
16830    ///
16831    /// revalidate: `bool` -> Don't use a cached result for this operation
16832    pub fn tiffload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
16833        let mut out_out = VipsImage::from(null_mut());
16834        let vips_op_response = call(
16835            "tiffload_source",
16836            option
16837                .set(
16838                    "source",
16839                    source,
16840                )
16841                .set(
16842                    "out",
16843                    &mut out_out,
16844                ),
16845        );
16846
16847        utils::result(
16848            vips_op_response,
16849            out_out,
16850            Error::OperationError("TiffloadSource (vips_tiffload_source) failed".to_string()),
16851        )
16852    }
16853
16854    /// VipsForeignSaveTiffFile (tiffsave), save image to tiff file (.tif, .tiff), priority=0,
16855    ///
16856    /// filename: `&str` -> Filename to save to
16857    pub fn tiffsave(&self, filename: &str) -> Result<()> {
16858        let vips_op_response = call(
16859            "tiffsave",
16860            VOption::new()
16861                .set("in", self)
16862                .set(
16863                    "filename",
16864                    filename,
16865                ),
16866        );
16867
16868        utils::result(
16869            vips_op_response,
16870            (),
16871            Error::OperationError("Tiffsave (vips_tiffsave) failed".to_string()),
16872        )
16873    }
16874
16875    /// VipsForeignSaveTiffFile (tiffsave), save image to tiff file (.tif, .tiff), priority=0,
16876    ///
16877    /// filename: `&str` -> Filename to save to
16878    ///
16879    /// <ins>Optional arguments</ins>
16880    ///
16881    /// compression: [`ForeignTiffCompression`] -> Compression for this file
16882    ///
16883    /// Q: `i32` -> Q factor
16884    ///
16885    /// predictor: [`ForeignTiffPredictor`] -> Compression prediction
16886    ///
16887    /// tile: `bool` -> Write a tiled tiff
16888    ///
16889    /// tile_width: `i32` -> Tile width in pixels
16890    ///
16891    /// tile_height: `i32` -> Tile height in pixels
16892    ///
16893    /// pyramid: `bool` -> Write a pyramidal tiff
16894    ///
16895    /// miniswhite: `bool` -> Use 0 for white in 1-bit images
16896    ///
16897    /// bitdepth: `i32` -> Write as a 1, 2, 4 or 8 bit image
16898    ///
16899    /// resunit: [`ForeignTiffResunit`] -> Resolution unit
16900    ///
16901    /// xres: `f64` -> Horizontal resolution in pixels/mm
16902    ///
16903    /// yres: `f64` -> Vertical resolution in pixels/mm
16904    ///
16905    /// bigtiff: `bool` -> Write a bigtiff image
16906    ///
16907    /// properties: `bool` -> Write a properties document to IMAGEDESCRIPTION
16908    ///
16909    /// region_shrink: [`RegionShrink`] -> Method to shrink regions
16910    ///
16911    /// level: `i32` -> Deflate (1-9, default 6) or ZSTD (1-22, default 9) compression level
16912    ///
16913    /// lossless: `bool` -> Enable WEBP lossless mode
16914    ///
16915    /// depth: [`ForeignDzDepth`] -> Pyramid depth
16916    ///
16917    /// subifd: `bool` -> Save pyr layers as sub-IFDs
16918    ///
16919    /// premultiply: `bool` -> Save with premultiplied alpha
16920    ///
16921    /// keep: [`ForeignKeep`] -> Which metadata to retain
16922    ///
16923    /// background: `&[f64]` -> Background value
16924    ///
16925    /// page_height: `i32` -> Set page height for multipage save
16926    ///
16927    /// profile: `&str` -> Filename of ICC profile to embed
16928    pub fn tiffsave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
16929        let vips_op_response = call(
16930            "tiffsave",
16931            option
16932                .set("in", self)
16933                .set(
16934                    "filename",
16935                    filename,
16936                ),
16937        );
16938
16939        utils::result(
16940            vips_op_response,
16941            (),
16942            Error::OperationError("Tiffsave (vips_tiffsave) failed".to_string()),
16943        )
16944    }
16945
16946    /// VipsForeignSaveTiffBuffer (tiffsave_buffer), save image to tiff buffer (.tif, .tiff), priority=0,
16947    /// returns `Vec<u8>` - Buffer to save to
16948    pub fn tiffsave_buffer(&self) -> Result<Vec<u8>> {
16949        let mut buffer_out = VipsBlob::from(null_mut());
16950        let vips_op_response = call(
16951            "tiffsave_buffer",
16952            VOption::new()
16953                .set("in", self)
16954                .set(
16955                    "buffer",
16956                    &mut buffer_out,
16957                ),
16958        );
16959
16960        utils::result(
16961            vips_op_response,
16962            buffer_out.into(),
16963            Error::OperationError("TiffsaveBuffer (vips_tiffsave_buffer) failed".to_string()),
16964        )
16965    }
16966
16967    /// VipsForeignSaveTiffBuffer (tiffsave_buffer), save image to tiff buffer (.tif, .tiff), priority=0,
16968    /// returns `Vec<u8>` - Buffer to save to
16969    ///
16970    /// <ins>Optional arguments</ins>
16971    ///
16972    /// compression: [`ForeignTiffCompression`] -> Compression for this file
16973    ///
16974    /// Q: `i32` -> Q factor
16975    ///
16976    /// predictor: [`ForeignTiffPredictor`] -> Compression prediction
16977    ///
16978    /// tile: `bool` -> Write a tiled tiff
16979    ///
16980    /// tile_width: `i32` -> Tile width in pixels
16981    ///
16982    /// tile_height: `i32` -> Tile height in pixels
16983    ///
16984    /// pyramid: `bool` -> Write a pyramidal tiff
16985    ///
16986    /// miniswhite: `bool` -> Use 0 for white in 1-bit images
16987    ///
16988    /// bitdepth: `i32` -> Write as a 1, 2, 4 or 8 bit image
16989    ///
16990    /// resunit: [`ForeignTiffResunit`] -> Resolution unit
16991    ///
16992    /// xres: `f64` -> Horizontal resolution in pixels/mm
16993    ///
16994    /// yres: `f64` -> Vertical resolution in pixels/mm
16995    ///
16996    /// bigtiff: `bool` -> Write a bigtiff image
16997    ///
16998    /// properties: `bool` -> Write a properties document to IMAGEDESCRIPTION
16999    ///
17000    /// region_shrink: [`RegionShrink`] -> Method to shrink regions
17001    ///
17002    /// level: `i32` -> Deflate (1-9, default 6) or ZSTD (1-22, default 9) compression level
17003    ///
17004    /// lossless: `bool` -> Enable WEBP lossless mode
17005    ///
17006    /// depth: [`ForeignDzDepth`] -> Pyramid depth
17007    ///
17008    /// subifd: `bool` -> Save pyr layers as sub-IFDs
17009    ///
17010    /// premultiply: `bool` -> Save with premultiplied alpha
17011    ///
17012    /// keep: [`ForeignKeep`] -> Which metadata to retain
17013    ///
17014    /// background: `&[f64]` -> Background value
17015    ///
17016    /// page_height: `i32` -> Set page height for multipage save
17017    ///
17018    /// profile: `&str` -> Filename of ICC profile to embed
17019    pub fn tiffsave_buffer_with_opts(&self, option: VOption) -> Result<Vec<u8>> {
17020        let mut buffer_out = VipsBlob::from(null_mut());
17021        let vips_op_response = call(
17022            "tiffsave_buffer",
17023            option
17024                .set("in", self)
17025                .set(
17026                    "buffer",
17027                    &mut buffer_out,
17028                ),
17029        );
17030
17031        utils::result(
17032            vips_op_response,
17033            buffer_out.into(),
17034            Error::OperationError("TiffsaveBuffer (vips_tiffsave_buffer) failed".to_string()),
17035        )
17036    }
17037
17038    /// VipsForeignSaveTiffTarget (tiffsave_target), save image to tiff target (.tif, .tiff), priority=0,
17039    ///
17040    /// target: `&VipsTarget` -> Target to save to
17041    pub fn tiffsave_target(&self, target: &VipsTarget) -> Result<()> {
17042        let vips_op_response = call(
17043            "tiffsave_target",
17044            VOption::new()
17045                .set("in", self)
17046                .set(
17047                    "target",
17048                    target,
17049                ),
17050        );
17051
17052        utils::result(
17053            vips_op_response,
17054            (),
17055            Error::OperationError("TiffsaveTarget (vips_tiffsave_target) failed".to_string()),
17056        )
17057    }
17058
17059    /// VipsForeignSaveTiffTarget (tiffsave_target), save image to tiff target (.tif, .tiff), priority=0,
17060    ///
17061    /// target: `&VipsTarget` -> Target to save to
17062    ///
17063    /// <ins>Optional arguments</ins>
17064    ///
17065    /// compression: [`ForeignTiffCompression`] -> Compression for this file
17066    ///
17067    /// Q: `i32` -> Q factor
17068    ///
17069    /// predictor: [`ForeignTiffPredictor`] -> Compression prediction
17070    ///
17071    /// tile: `bool` -> Write a tiled tiff
17072    ///
17073    /// tile_width: `i32` -> Tile width in pixels
17074    ///
17075    /// tile_height: `i32` -> Tile height in pixels
17076    ///
17077    /// pyramid: `bool` -> Write a pyramidal tiff
17078    ///
17079    /// miniswhite: `bool` -> Use 0 for white in 1-bit images
17080    ///
17081    /// bitdepth: `i32` -> Write as a 1, 2, 4 or 8 bit image
17082    ///
17083    /// resunit: [`ForeignTiffResunit`] -> Resolution unit
17084    ///
17085    /// xres: `f64` -> Horizontal resolution in pixels/mm
17086    ///
17087    /// yres: `f64` -> Vertical resolution in pixels/mm
17088    ///
17089    /// bigtiff: `bool` -> Write a bigtiff image
17090    ///
17091    /// properties: `bool` -> Write a properties document to IMAGEDESCRIPTION
17092    ///
17093    /// region_shrink: [`RegionShrink`] -> Method to shrink regions
17094    ///
17095    /// level: `i32` -> Deflate (1-9, default 6) or ZSTD (1-22, default 9) compression level
17096    ///
17097    /// lossless: `bool` -> Enable WEBP lossless mode
17098    ///
17099    /// depth: [`ForeignDzDepth`] -> Pyramid depth
17100    ///
17101    /// subifd: `bool` -> Save pyr layers as sub-IFDs
17102    ///
17103    /// premultiply: `bool` -> Save with premultiplied alpha
17104    ///
17105    /// keep: [`ForeignKeep`] -> Which metadata to retain
17106    ///
17107    /// background: `&[f64]` -> Background value
17108    ///
17109    /// page_height: `i32` -> Set page height for multipage save
17110    ///
17111    /// profile: `&str` -> Filename of ICC profile to embed
17112    pub fn tiffsave_target_with_opts(&self, target: &VipsTarget, option: VOption) -> Result<()> {
17113        let vips_op_response = call(
17114            "tiffsave_target",
17115            option
17116                .set("in", self)
17117                .set(
17118                    "target",
17119                    target,
17120                ),
17121        );
17122
17123        utils::result(
17124            vips_op_response,
17125            (),
17126            Error::OperationError("TiffsaveTarget (vips_tiffsave_target) failed".to_string()),
17127        )
17128    }
17129
17130    /// VipsTileCache (tilecache), cache an image as a set of tiles
17131    /// returns `VipsImage` - Output image
17132    pub fn tilecache(&self) -> Result<VipsImage> {
17133        let mut out_out = VipsImage::from(null_mut());
17134        let vips_op_response = call(
17135            "tilecache",
17136            VOption::new()
17137                .set("in", self)
17138                .set(
17139                    "out",
17140                    &mut out_out,
17141                ),
17142        );
17143
17144        utils::result(
17145            vips_op_response,
17146            out_out,
17147            Error::OperationError("Tilecache (vips_tilecache) failed".to_string()),
17148        )
17149    }
17150
17151    /// VipsTileCache (tilecache), cache an image as a set of tiles
17152    /// returns `VipsImage` - Output image
17153    ///
17154    /// <ins>Optional arguments</ins>
17155    ///
17156    /// tile_width: `i32` -> Tile width in pixels
17157    ///
17158    /// tile_height: `i32` -> Tile height in pixels
17159    ///
17160    /// max_tiles: `i32` -> Maximum number of tiles to cache
17161    ///
17162    /// access: [`Access`] -> Expected access pattern
17163    ///
17164    /// threaded: `bool` -> Allow threaded access
17165    ///
17166    /// persistent: `bool` -> Keep cache between evaluations
17167    pub fn tilecache_with_opts(&self, option: VOption) -> Result<VipsImage> {
17168        let mut out_out = VipsImage::from(null_mut());
17169        let vips_op_response = call(
17170            "tilecache",
17171            option
17172                .set("in", self)
17173                .set(
17174                    "out",
17175                    &mut out_out,
17176                ),
17177        );
17178
17179        utils::result(
17180            vips_op_response,
17181            out_out,
17182            Error::OperationError("Tilecache (vips_tilecache) failed".to_string()),
17183        )
17184    }
17185
17186    /// VipsTonelut (tonelut), build a look-up table
17187    /// returns `VipsImage` - Output image
17188    pub fn tonelut() -> Result<VipsImage> {
17189        let mut out_out = VipsImage::from(null_mut());
17190        let vips_op_response = call(
17191            "tonelut",
17192            VOption::new().set(
17193                "out",
17194                &mut out_out,
17195            ),
17196        );
17197
17198        utils::result(
17199            vips_op_response,
17200            out_out,
17201            Error::OperationError("Tonelut (vips_tonelut) failed".to_string()),
17202        )
17203    }
17204
17205    /// VipsTonelut (tonelut), build a look-up table
17206    /// returns `VipsImage` - Output image
17207    ///
17208    /// <ins>Optional arguments</ins>
17209    ///
17210    /// in_max: `i32` -> Size of LUT to build
17211    ///
17212    /// out_max: `i32` -> Maximum value in output LUT
17213    ///
17214    /// Lb: `f64` -> Lowest value in output
17215    ///
17216    /// Lw: `f64` -> Highest value in output
17217    ///
17218    /// Ps: `f64` -> Position of shadow
17219    ///
17220    /// Pm: `f64` -> Position of mid-tones
17221    ///
17222    /// Ph: `f64` -> Position of highlights
17223    ///
17224    /// S: `f64` -> Adjust shadows by this much
17225    ///
17226    /// M: `f64` -> Adjust mid-tones by this much
17227    ///
17228    /// H: `f64` -> Adjust highlights by this much
17229    pub fn tonelut_with_opts(option: VOption) -> Result<VipsImage> {
17230        let mut out_out = VipsImage::from(null_mut());
17231        let vips_op_response = call(
17232            "tonelut",
17233            option.set(
17234                "out",
17235                &mut out_out,
17236            ),
17237        );
17238
17239        utils::result(
17240            vips_op_response,
17241            out_out,
17242            Error::OperationError("Tonelut (vips_tonelut) failed".to_string()),
17243        )
17244    }
17245
17246    /// VipsTranspose3d (transpose3d), transpose3d an image
17247    /// returns `VipsImage` - Output image
17248    pub fn transpose3d(&self) -> Result<VipsImage> {
17249        let mut out_out = VipsImage::from(null_mut());
17250        let vips_op_response = call(
17251            "transpose3d",
17252            VOption::new()
17253                .set("in", self)
17254                .set(
17255                    "out",
17256                    &mut out_out,
17257                ),
17258        );
17259
17260        utils::result(
17261            vips_op_response,
17262            out_out,
17263            Error::OperationError("Transpose3D (vips_transpose3d) failed".to_string()),
17264        )
17265    }
17266
17267    /// VipsTranspose3d (transpose3d), transpose3d an image
17268    /// returns `VipsImage` - Output image
17269    ///
17270    /// <ins>Optional arguments</ins>
17271    ///
17272    /// page_height: `i32` -> Height of each input page
17273    pub fn transpose3d_with_opts(&self, option: VOption) -> Result<VipsImage> {
17274        let mut out_out = VipsImage::from(null_mut());
17275        let vips_op_response = call(
17276            "transpose3d",
17277            option
17278                .set("in", self)
17279                .set(
17280                    "out",
17281                    &mut out_out,
17282                ),
17283        );
17284
17285        utils::result(
17286            vips_op_response,
17287            out_out,
17288            Error::OperationError("Transpose3D (vips_transpose3d) failed".to_string()),
17289        )
17290    }
17291
17292    /// VipsUnpremultiply (unpremultiply), unpremultiply image alpha
17293    /// returns `VipsImage` - Output image
17294    pub fn unpremultiply(&self) -> Result<VipsImage> {
17295        let mut out_out = VipsImage::from(null_mut());
17296        let vips_op_response = call(
17297            "unpremultiply",
17298            VOption::new()
17299                .set("in", self)
17300                .set(
17301                    "out",
17302                    &mut out_out,
17303                ),
17304        );
17305
17306        utils::result(
17307            vips_op_response,
17308            out_out,
17309            Error::OperationError("Unpremultiply (vips_unpremultiply) failed".to_string()),
17310        )
17311    }
17312
17313    /// VipsUnpremultiply (unpremultiply), unpremultiply image alpha
17314    /// returns `VipsImage` - Output image
17315    ///
17316    /// <ins>Optional arguments</ins>
17317    ///
17318    /// max_alpha: `f64` -> Maximum value of alpha channel
17319    ///
17320    /// alpha_band: `i32` -> Unpremultiply with this alpha
17321    pub fn unpremultiply_with_opts(&self, option: VOption) -> Result<VipsImage> {
17322        let mut out_out = VipsImage::from(null_mut());
17323        let vips_op_response = call(
17324            "unpremultiply",
17325            option
17326                .set("in", self)
17327                .set(
17328                    "out",
17329                    &mut out_out,
17330                ),
17331        );
17332
17333        utils::result(
17334            vips_op_response,
17335            out_out,
17336            Error::OperationError("Unpremultiply (vips_unpremultiply) failed".to_string()),
17337        )
17338    }
17339
17340    /// VipsForeignLoadVipsFile (vipsload), load vips from file (.v, .vips), priority=200, untrusted, is_a, get_flags, get_flags_filename, header
17341    /// returns `VipsImage` - Output image
17342    ///
17343    /// filename: `&str` -> Filename to load from
17344    pub fn vipsload(filename: &str) -> Result<VipsImage> {
17345        let mut out_out = VipsImage::from(null_mut());
17346        let vips_op_response = call(
17347            "vipsload",
17348            VOption::new()
17349                .set(
17350                    "filename",
17351                    filename,
17352                )
17353                .set(
17354                    "out",
17355                    &mut out_out,
17356                ),
17357        );
17358
17359        utils::result(
17360            vips_op_response,
17361            out_out,
17362            Error::OperationError("Vipsload (vips_vipsload) failed".to_string()),
17363        )
17364    }
17365
17366    /// VipsForeignLoadVipsFile (vipsload), load vips from file (.v, .vips), priority=200, untrusted, is_a, get_flags, get_flags_filename, header
17367    /// returns `VipsImage` - Output image
17368    ///
17369    /// filename: `&str` -> Filename to load from
17370    ///
17371    /// <ins>Optional arguments</ins>
17372    ///
17373    /// flags: [`ForeignFlags`] -> Flags for this file
17374    ///
17375    /// memory: `bool` -> Force open via memory
17376    ///
17377    /// access: [`Access`] -> Required access pattern for this file
17378    ///
17379    /// fail_on: [`FailOn`] -> Error level to fail on
17380    ///
17381    /// revalidate: `bool` -> Don't use a cached result for this operation
17382    pub fn vipsload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
17383        let mut out_out = VipsImage::from(null_mut());
17384        let vips_op_response = call(
17385            "vipsload",
17386            option
17387                .set(
17388                    "filename",
17389                    filename,
17390                )
17391                .set(
17392                    "out",
17393                    &mut out_out,
17394                ),
17395        );
17396
17397        utils::result(
17398            vips_op_response,
17399            out_out,
17400            Error::OperationError("Vipsload (vips_vipsload) failed".to_string()),
17401        )
17402    }
17403
17404    /// VipsForeignLoadVipsSource (vipsload_source), load vips from source, priority=200, untrusted, is_a_source, get_flags, get_flags_filename, header
17405    /// returns `VipsImage` - Output image
17406    ///
17407    /// source: `&VipsSource` -> Source to load from
17408    pub fn vipsload_source(source: &VipsSource) -> Result<VipsImage> {
17409        let mut out_out = VipsImage::from(null_mut());
17410        let vips_op_response = call(
17411            "vipsload_source",
17412            VOption::new()
17413                .set(
17414                    "source",
17415                    source,
17416                )
17417                .set(
17418                    "out",
17419                    &mut out_out,
17420                ),
17421        );
17422
17423        utils::result(
17424            vips_op_response,
17425            out_out,
17426            Error::OperationError("VipsloadSource (vips_vipsload_source) failed".to_string()),
17427        )
17428    }
17429
17430    /// VipsForeignLoadVipsSource (vipsload_source), load vips from source, priority=200, untrusted, is_a_source, get_flags, get_flags_filename, header
17431    /// returns `VipsImage` - Output image
17432    ///
17433    /// source: `&VipsSource` -> Source to load from
17434    ///
17435    /// <ins>Optional arguments</ins>
17436    ///
17437    /// flags: [`ForeignFlags`] -> Flags for this file
17438    ///
17439    /// memory: `bool` -> Force open via memory
17440    ///
17441    /// access: [`Access`] -> Required access pattern for this file
17442    ///
17443    /// fail_on: [`FailOn`] -> Error level to fail on
17444    ///
17445    /// revalidate: `bool` -> Don't use a cached result for this operation
17446    pub fn vipsload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
17447        let mut out_out = VipsImage::from(null_mut());
17448        let vips_op_response = call(
17449            "vipsload_source",
17450            option
17451                .set(
17452                    "source",
17453                    source,
17454                )
17455                .set(
17456                    "out",
17457                    &mut out_out,
17458                ),
17459        );
17460
17461        utils::result(
17462            vips_op_response,
17463            out_out,
17464            Error::OperationError("VipsloadSource (vips_vipsload_source) failed".to_string()),
17465        )
17466    }
17467
17468    /// VipsForeignSaveVipsFile (vipssave), save image to file in vips format (.v, .vips), priority=0,
17469    ///
17470    /// filename: `&str` -> Filename to save to
17471    pub fn vipssave(&self, filename: &str) -> Result<()> {
17472        let vips_op_response = call(
17473            "vipssave",
17474            VOption::new()
17475                .set("in", self)
17476                .set(
17477                    "filename",
17478                    filename,
17479                ),
17480        );
17481
17482        utils::result(
17483            vips_op_response,
17484            (),
17485            Error::OperationError("Vipssave (vips_vipssave) failed".to_string()),
17486        )
17487    }
17488
17489    /// VipsForeignSaveVipsFile (vipssave), save image to file in vips format (.v, .vips), priority=0,
17490    ///
17491    /// filename: `&str` -> Filename to save to
17492    ///
17493    /// <ins>Optional arguments</ins>
17494    ///
17495    /// keep: [`ForeignKeep`] -> Which metadata to retain
17496    ///
17497    /// background: `&[f64]` -> Background value
17498    ///
17499    /// page_height: `i32` -> Set page height for multipage save
17500    ///
17501    /// profile: `&str` -> Filename of ICC profile to embed
17502    pub fn vipssave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
17503        let vips_op_response = call(
17504            "vipssave",
17505            option
17506                .set("in", self)
17507                .set(
17508                    "filename",
17509                    filename,
17510                ),
17511        );
17512
17513        utils::result(
17514            vips_op_response,
17515            (),
17516            Error::OperationError("Vipssave (vips_vipssave) failed".to_string()),
17517        )
17518    }
17519
17520    /// VipsForeignSaveVipsTarget (vipssave_target), save image to target in vips format (.v, .vips), priority=0,
17521    ///
17522    /// target: `&VipsTarget` -> Target to save to
17523    pub fn vipssave_target(&self, target: &VipsTarget) -> Result<()> {
17524        let vips_op_response = call(
17525            "vipssave_target",
17526            VOption::new()
17527                .set("in", self)
17528                .set(
17529                    "target",
17530                    target,
17531                ),
17532        );
17533
17534        utils::result(
17535            vips_op_response,
17536            (),
17537            Error::OperationError("VipssaveTarget (vips_vipssave_target) failed".to_string()),
17538        )
17539    }
17540
17541    /// VipsForeignSaveVipsTarget (vipssave_target), save image to target in vips format (.v, .vips), priority=0,
17542    ///
17543    /// target: `&VipsTarget` -> Target to save to
17544    ///
17545    /// <ins>Optional arguments</ins>
17546    ///
17547    /// keep: [`ForeignKeep`] -> Which metadata to retain
17548    ///
17549    /// background: `&[f64]` -> Background value
17550    ///
17551    /// page_height: `i32` -> Set page height for multipage save
17552    ///
17553    /// profile: `&str` -> Filename of ICC profile to embed
17554    pub fn vipssave_target_with_opts(&self, target: &VipsTarget, option: VOption) -> Result<()> {
17555        let vips_op_response = call(
17556            "vipssave_target",
17557            option
17558                .set("in", self)
17559                .set(
17560                    "target",
17561                    target,
17562                ),
17563        );
17564
17565        utils::result(
17566            vips_op_response,
17567            (),
17568            Error::OperationError("VipssaveTarget (vips_vipssave_target) failed".to_string()),
17569        )
17570    }
17571
17572    /// VipsForeignLoadWebpFile (webpload), load webp from file (.webp), priority=200, is_a, get_flags, get_flags_filename, header, load
17573    /// returns `VipsImage` - Output image
17574    ///
17575    /// filename: `&str` -> Filename to load from
17576    pub fn webpload(filename: &str) -> Result<VipsImage> {
17577        let mut out_out = VipsImage::from(null_mut());
17578        let vips_op_response = call(
17579            "webpload",
17580            VOption::new()
17581                .set(
17582                    "filename",
17583                    filename,
17584                )
17585                .set(
17586                    "out",
17587                    &mut out_out,
17588                ),
17589        );
17590
17591        utils::result(
17592            vips_op_response,
17593            out_out,
17594            Error::OperationError("Webpload (vips_webpload) failed".to_string()),
17595        )
17596    }
17597
17598    /// VipsForeignLoadWebpFile (webpload), load webp from file (.webp), priority=200, is_a, get_flags, get_flags_filename, header, load
17599    /// returns `VipsImage` - Output image
17600    ///
17601    /// filename: `&str` -> Filename to load from
17602    ///
17603    /// <ins>Optional arguments</ins>
17604    ///
17605    /// page: `i32` -> First page to load
17606    ///
17607    /// n: `i32` -> Number of pages to load, -1 for all
17608    ///
17609    /// scale: `f64` -> Factor to scale by
17610    ///
17611    /// flags: [`ForeignFlags`] -> Flags for this file
17612    ///
17613    /// memory: `bool` -> Force open via memory
17614    ///
17615    /// access: [`Access`] -> Required access pattern for this file
17616    ///
17617    /// fail_on: [`FailOn`] -> Error level to fail on
17618    ///
17619    /// revalidate: `bool` -> Don't use a cached result for this operation
17620    pub fn webpload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
17621        let mut out_out = VipsImage::from(null_mut());
17622        let vips_op_response = call(
17623            "webpload",
17624            option
17625                .set(
17626                    "filename",
17627                    filename,
17628                )
17629                .set(
17630                    "out",
17631                    &mut out_out,
17632                ),
17633        );
17634
17635        utils::result(
17636            vips_op_response,
17637            out_out,
17638            Error::OperationError("Webpload (vips_webpload) failed".to_string()),
17639        )
17640    }
17641
17642    /// VipsForeignLoadWebpBuffer (webpload_buffer), load webp from buffer, priority=200, is_a_buffer, get_flags, get_flags_filename, header, load
17643    /// returns `VipsImage` - Output image
17644    ///
17645    /// buffer: `&[u8]` -> Buffer to load from
17646    pub fn webpload_buffer(buffer: &[u8]) -> Result<VipsImage> {
17647        let blob = unsafe {
17648            vips_blob_new(
17649                None,
17650                buffer.as_ptr() as _,
17651                buffer.len() as _,
17652            )
17653        };
17654        let mut out_out = VipsImage::from(null_mut());
17655        let vips_op_response = call(
17656            "webpload_buffer",
17657            VOption::new()
17658                .set(
17659                    "buffer",
17660                    &VipsBlob::from(blob),
17661                )
17662                .set(
17663                    "out",
17664                    &mut out_out,
17665                ),
17666        );
17667        unsafe { vips_area_unref(&mut (*blob).area) };
17668        utils::result(
17669            vips_op_response,
17670            out_out,
17671            Error::OperationError("WebploadBuffer (vips_webpload_buffer) failed".to_string()),
17672        )
17673    }
17674
17675    /// VipsForeignLoadWebpBuffer (webpload_buffer), load webp from buffer, priority=200, is_a_buffer, get_flags, get_flags_filename, header, load
17676    /// returns `VipsImage` - Output image
17677    ///
17678    /// buffer: `&[u8]` -> Buffer to load from
17679    ///
17680    /// <ins>Optional arguments</ins>
17681    ///
17682    /// page: `i32` -> First page to load
17683    ///
17684    /// n: `i32` -> Number of pages to load, -1 for all
17685    ///
17686    /// scale: `f64` -> Factor to scale by
17687    ///
17688    /// flags: [`ForeignFlags`] -> Flags for this file
17689    ///
17690    /// memory: `bool` -> Force open via memory
17691    ///
17692    /// access: [`Access`] -> Required access pattern for this file
17693    ///
17694    /// fail_on: [`FailOn`] -> Error level to fail on
17695    ///
17696    /// revalidate: `bool` -> Don't use a cached result for this operation
17697    pub fn webpload_buffer_with_opts(buffer: &[u8], option: VOption) -> Result<VipsImage> {
17698        let blob = unsafe {
17699            vips_blob_new(
17700                None,
17701                buffer.as_ptr() as _,
17702                buffer.len() as _,
17703            )
17704        };
17705        let mut out_out = VipsImage::from(null_mut());
17706        let vips_op_response = call(
17707            "webpload_buffer",
17708            option
17709                .set(
17710                    "buffer",
17711                    &VipsBlob::from(blob),
17712                )
17713                .set(
17714                    "out",
17715                    &mut out_out,
17716                ),
17717        );
17718        unsafe { vips_area_unref(&mut (*blob).area) };
17719        utils::result(
17720            vips_op_response,
17721            out_out,
17722            Error::OperationError("WebploadBuffer (vips_webpload_buffer) failed".to_string()),
17723        )
17724    }
17725
17726    /// VipsForeignLoadWebpSource (webpload_source), load webp from source, priority=200, is_a_source, get_flags, get_flags_filename, header, load
17727    /// returns `VipsImage` - Output image
17728    ///
17729    /// source: `&VipsSource` -> Source to load from
17730    pub fn webpload_source(source: &VipsSource) -> Result<VipsImage> {
17731        let mut out_out = VipsImage::from(null_mut());
17732        let vips_op_response = call(
17733            "webpload_source",
17734            VOption::new()
17735                .set(
17736                    "source",
17737                    source,
17738                )
17739                .set(
17740                    "out",
17741                    &mut out_out,
17742                ),
17743        );
17744
17745        utils::result(
17746            vips_op_response,
17747            out_out,
17748            Error::OperationError("WebploadSource (vips_webpload_source) failed".to_string()),
17749        )
17750    }
17751
17752    /// VipsForeignLoadWebpSource (webpload_source), load webp from source, priority=200, is_a_source, get_flags, get_flags_filename, header, load
17753    /// returns `VipsImage` - Output image
17754    ///
17755    /// source: `&VipsSource` -> Source to load from
17756    ///
17757    /// <ins>Optional arguments</ins>
17758    ///
17759    /// page: `i32` -> First page to load
17760    ///
17761    /// n: `i32` -> Number of pages to load, -1 for all
17762    ///
17763    /// scale: `f64` -> Factor to scale by
17764    ///
17765    /// flags: [`ForeignFlags`] -> Flags for this file
17766    ///
17767    /// memory: `bool` -> Force open via memory
17768    ///
17769    /// access: [`Access`] -> Required access pattern for this file
17770    ///
17771    /// fail_on: [`FailOn`] -> Error level to fail on
17772    ///
17773    /// revalidate: `bool` -> Don't use a cached result for this operation
17774    pub fn webpload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
17775        let mut out_out = VipsImage::from(null_mut());
17776        let vips_op_response = call(
17777            "webpload_source",
17778            option
17779                .set(
17780                    "source",
17781                    source,
17782                )
17783                .set(
17784                    "out",
17785                    &mut out_out,
17786                ),
17787        );
17788
17789        utils::result(
17790            vips_op_response,
17791            out_out,
17792            Error::OperationError("WebploadSource (vips_webpload_source) failed".to_string()),
17793        )
17794    }
17795
17796    /// VipsForeignSaveWebpFile (webpsave), save as WebP (.webp), priority=0, rgb alpha
17797    ///
17798    /// filename: `&str` -> Filename to save to
17799    pub fn webpsave(&self, filename: &str) -> Result<()> {
17800        let vips_op_response = call(
17801            "webpsave",
17802            VOption::new()
17803                .set("in", self)
17804                .set(
17805                    "filename",
17806                    filename,
17807                ),
17808        );
17809
17810        utils::result(
17811            vips_op_response,
17812            (),
17813            Error::OperationError("Webpsave (vips_webpsave) failed".to_string()),
17814        )
17815    }
17816
17817    /// VipsForeignSaveWebpFile (webpsave), save as WebP (.webp), priority=0, rgb alpha
17818    ///
17819    /// filename: `&str` -> Filename to save to
17820    ///
17821    /// <ins>Optional arguments</ins>
17822    ///
17823    /// Q: `i32` -> Q factor
17824    ///
17825    /// lossless: `bool` -> Enable lossless compression
17826    ///
17827    /// preset: [`ForeignWebpPreset`] -> Preset for lossy compression
17828    ///
17829    /// smart_subsample: `bool` -> Enable high quality chroma subsampling
17830    ///
17831    /// near_lossless: `bool` -> Enable preprocessing in lossless mode (uses Q)
17832    ///
17833    /// alpha_q: `i32` -> Change alpha plane fidelity for lossy compression
17834    ///
17835    /// min_size: `bool` -> Optimise for minimum size
17836    ///
17837    /// kmin: `i32` -> Minimum number of frames between key frames
17838    ///
17839    /// kmax: `i32` -> Maximum number of frames between key frames
17840    ///
17841    /// effort: `i32` -> Level of CPU effort to reduce file size
17842    ///
17843    /// target_size: `i32` -> Desired target size in bytes
17844    ///
17845    /// mixed: `bool` -> Allow mixed encoding (might reduce file size)
17846    ///
17847    /// smart_deblock: `bool` -> Enable auto-adjusting of the deblocking filter
17848    ///
17849    /// passes: `i32` -> Number of entropy-analysis passes (in [1..10])
17850    ///
17851    /// keep: [`ForeignKeep`] -> Which metadata to retain
17852    ///
17853    /// background: `&[f64]` -> Background value
17854    ///
17855    /// page_height: `i32` -> Set page height for multipage save
17856    ///
17857    /// profile: `&str` -> Filename of ICC profile to embed
17858    pub fn webpsave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
17859        let vips_op_response = call(
17860            "webpsave",
17861            option
17862                .set("in", self)
17863                .set(
17864                    "filename",
17865                    filename,
17866                ),
17867        );
17868
17869        utils::result(
17870            vips_op_response,
17871            (),
17872            Error::OperationError("Webpsave (vips_webpsave) failed".to_string()),
17873        )
17874    }
17875
17876    /// VipsForeignSaveWebpBuffer (webpsave_buffer), save as WebP (.webp), priority=0, rgb alpha
17877    /// returns `Vec<u8>` - Buffer to save to
17878    pub fn webpsave_buffer(&self) -> Result<Vec<u8>> {
17879        let mut buffer_out = VipsBlob::from(null_mut());
17880        let vips_op_response = call(
17881            "webpsave_buffer",
17882            VOption::new()
17883                .set("in", self)
17884                .set(
17885                    "buffer",
17886                    &mut buffer_out,
17887                ),
17888        );
17889
17890        utils::result(
17891            vips_op_response,
17892            buffer_out.into(),
17893            Error::OperationError("WebpsaveBuffer (vips_webpsave_buffer) failed".to_string()),
17894        )
17895    }
17896
17897    /// VipsForeignSaveWebpBuffer (webpsave_buffer), save as WebP (.webp), priority=0, rgb alpha
17898    /// returns `Vec<u8>` - Buffer to save to
17899    ///
17900    /// <ins>Optional arguments</ins>
17901    ///
17902    /// Q: `i32` -> Q factor
17903    ///
17904    /// lossless: `bool` -> Enable lossless compression
17905    ///
17906    /// preset: [`ForeignWebpPreset`] -> Preset for lossy compression
17907    ///
17908    /// smart_subsample: `bool` -> Enable high quality chroma subsampling
17909    ///
17910    /// near_lossless: `bool` -> Enable preprocessing in lossless mode (uses Q)
17911    ///
17912    /// alpha_q: `i32` -> Change alpha plane fidelity for lossy compression
17913    ///
17914    /// min_size: `bool` -> Optimise for minimum size
17915    ///
17916    /// kmin: `i32` -> Minimum number of frames between key frames
17917    ///
17918    /// kmax: `i32` -> Maximum number of frames between key frames
17919    ///
17920    /// effort: `i32` -> Level of CPU effort to reduce file size
17921    ///
17922    /// target_size: `i32` -> Desired target size in bytes
17923    ///
17924    /// mixed: `bool` -> Allow mixed encoding (might reduce file size)
17925    ///
17926    /// smart_deblock: `bool` -> Enable auto-adjusting of the deblocking filter
17927    ///
17928    /// passes: `i32` -> Number of entropy-analysis passes (in [1..10])
17929    ///
17930    /// keep: [`ForeignKeep`] -> Which metadata to retain
17931    ///
17932    /// background: `&[f64]` -> Background value
17933    ///
17934    /// page_height: `i32` -> Set page height for multipage save
17935    ///
17936    /// profile: `&str` -> Filename of ICC profile to embed
17937    pub fn webpsave_buffer_with_opts(&self, option: VOption) -> Result<Vec<u8>> {
17938        let mut buffer_out = VipsBlob::from(null_mut());
17939        let vips_op_response = call(
17940            "webpsave_buffer",
17941            option
17942                .set("in", self)
17943                .set(
17944                    "buffer",
17945                    &mut buffer_out,
17946                ),
17947        );
17948
17949        utils::result(
17950            vips_op_response,
17951            buffer_out.into(),
17952            Error::OperationError("WebpsaveBuffer (vips_webpsave_buffer) failed".to_string()),
17953        )
17954    }
17955
17956    /// VipsForeignSaveWebpMime (webpsave_mime), save image to webp mime (.webp), priority=0, rgb alpha
17957    pub fn webpsave_mime(&self) -> Result<()> {
17958        let vips_op_response = call(
17959            "webpsave_mime",
17960            VOption::new().set("in", self),
17961        );
17962
17963        utils::result(
17964            vips_op_response,
17965            (),
17966            Error::OperationError("WebpsaveMime (vips_webpsave_mime) failed".to_string()),
17967        )
17968    }
17969
17970    /// VipsForeignSaveWebpMime (webpsave_mime), save image to webp mime (.webp), priority=0, rgb alpha
17971    ///
17972    /// <ins>Optional arguments</ins>
17973    ///
17974    /// Q: `i32` -> Q factor
17975    ///
17976    /// lossless: `bool` -> Enable lossless compression
17977    ///
17978    /// preset: [`ForeignWebpPreset`] -> Preset for lossy compression
17979    ///
17980    /// smart_subsample: `bool` -> Enable high quality chroma subsampling
17981    ///
17982    /// near_lossless: `bool` -> Enable preprocessing in lossless mode (uses Q)
17983    ///
17984    /// alpha_q: `i32` -> Change alpha plane fidelity for lossy compression
17985    ///
17986    /// min_size: `bool` -> Optimise for minimum size
17987    ///
17988    /// kmin: `i32` -> Minimum number of frames between key frames
17989    ///
17990    /// kmax: `i32` -> Maximum number of frames between key frames
17991    ///
17992    /// effort: `i32` -> Level of CPU effort to reduce file size
17993    ///
17994    /// target_size: `i32` -> Desired target size in bytes
17995    ///
17996    /// mixed: `bool` -> Allow mixed encoding (might reduce file size)
17997    ///
17998    /// smart_deblock: `bool` -> Enable auto-adjusting of the deblocking filter
17999    ///
18000    /// passes: `i32` -> Number of entropy-analysis passes (in [1..10])
18001    ///
18002    /// keep: [`ForeignKeep`] -> Which metadata to retain
18003    ///
18004    /// background: `&[f64]` -> Background value
18005    ///
18006    /// page_height: `i32` -> Set page height for multipage save
18007    ///
18008    /// profile: `&str` -> Filename of ICC profile to embed
18009    pub fn webpsave_mime_with_opts(&self, option: VOption) -> Result<()> {
18010        let vips_op_response = call(
18011            "webpsave_mime",
18012            option.set("in", self),
18013        );
18014
18015        utils::result(
18016            vips_op_response,
18017            (),
18018            Error::OperationError("WebpsaveMime (vips_webpsave_mime) failed".to_string()),
18019        )
18020    }
18021
18022    /// VipsForeignSaveWebpTarget (webpsave_target), save as WebP (.webp), priority=0, rgb alpha
18023    ///
18024    /// target: `&VipsTarget` -> Target to save to
18025    pub fn webpsave_target(&self, target: &VipsTarget) -> Result<()> {
18026        let vips_op_response = call(
18027            "webpsave_target",
18028            VOption::new()
18029                .set("in", self)
18030                .set(
18031                    "target",
18032                    target,
18033                ),
18034        );
18035
18036        utils::result(
18037            vips_op_response,
18038            (),
18039            Error::OperationError("WebpsaveTarget (vips_webpsave_target) failed".to_string()),
18040        )
18041    }
18042
18043    /// VipsForeignSaveWebpTarget (webpsave_target), save as WebP (.webp), priority=0, rgb alpha
18044    ///
18045    /// target: `&VipsTarget` -> Target to save to
18046    ///
18047    /// <ins>Optional arguments</ins>
18048    ///
18049    /// Q: `i32` -> Q factor
18050    ///
18051    /// lossless: `bool` -> Enable lossless compression
18052    ///
18053    /// preset: [`ForeignWebpPreset`] -> Preset for lossy compression
18054    ///
18055    /// smart_subsample: `bool` -> Enable high quality chroma subsampling
18056    ///
18057    /// near_lossless: `bool` -> Enable preprocessing in lossless mode (uses Q)
18058    ///
18059    /// alpha_q: `i32` -> Change alpha plane fidelity for lossy compression
18060    ///
18061    /// min_size: `bool` -> Optimise for minimum size
18062    ///
18063    /// kmin: `i32` -> Minimum number of frames between key frames
18064    ///
18065    /// kmax: `i32` -> Maximum number of frames between key frames
18066    ///
18067    /// effort: `i32` -> Level of CPU effort to reduce file size
18068    ///
18069    /// target_size: `i32` -> Desired target size in bytes
18070    ///
18071    /// mixed: `bool` -> Allow mixed encoding (might reduce file size)
18072    ///
18073    /// smart_deblock: `bool` -> Enable auto-adjusting of the deblocking filter
18074    ///
18075    /// passes: `i32` -> Number of entropy-analysis passes (in [1..10])
18076    ///
18077    /// keep: [`ForeignKeep`] -> Which metadata to retain
18078    ///
18079    /// background: `&[f64]` -> Background value
18080    ///
18081    /// page_height: `i32` -> Set page height for multipage save
18082    ///
18083    /// profile: `&str` -> Filename of ICC profile to embed
18084    pub fn webpsave_target_with_opts(&self, target: &VipsTarget, option: VOption) -> Result<()> {
18085        let vips_op_response = call(
18086            "webpsave_target",
18087            option
18088                .set("in", self)
18089                .set(
18090                    "target",
18091                    target,
18092                ),
18093        );
18094
18095        utils::result(
18096            vips_op_response,
18097            (),
18098            Error::OperationError("WebpsaveTarget (vips_webpsave_target) failed".to_string()),
18099        )
18100    }
18101
18102    /// VipsWorley (worley), make a worley noise image
18103    /// returns `VipsImage` - Output image
18104    ///
18105    /// width: `i32` -> Image width in pixels
18106    ///
18107    /// height: `i32` -> Image height in pixels
18108    pub fn worley(width: i32, height: i32) -> Result<VipsImage> {
18109        let mut out_out = VipsImage::from(null_mut());
18110        let vips_op_response = call(
18111            "worley",
18112            VOption::new()
18113                .set(
18114                    "out",
18115                    &mut out_out,
18116                )
18117                .set(
18118                    "width",
18119                    width,
18120                )
18121                .set(
18122                    "height",
18123                    height,
18124                ),
18125        );
18126
18127        utils::result(
18128            vips_op_response,
18129            out_out,
18130            Error::OperationError("Worley (vips_worley) failed".to_string()),
18131        )
18132    }
18133
18134    /// VipsWorley (worley), make a worley noise image
18135    /// returns `VipsImage` - Output image
18136    ///
18137    /// width: `i32` -> Image width in pixels
18138    ///
18139    /// height: `i32` -> Image height in pixels
18140    ///
18141    /// <ins>Optional arguments</ins>
18142    ///
18143    /// cell_size: `i32` -> Size of Worley cells
18144    ///
18145    /// seed: `i32` -> Random number seed
18146    pub fn worley_with_opts(width: i32, height: i32, option: VOption) -> Result<VipsImage> {
18147        let mut out_out = VipsImage::from(null_mut());
18148        let vips_op_response = call(
18149            "worley",
18150            option
18151                .set(
18152                    "out",
18153                    &mut out_out,
18154                )
18155                .set(
18156                    "width",
18157                    width,
18158                )
18159                .set(
18160                    "height",
18161                    height,
18162                ),
18163        );
18164
18165        utils::result(
18166            vips_op_response,
18167            out_out,
18168            Error::OperationError("Worley (vips_worley) failed".to_string()),
18169        )
18170    }
18171
18172    /// VipsWrap (wrap), wrap image origin
18173    /// returns `VipsImage` - Output image
18174    pub fn wrap(&self) -> Result<VipsImage> {
18175        let mut out_out = VipsImage::from(null_mut());
18176        let vips_op_response = call(
18177            "wrap",
18178            VOption::new()
18179                .set("in", self)
18180                .set(
18181                    "out",
18182                    &mut out_out,
18183                ),
18184        );
18185
18186        utils::result(
18187            vips_op_response,
18188            out_out,
18189            Error::OperationError("Wrap (vips_wrap) failed".to_string()),
18190        )
18191    }
18192
18193    /// VipsWrap (wrap), wrap image origin
18194    /// returns `VipsImage` - Output image
18195    ///
18196    /// <ins>Optional arguments</ins>
18197    ///
18198    /// x: `i32` -> Left edge of input in output
18199    ///
18200    /// y: `i32` -> Top edge of input in output
18201    pub fn wrap_with_opts(&self, option: VOption) -> Result<VipsImage> {
18202        let mut out_out = VipsImage::from(null_mut());
18203        let vips_op_response = call(
18204            "wrap",
18205            option
18206                .set("in", self)
18207                .set(
18208                    "out",
18209                    &mut out_out,
18210                ),
18211        );
18212
18213        utils::result(
18214            vips_op_response,
18215            out_out,
18216            Error::OperationError("Wrap (vips_wrap) failed".to_string()),
18217        )
18218    }
18219
18220    /// VipsXyz (xyz), make an image where pixel values are coordinates
18221    /// returns `VipsImage` - Output image
18222    ///
18223    /// width: `i32` -> Image width in pixels
18224    ///
18225    /// height: `i32` -> Image height in pixels
18226    pub fn xyz(width: i32, height: i32) -> Result<VipsImage> {
18227        let mut out_out = VipsImage::from(null_mut());
18228        let vips_op_response = call(
18229            "xyz",
18230            VOption::new()
18231                .set(
18232                    "out",
18233                    &mut out_out,
18234                )
18235                .set(
18236                    "width",
18237                    width,
18238                )
18239                .set(
18240                    "height",
18241                    height,
18242                ),
18243        );
18244
18245        utils::result(
18246            vips_op_response,
18247            out_out,
18248            Error::OperationError("Xyz (vips_xyz) failed".to_string()),
18249        )
18250    }
18251
18252    /// VipsXyz (xyz), make an image where pixel values are coordinates
18253    /// returns `VipsImage` - Output image
18254    ///
18255    /// width: `i32` -> Image width in pixels
18256    ///
18257    /// height: `i32` -> Image height in pixels
18258    ///
18259    /// <ins>Optional arguments</ins>
18260    ///
18261    /// csize: `i32` -> Size of third dimension
18262    ///
18263    /// dsize: `i32` -> Size of fourth dimension
18264    ///
18265    /// esize: `i32` -> Size of fifth dimension
18266    pub fn xyz_with_opts(width: i32, height: i32, option: VOption) -> Result<VipsImage> {
18267        let mut out_out = VipsImage::from(null_mut());
18268        let vips_op_response = call(
18269            "xyz",
18270            option
18271                .set(
18272                    "out",
18273                    &mut out_out,
18274                )
18275                .set(
18276                    "width",
18277                    width,
18278                )
18279                .set(
18280                    "height",
18281                    height,
18282                ),
18283        );
18284
18285        utils::result(
18286            vips_op_response,
18287            out_out,
18288            Error::OperationError("Xyz (vips_xyz) failed".to_string()),
18289        )
18290    }
18291
18292    /// VipsZone (zone), make a zone plate
18293    /// returns `VipsImage` - Output image
18294    ///
18295    /// width: `i32` -> Image width in pixels
18296    ///
18297    /// height: `i32` -> Image height in pixels
18298    pub fn zone(width: i32, height: i32) -> Result<VipsImage> {
18299        let mut out_out = VipsImage::from(null_mut());
18300        let vips_op_response = call(
18301            "zone",
18302            VOption::new()
18303                .set(
18304                    "out",
18305                    &mut out_out,
18306                )
18307                .set(
18308                    "width",
18309                    width,
18310                )
18311                .set(
18312                    "height",
18313                    height,
18314                ),
18315        );
18316
18317        utils::result(
18318            vips_op_response,
18319            out_out,
18320            Error::OperationError("Zone (vips_zone) failed".to_string()),
18321        )
18322    }
18323
18324    /// VipsZone (zone), make a zone plate
18325    /// returns `VipsImage` - Output image
18326    ///
18327    /// width: `i32` -> Image width in pixels
18328    ///
18329    /// height: `i32` -> Image height in pixels
18330    ///
18331    /// <ins>Optional arguments</ins>
18332    ///
18333    /// uchar: `bool` -> Output an unsigned char image
18334    pub fn zone_with_opts(width: i32, height: i32, option: VOption) -> Result<VipsImage> {
18335        let mut out_out = VipsImage::from(null_mut());
18336        let vips_op_response = call(
18337            "zone",
18338            option
18339                .set(
18340                    "out",
18341                    &mut out_out,
18342                )
18343                .set(
18344                    "width",
18345                    width,
18346                )
18347                .set(
18348                    "height",
18349                    height,
18350                ),
18351        );
18352
18353        utils::result(
18354            vips_op_response,
18355            out_out,
18356            Error::OperationError("Zone (vips_zone) failed".to_string()),
18357        )
18358    }
18359
18360    /// VipsZoom (zoom), zoom an image
18361    /// returns `VipsImage` - Output image
18362    ///
18363    /// xfac: `i32` -> Horizontal zoom factor
18364    ///
18365    /// yfac: `i32` -> Vertical zoom factor
18366    pub fn zoom(&self, xfac: i32, yfac: i32) -> Result<VipsImage> {
18367        let mut out_out = VipsImage::from(null_mut());
18368        let vips_op_response = call(
18369            "zoom",
18370            VOption::new()
18371                .set(
18372                    "input",
18373                    self,
18374                )
18375                .set(
18376                    "out",
18377                    &mut out_out,
18378                )
18379                .set(
18380                    "xfac",
18381                    xfac,
18382                )
18383                .set(
18384                    "yfac",
18385                    yfac,
18386                ),
18387        );
18388
18389        utils::result(
18390            vips_op_response,
18391            out_out,
18392            Error::OperationError("Zoom (vips_zoom) failed".to_string()),
18393        )
18394    }
18395
18396    // Alias for operator overload
18397    pub(crate) fn add_image(&self, right: &VipsImage) -> Result<VipsImage> {
18398        self.add(right)
18399    }
18400
18401    /// VipsBandjoin (bandjoin), bandwise join two images
18402    /// returns `VipsImage` - Output image
18403    ///
18404    /// other: `VipsImage` -> Input images
18405    pub fn bandjoin_with(self, other: VipsImage) -> Result<VipsImage> {
18406        Self::bandjoin(&[self, other])
18407    }
18408
18409    /// VipsMedian (median), median filter of the specified size.
18410    pub fn median(&self, size: i32) -> Result<VipsImage> {
18411        self.rank(
18412            size,
18413            size,
18414            (size * size) / 2,
18415        )
18416    }
18417}