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_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 vips_blob = unsafe {
5290            vips_blob_new(
5291                None,
5292                buffer.as_ptr() as _,
5293                buffer.len() as _,
5294            )
5295        };
5296        let blob = VipsBlob::from(vips_blob);
5297        let mut out_out = VipsImage::from(null_mut());
5298        let vips_op_response = call(
5299            "gifload_buffer",
5300            VOption::new()
5301                .set(
5302                    "buffer",
5303                    &blob,
5304                )
5305                .set(
5306                    "out",
5307                    &mut out_out,
5308                ),
5309        );
5310        blob.area_unref();
5311        utils::result(
5312            vips_op_response,
5313            out_out,
5314            Error::OperationError("GifloadBuffer (vips_gifload_buffer) failed".to_string()),
5315        )
5316    }
5317
5318    /// VipsForeignLoadNsgifBuffer (gifload_buffer), load GIF with libnsgif, priority=50, is_a_buffer, get_flags, get_flags_filename, header, load
5319    /// returns `VipsImage` - Output image
5320    ///
5321    /// buffer: `&[u8]` -> Buffer to load from
5322    ///
5323    /// <ins>Optional arguments</ins>
5324    ///
5325    /// n: `i32` -> Number of pages to load, -1 for all
5326    ///
5327    /// page: `i32` -> First page to load
5328    ///
5329    /// flags: [`ForeignFlags`] -> Flags for this file
5330    ///
5331    /// memory: `bool` -> Force open via memory
5332    ///
5333    /// access: [`Access`] -> Required access pattern for this file
5334    ///
5335    /// fail_on: [`FailOn`] -> Error level to fail on
5336    ///
5337    /// revalidate: `bool` -> Don't use a cached result for this operation
5338    pub fn gifload_buffer_with_opts(buffer: &[u8], option: VOption) -> Result<VipsImage> {
5339        let vips_blob = unsafe {
5340            vips_blob_new(
5341                None,
5342                buffer.as_ptr() as _,
5343                buffer.len() as _,
5344            )
5345        };
5346        let blob = VipsBlob::from(vips_blob);
5347        let mut out_out = VipsImage::from(null_mut());
5348        let vips_op_response = call(
5349            "gifload_buffer",
5350            option
5351                .set(
5352                    "buffer",
5353                    &blob,
5354                )
5355                .set(
5356                    "out",
5357                    &mut out_out,
5358                ),
5359        );
5360        blob.area_unref();
5361        utils::result(
5362            vips_op_response,
5363            out_out,
5364            Error::OperationError("GifloadBuffer (vips_gifload_buffer) failed".to_string()),
5365        )
5366    }
5367
5368    /// VipsForeignLoadNsgifSource (gifload_source), load gif from source, priority=50, is_a_source, get_flags, get_flags_filename, header, load
5369    /// returns `VipsImage` - Output image
5370    ///
5371    /// source: `&VipsSource` -> Source to load from
5372    pub fn gifload_source(source: &VipsSource) -> Result<VipsImage> {
5373        let mut out_out = VipsImage::from(null_mut());
5374        let vips_op_response = call(
5375            "gifload_source",
5376            VOption::new()
5377                .set(
5378                    "source",
5379                    source,
5380                )
5381                .set(
5382                    "out",
5383                    &mut out_out,
5384                ),
5385        );
5386
5387        utils::result(
5388            vips_op_response,
5389            out_out,
5390            Error::OperationError("GifloadSource (vips_gifload_source) failed".to_string()),
5391        )
5392    }
5393
5394    /// VipsForeignLoadNsgifSource (gifload_source), load gif from source, priority=50, is_a_source, get_flags, get_flags_filename, header, load
5395    /// returns `VipsImage` - Output image
5396    ///
5397    /// source: `&VipsSource` -> Source to load from
5398    ///
5399    /// <ins>Optional arguments</ins>
5400    ///
5401    /// n: `i32` -> Number of pages to load, -1 for all
5402    ///
5403    /// page: `i32` -> First page to load
5404    ///
5405    /// flags: [`ForeignFlags`] -> Flags for this file
5406    ///
5407    /// memory: `bool` -> Force open via memory
5408    ///
5409    /// access: [`Access`] -> Required access pattern for this file
5410    ///
5411    /// fail_on: [`FailOn`] -> Error level to fail on
5412    ///
5413    /// revalidate: `bool` -> Don't use a cached result for this operation
5414    pub fn gifload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
5415        let mut out_out = VipsImage::from(null_mut());
5416        let vips_op_response = call(
5417            "gifload_source",
5418            option
5419                .set(
5420                    "source",
5421                    source,
5422                )
5423                .set(
5424                    "out",
5425                    &mut out_out,
5426                ),
5427        );
5428
5429        utils::result(
5430            vips_op_response,
5431            out_out,
5432            Error::OperationError("GifloadSource (vips_gifload_source) failed".to_string()),
5433        )
5434    }
5435
5436    /// VipsForeignSaveCgifFile (gifsave), save as gif (.gif), priority=0, rgb alpha
5437    ///
5438    /// filename: `&str` -> Filename to save to
5439    pub fn gifsave(&self, filename: &str) -> Result<()> {
5440        let vips_op_response = call(
5441            "gifsave",
5442            VOption::new()
5443                .set("in", self)
5444                .set(
5445                    "filename",
5446                    filename,
5447                ),
5448        );
5449
5450        utils::result(
5451            vips_op_response,
5452            (),
5453            Error::OperationError("Gifsave (vips_gifsave) failed".to_string()),
5454        )
5455    }
5456
5457    /// VipsForeignSaveCgifFile (gifsave), save as gif (.gif), priority=0, rgb alpha
5458    ///
5459    /// filename: `&str` -> Filename to save to
5460    ///
5461    /// <ins>Optional arguments</ins>
5462    ///
5463    /// dither: `f64` -> Amount of dithering
5464    ///
5465    /// effort: `i32` -> Quantisation effort
5466    ///
5467    /// bitdepth: `i32` -> Number of bits per pixel
5468    ///
5469    /// interframe_maxerror: `f64` -> Maximum inter-frame error for transparency
5470    ///
5471    /// reuse: `bool` -> Reuse palette from input
5472    ///
5473    /// interpalette_maxerror: `f64` -> Maximum inter-palette error for palette reusage
5474    ///
5475    /// interlace: `bool` -> Generate an interlaced (progressive) GIF
5476    ///
5477    /// keep_duplicate_frames: `bool` -> Keep duplicate frames in the output instead of combining them
5478    ///
5479    /// keep: [`ForeignKeep`] -> Which metadata to retain
5480    ///
5481    /// background: `&[f64]` -> Background value
5482    ///
5483    /// page_height: `i32` -> Set page height for multipage save
5484    ///
5485    /// profile: `&str` -> Filename of ICC profile to embed
5486    pub fn gifsave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
5487        let vips_op_response = call(
5488            "gifsave",
5489            option
5490                .set("in", self)
5491                .set(
5492                    "filename",
5493                    filename,
5494                ),
5495        );
5496
5497        utils::result(
5498            vips_op_response,
5499            (),
5500            Error::OperationError("Gifsave (vips_gifsave) failed".to_string()),
5501        )
5502    }
5503
5504    /// VipsForeignSaveCgifBuffer (gifsave_buffer), save as gif (.gif), priority=0, rgb alpha
5505    /// returns `Vec<u8>` - Buffer to save to
5506    pub fn gifsave_buffer(&self) -> Result<Vec<u8>> {
5507        let mut buffer_out = VipsBlob::from(null_mut());
5508        let vips_op_response = call(
5509            "gifsave_buffer",
5510            VOption::new()
5511                .set("in", self)
5512                .set(
5513                    "buffer",
5514                    &mut buffer_out,
5515                ),
5516        );
5517
5518        utils::result(
5519            vips_op_response,
5520            buffer_out.into(),
5521            Error::OperationError("GifsaveBuffer (vips_gifsave_buffer) failed".to_string()),
5522        )
5523    }
5524
5525    /// VipsForeignSaveCgifBuffer (gifsave_buffer), save as gif (.gif), priority=0, rgb alpha
5526    /// returns `Vec<u8>` - Buffer to save to
5527    ///
5528    /// <ins>Optional arguments</ins>
5529    ///
5530    /// dither: `f64` -> Amount of dithering
5531    ///
5532    /// effort: `i32` -> Quantisation effort
5533    ///
5534    /// bitdepth: `i32` -> Number of bits per pixel
5535    ///
5536    /// interframe_maxerror: `f64` -> Maximum inter-frame error for transparency
5537    ///
5538    /// reuse: `bool` -> Reuse palette from input
5539    ///
5540    /// interpalette_maxerror: `f64` -> Maximum inter-palette error for palette reusage
5541    ///
5542    /// interlace: `bool` -> Generate an interlaced (progressive) GIF
5543    ///
5544    /// keep_duplicate_frames: `bool` -> Keep duplicate frames in the output instead of combining them
5545    ///
5546    /// keep: [`ForeignKeep`] -> Which metadata to retain
5547    ///
5548    /// background: `&[f64]` -> Background value
5549    ///
5550    /// page_height: `i32` -> Set page height for multipage save
5551    ///
5552    /// profile: `&str` -> Filename of ICC profile to embed
5553    pub fn gifsave_buffer_with_opts(&self, option: VOption) -> Result<Vec<u8>> {
5554        let mut buffer_out = VipsBlob::from(null_mut());
5555        let vips_op_response = call(
5556            "gifsave_buffer",
5557            option
5558                .set("in", self)
5559                .set(
5560                    "buffer",
5561                    &mut buffer_out,
5562                ),
5563        );
5564
5565        utils::result(
5566            vips_op_response,
5567            buffer_out.into(),
5568            Error::OperationError("GifsaveBuffer (vips_gifsave_buffer) failed".to_string()),
5569        )
5570    }
5571
5572    /// VipsForeignSaveCgifTarget (gifsave_target), save as gif (.gif), priority=0, rgb alpha
5573    ///
5574    /// target: `&VipsTarget` -> Target to save to
5575    pub fn gifsave_target(&self, target: &VipsTarget) -> Result<()> {
5576        let vips_op_response = call(
5577            "gifsave_target",
5578            VOption::new()
5579                .set("in", self)
5580                .set(
5581                    "target",
5582                    target,
5583                ),
5584        );
5585
5586        utils::result(
5587            vips_op_response,
5588            (),
5589            Error::OperationError("GifsaveTarget (vips_gifsave_target) failed".to_string()),
5590        )
5591    }
5592
5593    /// VipsForeignSaveCgifTarget (gifsave_target), save as gif (.gif), priority=0, rgb alpha
5594    ///
5595    /// target: `&VipsTarget` -> Target to save to
5596    ///
5597    /// <ins>Optional arguments</ins>
5598    ///
5599    /// dither: `f64` -> Amount of dithering
5600    ///
5601    /// effort: `i32` -> Quantisation effort
5602    ///
5603    /// bitdepth: `i32` -> Number of bits per pixel
5604    ///
5605    /// interframe_maxerror: `f64` -> Maximum inter-frame error for transparency
5606    ///
5607    /// reuse: `bool` -> Reuse palette from input
5608    ///
5609    /// interpalette_maxerror: `f64` -> Maximum inter-palette error for palette reusage
5610    ///
5611    /// interlace: `bool` -> Generate an interlaced (progressive) GIF
5612    ///
5613    /// keep_duplicate_frames: `bool` -> Keep duplicate frames in the output instead of combining them
5614    ///
5615    /// keep: [`ForeignKeep`] -> Which metadata to retain
5616    ///
5617    /// background: `&[f64]` -> Background value
5618    ///
5619    /// page_height: `i32` -> Set page height for multipage save
5620    ///
5621    /// profile: `&str` -> Filename of ICC profile to embed
5622    pub fn gifsave_target_with_opts(&self, target: &VipsTarget, option: VOption) -> Result<()> {
5623        let vips_op_response = call(
5624            "gifsave_target",
5625            option
5626                .set("in", self)
5627                .set(
5628                    "target",
5629                    target,
5630                ),
5631        );
5632
5633        utils::result(
5634            vips_op_response,
5635            (),
5636            Error::OperationError("GifsaveTarget (vips_gifsave_target) failed".to_string()),
5637        )
5638    }
5639
5640    /// VipsGlobalbalance (globalbalance), global balance an image mosaic
5641    /// returns `VipsImage` - Output image
5642    pub fn globalbalance(&self) -> Result<VipsImage> {
5643        let mut out_out = VipsImage::from(null_mut());
5644        let vips_op_response = call(
5645            "globalbalance",
5646            VOption::new()
5647                .set("in", self)
5648                .set(
5649                    "out",
5650                    &mut out_out,
5651                ),
5652        );
5653
5654        utils::result(
5655            vips_op_response,
5656            out_out,
5657            Error::OperationError("Globalbalance (vips_globalbalance) failed".to_string()),
5658        )
5659    }
5660
5661    /// VipsGlobalbalance (globalbalance), global balance an image mosaic
5662    /// returns `VipsImage` - Output image
5663    ///
5664    /// <ins>Optional arguments</ins>
5665    ///
5666    /// gamma: `f64` -> Image gamma
5667    ///
5668    /// int_output: `bool` -> Integer output
5669    pub fn globalbalance_with_opts(&self, option: VOption) -> Result<VipsImage> {
5670        let mut out_out = VipsImage::from(null_mut());
5671        let vips_op_response = call(
5672            "globalbalance",
5673            option
5674                .set("in", self)
5675                .set(
5676                    "out",
5677                    &mut out_out,
5678                ),
5679        );
5680
5681        utils::result(
5682            vips_op_response,
5683            out_out,
5684            Error::OperationError("Globalbalance (vips_globalbalance) failed".to_string()),
5685        )
5686    }
5687
5688    /// VipsGravity (gravity), place an image within a larger image with a certain gravity
5689    /// returns `VipsImage` - Output image
5690    ///
5691    /// direction: `CompassDirection` -> Direction to place image within width/height
5692    ///
5693    /// width: `i32` -> Image width in pixels
5694    ///
5695    /// height: `i32` -> Image height in pixels
5696    pub fn gravity(
5697        &self,
5698        direction: CompassDirection,
5699        width: i32,
5700        height: i32,
5701    ) -> Result<VipsImage> {
5702        let mut out_out = VipsImage::from(null_mut());
5703        let vips_op_response = call(
5704            "gravity",
5705            VOption::new()
5706                .set("in", self)
5707                .set(
5708                    "out",
5709                    &mut out_out,
5710                )
5711                .set(
5712                    "direction",
5713                    direction as i32,
5714                )
5715                .set(
5716                    "width",
5717                    width,
5718                )
5719                .set(
5720                    "height",
5721                    height,
5722                ),
5723        );
5724
5725        utils::result(
5726            vips_op_response,
5727            out_out,
5728            Error::OperationError("Gravity (vips_gravity) failed".to_string()),
5729        )
5730    }
5731
5732    /// VipsGravity (gravity), place an image within a larger image with a certain gravity
5733    /// returns `VipsImage` - Output image
5734    ///
5735    /// direction: `CompassDirection` -> Direction to place image within width/height
5736    ///
5737    /// width: `i32` -> Image width in pixels
5738    ///
5739    /// height: `i32` -> Image height in pixels
5740    ///
5741    /// <ins>Optional arguments</ins>
5742    ///
5743    /// extend: [`Extend`] -> How to generate the extra pixels
5744    ///
5745    /// background: `&[f64]` -> Color for background pixels
5746    pub fn gravity_with_opts(
5747        &self,
5748        direction: CompassDirection,
5749        width: i32,
5750        height: i32,
5751        option: VOption,
5752    ) -> Result<VipsImage> {
5753        let mut out_out = VipsImage::from(null_mut());
5754        let vips_op_response = call(
5755            "gravity",
5756            option
5757                .set("in", self)
5758                .set(
5759                    "out",
5760                    &mut out_out,
5761                )
5762                .set(
5763                    "direction",
5764                    direction as i32,
5765                )
5766                .set(
5767                    "width",
5768                    width,
5769                )
5770                .set(
5771                    "height",
5772                    height,
5773                ),
5774        );
5775
5776        utils::result(
5777            vips_op_response,
5778            out_out,
5779            Error::OperationError("Gravity (vips_gravity) failed".to_string()),
5780        )
5781    }
5782
5783    /// VipsGrey (grey), make a grey ramp image
5784    /// returns `VipsImage` - Output image
5785    ///
5786    /// width: `i32` -> Image width in pixels
5787    ///
5788    /// height: `i32` -> Image height in pixels
5789    pub fn grey(width: i32, height: i32) -> Result<VipsImage> {
5790        let mut out_out = VipsImage::from(null_mut());
5791        let vips_op_response = call(
5792            "grey",
5793            VOption::new()
5794                .set(
5795                    "out",
5796                    &mut out_out,
5797                )
5798                .set(
5799                    "width",
5800                    width,
5801                )
5802                .set(
5803                    "height",
5804                    height,
5805                ),
5806        );
5807
5808        utils::result(
5809            vips_op_response,
5810            out_out,
5811            Error::OperationError("Grey (vips_grey) failed".to_string()),
5812        )
5813    }
5814
5815    /// VipsGrey (grey), make a grey ramp image
5816    /// returns `VipsImage` - Output image
5817    ///
5818    /// width: `i32` -> Image width in pixels
5819    ///
5820    /// height: `i32` -> Image height in pixels
5821    ///
5822    /// <ins>Optional arguments</ins>
5823    ///
5824    /// uchar: `bool` -> Output an unsigned char image
5825    pub fn grey_with_opts(width: i32, height: i32, option: VOption) -> Result<VipsImage> {
5826        let mut out_out = VipsImage::from(null_mut());
5827        let vips_op_response = call(
5828            "grey",
5829            option
5830                .set(
5831                    "out",
5832                    &mut out_out,
5833                )
5834                .set(
5835                    "width",
5836                    width,
5837                )
5838                .set(
5839                    "height",
5840                    height,
5841                ),
5842        );
5843
5844        utils::result(
5845            vips_op_response,
5846            out_out,
5847            Error::OperationError("Grey (vips_grey) failed".to_string()),
5848        )
5849    }
5850
5851    /// VipsGrid (grid), grid an image
5852    /// returns `VipsImage` - Output image
5853    ///
5854    /// tile_height: `i32` -> Chop into tiles this high
5855    ///
5856    /// across: `i32` -> Number of tiles across
5857    ///
5858    /// down: `i32` -> Number of tiles down
5859    pub fn grid(&self, tile_height: i32, across: i32, down: i32) -> Result<VipsImage> {
5860        let mut out_out = VipsImage::from(null_mut());
5861        let vips_op_response = call(
5862            "grid",
5863            VOption::new()
5864                .set("in", self)
5865                .set(
5866                    "out",
5867                    &mut out_out,
5868                )
5869                .set(
5870                    "tile-height",
5871                    tile_height,
5872                )
5873                .set(
5874                    "across",
5875                    across,
5876                )
5877                .set(
5878                    "down",
5879                    down,
5880                ),
5881        );
5882
5883        utils::result(
5884            vips_op_response,
5885            out_out,
5886            Error::OperationError("Grid (vips_grid) failed".to_string()),
5887        )
5888    }
5889
5890    /// VipsForeignLoadHeifFile (heifload), load a HEIF image (.heic, .heif, .avif), priority=0, is_a, get_flags, header, load
5891    /// returns `VipsImage` - Output image
5892    ///
5893    /// filename: `&str` -> Filename to load from
5894    pub fn heifload(filename: &str) -> Result<VipsImage> {
5895        let mut out_out = VipsImage::from(null_mut());
5896        let vips_op_response = call(
5897            "heifload",
5898            VOption::new()
5899                .set(
5900                    "filename",
5901                    filename,
5902                )
5903                .set(
5904                    "out",
5905                    &mut out_out,
5906                ),
5907        );
5908
5909        utils::result(
5910            vips_op_response,
5911            out_out,
5912            Error::OperationError("Heifload (vips_heifload) failed".to_string()),
5913        )
5914    }
5915
5916    /// VipsForeignLoadHeifFile (heifload), load a HEIF image (.heic, .heif, .avif), priority=0, is_a, get_flags, header, load
5917    /// returns `VipsImage` - Output image
5918    ///
5919    /// filename: `&str` -> Filename to load from
5920    ///
5921    /// <ins>Optional arguments</ins>
5922    ///
5923    /// page: `i32` -> First page to load
5924    ///
5925    /// n: `i32` -> Number of pages to load, -1 for all
5926    ///
5927    /// thumbnail: `bool` -> Fetch thumbnail image
5928    ///
5929    /// unlimited: `bool` -> Remove all denial of service limits
5930    ///
5931    /// flags: [`ForeignFlags`] -> Flags for this file
5932    ///
5933    /// memory: `bool` -> Force open via memory
5934    ///
5935    /// access: [`Access`] -> Required access pattern for this file
5936    ///
5937    /// fail_on: [`FailOn`] -> Error level to fail on
5938    ///
5939    /// revalidate: `bool` -> Don't use a cached result for this operation
5940    pub fn heifload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
5941        let mut out_out = VipsImage::from(null_mut());
5942        let vips_op_response = call(
5943            "heifload",
5944            option
5945                .set(
5946                    "filename",
5947                    filename,
5948                )
5949                .set(
5950                    "out",
5951                    &mut out_out,
5952                ),
5953        );
5954
5955        utils::result(
5956            vips_op_response,
5957            out_out,
5958            Error::OperationError("Heifload (vips_heifload) failed".to_string()),
5959        )
5960    }
5961
5962    /// VipsForeignLoadHeifBuffer (heifload_buffer), load a HEIF image, priority=0, is_a_buffer, get_flags, header, load
5963    /// returns `VipsImage` - Output image
5964    ///
5965    /// buffer: `&[u8]` -> Buffer to load from
5966    pub fn heifload_buffer(buffer: &[u8]) -> Result<VipsImage> {
5967        let vips_blob = unsafe {
5968            vips_blob_new(
5969                None,
5970                buffer.as_ptr() as _,
5971                buffer.len() as _,
5972            )
5973        };
5974        let blob = VipsBlob::from(vips_blob);
5975        let mut out_out = VipsImage::from(null_mut());
5976        let vips_op_response = call(
5977            "heifload_buffer",
5978            VOption::new()
5979                .set(
5980                    "buffer",
5981                    &blob,
5982                )
5983                .set(
5984                    "out",
5985                    &mut out_out,
5986                ),
5987        );
5988        blob.area_unref();
5989        utils::result(
5990            vips_op_response,
5991            out_out,
5992            Error::OperationError("HeifloadBuffer (vips_heifload_buffer) failed".to_string()),
5993        )
5994    }
5995
5996    /// VipsForeignLoadHeifBuffer (heifload_buffer), load a HEIF image, priority=0, is_a_buffer, get_flags, header, load
5997    /// returns `VipsImage` - Output image
5998    ///
5999    /// buffer: `&[u8]` -> Buffer to load from
6000    ///
6001    /// <ins>Optional arguments</ins>
6002    ///
6003    /// page: `i32` -> First page to load
6004    ///
6005    /// n: `i32` -> Number of pages to load, -1 for all
6006    ///
6007    /// thumbnail: `bool` -> Fetch thumbnail image
6008    ///
6009    /// unlimited: `bool` -> Remove all denial of service limits
6010    ///
6011    /// flags: [`ForeignFlags`] -> Flags for this file
6012    ///
6013    /// memory: `bool` -> Force open via memory
6014    ///
6015    /// access: [`Access`] -> Required access pattern for this file
6016    ///
6017    /// fail_on: [`FailOn`] -> Error level to fail on
6018    ///
6019    /// revalidate: `bool` -> Don't use a cached result for this operation
6020    pub fn heifload_buffer_with_opts(buffer: &[u8], option: VOption) -> Result<VipsImage> {
6021        let vips_blob = unsafe {
6022            vips_blob_new(
6023                None,
6024                buffer.as_ptr() as _,
6025                buffer.len() as _,
6026            )
6027        };
6028        let blob = VipsBlob::from(vips_blob);
6029        let mut out_out = VipsImage::from(null_mut());
6030        let vips_op_response = call(
6031            "heifload_buffer",
6032            option
6033                .set(
6034                    "buffer",
6035                    &blob,
6036                )
6037                .set(
6038                    "out",
6039                    &mut out_out,
6040                ),
6041        );
6042        blob.area_unref();
6043        utils::result(
6044            vips_op_response,
6045            out_out,
6046            Error::OperationError("HeifloadBuffer (vips_heifload_buffer) failed".to_string()),
6047        )
6048    }
6049
6050    /// VipsForeignLoadHeifSource (heifload_source), load a HEIF image, priority=0, is_a_source, get_flags, header, load
6051    /// returns `VipsImage` - Output image
6052    ///
6053    /// source: `&VipsSource` -> Source to load from
6054    pub fn heifload_source(source: &VipsSource) -> Result<VipsImage> {
6055        let mut out_out = VipsImage::from(null_mut());
6056        let vips_op_response = call(
6057            "heifload_source",
6058            VOption::new()
6059                .set(
6060                    "source",
6061                    source,
6062                )
6063                .set(
6064                    "out",
6065                    &mut out_out,
6066                ),
6067        );
6068
6069        utils::result(
6070            vips_op_response,
6071            out_out,
6072            Error::OperationError("HeifloadSource (vips_heifload_source) failed".to_string()),
6073        )
6074    }
6075
6076    /// VipsForeignLoadHeifSource (heifload_source), load a HEIF image, priority=0, is_a_source, get_flags, header, load
6077    /// returns `VipsImage` - Output image
6078    ///
6079    /// source: `&VipsSource` -> Source to load from
6080    ///
6081    /// <ins>Optional arguments</ins>
6082    ///
6083    /// page: `i32` -> First page to load
6084    ///
6085    /// n: `i32` -> Number of pages to load, -1 for all
6086    ///
6087    /// thumbnail: `bool` -> Fetch thumbnail image
6088    ///
6089    /// unlimited: `bool` -> Remove all denial of service limits
6090    ///
6091    /// flags: [`ForeignFlags`] -> Flags for this file
6092    ///
6093    /// memory: `bool` -> Force open via memory
6094    ///
6095    /// access: [`Access`] -> Required access pattern for this file
6096    ///
6097    /// fail_on: [`FailOn`] -> Error level to fail on
6098    ///
6099    /// revalidate: `bool` -> Don't use a cached result for this operation
6100    pub fn heifload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
6101        let mut out_out = VipsImage::from(null_mut());
6102        let vips_op_response = call(
6103            "heifload_source",
6104            option
6105                .set(
6106                    "source",
6107                    source,
6108                )
6109                .set(
6110                    "out",
6111                    &mut out_out,
6112                ),
6113        );
6114
6115        utils::result(
6116            vips_op_response,
6117            out_out,
6118            Error::OperationError("HeifloadSource (vips_heifload_source) failed".to_string()),
6119        )
6120    }
6121
6122    /// VipsForeignSaveHeifFile (heifsave), save image in HEIF format (.heic, .heif, .avif), priority=0, rgb alpha
6123    ///
6124    /// filename: `&str` -> Filename to save to
6125    pub fn heifsave(&self, filename: &str) -> Result<()> {
6126        let vips_op_response = call(
6127            "heifsave",
6128            VOption::new()
6129                .set("in", self)
6130                .set(
6131                    "filename",
6132                    filename,
6133                ),
6134        );
6135
6136        utils::result(
6137            vips_op_response,
6138            (),
6139            Error::OperationError("Heifsave (vips_heifsave) failed".to_string()),
6140        )
6141    }
6142
6143    /// VipsForeignSaveHeifFile (heifsave), save image in HEIF format (.heic, .heif, .avif), priority=0, rgb alpha
6144    ///
6145    /// filename: `&str` -> Filename to save to
6146    ///
6147    /// <ins>Optional arguments</ins>
6148    ///
6149    /// Q: `i32` -> Q factor
6150    ///
6151    /// bitdepth: `i32` -> Number of bits per pixel
6152    ///
6153    /// lossless: `bool` -> Enable lossless compression
6154    ///
6155    /// compression: [`ForeignHeifCompression`] -> Compression format
6156    ///
6157    /// effort: `i32` -> CPU effort
6158    ///
6159    /// subsample_mode: [`ForeignSubsample`] -> Select chroma subsample operation mode
6160    ///
6161    /// encoder: [`ForeignHeifEncoder`] -> Select encoder to use
6162    ///
6163    /// keep: [`ForeignKeep`] -> Which metadata to retain
6164    ///
6165    /// background: `&[f64]` -> Background value
6166    ///
6167    /// page_height: `i32` -> Set page height for multipage save
6168    ///
6169    /// profile: `&str` -> Filename of ICC profile to embed
6170    pub fn heifsave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
6171        let vips_op_response = call(
6172            "heifsave",
6173            option
6174                .set("in", self)
6175                .set(
6176                    "filename",
6177                    filename,
6178                ),
6179        );
6180
6181        utils::result(
6182            vips_op_response,
6183            (),
6184            Error::OperationError("Heifsave (vips_heifsave) failed".to_string()),
6185        )
6186    }
6187
6188    /// VipsForeignSaveHeifBuffer (heifsave_buffer), save image in HEIF format (.heic, .heif), priority=0, rgb alpha
6189    /// returns `Vec<u8>` - Buffer to save to
6190    pub fn heifsave_buffer(&self) -> Result<Vec<u8>> {
6191        let mut buffer_out = VipsBlob::from(null_mut());
6192        let vips_op_response = call(
6193            "heifsave_buffer",
6194            VOption::new()
6195                .set("in", self)
6196                .set(
6197                    "buffer",
6198                    &mut buffer_out,
6199                ),
6200        );
6201
6202        utils::result(
6203            vips_op_response,
6204            buffer_out.into(),
6205            Error::OperationError("HeifsaveBuffer (vips_heifsave_buffer) failed".to_string()),
6206        )
6207    }
6208
6209    /// VipsForeignSaveHeifBuffer (heifsave_buffer), save image in HEIF format (.heic, .heif), priority=0, rgb alpha
6210    /// returns `Vec<u8>` - Buffer to save to
6211    ///
6212    /// <ins>Optional arguments</ins>
6213    ///
6214    /// Q: `i32` -> Q factor
6215    ///
6216    /// bitdepth: `i32` -> Number of bits per pixel
6217    ///
6218    /// lossless: `bool` -> Enable lossless compression
6219    ///
6220    /// compression: [`ForeignHeifCompression`] -> Compression format
6221    ///
6222    /// effort: `i32` -> CPU effort
6223    ///
6224    /// subsample_mode: [`ForeignSubsample`] -> Select chroma subsample operation mode
6225    ///
6226    /// encoder: [`ForeignHeifEncoder`] -> Select encoder to use
6227    ///
6228    /// keep: [`ForeignKeep`] -> Which metadata to retain
6229    ///
6230    /// background: `&[f64]` -> Background value
6231    ///
6232    /// page_height: `i32` -> Set page height for multipage save
6233    ///
6234    /// profile: `&str` -> Filename of ICC profile to embed
6235    pub fn heifsave_buffer_with_opts(&self, option: VOption) -> Result<Vec<u8>> {
6236        let mut buffer_out = VipsBlob::from(null_mut());
6237        let vips_op_response = call(
6238            "heifsave_buffer",
6239            option
6240                .set("in", self)
6241                .set(
6242                    "buffer",
6243                    &mut buffer_out,
6244                ),
6245        );
6246
6247        utils::result(
6248            vips_op_response,
6249            buffer_out.into(),
6250            Error::OperationError("HeifsaveBuffer (vips_heifsave_buffer) failed".to_string()),
6251        )
6252    }
6253
6254    /// VipsForeignSaveHeifTarget (heifsave_target), save image in HEIF format (.heic, .heif), priority=0, rgb alpha
6255    ///
6256    /// target: `&VipsTarget` -> Target to save to
6257    pub fn heifsave_target(&self, target: &VipsTarget) -> Result<()> {
6258        let vips_op_response = call(
6259            "heifsave_target",
6260            VOption::new()
6261                .set("in", self)
6262                .set(
6263                    "target",
6264                    target,
6265                ),
6266        );
6267
6268        utils::result(
6269            vips_op_response,
6270            (),
6271            Error::OperationError("HeifsaveTarget (vips_heifsave_target) failed".to_string()),
6272        )
6273    }
6274
6275    /// VipsForeignSaveHeifTarget (heifsave_target), save image in HEIF format (.heic, .heif), priority=0, rgb alpha
6276    ///
6277    /// target: `&VipsTarget` -> Target to save to
6278    ///
6279    /// <ins>Optional arguments</ins>
6280    ///
6281    /// Q: `i32` -> Q factor
6282    ///
6283    /// bitdepth: `i32` -> Number of bits per pixel
6284    ///
6285    /// lossless: `bool` -> Enable lossless compression
6286    ///
6287    /// compression: [`ForeignHeifCompression`] -> Compression format
6288    ///
6289    /// effort: `i32` -> CPU effort
6290    ///
6291    /// subsample_mode: [`ForeignSubsample`] -> Select chroma subsample operation mode
6292    ///
6293    /// encoder: [`ForeignHeifEncoder`] -> Select encoder to use
6294    ///
6295    /// keep: [`ForeignKeep`] -> Which metadata to retain
6296    ///
6297    /// background: `&[f64]` -> Background value
6298    ///
6299    /// page_height: `i32` -> Set page height for multipage save
6300    ///
6301    /// profile: `&str` -> Filename of ICC profile to embed
6302    pub fn heifsave_target_with_opts(&self, target: &VipsTarget, option: VOption) -> Result<()> {
6303        let vips_op_response = call(
6304            "heifsave_target",
6305            option
6306                .set("in", self)
6307                .set(
6308                    "target",
6309                    target,
6310                ),
6311        );
6312
6313        utils::result(
6314            vips_op_response,
6315            (),
6316            Error::OperationError("HeifsaveTarget (vips_heifsave_target) failed".to_string()),
6317        )
6318    }
6319
6320    /// VipsHistCum (hist_cum), form cumulative histogram
6321    /// returns `VipsImage` - Output image
6322    pub fn hist_cum(&self) -> Result<VipsImage> {
6323        let mut out_out = VipsImage::from(null_mut());
6324        let vips_op_response = call(
6325            "hist_cum",
6326            VOption::new()
6327                .set("in", self)
6328                .set(
6329                    "out",
6330                    &mut out_out,
6331                ),
6332        );
6333
6334        utils::result(
6335            vips_op_response,
6336            out_out,
6337            Error::OperationError("HistCum (vips_hist_cum) failed".to_string()),
6338        )
6339    }
6340
6341    /// VipsHistEntropy (hist_entropy), estimate image entropy
6342    /// returns `f64` - Output value
6343    pub fn hist_entropy(&self) -> Result<f64> {
6344        let mut out_out: f64 = 0.0;
6345        let vips_op_response = call(
6346            "hist_entropy",
6347            VOption::new()
6348                .set("in", self)
6349                .set(
6350                    "out",
6351                    &mut out_out,
6352                ),
6353        );
6354
6355        utils::result(
6356            vips_op_response,
6357            out_out,
6358            Error::OperationError("HistEntropy (vips_hist_entropy) failed".to_string()),
6359        )
6360    }
6361
6362    /// VipsHistEqual (hist_equal), histogram equalisation
6363    /// returns `VipsImage` - Output image
6364    pub fn hist_equal(&self) -> Result<VipsImage> {
6365        let mut out_out = VipsImage::from(null_mut());
6366        let vips_op_response = call(
6367            "hist_equal",
6368            VOption::new()
6369                .set("in", self)
6370                .set(
6371                    "out",
6372                    &mut out_out,
6373                ),
6374        );
6375
6376        utils::result(
6377            vips_op_response,
6378            out_out,
6379            Error::OperationError("HistEqual (vips_hist_equal) failed".to_string()),
6380        )
6381    }
6382
6383    /// VipsHistEqual (hist_equal), histogram equalisation
6384    /// returns `VipsImage` - Output image
6385    ///
6386    /// <ins>Optional arguments</ins>
6387    ///
6388    /// band: `i32` -> Equalise with this band
6389    pub fn hist_equal_with_opts(&self, option: VOption) -> Result<VipsImage> {
6390        let mut out_out = VipsImage::from(null_mut());
6391        let vips_op_response = call(
6392            "hist_equal",
6393            option
6394                .set("in", self)
6395                .set(
6396                    "out",
6397                    &mut out_out,
6398                ),
6399        );
6400
6401        utils::result(
6402            vips_op_response,
6403            out_out,
6404            Error::OperationError("HistEqual (vips_hist_equal) failed".to_string()),
6405        )
6406    }
6407
6408    /// VipsHistFind (hist_find), find image histogram
6409    /// returns `VipsImage` - Output histogram
6410    pub fn hist_find(&self) -> Result<VipsImage> {
6411        let mut out_out = VipsImage::from(null_mut());
6412        let vips_op_response = call(
6413            "hist_find",
6414            VOption::new()
6415                .set("in", self)
6416                .set(
6417                    "out",
6418                    &mut out_out,
6419                ),
6420        );
6421
6422        utils::result(
6423            vips_op_response,
6424            out_out,
6425            Error::OperationError("HistFind (vips_hist_find) failed".to_string()),
6426        )
6427    }
6428
6429    /// VipsHistFind (hist_find), find image histogram
6430    /// returns `VipsImage` - Output histogram
6431    ///
6432    /// <ins>Optional arguments</ins>
6433    ///
6434    /// band: `i32` -> Find histogram of band
6435    pub fn hist_find_with_opts(&self, option: VOption) -> Result<VipsImage> {
6436        let mut out_out = VipsImage::from(null_mut());
6437        let vips_op_response = call(
6438            "hist_find",
6439            option
6440                .set("in", self)
6441                .set(
6442                    "out",
6443                    &mut out_out,
6444                ),
6445        );
6446
6447        utils::result(
6448            vips_op_response,
6449            out_out,
6450            Error::OperationError("HistFind (vips_hist_find) failed".to_string()),
6451        )
6452    }
6453
6454    /// VipsHistFindIndexed (hist_find_indexed), find indexed image histogram
6455    /// returns `VipsImage` - Output histogram
6456    ///
6457    /// index: `&VipsImage` -> Index image
6458    pub fn hist_find_indexed(&self, index: &VipsImage) -> Result<VipsImage> {
6459        let mut out_out = VipsImage::from(null_mut());
6460        let vips_op_response = call(
6461            "hist_find_indexed",
6462            VOption::new()
6463                .set("in", self)
6464                .set(
6465                    "index",
6466                    index,
6467                )
6468                .set(
6469                    "out",
6470                    &mut out_out,
6471                ),
6472        );
6473
6474        utils::result(
6475            vips_op_response,
6476            out_out,
6477            Error::OperationError("HistFindIndexed (vips_hist_find_indexed) failed".to_string()),
6478        )
6479    }
6480
6481    /// VipsHistFindIndexed (hist_find_indexed), find indexed image histogram
6482    /// returns `VipsImage` - Output histogram
6483    ///
6484    /// index: `&VipsImage` -> Index image
6485    ///
6486    /// <ins>Optional arguments</ins>
6487    ///
6488    /// combine: [`Combine`] -> Combine bins like this
6489    pub fn hist_find_indexed_with_opts(
6490        &self,
6491        index: &VipsImage,
6492        option: VOption,
6493    ) -> Result<VipsImage> {
6494        let mut out_out = VipsImage::from(null_mut());
6495        let vips_op_response = call(
6496            "hist_find_indexed",
6497            option
6498                .set("in", self)
6499                .set(
6500                    "index",
6501                    index,
6502                )
6503                .set(
6504                    "out",
6505                    &mut out_out,
6506                ),
6507        );
6508
6509        utils::result(
6510            vips_op_response,
6511            out_out,
6512            Error::OperationError("HistFindIndexed (vips_hist_find_indexed) failed".to_string()),
6513        )
6514    }
6515
6516    /// VipsHistFindNDim (hist_find_ndim), find n-dimensional image histogram
6517    /// returns `VipsImage` - Output histogram
6518    pub fn hist_find_ndim(&self) -> Result<VipsImage> {
6519        let mut out_out = VipsImage::from(null_mut());
6520        let vips_op_response = call(
6521            "hist_find_ndim",
6522            VOption::new()
6523                .set("in", self)
6524                .set(
6525                    "out",
6526                    &mut out_out,
6527                ),
6528        );
6529
6530        utils::result(
6531            vips_op_response,
6532            out_out,
6533            Error::OperationError("HistFindNdim (vips_hist_find_ndim) failed".to_string()),
6534        )
6535    }
6536
6537    /// VipsHistFindNDim (hist_find_ndim), find n-dimensional image histogram
6538    /// returns `VipsImage` - Output histogram
6539    ///
6540    /// <ins>Optional arguments</ins>
6541    ///
6542    /// bins: `i32` -> Number of bins in each dimension
6543    pub fn hist_find_ndim_with_opts(&self, option: VOption) -> Result<VipsImage> {
6544        let mut out_out = VipsImage::from(null_mut());
6545        let vips_op_response = call(
6546            "hist_find_ndim",
6547            option
6548                .set("in", self)
6549                .set(
6550                    "out",
6551                    &mut out_out,
6552                ),
6553        );
6554
6555        utils::result(
6556            vips_op_response,
6557            out_out,
6558            Error::OperationError("HistFindNdim (vips_hist_find_ndim) failed".to_string()),
6559        )
6560    }
6561
6562    /// VipsHistIsmonotonic (hist_ismonotonic), test for monotonicity
6563    /// returns `bool` - true if in is monotonic
6564    pub fn hist_ismonotonic(&self) -> Result<bool> {
6565        let mut monotonic_out: bool = false;
6566        let vips_op_response = call(
6567            "hist_ismonotonic",
6568            VOption::new()
6569                .set("in", self)
6570                .set(
6571                    "monotonic",
6572                    &mut monotonic_out,
6573                ),
6574        );
6575
6576        utils::result(
6577            vips_op_response,
6578            monotonic_out,
6579            Error::OperationError("HistIsmonotonic (vips_hist_ismonotonic) failed".to_string()),
6580        )
6581    }
6582
6583    /// VipsHistLocal (hist_local), local histogram equalisation
6584    /// returns `VipsImage` - Output image
6585    ///
6586    /// width: `i32` -> Window width in pixels
6587    ///
6588    /// height: `i32` -> Window height in pixels
6589    pub fn hist_local(&self, width: i32, height: i32) -> Result<VipsImage> {
6590        let mut out_out = VipsImage::from(null_mut());
6591        let vips_op_response = call(
6592            "hist_local",
6593            VOption::new()
6594                .set("in", self)
6595                .set(
6596                    "out",
6597                    &mut out_out,
6598                )
6599                .set(
6600                    "width",
6601                    width,
6602                )
6603                .set(
6604                    "height",
6605                    height,
6606                ),
6607        );
6608
6609        utils::result(
6610            vips_op_response,
6611            out_out,
6612            Error::OperationError("HistLocal (vips_hist_local) failed".to_string()),
6613        )
6614    }
6615
6616    /// VipsHistLocal (hist_local), local histogram equalisation
6617    /// returns `VipsImage` - Output image
6618    ///
6619    /// width: `i32` -> Window width in pixels
6620    ///
6621    /// height: `i32` -> Window height in pixels
6622    ///
6623    /// <ins>Optional arguments</ins>
6624    ///
6625    /// max_slope: `i32` -> Maximum slope (CLAHE)
6626    pub fn hist_local_with_opts(
6627        &self,
6628        width: i32,
6629        height: i32,
6630        option: VOption,
6631    ) -> Result<VipsImage> {
6632        let mut out_out = VipsImage::from(null_mut());
6633        let vips_op_response = call(
6634            "hist_local",
6635            option
6636                .set("in", self)
6637                .set(
6638                    "out",
6639                    &mut out_out,
6640                )
6641                .set(
6642                    "width",
6643                    width,
6644                )
6645                .set(
6646                    "height",
6647                    height,
6648                ),
6649        );
6650
6651        utils::result(
6652            vips_op_response,
6653            out_out,
6654            Error::OperationError("HistLocal (vips_hist_local) failed".to_string()),
6655        )
6656    }
6657
6658    /// VipsHistMatch (hist_match), match two histograms
6659    /// returns `VipsImage` - Output image
6660    ///
6661    /// refp: `&VipsImage` -> Reference histogram
6662    pub fn hist_match(&self, refp: &VipsImage) -> Result<VipsImage> {
6663        let mut out_out = VipsImage::from(null_mut());
6664        let vips_op_response = call(
6665            "hist_match",
6666            VOption::new()
6667                .set("in", self)
6668                .set(
6669                    "ref", refp,
6670                )
6671                .set(
6672                    "out",
6673                    &mut out_out,
6674                ),
6675        );
6676
6677        utils::result(
6678            vips_op_response,
6679            out_out,
6680            Error::OperationError("HistMatch (vips_hist_match) failed".to_string()),
6681        )
6682    }
6683
6684    /// VipsHistNorm (hist_norm), normalise histogram
6685    /// returns `VipsImage` - Output image
6686    pub fn hist_norm(&self) -> Result<VipsImage> {
6687        let mut out_out = VipsImage::from(null_mut());
6688        let vips_op_response = call(
6689            "hist_norm",
6690            VOption::new()
6691                .set("in", self)
6692                .set(
6693                    "out",
6694                    &mut out_out,
6695                ),
6696        );
6697
6698        utils::result(
6699            vips_op_response,
6700            out_out,
6701            Error::OperationError("HistNorm (vips_hist_norm) failed".to_string()),
6702        )
6703    }
6704
6705    /// VipsHistPlot (hist_plot), plot histogram
6706    /// returns `VipsImage` - Output image
6707    pub fn hist_plot(&self) -> Result<VipsImage> {
6708        let mut out_out = VipsImage::from(null_mut());
6709        let vips_op_response = call(
6710            "hist_plot",
6711            VOption::new()
6712                .set("in", self)
6713                .set(
6714                    "out",
6715                    &mut out_out,
6716                ),
6717        );
6718
6719        utils::result(
6720            vips_op_response,
6721            out_out,
6722            Error::OperationError("HistPlot (vips_hist_plot) failed".to_string()),
6723        )
6724    }
6725
6726    /// VipsHoughCircle (hough_circle), find hough circle transform
6727    /// returns `VipsImage` - Output image
6728    pub fn hough_circle(&self) -> Result<VipsImage> {
6729        let mut out_out = VipsImage::from(null_mut());
6730        let vips_op_response = call(
6731            "hough_circle",
6732            VOption::new()
6733                .set("in", self)
6734                .set(
6735                    "out",
6736                    &mut out_out,
6737                ),
6738        );
6739
6740        utils::result(
6741            vips_op_response,
6742            out_out,
6743            Error::OperationError("HoughCircle (vips_hough_circle) failed".to_string()),
6744        )
6745    }
6746
6747    /// VipsHoughCircle (hough_circle), find hough circle transform
6748    /// returns `VipsImage` - Output image
6749    ///
6750    /// <ins>Optional arguments</ins>
6751    ///
6752    /// scale: `i32` -> Scale down dimensions by this factor
6753    ///
6754    /// min_radius: `i32` -> Smallest radius to search for
6755    ///
6756    /// max_radius: `i32` -> Largest radius to search for
6757    pub fn hough_circle_with_opts(&self, option: VOption) -> Result<VipsImage> {
6758        let mut out_out = VipsImage::from(null_mut());
6759        let vips_op_response = call(
6760            "hough_circle",
6761            option
6762                .set("in", self)
6763                .set(
6764                    "out",
6765                    &mut out_out,
6766                ),
6767        );
6768
6769        utils::result(
6770            vips_op_response,
6771            out_out,
6772            Error::OperationError("HoughCircle (vips_hough_circle) failed".to_string()),
6773        )
6774    }
6775
6776    /// VipsHoughLine (hough_line), find hough line transform
6777    /// returns `VipsImage` - Output image
6778    pub fn hough_line(&self) -> Result<VipsImage> {
6779        let mut out_out = VipsImage::from(null_mut());
6780        let vips_op_response = call(
6781            "hough_line",
6782            VOption::new()
6783                .set("in", self)
6784                .set(
6785                    "out",
6786                    &mut out_out,
6787                ),
6788        );
6789
6790        utils::result(
6791            vips_op_response,
6792            out_out,
6793            Error::OperationError("HoughLine (vips_hough_line) failed".to_string()),
6794        )
6795    }
6796
6797    /// VipsHoughLine (hough_line), find hough line transform
6798    /// returns `VipsImage` - Output image
6799    ///
6800    /// <ins>Optional arguments</ins>
6801    ///
6802    /// width: `i32` -> Horizontal size of parameter space
6803    ///
6804    /// height: `i32` -> Vertical size of parameter space
6805    pub fn hough_line_with_opts(&self, option: VOption) -> Result<VipsImage> {
6806        let mut out_out = VipsImage::from(null_mut());
6807        let vips_op_response = call(
6808            "hough_line",
6809            option
6810                .set("in", self)
6811                .set(
6812                    "out",
6813                    &mut out_out,
6814                ),
6815        );
6816
6817        utils::result(
6818            vips_op_response,
6819            out_out,
6820            Error::OperationError("HoughLine (vips_hough_line) failed".to_string()),
6821        )
6822    }
6823
6824    /// VipsIccExport (icc_export), output to device with ICC profile
6825    /// returns `VipsImage` - Output image
6826    pub fn icc_export(&self) -> Result<VipsImage> {
6827        let mut out_out = VipsImage::from(null_mut());
6828        let vips_op_response = call(
6829            "icc_export",
6830            VOption::new()
6831                .set("in", self)
6832                .set(
6833                    "out",
6834                    &mut out_out,
6835                ),
6836        );
6837
6838        utils::result(
6839            vips_op_response,
6840            out_out,
6841            Error::OperationError("IccExport (vips_icc_export) failed".to_string()),
6842        )
6843    }
6844
6845    /// VipsIccExport (icc_export), output to device with ICC profile
6846    /// returns `VipsImage` - Output image
6847    ///
6848    /// <ins>Optional arguments</ins>
6849    ///
6850    /// pcs: [`PCS`] -> Set Profile Connection Space
6851    ///
6852    /// intent: [`Intent`] -> Rendering intent
6853    ///
6854    /// black_point_compensation: `bool` -> Enable black point compensation
6855    ///
6856    /// output_profile: `&str` -> Filename to load output profile from
6857    ///
6858    /// depth: `i32` -> Output device space depth in bits
6859    pub fn icc_export_with_opts(&self, option: VOption) -> Result<VipsImage> {
6860        let mut out_out = VipsImage::from(null_mut());
6861        let vips_op_response = call(
6862            "icc_export",
6863            option
6864                .set("in", self)
6865                .set(
6866                    "out",
6867                    &mut out_out,
6868                ),
6869        );
6870
6871        utils::result(
6872            vips_op_response,
6873            out_out,
6874            Error::OperationError("IccExport (vips_icc_export) failed".to_string()),
6875        )
6876    }
6877
6878    /// VipsIccImport (icc_import), import from device with ICC profile
6879    /// returns `VipsImage` - Output image
6880    pub fn icc_import(&self) -> Result<VipsImage> {
6881        let mut out_out = VipsImage::from(null_mut());
6882        let vips_op_response = call(
6883            "icc_import",
6884            VOption::new()
6885                .set("in", self)
6886                .set(
6887                    "out",
6888                    &mut out_out,
6889                ),
6890        );
6891
6892        utils::result(
6893            vips_op_response,
6894            out_out,
6895            Error::OperationError("IccImport (vips_icc_import) failed".to_string()),
6896        )
6897    }
6898
6899    /// VipsIccImport (icc_import), import from device with ICC profile
6900    /// returns `VipsImage` - Output image
6901    ///
6902    /// <ins>Optional arguments</ins>
6903    ///
6904    /// pcs: [`PCS`] -> Set Profile Connection Space
6905    ///
6906    /// intent: [`Intent`] -> Rendering intent
6907    ///
6908    /// black_point_compensation: `bool` -> Enable black point compensation
6909    ///
6910    /// embedded: `bool` -> Use embedded input profile, if available
6911    ///
6912    /// input_profile: `&str` -> Filename to load input profile from
6913    pub fn icc_import_with_opts(&self, option: VOption) -> Result<VipsImage> {
6914        let mut out_out = VipsImage::from(null_mut());
6915        let vips_op_response = call(
6916            "icc_import",
6917            option
6918                .set("in", self)
6919                .set(
6920                    "out",
6921                    &mut out_out,
6922                ),
6923        );
6924
6925        utils::result(
6926            vips_op_response,
6927            out_out,
6928            Error::OperationError("IccImport (vips_icc_import) failed".to_string()),
6929        )
6930    }
6931
6932    /// VipsIccTransform (icc_transform), transform between devices with ICC profiles
6933    /// returns `VipsImage` - Output image
6934    ///
6935    /// output_profile: `&str` -> Filename to load output profile from
6936    pub fn icc_transform(&self, output_profile: &str) -> Result<VipsImage> {
6937        let mut out_out = VipsImage::from(null_mut());
6938        let vips_op_response = call(
6939            "icc_transform",
6940            VOption::new()
6941                .set("in", self)
6942                .set(
6943                    "out",
6944                    &mut out_out,
6945                )
6946                .set(
6947                    "output-profile",
6948                    output_profile,
6949                ),
6950        );
6951
6952        utils::result(
6953            vips_op_response,
6954            out_out,
6955            Error::OperationError("IccTransform (vips_icc_transform) failed".to_string()),
6956        )
6957    }
6958
6959    /// VipsIccTransform (icc_transform), transform between devices with ICC profiles
6960    /// returns `VipsImage` - Output image
6961    ///
6962    /// output_profile: `&str` -> Filename to load output profile from
6963    ///
6964    /// <ins>Optional arguments</ins>
6965    ///
6966    /// pcs: [`PCS`] -> Set Profile Connection Space
6967    ///
6968    /// intent: [`Intent`] -> Rendering intent
6969    ///
6970    /// black_point_compensation: `bool` -> Enable black point compensation
6971    ///
6972    /// embedded: `bool` -> Use embedded input profile, if available
6973    ///
6974    /// input_profile: `&str` -> Filename to load input profile from
6975    ///
6976    /// depth: `i32` -> Output device space depth in bits
6977    pub fn icc_transform_with_opts(
6978        &self,
6979        output_profile: &str,
6980        option: VOption,
6981    ) -> Result<VipsImage> {
6982        let mut out_out = VipsImage::from(null_mut());
6983        let vips_op_response = call(
6984            "icc_transform",
6985            option
6986                .set("in", self)
6987                .set(
6988                    "out",
6989                    &mut out_out,
6990                )
6991                .set(
6992                    "output-profile",
6993                    output_profile,
6994                ),
6995        );
6996
6997        utils::result(
6998            vips_op_response,
6999            out_out,
7000            Error::OperationError("IccTransform (vips_icc_transform) failed".to_string()),
7001        )
7002    }
7003
7004    /// VipsIdentity (identity), make a 1D image where pixel values are indexes
7005    /// returns `VipsImage` - Output image
7006    pub fn identity() -> Result<VipsImage> {
7007        let mut out_out = VipsImage::from(null_mut());
7008        let vips_op_response = call(
7009            "identity",
7010            VOption::new().set(
7011                "out",
7012                &mut out_out,
7013            ),
7014        );
7015
7016        utils::result(
7017            vips_op_response,
7018            out_out,
7019            Error::OperationError("Identity (vips_identity) failed".to_string()),
7020        )
7021    }
7022
7023    /// VipsIdentity (identity), make a 1D image where pixel values are indexes
7024    /// returns `VipsImage` - Output image
7025    ///
7026    /// <ins>Optional arguments</ins>
7027    ///
7028    /// bands: `i32` -> Number of bands in LUT
7029    ///
7030    /// ushort: `bool` -> Create a 16-bit LUT
7031    ///
7032    /// size: `i32` -> Size of 16-bit LUT
7033    pub fn identity_with_opts(option: VOption) -> Result<VipsImage> {
7034        let mut out_out = VipsImage::from(null_mut());
7035        let vips_op_response = call(
7036            "identity",
7037            option.set(
7038                "out",
7039                &mut out_out,
7040            ),
7041        );
7042
7043        utils::result(
7044            vips_op_response,
7045            out_out,
7046            Error::OperationError("Identity (vips_identity) failed".to_string()),
7047        )
7048    }
7049
7050    /// VipsIfthenelse (ifthenelse), ifthenelse an image
7051    /// returns `VipsImage` - Output image
7052    ///
7053    /// in1: `&VipsImage` -> Source for TRUE pixels
7054    ///
7055    /// in2: `&VipsImage` -> Source for FALSE pixels
7056    pub fn ifthenelse(&self, in1: &VipsImage, in2: &VipsImage) -> Result<VipsImage> {
7057        let mut out_out = VipsImage::from(null_mut());
7058        let vips_op_response = call(
7059            "ifthenelse",
7060            VOption::new()
7061                .set(
7062                    "cond",
7063                    self,
7064                )
7065                .set("in1", in1)
7066                .set("in2", in2)
7067                .set(
7068                    "out",
7069                    &mut out_out,
7070                ),
7071        );
7072
7073        utils::result(
7074            vips_op_response,
7075            out_out,
7076            Error::OperationError("Ifthenelse (vips_ifthenelse) failed".to_string()),
7077        )
7078    }
7079
7080    /// VipsIfthenelse (ifthenelse), ifthenelse an image
7081    /// returns `VipsImage` - Output image
7082    ///
7083    /// in1: `&VipsImage` -> Source for TRUE pixels
7084    ///
7085    /// in2: `&VipsImage` -> Source for FALSE pixels
7086    ///
7087    /// <ins>Optional arguments</ins>
7088    ///
7089    /// blend: `bool` -> Blend smoothly between then and else parts
7090    pub fn ifthenelse_with_opts(
7091        &self,
7092        in1: &VipsImage,
7093        in2: &VipsImage,
7094        option: VOption,
7095    ) -> Result<VipsImage> {
7096        let mut out_out = VipsImage::from(null_mut());
7097        let vips_op_response = call(
7098            "ifthenelse",
7099            option
7100                .set(
7101                    "cond",
7102                    self,
7103                )
7104                .set("in1", in1)
7105                .set("in2", in2)
7106                .set(
7107                    "out",
7108                    &mut out_out,
7109                ),
7110        );
7111
7112        utils::result(
7113            vips_op_response,
7114            out_out,
7115            Error::OperationError("Ifthenelse (vips_ifthenelse) failed".to_string()),
7116        )
7117    }
7118
7119    /// VipsInsert (insert), insert image @sub into @main at @x, @y
7120    /// returns `VipsImage` - Output image
7121    ///
7122    /// sub: `&VipsImage` -> Sub-image to insert into main image
7123    ///
7124    /// x: `i32` -> Left edge of sub in main
7125    ///
7126    /// y: `i32` -> Top edge of sub in main
7127    pub fn insert(&self, sub: &VipsImage, x: i32, y: i32) -> Result<VipsImage> {
7128        let mut out_out = VipsImage::from(null_mut());
7129        let vips_op_response = call(
7130            "insert",
7131            VOption::new()
7132                .set(
7133                    "main",
7134                    self,
7135                )
7136                .set("sub", sub)
7137                .set(
7138                    "out",
7139                    &mut out_out,
7140                )
7141                .set("x", x)
7142                .set("y", y),
7143        );
7144
7145        utils::result(
7146            vips_op_response,
7147            out_out,
7148            Error::OperationError("Insert (vips_insert) failed".to_string()),
7149        )
7150    }
7151
7152    /// VipsInsert (insert), insert image @sub into @main at @x, @y
7153    /// returns `VipsImage` - Output image
7154    ///
7155    /// sub: `&VipsImage` -> Sub-image to insert into main image
7156    ///
7157    /// x: `i32` -> Left edge of sub in main
7158    ///
7159    /// y: `i32` -> Top edge of sub in main
7160    ///
7161    /// <ins>Optional arguments</ins>
7162    ///
7163    /// expand: `bool` -> Expand output to hold all of both inputs
7164    ///
7165    /// background: `&[f64]` -> Color for new pixels
7166    pub fn insert_with_opts(
7167        &self,
7168        sub: &VipsImage,
7169        x: i32,
7170        y: i32,
7171        option: VOption,
7172    ) -> Result<VipsImage> {
7173        let mut out_out = VipsImage::from(null_mut());
7174        let vips_op_response = call(
7175            "insert",
7176            option
7177                .set(
7178                    "main",
7179                    self,
7180                )
7181                .set("sub", sub)
7182                .set(
7183                    "out",
7184                    &mut out_out,
7185                )
7186                .set("x", x)
7187                .set("y", y),
7188        );
7189
7190        utils::result(
7191            vips_op_response,
7192            out_out,
7193            Error::OperationError("Insert (vips_insert) failed".to_string()),
7194        )
7195    }
7196
7197    /// VipsInvert (invert), invert an image
7198    /// returns `VipsImage` - Output image
7199    pub fn invert(&self) -> Result<VipsImage> {
7200        let mut out_out = VipsImage::from(null_mut());
7201        let vips_op_response = call(
7202            "invert",
7203            VOption::new()
7204                .set("in", self)
7205                .set(
7206                    "out",
7207                    &mut out_out,
7208                ),
7209        );
7210
7211        utils::result(
7212            vips_op_response,
7213            out_out,
7214            Error::OperationError("Invert (vips_invert) failed".to_string()),
7215        )
7216    }
7217
7218    /// VipsInvertlut (invertlut), build an inverted look-up table
7219    /// returns `VipsImage` - Output image
7220    pub fn invertlut(&self) -> Result<VipsImage> {
7221        let mut out_out = VipsImage::from(null_mut());
7222        let vips_op_response = call(
7223            "invertlut",
7224            VOption::new()
7225                .set("in", self)
7226                .set(
7227                    "out",
7228                    &mut out_out,
7229                ),
7230        );
7231
7232        utils::result(
7233            vips_op_response,
7234            out_out,
7235            Error::OperationError("Invertlut (vips_invertlut) failed".to_string()),
7236        )
7237    }
7238
7239    /// VipsInvertlut (invertlut), build an inverted look-up table
7240    /// returns `VipsImage` - Output image
7241    ///
7242    /// <ins>Optional arguments</ins>
7243    ///
7244    /// size: `i32` -> LUT size to generate
7245    pub fn invertlut_with_opts(&self, option: VOption) -> Result<VipsImage> {
7246        let mut out_out = VipsImage::from(null_mut());
7247        let vips_op_response = call(
7248            "invertlut",
7249            option
7250                .set("in", self)
7251                .set(
7252                    "out",
7253                    &mut out_out,
7254                ),
7255        );
7256
7257        utils::result(
7258            vips_op_response,
7259            out_out,
7260            Error::OperationError("Invertlut (vips_invertlut) failed".to_string()),
7261        )
7262    }
7263
7264    /// VipsInvfft (invfft), inverse FFT
7265    /// returns `VipsImage` - Output image
7266    pub fn invfft(&self) -> Result<VipsImage> {
7267        let mut out_out = VipsImage::from(null_mut());
7268        let vips_op_response = call(
7269            "invfft",
7270            VOption::new()
7271                .set("in", self)
7272                .set(
7273                    "out",
7274                    &mut out_out,
7275                ),
7276        );
7277
7278        utils::result(
7279            vips_op_response,
7280            out_out,
7281            Error::OperationError("Invfft (vips_invfft) failed".to_string()),
7282        )
7283    }
7284
7285    /// VipsInvfft (invfft), inverse FFT
7286    /// returns `VipsImage` - Output image
7287    ///
7288    /// <ins>Optional arguments</ins>
7289    ///
7290    /// real: `bool` -> Output only the real part of the transform
7291    pub fn invfft_with_opts(&self, option: VOption) -> Result<VipsImage> {
7292        let mut out_out = VipsImage::from(null_mut());
7293        let vips_op_response = call(
7294            "invfft",
7295            option
7296                .set("in", self)
7297                .set(
7298                    "out",
7299                    &mut out_out,
7300                ),
7301        );
7302
7303        utils::result(
7304            vips_op_response,
7305            out_out,
7306            Error::OperationError("Invfft (vips_invfft) failed".to_string()),
7307        )
7308    }
7309
7310    /// VipsJoin (join), join a pair of images
7311    /// returns `VipsImage` - Output image
7312    ///
7313    /// in2: `&VipsImage` -> Second input image
7314    ///
7315    /// direction: `Direction` -> Join left-right or up-down
7316    pub fn join(&self, in2: &VipsImage, direction: Direction) -> Result<VipsImage> {
7317        let mut out_out = VipsImage::from(null_mut());
7318        let vips_op_response = call(
7319            "join",
7320            VOption::new()
7321                .set(
7322                    "in1", self,
7323                )
7324                .set("in2", in2)
7325                .set(
7326                    "out",
7327                    &mut out_out,
7328                )
7329                .set(
7330                    "direction",
7331                    direction as i32,
7332                ),
7333        );
7334
7335        utils::result(
7336            vips_op_response,
7337            out_out,
7338            Error::OperationError("Join (vips_join) failed".to_string()),
7339        )
7340    }
7341
7342    /// VipsJoin (join), join a pair of images
7343    /// returns `VipsImage` - Output image
7344    ///
7345    /// in2: `&VipsImage` -> Second input image
7346    ///
7347    /// direction: `Direction` -> Join left-right or up-down
7348    ///
7349    /// <ins>Optional arguments</ins>
7350    ///
7351    /// expand: `bool` -> Expand output to hold all of both inputs
7352    ///
7353    /// shim: `i32` -> Pixels between images
7354    ///
7355    /// background: `&[f64]` -> Colour for new pixels
7356    ///
7357    /// align: [`Align`] -> Align on the low, centre or high coordinate edge
7358    pub fn join_with_opts(
7359        &self,
7360        in2: &VipsImage,
7361        direction: Direction,
7362        option: VOption,
7363    ) -> Result<VipsImage> {
7364        let mut out_out = VipsImage::from(null_mut());
7365        let vips_op_response = call(
7366            "join",
7367            option
7368                .set(
7369                    "in1", self,
7370                )
7371                .set("in2", in2)
7372                .set(
7373                    "out",
7374                    &mut out_out,
7375                )
7376                .set(
7377                    "direction",
7378                    direction as i32,
7379                ),
7380        );
7381
7382        utils::result(
7383            vips_op_response,
7384            out_out,
7385            Error::OperationError("Join (vips_join) failed".to_string()),
7386        )
7387    }
7388
7389    /// VipsForeignLoadJp2kFile (jp2kload), load JPEG2000 image (.j2k, .jp2, .jpt, .j2c, .jpc), priority=0, untrusted, is_a, get_flags, header, load
7390    /// returns `VipsImage` - Output image
7391    ///
7392    /// filename: `&str` -> Filename to load from
7393    pub fn jp2kload(filename: &str) -> Result<VipsImage> {
7394        let mut out_out = VipsImage::from(null_mut());
7395        let vips_op_response = call(
7396            "jp2kload",
7397            VOption::new()
7398                .set(
7399                    "filename",
7400                    filename,
7401                )
7402                .set(
7403                    "out",
7404                    &mut out_out,
7405                ),
7406        );
7407
7408        utils::result(
7409            vips_op_response,
7410            out_out,
7411            Error::OperationError("Jp2Kload (vips_jp2kload) failed".to_string()),
7412        )
7413    }
7414
7415    /// VipsForeignLoadJp2kFile (jp2kload), load JPEG2000 image (.j2k, .jp2, .jpt, .j2c, .jpc), priority=0, untrusted, is_a, get_flags, header, load
7416    /// returns `VipsImage` - Output image
7417    ///
7418    /// filename: `&str` -> Filename to load from
7419    ///
7420    /// <ins>Optional arguments</ins>
7421    ///
7422    /// page: `i32` -> Load this page from the image
7423    ///
7424    /// oneshot: `bool` -> Load images a frame at a time
7425    ///
7426    /// flags: [`ForeignFlags`] -> Flags for this file
7427    ///
7428    /// memory: `bool` -> Force open via memory
7429    ///
7430    /// access: [`Access`] -> Required access pattern for this file
7431    ///
7432    /// fail_on: [`FailOn`] -> Error level to fail on
7433    ///
7434    /// revalidate: `bool` -> Don't use a cached result for this operation
7435    pub fn jp2kload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
7436        let mut out_out = VipsImage::from(null_mut());
7437        let vips_op_response = call(
7438            "jp2kload",
7439            option
7440                .set(
7441                    "filename",
7442                    filename,
7443                )
7444                .set(
7445                    "out",
7446                    &mut out_out,
7447                ),
7448        );
7449
7450        utils::result(
7451            vips_op_response,
7452            out_out,
7453            Error::OperationError("Jp2Kload (vips_jp2kload) failed".to_string()),
7454        )
7455    }
7456
7457    /// VipsForeignLoadJp2kBuffer (jp2kload_buffer), load JPEG2000 image, priority=0, untrusted, is_a_buffer, get_flags, header, load
7458    /// returns `VipsImage` - Output image
7459    ///
7460    /// buffer: `&[u8]` -> Buffer to load from
7461    pub fn jp2kload_buffer(buffer: &[u8]) -> Result<VipsImage> {
7462        let vips_blob = unsafe {
7463            vips_blob_new(
7464                None,
7465                buffer.as_ptr() as _,
7466                buffer.len() as _,
7467            )
7468        };
7469        let blob = VipsBlob::from(vips_blob);
7470        let mut out_out = VipsImage::from(null_mut());
7471        let vips_op_response = call(
7472            "jp2kload_buffer",
7473            VOption::new()
7474                .set(
7475                    "buffer",
7476                    &blob,
7477                )
7478                .set(
7479                    "out",
7480                    &mut out_out,
7481                ),
7482        );
7483        blob.area_unref();
7484        utils::result(
7485            vips_op_response,
7486            out_out,
7487            Error::OperationError("Jp2KloadBuffer (vips_jp2kload_buffer) failed".to_string()),
7488        )
7489    }
7490
7491    /// VipsForeignLoadJp2kBuffer (jp2kload_buffer), load JPEG2000 image, priority=0, untrusted, is_a_buffer, get_flags, header, load
7492    /// returns `VipsImage` - Output image
7493    ///
7494    /// buffer: `&[u8]` -> Buffer to load from
7495    ///
7496    /// <ins>Optional arguments</ins>
7497    ///
7498    /// page: `i32` -> Load this page from the image
7499    ///
7500    /// oneshot: `bool` -> Load images a frame at a time
7501    ///
7502    /// flags: [`ForeignFlags`] -> Flags for this file
7503    ///
7504    /// memory: `bool` -> Force open via memory
7505    ///
7506    /// access: [`Access`] -> Required access pattern for this file
7507    ///
7508    /// fail_on: [`FailOn`] -> Error level to fail on
7509    ///
7510    /// revalidate: `bool` -> Don't use a cached result for this operation
7511    pub fn jp2kload_buffer_with_opts(buffer: &[u8], option: VOption) -> Result<VipsImage> {
7512        let vips_blob = unsafe {
7513            vips_blob_new(
7514                None,
7515                buffer.as_ptr() as _,
7516                buffer.len() as _,
7517            )
7518        };
7519        let blob = VipsBlob::from(vips_blob);
7520        let mut out_out = VipsImage::from(null_mut());
7521        let vips_op_response = call(
7522            "jp2kload_buffer",
7523            option
7524                .set(
7525                    "buffer",
7526                    &blob,
7527                )
7528                .set(
7529                    "out",
7530                    &mut out_out,
7531                ),
7532        );
7533        blob.area_unref();
7534        utils::result(
7535            vips_op_response,
7536            out_out,
7537            Error::OperationError("Jp2KloadBuffer (vips_jp2kload_buffer) failed".to_string()),
7538        )
7539    }
7540
7541    /// VipsForeignLoadJp2kSource (jp2kload_source), load JPEG2000 image, priority=0, untrusted, is_a_source, get_flags, header, load
7542    /// returns `VipsImage` - Output image
7543    ///
7544    /// source: `&VipsSource` -> Source to load from
7545    pub fn jp2kload_source(source: &VipsSource) -> Result<VipsImage> {
7546        let mut out_out = VipsImage::from(null_mut());
7547        let vips_op_response = call(
7548            "jp2kload_source",
7549            VOption::new()
7550                .set(
7551                    "source",
7552                    source,
7553                )
7554                .set(
7555                    "out",
7556                    &mut out_out,
7557                ),
7558        );
7559
7560        utils::result(
7561            vips_op_response,
7562            out_out,
7563            Error::OperationError("Jp2KloadSource (vips_jp2kload_source) failed".to_string()),
7564        )
7565    }
7566
7567    /// VipsForeignLoadJp2kSource (jp2kload_source), load JPEG2000 image, priority=0, untrusted, is_a_source, get_flags, header, load
7568    /// returns `VipsImage` - Output image
7569    ///
7570    /// source: `&VipsSource` -> Source to load from
7571    ///
7572    /// <ins>Optional arguments</ins>
7573    ///
7574    /// page: `i32` -> Load this page from the image
7575    ///
7576    /// oneshot: `bool` -> Load images a frame at a time
7577    ///
7578    /// flags: [`ForeignFlags`] -> Flags for this file
7579    ///
7580    /// memory: `bool` -> Force open via memory
7581    ///
7582    /// access: [`Access`] -> Required access pattern for this file
7583    ///
7584    /// fail_on: [`FailOn`] -> Error level to fail on
7585    ///
7586    /// revalidate: `bool` -> Don't use a cached result for this operation
7587    pub fn jp2kload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
7588        let mut out_out = VipsImage::from(null_mut());
7589        let vips_op_response = call(
7590            "jp2kload_source",
7591            option
7592                .set(
7593                    "source",
7594                    source,
7595                )
7596                .set(
7597                    "out",
7598                    &mut out_out,
7599                ),
7600        );
7601
7602        utils::result(
7603            vips_op_response,
7604            out_out,
7605            Error::OperationError("Jp2KloadSource (vips_jp2kload_source) failed".to_string()),
7606        )
7607    }
7608
7609    /// VipsForeignSaveJp2kFile (jp2ksave), save image in JPEG2000 format (.j2k, .jp2, .jpt, .j2c, .jpc), priority=0,
7610    ///
7611    /// filename: `&str` -> Filename to save to
7612    pub fn jp2ksave(&self, filename: &str) -> Result<()> {
7613        let vips_op_response = call(
7614            "jp2ksave",
7615            VOption::new()
7616                .set("in", self)
7617                .set(
7618                    "filename",
7619                    filename,
7620                ),
7621        );
7622
7623        utils::result(
7624            vips_op_response,
7625            (),
7626            Error::OperationError("Jp2Ksave (vips_jp2ksave) failed".to_string()),
7627        )
7628    }
7629
7630    /// VipsForeignSaveJp2kFile (jp2ksave), save image in JPEG2000 format (.j2k, .jp2, .jpt, .j2c, .jpc), priority=0,
7631    ///
7632    /// filename: `&str` -> Filename to save to
7633    ///
7634    /// <ins>Optional arguments</ins>
7635    ///
7636    /// tile_width: `i32` -> Tile width in pixels
7637    ///
7638    /// tile_height: `i32` -> Tile height in pixels
7639    ///
7640    /// lossless: `bool` -> Enable lossless compression
7641    ///
7642    /// Q: `i32` -> Q factor
7643    ///
7644    /// subsample_mode: [`ForeignSubsample`] -> Select chroma subsample operation mode
7645    ///
7646    /// keep: [`ForeignKeep`] -> Which metadata to retain
7647    ///
7648    /// background: `&[f64]` -> Background value
7649    ///
7650    /// page_height: `i32` -> Set page height for multipage save
7651    ///
7652    /// profile: `&str` -> Filename of ICC profile to embed
7653    pub fn jp2ksave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
7654        let vips_op_response = call(
7655            "jp2ksave",
7656            option
7657                .set("in", self)
7658                .set(
7659                    "filename",
7660                    filename,
7661                ),
7662        );
7663
7664        utils::result(
7665            vips_op_response,
7666            (),
7667            Error::OperationError("Jp2Ksave (vips_jp2ksave) failed".to_string()),
7668        )
7669    }
7670
7671    /// VipsForeignSaveJp2kBuffer (jp2ksave_buffer), save image in JPEG2000 format (.j2k, .jp2, .jpt, .j2c, .jpc), priority=0,
7672    /// returns `Vec<u8>` - Buffer to save to
7673    pub fn jp2ksave_buffer(&self) -> Result<Vec<u8>> {
7674        let mut buffer_out = VipsBlob::from(null_mut());
7675        let vips_op_response = call(
7676            "jp2ksave_buffer",
7677            VOption::new()
7678                .set("in", self)
7679                .set(
7680                    "buffer",
7681                    &mut buffer_out,
7682                ),
7683        );
7684
7685        utils::result(
7686            vips_op_response,
7687            buffer_out.into(),
7688            Error::OperationError("Jp2KsaveBuffer (vips_jp2ksave_buffer) failed".to_string()),
7689        )
7690    }
7691
7692    /// VipsForeignSaveJp2kBuffer (jp2ksave_buffer), save image in JPEG2000 format (.j2k, .jp2, .jpt, .j2c, .jpc), priority=0,
7693    /// returns `Vec<u8>` - Buffer to save to
7694    ///
7695    /// <ins>Optional arguments</ins>
7696    ///
7697    /// tile_width: `i32` -> Tile width in pixels
7698    ///
7699    /// tile_height: `i32` -> Tile height in pixels
7700    ///
7701    /// lossless: `bool` -> Enable lossless compression
7702    ///
7703    /// Q: `i32` -> Q factor
7704    ///
7705    /// subsample_mode: [`ForeignSubsample`] -> Select chroma subsample operation mode
7706    ///
7707    /// keep: [`ForeignKeep`] -> Which metadata to retain
7708    ///
7709    /// background: `&[f64]` -> Background value
7710    ///
7711    /// page_height: `i32` -> Set page height for multipage save
7712    ///
7713    /// profile: `&str` -> Filename of ICC profile to embed
7714    pub fn jp2ksave_buffer_with_opts(&self, option: VOption) -> Result<Vec<u8>> {
7715        let mut buffer_out = VipsBlob::from(null_mut());
7716        let vips_op_response = call(
7717            "jp2ksave_buffer",
7718            option
7719                .set("in", self)
7720                .set(
7721                    "buffer",
7722                    &mut buffer_out,
7723                ),
7724        );
7725
7726        utils::result(
7727            vips_op_response,
7728            buffer_out.into(),
7729            Error::OperationError("Jp2KsaveBuffer (vips_jp2ksave_buffer) failed".to_string()),
7730        )
7731    }
7732
7733    /// VipsForeignSaveJp2kTarget (jp2ksave_target), save image in JPEG2000 format (.j2k, .jp2, .jpt, .j2c, .jpc), priority=0,
7734    ///
7735    /// target: `&VipsTarget` -> Target to save to
7736    pub fn jp2ksave_target(&self, target: &VipsTarget) -> Result<()> {
7737        let vips_op_response = call(
7738            "jp2ksave_target",
7739            VOption::new()
7740                .set("in", self)
7741                .set(
7742                    "target",
7743                    target,
7744                ),
7745        );
7746
7747        utils::result(
7748            vips_op_response,
7749            (),
7750            Error::OperationError("Jp2KsaveTarget (vips_jp2ksave_target) failed".to_string()),
7751        )
7752    }
7753
7754    /// VipsForeignSaveJp2kTarget (jp2ksave_target), save image in JPEG2000 format (.j2k, .jp2, .jpt, .j2c, .jpc), priority=0,
7755    ///
7756    /// target: `&VipsTarget` -> Target to save to
7757    ///
7758    /// <ins>Optional arguments</ins>
7759    ///
7760    /// tile_width: `i32` -> Tile width in pixels
7761    ///
7762    /// tile_height: `i32` -> Tile height in pixels
7763    ///
7764    /// lossless: `bool` -> Enable lossless compression
7765    ///
7766    /// Q: `i32` -> Q factor
7767    ///
7768    /// subsample_mode: [`ForeignSubsample`] -> Select chroma subsample operation mode
7769    ///
7770    /// keep: [`ForeignKeep`] -> Which metadata to retain
7771    ///
7772    /// background: `&[f64]` -> Background value
7773    ///
7774    /// page_height: `i32` -> Set page height for multipage save
7775    ///
7776    /// profile: `&str` -> Filename of ICC profile to embed
7777    pub fn jp2ksave_target_with_opts(&self, target: &VipsTarget, option: VOption) -> Result<()> {
7778        let vips_op_response = call(
7779            "jp2ksave_target",
7780            option
7781                .set("in", self)
7782                .set(
7783                    "target",
7784                    target,
7785                ),
7786        );
7787
7788        utils::result(
7789            vips_op_response,
7790            (),
7791            Error::OperationError("Jp2KsaveTarget (vips_jp2ksave_target) failed".to_string()),
7792        )
7793    }
7794
7795    /// VipsForeignLoadJpegFile (jpegload), load jpeg from file (.jpg, .jpeg, .jpe, .jfif), priority=50, is_a, get_flags, get_flags_filename, header, load
7796    /// returns `VipsImage` - Output image
7797    ///
7798    /// filename: `&str` -> Filename to load from
7799    pub fn jpegload(filename: &str) -> Result<VipsImage> {
7800        let mut out_out = VipsImage::from(null_mut());
7801        let vips_op_response = call(
7802            "jpegload",
7803            VOption::new()
7804                .set(
7805                    "filename",
7806                    filename,
7807                )
7808                .set(
7809                    "out",
7810                    &mut out_out,
7811                ),
7812        );
7813
7814        utils::result(
7815            vips_op_response,
7816            out_out,
7817            Error::OperationError("Jpegload (vips_jpegload) failed".to_string()),
7818        )
7819    }
7820
7821    /// VipsForeignLoadJpegFile (jpegload), load jpeg from file (.jpg, .jpeg, .jpe, .jfif), priority=50, is_a, get_flags, get_flags_filename, header, load
7822    /// returns `VipsImage` - Output image
7823    ///
7824    /// filename: `&str` -> Filename to load from
7825    ///
7826    /// <ins>Optional arguments</ins>
7827    ///
7828    /// shrink: `i32` -> Shrink factor on load
7829    ///
7830    /// autorotate: `bool` -> Rotate image using exif orientation
7831    ///
7832    /// unlimited: `bool` -> Remove all denial of service limits
7833    ///
7834    /// flags: [`ForeignFlags`] -> Flags for this file
7835    ///
7836    /// memory: `bool` -> Force open via memory
7837    ///
7838    /// access: [`Access`] -> Required access pattern for this file
7839    ///
7840    /// fail_on: [`FailOn`] -> Error level to fail on
7841    ///
7842    /// revalidate: `bool` -> Don't use a cached result for this operation
7843    pub fn jpegload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
7844        let mut out_out = VipsImage::from(null_mut());
7845        let vips_op_response = call(
7846            "jpegload",
7847            option
7848                .set(
7849                    "filename",
7850                    filename,
7851                )
7852                .set(
7853                    "out",
7854                    &mut out_out,
7855                ),
7856        );
7857
7858        utils::result(
7859            vips_op_response,
7860            out_out,
7861            Error::OperationError("Jpegload (vips_jpegload) failed".to_string()),
7862        )
7863    }
7864
7865    /// VipsForeignLoadJpegBuffer (jpegload_buffer), load jpeg from buffer, priority=50, is_a_buffer, get_flags, get_flags_filename, header, load
7866    /// returns `VipsImage` - Output image
7867    ///
7868    /// buffer: `&[u8]` -> Buffer to load from
7869    pub fn jpegload_buffer(buffer: &[u8]) -> Result<VipsImage> {
7870        let vips_blob = unsafe {
7871            vips_blob_new(
7872                None,
7873                buffer.as_ptr() as _,
7874                buffer.len() as _,
7875            )
7876        };
7877        let blob = VipsBlob::from(vips_blob);
7878        let mut out_out = VipsImage::from(null_mut());
7879        let vips_op_response = call(
7880            "jpegload_buffer",
7881            VOption::new()
7882                .set(
7883                    "buffer",
7884                    &blob,
7885                )
7886                .set(
7887                    "out",
7888                    &mut out_out,
7889                ),
7890        );
7891        blob.area_unref();
7892        utils::result(
7893            vips_op_response,
7894            out_out,
7895            Error::OperationError("JpegloadBuffer (vips_jpegload_buffer) failed".to_string()),
7896        )
7897    }
7898
7899    /// VipsForeignLoadJpegBuffer (jpegload_buffer), load jpeg from buffer, priority=50, is_a_buffer, get_flags, get_flags_filename, header, load
7900    /// returns `VipsImage` - Output image
7901    ///
7902    /// buffer: `&[u8]` -> Buffer to load from
7903    ///
7904    /// <ins>Optional arguments</ins>
7905    ///
7906    /// shrink: `i32` -> Shrink factor on load
7907    ///
7908    /// autorotate: `bool` -> Rotate image using exif orientation
7909    ///
7910    /// unlimited: `bool` -> Remove all denial of service limits
7911    ///
7912    /// flags: [`ForeignFlags`] -> Flags for this file
7913    ///
7914    /// memory: `bool` -> Force open via memory
7915    ///
7916    /// access: [`Access`] -> Required access pattern for this file
7917    ///
7918    /// fail_on: [`FailOn`] -> Error level to fail on
7919    ///
7920    /// revalidate: `bool` -> Don't use a cached result for this operation
7921    pub fn jpegload_buffer_with_opts(buffer: &[u8], option: VOption) -> Result<VipsImage> {
7922        let vips_blob = unsafe {
7923            vips_blob_new(
7924                None,
7925                buffer.as_ptr() as _,
7926                buffer.len() as _,
7927            )
7928        };
7929        let blob = VipsBlob::from(vips_blob);
7930        let mut out_out = VipsImage::from(null_mut());
7931        let vips_op_response = call(
7932            "jpegload_buffer",
7933            option
7934                .set(
7935                    "buffer",
7936                    &blob,
7937                )
7938                .set(
7939                    "out",
7940                    &mut out_out,
7941                ),
7942        );
7943        blob.area_unref();
7944        utils::result(
7945            vips_op_response,
7946            out_out,
7947            Error::OperationError("JpegloadBuffer (vips_jpegload_buffer) failed".to_string()),
7948        )
7949    }
7950
7951    /// VipsForeignLoadJpegSource (jpegload_source), load image from jpeg source, priority=50, is_a_source, get_flags, get_flags_filename, header, load
7952    /// returns `VipsImage` - Output image
7953    ///
7954    /// source: `&VipsSource` -> Source to load from
7955    pub fn jpegload_source(source: &VipsSource) -> Result<VipsImage> {
7956        let mut out_out = VipsImage::from(null_mut());
7957        let vips_op_response = call(
7958            "jpegload_source",
7959            VOption::new()
7960                .set(
7961                    "source",
7962                    source,
7963                )
7964                .set(
7965                    "out",
7966                    &mut out_out,
7967                ),
7968        );
7969
7970        utils::result(
7971            vips_op_response,
7972            out_out,
7973            Error::OperationError("JpegloadSource (vips_jpegload_source) failed".to_string()),
7974        )
7975    }
7976
7977    /// VipsForeignLoadJpegSource (jpegload_source), load image from jpeg source, priority=50, is_a_source, get_flags, get_flags_filename, header, load
7978    /// returns `VipsImage` - Output image
7979    ///
7980    /// source: `&VipsSource` -> Source to load from
7981    ///
7982    /// <ins>Optional arguments</ins>
7983    ///
7984    /// shrink: `i32` -> Shrink factor on load
7985    ///
7986    /// autorotate: `bool` -> Rotate image using exif orientation
7987    ///
7988    /// unlimited: `bool` -> Remove all denial of service limits
7989    ///
7990    /// flags: [`ForeignFlags`] -> Flags for this file
7991    ///
7992    /// memory: `bool` -> Force open via memory
7993    ///
7994    /// access: [`Access`] -> Required access pattern for this file
7995    ///
7996    /// fail_on: [`FailOn`] -> Error level to fail on
7997    ///
7998    /// revalidate: `bool` -> Don't use a cached result for this operation
7999    pub fn jpegload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
8000        let mut out_out = VipsImage::from(null_mut());
8001        let vips_op_response = call(
8002            "jpegload_source",
8003            option
8004                .set(
8005                    "source",
8006                    source,
8007                )
8008                .set(
8009                    "out",
8010                    &mut out_out,
8011                ),
8012        );
8013
8014        utils::result(
8015            vips_op_response,
8016            out_out,
8017            Error::OperationError("JpegloadSource (vips_jpegload_source) failed".to_string()),
8018        )
8019    }
8020
8021    /// VipsForeignSaveJpegFile (jpegsave), save image to jpeg file (.jpg, .jpeg, .jpe, .jfif), priority=0, mono rgb cmyk
8022    ///
8023    /// filename: `&str` -> Filename to save to
8024    pub fn jpegsave(&self, filename: &str) -> Result<()> {
8025        let vips_op_response = call(
8026            "jpegsave",
8027            VOption::new()
8028                .set("in", self)
8029                .set(
8030                    "filename",
8031                    filename,
8032                ),
8033        );
8034
8035        utils::result(
8036            vips_op_response,
8037            (),
8038            Error::OperationError("Jpegsave (vips_jpegsave) failed".to_string()),
8039        )
8040    }
8041
8042    /// VipsForeignSaveJpegFile (jpegsave), save image to jpeg file (.jpg, .jpeg, .jpe, .jfif), priority=0, mono rgb cmyk
8043    ///
8044    /// filename: `&str` -> Filename to save to
8045    ///
8046    /// <ins>Optional arguments</ins>
8047    ///
8048    /// Q: `i32` -> Q factor
8049    ///
8050    /// optimize_coding: `bool` -> Compute optimal Huffman coding tables
8051    ///
8052    /// interlace: `bool` -> Generate an interlaced (progressive) jpeg
8053    ///
8054    /// trellis_quant: `bool` -> Apply trellis quantisation to each 8x8 block
8055    ///
8056    /// overshoot_deringing: `bool` -> Apply overshooting to samples with extreme values
8057    ///
8058    /// optimize_scans: `bool` -> Split spectrum of DCT coefficients into separate scans
8059    ///
8060    /// quant_table: `i32` -> Use predefined quantization table with given index
8061    ///
8062    /// subsample_mode: [`ForeignSubsample`] -> Select chroma subsample operation mode
8063    ///
8064    /// restart_interval: `i32` -> Add restart markers every specified number of mcu
8065    ///
8066    /// keep: [`ForeignKeep`] -> Which metadata to retain
8067    ///
8068    /// background: `&[f64]` -> Background value
8069    ///
8070    /// page_height: `i32` -> Set page height for multipage save
8071    ///
8072    /// profile: `&str` -> Filename of ICC profile to embed
8073    pub fn jpegsave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
8074        let vips_op_response = call(
8075            "jpegsave",
8076            option
8077                .set("in", self)
8078                .set(
8079                    "filename",
8080                    filename,
8081                ),
8082        );
8083
8084        utils::result(
8085            vips_op_response,
8086            (),
8087            Error::OperationError("Jpegsave (vips_jpegsave) failed".to_string()),
8088        )
8089    }
8090
8091    /// VipsForeignSaveJpegBuffer (jpegsave_buffer), save image to jpeg buffer (.jpg, .jpeg, .jpe, .jfif), priority=0, mono rgb cmyk
8092    /// returns `Vec<u8>` - Buffer to save to
8093    pub fn jpegsave_buffer(&self) -> Result<Vec<u8>> {
8094        let mut buffer_out = VipsBlob::from(null_mut());
8095        let vips_op_response = call(
8096            "jpegsave_buffer",
8097            VOption::new()
8098                .set("in", self)
8099                .set(
8100                    "buffer",
8101                    &mut buffer_out,
8102                ),
8103        );
8104
8105        utils::result(
8106            vips_op_response,
8107            buffer_out.into(),
8108            Error::OperationError("JpegsaveBuffer (vips_jpegsave_buffer) failed".to_string()),
8109        )
8110    }
8111
8112    /// VipsForeignSaveJpegBuffer (jpegsave_buffer), save image to jpeg buffer (.jpg, .jpeg, .jpe, .jfif), priority=0, mono rgb cmyk
8113    /// returns `Vec<u8>` - Buffer to save to
8114    ///
8115    /// <ins>Optional arguments</ins>
8116    ///
8117    /// Q: `i32` -> Q factor
8118    ///
8119    /// optimize_coding: `bool` -> Compute optimal Huffman coding tables
8120    ///
8121    /// interlace: `bool` -> Generate an interlaced (progressive) jpeg
8122    ///
8123    /// trellis_quant: `bool` -> Apply trellis quantisation to each 8x8 block
8124    ///
8125    /// overshoot_deringing: `bool` -> Apply overshooting to samples with extreme values
8126    ///
8127    /// optimize_scans: `bool` -> Split spectrum of DCT coefficients into separate scans
8128    ///
8129    /// quant_table: `i32` -> Use predefined quantization table with given index
8130    ///
8131    /// subsample_mode: [`ForeignSubsample`] -> Select chroma subsample operation mode
8132    ///
8133    /// restart_interval: `i32` -> Add restart markers every specified number of mcu
8134    ///
8135    /// keep: [`ForeignKeep`] -> Which metadata to retain
8136    ///
8137    /// background: `&[f64]` -> Background value
8138    ///
8139    /// page_height: `i32` -> Set page height for multipage save
8140    ///
8141    /// profile: `&str` -> Filename of ICC profile to embed
8142    pub fn jpegsave_buffer_with_opts(&self, option: VOption) -> Result<Vec<u8>> {
8143        let mut buffer_out = VipsBlob::from(null_mut());
8144        let vips_op_response = call(
8145            "jpegsave_buffer",
8146            option
8147                .set("in", self)
8148                .set(
8149                    "buffer",
8150                    &mut buffer_out,
8151                ),
8152        );
8153
8154        utils::result(
8155            vips_op_response,
8156            buffer_out.into(),
8157            Error::OperationError("JpegsaveBuffer (vips_jpegsave_buffer) failed".to_string()),
8158        )
8159    }
8160
8161    /// VipsForeignSaveJpegMime (jpegsave_mime), save image to jpeg mime (.jpg, .jpeg, .jpe, .jfif), priority=0, mono rgb cmyk
8162    pub fn jpegsave_mime(&self) -> Result<()> {
8163        let vips_op_response = call(
8164            "jpegsave_mime",
8165            VOption::new().set("in", self),
8166        );
8167
8168        utils::result(
8169            vips_op_response,
8170            (),
8171            Error::OperationError("JpegsaveMime (vips_jpegsave_mime) failed".to_string()),
8172        )
8173    }
8174
8175    /// VipsForeignSaveJpegMime (jpegsave_mime), save image to jpeg mime (.jpg, .jpeg, .jpe, .jfif), priority=0, mono rgb cmyk
8176    ///
8177    /// <ins>Optional arguments</ins>
8178    ///
8179    /// Q: `i32` -> Q factor
8180    ///
8181    /// optimize_coding: `bool` -> Compute optimal Huffman coding tables
8182    ///
8183    /// interlace: `bool` -> Generate an interlaced (progressive) jpeg
8184    ///
8185    /// trellis_quant: `bool` -> Apply trellis quantisation to each 8x8 block
8186    ///
8187    /// overshoot_deringing: `bool` -> Apply overshooting to samples with extreme values
8188    ///
8189    /// optimize_scans: `bool` -> Split spectrum of DCT coefficients into separate scans
8190    ///
8191    /// quant_table: `i32` -> Use predefined quantization table with given index
8192    ///
8193    /// subsample_mode: [`ForeignSubsample`] -> Select chroma subsample operation mode
8194    ///
8195    /// restart_interval: `i32` -> Add restart markers every specified number of mcu
8196    ///
8197    /// keep: [`ForeignKeep`] -> Which metadata to retain
8198    ///
8199    /// background: `&[f64]` -> Background value
8200    ///
8201    /// page_height: `i32` -> Set page height for multipage save
8202    ///
8203    /// profile: `&str` -> Filename of ICC profile to embed
8204    pub fn jpegsave_mime_with_opts(&self, option: VOption) -> Result<()> {
8205        let vips_op_response = call(
8206            "jpegsave_mime",
8207            option.set("in", self),
8208        );
8209
8210        utils::result(
8211            vips_op_response,
8212            (),
8213            Error::OperationError("JpegsaveMime (vips_jpegsave_mime) failed".to_string()),
8214        )
8215    }
8216
8217    /// VipsForeignSaveJpegTarget (jpegsave_target), save image to jpeg target (.jpg, .jpeg, .jpe, .jfif), priority=0, mono rgb cmyk
8218    ///
8219    /// target: `&VipsTarget` -> Target to save to
8220    pub fn jpegsave_target(&self, target: &VipsTarget) -> Result<()> {
8221        let vips_op_response = call(
8222            "jpegsave_target",
8223            VOption::new()
8224                .set("in", self)
8225                .set(
8226                    "target",
8227                    target,
8228                ),
8229        );
8230
8231        utils::result(
8232            vips_op_response,
8233            (),
8234            Error::OperationError("JpegsaveTarget (vips_jpegsave_target) failed".to_string()),
8235        )
8236    }
8237
8238    /// VipsForeignSaveJpegTarget (jpegsave_target), save image to jpeg target (.jpg, .jpeg, .jpe, .jfif), priority=0, mono rgb cmyk
8239    ///
8240    /// target: `&VipsTarget` -> Target to save to
8241    ///
8242    /// <ins>Optional arguments</ins>
8243    ///
8244    /// Q: `i32` -> Q factor
8245    ///
8246    /// optimize_coding: `bool` -> Compute optimal Huffman coding tables
8247    ///
8248    /// interlace: `bool` -> Generate an interlaced (progressive) jpeg
8249    ///
8250    /// trellis_quant: `bool` -> Apply trellis quantisation to each 8x8 block
8251    ///
8252    /// overshoot_deringing: `bool` -> Apply overshooting to samples with extreme values
8253    ///
8254    /// optimize_scans: `bool` -> Split spectrum of DCT coefficients into separate scans
8255    ///
8256    /// quant_table: `i32` -> Use predefined quantization table with given index
8257    ///
8258    /// subsample_mode: [`ForeignSubsample`] -> Select chroma subsample operation mode
8259    ///
8260    /// restart_interval: `i32` -> Add restart markers every specified number of mcu
8261    ///
8262    /// keep: [`ForeignKeep`] -> Which metadata to retain
8263    ///
8264    /// background: `&[f64]` -> Background value
8265    ///
8266    /// page_height: `i32` -> Set page height for multipage save
8267    ///
8268    /// profile: `&str` -> Filename of ICC profile to embed
8269    pub fn jpegsave_target_with_opts(&self, target: &VipsTarget, option: VOption) -> Result<()> {
8270        let vips_op_response = call(
8271            "jpegsave_target",
8272            option
8273                .set("in", self)
8274                .set(
8275                    "target",
8276                    target,
8277                ),
8278        );
8279
8280        utils::result(
8281            vips_op_response,
8282            (),
8283            Error::OperationError("JpegsaveTarget (vips_jpegsave_target) failed".to_string()),
8284        )
8285    }
8286
8287    /// VipsForeignLoadJxlFile (jxlload), load JPEG-XL image (.jxl), priority=0, untrusted, is_a, get_flags, header, load
8288    /// returns `VipsImage` - Output image
8289    ///
8290    /// filename: `&str` -> Filename to load from
8291    pub fn jxlload(filename: &str) -> Result<VipsImage> {
8292        let mut out_out = VipsImage::from(null_mut());
8293        let vips_op_response = call(
8294            "jxlload",
8295            VOption::new()
8296                .set(
8297                    "filename",
8298                    filename,
8299                )
8300                .set(
8301                    "out",
8302                    &mut out_out,
8303                ),
8304        );
8305
8306        utils::result(
8307            vips_op_response,
8308            out_out,
8309            Error::OperationError("Jxlload (vips_jxlload) failed".to_string()),
8310        )
8311    }
8312
8313    /// VipsForeignLoadJxlFile (jxlload), load JPEG-XL image (.jxl), priority=0, untrusted, is_a, get_flags, header, load
8314    /// returns `VipsImage` - Output image
8315    ///
8316    /// filename: `&str` -> Filename to load from
8317    ///
8318    /// <ins>Optional arguments</ins>
8319    ///
8320    /// page: `i32` -> First page to load
8321    ///
8322    /// n: `i32` -> Number of pages to load, -1 for all
8323    ///
8324    /// flags: [`ForeignFlags`] -> Flags for this file
8325    ///
8326    /// memory: `bool` -> Force open via memory
8327    ///
8328    /// access: [`Access`] -> Required access pattern for this file
8329    ///
8330    /// fail_on: [`FailOn`] -> Error level to fail on
8331    ///
8332    /// revalidate: `bool` -> Don't use a cached result for this operation
8333    pub fn jxlload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
8334        let mut out_out = VipsImage::from(null_mut());
8335        let vips_op_response = call(
8336            "jxlload",
8337            option
8338                .set(
8339                    "filename",
8340                    filename,
8341                )
8342                .set(
8343                    "out",
8344                    &mut out_out,
8345                ),
8346        );
8347
8348        utils::result(
8349            vips_op_response,
8350            out_out,
8351            Error::OperationError("Jxlload (vips_jxlload) failed".to_string()),
8352        )
8353    }
8354
8355    /// VipsForeignLoadJxlBuffer (jxlload_buffer), load JPEG-XL image, priority=0, untrusted, is_a_buffer, get_flags, header, load
8356    /// returns `VipsImage` - Output image
8357    ///
8358    /// buffer: `&[u8]` -> Buffer to load from
8359    pub fn jxlload_buffer(buffer: &[u8]) -> Result<VipsImage> {
8360        let vips_blob = unsafe {
8361            vips_blob_new(
8362                None,
8363                buffer.as_ptr() as _,
8364                buffer.len() as _,
8365            )
8366        };
8367        let blob = VipsBlob::from(vips_blob);
8368        let mut out_out = VipsImage::from(null_mut());
8369        let vips_op_response = call(
8370            "jxlload_buffer",
8371            VOption::new()
8372                .set(
8373                    "buffer",
8374                    &blob,
8375                )
8376                .set(
8377                    "out",
8378                    &mut out_out,
8379                ),
8380        );
8381        blob.area_unref();
8382        utils::result(
8383            vips_op_response,
8384            out_out,
8385            Error::OperationError("JxlloadBuffer (vips_jxlload_buffer) failed".to_string()),
8386        )
8387    }
8388
8389    /// VipsForeignLoadJxlBuffer (jxlload_buffer), load JPEG-XL image, priority=0, untrusted, is_a_buffer, get_flags, header, load
8390    /// returns `VipsImage` - Output image
8391    ///
8392    /// buffer: `&[u8]` -> Buffer to load from
8393    ///
8394    /// <ins>Optional arguments</ins>
8395    ///
8396    /// page: `i32` -> First page to load
8397    ///
8398    /// n: `i32` -> Number of pages to load, -1 for all
8399    ///
8400    /// flags: [`ForeignFlags`] -> Flags for this file
8401    ///
8402    /// memory: `bool` -> Force open via memory
8403    ///
8404    /// access: [`Access`] -> Required access pattern for this file
8405    ///
8406    /// fail_on: [`FailOn`] -> Error level to fail on
8407    ///
8408    /// revalidate: `bool` -> Don't use a cached result for this operation
8409    pub fn jxlload_buffer_with_opts(buffer: &[u8], option: VOption) -> Result<VipsImage> {
8410        let vips_blob = unsafe {
8411            vips_blob_new(
8412                None,
8413                buffer.as_ptr() as _,
8414                buffer.len() as _,
8415            )
8416        };
8417        let blob = VipsBlob::from(vips_blob);
8418        let mut out_out = VipsImage::from(null_mut());
8419        let vips_op_response = call(
8420            "jxlload_buffer",
8421            option
8422                .set(
8423                    "buffer",
8424                    &blob,
8425                )
8426                .set(
8427                    "out",
8428                    &mut out_out,
8429                ),
8430        );
8431        blob.area_unref();
8432        utils::result(
8433            vips_op_response,
8434            out_out,
8435            Error::OperationError("JxlloadBuffer (vips_jxlload_buffer) failed".to_string()),
8436        )
8437    }
8438
8439    /// VipsForeignLoadJxlSource (jxlload_source), load JPEG-XL image, priority=0, untrusted, is_a_source, get_flags, header, load
8440    /// returns `VipsImage` - Output image
8441    ///
8442    /// source: `&VipsSource` -> Source to load from
8443    pub fn jxlload_source(source: &VipsSource) -> Result<VipsImage> {
8444        let mut out_out = VipsImage::from(null_mut());
8445        let vips_op_response = call(
8446            "jxlload_source",
8447            VOption::new()
8448                .set(
8449                    "source",
8450                    source,
8451                )
8452                .set(
8453                    "out",
8454                    &mut out_out,
8455                ),
8456        );
8457
8458        utils::result(
8459            vips_op_response,
8460            out_out,
8461            Error::OperationError("JxlloadSource (vips_jxlload_source) failed".to_string()),
8462        )
8463    }
8464
8465    /// VipsForeignLoadJxlSource (jxlload_source), load JPEG-XL image, priority=0, untrusted, is_a_source, get_flags, header, load
8466    /// returns `VipsImage` - Output image
8467    ///
8468    /// source: `&VipsSource` -> Source to load from
8469    ///
8470    /// <ins>Optional arguments</ins>
8471    ///
8472    /// page: `i32` -> First page to load
8473    ///
8474    /// n: `i32` -> Number of pages to load, -1 for all
8475    ///
8476    /// flags: [`ForeignFlags`] -> Flags for this file
8477    ///
8478    /// memory: `bool` -> Force open via memory
8479    ///
8480    /// access: [`Access`] -> Required access pattern for this file
8481    ///
8482    /// fail_on: [`FailOn`] -> Error level to fail on
8483    ///
8484    /// revalidate: `bool` -> Don't use a cached result for this operation
8485    pub fn jxlload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
8486        let mut out_out = VipsImage::from(null_mut());
8487        let vips_op_response = call(
8488            "jxlload_source",
8489            option
8490                .set(
8491                    "source",
8492                    source,
8493                )
8494                .set(
8495                    "out",
8496                    &mut out_out,
8497                ),
8498        );
8499
8500        utils::result(
8501            vips_op_response,
8502            out_out,
8503            Error::OperationError("JxlloadSource (vips_jxlload_source) failed".to_string()),
8504        )
8505    }
8506
8507    /// VipsForeignSaveJxlFile (jxlsave), save image in JPEG-XL format (.jxl), priority=0, untrusted,
8508    ///
8509    /// filename: `&str` -> Filename to save to
8510    pub fn jxlsave(&self, filename: &str) -> Result<()> {
8511        let vips_op_response = call(
8512            "jxlsave",
8513            VOption::new()
8514                .set("in", self)
8515                .set(
8516                    "filename",
8517                    filename,
8518                ),
8519        );
8520
8521        utils::result(
8522            vips_op_response,
8523            (),
8524            Error::OperationError("Jxlsave (vips_jxlsave) failed".to_string()),
8525        )
8526    }
8527
8528    /// VipsForeignSaveJxlFile (jxlsave), save image in JPEG-XL format (.jxl), priority=0, untrusted,
8529    ///
8530    /// filename: `&str` -> Filename to save to
8531    ///
8532    /// <ins>Optional arguments</ins>
8533    ///
8534    /// tier: `i32` -> Decode speed tier
8535    ///
8536    /// distance: `f64` -> Target butteraugli distance
8537    ///
8538    /// effort: `i32` -> Encoding effort
8539    ///
8540    /// lossless: `bool` -> Enable lossless compression
8541    ///
8542    /// Q: `i32` -> Quality factor
8543    ///
8544    /// keep: [`ForeignKeep`] -> Which metadata to retain
8545    ///
8546    /// background: `&[f64]` -> Background value
8547    ///
8548    /// page_height: `i32` -> Set page height for multipage save
8549    ///
8550    /// profile: `&str` -> Filename of ICC profile to embed
8551    pub fn jxlsave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
8552        let vips_op_response = call(
8553            "jxlsave",
8554            option
8555                .set("in", self)
8556                .set(
8557                    "filename",
8558                    filename,
8559                ),
8560        );
8561
8562        utils::result(
8563            vips_op_response,
8564            (),
8565            Error::OperationError("Jxlsave (vips_jxlsave) failed".to_string()),
8566        )
8567    }
8568
8569    /// VipsForeignSaveJxlBuffer (jxlsave_buffer), save image in JPEG-XL format (.jxl), priority=0, untrusted,
8570    /// returns `Vec<u8>` - Buffer to save to
8571    pub fn jxlsave_buffer(&self) -> Result<Vec<u8>> {
8572        let mut buffer_out = VipsBlob::from(null_mut());
8573        let vips_op_response = call(
8574            "jxlsave_buffer",
8575            VOption::new()
8576                .set("in", self)
8577                .set(
8578                    "buffer",
8579                    &mut buffer_out,
8580                ),
8581        );
8582
8583        utils::result(
8584            vips_op_response,
8585            buffer_out.into(),
8586            Error::OperationError("JxlsaveBuffer (vips_jxlsave_buffer) failed".to_string()),
8587        )
8588    }
8589
8590    /// VipsForeignSaveJxlBuffer (jxlsave_buffer), save image in JPEG-XL format (.jxl), priority=0, untrusted,
8591    /// returns `Vec<u8>` - Buffer to save to
8592    ///
8593    /// <ins>Optional arguments</ins>
8594    ///
8595    /// tier: `i32` -> Decode speed tier
8596    ///
8597    /// distance: `f64` -> Target butteraugli distance
8598    ///
8599    /// effort: `i32` -> Encoding effort
8600    ///
8601    /// lossless: `bool` -> Enable lossless compression
8602    ///
8603    /// Q: `i32` -> Quality factor
8604    ///
8605    /// keep: [`ForeignKeep`] -> Which metadata to retain
8606    ///
8607    /// background: `&[f64]` -> Background value
8608    ///
8609    /// page_height: `i32` -> Set page height for multipage save
8610    ///
8611    /// profile: `&str` -> Filename of ICC profile to embed
8612    pub fn jxlsave_buffer_with_opts(&self, option: VOption) -> Result<Vec<u8>> {
8613        let mut buffer_out = VipsBlob::from(null_mut());
8614        let vips_op_response = call(
8615            "jxlsave_buffer",
8616            option
8617                .set("in", self)
8618                .set(
8619                    "buffer",
8620                    &mut buffer_out,
8621                ),
8622        );
8623
8624        utils::result(
8625            vips_op_response,
8626            buffer_out.into(),
8627            Error::OperationError("JxlsaveBuffer (vips_jxlsave_buffer) failed".to_string()),
8628        )
8629    }
8630
8631    /// VipsForeignSaveJxlTarget (jxlsave_target), save image in JPEG-XL format (.jxl), priority=0, untrusted,
8632    ///
8633    /// target: `&VipsTarget` -> Target to save to
8634    pub fn jxlsave_target(&self, target: &VipsTarget) -> Result<()> {
8635        let vips_op_response = call(
8636            "jxlsave_target",
8637            VOption::new()
8638                .set("in", self)
8639                .set(
8640                    "target",
8641                    target,
8642                ),
8643        );
8644
8645        utils::result(
8646            vips_op_response,
8647            (),
8648            Error::OperationError("JxlsaveTarget (vips_jxlsave_target) failed".to_string()),
8649        )
8650    }
8651
8652    /// VipsForeignSaveJxlTarget (jxlsave_target), save image in JPEG-XL format (.jxl), priority=0, untrusted,
8653    ///
8654    /// target: `&VipsTarget` -> Target to save to
8655    ///
8656    /// <ins>Optional arguments</ins>
8657    ///
8658    /// tier: `i32` -> Decode speed tier
8659    ///
8660    /// distance: `f64` -> Target butteraugli distance
8661    ///
8662    /// effort: `i32` -> Encoding effort
8663    ///
8664    /// lossless: `bool` -> Enable lossless compression
8665    ///
8666    /// Q: `i32` -> Quality factor
8667    ///
8668    /// keep: [`ForeignKeep`] -> Which metadata to retain
8669    ///
8670    /// background: `&[f64]` -> Background value
8671    ///
8672    /// page_height: `i32` -> Set page height for multipage save
8673    ///
8674    /// profile: `&str` -> Filename of ICC profile to embed
8675    pub fn jxlsave_target_with_opts(&self, target: &VipsTarget, option: VOption) -> Result<()> {
8676        let vips_op_response = call(
8677            "jxlsave_target",
8678            option
8679                .set("in", self)
8680                .set(
8681                    "target",
8682                    target,
8683                ),
8684        );
8685
8686        utils::result(
8687            vips_op_response,
8688            (),
8689            Error::OperationError("JxlsaveTarget (vips_jxlsave_target) failed".to_string()),
8690        )
8691    }
8692
8693    /// VipsLabelregions (labelregions), label regions in an image
8694    /// returns `VipsImage` - Mask of region labels
8695    pub fn labelregions(&self) -> Result<VipsImage> {
8696        let mut mask_out = VipsImage::from(null_mut());
8697        let vips_op_response = call(
8698            "labelregions",
8699            VOption::new()
8700                .set("in", self)
8701                .set(
8702                    "mask",
8703                    &mut mask_out,
8704                ),
8705        );
8706
8707        utils::result(
8708            vips_op_response,
8709            mask_out,
8710            Error::OperationError("Labelregions (vips_labelregions) failed".to_string()),
8711        )
8712    }
8713
8714    /// VipsLabelregions (labelregions), label regions in an image
8715    /// returns `VipsImage` - Mask of region labels
8716    ///
8717    /// <ins>Optional arguments</ins>
8718    ///
8719    /// segments: `&mut i32` -> Number of discrete contiguous regions
8720    pub fn labelregions_with_opts(&self, option: VOption) -> Result<VipsImage> {
8721        let mut mask_out = VipsImage::from(null_mut());
8722        let vips_op_response = call(
8723            "labelregions",
8724            option
8725                .set("in", self)
8726                .set(
8727                    "mask",
8728                    &mut mask_out,
8729                ),
8730        );
8731
8732        utils::result(
8733            vips_op_response,
8734            mask_out,
8735            Error::OperationError("Labelregions (vips_labelregions) failed".to_string()),
8736        )
8737    }
8738
8739    /// VipsLinear (linear), calculate (a * in + b)
8740    /// returns `VipsImage` - Output image
8741    ///
8742    /// a: `&[f64]` -> Multiply by this
8743    ///
8744    /// b: `&[f64]` -> Add this
8745    pub fn linear(&self, a: &[f64], b: &[f64]) -> Result<VipsImage> {
8746        let mut out_out = VipsImage::from(null_mut());
8747        let vips_op_response = call(
8748            "linear",
8749            VOption::new()
8750                .set("in", self)
8751                .set(
8752                    "out",
8753                    &mut out_out,
8754                )
8755                .set("a", a)
8756                .set("b", b),
8757        );
8758
8759        utils::result(
8760            vips_op_response,
8761            out_out,
8762            Error::OperationError("Linear (vips_linear) failed".to_string()),
8763        )
8764    }
8765
8766    /// VipsLinear (linear), calculate (a * in + b)
8767    /// returns `VipsImage` - Output image
8768    ///
8769    /// a: `&[f64]` -> Multiply by this
8770    ///
8771    /// b: `&[f64]` -> Add this
8772    ///
8773    /// <ins>Optional arguments</ins>
8774    ///
8775    /// uchar: `bool` -> Output should be uchar
8776    pub fn linear_with_opts(&self, a: &[f64], b: &[f64], option: VOption) -> Result<VipsImage> {
8777        let mut out_out = VipsImage::from(null_mut());
8778        let vips_op_response = call(
8779            "linear",
8780            option
8781                .set("in", self)
8782                .set(
8783                    "out",
8784                    &mut out_out,
8785                )
8786                .set("a", a)
8787                .set("b", b),
8788        );
8789
8790        utils::result(
8791            vips_op_response,
8792            out_out,
8793            Error::OperationError("Linear (vips_linear) failed".to_string()),
8794        )
8795    }
8796
8797    /// VipsLineCache (linecache), cache an image as a set of lines
8798    /// returns `VipsImage` - Output image
8799    pub fn linecache(&self) -> Result<VipsImage> {
8800        let mut out_out = VipsImage::from(null_mut());
8801        let vips_op_response = call(
8802            "linecache",
8803            VOption::new()
8804                .set("in", self)
8805                .set(
8806                    "out",
8807                    &mut out_out,
8808                ),
8809        );
8810
8811        utils::result(
8812            vips_op_response,
8813            out_out,
8814            Error::OperationError("Linecache (vips_linecache) failed".to_string()),
8815        )
8816    }
8817
8818    /// VipsLineCache (linecache), cache an image as a set of lines
8819    /// returns `VipsImage` - Output image
8820    ///
8821    /// <ins>Optional arguments</ins>
8822    ///
8823    /// tile_height: `i32` -> Tile height in pixels
8824    ///
8825    /// access: [`Access`] -> Expected access pattern
8826    ///
8827    /// threaded: `bool` -> Allow threaded access
8828    ///
8829    /// persistent: `bool` -> Keep cache between evaluations
8830    pub fn linecache_with_opts(&self, option: VOption) -> Result<VipsImage> {
8831        let mut out_out = VipsImage::from(null_mut());
8832        let vips_op_response = call(
8833            "linecache",
8834            option
8835                .set("in", self)
8836                .set(
8837                    "out",
8838                    &mut out_out,
8839                ),
8840        );
8841
8842        utils::result(
8843            vips_op_response,
8844            out_out,
8845            Error::OperationError("Linecache (vips_linecache) failed".to_string()),
8846        )
8847    }
8848
8849    /// VipsLogmat (logmat), make a Laplacian of Gaussian image
8850    /// returns `VipsImage` - Output image
8851    ///
8852    /// sigma: `f64` -> Radius of Gaussian
8853    ///
8854    /// min_ampl: `f64` -> Minimum amplitude of Gaussian
8855    pub fn logmat(sigma: f64, min_ampl: f64) -> Result<VipsImage> {
8856        let mut out_out = VipsImage::from(null_mut());
8857        let vips_op_response = call(
8858            "logmat",
8859            VOption::new()
8860                .set(
8861                    "out",
8862                    &mut out_out,
8863                )
8864                .set(
8865                    "sigma",
8866                    sigma,
8867                )
8868                .set(
8869                    "min-ampl",
8870                    min_ampl,
8871                ),
8872        );
8873
8874        utils::result(
8875            vips_op_response,
8876            out_out,
8877            Error::OperationError("Logmat (vips_logmat) failed".to_string()),
8878        )
8879    }
8880
8881    /// VipsLogmat (logmat), make a Laplacian of Gaussian image
8882    /// returns `VipsImage` - Output image
8883    ///
8884    /// sigma: `f64` -> Radius of Gaussian
8885    ///
8886    /// min_ampl: `f64` -> Minimum amplitude of Gaussian
8887    ///
8888    /// <ins>Optional arguments</ins>
8889    ///
8890    /// separable: `bool` -> Generate separable Gaussian
8891    ///
8892    /// precision: [`Precision`] -> Generate with this precision
8893    pub fn logmat_with_opts(sigma: f64, min_ampl: f64, option: VOption) -> Result<VipsImage> {
8894        let mut out_out = VipsImage::from(null_mut());
8895        let vips_op_response = call(
8896            "logmat",
8897            option
8898                .set(
8899                    "out",
8900                    &mut out_out,
8901                )
8902                .set(
8903                    "sigma",
8904                    sigma,
8905                )
8906                .set(
8907                    "min-ampl",
8908                    min_ampl,
8909                ),
8910        );
8911
8912        utils::result(
8913            vips_op_response,
8914            out_out,
8915            Error::OperationError("Logmat (vips_logmat) failed".to_string()),
8916        )
8917    }
8918
8919    /// VipsMapim (mapim), resample with a map image
8920    /// returns `VipsImage` - Output image
8921    ///
8922    /// index: `&VipsImage` -> Index pixels with this
8923    pub fn mapim(&self, index: &VipsImage) -> Result<VipsImage> {
8924        let mut out_out = VipsImage::from(null_mut());
8925        let vips_op_response = call(
8926            "mapim",
8927            VOption::new()
8928                .set("in", self)
8929                .set(
8930                    "out",
8931                    &mut out_out,
8932                )
8933                .set(
8934                    "index",
8935                    index,
8936                ),
8937        );
8938
8939        utils::result(
8940            vips_op_response,
8941            out_out,
8942            Error::OperationError("Mapim (vips_mapim) failed".to_string()),
8943        )
8944    }
8945
8946    /// VipsMapim (mapim), resample with a map image
8947    /// returns `VipsImage` - Output image
8948    ///
8949    /// index: `&VipsImage` -> Index pixels with this
8950    ///
8951    /// <ins>Optional arguments</ins>
8952    ///
8953    /// interpolate: `&VipsInterpolate` -> Interpolate pixels with this
8954    ///
8955    /// background: `&[f64]` -> Background value
8956    ///
8957    /// premultiplied: `bool` -> Images have premultiplied alpha
8958    ///
8959    /// extend: [`Extend`] -> How to generate the extra pixels
8960    pub fn mapim_with_opts(&self, index: &VipsImage, option: VOption) -> Result<VipsImage> {
8961        let mut out_out = VipsImage::from(null_mut());
8962        let vips_op_response = call(
8963            "mapim",
8964            option
8965                .set("in", self)
8966                .set(
8967                    "out",
8968                    &mut out_out,
8969                )
8970                .set(
8971                    "index",
8972                    index,
8973                ),
8974        );
8975
8976        utils::result(
8977            vips_op_response,
8978            out_out,
8979            Error::OperationError("Mapim (vips_mapim) failed".to_string()),
8980        )
8981    }
8982
8983    /// VipsMaplut (maplut), map an image though a lut
8984    /// returns `VipsImage` - Output image
8985    ///
8986    /// lut: `&VipsImage` -> Look-up table image
8987    pub fn maplut(&self, lut: &VipsImage) -> Result<VipsImage> {
8988        let mut out_out = VipsImage::from(null_mut());
8989        let vips_op_response = call(
8990            "maplut",
8991            VOption::new()
8992                .set("in", self)
8993                .set(
8994                    "out",
8995                    &mut out_out,
8996                )
8997                .set("lut", lut),
8998        );
8999
9000        utils::result(
9001            vips_op_response,
9002            out_out,
9003            Error::OperationError("Maplut (vips_maplut) failed".to_string()),
9004        )
9005    }
9006
9007    /// VipsMaplut (maplut), map an image though a lut
9008    /// returns `VipsImage` - Output image
9009    ///
9010    /// lut: `&VipsImage` -> Look-up table image
9011    ///
9012    /// <ins>Optional arguments</ins>
9013    ///
9014    /// band: `i32` -> Apply one-band lut to this band of in
9015    pub fn maplut_with_opts(&self, lut: &VipsImage, option: VOption) -> Result<VipsImage> {
9016        let mut out_out = VipsImage::from(null_mut());
9017        let vips_op_response = call(
9018            "maplut",
9019            option
9020                .set("in", self)
9021                .set(
9022                    "out",
9023                    &mut out_out,
9024                )
9025                .set("lut", lut),
9026        );
9027
9028        utils::result(
9029            vips_op_response,
9030            out_out,
9031            Error::OperationError("Maplut (vips_maplut) failed".to_string()),
9032        )
9033    }
9034
9035    /// VipsMaskButterworth (mask_butterworth), make a butterworth filter
9036    /// returns `VipsImage` - Output image
9037    ///
9038    /// width: `i32` -> Image width in pixels
9039    ///
9040    /// height: `i32` -> Image height in pixels
9041    ///
9042    /// order: `f64` -> Filter order
9043    ///
9044    /// frequency_cutoff: `f64` -> Frequency cutoff
9045    ///
9046    /// amplitude_cutoff: `f64` -> Amplitude cutoff
9047    pub fn mask_butterworth(
9048        width: i32,
9049        height: i32,
9050        order: f64,
9051        frequency_cutoff: f64,
9052        amplitude_cutoff: f64,
9053    ) -> Result<VipsImage> {
9054        let mut out_out = VipsImage::from(null_mut());
9055        let vips_op_response = call(
9056            "mask_butterworth",
9057            VOption::new()
9058                .set(
9059                    "out",
9060                    &mut out_out,
9061                )
9062                .set(
9063                    "width",
9064                    width,
9065                )
9066                .set(
9067                    "height",
9068                    height,
9069                )
9070                .set(
9071                    "order",
9072                    order,
9073                )
9074                .set(
9075                    "frequency-cutoff",
9076                    frequency_cutoff,
9077                )
9078                .set(
9079                    "amplitude-cutoff",
9080                    amplitude_cutoff,
9081                ),
9082        );
9083
9084        utils::result(
9085            vips_op_response,
9086            out_out,
9087            Error::OperationError("MaskButterworth (vips_mask_butterworth) failed".to_string()),
9088        )
9089    }
9090
9091    /// VipsMaskButterworth (mask_butterworth), make a butterworth filter
9092    /// returns `VipsImage` - Output image
9093    ///
9094    /// width: `i32` -> Image width in pixels
9095    ///
9096    /// height: `i32` -> Image height in pixels
9097    ///
9098    /// order: `f64` -> Filter order
9099    ///
9100    /// frequency_cutoff: `f64` -> Frequency cutoff
9101    ///
9102    /// amplitude_cutoff: `f64` -> Amplitude cutoff
9103    ///
9104    /// <ins>Optional arguments</ins>
9105    ///
9106    /// uchar: `bool` -> Output an unsigned char image
9107    ///
9108    /// nodc: `bool` -> Remove DC component
9109    ///
9110    /// reject: `bool` -> Invert the sense of the filter
9111    ///
9112    /// optical: `bool` -> Rotate quadrants to optical space
9113    pub fn mask_butterworth_with_opts(
9114        width: i32,
9115        height: i32,
9116        order: f64,
9117        frequency_cutoff: f64,
9118        amplitude_cutoff: f64,
9119        option: VOption,
9120    ) -> Result<VipsImage> {
9121        let mut out_out = VipsImage::from(null_mut());
9122        let vips_op_response = call(
9123            "mask_butterworth",
9124            option
9125                .set(
9126                    "out",
9127                    &mut out_out,
9128                )
9129                .set(
9130                    "width",
9131                    width,
9132                )
9133                .set(
9134                    "height",
9135                    height,
9136                )
9137                .set(
9138                    "order",
9139                    order,
9140                )
9141                .set(
9142                    "frequency-cutoff",
9143                    frequency_cutoff,
9144                )
9145                .set(
9146                    "amplitude-cutoff",
9147                    amplitude_cutoff,
9148                ),
9149        );
9150
9151        utils::result(
9152            vips_op_response,
9153            out_out,
9154            Error::OperationError("MaskButterworth (vips_mask_butterworth) failed".to_string()),
9155        )
9156    }
9157
9158    /// VipsMaskButterworthBand (mask_butterworth_band), make a butterworth_band filter
9159    /// returns `VipsImage` - Output image
9160    ///
9161    /// width: `i32` -> Image width in pixels
9162    ///
9163    /// height: `i32` -> Image height in pixels
9164    ///
9165    /// order: `f64` -> Filter order
9166    ///
9167    /// frequency_cutoff_x: `f64` -> Frequency cutoff x
9168    ///
9169    /// frequency_cutoff_y: `f64` -> Frequency cutoff y
9170    ///
9171    /// radius: `f64` -> Radius of circle
9172    ///
9173    /// amplitude_cutoff: `f64` -> Amplitude cutoff
9174    pub fn mask_butterworth_band(
9175        width: i32,
9176        height: i32,
9177        order: f64,
9178        frequency_cutoff_x: f64,
9179        frequency_cutoff_y: f64,
9180        radius: f64,
9181        amplitude_cutoff: f64,
9182    ) -> Result<VipsImage> {
9183        let mut out_out = VipsImage::from(null_mut());
9184        let vips_op_response = call(
9185            "mask_butterworth_band",
9186            VOption::new()
9187                .set(
9188                    "out",
9189                    &mut out_out,
9190                )
9191                .set(
9192                    "width",
9193                    width,
9194                )
9195                .set(
9196                    "height",
9197                    height,
9198                )
9199                .set(
9200                    "order",
9201                    order,
9202                )
9203                .set(
9204                    "frequency-cutoff-x",
9205                    frequency_cutoff_x,
9206                )
9207                .set(
9208                    "frequency-cutoff-y",
9209                    frequency_cutoff_y,
9210                )
9211                .set(
9212                    "radius",
9213                    radius,
9214                )
9215                .set(
9216                    "amplitude-cutoff",
9217                    amplitude_cutoff,
9218                ),
9219        );
9220
9221        utils::result(
9222            vips_op_response,
9223            out_out,
9224            Error::OperationError(
9225                "MaskButterworthBand (vips_mask_butterworth_band) failed".to_string(),
9226            ),
9227        )
9228    }
9229
9230    /// VipsMaskButterworthBand (mask_butterworth_band), make a butterworth_band filter
9231    /// returns `VipsImage` - Output image
9232    ///
9233    /// width: `i32` -> Image width in pixels
9234    ///
9235    /// height: `i32` -> Image height in pixels
9236    ///
9237    /// order: `f64` -> Filter order
9238    ///
9239    /// frequency_cutoff_x: `f64` -> Frequency cutoff x
9240    ///
9241    /// frequency_cutoff_y: `f64` -> Frequency cutoff y
9242    ///
9243    /// radius: `f64` -> Radius of circle
9244    ///
9245    /// amplitude_cutoff: `f64` -> Amplitude cutoff
9246    ///
9247    /// <ins>Optional arguments</ins>
9248    ///
9249    /// uchar: `bool` -> Output an unsigned char image
9250    ///
9251    /// nodc: `bool` -> Remove DC component
9252    ///
9253    /// reject: `bool` -> Invert the sense of the filter
9254    ///
9255    /// optical: `bool` -> Rotate quadrants to optical space
9256    pub fn mask_butterworth_band_with_opts(
9257        width: i32,
9258        height: i32,
9259        order: f64,
9260        frequency_cutoff_x: f64,
9261        frequency_cutoff_y: f64,
9262        radius: f64,
9263        amplitude_cutoff: f64,
9264        option: VOption,
9265    ) -> Result<VipsImage> {
9266        let mut out_out = VipsImage::from(null_mut());
9267        let vips_op_response = call(
9268            "mask_butterworth_band",
9269            option
9270                .set(
9271                    "out",
9272                    &mut out_out,
9273                )
9274                .set(
9275                    "width",
9276                    width,
9277                )
9278                .set(
9279                    "height",
9280                    height,
9281                )
9282                .set(
9283                    "order",
9284                    order,
9285                )
9286                .set(
9287                    "frequency-cutoff-x",
9288                    frequency_cutoff_x,
9289                )
9290                .set(
9291                    "frequency-cutoff-y",
9292                    frequency_cutoff_y,
9293                )
9294                .set(
9295                    "radius",
9296                    radius,
9297                )
9298                .set(
9299                    "amplitude-cutoff",
9300                    amplitude_cutoff,
9301                ),
9302        );
9303
9304        utils::result(
9305            vips_op_response,
9306            out_out,
9307            Error::OperationError(
9308                "MaskButterworthBand (vips_mask_butterworth_band) failed".to_string(),
9309            ),
9310        )
9311    }
9312
9313    /// VipsMaskButterworthRing (mask_butterworth_ring), make a butterworth ring filter
9314    /// returns `VipsImage` - Output image
9315    ///
9316    /// width: `i32` -> Image width in pixels
9317    ///
9318    /// height: `i32` -> Image height in pixels
9319    ///
9320    /// order: `f64` -> Filter order
9321    ///
9322    /// frequency_cutoff: `f64` -> Frequency cutoff
9323    ///
9324    /// amplitude_cutoff: `f64` -> Amplitude cutoff
9325    ///
9326    /// ringwidth: `f64` -> Ringwidth
9327    pub fn mask_butterworth_ring(
9328        width: i32,
9329        height: i32,
9330        order: f64,
9331        frequency_cutoff: f64,
9332        amplitude_cutoff: f64,
9333        ringwidth: f64,
9334    ) -> Result<VipsImage> {
9335        let mut out_out = VipsImage::from(null_mut());
9336        let vips_op_response = call(
9337            "mask_butterworth_ring",
9338            VOption::new()
9339                .set(
9340                    "out",
9341                    &mut out_out,
9342                )
9343                .set(
9344                    "width",
9345                    width,
9346                )
9347                .set(
9348                    "height",
9349                    height,
9350                )
9351                .set(
9352                    "order",
9353                    order,
9354                )
9355                .set(
9356                    "frequency-cutoff",
9357                    frequency_cutoff,
9358                )
9359                .set(
9360                    "amplitude-cutoff",
9361                    amplitude_cutoff,
9362                )
9363                .set(
9364                    "ringwidth",
9365                    ringwidth,
9366                ),
9367        );
9368
9369        utils::result(
9370            vips_op_response,
9371            out_out,
9372            Error::OperationError(
9373                "MaskButterworthRing (vips_mask_butterworth_ring) failed".to_string(),
9374            ),
9375        )
9376    }
9377
9378    /// VipsMaskButterworthRing (mask_butterworth_ring), make a butterworth ring filter
9379    /// returns `VipsImage` - Output image
9380    ///
9381    /// width: `i32` -> Image width in pixels
9382    ///
9383    /// height: `i32` -> Image height in pixels
9384    ///
9385    /// order: `f64` -> Filter order
9386    ///
9387    /// frequency_cutoff: `f64` -> Frequency cutoff
9388    ///
9389    /// amplitude_cutoff: `f64` -> Amplitude cutoff
9390    ///
9391    /// ringwidth: `f64` -> Ringwidth
9392    ///
9393    /// <ins>Optional arguments</ins>
9394    ///
9395    /// uchar: `bool` -> Output an unsigned char image
9396    ///
9397    /// nodc: `bool` -> Remove DC component
9398    ///
9399    /// reject: `bool` -> Invert the sense of the filter
9400    ///
9401    /// optical: `bool` -> Rotate quadrants to optical space
9402    pub fn mask_butterworth_ring_with_opts(
9403        width: i32,
9404        height: i32,
9405        order: f64,
9406        frequency_cutoff: f64,
9407        amplitude_cutoff: f64,
9408        ringwidth: f64,
9409        option: VOption,
9410    ) -> Result<VipsImage> {
9411        let mut out_out = VipsImage::from(null_mut());
9412        let vips_op_response = call(
9413            "mask_butterworth_ring",
9414            option
9415                .set(
9416                    "out",
9417                    &mut out_out,
9418                )
9419                .set(
9420                    "width",
9421                    width,
9422                )
9423                .set(
9424                    "height",
9425                    height,
9426                )
9427                .set(
9428                    "order",
9429                    order,
9430                )
9431                .set(
9432                    "frequency-cutoff",
9433                    frequency_cutoff,
9434                )
9435                .set(
9436                    "amplitude-cutoff",
9437                    amplitude_cutoff,
9438                )
9439                .set(
9440                    "ringwidth",
9441                    ringwidth,
9442                ),
9443        );
9444
9445        utils::result(
9446            vips_op_response,
9447            out_out,
9448            Error::OperationError(
9449                "MaskButterworthRing (vips_mask_butterworth_ring) failed".to_string(),
9450            ),
9451        )
9452    }
9453
9454    /// VipsMaskFractal (mask_fractal), make fractal filter
9455    /// returns `VipsImage` - Output image
9456    ///
9457    /// width: `i32` -> Image width in pixels
9458    ///
9459    /// height: `i32` -> Image height in pixels
9460    ///
9461    /// fractal_dimension: `f64` -> Fractal dimension
9462    pub fn mask_fractal(width: i32, height: i32, fractal_dimension: f64) -> Result<VipsImage> {
9463        let mut out_out = VipsImage::from(null_mut());
9464        let vips_op_response = call(
9465            "mask_fractal",
9466            VOption::new()
9467                .set(
9468                    "out",
9469                    &mut out_out,
9470                )
9471                .set(
9472                    "width",
9473                    width,
9474                )
9475                .set(
9476                    "height",
9477                    height,
9478                )
9479                .set(
9480                    "fractal-dimension",
9481                    fractal_dimension,
9482                ),
9483        );
9484
9485        utils::result(
9486            vips_op_response,
9487            out_out,
9488            Error::OperationError("MaskFractal (vips_mask_fractal) failed".to_string()),
9489        )
9490    }
9491
9492    /// VipsMaskFractal (mask_fractal), make fractal filter
9493    /// returns `VipsImage` - Output image
9494    ///
9495    /// width: `i32` -> Image width in pixels
9496    ///
9497    /// height: `i32` -> Image height in pixels
9498    ///
9499    /// fractal_dimension: `f64` -> Fractal dimension
9500    ///
9501    /// <ins>Optional arguments</ins>
9502    ///
9503    /// uchar: `bool` -> Output an unsigned char image
9504    ///
9505    /// nodc: `bool` -> Remove DC component
9506    ///
9507    /// reject: `bool` -> Invert the sense of the filter
9508    ///
9509    /// optical: `bool` -> Rotate quadrants to optical space
9510    pub fn mask_fractal_with_opts(
9511        width: i32,
9512        height: i32,
9513        fractal_dimension: f64,
9514        option: VOption,
9515    ) -> Result<VipsImage> {
9516        let mut out_out = VipsImage::from(null_mut());
9517        let vips_op_response = call(
9518            "mask_fractal",
9519            option
9520                .set(
9521                    "out",
9522                    &mut out_out,
9523                )
9524                .set(
9525                    "width",
9526                    width,
9527                )
9528                .set(
9529                    "height",
9530                    height,
9531                )
9532                .set(
9533                    "fractal-dimension",
9534                    fractal_dimension,
9535                ),
9536        );
9537
9538        utils::result(
9539            vips_op_response,
9540            out_out,
9541            Error::OperationError("MaskFractal (vips_mask_fractal) failed".to_string()),
9542        )
9543    }
9544
9545    /// VipsMaskGaussian (mask_gaussian), make a gaussian filter
9546    /// returns `VipsImage` - Output image
9547    ///
9548    /// width: `i32` -> Image width in pixels
9549    ///
9550    /// height: `i32` -> Image height in pixels
9551    ///
9552    /// frequency_cutoff: `f64` -> Frequency cutoff
9553    ///
9554    /// amplitude_cutoff: `f64` -> Amplitude cutoff
9555    pub fn mask_gaussian(
9556        width: i32,
9557        height: i32,
9558        frequency_cutoff: f64,
9559        amplitude_cutoff: f64,
9560    ) -> Result<VipsImage> {
9561        let mut out_out = VipsImage::from(null_mut());
9562        let vips_op_response = call(
9563            "mask_gaussian",
9564            VOption::new()
9565                .set(
9566                    "out",
9567                    &mut out_out,
9568                )
9569                .set(
9570                    "width",
9571                    width,
9572                )
9573                .set(
9574                    "height",
9575                    height,
9576                )
9577                .set(
9578                    "frequency-cutoff",
9579                    frequency_cutoff,
9580                )
9581                .set(
9582                    "amplitude-cutoff",
9583                    amplitude_cutoff,
9584                ),
9585        );
9586
9587        utils::result(
9588            vips_op_response,
9589            out_out,
9590            Error::OperationError("MaskGaussian (vips_mask_gaussian) failed".to_string()),
9591        )
9592    }
9593
9594    /// VipsMaskGaussian (mask_gaussian), make a gaussian filter
9595    /// returns `VipsImage` - Output image
9596    ///
9597    /// width: `i32` -> Image width in pixels
9598    ///
9599    /// height: `i32` -> Image height in pixels
9600    ///
9601    /// frequency_cutoff: `f64` -> Frequency cutoff
9602    ///
9603    /// amplitude_cutoff: `f64` -> Amplitude cutoff
9604    ///
9605    /// <ins>Optional arguments</ins>
9606    ///
9607    /// uchar: `bool` -> Output an unsigned char image
9608    ///
9609    /// nodc: `bool` -> Remove DC component
9610    ///
9611    /// reject: `bool` -> Invert the sense of the filter
9612    ///
9613    /// optical: `bool` -> Rotate quadrants to optical space
9614    pub fn mask_gaussian_with_opts(
9615        width: i32,
9616        height: i32,
9617        frequency_cutoff: f64,
9618        amplitude_cutoff: f64,
9619        option: VOption,
9620    ) -> Result<VipsImage> {
9621        let mut out_out = VipsImage::from(null_mut());
9622        let vips_op_response = call(
9623            "mask_gaussian",
9624            option
9625                .set(
9626                    "out",
9627                    &mut out_out,
9628                )
9629                .set(
9630                    "width",
9631                    width,
9632                )
9633                .set(
9634                    "height",
9635                    height,
9636                )
9637                .set(
9638                    "frequency-cutoff",
9639                    frequency_cutoff,
9640                )
9641                .set(
9642                    "amplitude-cutoff",
9643                    amplitude_cutoff,
9644                ),
9645        );
9646
9647        utils::result(
9648            vips_op_response,
9649            out_out,
9650            Error::OperationError("MaskGaussian (vips_mask_gaussian) failed".to_string()),
9651        )
9652    }
9653
9654    /// VipsMaskGaussianBand (mask_gaussian_band), make a gaussian filter
9655    /// returns `VipsImage` - Output image
9656    ///
9657    /// width: `i32` -> Image width in pixels
9658    ///
9659    /// height: `i32` -> Image height in pixels
9660    ///
9661    /// frequency_cutoff_x: `f64` -> Frequency cutoff x
9662    ///
9663    /// frequency_cutoff_y: `f64` -> Frequency cutoff y
9664    ///
9665    /// radius: `f64` -> Radius of circle
9666    ///
9667    /// amplitude_cutoff: `f64` -> Amplitude cutoff
9668    pub fn mask_gaussian_band(
9669        width: i32,
9670        height: i32,
9671        frequency_cutoff_x: f64,
9672        frequency_cutoff_y: f64,
9673        radius: f64,
9674        amplitude_cutoff: f64,
9675    ) -> Result<VipsImage> {
9676        let mut out_out = VipsImage::from(null_mut());
9677        let vips_op_response = call(
9678            "mask_gaussian_band",
9679            VOption::new()
9680                .set(
9681                    "out",
9682                    &mut out_out,
9683                )
9684                .set(
9685                    "width",
9686                    width,
9687                )
9688                .set(
9689                    "height",
9690                    height,
9691                )
9692                .set(
9693                    "frequency-cutoff-x",
9694                    frequency_cutoff_x,
9695                )
9696                .set(
9697                    "frequency-cutoff-y",
9698                    frequency_cutoff_y,
9699                )
9700                .set(
9701                    "radius",
9702                    radius,
9703                )
9704                .set(
9705                    "amplitude-cutoff",
9706                    amplitude_cutoff,
9707                ),
9708        );
9709
9710        utils::result(
9711            vips_op_response,
9712            out_out,
9713            Error::OperationError("MaskGaussianBand (vips_mask_gaussian_band) failed".to_string()),
9714        )
9715    }
9716
9717    /// VipsMaskGaussianBand (mask_gaussian_band), make a gaussian filter
9718    /// returns `VipsImage` - Output image
9719    ///
9720    /// width: `i32` -> Image width in pixels
9721    ///
9722    /// height: `i32` -> Image height in pixels
9723    ///
9724    /// frequency_cutoff_x: `f64` -> Frequency cutoff x
9725    ///
9726    /// frequency_cutoff_y: `f64` -> Frequency cutoff y
9727    ///
9728    /// radius: `f64` -> Radius of circle
9729    ///
9730    /// amplitude_cutoff: `f64` -> Amplitude cutoff
9731    ///
9732    /// <ins>Optional arguments</ins>
9733    ///
9734    /// uchar: `bool` -> Output an unsigned char image
9735    ///
9736    /// nodc: `bool` -> Remove DC component
9737    ///
9738    /// reject: `bool` -> Invert the sense of the filter
9739    ///
9740    /// optical: `bool` -> Rotate quadrants to optical space
9741    pub fn mask_gaussian_band_with_opts(
9742        width: i32,
9743        height: i32,
9744        frequency_cutoff_x: f64,
9745        frequency_cutoff_y: f64,
9746        radius: f64,
9747        amplitude_cutoff: f64,
9748        option: VOption,
9749    ) -> Result<VipsImage> {
9750        let mut out_out = VipsImage::from(null_mut());
9751        let vips_op_response = call(
9752            "mask_gaussian_band",
9753            option
9754                .set(
9755                    "out",
9756                    &mut out_out,
9757                )
9758                .set(
9759                    "width",
9760                    width,
9761                )
9762                .set(
9763                    "height",
9764                    height,
9765                )
9766                .set(
9767                    "frequency-cutoff-x",
9768                    frequency_cutoff_x,
9769                )
9770                .set(
9771                    "frequency-cutoff-y",
9772                    frequency_cutoff_y,
9773                )
9774                .set(
9775                    "radius",
9776                    radius,
9777                )
9778                .set(
9779                    "amplitude-cutoff",
9780                    amplitude_cutoff,
9781                ),
9782        );
9783
9784        utils::result(
9785            vips_op_response,
9786            out_out,
9787            Error::OperationError("MaskGaussianBand (vips_mask_gaussian_band) failed".to_string()),
9788        )
9789    }
9790
9791    /// VipsMaskGaussianRing (mask_gaussian_ring), make a gaussian ring filter
9792    /// returns `VipsImage` - Output image
9793    ///
9794    /// width: `i32` -> Image width in pixels
9795    ///
9796    /// height: `i32` -> Image height in pixels
9797    ///
9798    /// frequency_cutoff: `f64` -> Frequency cutoff
9799    ///
9800    /// amplitude_cutoff: `f64` -> Amplitude cutoff
9801    ///
9802    /// ringwidth: `f64` -> Ringwidth
9803    pub fn mask_gaussian_ring(
9804        width: i32,
9805        height: i32,
9806        frequency_cutoff: f64,
9807        amplitude_cutoff: f64,
9808        ringwidth: f64,
9809    ) -> Result<VipsImage> {
9810        let mut out_out = VipsImage::from(null_mut());
9811        let vips_op_response = call(
9812            "mask_gaussian_ring",
9813            VOption::new()
9814                .set(
9815                    "out",
9816                    &mut out_out,
9817                )
9818                .set(
9819                    "width",
9820                    width,
9821                )
9822                .set(
9823                    "height",
9824                    height,
9825                )
9826                .set(
9827                    "frequency-cutoff",
9828                    frequency_cutoff,
9829                )
9830                .set(
9831                    "amplitude-cutoff",
9832                    amplitude_cutoff,
9833                )
9834                .set(
9835                    "ringwidth",
9836                    ringwidth,
9837                ),
9838        );
9839
9840        utils::result(
9841            vips_op_response,
9842            out_out,
9843            Error::OperationError("MaskGaussianRing (vips_mask_gaussian_ring) failed".to_string()),
9844        )
9845    }
9846
9847    /// VipsMaskGaussianRing (mask_gaussian_ring), make a gaussian ring filter
9848    /// returns `VipsImage` - Output image
9849    ///
9850    /// width: `i32` -> Image width in pixels
9851    ///
9852    /// height: `i32` -> Image height in pixels
9853    ///
9854    /// frequency_cutoff: `f64` -> Frequency cutoff
9855    ///
9856    /// amplitude_cutoff: `f64` -> Amplitude cutoff
9857    ///
9858    /// ringwidth: `f64` -> Ringwidth
9859    ///
9860    /// <ins>Optional arguments</ins>
9861    ///
9862    /// uchar: `bool` -> Output an unsigned char image
9863    ///
9864    /// nodc: `bool` -> Remove DC component
9865    ///
9866    /// reject: `bool` -> Invert the sense of the filter
9867    ///
9868    /// optical: `bool` -> Rotate quadrants to optical space
9869    pub fn mask_gaussian_ring_with_opts(
9870        width: i32,
9871        height: i32,
9872        frequency_cutoff: f64,
9873        amplitude_cutoff: f64,
9874        ringwidth: f64,
9875        option: VOption,
9876    ) -> Result<VipsImage> {
9877        let mut out_out = VipsImage::from(null_mut());
9878        let vips_op_response = call(
9879            "mask_gaussian_ring",
9880            option
9881                .set(
9882                    "out",
9883                    &mut out_out,
9884                )
9885                .set(
9886                    "width",
9887                    width,
9888                )
9889                .set(
9890                    "height",
9891                    height,
9892                )
9893                .set(
9894                    "frequency-cutoff",
9895                    frequency_cutoff,
9896                )
9897                .set(
9898                    "amplitude-cutoff",
9899                    amplitude_cutoff,
9900                )
9901                .set(
9902                    "ringwidth",
9903                    ringwidth,
9904                ),
9905        );
9906
9907        utils::result(
9908            vips_op_response,
9909            out_out,
9910            Error::OperationError("MaskGaussianRing (vips_mask_gaussian_ring) failed".to_string()),
9911        )
9912    }
9913
9914    /// VipsMaskIdeal (mask_ideal), make an ideal filter
9915    /// returns `VipsImage` - Output image
9916    ///
9917    /// width: `i32` -> Image width in pixels
9918    ///
9919    /// height: `i32` -> Image height in pixels
9920    ///
9921    /// frequency_cutoff: `f64` -> Frequency cutoff
9922    pub fn mask_ideal(width: i32, height: i32, frequency_cutoff: f64) -> Result<VipsImage> {
9923        let mut out_out = VipsImage::from(null_mut());
9924        let vips_op_response = call(
9925            "mask_ideal",
9926            VOption::new()
9927                .set(
9928                    "out",
9929                    &mut out_out,
9930                )
9931                .set(
9932                    "width",
9933                    width,
9934                )
9935                .set(
9936                    "height",
9937                    height,
9938                )
9939                .set(
9940                    "frequency-cutoff",
9941                    frequency_cutoff,
9942                ),
9943        );
9944
9945        utils::result(
9946            vips_op_response,
9947            out_out,
9948            Error::OperationError("MaskIdeal (vips_mask_ideal) failed".to_string()),
9949        )
9950    }
9951
9952    /// VipsMaskIdeal (mask_ideal), make an ideal filter
9953    /// returns `VipsImage` - Output image
9954    ///
9955    /// width: `i32` -> Image width in pixels
9956    ///
9957    /// height: `i32` -> Image height in pixels
9958    ///
9959    /// frequency_cutoff: `f64` -> Frequency cutoff
9960    ///
9961    /// <ins>Optional arguments</ins>
9962    ///
9963    /// uchar: `bool` -> Output an unsigned char image
9964    ///
9965    /// nodc: `bool` -> Remove DC component
9966    ///
9967    /// reject: `bool` -> Invert the sense of the filter
9968    ///
9969    /// optical: `bool` -> Rotate quadrants to optical space
9970    pub fn mask_ideal_with_opts(
9971        width: i32,
9972        height: i32,
9973        frequency_cutoff: f64,
9974        option: VOption,
9975    ) -> Result<VipsImage> {
9976        let mut out_out = VipsImage::from(null_mut());
9977        let vips_op_response = call(
9978            "mask_ideal",
9979            option
9980                .set(
9981                    "out",
9982                    &mut out_out,
9983                )
9984                .set(
9985                    "width",
9986                    width,
9987                )
9988                .set(
9989                    "height",
9990                    height,
9991                )
9992                .set(
9993                    "frequency-cutoff",
9994                    frequency_cutoff,
9995                ),
9996        );
9997
9998        utils::result(
9999            vips_op_response,
10000            out_out,
10001            Error::OperationError("MaskIdeal (vips_mask_ideal) failed".to_string()),
10002        )
10003    }
10004
10005    /// VipsMaskIdealBand (mask_ideal_band), make an ideal band filter
10006    /// returns `VipsImage` - Output image
10007    ///
10008    /// width: `i32` -> Image width in pixels
10009    ///
10010    /// height: `i32` -> Image height in pixels
10011    ///
10012    /// frequency_cutoff_x: `f64` -> Frequency cutoff x
10013    ///
10014    /// frequency_cutoff_y: `f64` -> Frequency cutoff y
10015    ///
10016    /// radius: `f64` -> Radius of circle
10017    pub fn mask_ideal_band(
10018        width: i32,
10019        height: i32,
10020        frequency_cutoff_x: f64,
10021        frequency_cutoff_y: f64,
10022        radius: f64,
10023    ) -> Result<VipsImage> {
10024        let mut out_out = VipsImage::from(null_mut());
10025        let vips_op_response = call(
10026            "mask_ideal_band",
10027            VOption::new()
10028                .set(
10029                    "out",
10030                    &mut out_out,
10031                )
10032                .set(
10033                    "width",
10034                    width,
10035                )
10036                .set(
10037                    "height",
10038                    height,
10039                )
10040                .set(
10041                    "frequency-cutoff-x",
10042                    frequency_cutoff_x,
10043                )
10044                .set(
10045                    "frequency-cutoff-y",
10046                    frequency_cutoff_y,
10047                )
10048                .set(
10049                    "radius",
10050                    radius,
10051                ),
10052        );
10053
10054        utils::result(
10055            vips_op_response,
10056            out_out,
10057            Error::OperationError("MaskIdealBand (vips_mask_ideal_band) failed".to_string()),
10058        )
10059    }
10060
10061    /// VipsMaskIdealBand (mask_ideal_band), make an ideal band filter
10062    /// returns `VipsImage` - Output image
10063    ///
10064    /// width: `i32` -> Image width in pixels
10065    ///
10066    /// height: `i32` -> Image height in pixels
10067    ///
10068    /// frequency_cutoff_x: `f64` -> Frequency cutoff x
10069    ///
10070    /// frequency_cutoff_y: `f64` -> Frequency cutoff y
10071    ///
10072    /// radius: `f64` -> Radius of circle
10073    ///
10074    /// <ins>Optional arguments</ins>
10075    ///
10076    /// uchar: `bool` -> Output an unsigned char image
10077    ///
10078    /// nodc: `bool` -> Remove DC component
10079    ///
10080    /// reject: `bool` -> Invert the sense of the filter
10081    ///
10082    /// optical: `bool` -> Rotate quadrants to optical space
10083    pub fn mask_ideal_band_with_opts(
10084        width: i32,
10085        height: i32,
10086        frequency_cutoff_x: f64,
10087        frequency_cutoff_y: f64,
10088        radius: f64,
10089        option: VOption,
10090    ) -> Result<VipsImage> {
10091        let mut out_out = VipsImage::from(null_mut());
10092        let vips_op_response = call(
10093            "mask_ideal_band",
10094            option
10095                .set(
10096                    "out",
10097                    &mut out_out,
10098                )
10099                .set(
10100                    "width",
10101                    width,
10102                )
10103                .set(
10104                    "height",
10105                    height,
10106                )
10107                .set(
10108                    "frequency-cutoff-x",
10109                    frequency_cutoff_x,
10110                )
10111                .set(
10112                    "frequency-cutoff-y",
10113                    frequency_cutoff_y,
10114                )
10115                .set(
10116                    "radius",
10117                    radius,
10118                ),
10119        );
10120
10121        utils::result(
10122            vips_op_response,
10123            out_out,
10124            Error::OperationError("MaskIdealBand (vips_mask_ideal_band) failed".to_string()),
10125        )
10126    }
10127
10128    /// VipsMaskIdealRing (mask_ideal_ring), make an ideal ring filter
10129    /// returns `VipsImage` - Output image
10130    ///
10131    /// width: `i32` -> Image width in pixels
10132    ///
10133    /// height: `i32` -> Image height in pixels
10134    ///
10135    /// frequency_cutoff: `f64` -> Frequency cutoff
10136    ///
10137    /// ringwidth: `f64` -> Ringwidth
10138    pub fn mask_ideal_ring(
10139        width: i32,
10140        height: i32,
10141        frequency_cutoff: f64,
10142        ringwidth: f64,
10143    ) -> Result<VipsImage> {
10144        let mut out_out = VipsImage::from(null_mut());
10145        let vips_op_response = call(
10146            "mask_ideal_ring",
10147            VOption::new()
10148                .set(
10149                    "out",
10150                    &mut out_out,
10151                )
10152                .set(
10153                    "width",
10154                    width,
10155                )
10156                .set(
10157                    "height",
10158                    height,
10159                )
10160                .set(
10161                    "frequency-cutoff",
10162                    frequency_cutoff,
10163                )
10164                .set(
10165                    "ringwidth",
10166                    ringwidth,
10167                ),
10168        );
10169
10170        utils::result(
10171            vips_op_response,
10172            out_out,
10173            Error::OperationError("MaskIdealRing (vips_mask_ideal_ring) failed".to_string()),
10174        )
10175    }
10176
10177    /// VipsMaskIdealRing (mask_ideal_ring), make an ideal ring filter
10178    /// returns `VipsImage` - Output image
10179    ///
10180    /// width: `i32` -> Image width in pixels
10181    ///
10182    /// height: `i32` -> Image height in pixels
10183    ///
10184    /// frequency_cutoff: `f64` -> Frequency cutoff
10185    ///
10186    /// ringwidth: `f64` -> Ringwidth
10187    ///
10188    /// <ins>Optional arguments</ins>
10189    ///
10190    /// uchar: `bool` -> Output an unsigned char image
10191    ///
10192    /// nodc: `bool` -> Remove DC component
10193    ///
10194    /// reject: `bool` -> Invert the sense of the filter
10195    ///
10196    /// optical: `bool` -> Rotate quadrants to optical space
10197    pub fn mask_ideal_ring_with_opts(
10198        width: i32,
10199        height: i32,
10200        frequency_cutoff: f64,
10201        ringwidth: f64,
10202        option: VOption,
10203    ) -> Result<VipsImage> {
10204        let mut out_out = VipsImage::from(null_mut());
10205        let vips_op_response = call(
10206            "mask_ideal_ring",
10207            option
10208                .set(
10209                    "out",
10210                    &mut out_out,
10211                )
10212                .set(
10213                    "width",
10214                    width,
10215                )
10216                .set(
10217                    "height",
10218                    height,
10219                )
10220                .set(
10221                    "frequency-cutoff",
10222                    frequency_cutoff,
10223                )
10224                .set(
10225                    "ringwidth",
10226                    ringwidth,
10227                ),
10228        );
10229
10230        utils::result(
10231            vips_op_response,
10232            out_out,
10233            Error::OperationError("MaskIdealRing (vips_mask_ideal_ring) failed".to_string()),
10234        )
10235    }
10236
10237    /// VipsMatch (match), first-order match of two images
10238    /// returns `VipsImage` - Output image
10239    ///
10240    /// sec: `&VipsImage` -> Secondary image
10241    ///
10242    /// xr1: `i32` -> Position of first reference tie-point
10243    ///
10244    /// yr1: `i32` -> Position of first reference tie-point
10245    ///
10246    /// xs1: `i32` -> Position of first secondary tie-point
10247    ///
10248    /// ys1: `i32` -> Position of first secondary tie-point
10249    ///
10250    /// xr2: `i32` -> Position of second reference tie-point
10251    ///
10252    /// yr2: `i32` -> Position of second reference tie-point
10253    ///
10254    /// xs2: `i32` -> Position of second secondary tie-point
10255    ///
10256    /// ys2: `i32` -> Position of second secondary tie-point
10257    pub fn matches(
10258        &self,
10259        sec: &VipsImage,
10260        xr1: i32,
10261        yr1: i32,
10262        xs1: i32,
10263        ys1: i32,
10264        xr2: i32,
10265        yr2: i32,
10266        xs2: i32,
10267        ys2: i32,
10268    ) -> Result<VipsImage> {
10269        let mut out_out = VipsImage::from(null_mut());
10270        let vips_op_response = call(
10271            "match",
10272            VOption::new()
10273                .set(
10274                    "ref", self,
10275                )
10276                .set("sec", sec)
10277                .set(
10278                    "out",
10279                    &mut out_out,
10280                )
10281                .set("xr1", xr1)
10282                .set("yr1", yr1)
10283                .set("xs1", xs1)
10284                .set("ys1", ys1)
10285                .set("xr2", xr2)
10286                .set("yr2", yr2)
10287                .set("xs2", xs2)
10288                .set("ys2", ys2),
10289        );
10290
10291        utils::result(
10292            vips_op_response,
10293            out_out,
10294            Error::OperationError("Matchs (vips_match) failed".to_string()),
10295        )
10296    }
10297
10298    /// VipsMatch (match), first-order match of two images
10299    /// returns `VipsImage` - Output image
10300    ///
10301    /// sec: `&VipsImage` -> Secondary image
10302    ///
10303    /// xr1: `i32` -> Position of first reference tie-point
10304    ///
10305    /// yr1: `i32` -> Position of first reference tie-point
10306    ///
10307    /// xs1: `i32` -> Position of first secondary tie-point
10308    ///
10309    /// ys1: `i32` -> Position of first secondary tie-point
10310    ///
10311    /// xr2: `i32` -> Position of second reference tie-point
10312    ///
10313    /// yr2: `i32` -> Position of second reference tie-point
10314    ///
10315    /// xs2: `i32` -> Position of second secondary tie-point
10316    ///
10317    /// ys2: `i32` -> Position of second secondary tie-point
10318    ///
10319    /// <ins>Optional arguments</ins>
10320    ///
10321    /// hwindow: `i32` -> Half window size
10322    ///
10323    /// harea: `i32` -> Half area size
10324    ///
10325    /// search: `bool` -> Search to improve tie-points
10326    ///
10327    /// interpolate: `&VipsInterpolate` -> Interpolate pixels with this
10328    pub fn matches_with_opts(
10329        &self,
10330        sec: &VipsImage,
10331        xr1: i32,
10332        yr1: i32,
10333        xs1: i32,
10334        ys1: i32,
10335        xr2: i32,
10336        yr2: i32,
10337        xs2: i32,
10338        ys2: i32,
10339        option: VOption,
10340    ) -> Result<VipsImage> {
10341        let mut out_out = VipsImage::from(null_mut());
10342        let vips_op_response = call(
10343            "match",
10344            option
10345                .set(
10346                    "ref", self,
10347                )
10348                .set("sec", sec)
10349                .set(
10350                    "out",
10351                    &mut out_out,
10352                )
10353                .set("xr1", xr1)
10354                .set("yr1", yr1)
10355                .set("xs1", xs1)
10356                .set("ys1", ys1)
10357                .set("xr2", xr2)
10358                .set("yr2", yr2)
10359                .set("xs2", xs2)
10360                .set("ys2", ys2),
10361        );
10362
10363        utils::result(
10364            vips_op_response,
10365            out_out,
10366            Error::OperationError("Matchs (vips_match) failed".to_string()),
10367        )
10368    }
10369
10370    /// VipsMath2 (math2), binary math operations
10371    /// returns `VipsImage` - Output image
10372    ///
10373    /// right: `&VipsImage` -> Right-hand image argument
10374    ///
10375    /// math2: `OperationMath2` -> Math to perform
10376    pub fn math2(&self, right: &VipsImage, math2: OperationMath2) -> Result<VipsImage> {
10377        let mut out_out = VipsImage::from(null_mut());
10378        let vips_op_response = call(
10379            "math2",
10380            VOption::new()
10381                .set(
10382                    "left",
10383                    self,
10384                )
10385                .set(
10386                    "right",
10387                    right,
10388                )
10389                .set(
10390                    "out",
10391                    &mut out_out,
10392                )
10393                .set(
10394                    "math2",
10395                    math2 as i32,
10396                ),
10397        );
10398
10399        utils::result(
10400            vips_op_response,
10401            out_out,
10402            Error::OperationError("Math2 (vips_math2) failed".to_string()),
10403        )
10404    }
10405
10406    /// VipsMath2Const (math2_const), binary math operations with a constant
10407    /// returns `VipsImage` - Output image
10408    ///
10409    /// math2: `OperationMath2` -> Math to perform
10410    ///
10411    /// c: `&[f64]` -> Array of constants
10412    pub fn math2_const(&self, math2: OperationMath2, c: &[f64]) -> Result<VipsImage> {
10413        let mut out_out = VipsImage::from(null_mut());
10414        let vips_op_response = call(
10415            "math2_const",
10416            VOption::new()
10417                .set("in", self)
10418                .set(
10419                    "out",
10420                    &mut out_out,
10421                )
10422                .set(
10423                    "math2",
10424                    math2 as i32,
10425                )
10426                .set("c", c),
10427        );
10428
10429        utils::result(
10430            vips_op_response,
10431            out_out,
10432            Error::OperationError("Math2Const (vips_math2_const) failed".to_string()),
10433        )
10434    }
10435
10436    /// VipsMath (math), apply a math operation to an image
10437    /// returns `VipsImage` - Output image
10438    ///
10439    /// math: `OperationMath` -> Math to perform
10440    pub fn math(&self, math: OperationMath) -> Result<VipsImage> {
10441        let mut out_out = VipsImage::from(null_mut());
10442        let vips_op_response = call(
10443            "math",
10444            VOption::new()
10445                .set("in", self)
10446                .set(
10447                    "out",
10448                    &mut out_out,
10449                )
10450                .set(
10451                    "math",
10452                    math as i32,
10453                ),
10454        );
10455
10456        utils::result(
10457            vips_op_response,
10458            out_out,
10459            Error::OperationError("Math (vips_math) failed".to_string()),
10460        )
10461    }
10462
10463    /// VipsForeignLoadMat (matload), load mat from file (.mat), priority=0, untrusted, is_a, get_flags, get_flags_filename, header, load
10464    /// returns `VipsImage` - Output image
10465    ///
10466    /// filename: `&str` -> Filename to load from
10467    pub fn matload(filename: &str) -> Result<VipsImage> {
10468        let mut out_out = VipsImage::from(null_mut());
10469        let vips_op_response = call(
10470            "matload",
10471            VOption::new()
10472                .set(
10473                    "filename",
10474                    filename,
10475                )
10476                .set(
10477                    "out",
10478                    &mut out_out,
10479                ),
10480        );
10481
10482        utils::result(
10483            vips_op_response,
10484            out_out,
10485            Error::OperationError("Matload (vips_matload) failed".to_string()),
10486        )
10487    }
10488
10489    /// VipsForeignLoadMat (matload), load mat from file (.mat), priority=0, untrusted, is_a, get_flags, get_flags_filename, header, load
10490    /// returns `VipsImage` - Output image
10491    ///
10492    /// filename: `&str` -> Filename to load from
10493    ///
10494    /// <ins>Optional arguments</ins>
10495    ///
10496    /// flags: [`ForeignFlags`] -> Flags for this file
10497    ///
10498    /// memory: `bool` -> Force open via memory
10499    ///
10500    /// access: [`Access`] -> Required access pattern for this file
10501    ///
10502    /// fail_on: [`FailOn`] -> Error level to fail on
10503    ///
10504    /// revalidate: `bool` -> Don't use a cached result for this operation
10505    pub fn matload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
10506        let mut out_out = VipsImage::from(null_mut());
10507        let vips_op_response = call(
10508            "matload",
10509            option
10510                .set(
10511                    "filename",
10512                    filename,
10513                )
10514                .set(
10515                    "out",
10516                    &mut out_out,
10517                ),
10518        );
10519
10520        utils::result(
10521            vips_op_response,
10522            out_out,
10523            Error::OperationError("Matload (vips_matload) failed".to_string()),
10524        )
10525    }
10526
10527    /// VipsMatrixinvert (matrixinvert), invert a matrix
10528    /// returns `VipsImage` - Output matrix
10529    pub fn matrixinvert(&self) -> Result<VipsImage> {
10530        let mut out_out = VipsImage::from(null_mut());
10531        let vips_op_response = call(
10532            "matrixinvert",
10533            VOption::new()
10534                .set("in", self)
10535                .set(
10536                    "out",
10537                    &mut out_out,
10538                ),
10539        );
10540
10541        utils::result(
10542            vips_op_response,
10543            out_out,
10544            Error::OperationError("Matrixinvert (vips_matrixinvert) failed".to_string()),
10545        )
10546    }
10547
10548    /// VipsForeignLoadMatrixFile (matrixload), load matrix (.mat), priority=0, is_a, get_flags, get_flags_filename, header, load
10549    /// returns `VipsImage` - Output image
10550    ///
10551    /// filename: `&str` -> Filename to load from
10552    pub fn matrixload(filename: &str) -> Result<VipsImage> {
10553        let mut out_out = VipsImage::from(null_mut());
10554        let vips_op_response = call(
10555            "matrixload",
10556            VOption::new()
10557                .set(
10558                    "filename",
10559                    filename,
10560                )
10561                .set(
10562                    "out",
10563                    &mut out_out,
10564                ),
10565        );
10566
10567        utils::result(
10568            vips_op_response,
10569            out_out,
10570            Error::OperationError("Matrixload (vips_matrixload) failed".to_string()),
10571        )
10572    }
10573
10574    /// VipsForeignLoadMatrixFile (matrixload), load matrix (.mat), priority=0, is_a, get_flags, get_flags_filename, header, load
10575    /// returns `VipsImage` - Output image
10576    ///
10577    /// filename: `&str` -> Filename to load from
10578    ///
10579    /// <ins>Optional arguments</ins>
10580    ///
10581    /// flags: [`ForeignFlags`] -> Flags for this file
10582    ///
10583    /// memory: `bool` -> Force open via memory
10584    ///
10585    /// access: [`Access`] -> Required access pattern for this file
10586    ///
10587    /// fail_on: [`FailOn`] -> Error level to fail on
10588    ///
10589    /// revalidate: `bool` -> Don't use a cached result for this operation
10590    pub fn matrixload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
10591        let mut out_out = VipsImage::from(null_mut());
10592        let vips_op_response = call(
10593            "matrixload",
10594            option
10595                .set(
10596                    "filename",
10597                    filename,
10598                )
10599                .set(
10600                    "out",
10601                    &mut out_out,
10602                ),
10603        );
10604
10605        utils::result(
10606            vips_op_response,
10607            out_out,
10608            Error::OperationError("Matrixload (vips_matrixload) failed".to_string()),
10609        )
10610    }
10611
10612    /// VipsForeignLoadMatrixSource (matrixload_source), load matrix, priority=0, is_a_source, get_flags, header, load
10613    /// returns `VipsImage` - Output image
10614    ///
10615    /// source: `&VipsSource` -> Source to load from
10616    pub fn matrixload_source(source: &VipsSource) -> Result<VipsImage> {
10617        let mut out_out = VipsImage::from(null_mut());
10618        let vips_op_response = call(
10619            "matrixload_source",
10620            VOption::new()
10621                .set(
10622                    "source",
10623                    source,
10624                )
10625                .set(
10626                    "out",
10627                    &mut out_out,
10628                ),
10629        );
10630
10631        utils::result(
10632            vips_op_response,
10633            out_out,
10634            Error::OperationError("MatrixloadSource (vips_matrixload_source) failed".to_string()),
10635        )
10636    }
10637
10638    /// VipsForeignLoadMatrixSource (matrixload_source), load matrix, priority=0, is_a_source, get_flags, header, load
10639    /// returns `VipsImage` - Output image
10640    ///
10641    /// source: `&VipsSource` -> Source to load from
10642    ///
10643    /// <ins>Optional arguments</ins>
10644    ///
10645    /// flags: [`ForeignFlags`] -> Flags for this file
10646    ///
10647    /// memory: `bool` -> Force open via memory
10648    ///
10649    /// access: [`Access`] -> Required access pattern for this file
10650    ///
10651    /// fail_on: [`FailOn`] -> Error level to fail on
10652    ///
10653    /// revalidate: `bool` -> Don't use a cached result for this operation
10654    pub fn matrixload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
10655        let mut out_out = VipsImage::from(null_mut());
10656        let vips_op_response = call(
10657            "matrixload_source",
10658            option
10659                .set(
10660                    "source",
10661                    source,
10662                )
10663                .set(
10664                    "out",
10665                    &mut out_out,
10666                ),
10667        );
10668
10669        utils::result(
10670            vips_op_response,
10671            out_out,
10672            Error::OperationError("MatrixloadSource (vips_matrixload_source) failed".to_string()),
10673        )
10674    }
10675
10676    /// VipsMatrixmultiply (matrixmultiply), multiply two matrices
10677    /// returns `VipsImage` - Output matrix
10678    ///
10679    /// right: `&VipsImage` -> Second matrix to multiply
10680    pub fn matrixmultiply(&self, right: &VipsImage) -> Result<VipsImage> {
10681        let mut out_out = VipsImage::from(null_mut());
10682        let vips_op_response = call(
10683            "matrixmultiply",
10684            VOption::new()
10685                .set(
10686                    "left",
10687                    self,
10688                )
10689                .set(
10690                    "right",
10691                    right,
10692                )
10693                .set(
10694                    "out",
10695                    &mut out_out,
10696                ),
10697        );
10698
10699        utils::result(
10700            vips_op_response,
10701            out_out,
10702            Error::OperationError("Matrixmultiply (vips_matrixmultiply) failed".to_string()),
10703        )
10704    }
10705
10706    /// VipsForeignPrintMatrix (matrixprint), print matrix (.mat), priority=0, mono
10707    pub fn matrixprint(&self) -> Result<()> {
10708        let vips_op_response = call(
10709            "matrixprint",
10710            VOption::new().set("in", self),
10711        );
10712
10713        utils::result(
10714            vips_op_response,
10715            (),
10716            Error::OperationError("Matrixprint (vips_matrixprint) failed".to_string()),
10717        )
10718    }
10719
10720    /// VipsForeignPrintMatrix (matrixprint), print matrix (.mat), priority=0, mono
10721    ///
10722    /// <ins>Optional arguments</ins>
10723    ///
10724    /// keep: [`ForeignKeep`] -> Which metadata to retain
10725    ///
10726    /// background: `&[f64]` -> Background value
10727    ///
10728    /// page_height: `i32` -> Set page height for multipage save
10729    ///
10730    /// profile: `&str` -> Filename of ICC profile to embed
10731    pub fn matrixprint_with_opts(&self, option: VOption) -> Result<()> {
10732        let vips_op_response = call(
10733            "matrixprint",
10734            option.set("in", self),
10735        );
10736
10737        utils::result(
10738            vips_op_response,
10739            (),
10740            Error::OperationError("Matrixprint (vips_matrixprint) failed".to_string()),
10741        )
10742    }
10743
10744    /// VipsForeignSaveMatrixFile (matrixsave), save image to matrix (.mat), priority=0, mono
10745    ///
10746    /// filename: `&str` -> Filename to save to
10747    pub fn matrixsave(&self, filename: &str) -> Result<()> {
10748        let vips_op_response = call(
10749            "matrixsave",
10750            VOption::new()
10751                .set("in", self)
10752                .set(
10753                    "filename",
10754                    filename,
10755                ),
10756        );
10757
10758        utils::result(
10759            vips_op_response,
10760            (),
10761            Error::OperationError("Matrixsave (vips_matrixsave) failed".to_string()),
10762        )
10763    }
10764
10765    /// VipsForeignSaveMatrixFile (matrixsave), save image to matrix (.mat), priority=0, mono
10766    ///
10767    /// filename: `&str` -> Filename to save to
10768    ///
10769    /// <ins>Optional arguments</ins>
10770    ///
10771    /// keep: [`ForeignKeep`] -> Which metadata to retain
10772    ///
10773    /// background: `&[f64]` -> Background value
10774    ///
10775    /// page_height: `i32` -> Set page height for multipage save
10776    ///
10777    /// profile: `&str` -> Filename of ICC profile to embed
10778    pub fn matrixsave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
10779        let vips_op_response = call(
10780            "matrixsave",
10781            option
10782                .set("in", self)
10783                .set(
10784                    "filename",
10785                    filename,
10786                ),
10787        );
10788
10789        utils::result(
10790            vips_op_response,
10791            (),
10792            Error::OperationError("Matrixsave (vips_matrixsave) failed".to_string()),
10793        )
10794    }
10795
10796    /// VipsForeignSaveMatrixTarget (matrixsave_target), save image to matrix (.mat), priority=0, mono
10797    ///
10798    /// target: `&VipsTarget` -> Target to save to
10799    pub fn matrixsave_target(&self, target: &VipsTarget) -> Result<()> {
10800        let vips_op_response = call(
10801            "matrixsave_target",
10802            VOption::new()
10803                .set("in", self)
10804                .set(
10805                    "target",
10806                    target,
10807                ),
10808        );
10809
10810        utils::result(
10811            vips_op_response,
10812            (),
10813            Error::OperationError("MatrixsaveTarget (vips_matrixsave_target) failed".to_string()),
10814        )
10815    }
10816
10817    /// VipsForeignSaveMatrixTarget (matrixsave_target), save image to matrix (.mat), priority=0, mono
10818    ///
10819    /// target: `&VipsTarget` -> Target to save to
10820    ///
10821    /// <ins>Optional arguments</ins>
10822    ///
10823    /// keep: [`ForeignKeep`] -> Which metadata to retain
10824    ///
10825    /// background: `&[f64]` -> Background value
10826    ///
10827    /// page_height: `i32` -> Set page height for multipage save
10828    ///
10829    /// profile: `&str` -> Filename of ICC profile to embed
10830    pub fn matrixsave_target_with_opts(&self, target: &VipsTarget, option: VOption) -> Result<()> {
10831        let vips_op_response = call(
10832            "matrixsave_target",
10833            option
10834                .set("in", self)
10835                .set(
10836                    "target",
10837                    target,
10838                ),
10839        );
10840
10841        utils::result(
10842            vips_op_response,
10843            (),
10844            Error::OperationError("MatrixsaveTarget (vips_matrixsave_target) failed".to_string()),
10845        )
10846    }
10847
10848    /// VipsMax (max), find image maximum
10849    /// returns `f64` - Output value
10850    pub fn max(&self) -> Result<f64> {
10851        let mut out_out: f64 = 0.0;
10852        let vips_op_response = call(
10853            "max",
10854            VOption::new()
10855                .set("in", self)
10856                .set(
10857                    "out",
10858                    &mut out_out,
10859                ),
10860        );
10861
10862        utils::result(
10863            vips_op_response,
10864            out_out,
10865            Error::OperationError("Max (vips_max) failed".to_string()),
10866        )
10867    }
10868
10869    /// VipsMax (max), find image maximum
10870    /// returns `f64` - Output value
10871    ///
10872    /// <ins>Optional arguments</ins>
10873    ///
10874    /// x: `&mut i32` -> Horizontal position of maximum
10875    ///
10876    /// y: `&mut i32` -> Vertical position of maximum
10877    ///
10878    /// size: `i32` -> Number of maximum values to find
10879    ///
10880    /// out_array: `&mut Vec<f64>` -> Array of output values
10881    ///
10882    /// x_array: `&[i32]` -> Array of horizontal positions
10883    ///
10884    /// y_array: `&[i32]` -> Array of vertical positions
10885    pub fn max_with_opts(&self, option: VOption) -> Result<f64> {
10886        let mut out_out: f64 = 0.0;
10887        let vips_op_response = call(
10888            "max",
10889            option
10890                .set("in", self)
10891                .set(
10892                    "out",
10893                    &mut out_out,
10894                ),
10895        );
10896
10897        utils::result(
10898            vips_op_response,
10899            out_out,
10900            Error::OperationError("Max (vips_max) failed".to_string()),
10901        )
10902    }
10903
10904    /// VipsMaxpair (maxpair), maximum of a pair of images
10905    /// returns `VipsImage` - Output image
10906    ///
10907    /// right: `&VipsImage` -> Right-hand image argument
10908    pub fn maxpair(&self, right: &VipsImage) -> Result<VipsImage> {
10909        let mut out_out = VipsImage::from(null_mut());
10910        let vips_op_response = call(
10911            "maxpair",
10912            VOption::new()
10913                .set(
10914                    "left",
10915                    self,
10916                )
10917                .set(
10918                    "right",
10919                    right,
10920                )
10921                .set(
10922                    "out",
10923                    &mut out_out,
10924                ),
10925        );
10926
10927        utils::result(
10928            vips_op_response,
10929            out_out,
10930            Error::OperationError("Maxpair (vips_maxpair) failed".to_string()),
10931        )
10932    }
10933
10934    /// VipsMeasure (measure), measure a set of patches on a color chart
10935    /// returns `VipsImage` - Output array of statistics
10936    ///
10937    /// h: `i32` -> Number of patches across chart
10938    ///
10939    /// v: `i32` -> Number of patches down chart
10940    pub fn measure(&self, h: i32, v: i32) -> Result<VipsImage> {
10941        let mut out_out = VipsImage::from(null_mut());
10942        let vips_op_response = call(
10943            "measure",
10944            VOption::new()
10945                .set("in", self)
10946                .set(
10947                    "out",
10948                    &mut out_out,
10949                )
10950                .set("h", h)
10951                .set("v", v),
10952        );
10953
10954        utils::result(
10955            vips_op_response,
10956            out_out,
10957            Error::OperationError("Measure (vips_measure) failed".to_string()),
10958        )
10959    }
10960
10961    /// VipsMeasure (measure), measure a set of patches on a color chart
10962    /// returns `VipsImage` - Output array of statistics
10963    ///
10964    /// h: `i32` -> Number of patches across chart
10965    ///
10966    /// v: `i32` -> Number of patches down chart
10967    ///
10968    /// <ins>Optional arguments</ins>
10969    ///
10970    /// left: `i32` -> Left edge of extract area
10971    ///
10972    /// top: `i32` -> Top edge of extract area
10973    ///
10974    /// width: `i32` -> Width of extract area
10975    ///
10976    /// height: `i32` -> Height of extract area
10977    pub fn measure_with_opts(&self, h: i32, v: i32, option: VOption) -> Result<VipsImage> {
10978        let mut out_out = VipsImage::from(null_mut());
10979        let vips_op_response = call(
10980            "measure",
10981            option
10982                .set("in", self)
10983                .set(
10984                    "out",
10985                    &mut out_out,
10986                )
10987                .set("h", h)
10988                .set("v", v),
10989        );
10990
10991        utils::result(
10992            vips_op_response,
10993            out_out,
10994            Error::OperationError("Measure (vips_measure) failed".to_string()),
10995        )
10996    }
10997
10998    /// VipsMerge (merge), merge two images
10999    /// returns `VipsImage` - Output image
11000    ///
11001    /// sec: `&VipsImage` -> Secondary image
11002    ///
11003    /// direction: `Direction` -> Horizontal or vertical merge
11004    ///
11005    /// dx: `i32` -> Horizontal displacement from sec to ref
11006    ///
11007    /// dy: `i32` -> Vertical displacement from sec to ref
11008    pub fn merge(
11009        &self,
11010        sec: &VipsImage,
11011        direction: Direction,
11012        dx: i32,
11013        dy: i32,
11014    ) -> Result<VipsImage> {
11015        let mut out_out = VipsImage::from(null_mut());
11016        let vips_op_response = call(
11017            "merge",
11018            VOption::new()
11019                .set(
11020                    "ref", self,
11021                )
11022                .set("sec", sec)
11023                .set(
11024                    "out",
11025                    &mut out_out,
11026                )
11027                .set(
11028                    "direction",
11029                    direction as i32,
11030                )
11031                .set("dx", dx)
11032                .set("dy", dy),
11033        );
11034
11035        utils::result(
11036            vips_op_response,
11037            out_out,
11038            Error::OperationError("Merge (vips_merge) failed".to_string()),
11039        )
11040    }
11041
11042    /// VipsMerge (merge), merge two images
11043    /// returns `VipsImage` - Output image
11044    ///
11045    /// sec: `&VipsImage` -> Secondary image
11046    ///
11047    /// direction: `Direction` -> Horizontal or vertical merge
11048    ///
11049    /// dx: `i32` -> Horizontal displacement from sec to ref
11050    ///
11051    /// dy: `i32` -> Vertical displacement from sec to ref
11052    ///
11053    /// <ins>Optional arguments</ins>
11054    ///
11055    /// mblend: `i32` -> Maximum blend size
11056    pub fn merge_with_opts(
11057        &self,
11058        sec: &VipsImage,
11059        direction: Direction,
11060        dx: i32,
11061        dy: i32,
11062        option: VOption,
11063    ) -> Result<VipsImage> {
11064        let mut out_out = VipsImage::from(null_mut());
11065        let vips_op_response = call(
11066            "merge",
11067            option
11068                .set(
11069                    "ref", self,
11070                )
11071                .set("sec", sec)
11072                .set(
11073                    "out",
11074                    &mut out_out,
11075                )
11076                .set(
11077                    "direction",
11078                    direction as i32,
11079                )
11080                .set("dx", dx)
11081                .set("dy", dy),
11082        );
11083
11084        utils::result(
11085            vips_op_response,
11086            out_out,
11087            Error::OperationError("Merge (vips_merge) failed".to_string()),
11088        )
11089    }
11090
11091    /// VipsMin (min), find image minimum
11092    /// returns `f64` - Output value
11093    pub fn min(&self) -> Result<f64> {
11094        let mut out_out: f64 = 0.0;
11095        let vips_op_response = call(
11096            "min",
11097            VOption::new()
11098                .set("in", self)
11099                .set(
11100                    "out",
11101                    &mut out_out,
11102                ),
11103        );
11104
11105        utils::result(
11106            vips_op_response,
11107            out_out,
11108            Error::OperationError("Min (vips_min) failed".to_string()),
11109        )
11110    }
11111
11112    /// VipsMin (min), find image minimum
11113    /// returns `f64` - Output value
11114    ///
11115    /// <ins>Optional arguments</ins>
11116    ///
11117    /// x: `&mut i32` -> Horizontal position of minimum
11118    ///
11119    /// y: `&mut i32` -> Vertical position of minimum
11120    ///
11121    /// size: `i32` -> Number of minimum values to find
11122    ///
11123    /// out_array: `&mut Vec<f64>` -> Array of output values
11124    ///
11125    /// x_array: `&[i32]` -> Array of horizontal positions
11126    ///
11127    /// y_array: `&[i32]` -> Array of vertical positions
11128    pub fn min_with_opts(&self, option: VOption) -> Result<f64> {
11129        let mut out_out: f64 = 0.0;
11130        let vips_op_response = call(
11131            "min",
11132            option
11133                .set("in", self)
11134                .set(
11135                    "out",
11136                    &mut out_out,
11137                ),
11138        );
11139
11140        utils::result(
11141            vips_op_response,
11142            out_out,
11143            Error::OperationError("Min (vips_min) failed".to_string()),
11144        )
11145    }
11146
11147    /// VipsMinpair (minpair), minimum of a pair of images
11148    /// returns `VipsImage` - Output image
11149    ///
11150    /// right: `&VipsImage` -> Right-hand image argument
11151    pub fn minpair(&self, right: &VipsImage) -> Result<VipsImage> {
11152        let mut out_out = VipsImage::from(null_mut());
11153        let vips_op_response = call(
11154            "minpair",
11155            VOption::new()
11156                .set(
11157                    "left",
11158                    self,
11159                )
11160                .set(
11161                    "right",
11162                    right,
11163                )
11164                .set(
11165                    "out",
11166                    &mut out_out,
11167                ),
11168        );
11169
11170        utils::result(
11171            vips_op_response,
11172            out_out,
11173            Error::OperationError("Minpair (vips_minpair) failed".to_string()),
11174        )
11175    }
11176
11177    /// VipsMorph (morph), morphology operation
11178    /// returns `VipsImage` - Output image
11179    ///
11180    /// mask: `&VipsImage` -> Input matrix image
11181    ///
11182    /// morph: `OperationMorphology` -> Morphological operation to perform
11183    pub fn morph(&self, mask: &VipsImage, morph: OperationMorphology) -> Result<VipsImage> {
11184        let mut out_out = VipsImage::from(null_mut());
11185        let vips_op_response = call(
11186            "morph",
11187            VOption::new()
11188                .set("in", self)
11189                .set(
11190                    "out",
11191                    &mut out_out,
11192                )
11193                .set(
11194                    "mask",
11195                    mask,
11196                )
11197                .set(
11198                    "morph",
11199                    morph as i32,
11200                ),
11201        );
11202
11203        utils::result(
11204            vips_op_response,
11205            out_out,
11206            Error::OperationError("Morph (vips_morph) failed".to_string()),
11207        )
11208    }
11209
11210    /// VipsMosaic1 (mosaic1), first-order mosaic of two images
11211    /// returns `VipsImage` - Output image
11212    ///
11213    /// sec: `&VipsImage` -> Secondary image
11214    ///
11215    /// direction: `Direction` -> Horizontal or vertical mosaic
11216    ///
11217    /// xr1: `i32` -> Position of first reference tie-point
11218    ///
11219    /// yr1: `i32` -> Position of first reference tie-point
11220    ///
11221    /// xs1: `i32` -> Position of first secondary tie-point
11222    ///
11223    /// ys1: `i32` -> Position of first secondary tie-point
11224    ///
11225    /// xr2: `i32` -> Position of second reference tie-point
11226    ///
11227    /// yr2: `i32` -> Position of second reference tie-point
11228    ///
11229    /// xs2: `i32` -> Position of second secondary tie-point
11230    ///
11231    /// ys2: `i32` -> Position of second secondary tie-point
11232    pub fn mosaic1(
11233        &self,
11234        sec: &VipsImage,
11235        direction: Direction,
11236        xr1: i32,
11237        yr1: i32,
11238        xs1: i32,
11239        ys1: i32,
11240        xr2: i32,
11241        yr2: i32,
11242        xs2: i32,
11243        ys2: i32,
11244    ) -> Result<VipsImage> {
11245        let mut out_out = VipsImage::from(null_mut());
11246        let vips_op_response = call(
11247            "mosaic1",
11248            VOption::new()
11249                .set(
11250                    "ref", self,
11251                )
11252                .set("sec", sec)
11253                .set(
11254                    "out",
11255                    &mut out_out,
11256                )
11257                .set(
11258                    "direction",
11259                    direction as i32,
11260                )
11261                .set("xr1", xr1)
11262                .set("yr1", yr1)
11263                .set("xs1", xs1)
11264                .set("ys1", ys1)
11265                .set("xr2", xr2)
11266                .set("yr2", yr2)
11267                .set("xs2", xs2)
11268                .set("ys2", ys2),
11269        );
11270
11271        utils::result(
11272            vips_op_response,
11273            out_out,
11274            Error::OperationError("Mosaic1 (vips_mosaic1) failed".to_string()),
11275        )
11276    }
11277
11278    /// VipsMosaic1 (mosaic1), first-order mosaic of two images
11279    /// returns `VipsImage` - Output image
11280    ///
11281    /// sec: `&VipsImage` -> Secondary image
11282    ///
11283    /// direction: `Direction` -> Horizontal or vertical mosaic
11284    ///
11285    /// xr1: `i32` -> Position of first reference tie-point
11286    ///
11287    /// yr1: `i32` -> Position of first reference tie-point
11288    ///
11289    /// xs1: `i32` -> Position of first secondary tie-point
11290    ///
11291    /// ys1: `i32` -> Position of first secondary tie-point
11292    ///
11293    /// xr2: `i32` -> Position of second reference tie-point
11294    ///
11295    /// yr2: `i32` -> Position of second reference tie-point
11296    ///
11297    /// xs2: `i32` -> Position of second secondary tie-point
11298    ///
11299    /// ys2: `i32` -> Position of second secondary tie-point
11300    ///
11301    /// <ins>Optional arguments</ins>
11302    ///
11303    /// hwindow: `i32` -> Half window size
11304    ///
11305    /// harea: `i32` -> Half area size
11306    ///
11307    /// search: `bool` -> Search to improve tie-points
11308    ///
11309    /// interpolate: `&VipsInterpolate` -> Interpolate pixels with this
11310    ///
11311    /// mblend: `i32` -> Maximum blend size
11312    pub fn mosaic1_with_opts(
11313        &self,
11314        sec: &VipsImage,
11315        direction: Direction,
11316        xr1: i32,
11317        yr1: i32,
11318        xs1: i32,
11319        ys1: i32,
11320        xr2: i32,
11321        yr2: i32,
11322        xs2: i32,
11323        ys2: i32,
11324        option: VOption,
11325    ) -> Result<VipsImage> {
11326        let mut out_out = VipsImage::from(null_mut());
11327        let vips_op_response = call(
11328            "mosaic1",
11329            option
11330                .set(
11331                    "ref", self,
11332                )
11333                .set("sec", sec)
11334                .set(
11335                    "out",
11336                    &mut out_out,
11337                )
11338                .set(
11339                    "direction",
11340                    direction as i32,
11341                )
11342                .set("xr1", xr1)
11343                .set("yr1", yr1)
11344                .set("xs1", xs1)
11345                .set("ys1", ys1)
11346                .set("xr2", xr2)
11347                .set("yr2", yr2)
11348                .set("xs2", xs2)
11349                .set("ys2", ys2),
11350        );
11351
11352        utils::result(
11353            vips_op_response,
11354            out_out,
11355            Error::OperationError("Mosaic1 (vips_mosaic1) failed".to_string()),
11356        )
11357    }
11358
11359    /// VipsMosaic (mosaic), mosaic two images
11360    /// returns `VipsImage` - Output image
11361    ///
11362    /// sec: `&VipsImage` -> Secondary image
11363    ///
11364    /// direction: `Direction` -> Horizontal or vertical mosaic
11365    ///
11366    /// xref: `i32` -> Position of reference tie-point
11367    ///
11368    /// yref: `i32` -> Position of reference tie-point
11369    ///
11370    /// xsec: `i32` -> Position of secondary tie-point
11371    ///
11372    /// ysec: `i32` -> Position of secondary tie-point
11373    pub fn mosaic(
11374        &self,
11375        sec: &VipsImage,
11376        direction: Direction,
11377        xref: i32,
11378        yref: i32,
11379        xsec: i32,
11380        ysec: i32,
11381    ) -> Result<VipsImage> {
11382        let mut out_out = VipsImage::from(null_mut());
11383        let vips_op_response = call(
11384            "mosaic",
11385            VOption::new()
11386                .set(
11387                    "ref", self,
11388                )
11389                .set("sec", sec)
11390                .set(
11391                    "out",
11392                    &mut out_out,
11393                )
11394                .set(
11395                    "direction",
11396                    direction as i32,
11397                )
11398                .set(
11399                    "xref",
11400                    xref,
11401                )
11402                .set(
11403                    "yref",
11404                    yref,
11405                )
11406                .set(
11407                    "xsec",
11408                    xsec,
11409                )
11410                .set(
11411                    "ysec",
11412                    ysec,
11413                ),
11414        );
11415
11416        utils::result(
11417            vips_op_response,
11418            out_out,
11419            Error::OperationError("Mosaic (vips_mosaic) failed".to_string()),
11420        )
11421    }
11422
11423    /// VipsMosaic (mosaic), mosaic two images
11424    /// returns `VipsImage` - Output image
11425    ///
11426    /// sec: `&VipsImage` -> Secondary image
11427    ///
11428    /// direction: `Direction` -> Horizontal or vertical mosaic
11429    ///
11430    /// xref: `i32` -> Position of reference tie-point
11431    ///
11432    /// yref: `i32` -> Position of reference tie-point
11433    ///
11434    /// xsec: `i32` -> Position of secondary tie-point
11435    ///
11436    /// ysec: `i32` -> Position of secondary tie-point
11437    ///
11438    /// <ins>Optional arguments</ins>
11439    ///
11440    /// hwindow: `i32` -> Half window size
11441    ///
11442    /// harea: `i32` -> Half area size
11443    ///
11444    /// mblend: `i32` -> Maximum blend size
11445    ///
11446    /// bandno: `i32` -> Band to search for features on
11447    ///
11448    /// dx0: `&mut i32` -> Detected integer offset
11449    ///
11450    /// dy0: `&mut i32` -> Detected integer offset
11451    ///
11452    /// scale1: `&mut f64` -> Detected scale
11453    ///
11454    /// angle1: `&mut f64` -> Detected rotation
11455    ///
11456    /// dy1: `&mut f64` -> Detected first-order displacement
11457    ///
11458    /// dx1: `&mut f64` -> Detected first-order displacement
11459    pub fn mosaic_with_opts(
11460        &self,
11461        sec: &VipsImage,
11462        direction: Direction,
11463        xref: i32,
11464        yref: i32,
11465        xsec: i32,
11466        ysec: i32,
11467        option: VOption,
11468    ) -> Result<VipsImage> {
11469        let mut out_out = VipsImage::from(null_mut());
11470        let vips_op_response = call(
11471            "mosaic",
11472            option
11473                .set(
11474                    "ref", self,
11475                )
11476                .set("sec", sec)
11477                .set(
11478                    "out",
11479                    &mut out_out,
11480                )
11481                .set(
11482                    "direction",
11483                    direction as i32,
11484                )
11485                .set(
11486                    "xref",
11487                    xref,
11488                )
11489                .set(
11490                    "yref",
11491                    yref,
11492                )
11493                .set(
11494                    "xsec",
11495                    xsec,
11496                )
11497                .set(
11498                    "ysec",
11499                    ysec,
11500                ),
11501        );
11502
11503        utils::result(
11504            vips_op_response,
11505            out_out,
11506            Error::OperationError("Mosaic (vips_mosaic) failed".to_string()),
11507        )
11508    }
11509
11510    /// VipsMsb (msb), pick most-significant byte from an image
11511    /// returns `VipsImage` - Output image
11512    pub fn msb(&self) -> Result<VipsImage> {
11513        let mut out_out = VipsImage::from(null_mut());
11514        let vips_op_response = call(
11515            "msb",
11516            VOption::new()
11517                .set("in", self)
11518                .set(
11519                    "out",
11520                    &mut out_out,
11521                ),
11522        );
11523
11524        utils::result(
11525            vips_op_response,
11526            out_out,
11527            Error::OperationError("Msb (vips_msb) failed".to_string()),
11528        )
11529    }
11530
11531    /// VipsMsb (msb), pick most-significant byte from an image
11532    /// returns `VipsImage` - Output image
11533    ///
11534    /// <ins>Optional arguments</ins>
11535    ///
11536    /// band: `i32` -> Band to msb
11537    pub fn msb_with_opts(&self, option: VOption) -> Result<VipsImage> {
11538        let mut out_out = VipsImage::from(null_mut());
11539        let vips_op_response = call(
11540            "msb",
11541            option
11542                .set("in", self)
11543                .set(
11544                    "out",
11545                    &mut out_out,
11546                ),
11547        );
11548
11549        utils::result(
11550            vips_op_response,
11551            out_out,
11552            Error::OperationError("Msb (vips_msb) failed".to_string()),
11553        )
11554    }
11555
11556    /// VipsMultiply (multiply), multiply two images
11557    /// returns `VipsImage` - Output image
11558    ///
11559    /// right: `&VipsImage` -> Right-hand image argument
11560    pub fn multiply(&self, right: &VipsImage) -> Result<VipsImage> {
11561        let mut out_out = VipsImage::from(null_mut());
11562        let vips_op_response = call(
11563            "multiply",
11564            VOption::new()
11565                .set(
11566                    "left",
11567                    self,
11568                )
11569                .set(
11570                    "right",
11571                    right,
11572                )
11573                .set(
11574                    "out",
11575                    &mut out_out,
11576                ),
11577        );
11578
11579        utils::result(
11580            vips_op_response,
11581            out_out,
11582            Error::OperationError("Multiply (vips_multiply) failed".to_string()),
11583        )
11584    }
11585
11586    /// VipsForeignLoadOpenexr (openexrload), load an OpenEXR image (.exr), priority=200, untrusted, is_a, get_flags, get_flags_filename, header, load
11587    /// returns `VipsImage` - Output image
11588    ///
11589    /// filename: `&str` -> Filename to load from
11590    pub fn openexrload(filename: &str) -> Result<VipsImage> {
11591        let mut out_out = VipsImage::from(null_mut());
11592        let vips_op_response = call(
11593            "openexrload",
11594            VOption::new()
11595                .set(
11596                    "filename",
11597                    filename,
11598                )
11599                .set(
11600                    "out",
11601                    &mut out_out,
11602                ),
11603        );
11604
11605        utils::result(
11606            vips_op_response,
11607            out_out,
11608            Error::OperationError("Openexrload (vips_openexrload) failed".to_string()),
11609        )
11610    }
11611
11612    /// VipsForeignLoadOpenexr (openexrload), load an OpenEXR image (.exr), priority=200, untrusted, is_a, get_flags, get_flags_filename, header, load
11613    /// returns `VipsImage` - Output image
11614    ///
11615    /// filename: `&str` -> Filename to load from
11616    ///
11617    /// <ins>Optional arguments</ins>
11618    ///
11619    /// flags: [`ForeignFlags`] -> Flags for this file
11620    ///
11621    /// memory: `bool` -> Force open via memory
11622    ///
11623    /// access: [`Access`] -> Required access pattern for this file
11624    ///
11625    /// fail_on: [`FailOn`] -> Error level to fail on
11626    ///
11627    /// revalidate: `bool` -> Don't use a cached result for this operation
11628    pub fn openexrload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
11629        let mut out_out = VipsImage::from(null_mut());
11630        let vips_op_response = call(
11631            "openexrload",
11632            option
11633                .set(
11634                    "filename",
11635                    filename,
11636                )
11637                .set(
11638                    "out",
11639                    &mut out_out,
11640                ),
11641        );
11642
11643        utils::result(
11644            vips_op_response,
11645            out_out,
11646            Error::OperationError("Openexrload (vips_openexrload) failed".to_string()),
11647        )
11648    }
11649
11650    /// 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
11651    /// returns `VipsImage` - Output image
11652    ///
11653    /// filename: `&str` -> Filename to load from
11654    pub fn openslideload(filename: &str) -> Result<VipsImage> {
11655        let mut out_out = VipsImage::from(null_mut());
11656        let vips_op_response = call(
11657            "openslideload",
11658            VOption::new()
11659                .set(
11660                    "filename",
11661                    filename,
11662                )
11663                .set(
11664                    "out",
11665                    &mut out_out,
11666                ),
11667        );
11668
11669        utils::result(
11670            vips_op_response,
11671            out_out,
11672            Error::OperationError("Openslideload (vips_openslideload) failed".to_string()),
11673        )
11674    }
11675
11676    /// 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
11677    /// returns `VipsImage` - Output image
11678    ///
11679    /// filename: `&str` -> Filename to load from
11680    ///
11681    /// <ins>Optional arguments</ins>
11682    ///
11683    /// level: `i32` -> Load this level from the file
11684    ///
11685    /// autocrop: `bool` -> Crop to image bounds
11686    ///
11687    /// associated: `&str` -> Load this associated image
11688    ///
11689    /// attach_associated: `bool` -> Attach all associated images
11690    ///
11691    /// rgb: `bool` -> Output RGB (not RGBA)
11692    ///
11693    /// flags: [`ForeignFlags`] -> Flags for this file
11694    ///
11695    /// memory: `bool` -> Force open via memory
11696    ///
11697    /// access: [`Access`] -> Required access pattern for this file
11698    ///
11699    /// fail_on: [`FailOn`] -> Error level to fail on
11700    ///
11701    /// revalidate: `bool` -> Don't use a cached result for this operation
11702    pub fn openslideload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
11703        let mut out_out = VipsImage::from(null_mut());
11704        let vips_op_response = call(
11705            "openslideload",
11706            option
11707                .set(
11708                    "filename",
11709                    filename,
11710                )
11711                .set(
11712                    "out",
11713                    &mut out_out,
11714                ),
11715        );
11716
11717        utils::result(
11718            vips_op_response,
11719            out_out,
11720            Error::OperationError("Openslideload (vips_openslideload) failed".to_string()),
11721        )
11722    }
11723
11724    /// VipsForeignLoadOpenslideSource (openslideload_source), load source with OpenSlide, priority=100, untrusted, is_a_source, get_flags, get_flags_filename, header, load
11725    /// returns `VipsImage` - Output image
11726    ///
11727    /// source: `&VipsSource` -> Source to load from
11728    pub fn openslideload_source(source: &VipsSource) -> Result<VipsImage> {
11729        let mut out_out = VipsImage::from(null_mut());
11730        let vips_op_response = call(
11731            "openslideload_source",
11732            VOption::new()
11733                .set(
11734                    "source",
11735                    source,
11736                )
11737                .set(
11738                    "out",
11739                    &mut out_out,
11740                ),
11741        );
11742
11743        utils::result(
11744            vips_op_response,
11745            out_out,
11746            Error::OperationError(
11747                "OpenslideloadSource (vips_openslideload_source) failed".to_string(),
11748            ),
11749        )
11750    }
11751
11752    /// VipsForeignLoadOpenslideSource (openslideload_source), load source with OpenSlide, priority=100, untrusted, is_a_source, get_flags, get_flags_filename, header, load
11753    /// returns `VipsImage` - Output image
11754    ///
11755    /// source: `&VipsSource` -> Source to load from
11756    ///
11757    /// <ins>Optional arguments</ins>
11758    ///
11759    /// level: `i32` -> Load this level from the file
11760    ///
11761    /// autocrop: `bool` -> Crop to image bounds
11762    ///
11763    /// associated: `&str` -> Load this associated image
11764    ///
11765    /// attach_associated: `bool` -> Attach all associated images
11766    ///
11767    /// rgb: `bool` -> Output RGB (not RGBA)
11768    ///
11769    /// flags: [`ForeignFlags`] -> Flags for this file
11770    ///
11771    /// memory: `bool` -> Force open via memory
11772    ///
11773    /// access: [`Access`] -> Required access pattern for this file
11774    ///
11775    /// fail_on: [`FailOn`] -> Error level to fail on
11776    ///
11777    /// revalidate: `bool` -> Don't use a cached result for this operation
11778    pub fn openslideload_source_with_opts(
11779        source: &VipsSource,
11780        option: VOption,
11781    ) -> Result<VipsImage> {
11782        let mut out_out = VipsImage::from(null_mut());
11783        let vips_op_response = call(
11784            "openslideload_source",
11785            option
11786                .set(
11787                    "source",
11788                    source,
11789                )
11790                .set(
11791                    "out",
11792                    &mut out_out,
11793                ),
11794        );
11795
11796        utils::result(
11797            vips_op_response,
11798            out_out,
11799            Error::OperationError(
11800                "OpenslideloadSource (vips_openslideload_source) failed".to_string(),
11801            ),
11802        )
11803    }
11804
11805    /// VipsForeignLoadPdfFile (pdfload), load PDF from file (.pdf), priority=0, untrusted, is_a, get_flags, get_flags_filename, header, load
11806    /// returns `VipsImage` - Output image
11807    ///
11808    /// filename: `&str` -> Filename to load from
11809    pub fn pdfload(filename: &str) -> Result<VipsImage> {
11810        let mut out_out = VipsImage::from(null_mut());
11811        let vips_op_response = call(
11812            "pdfload",
11813            VOption::new()
11814                .set(
11815                    "filename",
11816                    filename,
11817                )
11818                .set(
11819                    "out",
11820                    &mut out_out,
11821                ),
11822        );
11823
11824        utils::result(
11825            vips_op_response,
11826            out_out,
11827            Error::OperationError("Pdfload (vips_pdfload) failed".to_string()),
11828        )
11829    }
11830
11831    /// VipsForeignLoadPdfFile (pdfload), load PDF from file (.pdf), priority=0, untrusted, is_a, get_flags, get_flags_filename, header, load
11832    /// returns `VipsImage` - Output image
11833    ///
11834    /// filename: `&str` -> Filename to load from
11835    ///
11836    /// <ins>Optional arguments</ins>
11837    ///
11838    /// page: `i32` -> First page to load
11839    ///
11840    /// n: `i32` -> Number of pages to load, -1 for all
11841    ///
11842    /// dpi: `f64` -> DPI to render at
11843    ///
11844    /// scale: `f64` -> Factor to scale by
11845    ///
11846    /// background: `&[f64]` -> Background colour
11847    ///
11848    /// password: `&str` -> Password to decrypt with
11849    ///
11850    /// flags: [`ForeignFlags`] -> Flags for this file
11851    ///
11852    /// memory: `bool` -> Force open via memory
11853    ///
11854    /// access: [`Access`] -> Required access pattern for this file
11855    ///
11856    /// fail_on: [`FailOn`] -> Error level to fail on
11857    ///
11858    /// revalidate: `bool` -> Don't use a cached result for this operation
11859    pub fn pdfload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
11860        let mut out_out = VipsImage::from(null_mut());
11861        let vips_op_response = call(
11862            "pdfload",
11863            option
11864                .set(
11865                    "filename",
11866                    filename,
11867                )
11868                .set(
11869                    "out",
11870                    &mut out_out,
11871                ),
11872        );
11873
11874        utils::result(
11875            vips_op_response,
11876            out_out,
11877            Error::OperationError("Pdfload (vips_pdfload) failed".to_string()),
11878        )
11879    }
11880
11881    /// VipsForeignLoadPdfBuffer (pdfload_buffer), load PDF from buffer, priority=0, untrusted, is_a_buffer, get_flags, get_flags_filename, header, load
11882    /// returns `VipsImage` - Output image
11883    ///
11884    /// buffer: `&[u8]` -> Buffer to load from
11885    pub fn pdfload_buffer(buffer: &[u8]) -> Result<VipsImage> {
11886        let vips_blob = unsafe {
11887            vips_blob_new(
11888                None,
11889                buffer.as_ptr() as _,
11890                buffer.len() as _,
11891            )
11892        };
11893        let blob = VipsBlob::from(vips_blob);
11894        let mut out_out = VipsImage::from(null_mut());
11895        let vips_op_response = call(
11896            "pdfload_buffer",
11897            VOption::new()
11898                .set(
11899                    "buffer",
11900                    &blob,
11901                )
11902                .set(
11903                    "out",
11904                    &mut out_out,
11905                ),
11906        );
11907        blob.area_unref();
11908        utils::result(
11909            vips_op_response,
11910            out_out,
11911            Error::OperationError("PdfloadBuffer (vips_pdfload_buffer) failed".to_string()),
11912        )
11913    }
11914
11915    /// VipsForeignLoadPdfBuffer (pdfload_buffer), load PDF from buffer, priority=0, untrusted, is_a_buffer, get_flags, get_flags_filename, header, load
11916    /// returns `VipsImage` - Output image
11917    ///
11918    /// buffer: `&[u8]` -> Buffer to load from
11919    ///
11920    /// <ins>Optional arguments</ins>
11921    ///
11922    /// page: `i32` -> First page to load
11923    ///
11924    /// n: `i32` -> Number of pages to load, -1 for all
11925    ///
11926    /// dpi: `f64` -> DPI to render at
11927    ///
11928    /// scale: `f64` -> Factor to scale by
11929    ///
11930    /// background: `&[f64]` -> Background colour
11931    ///
11932    /// password: `&str` -> Password to decrypt with
11933    ///
11934    /// flags: [`ForeignFlags`] -> Flags for this file
11935    ///
11936    /// memory: `bool` -> Force open via memory
11937    ///
11938    /// access: [`Access`] -> Required access pattern for this file
11939    ///
11940    /// fail_on: [`FailOn`] -> Error level to fail on
11941    ///
11942    /// revalidate: `bool` -> Don't use a cached result for this operation
11943    pub fn pdfload_buffer_with_opts(buffer: &[u8], option: VOption) -> Result<VipsImage> {
11944        let vips_blob = unsafe {
11945            vips_blob_new(
11946                None,
11947                buffer.as_ptr() as _,
11948                buffer.len() as _,
11949            )
11950        };
11951        let blob = VipsBlob::from(vips_blob);
11952        let mut out_out = VipsImage::from(null_mut());
11953        let vips_op_response = call(
11954            "pdfload_buffer",
11955            option
11956                .set(
11957                    "buffer",
11958                    &blob,
11959                )
11960                .set(
11961                    "out",
11962                    &mut out_out,
11963                ),
11964        );
11965        blob.area_unref();
11966        utils::result(
11967            vips_op_response,
11968            out_out,
11969            Error::OperationError("PdfloadBuffer (vips_pdfload_buffer) failed".to_string()),
11970        )
11971    }
11972
11973    /// VipsForeignLoadPdfSource (pdfload_source), load PDF from source, priority=0, untrusted, is_a_source, get_flags, get_flags_filename, header, load
11974    /// returns `VipsImage` - Output image
11975    ///
11976    /// source: `&VipsSource` -> Source to load from
11977    pub fn pdfload_source(source: &VipsSource) -> Result<VipsImage> {
11978        let mut out_out = VipsImage::from(null_mut());
11979        let vips_op_response = call(
11980            "pdfload_source",
11981            VOption::new()
11982                .set(
11983                    "source",
11984                    source,
11985                )
11986                .set(
11987                    "out",
11988                    &mut out_out,
11989                ),
11990        );
11991
11992        utils::result(
11993            vips_op_response,
11994            out_out,
11995            Error::OperationError("PdfloadSource (vips_pdfload_source) failed".to_string()),
11996        )
11997    }
11998
11999    /// VipsForeignLoadPdfSource (pdfload_source), load PDF from source, priority=0, untrusted, is_a_source, get_flags, get_flags_filename, header, load
12000    /// returns `VipsImage` - Output image
12001    ///
12002    /// source: `&VipsSource` -> Source to load from
12003    ///
12004    /// <ins>Optional arguments</ins>
12005    ///
12006    /// page: `i32` -> First page to load
12007    ///
12008    /// n: `i32` -> Number of pages to load, -1 for all
12009    ///
12010    /// dpi: `f64` -> DPI to render at
12011    ///
12012    /// scale: `f64` -> Factor to scale by
12013    ///
12014    /// background: `&[f64]` -> Background colour
12015    ///
12016    /// password: `&str` -> Password to decrypt with
12017    ///
12018    /// flags: [`ForeignFlags`] -> Flags for this file
12019    ///
12020    /// memory: `bool` -> Force open via memory
12021    ///
12022    /// access: [`Access`] -> Required access pattern for this file
12023    ///
12024    /// fail_on: [`FailOn`] -> Error level to fail on
12025    ///
12026    /// revalidate: `bool` -> Don't use a cached result for this operation
12027    pub fn pdfload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
12028        let mut out_out = VipsImage::from(null_mut());
12029        let vips_op_response = call(
12030            "pdfload_source",
12031            option
12032                .set(
12033                    "source",
12034                    source,
12035                )
12036                .set(
12037                    "out",
12038                    &mut out_out,
12039                ),
12040        );
12041
12042        utils::result(
12043            vips_op_response,
12044            out_out,
12045            Error::OperationError("PdfloadSource (vips_pdfload_source) failed".to_string()),
12046        )
12047    }
12048
12049    /// VipsPercent (percent), find threshold for percent of pixels
12050    /// returns `i32` - Threshold above which lie percent of pixels
12051    ///
12052    /// percent: `f64` -> Percent of pixels
12053    pub fn percent(&self, percent: f64) -> Result<i32> {
12054        let mut threshold_out: i32 = 0;
12055        let vips_op_response = call(
12056            "percent",
12057            VOption::new()
12058                .set("in", self)
12059                .set(
12060                    "percent",
12061                    percent,
12062                )
12063                .set(
12064                    "threshold",
12065                    &mut threshold_out,
12066                ),
12067        );
12068
12069        utils::result(
12070            vips_op_response,
12071            threshold_out,
12072            Error::OperationError("Percent (vips_percent) failed".to_string()),
12073        )
12074    }
12075
12076    /// VipsPerlin (perlin), make a perlin noise image
12077    /// returns `VipsImage` - Output image
12078    ///
12079    /// width: `i32` -> Image width in pixels
12080    ///
12081    /// height: `i32` -> Image height in pixels
12082    pub fn perlin(width: i32, height: i32) -> Result<VipsImage> {
12083        let mut out_out = VipsImage::from(null_mut());
12084        let vips_op_response = call(
12085            "perlin",
12086            VOption::new()
12087                .set(
12088                    "out",
12089                    &mut out_out,
12090                )
12091                .set(
12092                    "width",
12093                    width,
12094                )
12095                .set(
12096                    "height",
12097                    height,
12098                ),
12099        );
12100
12101        utils::result(
12102            vips_op_response,
12103            out_out,
12104            Error::OperationError("Perlin (vips_perlin) failed".to_string()),
12105        )
12106    }
12107
12108    /// VipsPerlin (perlin), make a perlin noise image
12109    /// returns `VipsImage` - Output image
12110    ///
12111    /// width: `i32` -> Image width in pixels
12112    ///
12113    /// height: `i32` -> Image height in pixels
12114    ///
12115    /// <ins>Optional arguments</ins>
12116    ///
12117    /// cell_size: `i32` -> Size of Perlin cells
12118    ///
12119    /// uchar: `bool` -> Output an unsigned char image
12120    ///
12121    /// seed: `i32` -> Random number seed
12122    pub fn perlin_with_opts(width: i32, height: i32, option: VOption) -> Result<VipsImage> {
12123        let mut out_out = VipsImage::from(null_mut());
12124        let vips_op_response = call(
12125            "perlin",
12126            option
12127                .set(
12128                    "out",
12129                    &mut out_out,
12130                )
12131                .set(
12132                    "width",
12133                    width,
12134                )
12135                .set(
12136                    "height",
12137                    height,
12138                ),
12139        );
12140
12141        utils::result(
12142            vips_op_response,
12143            out_out,
12144            Error::OperationError("Perlin (vips_perlin) failed".to_string()),
12145        )
12146    }
12147
12148    /// VipsPhasecor (phasecor), calculate phase correlation
12149    /// returns `VipsImage` - Output image
12150    ///
12151    /// in2: `&VipsImage` -> Second input image
12152    pub fn phasecor(&self, in2: &VipsImage) -> Result<VipsImage> {
12153        let mut out_out = VipsImage::from(null_mut());
12154        let vips_op_response = call(
12155            "phasecor",
12156            VOption::new()
12157                .set("in", self)
12158                .set("in2", in2)
12159                .set(
12160                    "out",
12161                    &mut out_out,
12162                ),
12163        );
12164
12165        utils::result(
12166            vips_op_response,
12167            out_out,
12168            Error::OperationError("Phasecor (vips_phasecor) failed".to_string()),
12169        )
12170    }
12171
12172    /// VipsForeignLoadPngFile (pngload), load png from file (.png), priority=200, is_a, get_flags, get_flags_filename, header, load
12173    /// returns `VipsImage` - Output image
12174    ///
12175    /// filename: `&str` -> Filename to load from
12176    pub fn pngload(filename: &str) -> Result<VipsImage> {
12177        let mut out_out = VipsImage::from(null_mut());
12178        let vips_op_response = call(
12179            "pngload",
12180            VOption::new()
12181                .set(
12182                    "filename",
12183                    filename,
12184                )
12185                .set(
12186                    "out",
12187                    &mut out_out,
12188                ),
12189        );
12190
12191        utils::result(
12192            vips_op_response,
12193            out_out,
12194            Error::OperationError("Pngload (vips_pngload) failed".to_string()),
12195        )
12196    }
12197
12198    /// VipsForeignLoadPngFile (pngload), load png from file (.png), priority=200, is_a, get_flags, get_flags_filename, header, load
12199    /// returns `VipsImage` - Output image
12200    ///
12201    /// filename: `&str` -> Filename to load from
12202    ///
12203    /// <ins>Optional arguments</ins>
12204    ///
12205    /// unlimited: `bool` -> Remove all denial of service limits
12206    ///
12207    /// flags: [`ForeignFlags`] -> Flags for this file
12208    ///
12209    /// memory: `bool` -> Force open via memory
12210    ///
12211    /// access: [`Access`] -> Required access pattern for this file
12212    ///
12213    /// fail_on: [`FailOn`] -> Error level to fail on
12214    ///
12215    /// revalidate: `bool` -> Don't use a cached result for this operation
12216    pub fn pngload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
12217        let mut out_out = VipsImage::from(null_mut());
12218        let vips_op_response = call(
12219            "pngload",
12220            option
12221                .set(
12222                    "filename",
12223                    filename,
12224                )
12225                .set(
12226                    "out",
12227                    &mut out_out,
12228                ),
12229        );
12230
12231        utils::result(
12232            vips_op_response,
12233            out_out,
12234            Error::OperationError("Pngload (vips_pngload) failed".to_string()),
12235        )
12236    }
12237
12238    /// VipsForeignLoadPngBuffer (pngload_buffer), load png from buffer, priority=200, is_a_buffer, get_flags, get_flags_filename, header, load
12239    /// returns `VipsImage` - Output image
12240    ///
12241    /// buffer: `&[u8]` -> Buffer to load from
12242    pub fn pngload_buffer(buffer: &[u8]) -> Result<VipsImage> {
12243        let vips_blob = unsafe {
12244            vips_blob_new(
12245                None,
12246                buffer.as_ptr() as _,
12247                buffer.len() as _,
12248            )
12249        };
12250        let blob = VipsBlob::from(vips_blob);
12251        let mut out_out = VipsImage::from(null_mut());
12252        let vips_op_response = call(
12253            "pngload_buffer",
12254            VOption::new()
12255                .set(
12256                    "buffer",
12257                    &blob,
12258                )
12259                .set(
12260                    "out",
12261                    &mut out_out,
12262                ),
12263        );
12264        blob.area_unref();
12265        utils::result(
12266            vips_op_response,
12267            out_out,
12268            Error::OperationError("PngloadBuffer (vips_pngload_buffer) failed".to_string()),
12269        )
12270    }
12271
12272    /// VipsForeignLoadPngBuffer (pngload_buffer), load png from buffer, priority=200, is_a_buffer, get_flags, get_flags_filename, header, load
12273    /// returns `VipsImage` - Output image
12274    ///
12275    /// buffer: `&[u8]` -> Buffer to load from
12276    ///
12277    /// <ins>Optional arguments</ins>
12278    ///
12279    /// unlimited: `bool` -> Remove all denial of service limits
12280    ///
12281    /// flags: [`ForeignFlags`] -> Flags for this file
12282    ///
12283    /// memory: `bool` -> Force open via memory
12284    ///
12285    /// access: [`Access`] -> Required access pattern for this file
12286    ///
12287    /// fail_on: [`FailOn`] -> Error level to fail on
12288    ///
12289    /// revalidate: `bool` -> Don't use a cached result for this operation
12290    pub fn pngload_buffer_with_opts(buffer: &[u8], option: VOption) -> Result<VipsImage> {
12291        let vips_blob = unsafe {
12292            vips_blob_new(
12293                None,
12294                buffer.as_ptr() as _,
12295                buffer.len() as _,
12296            )
12297        };
12298        let blob = VipsBlob::from(vips_blob);
12299        let mut out_out = VipsImage::from(null_mut());
12300        let vips_op_response = call(
12301            "pngload_buffer",
12302            option
12303                .set(
12304                    "buffer",
12305                    &blob,
12306                )
12307                .set(
12308                    "out",
12309                    &mut out_out,
12310                ),
12311        );
12312        blob.area_unref();
12313        utils::result(
12314            vips_op_response,
12315            out_out,
12316            Error::OperationError("PngloadBuffer (vips_pngload_buffer) failed".to_string()),
12317        )
12318    }
12319
12320    /// VipsForeignLoadPngSource (pngload_source), load png from source, priority=200, is_a_source, get_flags, get_flags_filename, header, load
12321    /// returns `VipsImage` - Output image
12322    ///
12323    /// source: `&VipsSource` -> Source to load from
12324    pub fn pngload_source(source: &VipsSource) -> Result<VipsImage> {
12325        let mut out_out = VipsImage::from(null_mut());
12326        let vips_op_response = call(
12327            "pngload_source",
12328            VOption::new()
12329                .set(
12330                    "source",
12331                    source,
12332                )
12333                .set(
12334                    "out",
12335                    &mut out_out,
12336                ),
12337        );
12338
12339        utils::result(
12340            vips_op_response,
12341            out_out,
12342            Error::OperationError("PngloadSource (vips_pngload_source) failed".to_string()),
12343        )
12344    }
12345
12346    /// VipsForeignLoadPngSource (pngload_source), load png from source, priority=200, is_a_source, get_flags, get_flags_filename, header, load
12347    /// returns `VipsImage` - Output image
12348    ///
12349    /// source: `&VipsSource` -> Source to load from
12350    ///
12351    /// <ins>Optional arguments</ins>
12352    ///
12353    /// unlimited: `bool` -> Remove all denial of service limits
12354    ///
12355    /// flags: [`ForeignFlags`] -> Flags for this file
12356    ///
12357    /// memory: `bool` -> Force open via memory
12358    ///
12359    /// access: [`Access`] -> Required access pattern for this file
12360    ///
12361    /// fail_on: [`FailOn`] -> Error level to fail on
12362    ///
12363    /// revalidate: `bool` -> Don't use a cached result for this operation
12364    pub fn pngload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
12365        let mut out_out = VipsImage::from(null_mut());
12366        let vips_op_response = call(
12367            "pngload_source",
12368            option
12369                .set(
12370                    "source",
12371                    source,
12372                )
12373                .set(
12374                    "out",
12375                    &mut out_out,
12376                ),
12377        );
12378
12379        utils::result(
12380            vips_op_response,
12381            out_out,
12382            Error::OperationError("PngloadSource (vips_pngload_source) failed".to_string()),
12383        )
12384    }
12385
12386    /// VipsForeignSavePngFile (pngsave), save image to png file (.png), priority=0, mono rgb alpha
12387    ///
12388    /// filename: `&str` -> Filename to save to
12389    pub fn pngsave(&self, filename: &str) -> Result<()> {
12390        let vips_op_response = call(
12391            "pngsave",
12392            VOption::new()
12393                .set("in", self)
12394                .set(
12395                    "filename",
12396                    filename,
12397                ),
12398        );
12399
12400        utils::result(
12401            vips_op_response,
12402            (),
12403            Error::OperationError("Pngsave (vips_pngsave) failed".to_string()),
12404        )
12405    }
12406
12407    /// VipsForeignSavePngFile (pngsave), save image to png file (.png), priority=0, mono rgb alpha
12408    ///
12409    /// filename: `&str` -> Filename to save to
12410    ///
12411    /// <ins>Optional arguments</ins>
12412    ///
12413    /// compression: `i32` -> Compression factor
12414    ///
12415    /// interlace: `bool` -> Interlace image
12416    ///
12417    /// filter: [`ForeignPngFilter`] -> libpng row filter flag(s)
12418    ///
12419    /// palette: `bool` -> Quantise to 8bpp palette
12420    ///
12421    /// Q: `i32` -> Quantisation quality
12422    ///
12423    /// dither: `f64` -> Amount of dithering
12424    ///
12425    /// bitdepth: `i32` -> Write as a 1, 2, 4, 8 or 16 bit image
12426    ///
12427    /// effort: `i32` -> Quantisation CPU effort
12428    ///
12429    /// keep: [`ForeignKeep`] -> Which metadata to retain
12430    ///
12431    /// background: `&[f64]` -> Background value
12432    ///
12433    /// page_height: `i32` -> Set page height for multipage save
12434    ///
12435    /// profile: `&str` -> Filename of ICC profile to embed
12436    pub fn pngsave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
12437        let vips_op_response = call(
12438            "pngsave",
12439            option
12440                .set("in", self)
12441                .set(
12442                    "filename",
12443                    filename,
12444                ),
12445        );
12446
12447        utils::result(
12448            vips_op_response,
12449            (),
12450            Error::OperationError("Pngsave (vips_pngsave) failed".to_string()),
12451        )
12452    }
12453
12454    /// VipsForeignSavePngBuffer (pngsave_buffer), save image to png buffer (.png), priority=0, mono rgb alpha
12455    /// returns `Vec<u8>` - Buffer to save to
12456    pub fn pngsave_buffer(&self) -> Result<Vec<u8>> {
12457        let mut buffer_out = VipsBlob::from(null_mut());
12458        let vips_op_response = call(
12459            "pngsave_buffer",
12460            VOption::new()
12461                .set("in", self)
12462                .set(
12463                    "buffer",
12464                    &mut buffer_out,
12465                ),
12466        );
12467
12468        utils::result(
12469            vips_op_response,
12470            buffer_out.into(),
12471            Error::OperationError("PngsaveBuffer (vips_pngsave_buffer) failed".to_string()),
12472        )
12473    }
12474
12475    /// VipsForeignSavePngBuffer (pngsave_buffer), save image to png buffer (.png), priority=0, mono rgb alpha
12476    /// returns `Vec<u8>` - Buffer to save to
12477    ///
12478    /// <ins>Optional arguments</ins>
12479    ///
12480    /// compression: `i32` -> Compression factor
12481    ///
12482    /// interlace: `bool` -> Interlace image
12483    ///
12484    /// filter: [`ForeignPngFilter`] -> libpng row filter flag(s)
12485    ///
12486    /// palette: `bool` -> Quantise to 8bpp palette
12487    ///
12488    /// Q: `i32` -> Quantisation quality
12489    ///
12490    /// dither: `f64` -> Amount of dithering
12491    ///
12492    /// bitdepth: `i32` -> Write as a 1, 2, 4, 8 or 16 bit image
12493    ///
12494    /// effort: `i32` -> Quantisation CPU effort
12495    ///
12496    /// keep: [`ForeignKeep`] -> Which metadata to retain
12497    ///
12498    /// background: `&[f64]` -> Background value
12499    ///
12500    /// page_height: `i32` -> Set page height for multipage save
12501    ///
12502    /// profile: `&str` -> Filename of ICC profile to embed
12503    pub fn pngsave_buffer_with_opts(&self, option: VOption) -> Result<Vec<u8>> {
12504        let mut buffer_out = VipsBlob::from(null_mut());
12505        let vips_op_response = call(
12506            "pngsave_buffer",
12507            option
12508                .set("in", self)
12509                .set(
12510                    "buffer",
12511                    &mut buffer_out,
12512                ),
12513        );
12514
12515        utils::result(
12516            vips_op_response,
12517            buffer_out.into(),
12518            Error::OperationError("PngsaveBuffer (vips_pngsave_buffer) failed".to_string()),
12519        )
12520    }
12521
12522    /// VipsForeignSavePngTarget (pngsave_target), save image to target as PNG (.png), priority=0, mono rgb alpha
12523    ///
12524    /// target: `&VipsTarget` -> Target to save to
12525    pub fn pngsave_target(&self, target: &VipsTarget) -> Result<()> {
12526        let vips_op_response = call(
12527            "pngsave_target",
12528            VOption::new()
12529                .set("in", self)
12530                .set(
12531                    "target",
12532                    target,
12533                ),
12534        );
12535
12536        utils::result(
12537            vips_op_response,
12538            (),
12539            Error::OperationError("PngsaveTarget (vips_pngsave_target) failed".to_string()),
12540        )
12541    }
12542
12543    /// VipsForeignSavePngTarget (pngsave_target), save image to target as PNG (.png), priority=0, mono rgb alpha
12544    ///
12545    /// target: `&VipsTarget` -> Target to save to
12546    ///
12547    /// <ins>Optional arguments</ins>
12548    ///
12549    /// compression: `i32` -> Compression factor
12550    ///
12551    /// interlace: `bool` -> Interlace image
12552    ///
12553    /// filter: [`ForeignPngFilter`] -> libpng row filter flag(s)
12554    ///
12555    /// palette: `bool` -> Quantise to 8bpp palette
12556    ///
12557    /// Q: `i32` -> Quantisation quality
12558    ///
12559    /// dither: `f64` -> Amount of dithering
12560    ///
12561    /// bitdepth: `i32` -> Write as a 1, 2, 4, 8 or 16 bit image
12562    ///
12563    /// effort: `i32` -> Quantisation CPU effort
12564    ///
12565    /// keep: [`ForeignKeep`] -> Which metadata to retain
12566    ///
12567    /// background: `&[f64]` -> Background value
12568    ///
12569    /// page_height: `i32` -> Set page height for multipage save
12570    ///
12571    /// profile: `&str` -> Filename of ICC profile to embed
12572    pub fn pngsave_target_with_opts(&self, target: &VipsTarget, option: VOption) -> Result<()> {
12573        let vips_op_response = call(
12574            "pngsave_target",
12575            option
12576                .set("in", self)
12577                .set(
12578                    "target",
12579                    target,
12580                ),
12581        );
12582
12583        utils::result(
12584            vips_op_response,
12585            (),
12586            Error::OperationError("PngsaveTarget (vips_pngsave_target) failed".to_string()),
12587        )
12588    }
12589
12590    /// VipsForeignLoadPpmFile (ppmload), load ppm from file (.pbm, .pgm, .ppm, .pfm, .pnm), priority=200, untrusted, is_a, get_flags, header, load
12591    /// returns `VipsImage` - Output image
12592    ///
12593    /// filename: `&str` -> Filename to load from
12594    pub fn ppmload(filename: &str) -> Result<VipsImage> {
12595        let mut out_out = VipsImage::from(null_mut());
12596        let vips_op_response = call(
12597            "ppmload",
12598            VOption::new()
12599                .set(
12600                    "filename",
12601                    filename,
12602                )
12603                .set(
12604                    "out",
12605                    &mut out_out,
12606                ),
12607        );
12608
12609        utils::result(
12610            vips_op_response,
12611            out_out,
12612            Error::OperationError("Ppmload (vips_ppmload) failed".to_string()),
12613        )
12614    }
12615
12616    /// VipsForeignLoadPpmFile (ppmload), load ppm from file (.pbm, .pgm, .ppm, .pfm, .pnm), priority=200, untrusted, is_a, get_flags, header, load
12617    /// returns `VipsImage` - Output image
12618    ///
12619    /// filename: `&str` -> Filename to load from
12620    ///
12621    /// <ins>Optional arguments</ins>
12622    ///
12623    /// flags: [`ForeignFlags`] -> Flags for this file
12624    ///
12625    /// memory: `bool` -> Force open via memory
12626    ///
12627    /// access: [`Access`] -> Required access pattern for this file
12628    ///
12629    /// fail_on: [`FailOn`] -> Error level to fail on
12630    ///
12631    /// revalidate: `bool` -> Don't use a cached result for this operation
12632    pub fn ppmload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
12633        let mut out_out = VipsImage::from(null_mut());
12634        let vips_op_response = call(
12635            "ppmload",
12636            option
12637                .set(
12638                    "filename",
12639                    filename,
12640                )
12641                .set(
12642                    "out",
12643                    &mut out_out,
12644                ),
12645        );
12646
12647        utils::result(
12648            vips_op_response,
12649            out_out,
12650            Error::OperationError("Ppmload (vips_ppmload) failed".to_string()),
12651        )
12652    }
12653
12654    /// VipsForeignLoadPpmBuffer (ppmload_buffer), load ppm from buffer (.pbm, .pgm, .ppm, .pfm, .pnm), priority=200, untrusted, is_a_buffer, get_flags, header, load
12655    /// returns `VipsImage` - Output image
12656    ///
12657    /// buffer: `&[u8]` -> Buffer to load from
12658    pub fn ppmload_buffer(buffer: &[u8]) -> Result<VipsImage> {
12659        let vips_blob = unsafe {
12660            vips_blob_new(
12661                None,
12662                buffer.as_ptr() as _,
12663                buffer.len() as _,
12664            )
12665        };
12666        let blob = VipsBlob::from(vips_blob);
12667        let mut out_out = VipsImage::from(null_mut());
12668        let vips_op_response = call(
12669            "ppmload_buffer",
12670            VOption::new()
12671                .set(
12672                    "buffer",
12673                    &blob,
12674                )
12675                .set(
12676                    "out",
12677                    &mut out_out,
12678                ),
12679        );
12680        blob.area_unref();
12681        utils::result(
12682            vips_op_response,
12683            out_out,
12684            Error::OperationError("PpmloadBuffer (vips_ppmload_buffer) failed".to_string()),
12685        )
12686    }
12687
12688    /// VipsForeignLoadPpmBuffer (ppmload_buffer), load ppm from buffer (.pbm, .pgm, .ppm, .pfm, .pnm), priority=200, untrusted, is_a_buffer, get_flags, header, load
12689    /// returns `VipsImage` - Output image
12690    ///
12691    /// buffer: `&[u8]` -> Buffer to load from
12692    ///
12693    /// <ins>Optional arguments</ins>
12694    ///
12695    /// flags: [`ForeignFlags`] -> Flags for this file
12696    ///
12697    /// memory: `bool` -> Force open via memory
12698    ///
12699    /// access: [`Access`] -> Required access pattern for this file
12700    ///
12701    /// fail_on: [`FailOn`] -> Error level to fail on
12702    ///
12703    /// revalidate: `bool` -> Don't use a cached result for this operation
12704    pub fn ppmload_buffer_with_opts(buffer: &[u8], option: VOption) -> Result<VipsImage> {
12705        let vips_blob = unsafe {
12706            vips_blob_new(
12707                None,
12708                buffer.as_ptr() as _,
12709                buffer.len() as _,
12710            )
12711        };
12712        let blob = VipsBlob::from(vips_blob);
12713        let mut out_out = VipsImage::from(null_mut());
12714        let vips_op_response = call(
12715            "ppmload_buffer",
12716            option
12717                .set(
12718                    "buffer",
12719                    &blob,
12720                )
12721                .set(
12722                    "out",
12723                    &mut out_out,
12724                ),
12725        );
12726        blob.area_unref();
12727        utils::result(
12728            vips_op_response,
12729            out_out,
12730            Error::OperationError("PpmloadBuffer (vips_ppmload_buffer) failed".to_string()),
12731        )
12732    }
12733
12734    /// VipsForeignLoadPpmSource (ppmload_source), load ppm from source (.pbm, .pgm, .ppm, .pfm, .pnm), priority=200, untrusted, is_a_source, get_flags, header, load
12735    /// returns `VipsImage` - Output image
12736    ///
12737    /// source: `&VipsSource` -> Source to load from
12738    pub fn ppmload_source(source: &VipsSource) -> Result<VipsImage> {
12739        let mut out_out = VipsImage::from(null_mut());
12740        let vips_op_response = call(
12741            "ppmload_source",
12742            VOption::new()
12743                .set(
12744                    "source",
12745                    source,
12746                )
12747                .set(
12748                    "out",
12749                    &mut out_out,
12750                ),
12751        );
12752
12753        utils::result(
12754            vips_op_response,
12755            out_out,
12756            Error::OperationError("PpmloadSource (vips_ppmload_source) failed".to_string()),
12757        )
12758    }
12759
12760    /// VipsForeignLoadPpmSource (ppmload_source), load ppm from source (.pbm, .pgm, .ppm, .pfm, .pnm), priority=200, untrusted, is_a_source, get_flags, header, load
12761    /// returns `VipsImage` - Output image
12762    ///
12763    /// source: `&VipsSource` -> Source to load from
12764    ///
12765    /// <ins>Optional arguments</ins>
12766    ///
12767    /// flags: [`ForeignFlags`] -> Flags for this file
12768    ///
12769    /// memory: `bool` -> Force open via memory
12770    ///
12771    /// access: [`Access`] -> Required access pattern for this file
12772    ///
12773    /// fail_on: [`FailOn`] -> Error level to fail on
12774    ///
12775    /// revalidate: `bool` -> Don't use a cached result for this operation
12776    pub fn ppmload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
12777        let mut out_out = VipsImage::from(null_mut());
12778        let vips_op_response = call(
12779            "ppmload_source",
12780            option
12781                .set(
12782                    "source",
12783                    source,
12784                )
12785                .set(
12786                    "out",
12787                    &mut out_out,
12788                ),
12789        );
12790
12791        utils::result(
12792            vips_op_response,
12793            out_out,
12794            Error::OperationError("PpmloadSource (vips_ppmload_source) failed".to_string()),
12795        )
12796    }
12797
12798    /// VipsForeignSavePpmFile (ppmsave), save image to ppm file (.pbm, .pgm, .ppm, .pfm, .pnm), priority=0,
12799    ///
12800    /// filename: `&str` -> Filename to save to
12801    pub fn ppmsave(&self, filename: &str) -> Result<()> {
12802        let vips_op_response = call(
12803            "ppmsave",
12804            VOption::new()
12805                .set("in", self)
12806                .set(
12807                    "filename",
12808                    filename,
12809                ),
12810        );
12811
12812        utils::result(
12813            vips_op_response,
12814            (),
12815            Error::OperationError("Ppmsave (vips_ppmsave) failed".to_string()),
12816        )
12817    }
12818
12819    /// VipsForeignSavePpmFile (ppmsave), save image to ppm file (.pbm, .pgm, .ppm, .pfm, .pnm), priority=0,
12820    ///
12821    /// filename: `&str` -> Filename to save to
12822    ///
12823    /// <ins>Optional arguments</ins>
12824    ///
12825    /// format: [`ForeignPpmFormat`] -> Format to save in
12826    ///
12827    /// ascii: `bool` -> Save as ascii
12828    ///
12829    /// bitdepth: `i32` -> Set to 1 to write as a 1 bit image
12830    ///
12831    /// keep: [`ForeignKeep`] -> Which metadata to retain
12832    ///
12833    /// background: `&[f64]` -> Background value
12834    ///
12835    /// page_height: `i32` -> Set page height for multipage save
12836    ///
12837    /// profile: `&str` -> Filename of ICC profile to embed
12838    pub fn ppmsave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
12839        let vips_op_response = call(
12840            "ppmsave",
12841            option
12842                .set("in", self)
12843                .set(
12844                    "filename",
12845                    filename,
12846                ),
12847        );
12848
12849        utils::result(
12850            vips_op_response,
12851            (),
12852            Error::OperationError("Ppmsave (vips_ppmsave) failed".to_string()),
12853        )
12854    }
12855
12856    /// VipsForeignSavePpmTarget (ppmsave_target), save to ppm (.ppm), priority=0,
12857    ///
12858    /// target: `&VipsTarget` -> Target to save to
12859    pub fn ppmsave_target(&self, target: &VipsTarget) -> Result<()> {
12860        let vips_op_response = call(
12861            "ppmsave_target",
12862            VOption::new()
12863                .set("in", self)
12864                .set(
12865                    "target",
12866                    target,
12867                ),
12868        );
12869
12870        utils::result(
12871            vips_op_response,
12872            (),
12873            Error::OperationError("PpmsaveTarget (vips_ppmsave_target) failed".to_string()),
12874        )
12875    }
12876
12877    /// VipsForeignSavePpmTarget (ppmsave_target), save to ppm (.ppm), priority=0,
12878    ///
12879    /// target: `&VipsTarget` -> Target to save to
12880    ///
12881    /// <ins>Optional arguments</ins>
12882    ///
12883    /// format: [`ForeignPpmFormat`] -> Format to save in
12884    ///
12885    /// ascii: `bool` -> Save as ascii
12886    ///
12887    /// bitdepth: `i32` -> Set to 1 to write as a 1 bit image
12888    ///
12889    /// keep: [`ForeignKeep`] -> Which metadata to retain
12890    ///
12891    /// background: `&[f64]` -> Background value
12892    ///
12893    /// page_height: `i32` -> Set page height for multipage save
12894    ///
12895    /// profile: `&str` -> Filename of ICC profile to embed
12896    pub fn ppmsave_target_with_opts(&self, target: &VipsTarget, option: VOption) -> Result<()> {
12897        let vips_op_response = call(
12898            "ppmsave_target",
12899            option
12900                .set("in", self)
12901                .set(
12902                    "target",
12903                    target,
12904                ),
12905        );
12906
12907        utils::result(
12908            vips_op_response,
12909            (),
12910            Error::OperationError("PpmsaveTarget (vips_ppmsave_target) failed".to_string()),
12911        )
12912    }
12913
12914    /// VipsPremultiply (premultiply), premultiply image alpha
12915    /// returns `VipsImage` - Output image
12916    pub fn premultiply(&self) -> Result<VipsImage> {
12917        let mut out_out = VipsImage::from(null_mut());
12918        let vips_op_response = call(
12919            "premultiply",
12920            VOption::new()
12921                .set("in", self)
12922                .set(
12923                    "out",
12924                    &mut out_out,
12925                ),
12926        );
12927
12928        utils::result(
12929            vips_op_response,
12930            out_out,
12931            Error::OperationError("Premultiply (vips_premultiply) failed".to_string()),
12932        )
12933    }
12934
12935    /// VipsPremultiply (premultiply), premultiply image alpha
12936    /// returns `VipsImage` - Output image
12937    ///
12938    /// <ins>Optional arguments</ins>
12939    ///
12940    /// max_alpha: `f64` -> Maximum value of alpha channel
12941    pub fn premultiply_with_opts(&self, option: VOption) -> Result<VipsImage> {
12942        let mut out_out = VipsImage::from(null_mut());
12943        let vips_op_response = call(
12944            "premultiply",
12945            option
12946                .set("in", self)
12947                .set(
12948                    "out",
12949                    &mut out_out,
12950                ),
12951        );
12952
12953        utils::result(
12954            vips_op_response,
12955            out_out,
12956            Error::OperationError("Premultiply (vips_premultiply) failed".to_string()),
12957        )
12958    }
12959
12960    /// VipsPrewitt (prewitt), Prewitt edge detector
12961    /// returns `VipsImage` - Output image
12962    pub fn prewitt(&self) -> Result<VipsImage> {
12963        let mut out_out = VipsImage::from(null_mut());
12964        let vips_op_response = call(
12965            "prewitt",
12966            VOption::new()
12967                .set("in", self)
12968                .set(
12969                    "out",
12970                    &mut out_out,
12971                ),
12972        );
12973
12974        utils::result(
12975            vips_op_response,
12976            out_out,
12977            Error::OperationError("Prewitt (vips_prewitt) failed".to_string()),
12978        )
12979    }
12980
12981    /// VipsProfile (profile), find image profiles
12982    /// Tuple (
12983    /// VipsImage - First non-zero pixel in column
12984    /// VipsImage - First non-zero pixel in row
12985    ///)
12986    pub fn profile(
12987        &self,
12988    ) -> Result<(
12989        VipsImage,
12990        VipsImage,
12991    )> {
12992        let mut columns_out = VipsImage::from(null_mut());
12993        let mut rows_out = VipsImage::from(null_mut());
12994        let vips_op_response = call(
12995            "profile",
12996            VOption::new()
12997                .set("in", self)
12998                .set(
12999                    "columns",
13000                    &mut columns_out,
13001                )
13002                .set(
13003                    "rows",
13004                    &mut rows_out,
13005                ),
13006        );
13007
13008        utils::result(
13009            vips_op_response,
13010            (
13011                columns_out,
13012                rows_out,
13013            ),
13014            Error::OperationError("Profile (vips_profile) failed".to_string()),
13015        )
13016    }
13017
13018    /// VipsProfileLoad (profile_load), load named ICC profile
13019    /// returns `Vec<u8>` - Loaded profile
13020    ///
13021    /// name: `&str` -> Profile name
13022    pub fn profile_load(name: &str) -> Result<Vec<u8>> {
13023        let mut profile_out = VipsBlob::from(null_mut());
13024        let vips_op_response = call(
13025            "profile_load",
13026            VOption::new()
13027                .set(
13028                    "name",
13029                    name,
13030                )
13031                .set(
13032                    "profile",
13033                    &mut profile_out,
13034                ),
13035        );
13036
13037        utils::result(
13038            vips_op_response,
13039            profile_out.into(),
13040            Error::OperationError("ProfileLoad (vips_profile_load) failed".to_string()),
13041        )
13042    }
13043
13044    /// VipsProject (project), find image projections
13045    /// Tuple (
13046    /// VipsImage - Sums of columns
13047    /// VipsImage - Sums of rows
13048    ///)
13049    pub fn project(
13050        &self,
13051    ) -> Result<(
13052        VipsImage,
13053        VipsImage,
13054    )> {
13055        let mut columns_out = VipsImage::from(null_mut());
13056        let mut rows_out = VipsImage::from(null_mut());
13057        let vips_op_response = call(
13058            "project",
13059            VOption::new()
13060                .set("in", self)
13061                .set(
13062                    "columns",
13063                    &mut columns_out,
13064                )
13065                .set(
13066                    "rows",
13067                    &mut rows_out,
13068                ),
13069        );
13070
13071        utils::result(
13072            vips_op_response,
13073            (
13074                columns_out,
13075                rows_out,
13076            ),
13077            Error::OperationError("Project (vips_project) failed".to_string()),
13078        )
13079    }
13080
13081    /// VipsQuadratic (quadratic), resample an image with a quadratic transform
13082    /// returns `VipsImage` - Output image
13083    ///
13084    /// coeff: `&VipsImage` -> Coefficient matrix
13085    pub fn quadratic(&self, coeff: &VipsImage) -> Result<VipsImage> {
13086        let mut out_out = VipsImage::from(null_mut());
13087        let vips_op_response = call(
13088            "quadratic",
13089            VOption::new()
13090                .set("in", self)
13091                .set(
13092                    "out",
13093                    &mut out_out,
13094                )
13095                .set(
13096                    "coeff",
13097                    coeff,
13098                ),
13099        );
13100
13101        utils::result(
13102            vips_op_response,
13103            out_out,
13104            Error::OperationError("Quadratic (vips_quadratic) failed".to_string()),
13105        )
13106    }
13107
13108    /// VipsQuadratic (quadratic), resample an image with a quadratic transform
13109    /// returns `VipsImage` - Output image
13110    ///
13111    /// coeff: `&VipsImage` -> Coefficient matrix
13112    ///
13113    /// <ins>Optional arguments</ins>
13114    ///
13115    /// interpolate: `&VipsInterpolate` -> Interpolate values with this
13116    pub fn quadratic_with_opts(&self, coeff: &VipsImage, option: VOption) -> Result<VipsImage> {
13117        let mut out_out = VipsImage::from(null_mut());
13118        let vips_op_response = call(
13119            "quadratic",
13120            option
13121                .set("in", self)
13122                .set(
13123                    "out",
13124                    &mut out_out,
13125                )
13126                .set(
13127                    "coeff",
13128                    coeff,
13129                ),
13130        );
13131
13132        utils::result(
13133            vips_op_response,
13134            out_out,
13135            Error::OperationError("Quadratic (vips_quadratic) failed".to_string()),
13136        )
13137    }
13138
13139    /// VipsRad2float (rad2float), unpack Radiance coding to float RGB
13140    /// returns `VipsImage` - Output image
13141    pub fn rad2float(&self) -> Result<VipsImage> {
13142        let mut out_out = VipsImage::from(null_mut());
13143        let vips_op_response = call(
13144            "rad2float",
13145            VOption::new()
13146                .set("in", self)
13147                .set(
13148                    "out",
13149                    &mut out_out,
13150                ),
13151        );
13152
13153        utils::result(
13154            vips_op_response,
13155            out_out,
13156            Error::OperationError("Rad2Float (vips_rad2float) failed".to_string()),
13157        )
13158    }
13159
13160    /// VipsForeignLoadRadFile (radload), load a Radiance image from a file (.hdr), priority=-50, untrusted, is_a, get_flags, get_flags_filename, header, load
13161    /// returns `VipsImage` - Output image
13162    ///
13163    /// filename: `&str` -> Filename to load from
13164    pub fn radload(filename: &str) -> Result<VipsImage> {
13165        let mut out_out = VipsImage::from(null_mut());
13166        let vips_op_response = call(
13167            "radload",
13168            VOption::new()
13169                .set(
13170                    "filename",
13171                    filename,
13172                )
13173                .set(
13174                    "out",
13175                    &mut out_out,
13176                ),
13177        );
13178
13179        utils::result(
13180            vips_op_response,
13181            out_out,
13182            Error::OperationError("Radload (vips_radload) failed".to_string()),
13183        )
13184    }
13185
13186    /// VipsForeignLoadRadFile (radload), load a Radiance image from a file (.hdr), priority=-50, untrusted, is_a, get_flags, get_flags_filename, header, load
13187    /// returns `VipsImage` - Output image
13188    ///
13189    /// filename: `&str` -> Filename to load from
13190    ///
13191    /// <ins>Optional arguments</ins>
13192    ///
13193    /// flags: [`ForeignFlags`] -> Flags for this file
13194    ///
13195    /// memory: `bool` -> Force open via memory
13196    ///
13197    /// access: [`Access`] -> Required access pattern for this file
13198    ///
13199    /// fail_on: [`FailOn`] -> Error level to fail on
13200    ///
13201    /// revalidate: `bool` -> Don't use a cached result for this operation
13202    pub fn radload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
13203        let mut out_out = VipsImage::from(null_mut());
13204        let vips_op_response = call(
13205            "radload",
13206            option
13207                .set(
13208                    "filename",
13209                    filename,
13210                )
13211                .set(
13212                    "out",
13213                    &mut out_out,
13214                ),
13215        );
13216
13217        utils::result(
13218            vips_op_response,
13219            out_out,
13220            Error::OperationError("Radload (vips_radload) failed".to_string()),
13221        )
13222    }
13223
13224    /// VipsForeignLoadRadBuffer (radload_buffer), load rad from buffer, priority=-50, untrusted, is_a_buffer, get_flags, get_flags_filename, header, load
13225    /// returns `VipsImage` - Output image
13226    ///
13227    /// buffer: `&[u8]` -> Buffer to load from
13228    pub fn radload_buffer(buffer: &[u8]) -> Result<VipsImage> {
13229        let vips_blob = unsafe {
13230            vips_blob_new(
13231                None,
13232                buffer.as_ptr() as _,
13233                buffer.len() as _,
13234            )
13235        };
13236        let blob = VipsBlob::from(vips_blob);
13237        let mut out_out = VipsImage::from(null_mut());
13238        let vips_op_response = call(
13239            "radload_buffer",
13240            VOption::new()
13241                .set(
13242                    "buffer",
13243                    &blob,
13244                )
13245                .set(
13246                    "out",
13247                    &mut out_out,
13248                ),
13249        );
13250        blob.area_unref();
13251        utils::result(
13252            vips_op_response,
13253            out_out,
13254            Error::OperationError("RadloadBuffer (vips_radload_buffer) failed".to_string()),
13255        )
13256    }
13257
13258    /// VipsForeignLoadRadBuffer (radload_buffer), load rad from buffer, priority=-50, untrusted, is_a_buffer, get_flags, get_flags_filename, header, load
13259    /// returns `VipsImage` - Output image
13260    ///
13261    /// buffer: `&[u8]` -> Buffer to load from
13262    ///
13263    /// <ins>Optional arguments</ins>
13264    ///
13265    /// flags: [`ForeignFlags`] -> Flags for this file
13266    ///
13267    /// memory: `bool` -> Force open via memory
13268    ///
13269    /// access: [`Access`] -> Required access pattern for this file
13270    ///
13271    /// fail_on: [`FailOn`] -> Error level to fail on
13272    ///
13273    /// revalidate: `bool` -> Don't use a cached result for this operation
13274    pub fn radload_buffer_with_opts(buffer: &[u8], option: VOption) -> Result<VipsImage> {
13275        let vips_blob = unsafe {
13276            vips_blob_new(
13277                None,
13278                buffer.as_ptr() as _,
13279                buffer.len() as _,
13280            )
13281        };
13282        let blob = VipsBlob::from(vips_blob);
13283        let mut out_out = VipsImage::from(null_mut());
13284        let vips_op_response = call(
13285            "radload_buffer",
13286            option
13287                .set(
13288                    "buffer",
13289                    &blob,
13290                )
13291                .set(
13292                    "out",
13293                    &mut out_out,
13294                ),
13295        );
13296        blob.area_unref();
13297        utils::result(
13298            vips_op_response,
13299            out_out,
13300            Error::OperationError("RadloadBuffer (vips_radload_buffer) failed".to_string()),
13301        )
13302    }
13303
13304    /// VipsForeignLoadRadSource (radload_source), load rad from source, priority=-50, untrusted, is_a_source, get_flags, get_flags_filename, header, load
13305    /// returns `VipsImage` - Output image
13306    ///
13307    /// source: `&VipsSource` -> Source to load from
13308    pub fn radload_source(source: &VipsSource) -> Result<VipsImage> {
13309        let mut out_out = VipsImage::from(null_mut());
13310        let vips_op_response = call(
13311            "radload_source",
13312            VOption::new()
13313                .set(
13314                    "source",
13315                    source,
13316                )
13317                .set(
13318                    "out",
13319                    &mut out_out,
13320                ),
13321        );
13322
13323        utils::result(
13324            vips_op_response,
13325            out_out,
13326            Error::OperationError("RadloadSource (vips_radload_source) failed".to_string()),
13327        )
13328    }
13329
13330    /// VipsForeignLoadRadSource (radload_source), load rad from source, priority=-50, untrusted, is_a_source, get_flags, get_flags_filename, header, load
13331    /// returns `VipsImage` - Output image
13332    ///
13333    /// source: `&VipsSource` -> Source to load from
13334    ///
13335    /// <ins>Optional arguments</ins>
13336    ///
13337    /// flags: [`ForeignFlags`] -> Flags for this file
13338    ///
13339    /// memory: `bool` -> Force open via memory
13340    ///
13341    /// access: [`Access`] -> Required access pattern for this file
13342    ///
13343    /// fail_on: [`FailOn`] -> Error level to fail on
13344    ///
13345    /// revalidate: `bool` -> Don't use a cached result for this operation
13346    pub fn radload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
13347        let mut out_out = VipsImage::from(null_mut());
13348        let vips_op_response = call(
13349            "radload_source",
13350            option
13351                .set(
13352                    "source",
13353                    source,
13354                )
13355                .set(
13356                    "out",
13357                    &mut out_out,
13358                ),
13359        );
13360
13361        utils::result(
13362            vips_op_response,
13363            out_out,
13364            Error::OperationError("RadloadSource (vips_radload_source) failed".to_string()),
13365        )
13366    }
13367
13368    /// VipsForeignSaveRadFile (radsave), save image to Radiance file (.hdr), priority=0, mono rgb
13369    ///
13370    /// filename: `&str` -> Filename to save to
13371    pub fn radsave(&self, filename: &str) -> Result<()> {
13372        let vips_op_response = call(
13373            "radsave",
13374            VOption::new()
13375                .set("in", self)
13376                .set(
13377                    "filename",
13378                    filename,
13379                ),
13380        );
13381
13382        utils::result(
13383            vips_op_response,
13384            (),
13385            Error::OperationError("Radsave (vips_radsave) failed".to_string()),
13386        )
13387    }
13388
13389    /// VipsForeignSaveRadFile (radsave), save image to Radiance file (.hdr), priority=0, mono rgb
13390    ///
13391    /// filename: `&str` -> Filename to save to
13392    ///
13393    /// <ins>Optional arguments</ins>
13394    ///
13395    /// keep: [`ForeignKeep`] -> Which metadata to retain
13396    ///
13397    /// background: `&[f64]` -> Background value
13398    ///
13399    /// page_height: `i32` -> Set page height for multipage save
13400    ///
13401    /// profile: `&str` -> Filename of ICC profile to embed
13402    pub fn radsave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
13403        let vips_op_response = call(
13404            "radsave",
13405            option
13406                .set("in", self)
13407                .set(
13408                    "filename",
13409                    filename,
13410                ),
13411        );
13412
13413        utils::result(
13414            vips_op_response,
13415            (),
13416            Error::OperationError("Radsave (vips_radsave) failed".to_string()),
13417        )
13418    }
13419
13420    /// VipsForeignSaveRadBuffer (radsave_buffer), save image to Radiance buffer (.hdr), priority=0, mono rgb
13421    /// returns `Vec<u8>` - Buffer to save to
13422    pub fn radsave_buffer(&self) -> Result<Vec<u8>> {
13423        let mut buffer_out = VipsBlob::from(null_mut());
13424        let vips_op_response = call(
13425            "radsave_buffer",
13426            VOption::new()
13427                .set("in", self)
13428                .set(
13429                    "buffer",
13430                    &mut buffer_out,
13431                ),
13432        );
13433
13434        utils::result(
13435            vips_op_response,
13436            buffer_out.into(),
13437            Error::OperationError("RadsaveBuffer (vips_radsave_buffer) failed".to_string()),
13438        )
13439    }
13440
13441    /// VipsForeignSaveRadBuffer (radsave_buffer), save image to Radiance buffer (.hdr), priority=0, mono rgb
13442    /// returns `Vec<u8>` - Buffer to save to
13443    ///
13444    /// <ins>Optional arguments</ins>
13445    ///
13446    /// keep: [`ForeignKeep`] -> Which metadata to retain
13447    ///
13448    /// background: `&[f64]` -> Background value
13449    ///
13450    /// page_height: `i32` -> Set page height for multipage save
13451    ///
13452    /// profile: `&str` -> Filename of ICC profile to embed
13453    pub fn radsave_buffer_with_opts(&self, option: VOption) -> Result<Vec<u8>> {
13454        let mut buffer_out = VipsBlob::from(null_mut());
13455        let vips_op_response = call(
13456            "radsave_buffer",
13457            option
13458                .set("in", self)
13459                .set(
13460                    "buffer",
13461                    &mut buffer_out,
13462                ),
13463        );
13464
13465        utils::result(
13466            vips_op_response,
13467            buffer_out.into(),
13468            Error::OperationError("RadsaveBuffer (vips_radsave_buffer) failed".to_string()),
13469        )
13470    }
13471
13472    /// VipsForeignSaveRadTarget (radsave_target), save image to Radiance target (.hdr), priority=0, mono rgb
13473    ///
13474    /// target: `&VipsTarget` -> Target to save to
13475    pub fn radsave_target(&self, target: &VipsTarget) -> Result<()> {
13476        let vips_op_response = call(
13477            "radsave_target",
13478            VOption::new()
13479                .set("in", self)
13480                .set(
13481                    "target",
13482                    target,
13483                ),
13484        );
13485
13486        utils::result(
13487            vips_op_response,
13488            (),
13489            Error::OperationError("RadsaveTarget (vips_radsave_target) failed".to_string()),
13490        )
13491    }
13492
13493    /// VipsForeignSaveRadTarget (radsave_target), save image to Radiance target (.hdr), priority=0, mono rgb
13494    ///
13495    /// target: `&VipsTarget` -> Target to save to
13496    ///
13497    /// <ins>Optional arguments</ins>
13498    ///
13499    /// keep: [`ForeignKeep`] -> Which metadata to retain
13500    ///
13501    /// background: `&[f64]` -> Background value
13502    ///
13503    /// page_height: `i32` -> Set page height for multipage save
13504    ///
13505    /// profile: `&str` -> Filename of ICC profile to embed
13506    pub fn radsave_target_with_opts(&self, target: &VipsTarget, option: VOption) -> Result<()> {
13507        let vips_op_response = call(
13508            "radsave_target",
13509            option
13510                .set("in", self)
13511                .set(
13512                    "target",
13513                    target,
13514                ),
13515        );
13516
13517        utils::result(
13518            vips_op_response,
13519            (),
13520            Error::OperationError("RadsaveTarget (vips_radsave_target) failed".to_string()),
13521        )
13522    }
13523
13524    /// VipsRank (rank), rank filter
13525    /// returns `VipsImage` - Output image
13526    ///
13527    /// width: `i32` -> Window width in pixels
13528    ///
13529    /// height: `i32` -> Window height in pixels
13530    ///
13531    /// index: `i32` -> Select pixel at index
13532    pub fn rank(&self, width: i32, height: i32, index: i32) -> Result<VipsImage> {
13533        let mut out_out = VipsImage::from(null_mut());
13534        let vips_op_response = call(
13535            "rank",
13536            VOption::new()
13537                .set("in", self)
13538                .set(
13539                    "out",
13540                    &mut out_out,
13541                )
13542                .set(
13543                    "width",
13544                    width,
13545                )
13546                .set(
13547                    "height",
13548                    height,
13549                )
13550                .set(
13551                    "index",
13552                    index,
13553                ),
13554        );
13555
13556        utils::result(
13557            vips_op_response,
13558            out_out,
13559            Error::OperationError("Rank (vips_rank) failed".to_string()),
13560        )
13561    }
13562
13563    /// VipsForeignLoadRaw (rawload), load raw data from a file, priority=0, untrusted, get_flags, get_flags_filename, header
13564    /// returns `VipsImage` - Output image
13565    ///
13566    /// filename: `&str` -> Filename to load from
13567    ///
13568    /// width: `i32` -> Image width in pixels
13569    ///
13570    /// height: `i32` -> Image height in pixels
13571    ///
13572    /// bands: `i32` -> Number of bands in image
13573    pub fn rawload(filename: &str, width: i32, height: i32, bands: i32) -> Result<VipsImage> {
13574        let mut out_out = VipsImage::from(null_mut());
13575        let vips_op_response = call(
13576            "rawload",
13577            VOption::new()
13578                .set(
13579                    "filename",
13580                    filename,
13581                )
13582                .set(
13583                    "out",
13584                    &mut out_out,
13585                )
13586                .set(
13587                    "width",
13588                    width,
13589                )
13590                .set(
13591                    "height",
13592                    height,
13593                )
13594                .set(
13595                    "bands",
13596                    bands,
13597                ),
13598        );
13599
13600        utils::result(
13601            vips_op_response,
13602            out_out,
13603            Error::OperationError("Rawload (vips_rawload) failed".to_string()),
13604        )
13605    }
13606
13607    /// VipsForeignLoadRaw (rawload), load raw data from a file, priority=0, untrusted, get_flags, get_flags_filename, header
13608    /// returns `VipsImage` - Output image
13609    ///
13610    /// filename: `&str` -> Filename to load from
13611    ///
13612    /// width: `i32` -> Image width in pixels
13613    ///
13614    /// height: `i32` -> Image height in pixels
13615    ///
13616    /// bands: `i32` -> Number of bands in image
13617    ///
13618    /// <ins>Optional arguments</ins>
13619    ///
13620    /// offset: `u64` -> Offset in bytes from start of file
13621    ///
13622    /// format: [`BandFormat`] -> Pixel format in image
13623    ///
13624    /// interpretation: [`Interpretation`] -> Pixel interpretation
13625    ///
13626    /// flags: [`ForeignFlags`] -> Flags for this file
13627    ///
13628    /// memory: `bool` -> Force open via memory
13629    ///
13630    /// access: [`Access`] -> Required access pattern for this file
13631    ///
13632    /// fail_on: [`FailOn`] -> Error level to fail on
13633    ///
13634    /// revalidate: `bool` -> Don't use a cached result for this operation
13635    pub fn rawload_with_opts(
13636        filename: &str,
13637        width: i32,
13638        height: i32,
13639        bands: i32,
13640        option: VOption,
13641    ) -> Result<VipsImage> {
13642        let mut out_out = VipsImage::from(null_mut());
13643        let vips_op_response = call(
13644            "rawload",
13645            option
13646                .set(
13647                    "filename",
13648                    filename,
13649                )
13650                .set(
13651                    "out",
13652                    &mut out_out,
13653                )
13654                .set(
13655                    "width",
13656                    width,
13657                )
13658                .set(
13659                    "height",
13660                    height,
13661                )
13662                .set(
13663                    "bands",
13664                    bands,
13665                ),
13666        );
13667
13668        utils::result(
13669            vips_op_response,
13670            out_out,
13671            Error::OperationError("Rawload (vips_rawload) failed".to_string()),
13672        )
13673    }
13674
13675    /// VipsForeignSaveRawFile (rawsave), save image to raw file (.raw), priority=0,
13676    ///
13677    /// filename: `&str` -> Filename to save to
13678    pub fn rawsave(&self, filename: &str) -> Result<()> {
13679        let vips_op_response = call(
13680            "rawsave",
13681            VOption::new()
13682                .set("in", self)
13683                .set(
13684                    "filename",
13685                    filename,
13686                ),
13687        );
13688
13689        utils::result(
13690            vips_op_response,
13691            (),
13692            Error::OperationError("Rawsave (vips_rawsave) failed".to_string()),
13693        )
13694    }
13695
13696    /// VipsForeignSaveRawFile (rawsave), save image to raw file (.raw), priority=0,
13697    ///
13698    /// filename: `&str` -> Filename to save to
13699    ///
13700    /// <ins>Optional arguments</ins>
13701    ///
13702    /// keep: [`ForeignKeep`] -> Which metadata to retain
13703    ///
13704    /// background: `&[f64]` -> Background value
13705    ///
13706    /// page_height: `i32` -> Set page height for multipage save
13707    ///
13708    /// profile: `&str` -> Filename of ICC profile to embed
13709    pub fn rawsave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
13710        let vips_op_response = call(
13711            "rawsave",
13712            option
13713                .set("in", self)
13714                .set(
13715                    "filename",
13716                    filename,
13717                ),
13718        );
13719
13720        utils::result(
13721            vips_op_response,
13722            (),
13723            Error::OperationError("Rawsave (vips_rawsave) failed".to_string()),
13724        )
13725    }
13726
13727    /// VipsForeignSaveRawBuffer (rawsave_buffer), write raw image to buffer (.raw), priority=0,
13728    /// returns `Vec<u8>` - Buffer to save to
13729    pub fn rawsave_buffer(&self) -> Result<Vec<u8>> {
13730        let mut buffer_out = VipsBlob::from(null_mut());
13731        let vips_op_response = call(
13732            "rawsave_buffer",
13733            VOption::new()
13734                .set("in", self)
13735                .set(
13736                    "buffer",
13737                    &mut buffer_out,
13738                ),
13739        );
13740
13741        utils::result(
13742            vips_op_response,
13743            buffer_out.into(),
13744            Error::OperationError("RawsaveBuffer (vips_rawsave_buffer) failed".to_string()),
13745        )
13746    }
13747
13748    /// VipsForeignSaveRawBuffer (rawsave_buffer), write raw image to buffer (.raw), priority=0,
13749    /// returns `Vec<u8>` - Buffer to save to
13750    ///
13751    /// <ins>Optional arguments</ins>
13752    ///
13753    /// keep: [`ForeignKeep`] -> Which metadata to retain
13754    ///
13755    /// background: `&[f64]` -> Background value
13756    ///
13757    /// page_height: `i32` -> Set page height for multipage save
13758    ///
13759    /// profile: `&str` -> Filename of ICC profile to embed
13760    pub fn rawsave_buffer_with_opts(&self, option: VOption) -> Result<Vec<u8>> {
13761        let mut buffer_out = VipsBlob::from(null_mut());
13762        let vips_op_response = call(
13763            "rawsave_buffer",
13764            option
13765                .set("in", self)
13766                .set(
13767                    "buffer",
13768                    &mut buffer_out,
13769                ),
13770        );
13771
13772        utils::result(
13773            vips_op_response,
13774            buffer_out.into(),
13775            Error::OperationError("RawsaveBuffer (vips_rawsave_buffer) failed".to_string()),
13776        )
13777    }
13778
13779    /// VipsForeignSaveRawTarget (rawsave_target), write raw image to target (.raw), priority=0,
13780    ///
13781    /// target: `&VipsTarget` -> Target to save to
13782    pub fn rawsave_target(&self, target: &VipsTarget) -> Result<()> {
13783        let vips_op_response = call(
13784            "rawsave_target",
13785            VOption::new()
13786                .set("in", self)
13787                .set(
13788                    "target",
13789                    target,
13790                ),
13791        );
13792
13793        utils::result(
13794            vips_op_response,
13795            (),
13796            Error::OperationError("RawsaveTarget (vips_rawsave_target) failed".to_string()),
13797        )
13798    }
13799
13800    /// VipsForeignSaveRawTarget (rawsave_target), write raw image to target (.raw), priority=0,
13801    ///
13802    /// target: `&VipsTarget` -> Target to save to
13803    ///
13804    /// <ins>Optional arguments</ins>
13805    ///
13806    /// keep: [`ForeignKeep`] -> Which metadata to retain
13807    ///
13808    /// background: `&[f64]` -> Background value
13809    ///
13810    /// page_height: `i32` -> Set page height for multipage save
13811    ///
13812    /// profile: `&str` -> Filename of ICC profile to embed
13813    pub fn rawsave_target_with_opts(&self, target: &VipsTarget, option: VOption) -> Result<()> {
13814        let vips_op_response = call(
13815            "rawsave_target",
13816            option
13817                .set("in", self)
13818                .set(
13819                    "target",
13820                    target,
13821                ),
13822        );
13823
13824        utils::result(
13825            vips_op_response,
13826            (),
13827            Error::OperationError("RawsaveTarget (vips_rawsave_target) failed".to_string()),
13828        )
13829    }
13830
13831    /// VipsRecomb (recomb), linear recombination with matrix
13832    /// returns `VipsImage` - Output image
13833    ///
13834    /// m: `&VipsImage` -> Matrix of coefficients
13835    pub fn recomb(&self, m: &VipsImage) -> Result<VipsImage> {
13836        let mut out_out = VipsImage::from(null_mut());
13837        let vips_op_response = call(
13838            "recomb",
13839            VOption::new()
13840                .set("in", self)
13841                .set(
13842                    "out",
13843                    &mut out_out,
13844                )
13845                .set("m", m),
13846        );
13847
13848        utils::result(
13849            vips_op_response,
13850            out_out,
13851            Error::OperationError("Recomb (vips_recomb) failed".to_string()),
13852        )
13853    }
13854
13855    /// VipsReduce (reduce), reduce an image
13856    /// returns `VipsImage` - Output image
13857    ///
13858    /// hshrink: `f64` -> Horizontal shrink factor
13859    ///
13860    /// vshrink: `f64` -> Vertical shrink factor
13861    pub fn reduce(&self, hshrink: f64, vshrink: f64) -> Result<VipsImage> {
13862        let mut out_out = VipsImage::from(null_mut());
13863        let vips_op_response = call(
13864            "reduce",
13865            VOption::new()
13866                .set("in", self)
13867                .set(
13868                    "out",
13869                    &mut out_out,
13870                )
13871                .set(
13872                    "hshrink",
13873                    hshrink,
13874                )
13875                .set(
13876                    "vshrink",
13877                    vshrink,
13878                ),
13879        );
13880
13881        utils::result(
13882            vips_op_response,
13883            out_out,
13884            Error::OperationError("Reduce (vips_reduce) failed".to_string()),
13885        )
13886    }
13887
13888    /// VipsReduce (reduce), reduce an image
13889    /// returns `VipsImage` - Output image
13890    ///
13891    /// hshrink: `f64` -> Horizontal shrink factor
13892    ///
13893    /// vshrink: `f64` -> Vertical shrink factor
13894    ///
13895    /// <ins>Optional arguments</ins>
13896    ///
13897    /// kernel: [`Kernel`] -> Resampling kernel
13898    ///
13899    /// gap: `f64` -> Reducing gap
13900    pub fn reduce_with_opts(
13901        &self,
13902        hshrink: f64,
13903        vshrink: f64,
13904        option: VOption,
13905    ) -> Result<VipsImage> {
13906        let mut out_out = VipsImage::from(null_mut());
13907        let vips_op_response = call(
13908            "reduce",
13909            option
13910                .set("in", self)
13911                .set(
13912                    "out",
13913                    &mut out_out,
13914                )
13915                .set(
13916                    "hshrink",
13917                    hshrink,
13918                )
13919                .set(
13920                    "vshrink",
13921                    vshrink,
13922                ),
13923        );
13924
13925        utils::result(
13926            vips_op_response,
13927            out_out,
13928            Error::OperationError("Reduce (vips_reduce) failed".to_string()),
13929        )
13930    }
13931
13932    /// VipsReduceh (reduceh), shrink an image horizontally
13933    /// returns `VipsImage` - Output image
13934    ///
13935    /// hshrink: `f64` -> Horizontal shrink factor
13936    pub fn reduceh(&self, hshrink: f64) -> Result<VipsImage> {
13937        let mut out_out = VipsImage::from(null_mut());
13938        let vips_op_response = call(
13939            "reduceh",
13940            VOption::new()
13941                .set("in", self)
13942                .set(
13943                    "out",
13944                    &mut out_out,
13945                )
13946                .set(
13947                    "hshrink",
13948                    hshrink,
13949                ),
13950        );
13951
13952        utils::result(
13953            vips_op_response,
13954            out_out,
13955            Error::OperationError("Reduceh (vips_reduceh) failed".to_string()),
13956        )
13957    }
13958
13959    /// VipsReduceh (reduceh), shrink an image horizontally
13960    /// returns `VipsImage` - Output image
13961    ///
13962    /// hshrink: `f64` -> Horizontal shrink factor
13963    ///
13964    /// <ins>Optional arguments</ins>
13965    ///
13966    /// kernel: [`Kernel`] -> Resampling kernel
13967    ///
13968    /// gap: `f64` -> Reducing gap
13969    pub fn reduceh_with_opts(&self, hshrink: f64, option: VOption) -> Result<VipsImage> {
13970        let mut out_out = VipsImage::from(null_mut());
13971        let vips_op_response = call(
13972            "reduceh",
13973            option
13974                .set("in", self)
13975                .set(
13976                    "out",
13977                    &mut out_out,
13978                )
13979                .set(
13980                    "hshrink",
13981                    hshrink,
13982                ),
13983        );
13984
13985        utils::result(
13986            vips_op_response,
13987            out_out,
13988            Error::OperationError("Reduceh (vips_reduceh) failed".to_string()),
13989        )
13990    }
13991
13992    /// VipsReducev (reducev), shrink an image vertically
13993    /// returns `VipsImage` - Output image
13994    ///
13995    /// vshrink: `f64` -> Vertical shrink factor
13996    pub fn reducev(&self, vshrink: f64) -> Result<VipsImage> {
13997        let mut out_out = VipsImage::from(null_mut());
13998        let vips_op_response = call(
13999            "reducev",
14000            VOption::new()
14001                .set("in", self)
14002                .set(
14003                    "out",
14004                    &mut out_out,
14005                )
14006                .set(
14007                    "vshrink",
14008                    vshrink,
14009                ),
14010        );
14011
14012        utils::result(
14013            vips_op_response,
14014            out_out,
14015            Error::OperationError("Reducev (vips_reducev) failed".to_string()),
14016        )
14017    }
14018
14019    /// VipsReducev (reducev), shrink an image vertically
14020    /// returns `VipsImage` - Output image
14021    ///
14022    /// vshrink: `f64` -> Vertical shrink factor
14023    ///
14024    /// <ins>Optional arguments</ins>
14025    ///
14026    /// kernel: [`Kernel`] -> Resampling kernel
14027    ///
14028    /// gap: `f64` -> Reducing gap
14029    pub fn reducev_with_opts(&self, vshrink: f64, option: VOption) -> Result<VipsImage> {
14030        let mut out_out = VipsImage::from(null_mut());
14031        let vips_op_response = call(
14032            "reducev",
14033            option
14034                .set("in", self)
14035                .set(
14036                    "out",
14037                    &mut out_out,
14038                )
14039                .set(
14040                    "vshrink",
14041                    vshrink,
14042                ),
14043        );
14044
14045        utils::result(
14046            vips_op_response,
14047            out_out,
14048            Error::OperationError("Reducev (vips_reducev) failed".to_string()),
14049        )
14050    }
14051
14052    /// VipsRelational (relational), relational operation on two images
14053    /// returns `VipsImage` - Output image
14054    ///
14055    /// right: `&VipsImage` -> Right-hand image argument
14056    ///
14057    /// relational: `OperationRelational` -> Relational to perform
14058    pub fn relational(
14059        &self,
14060        right: &VipsImage,
14061        relational: OperationRelational,
14062    ) -> Result<VipsImage> {
14063        let mut out_out = VipsImage::from(null_mut());
14064        let vips_op_response = call(
14065            "relational",
14066            VOption::new()
14067                .set(
14068                    "left",
14069                    self,
14070                )
14071                .set(
14072                    "right",
14073                    right,
14074                )
14075                .set(
14076                    "out",
14077                    &mut out_out,
14078                )
14079                .set(
14080                    "relational",
14081                    relational as i32,
14082                ),
14083        );
14084
14085        utils::result(
14086            vips_op_response,
14087            out_out,
14088            Error::OperationError("Relational (vips_relational) failed".to_string()),
14089        )
14090    }
14091
14092    /// VipsRelationalConst (relational_const), relational operations against a constant
14093    /// returns `VipsImage` - Output image
14094    ///
14095    /// relational: `OperationRelational` -> Relational to perform
14096    ///
14097    /// c: `&[f64]` -> Array of constants
14098    pub fn relational_const(
14099        &self,
14100        relational: OperationRelational,
14101        c: &[f64],
14102    ) -> Result<VipsImage> {
14103        let mut out_out = VipsImage::from(null_mut());
14104        let vips_op_response = call(
14105            "relational_const",
14106            VOption::new()
14107                .set("in", self)
14108                .set(
14109                    "out",
14110                    &mut out_out,
14111                )
14112                .set(
14113                    "relational",
14114                    relational as i32,
14115                )
14116                .set("c", c),
14117        );
14118
14119        utils::result(
14120            vips_op_response,
14121            out_out,
14122            Error::OperationError("RelationalConst (vips_relational_const) failed".to_string()),
14123        )
14124    }
14125
14126    /// VipsRemainder (remainder), remainder after integer division of two images
14127    /// returns `VipsImage` - Output image
14128    ///
14129    /// right: `&VipsImage` -> Right-hand image argument
14130    pub fn remainder(&self, right: &VipsImage) -> Result<VipsImage> {
14131        let mut out_out = VipsImage::from(null_mut());
14132        let vips_op_response = call(
14133            "remainder",
14134            VOption::new()
14135                .set(
14136                    "left",
14137                    self,
14138                )
14139                .set(
14140                    "right",
14141                    right,
14142                )
14143                .set(
14144                    "out",
14145                    &mut out_out,
14146                ),
14147        );
14148
14149        utils::result(
14150            vips_op_response,
14151            out_out,
14152            Error::OperationError("Remainder (vips_remainder) failed".to_string()),
14153        )
14154    }
14155
14156    /// VipsRemainderConst (remainder_const), remainder after integer division of an image and a constant
14157    /// returns `VipsImage` - Output image
14158    ///
14159    /// c: `&[f64]` -> Array of constants
14160    pub fn remainder_const(&self, c: &[f64]) -> Result<VipsImage> {
14161        let mut out_out = VipsImage::from(null_mut());
14162        let vips_op_response = call(
14163            "remainder_const",
14164            VOption::new()
14165                .set("in", self)
14166                .set(
14167                    "out",
14168                    &mut out_out,
14169                )
14170                .set("c", c),
14171        );
14172
14173        utils::result(
14174            vips_op_response,
14175            out_out,
14176            Error::OperationError("RemainderConst (vips_remainder_const) failed".to_string()),
14177        )
14178    }
14179
14180    /// VipsRemosaic (remosaic), rebuild an mosaiced image
14181    /// returns `VipsImage` - Output image
14182    ///
14183    /// old_str: `&str` -> Search for this string
14184    ///
14185    /// new_str: `&str` -> And swap for this string
14186    pub fn remosaic(&self, old_str: &str, new_str: &str) -> Result<VipsImage> {
14187        let mut out_out = VipsImage::from(null_mut());
14188        let vips_op_response = call(
14189            "remosaic",
14190            VOption::new()
14191                .set("in", self)
14192                .set(
14193                    "out",
14194                    &mut out_out,
14195                )
14196                .set(
14197                    "old-str",
14198                    old_str,
14199                )
14200                .set(
14201                    "new-str",
14202                    new_str,
14203                ),
14204        );
14205
14206        utils::result(
14207            vips_op_response,
14208            out_out,
14209            Error::OperationError("Remosaic (vips_remosaic) failed".to_string()),
14210        )
14211    }
14212
14213    /// VipsReplicate (replicate), replicate an image
14214    /// returns `VipsImage` - Output image
14215    ///
14216    /// across: `i32` -> Repeat this many times horizontally
14217    ///
14218    /// down: `i32` -> Repeat this many times vertically
14219    pub fn replicate(&self, across: i32, down: i32) -> Result<VipsImage> {
14220        let mut out_out = VipsImage::from(null_mut());
14221        let vips_op_response = call(
14222            "replicate",
14223            VOption::new()
14224                .set("in", self)
14225                .set(
14226                    "out",
14227                    &mut out_out,
14228                )
14229                .set(
14230                    "across",
14231                    across,
14232                )
14233                .set(
14234                    "down",
14235                    down,
14236                ),
14237        );
14238
14239        utils::result(
14240            vips_op_response,
14241            out_out,
14242            Error::OperationError("Replicate (vips_replicate) failed".to_string()),
14243        )
14244    }
14245
14246    /// VipsResize (resize), resize an image
14247    /// returns `VipsImage` - Output image
14248    ///
14249    /// scale: `f64` -> Scale image by this factor
14250    pub fn resize(&self, scale: f64) -> Result<VipsImage> {
14251        let mut out_out = VipsImage::from(null_mut());
14252        let vips_op_response = call(
14253            "resize",
14254            VOption::new()
14255                .set("in", self)
14256                .set(
14257                    "out",
14258                    &mut out_out,
14259                )
14260                .set(
14261                    "scale",
14262                    scale,
14263                ),
14264        );
14265
14266        utils::result(
14267            vips_op_response,
14268            out_out,
14269            Error::OperationError("Resize (vips_resize) failed".to_string()),
14270        )
14271    }
14272
14273    /// VipsResize (resize), resize an image
14274    /// returns `VipsImage` - Output image
14275    ///
14276    /// scale: `f64` -> Scale image by this factor
14277    ///
14278    /// <ins>Optional arguments</ins>
14279    ///
14280    /// kernel: [`Kernel`] -> Resampling kernel
14281    ///
14282    /// gap: `f64` -> Reducing gap
14283    ///
14284    /// vscale: `f64` -> Vertical scale image by this factor
14285    pub fn resize_with_opts(&self, scale: f64, option: VOption) -> Result<VipsImage> {
14286        let mut out_out = VipsImage::from(null_mut());
14287        let vips_op_response = call(
14288            "resize",
14289            option
14290                .set("in", self)
14291                .set(
14292                    "out",
14293                    &mut out_out,
14294                )
14295                .set(
14296                    "scale",
14297                    scale,
14298                ),
14299        );
14300
14301        utils::result(
14302            vips_op_response,
14303            out_out,
14304            Error::OperationError("Resize (vips_resize) failed".to_string()),
14305        )
14306    }
14307
14308    /// VipsRot45 (rot45), rotate an image
14309    /// returns `VipsImage` - Output image
14310    pub fn rot45(&self) -> Result<VipsImage> {
14311        let mut out_out = VipsImage::from(null_mut());
14312        let vips_op_response = call(
14313            "rot45",
14314            VOption::new()
14315                .set("in", self)
14316                .set(
14317                    "out",
14318                    &mut out_out,
14319                ),
14320        );
14321
14322        utils::result(
14323            vips_op_response,
14324            out_out,
14325            Error::OperationError("Rot45 (vips_rot45) failed".to_string()),
14326        )
14327    }
14328
14329    /// VipsRot45 (rot45), rotate an image
14330    /// returns `VipsImage` - Output image
14331    ///
14332    /// <ins>Optional arguments</ins>
14333    ///
14334    /// angle: [`Angle45`] -> Angle to rotate image
14335    pub fn rot45_with_opts(&self, option: VOption) -> Result<VipsImage> {
14336        let mut out_out = VipsImage::from(null_mut());
14337        let vips_op_response = call(
14338            "rot45",
14339            option
14340                .set("in", self)
14341                .set(
14342                    "out",
14343                    &mut out_out,
14344                ),
14345        );
14346
14347        utils::result(
14348            vips_op_response,
14349            out_out,
14350            Error::OperationError("Rot45 (vips_rot45) failed".to_string()),
14351        )
14352    }
14353
14354    /// VipsRot (rot), rotate an image
14355    /// returns `VipsImage` - Output image
14356    ///
14357    /// angle: `Angle` -> Angle to rotate image
14358    pub fn rot(&self, angle: Angle) -> Result<VipsImage> {
14359        let mut out_out = VipsImage::from(null_mut());
14360        let vips_op_response = call(
14361            "rot",
14362            VOption::new()
14363                .set("in", self)
14364                .set(
14365                    "out",
14366                    &mut out_out,
14367                )
14368                .set(
14369                    "angle",
14370                    angle as i32,
14371                ),
14372        );
14373
14374        utils::result(
14375            vips_op_response,
14376            out_out,
14377            Error::OperationError("Rot (vips_rot) failed".to_string()),
14378        )
14379    }
14380
14381    /// VipsRotate (rotate), rotate an image by a number of degrees
14382    /// returns `VipsImage` - Output image
14383    ///
14384    /// angle: `f64` -> Rotate clockwise by this many degrees
14385    pub fn rotate(&self, angle: f64) -> Result<VipsImage> {
14386        let mut out_out = VipsImage::from(null_mut());
14387        let vips_op_response = call(
14388            "rotate",
14389            VOption::new()
14390                .set("in", self)
14391                .set(
14392                    "out",
14393                    &mut out_out,
14394                )
14395                .set(
14396                    "angle",
14397                    angle,
14398                ),
14399        );
14400
14401        utils::result(
14402            vips_op_response,
14403            out_out,
14404            Error::OperationError("Rotate (vips_rotate) failed".to_string()),
14405        )
14406    }
14407
14408    /// VipsRotate (rotate), rotate an image by a number of degrees
14409    /// returns `VipsImage` - Output image
14410    ///
14411    /// angle: `f64` -> Rotate clockwise by this many degrees
14412    ///
14413    /// <ins>Optional arguments</ins>
14414    ///
14415    /// interpolate: `&VipsInterpolate` -> Interpolate pixels with this
14416    ///
14417    /// background: `&[f64]` -> Background value
14418    ///
14419    /// odx: `f64` -> Horizontal output displacement
14420    ///
14421    /// ody: `f64` -> Vertical output displacement
14422    ///
14423    /// idx: `f64` -> Horizontal input displacement
14424    ///
14425    /// idy: `f64` -> Vertical input displacement
14426    pub fn rotate_with_opts(&self, angle: f64, option: VOption) -> Result<VipsImage> {
14427        let mut out_out = VipsImage::from(null_mut());
14428        let vips_op_response = call(
14429            "rotate",
14430            option
14431                .set("in", self)
14432                .set(
14433                    "out",
14434                    &mut out_out,
14435                )
14436                .set(
14437                    "angle",
14438                    angle,
14439                ),
14440        );
14441
14442        utils::result(
14443            vips_op_response,
14444            out_out,
14445            Error::OperationError("Rotate (vips_rotate) failed".to_string()),
14446        )
14447    }
14448
14449    /// VipsRound (round), perform a round function on an image
14450    /// returns `VipsImage` - Output image
14451    ///
14452    /// round: `OperationRound` -> Rounding operation to perform
14453    pub fn round(&self, round: OperationRound) -> Result<VipsImage> {
14454        let mut out_out = VipsImage::from(null_mut());
14455        let vips_op_response = call(
14456            "round",
14457            VOption::new()
14458                .set("in", self)
14459                .set(
14460                    "out",
14461                    &mut out_out,
14462                )
14463                .set(
14464                    "round",
14465                    round as i32,
14466                ),
14467        );
14468
14469        utils::result(
14470            vips_op_response,
14471            out_out,
14472            Error::OperationError("Round (vips_round) failed".to_string()),
14473        )
14474    }
14475
14476    /// VipssRGB2HSV (sRGB2HSV), transform sRGB to HSV
14477    /// returns `VipsImage` - Output image
14478    pub fn sRGB2HSV(&self) -> Result<VipsImage> {
14479        let mut out_out = VipsImage::from(null_mut());
14480        let vips_op_response = call(
14481            "sRGB2HSV",
14482            VOption::new()
14483                .set("in", self)
14484                .set(
14485                    "out",
14486                    &mut out_out,
14487                ),
14488        );
14489
14490        utils::result(
14491            vips_op_response,
14492            out_out,
14493            Error::OperationError("SRgb2Hsv (vips_sRGB2HSV) failed".to_string()),
14494        )
14495    }
14496
14497    /// VipssRGB2scRGB (sRGB2scRGB), convert an sRGB image to scRGB
14498    /// returns `VipsImage` - Output image
14499    pub fn sRGB2scRGB(&self) -> Result<VipsImage> {
14500        let mut out_out = VipsImage::from(null_mut());
14501        let vips_op_response = call(
14502            "sRGB2scRGB",
14503            VOption::new()
14504                .set("in", self)
14505                .set(
14506                    "out",
14507                    &mut out_out,
14508                ),
14509        );
14510
14511        utils::result(
14512            vips_op_response,
14513            out_out,
14514            Error::OperationError("SRgb2ScRgb (vips_sRGB2scRGB) failed".to_string()),
14515        )
14516    }
14517
14518    /// VipsscRGB2BW (scRGB2BW), convert scRGB to BW
14519    /// returns `VipsImage` - Output image
14520    pub fn scRGB2BW(&self) -> Result<VipsImage> {
14521        let mut out_out = VipsImage::from(null_mut());
14522        let vips_op_response = call(
14523            "scRGB2BW",
14524            VOption::new()
14525                .set("in", self)
14526                .set(
14527                    "out",
14528                    &mut out_out,
14529                ),
14530        );
14531
14532        utils::result(
14533            vips_op_response,
14534            out_out,
14535            Error::OperationError("ScRgb2Bw (vips_scRGB2BW) failed".to_string()),
14536        )
14537    }
14538
14539    /// VipsscRGB2BW (scRGB2BW), convert scRGB to BW
14540    /// returns `VipsImage` - Output image
14541    ///
14542    /// <ins>Optional arguments</ins>
14543    ///
14544    /// depth: `i32` -> Output device space depth in bits
14545    pub fn scRGB2BW_with_opts(&self, option: VOption) -> Result<VipsImage> {
14546        let mut out_out = VipsImage::from(null_mut());
14547        let vips_op_response = call(
14548            "scRGB2BW",
14549            option
14550                .set("in", self)
14551                .set(
14552                    "out",
14553                    &mut out_out,
14554                ),
14555        );
14556
14557        utils::result(
14558            vips_op_response,
14559            out_out,
14560            Error::OperationError("ScRgb2Bw (vips_scRGB2BW) failed".to_string()),
14561        )
14562    }
14563
14564    /// VipsscRGB2XYZ (scRGB2XYZ), transform scRGB to XYZ
14565    /// returns `VipsImage` - Output image
14566    pub fn scRGB2XYZ(&self) -> Result<VipsImage> {
14567        let mut out_out = VipsImage::from(null_mut());
14568        let vips_op_response = call(
14569            "scRGB2XYZ",
14570            VOption::new()
14571                .set("in", self)
14572                .set(
14573                    "out",
14574                    &mut out_out,
14575                ),
14576        );
14577
14578        utils::result(
14579            vips_op_response,
14580            out_out,
14581            Error::OperationError("ScRgb2Xyz (vips_scRGB2XYZ) failed".to_string()),
14582        )
14583    }
14584
14585    /// VipsscRGB2sRGB (scRGB2sRGB), convert scRGB to sRGB
14586    /// returns `VipsImage` - Output image
14587    pub fn scRGB2sRGB(&self) -> Result<VipsImage> {
14588        let mut out_out = VipsImage::from(null_mut());
14589        let vips_op_response = call(
14590            "scRGB2sRGB",
14591            VOption::new()
14592                .set("in", self)
14593                .set(
14594                    "out",
14595                    &mut out_out,
14596                ),
14597        );
14598
14599        utils::result(
14600            vips_op_response,
14601            out_out,
14602            Error::OperationError("ScRgb2SRgb (vips_scRGB2sRGB) failed".to_string()),
14603        )
14604    }
14605
14606    /// VipsscRGB2sRGB (scRGB2sRGB), convert scRGB to sRGB
14607    /// returns `VipsImage` - Output image
14608    ///
14609    /// <ins>Optional arguments</ins>
14610    ///
14611    /// depth: `i32` -> Output device space depth in bits
14612    pub fn scRGB2sRGB_with_opts(&self, option: VOption) -> Result<VipsImage> {
14613        let mut out_out = VipsImage::from(null_mut());
14614        let vips_op_response = call(
14615            "scRGB2sRGB",
14616            option
14617                .set("in", self)
14618                .set(
14619                    "out",
14620                    &mut out_out,
14621                ),
14622        );
14623
14624        utils::result(
14625            vips_op_response,
14626            out_out,
14627            Error::OperationError("ScRgb2SRgb (vips_scRGB2sRGB) failed".to_string()),
14628        )
14629    }
14630
14631    /// VipsScale (scale), scale an image to uchar
14632    /// returns `VipsImage` - Output image
14633    pub fn scale(&self) -> Result<VipsImage> {
14634        let mut out_out = VipsImage::from(null_mut());
14635        let vips_op_response = call(
14636            "scale",
14637            VOption::new()
14638                .set("in", self)
14639                .set(
14640                    "out",
14641                    &mut out_out,
14642                ),
14643        );
14644
14645        utils::result(
14646            vips_op_response,
14647            out_out,
14648            Error::OperationError("Scale (vips_scale) failed".to_string()),
14649        )
14650    }
14651
14652    /// VipsScale (scale), scale an image to uchar
14653    /// returns `VipsImage` - Output image
14654    ///
14655    /// <ins>Optional arguments</ins>
14656    ///
14657    /// exp: `f64` -> Exponent for log scale
14658    ///
14659    /// log: `bool` -> Log scale
14660    pub fn scale_with_opts(&self, option: VOption) -> Result<VipsImage> {
14661        let mut out_out = VipsImage::from(null_mut());
14662        let vips_op_response = call(
14663            "scale",
14664            option
14665                .set("in", self)
14666                .set(
14667                    "out",
14668                    &mut out_out,
14669                ),
14670        );
14671
14672        utils::result(
14673            vips_op_response,
14674            out_out,
14675            Error::OperationError("Scale (vips_scale) failed".to_string()),
14676        )
14677    }
14678
14679    /// VipsScharr (scharr), Scharr edge detector
14680    /// returns `VipsImage` - Output image
14681    pub fn scharr(&self) -> Result<VipsImage> {
14682        let mut out_out = VipsImage::from(null_mut());
14683        let vips_op_response = call(
14684            "scharr",
14685            VOption::new()
14686                .set("in", self)
14687                .set(
14688                    "out",
14689                    &mut out_out,
14690                ),
14691        );
14692
14693        utils::result(
14694            vips_op_response,
14695            out_out,
14696            Error::OperationError("Scharr (vips_scharr) failed".to_string()),
14697        )
14698    }
14699
14700    /// VipsSdf (sdf), create an SDF image
14701    /// returns `VipsImage` - Output image
14702    ///
14703    /// width: `i32` -> Image width in pixels
14704    ///
14705    /// height: `i32` -> Image height in pixels
14706    ///
14707    /// shape: `SdfShape` -> SDF shape to create
14708    pub fn sdf(width: i32, height: i32, shape: SdfShape) -> Result<VipsImage> {
14709        let mut out_out = VipsImage::from(null_mut());
14710        let vips_op_response = call(
14711            "sdf",
14712            VOption::new()
14713                .set(
14714                    "out",
14715                    &mut out_out,
14716                )
14717                .set(
14718                    "width",
14719                    width,
14720                )
14721                .set(
14722                    "height",
14723                    height,
14724                )
14725                .set(
14726                    "shape",
14727                    shape as i32,
14728                ),
14729        );
14730
14731        utils::result(
14732            vips_op_response,
14733            out_out,
14734            Error::OperationError("Sdf (vips_sdf) failed".to_string()),
14735        )
14736    }
14737
14738    /// VipsSdf (sdf), create an SDF image
14739    /// returns `VipsImage` - Output image
14740    ///
14741    /// width: `i32` -> Image width in pixels
14742    ///
14743    /// height: `i32` -> Image height in pixels
14744    ///
14745    /// shape: `SdfShape` -> SDF shape to create
14746    ///
14747    /// <ins>Optional arguments</ins>
14748    ///
14749    /// r: `f64` -> Radius
14750    ///
14751    /// a: `&[f64]` -> Point a
14752    ///
14753    /// b: `&[f64]` -> Point b
14754    ///
14755    /// corners: `&[f64]` -> Corner radii
14756    pub fn sdf_with_opts(
14757        width: i32,
14758        height: i32,
14759        shape: SdfShape,
14760        option: VOption,
14761    ) -> Result<VipsImage> {
14762        let mut out_out = VipsImage::from(null_mut());
14763        let vips_op_response = call(
14764            "sdf",
14765            option
14766                .set(
14767                    "out",
14768                    &mut out_out,
14769                )
14770                .set(
14771                    "width",
14772                    width,
14773                )
14774                .set(
14775                    "height",
14776                    height,
14777                )
14778                .set(
14779                    "shape",
14780                    shape as i32,
14781                ),
14782        );
14783
14784        utils::result(
14785            vips_op_response,
14786            out_out,
14787            Error::OperationError("Sdf (vips_sdf) failed".to_string()),
14788        )
14789    }
14790
14791    /// VipsSequential (sequential), check sequential access
14792    /// returns `VipsImage` - Output image
14793    pub fn sequential(&self) -> Result<VipsImage> {
14794        let mut out_out = VipsImage::from(null_mut());
14795        let vips_op_response = call(
14796            "sequential",
14797            VOption::new()
14798                .set("in", self)
14799                .set(
14800                    "out",
14801                    &mut out_out,
14802                ),
14803        );
14804
14805        utils::result(
14806            vips_op_response,
14807            out_out,
14808            Error::OperationError("Sequential (vips_sequential) failed".to_string()),
14809        )
14810    }
14811
14812    /// VipsSequential (sequential), check sequential access
14813    /// returns `VipsImage` - Output image
14814    ///
14815    /// <ins>Optional arguments</ins>
14816    ///
14817    /// tile_height: `i32` -> Tile height in pixels
14818    pub fn sequential_with_opts(&self, option: VOption) -> Result<VipsImage> {
14819        let mut out_out = VipsImage::from(null_mut());
14820        let vips_op_response = call(
14821            "sequential",
14822            option
14823                .set("in", self)
14824                .set(
14825                    "out",
14826                    &mut out_out,
14827                ),
14828        );
14829
14830        utils::result(
14831            vips_op_response,
14832            out_out,
14833            Error::OperationError("Sequential (vips_sequential) failed".to_string()),
14834        )
14835    }
14836
14837    /// VipsSharpen (sharpen), unsharp masking for print
14838    /// returns `VipsImage` - Output image
14839    pub fn sharpen(&self) -> Result<VipsImage> {
14840        let mut out_out = VipsImage::from(null_mut());
14841        let vips_op_response = call(
14842            "sharpen",
14843            VOption::new()
14844                .set("in", self)
14845                .set(
14846                    "out",
14847                    &mut out_out,
14848                ),
14849        );
14850
14851        utils::result(
14852            vips_op_response,
14853            out_out,
14854            Error::OperationError("Sharpen (vips_sharpen) failed".to_string()),
14855        )
14856    }
14857
14858    /// VipsSharpen (sharpen), unsharp masking for print
14859    /// returns `VipsImage` - Output image
14860    ///
14861    /// <ins>Optional arguments</ins>
14862    ///
14863    /// sigma: `f64` -> Sigma of Gaussian
14864    ///
14865    /// x1: `f64` -> Flat/jaggy threshold
14866    ///
14867    /// y2: `f64` -> Maximum brightening
14868    ///
14869    /// y3: `f64` -> Maximum darkening
14870    ///
14871    /// m1: `f64` -> Slope for flat areas
14872    ///
14873    /// m2: `f64` -> Slope for jaggy areas
14874    pub fn sharpen_with_opts(&self, option: VOption) -> Result<VipsImage> {
14875        let mut out_out = VipsImage::from(null_mut());
14876        let vips_op_response = call(
14877            "sharpen",
14878            option
14879                .set("in", self)
14880                .set(
14881                    "out",
14882                    &mut out_out,
14883                ),
14884        );
14885
14886        utils::result(
14887            vips_op_response,
14888            out_out,
14889            Error::OperationError("Sharpen (vips_sharpen) failed".to_string()),
14890        )
14891    }
14892
14893    /// VipsShrink (shrink), shrink an image
14894    /// returns `VipsImage` - Output image
14895    ///
14896    /// hshrink: `f64` -> Horizontal shrink factor
14897    ///
14898    /// vshrink: `f64` -> Vertical shrink factor
14899    pub fn shrink(&self, hshrink: f64, vshrink: f64) -> Result<VipsImage> {
14900        let mut out_out = VipsImage::from(null_mut());
14901        let vips_op_response = call(
14902            "shrink",
14903            VOption::new()
14904                .set("in", self)
14905                .set(
14906                    "out",
14907                    &mut out_out,
14908                )
14909                .set(
14910                    "hshrink",
14911                    hshrink,
14912                )
14913                .set(
14914                    "vshrink",
14915                    vshrink,
14916                ),
14917        );
14918
14919        utils::result(
14920            vips_op_response,
14921            out_out,
14922            Error::OperationError("Shrink (vips_shrink) failed".to_string()),
14923        )
14924    }
14925
14926    /// VipsShrink (shrink), shrink an image
14927    /// returns `VipsImage` - Output image
14928    ///
14929    /// hshrink: `f64` -> Horizontal shrink factor
14930    ///
14931    /// vshrink: `f64` -> Vertical shrink factor
14932    ///
14933    /// <ins>Optional arguments</ins>
14934    ///
14935    /// ceil: `bool` -> Round-up output dimensions
14936    pub fn shrink_with_opts(
14937        &self,
14938        hshrink: f64,
14939        vshrink: f64,
14940        option: VOption,
14941    ) -> Result<VipsImage> {
14942        let mut out_out = VipsImage::from(null_mut());
14943        let vips_op_response = call(
14944            "shrink",
14945            option
14946                .set("in", self)
14947                .set(
14948                    "out",
14949                    &mut out_out,
14950                )
14951                .set(
14952                    "hshrink",
14953                    hshrink,
14954                )
14955                .set(
14956                    "vshrink",
14957                    vshrink,
14958                ),
14959        );
14960
14961        utils::result(
14962            vips_op_response,
14963            out_out,
14964            Error::OperationError("Shrink (vips_shrink) failed".to_string()),
14965        )
14966    }
14967
14968    /// VipsShrinkh (shrinkh), shrink an image horizontally
14969    /// returns `VipsImage` - Output image
14970    ///
14971    /// hshrink: `i32` -> Horizontal shrink factor
14972    pub fn shrinkh(&self, hshrink: i32) -> Result<VipsImage> {
14973        let mut out_out = VipsImage::from(null_mut());
14974        let vips_op_response = call(
14975            "shrinkh",
14976            VOption::new()
14977                .set("in", self)
14978                .set(
14979                    "out",
14980                    &mut out_out,
14981                )
14982                .set(
14983                    "hshrink",
14984                    hshrink,
14985                ),
14986        );
14987
14988        utils::result(
14989            vips_op_response,
14990            out_out,
14991            Error::OperationError("Shrinkh (vips_shrinkh) failed".to_string()),
14992        )
14993    }
14994
14995    /// VipsShrinkh (shrinkh), shrink an image horizontally
14996    /// returns `VipsImage` - Output image
14997    ///
14998    /// hshrink: `i32` -> Horizontal shrink factor
14999    ///
15000    /// <ins>Optional arguments</ins>
15001    ///
15002    /// ceil: `bool` -> Round-up output dimensions
15003    pub fn shrinkh_with_opts(&self, hshrink: i32, option: VOption) -> Result<VipsImage> {
15004        let mut out_out = VipsImage::from(null_mut());
15005        let vips_op_response = call(
15006            "shrinkh",
15007            option
15008                .set("in", self)
15009                .set(
15010                    "out",
15011                    &mut out_out,
15012                )
15013                .set(
15014                    "hshrink",
15015                    hshrink,
15016                ),
15017        );
15018
15019        utils::result(
15020            vips_op_response,
15021            out_out,
15022            Error::OperationError("Shrinkh (vips_shrinkh) failed".to_string()),
15023        )
15024    }
15025
15026    /// VipsShrinkv (shrinkv), shrink an image vertically
15027    /// returns `VipsImage` - Output image
15028    ///
15029    /// vshrink: `i32` -> Vertical shrink factor
15030    pub fn shrinkv(&self, vshrink: i32) -> Result<VipsImage> {
15031        let mut out_out = VipsImage::from(null_mut());
15032        let vips_op_response = call(
15033            "shrinkv",
15034            VOption::new()
15035                .set("in", self)
15036                .set(
15037                    "out",
15038                    &mut out_out,
15039                )
15040                .set(
15041                    "vshrink",
15042                    vshrink,
15043                ),
15044        );
15045
15046        utils::result(
15047            vips_op_response,
15048            out_out,
15049            Error::OperationError("Shrinkv (vips_shrinkv) failed".to_string()),
15050        )
15051    }
15052
15053    /// VipsShrinkv (shrinkv), shrink an image vertically
15054    /// returns `VipsImage` - Output image
15055    ///
15056    /// vshrink: `i32` -> Vertical shrink factor
15057    ///
15058    /// <ins>Optional arguments</ins>
15059    ///
15060    /// ceil: `bool` -> Round-up output dimensions
15061    pub fn shrinkv_with_opts(&self, vshrink: i32, option: VOption) -> Result<VipsImage> {
15062        let mut out_out = VipsImage::from(null_mut());
15063        let vips_op_response = call(
15064            "shrinkv",
15065            option
15066                .set("in", self)
15067                .set(
15068                    "out",
15069                    &mut out_out,
15070                )
15071                .set(
15072                    "vshrink",
15073                    vshrink,
15074                ),
15075        );
15076
15077        utils::result(
15078            vips_op_response,
15079            out_out,
15080            Error::OperationError("Shrinkv (vips_shrinkv) failed".to_string()),
15081        )
15082    }
15083
15084    /// VipsSign (sign), unit vector of pixel
15085    /// returns `VipsImage` - Output image
15086    pub fn sign(&self) -> Result<VipsImage> {
15087        let mut out_out = VipsImage::from(null_mut());
15088        let vips_op_response = call(
15089            "sign",
15090            VOption::new()
15091                .set("in", self)
15092                .set(
15093                    "out",
15094                    &mut out_out,
15095                ),
15096        );
15097
15098        utils::result(
15099            vips_op_response,
15100            out_out,
15101            Error::OperationError("Sign (vips_sign) failed".to_string()),
15102        )
15103    }
15104
15105    /// VipsSimilarity (similarity), similarity transform of an image
15106    /// returns `VipsImage` - Output image
15107    pub fn similarity(&self) -> Result<VipsImage> {
15108        let mut out_out = VipsImage::from(null_mut());
15109        let vips_op_response = call(
15110            "similarity",
15111            VOption::new()
15112                .set("in", self)
15113                .set(
15114                    "out",
15115                    &mut out_out,
15116                ),
15117        );
15118
15119        utils::result(
15120            vips_op_response,
15121            out_out,
15122            Error::OperationError("Similarity (vips_similarity) failed".to_string()),
15123        )
15124    }
15125
15126    /// VipsSimilarity (similarity), similarity transform of an image
15127    /// returns `VipsImage` - Output image
15128    ///
15129    /// <ins>Optional arguments</ins>
15130    ///
15131    /// scale: `f64` -> Scale by this factor
15132    ///
15133    /// angle: `f64` -> Rotate clockwise by this many degrees
15134    ///
15135    /// interpolate: `&VipsInterpolate` -> Interpolate pixels with this
15136    ///
15137    /// background: `&[f64]` -> Background value
15138    ///
15139    /// odx: `f64` -> Horizontal output displacement
15140    ///
15141    /// ody: `f64` -> Vertical output displacement
15142    ///
15143    /// idx: `f64` -> Horizontal input displacement
15144    ///
15145    /// idy: `f64` -> Vertical input displacement
15146    pub fn similarity_with_opts(&self, option: VOption) -> Result<VipsImage> {
15147        let mut out_out = VipsImage::from(null_mut());
15148        let vips_op_response = call(
15149            "similarity",
15150            option
15151                .set("in", self)
15152                .set(
15153                    "out",
15154                    &mut out_out,
15155                ),
15156        );
15157
15158        utils::result(
15159            vips_op_response,
15160            out_out,
15161            Error::OperationError("Similarity (vips_similarity) failed".to_string()),
15162        )
15163    }
15164
15165    /// VipsSines (sines), make a 2D sine wave
15166    /// returns `VipsImage` - Output image
15167    ///
15168    /// width: `i32` -> Image width in pixels
15169    ///
15170    /// height: `i32` -> Image height in pixels
15171    pub fn sines(width: i32, height: i32) -> Result<VipsImage> {
15172        let mut out_out = VipsImage::from(null_mut());
15173        let vips_op_response = call(
15174            "sines",
15175            VOption::new()
15176                .set(
15177                    "out",
15178                    &mut out_out,
15179                )
15180                .set(
15181                    "width",
15182                    width,
15183                )
15184                .set(
15185                    "height",
15186                    height,
15187                ),
15188        );
15189
15190        utils::result(
15191            vips_op_response,
15192            out_out,
15193            Error::OperationError("Sines (vips_sines) failed".to_string()),
15194        )
15195    }
15196
15197    /// VipsSines (sines), make a 2D sine wave
15198    /// returns `VipsImage` - Output image
15199    ///
15200    /// width: `i32` -> Image width in pixels
15201    ///
15202    /// height: `i32` -> Image height in pixels
15203    ///
15204    /// <ins>Optional arguments</ins>
15205    ///
15206    /// uchar: `bool` -> Output an unsigned char image
15207    ///
15208    /// hfreq: `f64` -> Horizontal spatial frequency
15209    ///
15210    /// vfreq: `f64` -> Vertical spatial frequency
15211    pub fn sines_with_opts(width: i32, height: i32, option: VOption) -> Result<VipsImage> {
15212        let mut out_out = VipsImage::from(null_mut());
15213        let vips_op_response = call(
15214            "sines",
15215            option
15216                .set(
15217                    "out",
15218                    &mut out_out,
15219                )
15220                .set(
15221                    "width",
15222                    width,
15223                )
15224                .set(
15225                    "height",
15226                    height,
15227                ),
15228        );
15229
15230        utils::result(
15231            vips_op_response,
15232            out_out,
15233            Error::OperationError("Sines (vips_sines) failed".to_string()),
15234        )
15235    }
15236
15237    /// VipsSmartcrop (smartcrop), extract an area from an image
15238    /// returns `VipsImage` - Output image
15239    ///
15240    /// width: `i32` -> Width of extract area
15241    ///
15242    /// height: `i32` -> Height of extract area
15243    pub fn smartcrop(&self, width: i32, height: i32) -> Result<VipsImage> {
15244        let mut out_out = VipsImage::from(null_mut());
15245        let vips_op_response = call(
15246            "smartcrop",
15247            VOption::new()
15248                .set(
15249                    "input",
15250                    self,
15251                )
15252                .set(
15253                    "out",
15254                    &mut out_out,
15255                )
15256                .set(
15257                    "width",
15258                    width,
15259                )
15260                .set(
15261                    "height",
15262                    height,
15263                ),
15264        );
15265
15266        utils::result(
15267            vips_op_response,
15268            out_out,
15269            Error::OperationError("Smartcrop (vips_smartcrop) failed".to_string()),
15270        )
15271    }
15272
15273    /// VipsSmartcrop (smartcrop), extract an area from an image
15274    /// returns `VipsImage` - Output image
15275    ///
15276    /// width: `i32` -> Width of extract area
15277    ///
15278    /// height: `i32` -> Height of extract area
15279    ///
15280    /// <ins>Optional arguments</ins>
15281    ///
15282    /// attention_x: `&mut i32` -> Horizontal position of attention centre
15283    ///
15284    /// attention_y: `&mut i32` -> Vertical position of attention centre
15285    ///
15286    /// interesting: [`Interesting`] -> How to measure interestingness
15287    ///
15288    /// premultiplied: `bool` -> Input image already has premultiplied alpha
15289    pub fn smartcrop_with_opts(
15290        &self,
15291        width: i32,
15292        height: i32,
15293        option: VOption,
15294    ) -> Result<VipsImage> {
15295        let mut out_out = VipsImage::from(null_mut());
15296        let vips_op_response = call(
15297            "smartcrop",
15298            option
15299                .set(
15300                    "input",
15301                    self,
15302                )
15303                .set(
15304                    "out",
15305                    &mut out_out,
15306                )
15307                .set(
15308                    "width",
15309                    width,
15310                )
15311                .set(
15312                    "height",
15313                    height,
15314                ),
15315        );
15316
15317        utils::result(
15318            vips_op_response,
15319            out_out,
15320            Error::OperationError("Smartcrop (vips_smartcrop) failed".to_string()),
15321        )
15322    }
15323
15324    /// VipsSobel (sobel), Sobel edge detector
15325    /// returns `VipsImage` - Output image
15326    pub fn sobel(&self) -> Result<VipsImage> {
15327        let mut out_out = VipsImage::from(null_mut());
15328        let vips_op_response = call(
15329            "sobel",
15330            VOption::new()
15331                .set("in", self)
15332                .set(
15333                    "out",
15334                    &mut out_out,
15335                ),
15336        );
15337
15338        utils::result(
15339            vips_op_response,
15340            out_out,
15341            Error::OperationError("Sobel (vips_sobel) failed".to_string()),
15342        )
15343    }
15344
15345    /// VipsSpcor (spcor), spatial correlation
15346    /// returns `VipsImage` - Output image
15347    ///
15348    /// refp: `&VipsImage` -> Input reference image
15349    pub fn spcor(&self, refp: &VipsImage) -> Result<VipsImage> {
15350        let mut out_out = VipsImage::from(null_mut());
15351        let vips_op_response = call(
15352            "spcor",
15353            VOption::new()
15354                .set("in", self)
15355                .set(
15356                    "ref", refp,
15357                )
15358                .set(
15359                    "out",
15360                    &mut out_out,
15361                ),
15362        );
15363
15364        utils::result(
15365            vips_op_response,
15366            out_out,
15367            Error::OperationError("Spcor (vips_spcor) failed".to_string()),
15368        )
15369    }
15370
15371    /// VipsSpectrum (spectrum), make displayable power spectrum
15372    /// returns `VipsImage` - Output image
15373    pub fn spectrum(&self) -> Result<VipsImage> {
15374        let mut out_out = VipsImage::from(null_mut());
15375        let vips_op_response = call(
15376            "spectrum",
15377            VOption::new()
15378                .set("in", self)
15379                .set(
15380                    "out",
15381                    &mut out_out,
15382                ),
15383        );
15384
15385        utils::result(
15386            vips_op_response,
15387            out_out,
15388            Error::OperationError("Spectrum (vips_spectrum) failed".to_string()),
15389        )
15390    }
15391
15392    /// VipsStats (stats), find many image stats
15393    /// returns `VipsImage` - Output array of statistics
15394    pub fn stats(&self) -> Result<VipsImage> {
15395        let mut out_out = VipsImage::from(null_mut());
15396        let vips_op_response = call(
15397            "stats",
15398            VOption::new()
15399                .set("in", self)
15400                .set(
15401                    "out",
15402                    &mut out_out,
15403                ),
15404        );
15405
15406        utils::result(
15407            vips_op_response,
15408            out_out,
15409            Error::OperationError("Stats (vips_stats) failed".to_string()),
15410        )
15411    }
15412
15413    /// VipsStdif (stdif), statistical difference
15414    /// returns `VipsImage` - Output image
15415    ///
15416    /// width: `i32` -> Window width in pixels
15417    ///
15418    /// height: `i32` -> Window height in pixels
15419    pub fn stdif(&self, width: i32, height: i32) -> Result<VipsImage> {
15420        let mut out_out = VipsImage::from(null_mut());
15421        let vips_op_response = call(
15422            "stdif",
15423            VOption::new()
15424                .set("in", self)
15425                .set(
15426                    "out",
15427                    &mut out_out,
15428                )
15429                .set(
15430                    "width",
15431                    width,
15432                )
15433                .set(
15434                    "height",
15435                    height,
15436                ),
15437        );
15438
15439        utils::result(
15440            vips_op_response,
15441            out_out,
15442            Error::OperationError("Stdif (vips_stdif) failed".to_string()),
15443        )
15444    }
15445
15446    /// VipsStdif (stdif), statistical difference
15447    /// returns `VipsImage` - Output image
15448    ///
15449    /// width: `i32` -> Window width in pixels
15450    ///
15451    /// height: `i32` -> Window height in pixels
15452    ///
15453    /// <ins>Optional arguments</ins>
15454    ///
15455    /// s0: `f64` -> New deviation
15456    ///
15457    /// b: `f64` -> Weight of new deviation
15458    ///
15459    /// m0: `f64` -> New mean
15460    ///
15461    /// a: `f64` -> Weight of new mean
15462    pub fn stdif_with_opts(&self, width: i32, height: i32, option: VOption) -> Result<VipsImage> {
15463        let mut out_out = VipsImage::from(null_mut());
15464        let vips_op_response = call(
15465            "stdif",
15466            option
15467                .set("in", self)
15468                .set(
15469                    "out",
15470                    &mut out_out,
15471                )
15472                .set(
15473                    "width",
15474                    width,
15475                )
15476                .set(
15477                    "height",
15478                    height,
15479                ),
15480        );
15481
15482        utils::result(
15483            vips_op_response,
15484            out_out,
15485            Error::OperationError("Stdif (vips_stdif) failed".to_string()),
15486        )
15487    }
15488
15489    /// VipsSubsample (subsample), subsample an image
15490    /// returns `VipsImage` - Output image
15491    ///
15492    /// xfac: `i32` -> Horizontal subsample factor
15493    ///
15494    /// yfac: `i32` -> Vertical subsample factor
15495    pub fn subsample(&self, xfac: i32, yfac: i32) -> Result<VipsImage> {
15496        let mut out_out = VipsImage::from(null_mut());
15497        let vips_op_response = call(
15498            "subsample",
15499            VOption::new()
15500                .set(
15501                    "input",
15502                    self,
15503                )
15504                .set(
15505                    "out",
15506                    &mut out_out,
15507                )
15508                .set(
15509                    "xfac",
15510                    xfac,
15511                )
15512                .set(
15513                    "yfac",
15514                    yfac,
15515                ),
15516        );
15517
15518        utils::result(
15519            vips_op_response,
15520            out_out,
15521            Error::OperationError("Subsample (vips_subsample) failed".to_string()),
15522        )
15523    }
15524
15525    /// VipsSubsample (subsample), subsample an image
15526    /// returns `VipsImage` - Output image
15527    ///
15528    /// xfac: `i32` -> Horizontal subsample factor
15529    ///
15530    /// yfac: `i32` -> Vertical subsample factor
15531    ///
15532    /// <ins>Optional arguments</ins>
15533    ///
15534    /// point: `bool` -> Point sample
15535    pub fn subsample_with_opts(&self, xfac: i32, yfac: i32, option: VOption) -> Result<VipsImage> {
15536        let mut out_out = VipsImage::from(null_mut());
15537        let vips_op_response = call(
15538            "subsample",
15539            option
15540                .set(
15541                    "input",
15542                    self,
15543                )
15544                .set(
15545                    "out",
15546                    &mut out_out,
15547                )
15548                .set(
15549                    "xfac",
15550                    xfac,
15551                )
15552                .set(
15553                    "yfac",
15554                    yfac,
15555                ),
15556        );
15557
15558        utils::result(
15559            vips_op_response,
15560            out_out,
15561            Error::OperationError("Subsample (vips_subsample) failed".to_string()),
15562        )
15563    }
15564
15565    /// VipsSubtract (subtract), subtract two images
15566    /// returns `VipsImage` - Output image
15567    ///
15568    /// right: `&VipsImage` -> Right-hand image argument
15569    pub fn subtract(&self, right: &VipsImage) -> Result<VipsImage> {
15570        let mut out_out = VipsImage::from(null_mut());
15571        let vips_op_response = call(
15572            "subtract",
15573            VOption::new()
15574                .set(
15575                    "left",
15576                    self,
15577                )
15578                .set(
15579                    "right",
15580                    right,
15581                )
15582                .set(
15583                    "out",
15584                    &mut out_out,
15585                ),
15586        );
15587
15588        utils::result(
15589            vips_op_response,
15590            out_out,
15591            Error::OperationError("Subtract (vips_subtract) failed".to_string()),
15592        )
15593    }
15594
15595    /// VipsSum (sum), sum an array of images
15596    /// returns `VipsImage` - Output image
15597    ///
15598    /// inp: `&[VipsImage]` -> Array of input images
15599    pub fn sum(inp: &[VipsImage]) -> Result<VipsImage> {
15600        let mut out_out = VipsImage::from(null_mut());
15601        let vips_op_response = call(
15602            "sum",
15603            VOption::new()
15604                .set("in", inp)
15605                .set(
15606                    "out",
15607                    &mut out_out,
15608                ),
15609        );
15610
15611        utils::result(
15612            vips_op_response,
15613            out_out,
15614            Error::OperationError("Sum (vips_sum) failed".to_string()),
15615        )
15616    }
15617
15618    /// VipsForeignLoadSvgFile (svgload), load SVG with rsvg (.svg, .svgz, .svg.gz), priority=-5, untrusted, is_a, get_flags, get_flags_filename, header, load
15619    /// returns `VipsImage` - Output image
15620    ///
15621    /// filename: `&str` -> Filename to load from
15622    pub fn svgload(filename: &str) -> Result<VipsImage> {
15623        let mut out_out = VipsImage::from(null_mut());
15624        let vips_op_response = call(
15625            "svgload",
15626            VOption::new()
15627                .set(
15628                    "filename",
15629                    filename,
15630                )
15631                .set(
15632                    "out",
15633                    &mut out_out,
15634                ),
15635        );
15636
15637        utils::result(
15638            vips_op_response,
15639            out_out,
15640            Error::OperationError("Svgload (vips_svgload) failed".to_string()),
15641        )
15642    }
15643
15644    /// VipsForeignLoadSvgFile (svgload), load SVG with rsvg (.svg, .svgz, .svg.gz), priority=-5, untrusted, is_a, get_flags, get_flags_filename, header, load
15645    /// returns `VipsImage` - Output image
15646    ///
15647    /// filename: `&str` -> Filename to load from
15648    ///
15649    /// <ins>Optional arguments</ins>
15650    ///
15651    /// dpi: `f64` -> Render at this DPI
15652    ///
15653    /// scale: `f64` -> Scale output by this factor
15654    ///
15655    /// unlimited: `bool` -> Allow SVG of any size
15656    ///
15657    /// stylesheet: `&str` -> Custom CSS
15658    ///
15659    /// high_bitdepth: `bool` -> Enable scRGB 128-bit output (32-bit per channel)
15660    ///
15661    /// flags: [`ForeignFlags`] -> Flags for this file
15662    ///
15663    /// memory: `bool` -> Force open via memory
15664    ///
15665    /// access: [`Access`] -> Required access pattern for this file
15666    ///
15667    /// fail_on: [`FailOn`] -> Error level to fail on
15668    ///
15669    /// revalidate: `bool` -> Don't use a cached result for this operation
15670    pub fn svgload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
15671        let mut out_out = VipsImage::from(null_mut());
15672        let vips_op_response = call(
15673            "svgload",
15674            option
15675                .set(
15676                    "filename",
15677                    filename,
15678                )
15679                .set(
15680                    "out",
15681                    &mut out_out,
15682                ),
15683        );
15684
15685        utils::result(
15686            vips_op_response,
15687            out_out,
15688            Error::OperationError("Svgload (vips_svgload) failed".to_string()),
15689        )
15690    }
15691
15692    /// VipsForeignLoadSvgBuffer (svgload_buffer), load SVG with rsvg, priority=-5, untrusted, is_a_buffer, get_flags, get_flags_filename, header, load
15693    /// returns `VipsImage` - Output image
15694    ///
15695    /// buffer: `&[u8]` -> Buffer to load from
15696    pub fn svgload_buffer(buffer: &[u8]) -> Result<VipsImage> {
15697        let vips_blob = unsafe {
15698            vips_blob_new(
15699                None,
15700                buffer.as_ptr() as _,
15701                buffer.len() as _,
15702            )
15703        };
15704        let blob = VipsBlob::from(vips_blob);
15705        let mut out_out = VipsImage::from(null_mut());
15706        let vips_op_response = call(
15707            "svgload_buffer",
15708            VOption::new()
15709                .set(
15710                    "buffer",
15711                    &blob,
15712                )
15713                .set(
15714                    "out",
15715                    &mut out_out,
15716                ),
15717        );
15718        blob.area_unref();
15719        utils::result(
15720            vips_op_response,
15721            out_out,
15722            Error::OperationError("SvgloadBuffer (vips_svgload_buffer) failed".to_string()),
15723        )
15724    }
15725
15726    /// VipsForeignLoadSvgBuffer (svgload_buffer), load SVG with rsvg, priority=-5, untrusted, is_a_buffer, get_flags, get_flags_filename, header, load
15727    /// returns `VipsImage` - Output image
15728    ///
15729    /// buffer: `&[u8]` -> Buffer to load from
15730    ///
15731    /// <ins>Optional arguments</ins>
15732    ///
15733    /// dpi: `f64` -> Render at this DPI
15734    ///
15735    /// scale: `f64` -> Scale output by this factor
15736    ///
15737    /// unlimited: `bool` -> Allow SVG of any size
15738    ///
15739    /// stylesheet: `&str` -> Custom CSS
15740    ///
15741    /// high_bitdepth: `bool` -> Enable scRGB 128-bit output (32-bit per channel)
15742    ///
15743    /// flags: [`ForeignFlags`] -> Flags for this file
15744    ///
15745    /// memory: `bool` -> Force open via memory
15746    ///
15747    /// access: [`Access`] -> Required access pattern for this file
15748    ///
15749    /// fail_on: [`FailOn`] -> Error level to fail on
15750    ///
15751    /// revalidate: `bool` -> Don't use a cached result for this operation
15752    pub fn svgload_buffer_with_opts(buffer: &[u8], option: VOption) -> Result<VipsImage> {
15753        let vips_blob = unsafe {
15754            vips_blob_new(
15755                None,
15756                buffer.as_ptr() as _,
15757                buffer.len() as _,
15758            )
15759        };
15760        let blob = VipsBlob::from(vips_blob);
15761        let mut out_out = VipsImage::from(null_mut());
15762        let vips_op_response = call(
15763            "svgload_buffer",
15764            option
15765                .set(
15766                    "buffer",
15767                    &blob,
15768                )
15769                .set(
15770                    "out",
15771                    &mut out_out,
15772                ),
15773        );
15774        blob.area_unref();
15775        utils::result(
15776            vips_op_response,
15777            out_out,
15778            Error::OperationError("SvgloadBuffer (vips_svgload_buffer) failed".to_string()),
15779        )
15780    }
15781
15782    /// VipsForeignLoadSvgSource (svgload_source), load svg from source, priority=-5, untrusted, is_a_source, get_flags, get_flags_filename, header, load
15783    /// returns `VipsImage` - Output image
15784    ///
15785    /// source: `&VipsSource` -> Source to load from
15786    pub fn svgload_source(source: &VipsSource) -> Result<VipsImage> {
15787        let mut out_out = VipsImage::from(null_mut());
15788        let vips_op_response = call(
15789            "svgload_source",
15790            VOption::new()
15791                .set(
15792                    "source",
15793                    source,
15794                )
15795                .set(
15796                    "out",
15797                    &mut out_out,
15798                ),
15799        );
15800
15801        utils::result(
15802            vips_op_response,
15803            out_out,
15804            Error::OperationError("SvgloadSource (vips_svgload_source) failed".to_string()),
15805        )
15806    }
15807
15808    /// VipsForeignLoadSvgSource (svgload_source), load svg from source, priority=-5, untrusted, is_a_source, get_flags, get_flags_filename, header, load
15809    /// returns `VipsImage` - Output image
15810    ///
15811    /// source: `&VipsSource` -> Source to load from
15812    ///
15813    /// <ins>Optional arguments</ins>
15814    ///
15815    /// dpi: `f64` -> Render at this DPI
15816    ///
15817    /// scale: `f64` -> Scale output by this factor
15818    ///
15819    /// unlimited: `bool` -> Allow SVG of any size
15820    ///
15821    /// stylesheet: `&str` -> Custom CSS
15822    ///
15823    /// high_bitdepth: `bool` -> Enable scRGB 128-bit output (32-bit per channel)
15824    ///
15825    /// flags: [`ForeignFlags`] -> Flags for this file
15826    ///
15827    /// memory: `bool` -> Force open via memory
15828    ///
15829    /// access: [`Access`] -> Required access pattern for this file
15830    ///
15831    /// fail_on: [`FailOn`] -> Error level to fail on
15832    ///
15833    /// revalidate: `bool` -> Don't use a cached result for this operation
15834    pub fn svgload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
15835        let mut out_out = VipsImage::from(null_mut());
15836        let vips_op_response = call(
15837            "svgload_source",
15838            option
15839                .set(
15840                    "source",
15841                    source,
15842                )
15843                .set(
15844                    "out",
15845                    &mut out_out,
15846                ),
15847        );
15848
15849        utils::result(
15850            vips_op_response,
15851            out_out,
15852            Error::OperationError("SvgloadSource (vips_svgload_source) failed".to_string()),
15853        )
15854    }
15855
15856    /// VipsSwitch (switch), find the index of the first non-zero pixel in tests
15857    /// returns `VipsImage` - Output image
15858    ///
15859    /// tests: `&[VipsImage]` -> Table of images to test
15860    pub fn switch(tests: &[VipsImage]) -> Result<VipsImage> {
15861        let mut out_out = VipsImage::from(null_mut());
15862        let vips_op_response = call(
15863            "switch",
15864            VOption::new()
15865                .set(
15866                    "tests",
15867                    tests,
15868                )
15869                .set(
15870                    "out",
15871                    &mut out_out,
15872                ),
15873        );
15874
15875        utils::result(
15876            vips_op_response,
15877            out_out,
15878            Error::OperationError("Switch (vips_switch) failed".to_string()),
15879        )
15880    }
15881
15882    /// VipsSystem (system), run an external command
15883    ///
15884    /// cmd_format: `&str` -> Command to run
15885    pub fn system(cmd_format: &str) -> Result<()> {
15886        let vips_op_response = call(
15887            "system",
15888            VOption::new().set(
15889                "cmd-format",
15890                cmd_format,
15891            ),
15892        );
15893
15894        utils::result(
15895            vips_op_response,
15896            (),
15897            Error::OperationError("System (vips_system) failed".to_string()),
15898        )
15899    }
15900
15901    /// VipsSystem (system), run an external command
15902    ///
15903    /// cmd_format: `&str` -> Command to run
15904    ///
15905    /// <ins>Optional arguments</ins>
15906    ///
15907    /// inp: `&[VipsImage]` -> Array of input images
15908    ///
15909    /// out: `&mut VipsImage` -> Output image
15910    ///
15911    /// log: `&str` -> Command log
15912    ///
15913    /// out_format: `&str` -> Format for output filename
15914    ///
15915    /// in_format: `&str` -> Format for input filename
15916    pub fn system_with_opts(cmd_format: &str, option: VOption) -> Result<()> {
15917        let vips_op_response = call(
15918            "system",
15919            option.set(
15920                "cmd-format",
15921                cmd_format,
15922            ),
15923        );
15924
15925        utils::result(
15926            vips_op_response,
15927            (),
15928            Error::OperationError("System (vips_system) failed".to_string()),
15929        )
15930    }
15931
15932    /// VipsText (text), make a text image
15933    /// returns `VipsImage` - Output image
15934    ///
15935    /// text: `&str` -> Text to render
15936    pub fn text(text: &str) -> Result<VipsImage> {
15937        let mut out_out = VipsImage::from(null_mut());
15938        let vips_op_response = call(
15939            "text",
15940            VOption::new()
15941                .set(
15942                    "out",
15943                    &mut out_out,
15944                )
15945                .set(
15946                    "text",
15947                    text,
15948                ),
15949        );
15950
15951        utils::result(
15952            vips_op_response,
15953            out_out,
15954            Error::OperationError("Text (vips_text) failed".to_string()),
15955        )
15956    }
15957
15958    /// VipsText (text), make a text image
15959    /// returns `VipsImage` - Output image
15960    ///
15961    /// text: `&str` -> Text to render
15962    ///
15963    /// <ins>Optional arguments</ins>
15964    ///
15965    /// font: `&str` -> Font to render with
15966    ///
15967    /// width: `i32` -> Maximum image width in pixels
15968    ///
15969    /// height: `i32` -> Maximum image height in pixels
15970    ///
15971    /// align: [`Align`] -> Align on the low, centre or high edge
15972    ///
15973    /// justify: `bool` -> Justify lines
15974    ///
15975    /// dpi: `i32` -> DPI to render at
15976    ///
15977    /// autofit_dpi: `&mut i32` -> DPI selected by autofit
15978    ///
15979    /// spacing: `i32` -> Line spacing
15980    ///
15981    /// fontfile: `&str` -> Load this font file
15982    ///
15983    /// rgba: `bool` -> Enable RGBA output
15984    ///
15985    /// wrap: [`TextWrap`] -> Wrap lines on word or character boundaries
15986    pub fn text_with_opts(text: &str, option: VOption) -> Result<VipsImage> {
15987        let mut out_out = VipsImage::from(null_mut());
15988        let vips_op_response = call(
15989            "text",
15990            option
15991                .set(
15992                    "out",
15993                    &mut out_out,
15994                )
15995                .set(
15996                    "text",
15997                    text,
15998                ),
15999        );
16000
16001        utils::result(
16002            vips_op_response,
16003            out_out,
16004            Error::OperationError("Text (vips_text) failed".to_string()),
16005        )
16006    }
16007
16008    /// VipsThumbnailFile (thumbnail), generate thumbnail from file
16009    /// returns `VipsImage` - Output image
16010    ///
16011    /// filename: `&str` -> Filename to read from
16012    ///
16013    /// width: `i32` -> Size to this width
16014    pub fn thumbnail(filename: &str, width: i32) -> Result<VipsImage> {
16015        let mut out_out = VipsImage::from(null_mut());
16016        let vips_op_response = call(
16017            "thumbnail",
16018            VOption::new()
16019                .set(
16020                    "filename",
16021                    filename,
16022                )
16023                .set(
16024                    "out",
16025                    &mut out_out,
16026                )
16027                .set(
16028                    "width",
16029                    width,
16030                ),
16031        );
16032
16033        utils::result(
16034            vips_op_response,
16035            out_out,
16036            Error::OperationError("Thumbnail (vips_thumbnail) failed".to_string()),
16037        )
16038    }
16039
16040    /// VipsThumbnailFile (thumbnail), generate thumbnail from file
16041    /// returns `VipsImage` - Output image
16042    ///
16043    /// filename: `&str` -> Filename to read from
16044    ///
16045    /// width: `i32` -> Size to this width
16046    ///
16047    /// <ins>Optional arguments</ins>
16048    ///
16049    /// height: `i32` -> Size to this height
16050    ///
16051    /// size: [`Size`] -> Only upsize, only downsize, or both
16052    ///
16053    /// no_rotate: `bool` -> Don't use orientation tags to rotate image upright
16054    ///
16055    /// crop: [`Interesting`] -> Reduce to fill target rectangle, then crop
16056    ///
16057    /// linear: `bool` -> Reduce in linear light
16058    ///
16059    /// input_profile: `&str` -> Fallback input profile
16060    ///
16061    /// output_profile: `&str` -> Fallback output profile
16062    ///
16063    /// intent: [`Intent`] -> Rendering intent
16064    ///
16065    /// fail_on: [`FailOn`] -> Error level to fail on
16066    pub fn thumbnail_with_opts(filename: &str, width: i32, option: VOption) -> Result<VipsImage> {
16067        let mut out_out = VipsImage::from(null_mut());
16068        let vips_op_response = call(
16069            "thumbnail",
16070            option
16071                .set(
16072                    "filename",
16073                    filename,
16074                )
16075                .set(
16076                    "out",
16077                    &mut out_out,
16078                )
16079                .set(
16080                    "width",
16081                    width,
16082                ),
16083        );
16084
16085        utils::result(
16086            vips_op_response,
16087            out_out,
16088            Error::OperationError("Thumbnail (vips_thumbnail) failed".to_string()),
16089        )
16090    }
16091
16092    /// VipsThumbnailBuffer (thumbnail_buffer), generate thumbnail from buffer
16093    /// returns `VipsImage` - Output image
16094    ///
16095    /// buffer: `&[u8]` -> Buffer to load from
16096    ///
16097    /// width: `i32` -> Size to this width
16098    pub fn thumbnail_buffer(buffer: &[u8], width: i32) -> Result<VipsImage> {
16099        let vips_blob = unsafe {
16100            vips_blob_new(
16101                None,
16102                buffer.as_ptr() as _,
16103                buffer.len() as _,
16104            )
16105        };
16106        let blob = VipsBlob::from(vips_blob);
16107        let mut out_out = VipsImage::from(null_mut());
16108        let vips_op_response = call(
16109            "thumbnail_buffer",
16110            VOption::new()
16111                .set(
16112                    "buffer",
16113                    &blob,
16114                )
16115                .set(
16116                    "out",
16117                    &mut out_out,
16118                )
16119                .set(
16120                    "width",
16121                    width,
16122                ),
16123        );
16124        blob.area_unref();
16125        utils::result(
16126            vips_op_response,
16127            out_out,
16128            Error::OperationError("ThumbnailBuffer (vips_thumbnail_buffer) failed".to_string()),
16129        )
16130    }
16131
16132    /// VipsThumbnailBuffer (thumbnail_buffer), generate thumbnail from buffer
16133    /// returns `VipsImage` - Output image
16134    ///
16135    /// buffer: `&[u8]` -> Buffer to load from
16136    ///
16137    /// width: `i32` -> Size to this width
16138    ///
16139    /// <ins>Optional arguments</ins>
16140    ///
16141    /// option_string: `&str` -> Options that are passed on to the underlying loader
16142    ///
16143    /// height: `i32` -> Size to this height
16144    ///
16145    /// size: [`Size`] -> Only upsize, only downsize, or both
16146    ///
16147    /// no_rotate: `bool` -> Don't use orientation tags to rotate image upright
16148    ///
16149    /// crop: [`Interesting`] -> Reduce to fill target rectangle, then crop
16150    ///
16151    /// linear: `bool` -> Reduce in linear light
16152    ///
16153    /// input_profile: `&str` -> Fallback input profile
16154    ///
16155    /// output_profile: `&str` -> Fallback output profile
16156    ///
16157    /// intent: [`Intent`] -> Rendering intent
16158    ///
16159    /// fail_on: [`FailOn`] -> Error level to fail on
16160    pub fn thumbnail_buffer_with_opts(
16161        buffer: &[u8],
16162        width: i32,
16163        option: VOption,
16164    ) -> Result<VipsImage> {
16165        let vips_blob = unsafe {
16166            vips_blob_new(
16167                None,
16168                buffer.as_ptr() as _,
16169                buffer.len() as _,
16170            )
16171        };
16172        let blob = VipsBlob::from(vips_blob);
16173        let mut out_out = VipsImage::from(null_mut());
16174        let vips_op_response = call(
16175            "thumbnail_buffer",
16176            option
16177                .set(
16178                    "buffer",
16179                    &blob,
16180                )
16181                .set(
16182                    "out",
16183                    &mut out_out,
16184                )
16185                .set(
16186                    "width",
16187                    width,
16188                ),
16189        );
16190        blob.area_unref();
16191        utils::result(
16192            vips_op_response,
16193            out_out,
16194            Error::OperationError("ThumbnailBuffer (vips_thumbnail_buffer) failed".to_string()),
16195        )
16196    }
16197
16198    /// VipsThumbnailImage (thumbnail_image), generate thumbnail from image
16199    /// returns `VipsImage` - Output image
16200    ///
16201    /// width: `i32` -> Size to this width
16202    pub fn thumbnail_image(&self, width: i32) -> Result<VipsImage> {
16203        let mut out_out = VipsImage::from(null_mut());
16204        let vips_op_response = call(
16205            "thumbnail_image",
16206            VOption::new()
16207                .set("in", self)
16208                .set(
16209                    "out",
16210                    &mut out_out,
16211                )
16212                .set(
16213                    "width",
16214                    width,
16215                ),
16216        );
16217
16218        utils::result(
16219            vips_op_response,
16220            out_out,
16221            Error::OperationError("ThumbnailImage (vips_thumbnail_image) failed".to_string()),
16222        )
16223    }
16224
16225    /// VipsThumbnailImage (thumbnail_image), generate thumbnail from image
16226    /// returns `VipsImage` - Output image
16227    ///
16228    /// width: `i32` -> Size to this width
16229    ///
16230    /// <ins>Optional arguments</ins>
16231    ///
16232    /// height: `i32` -> Size to this height
16233    ///
16234    /// size: [`Size`] -> Only upsize, only downsize, or both
16235    ///
16236    /// no_rotate: `bool` -> Don't use orientation tags to rotate image upright
16237    ///
16238    /// crop: [`Interesting`] -> Reduce to fill target rectangle, then crop
16239    ///
16240    /// linear: `bool` -> Reduce in linear light
16241    ///
16242    /// input_profile: `&str` -> Fallback input profile
16243    ///
16244    /// output_profile: `&str` -> Fallback output profile
16245    ///
16246    /// intent: [`Intent`] -> Rendering intent
16247    ///
16248    /// fail_on: [`FailOn`] -> Error level to fail on
16249    pub fn thumbnail_image_with_opts(&self, width: i32, option: VOption) -> Result<VipsImage> {
16250        let mut out_out = VipsImage::from(null_mut());
16251        let vips_op_response = call(
16252            "thumbnail_image",
16253            option
16254                .set("in", self)
16255                .set(
16256                    "out",
16257                    &mut out_out,
16258                )
16259                .set(
16260                    "width",
16261                    width,
16262                ),
16263        );
16264
16265        utils::result(
16266            vips_op_response,
16267            out_out,
16268            Error::OperationError("ThumbnailImage (vips_thumbnail_image) failed".to_string()),
16269        )
16270    }
16271
16272    /// VipsThumbnailSource (thumbnail_source), generate thumbnail from source
16273    /// returns `VipsImage` - Output image
16274    ///
16275    /// source: `&VipsSource` -> Source to load from
16276    ///
16277    /// width: `i32` -> Size to this width
16278    pub fn thumbnail_source(source: &VipsSource, width: i32) -> Result<VipsImage> {
16279        let mut out_out = VipsImage::from(null_mut());
16280        let vips_op_response = call(
16281            "thumbnail_source",
16282            VOption::new()
16283                .set(
16284                    "source",
16285                    source,
16286                )
16287                .set(
16288                    "out",
16289                    &mut out_out,
16290                )
16291                .set(
16292                    "width",
16293                    width,
16294                ),
16295        );
16296
16297        utils::result(
16298            vips_op_response,
16299            out_out,
16300            Error::OperationError("ThumbnailSource (vips_thumbnail_source) failed".to_string()),
16301        )
16302    }
16303
16304    /// VipsThumbnailSource (thumbnail_source), generate thumbnail from source
16305    /// returns `VipsImage` - Output image
16306    ///
16307    /// source: `&VipsSource` -> Source to load from
16308    ///
16309    /// width: `i32` -> Size to this width
16310    ///
16311    /// <ins>Optional arguments</ins>
16312    ///
16313    /// option_string: `&str` -> Options that are passed on to the underlying loader
16314    ///
16315    /// height: `i32` -> Size to this height
16316    ///
16317    /// size: [`Size`] -> Only upsize, only downsize, or both
16318    ///
16319    /// no_rotate: `bool` -> Don't use orientation tags to rotate image upright
16320    ///
16321    /// crop: [`Interesting`] -> Reduce to fill target rectangle, then crop
16322    ///
16323    /// linear: `bool` -> Reduce in linear light
16324    ///
16325    /// input_profile: `&str` -> Fallback input profile
16326    ///
16327    /// output_profile: `&str` -> Fallback output profile
16328    ///
16329    /// intent: [`Intent`] -> Rendering intent
16330    ///
16331    /// fail_on: [`FailOn`] -> Error level to fail on
16332    pub fn thumbnail_source_with_opts(
16333        source: &VipsSource,
16334        width: i32,
16335        option: VOption,
16336    ) -> Result<VipsImage> {
16337        let mut out_out = VipsImage::from(null_mut());
16338        let vips_op_response = call(
16339            "thumbnail_source",
16340            option
16341                .set(
16342                    "source",
16343                    source,
16344                )
16345                .set(
16346                    "out",
16347                    &mut out_out,
16348                )
16349                .set(
16350                    "width",
16351                    width,
16352                ),
16353        );
16354
16355        utils::result(
16356            vips_op_response,
16357            out_out,
16358            Error::OperationError("ThumbnailSource (vips_thumbnail_source) failed".to_string()),
16359        )
16360    }
16361
16362    /// VipsForeignLoadTiffFile (tiffload), load tiff from file (.tif, .tiff), priority=50, is_a, get_flags, get_flags_filename, header, load
16363    /// returns `VipsImage` - Output image
16364    ///
16365    /// filename: `&str` -> Filename to load from
16366    pub fn tiffload(filename: &str) -> Result<VipsImage> {
16367        let mut out_out = VipsImage::from(null_mut());
16368        let vips_op_response = call(
16369            "tiffload",
16370            VOption::new()
16371                .set(
16372                    "filename",
16373                    filename,
16374                )
16375                .set(
16376                    "out",
16377                    &mut out_out,
16378                ),
16379        );
16380
16381        utils::result(
16382            vips_op_response,
16383            out_out,
16384            Error::OperationError("Tiffload (vips_tiffload) failed".to_string()),
16385        )
16386    }
16387
16388    /// VipsForeignLoadTiffFile (tiffload), load tiff from file (.tif, .tiff), priority=50, is_a, get_flags, get_flags_filename, header, load
16389    /// returns `VipsImage` - Output image
16390    ///
16391    /// filename: `&str` -> Filename to load from
16392    ///
16393    /// <ins>Optional arguments</ins>
16394    ///
16395    /// page: `i32` -> First page to load
16396    ///
16397    /// n: `i32` -> Number of pages to load, -1 for all
16398    ///
16399    /// autorotate: `bool` -> Rotate image using orientation tag
16400    ///
16401    /// subifd: `i32` -> Subifd index
16402    ///
16403    /// unlimited: `bool` -> Remove all denial of service limits
16404    ///
16405    /// flags: [`ForeignFlags`] -> Flags for this file
16406    ///
16407    /// memory: `bool` -> Force open via memory
16408    ///
16409    /// access: [`Access`] -> Required access pattern for this file
16410    ///
16411    /// fail_on: [`FailOn`] -> Error level to fail on
16412    ///
16413    /// revalidate: `bool` -> Don't use a cached result for this operation
16414    pub fn tiffload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
16415        let mut out_out = VipsImage::from(null_mut());
16416        let vips_op_response = call(
16417            "tiffload",
16418            option
16419                .set(
16420                    "filename",
16421                    filename,
16422                )
16423                .set(
16424                    "out",
16425                    &mut out_out,
16426                ),
16427        );
16428
16429        utils::result(
16430            vips_op_response,
16431            out_out,
16432            Error::OperationError("Tiffload (vips_tiffload) failed".to_string()),
16433        )
16434    }
16435
16436    /// VipsForeignLoadTiffBuffer (tiffload_buffer), load tiff from buffer, priority=50, is_a_buffer, get_flags, get_flags_filename, header, load
16437    /// returns `VipsImage` - Output image
16438    ///
16439    /// buffer: `&[u8]` -> Buffer to load from
16440    pub fn tiffload_buffer(buffer: &[u8]) -> Result<VipsImage> {
16441        let vips_blob = unsafe {
16442            vips_blob_new(
16443                None,
16444                buffer.as_ptr() as _,
16445                buffer.len() as _,
16446            )
16447        };
16448        let blob = VipsBlob::from(vips_blob);
16449        let mut out_out = VipsImage::from(null_mut());
16450        let vips_op_response = call(
16451            "tiffload_buffer",
16452            VOption::new()
16453                .set(
16454                    "buffer",
16455                    &blob,
16456                )
16457                .set(
16458                    "out",
16459                    &mut out_out,
16460                ),
16461        );
16462        blob.area_unref();
16463        utils::result(
16464            vips_op_response,
16465            out_out,
16466            Error::OperationError("TiffloadBuffer (vips_tiffload_buffer) failed".to_string()),
16467        )
16468    }
16469
16470    /// VipsForeignLoadTiffBuffer (tiffload_buffer), load tiff from buffer, priority=50, is_a_buffer, get_flags, get_flags_filename, header, load
16471    /// returns `VipsImage` - Output image
16472    ///
16473    /// buffer: `&[u8]` -> Buffer to load from
16474    ///
16475    /// <ins>Optional arguments</ins>
16476    ///
16477    /// page: `i32` -> First page to load
16478    ///
16479    /// n: `i32` -> Number of pages to load, -1 for all
16480    ///
16481    /// autorotate: `bool` -> Rotate image using orientation tag
16482    ///
16483    /// subifd: `i32` -> Subifd index
16484    ///
16485    /// unlimited: `bool` -> Remove all denial of service limits
16486    ///
16487    /// flags: [`ForeignFlags`] -> Flags for this file
16488    ///
16489    /// memory: `bool` -> Force open via memory
16490    ///
16491    /// access: [`Access`] -> Required access pattern for this file
16492    ///
16493    /// fail_on: [`FailOn`] -> Error level to fail on
16494    ///
16495    /// revalidate: `bool` -> Don't use a cached result for this operation
16496    pub fn tiffload_buffer_with_opts(buffer: &[u8], option: VOption) -> Result<VipsImage> {
16497        let vips_blob = unsafe {
16498            vips_blob_new(
16499                None,
16500                buffer.as_ptr() as _,
16501                buffer.len() as _,
16502            )
16503        };
16504        let blob = VipsBlob::from(vips_blob);
16505        let mut out_out = VipsImage::from(null_mut());
16506        let vips_op_response = call(
16507            "tiffload_buffer",
16508            option
16509                .set(
16510                    "buffer",
16511                    &blob,
16512                )
16513                .set(
16514                    "out",
16515                    &mut out_out,
16516                ),
16517        );
16518        blob.area_unref();
16519        utils::result(
16520            vips_op_response,
16521            out_out,
16522            Error::OperationError("TiffloadBuffer (vips_tiffload_buffer) failed".to_string()),
16523        )
16524    }
16525
16526    /// VipsForeignLoadTiffSource (tiffload_source), load tiff from source, priority=50, is_a_source, get_flags, get_flags_filename, header, load
16527    /// returns `VipsImage` - Output image
16528    ///
16529    /// source: `&VipsSource` -> Source to load from
16530    pub fn tiffload_source(source: &VipsSource) -> Result<VipsImage> {
16531        let mut out_out = VipsImage::from(null_mut());
16532        let vips_op_response = call(
16533            "tiffload_source",
16534            VOption::new()
16535                .set(
16536                    "source",
16537                    source,
16538                )
16539                .set(
16540                    "out",
16541                    &mut out_out,
16542                ),
16543        );
16544
16545        utils::result(
16546            vips_op_response,
16547            out_out,
16548            Error::OperationError("TiffloadSource (vips_tiffload_source) failed".to_string()),
16549        )
16550    }
16551
16552    /// VipsForeignLoadTiffSource (tiffload_source), load tiff from source, priority=50, is_a_source, get_flags, get_flags_filename, header, load
16553    /// returns `VipsImage` - Output image
16554    ///
16555    /// source: `&VipsSource` -> Source to load from
16556    ///
16557    /// <ins>Optional arguments</ins>
16558    ///
16559    /// page: `i32` -> First page to load
16560    ///
16561    /// n: `i32` -> Number of pages to load, -1 for all
16562    ///
16563    /// autorotate: `bool` -> Rotate image using orientation tag
16564    ///
16565    /// subifd: `i32` -> Subifd index
16566    ///
16567    /// unlimited: `bool` -> Remove all denial of service limits
16568    ///
16569    /// flags: [`ForeignFlags`] -> Flags for this file
16570    ///
16571    /// memory: `bool` -> Force open via memory
16572    ///
16573    /// access: [`Access`] -> Required access pattern for this file
16574    ///
16575    /// fail_on: [`FailOn`] -> Error level to fail on
16576    ///
16577    /// revalidate: `bool` -> Don't use a cached result for this operation
16578    pub fn tiffload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
16579        let mut out_out = VipsImage::from(null_mut());
16580        let vips_op_response = call(
16581            "tiffload_source",
16582            option
16583                .set(
16584                    "source",
16585                    source,
16586                )
16587                .set(
16588                    "out",
16589                    &mut out_out,
16590                ),
16591        );
16592
16593        utils::result(
16594            vips_op_response,
16595            out_out,
16596            Error::OperationError("TiffloadSource (vips_tiffload_source) failed".to_string()),
16597        )
16598    }
16599
16600    /// VipsForeignSaveTiffFile (tiffsave), save image to tiff file (.tif, .tiff), priority=0,
16601    ///
16602    /// filename: `&str` -> Filename to save to
16603    pub fn tiffsave(&self, filename: &str) -> Result<()> {
16604        let vips_op_response = call(
16605            "tiffsave",
16606            VOption::new()
16607                .set("in", self)
16608                .set(
16609                    "filename",
16610                    filename,
16611                ),
16612        );
16613
16614        utils::result(
16615            vips_op_response,
16616            (),
16617            Error::OperationError("Tiffsave (vips_tiffsave) failed".to_string()),
16618        )
16619    }
16620
16621    /// VipsForeignSaveTiffFile (tiffsave), save image to tiff file (.tif, .tiff), priority=0,
16622    ///
16623    /// filename: `&str` -> Filename to save to
16624    ///
16625    /// <ins>Optional arguments</ins>
16626    ///
16627    /// compression: [`ForeignTiffCompression`] -> Compression for this file
16628    ///
16629    /// Q: `i32` -> Q factor
16630    ///
16631    /// predictor: [`ForeignTiffPredictor`] -> Compression prediction
16632    ///
16633    /// tile: `bool` -> Write a tiled tiff
16634    ///
16635    /// tile_width: `i32` -> Tile width in pixels
16636    ///
16637    /// tile_height: `i32` -> Tile height in pixels
16638    ///
16639    /// pyramid: `bool` -> Write a pyramidal tiff
16640    ///
16641    /// miniswhite: `bool` -> Use 0 for white in 1-bit images
16642    ///
16643    /// bitdepth: `i32` -> Write as a 1, 2, 4 or 8 bit image
16644    ///
16645    /// resunit: [`ForeignTiffResunit`] -> Resolution unit
16646    ///
16647    /// xres: `f64` -> Horizontal resolution in pixels/mm
16648    ///
16649    /// yres: `f64` -> Vertical resolution in pixels/mm
16650    ///
16651    /// bigtiff: `bool` -> Write a bigtiff image
16652    ///
16653    /// properties: `bool` -> Write a properties document to IMAGEDESCRIPTION
16654    ///
16655    /// region_shrink: [`RegionShrink`] -> Method to shrink regions
16656    ///
16657    /// level: `i32` -> Deflate (1-9, default 6) or ZSTD (1-22, default 9) compression level
16658    ///
16659    /// lossless: `bool` -> Enable WEBP lossless mode
16660    ///
16661    /// depth: [`ForeignDzDepth`] -> Pyramid depth
16662    ///
16663    /// subifd: `bool` -> Save pyr layers as sub-IFDs
16664    ///
16665    /// premultiply: `bool` -> Save with premultiplied alpha
16666    ///
16667    /// keep: [`ForeignKeep`] -> Which metadata to retain
16668    ///
16669    /// background: `&[f64]` -> Background value
16670    ///
16671    /// page_height: `i32` -> Set page height for multipage save
16672    ///
16673    /// profile: `&str` -> Filename of ICC profile to embed
16674    pub fn tiffsave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
16675        let vips_op_response = call(
16676            "tiffsave",
16677            option
16678                .set("in", self)
16679                .set(
16680                    "filename",
16681                    filename,
16682                ),
16683        );
16684
16685        utils::result(
16686            vips_op_response,
16687            (),
16688            Error::OperationError("Tiffsave (vips_tiffsave) failed".to_string()),
16689        )
16690    }
16691
16692    /// VipsForeignSaveTiffBuffer (tiffsave_buffer), save image to tiff buffer (.tif, .tiff), priority=0,
16693    /// returns `Vec<u8>` - Buffer to save to
16694    pub fn tiffsave_buffer(&self) -> Result<Vec<u8>> {
16695        let mut buffer_out = VipsBlob::from(null_mut());
16696        let vips_op_response = call(
16697            "tiffsave_buffer",
16698            VOption::new()
16699                .set("in", self)
16700                .set(
16701                    "buffer",
16702                    &mut buffer_out,
16703                ),
16704        );
16705
16706        utils::result(
16707            vips_op_response,
16708            buffer_out.into(),
16709            Error::OperationError("TiffsaveBuffer (vips_tiffsave_buffer) failed".to_string()),
16710        )
16711    }
16712
16713    /// VipsForeignSaveTiffBuffer (tiffsave_buffer), save image to tiff buffer (.tif, .tiff), priority=0,
16714    /// returns `Vec<u8>` - Buffer to save to
16715    ///
16716    /// <ins>Optional arguments</ins>
16717    ///
16718    /// compression: [`ForeignTiffCompression`] -> Compression for this file
16719    ///
16720    /// Q: `i32` -> Q factor
16721    ///
16722    /// predictor: [`ForeignTiffPredictor`] -> Compression prediction
16723    ///
16724    /// tile: `bool` -> Write a tiled tiff
16725    ///
16726    /// tile_width: `i32` -> Tile width in pixels
16727    ///
16728    /// tile_height: `i32` -> Tile height in pixels
16729    ///
16730    /// pyramid: `bool` -> Write a pyramidal tiff
16731    ///
16732    /// miniswhite: `bool` -> Use 0 for white in 1-bit images
16733    ///
16734    /// bitdepth: `i32` -> Write as a 1, 2, 4 or 8 bit image
16735    ///
16736    /// resunit: [`ForeignTiffResunit`] -> Resolution unit
16737    ///
16738    /// xres: `f64` -> Horizontal resolution in pixels/mm
16739    ///
16740    /// yres: `f64` -> Vertical resolution in pixels/mm
16741    ///
16742    /// bigtiff: `bool` -> Write a bigtiff image
16743    ///
16744    /// properties: `bool` -> Write a properties document to IMAGEDESCRIPTION
16745    ///
16746    /// region_shrink: [`RegionShrink`] -> Method to shrink regions
16747    ///
16748    /// level: `i32` -> Deflate (1-9, default 6) or ZSTD (1-22, default 9) compression level
16749    ///
16750    /// lossless: `bool` -> Enable WEBP lossless mode
16751    ///
16752    /// depth: [`ForeignDzDepth`] -> Pyramid depth
16753    ///
16754    /// subifd: `bool` -> Save pyr layers as sub-IFDs
16755    ///
16756    /// premultiply: `bool` -> Save with premultiplied alpha
16757    ///
16758    /// keep: [`ForeignKeep`] -> Which metadata to retain
16759    ///
16760    /// background: `&[f64]` -> Background value
16761    ///
16762    /// page_height: `i32` -> Set page height for multipage save
16763    ///
16764    /// profile: `&str` -> Filename of ICC profile to embed
16765    pub fn tiffsave_buffer_with_opts(&self, option: VOption) -> Result<Vec<u8>> {
16766        let mut buffer_out = VipsBlob::from(null_mut());
16767        let vips_op_response = call(
16768            "tiffsave_buffer",
16769            option
16770                .set("in", self)
16771                .set(
16772                    "buffer",
16773                    &mut buffer_out,
16774                ),
16775        );
16776
16777        utils::result(
16778            vips_op_response,
16779            buffer_out.into(),
16780            Error::OperationError("TiffsaveBuffer (vips_tiffsave_buffer) failed".to_string()),
16781        )
16782    }
16783
16784    /// VipsForeignSaveTiffTarget (tiffsave_target), save image to tiff target (.tif, .tiff), priority=0,
16785    ///
16786    /// target: `&VipsTarget` -> Target to save to
16787    pub fn tiffsave_target(&self, target: &VipsTarget) -> Result<()> {
16788        let vips_op_response = call(
16789            "tiffsave_target",
16790            VOption::new()
16791                .set("in", self)
16792                .set(
16793                    "target",
16794                    target,
16795                ),
16796        );
16797
16798        utils::result(
16799            vips_op_response,
16800            (),
16801            Error::OperationError("TiffsaveTarget (vips_tiffsave_target) failed".to_string()),
16802        )
16803    }
16804
16805    /// VipsForeignSaveTiffTarget (tiffsave_target), save image to tiff target (.tif, .tiff), priority=0,
16806    ///
16807    /// target: `&VipsTarget` -> Target to save to
16808    ///
16809    /// <ins>Optional arguments</ins>
16810    ///
16811    /// compression: [`ForeignTiffCompression`] -> Compression for this file
16812    ///
16813    /// Q: `i32` -> Q factor
16814    ///
16815    /// predictor: [`ForeignTiffPredictor`] -> Compression prediction
16816    ///
16817    /// tile: `bool` -> Write a tiled tiff
16818    ///
16819    /// tile_width: `i32` -> Tile width in pixels
16820    ///
16821    /// tile_height: `i32` -> Tile height in pixels
16822    ///
16823    /// pyramid: `bool` -> Write a pyramidal tiff
16824    ///
16825    /// miniswhite: `bool` -> Use 0 for white in 1-bit images
16826    ///
16827    /// bitdepth: `i32` -> Write as a 1, 2, 4 or 8 bit image
16828    ///
16829    /// resunit: [`ForeignTiffResunit`] -> Resolution unit
16830    ///
16831    /// xres: `f64` -> Horizontal resolution in pixels/mm
16832    ///
16833    /// yres: `f64` -> Vertical resolution in pixels/mm
16834    ///
16835    /// bigtiff: `bool` -> Write a bigtiff image
16836    ///
16837    /// properties: `bool` -> Write a properties document to IMAGEDESCRIPTION
16838    ///
16839    /// region_shrink: [`RegionShrink`] -> Method to shrink regions
16840    ///
16841    /// level: `i32` -> Deflate (1-9, default 6) or ZSTD (1-22, default 9) compression level
16842    ///
16843    /// lossless: `bool` -> Enable WEBP lossless mode
16844    ///
16845    /// depth: [`ForeignDzDepth`] -> Pyramid depth
16846    ///
16847    /// subifd: `bool` -> Save pyr layers as sub-IFDs
16848    ///
16849    /// premultiply: `bool` -> Save with premultiplied alpha
16850    ///
16851    /// keep: [`ForeignKeep`] -> Which metadata to retain
16852    ///
16853    /// background: `&[f64]` -> Background value
16854    ///
16855    /// page_height: `i32` -> Set page height for multipage save
16856    ///
16857    /// profile: `&str` -> Filename of ICC profile to embed
16858    pub fn tiffsave_target_with_opts(&self, target: &VipsTarget, option: VOption) -> Result<()> {
16859        let vips_op_response = call(
16860            "tiffsave_target",
16861            option
16862                .set("in", self)
16863                .set(
16864                    "target",
16865                    target,
16866                ),
16867        );
16868
16869        utils::result(
16870            vips_op_response,
16871            (),
16872            Error::OperationError("TiffsaveTarget (vips_tiffsave_target) failed".to_string()),
16873        )
16874    }
16875
16876    /// VipsTileCache (tilecache), cache an image as a set of tiles
16877    /// returns `VipsImage` - Output image
16878    pub fn tilecache(&self) -> Result<VipsImage> {
16879        let mut out_out = VipsImage::from(null_mut());
16880        let vips_op_response = call(
16881            "tilecache",
16882            VOption::new()
16883                .set("in", self)
16884                .set(
16885                    "out",
16886                    &mut out_out,
16887                ),
16888        );
16889
16890        utils::result(
16891            vips_op_response,
16892            out_out,
16893            Error::OperationError("Tilecache (vips_tilecache) failed".to_string()),
16894        )
16895    }
16896
16897    /// VipsTileCache (tilecache), cache an image as a set of tiles
16898    /// returns `VipsImage` - Output image
16899    ///
16900    /// <ins>Optional arguments</ins>
16901    ///
16902    /// tile_width: `i32` -> Tile width in pixels
16903    ///
16904    /// tile_height: `i32` -> Tile height in pixels
16905    ///
16906    /// max_tiles: `i32` -> Maximum number of tiles to cache
16907    ///
16908    /// access: [`Access`] -> Expected access pattern
16909    ///
16910    /// threaded: `bool` -> Allow threaded access
16911    ///
16912    /// persistent: `bool` -> Keep cache between evaluations
16913    pub fn tilecache_with_opts(&self, option: VOption) -> Result<VipsImage> {
16914        let mut out_out = VipsImage::from(null_mut());
16915        let vips_op_response = call(
16916            "tilecache",
16917            option
16918                .set("in", self)
16919                .set(
16920                    "out",
16921                    &mut out_out,
16922                ),
16923        );
16924
16925        utils::result(
16926            vips_op_response,
16927            out_out,
16928            Error::OperationError("Tilecache (vips_tilecache) failed".to_string()),
16929        )
16930    }
16931
16932    /// VipsTonelut (tonelut), build a look-up table
16933    /// returns `VipsImage` - Output image
16934    pub fn tonelut() -> Result<VipsImage> {
16935        let mut out_out = VipsImage::from(null_mut());
16936        let vips_op_response = call(
16937            "tonelut",
16938            VOption::new().set(
16939                "out",
16940                &mut out_out,
16941            ),
16942        );
16943
16944        utils::result(
16945            vips_op_response,
16946            out_out,
16947            Error::OperationError("Tonelut (vips_tonelut) failed".to_string()),
16948        )
16949    }
16950
16951    /// VipsTonelut (tonelut), build a look-up table
16952    /// returns `VipsImage` - Output image
16953    ///
16954    /// <ins>Optional arguments</ins>
16955    ///
16956    /// in_max: `i32` -> Size of LUT to build
16957    ///
16958    /// out_max: `i32` -> Maximum value in output LUT
16959    ///
16960    /// Lb: `f64` -> Lowest value in output
16961    ///
16962    /// Lw: `f64` -> Highest value in output
16963    ///
16964    /// Ps: `f64` -> Position of shadow
16965    ///
16966    /// Pm: `f64` -> Position of mid-tones
16967    ///
16968    /// Ph: `f64` -> Position of highlights
16969    ///
16970    /// S: `f64` -> Adjust shadows by this much
16971    ///
16972    /// M: `f64` -> Adjust mid-tones by this much
16973    ///
16974    /// H: `f64` -> Adjust highlights by this much
16975    pub fn tonelut_with_opts(option: VOption) -> Result<VipsImage> {
16976        let mut out_out = VipsImage::from(null_mut());
16977        let vips_op_response = call(
16978            "tonelut",
16979            option.set(
16980                "out",
16981                &mut out_out,
16982            ),
16983        );
16984
16985        utils::result(
16986            vips_op_response,
16987            out_out,
16988            Error::OperationError("Tonelut (vips_tonelut) failed".to_string()),
16989        )
16990    }
16991
16992    /// VipsTranspose3d (transpose3d), transpose3d an image
16993    /// returns `VipsImage` - Output image
16994    pub fn transpose3d(&self) -> Result<VipsImage> {
16995        let mut out_out = VipsImage::from(null_mut());
16996        let vips_op_response = call(
16997            "transpose3d",
16998            VOption::new()
16999                .set("in", self)
17000                .set(
17001                    "out",
17002                    &mut out_out,
17003                ),
17004        );
17005
17006        utils::result(
17007            vips_op_response,
17008            out_out,
17009            Error::OperationError("Transpose3D (vips_transpose3d) failed".to_string()),
17010        )
17011    }
17012
17013    /// VipsTranspose3d (transpose3d), transpose3d an image
17014    /// returns `VipsImage` - Output image
17015    ///
17016    /// <ins>Optional arguments</ins>
17017    ///
17018    /// page_height: `i32` -> Height of each input page
17019    pub fn transpose3d_with_opts(&self, option: VOption) -> Result<VipsImage> {
17020        let mut out_out = VipsImage::from(null_mut());
17021        let vips_op_response = call(
17022            "transpose3d",
17023            option
17024                .set("in", self)
17025                .set(
17026                    "out",
17027                    &mut out_out,
17028                ),
17029        );
17030
17031        utils::result(
17032            vips_op_response,
17033            out_out,
17034            Error::OperationError("Transpose3D (vips_transpose3d) failed".to_string()),
17035        )
17036    }
17037
17038    /// VipsUnpremultiply (unpremultiply), unpremultiply image alpha
17039    /// returns `VipsImage` - Output image
17040    pub fn unpremultiply(&self) -> Result<VipsImage> {
17041        let mut out_out = VipsImage::from(null_mut());
17042        let vips_op_response = call(
17043            "unpremultiply",
17044            VOption::new()
17045                .set("in", self)
17046                .set(
17047                    "out",
17048                    &mut out_out,
17049                ),
17050        );
17051
17052        utils::result(
17053            vips_op_response,
17054            out_out,
17055            Error::OperationError("Unpremultiply (vips_unpremultiply) failed".to_string()),
17056        )
17057    }
17058
17059    /// VipsUnpremultiply (unpremultiply), unpremultiply image alpha
17060    /// returns `VipsImage` - Output image
17061    ///
17062    /// <ins>Optional arguments</ins>
17063    ///
17064    /// max_alpha: `f64` -> Maximum value of alpha channel
17065    ///
17066    /// alpha_band: `i32` -> Unpremultiply with this alpha
17067    pub fn unpremultiply_with_opts(&self, option: VOption) -> Result<VipsImage> {
17068        let mut out_out = VipsImage::from(null_mut());
17069        let vips_op_response = call(
17070            "unpremultiply",
17071            option
17072                .set("in", self)
17073                .set(
17074                    "out",
17075                    &mut out_out,
17076                ),
17077        );
17078
17079        utils::result(
17080            vips_op_response,
17081            out_out,
17082            Error::OperationError("Unpremultiply (vips_unpremultiply) failed".to_string()),
17083        )
17084    }
17085
17086    /// VipsForeignLoadVipsFile (vipsload), load vips from file (.v, .vips), priority=200, untrusted, is_a, get_flags, get_flags_filename, header
17087    /// returns `VipsImage` - Output image
17088    ///
17089    /// filename: `&str` -> Filename to load from
17090    pub fn vipsload(filename: &str) -> Result<VipsImage> {
17091        let mut out_out = VipsImage::from(null_mut());
17092        let vips_op_response = call(
17093            "vipsload",
17094            VOption::new()
17095                .set(
17096                    "filename",
17097                    filename,
17098                )
17099                .set(
17100                    "out",
17101                    &mut out_out,
17102                ),
17103        );
17104
17105        utils::result(
17106            vips_op_response,
17107            out_out,
17108            Error::OperationError("Vipsload (vips_vipsload) failed".to_string()),
17109        )
17110    }
17111
17112    /// VipsForeignLoadVipsFile (vipsload), load vips from file (.v, .vips), priority=200, untrusted, is_a, get_flags, get_flags_filename, header
17113    /// returns `VipsImage` - Output image
17114    ///
17115    /// filename: `&str` -> Filename to load from
17116    ///
17117    /// <ins>Optional arguments</ins>
17118    ///
17119    /// flags: [`ForeignFlags`] -> Flags for this file
17120    ///
17121    /// memory: `bool` -> Force open via memory
17122    ///
17123    /// access: [`Access`] -> Required access pattern for this file
17124    ///
17125    /// fail_on: [`FailOn`] -> Error level to fail on
17126    ///
17127    /// revalidate: `bool` -> Don't use a cached result for this operation
17128    pub fn vipsload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
17129        let mut out_out = VipsImage::from(null_mut());
17130        let vips_op_response = call(
17131            "vipsload",
17132            option
17133                .set(
17134                    "filename",
17135                    filename,
17136                )
17137                .set(
17138                    "out",
17139                    &mut out_out,
17140                ),
17141        );
17142
17143        utils::result(
17144            vips_op_response,
17145            out_out,
17146            Error::OperationError("Vipsload (vips_vipsload) failed".to_string()),
17147        )
17148    }
17149
17150    /// VipsForeignLoadVipsSource (vipsload_source), load vips from source, priority=200, untrusted, is_a_source, get_flags, get_flags_filename, header
17151    /// returns `VipsImage` - Output image
17152    ///
17153    /// source: `&VipsSource` -> Source to load from
17154    pub fn vipsload_source(source: &VipsSource) -> Result<VipsImage> {
17155        let mut out_out = VipsImage::from(null_mut());
17156        let vips_op_response = call(
17157            "vipsload_source",
17158            VOption::new()
17159                .set(
17160                    "source",
17161                    source,
17162                )
17163                .set(
17164                    "out",
17165                    &mut out_out,
17166                ),
17167        );
17168
17169        utils::result(
17170            vips_op_response,
17171            out_out,
17172            Error::OperationError("VipsloadSource (vips_vipsload_source) failed".to_string()),
17173        )
17174    }
17175
17176    /// VipsForeignLoadVipsSource (vipsload_source), load vips from source, priority=200, untrusted, is_a_source, get_flags, get_flags_filename, header
17177    /// returns `VipsImage` - Output image
17178    ///
17179    /// source: `&VipsSource` -> Source to load from
17180    ///
17181    /// <ins>Optional arguments</ins>
17182    ///
17183    /// flags: [`ForeignFlags`] -> Flags for this file
17184    ///
17185    /// memory: `bool` -> Force open via memory
17186    ///
17187    /// access: [`Access`] -> Required access pattern for this file
17188    ///
17189    /// fail_on: [`FailOn`] -> Error level to fail on
17190    ///
17191    /// revalidate: `bool` -> Don't use a cached result for this operation
17192    pub fn vipsload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
17193        let mut out_out = VipsImage::from(null_mut());
17194        let vips_op_response = call(
17195            "vipsload_source",
17196            option
17197                .set(
17198                    "source",
17199                    source,
17200                )
17201                .set(
17202                    "out",
17203                    &mut out_out,
17204                ),
17205        );
17206
17207        utils::result(
17208            vips_op_response,
17209            out_out,
17210            Error::OperationError("VipsloadSource (vips_vipsload_source) failed".to_string()),
17211        )
17212    }
17213
17214    /// VipsForeignSaveVipsFile (vipssave), save image to file in vips format (.v, .vips), priority=0,
17215    ///
17216    /// filename: `&str` -> Filename to save to
17217    pub fn vipssave(&self, filename: &str) -> Result<()> {
17218        let vips_op_response = call(
17219            "vipssave",
17220            VOption::new()
17221                .set("in", self)
17222                .set(
17223                    "filename",
17224                    filename,
17225                ),
17226        );
17227
17228        utils::result(
17229            vips_op_response,
17230            (),
17231            Error::OperationError("Vipssave (vips_vipssave) failed".to_string()),
17232        )
17233    }
17234
17235    /// VipsForeignSaveVipsFile (vipssave), save image to file in vips format (.v, .vips), priority=0,
17236    ///
17237    /// filename: `&str` -> Filename to save to
17238    ///
17239    /// <ins>Optional arguments</ins>
17240    ///
17241    /// keep: [`ForeignKeep`] -> Which metadata to retain
17242    ///
17243    /// background: `&[f64]` -> Background value
17244    ///
17245    /// page_height: `i32` -> Set page height for multipage save
17246    ///
17247    /// profile: `&str` -> Filename of ICC profile to embed
17248    pub fn vipssave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
17249        let vips_op_response = call(
17250            "vipssave",
17251            option
17252                .set("in", self)
17253                .set(
17254                    "filename",
17255                    filename,
17256                ),
17257        );
17258
17259        utils::result(
17260            vips_op_response,
17261            (),
17262            Error::OperationError("Vipssave (vips_vipssave) failed".to_string()),
17263        )
17264    }
17265
17266    /// VipsForeignSaveVipsTarget (vipssave_target), save image to target in vips format (.v, .vips), priority=0,
17267    ///
17268    /// target: `&VipsTarget` -> Target to save to
17269    pub fn vipssave_target(&self, target: &VipsTarget) -> Result<()> {
17270        let vips_op_response = call(
17271            "vipssave_target",
17272            VOption::new()
17273                .set("in", self)
17274                .set(
17275                    "target",
17276                    target,
17277                ),
17278        );
17279
17280        utils::result(
17281            vips_op_response,
17282            (),
17283            Error::OperationError("VipssaveTarget (vips_vipssave_target) failed".to_string()),
17284        )
17285    }
17286
17287    /// VipsForeignSaveVipsTarget (vipssave_target), save image to target in vips format (.v, .vips), priority=0,
17288    ///
17289    /// target: `&VipsTarget` -> Target to save to
17290    ///
17291    /// <ins>Optional arguments</ins>
17292    ///
17293    /// keep: [`ForeignKeep`] -> Which metadata to retain
17294    ///
17295    /// background: `&[f64]` -> Background value
17296    ///
17297    /// page_height: `i32` -> Set page height for multipage save
17298    ///
17299    /// profile: `&str` -> Filename of ICC profile to embed
17300    pub fn vipssave_target_with_opts(&self, target: &VipsTarget, option: VOption) -> Result<()> {
17301        let vips_op_response = call(
17302            "vipssave_target",
17303            option
17304                .set("in", self)
17305                .set(
17306                    "target",
17307                    target,
17308                ),
17309        );
17310
17311        utils::result(
17312            vips_op_response,
17313            (),
17314            Error::OperationError("VipssaveTarget (vips_vipssave_target) failed".to_string()),
17315        )
17316    }
17317
17318    /// VipsForeignLoadWebpFile (webpload), load webp from file (.webp), priority=200, is_a, get_flags, get_flags_filename, header, load
17319    /// returns `VipsImage` - Output image
17320    ///
17321    /// filename: `&str` -> Filename to load from
17322    pub fn webpload(filename: &str) -> Result<VipsImage> {
17323        let mut out_out = VipsImage::from(null_mut());
17324        let vips_op_response = call(
17325            "webpload",
17326            VOption::new()
17327                .set(
17328                    "filename",
17329                    filename,
17330                )
17331                .set(
17332                    "out",
17333                    &mut out_out,
17334                ),
17335        );
17336
17337        utils::result(
17338            vips_op_response,
17339            out_out,
17340            Error::OperationError("Webpload (vips_webpload) failed".to_string()),
17341        )
17342    }
17343
17344    /// VipsForeignLoadWebpFile (webpload), load webp from file (.webp), priority=200, is_a, get_flags, get_flags_filename, header, load
17345    /// returns `VipsImage` - Output image
17346    ///
17347    /// filename: `&str` -> Filename to load from
17348    ///
17349    /// <ins>Optional arguments</ins>
17350    ///
17351    /// page: `i32` -> First page to load
17352    ///
17353    /// n: `i32` -> Number of pages to load, -1 for all
17354    ///
17355    /// scale: `f64` -> Factor to scale by
17356    ///
17357    /// flags: [`ForeignFlags`] -> Flags for this file
17358    ///
17359    /// memory: `bool` -> Force open via memory
17360    ///
17361    /// access: [`Access`] -> Required access pattern for this file
17362    ///
17363    /// fail_on: [`FailOn`] -> Error level to fail on
17364    ///
17365    /// revalidate: `bool` -> Don't use a cached result for this operation
17366    pub fn webpload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
17367        let mut out_out = VipsImage::from(null_mut());
17368        let vips_op_response = call(
17369            "webpload",
17370            option
17371                .set(
17372                    "filename",
17373                    filename,
17374                )
17375                .set(
17376                    "out",
17377                    &mut out_out,
17378                ),
17379        );
17380
17381        utils::result(
17382            vips_op_response,
17383            out_out,
17384            Error::OperationError("Webpload (vips_webpload) failed".to_string()),
17385        )
17386    }
17387
17388    /// VipsForeignLoadWebpBuffer (webpload_buffer), load webp from buffer, priority=200, is_a_buffer, get_flags, get_flags_filename, header, load
17389    /// returns `VipsImage` - Output image
17390    ///
17391    /// buffer: `&[u8]` -> Buffer to load from
17392    pub fn webpload_buffer(buffer: &[u8]) -> Result<VipsImage> {
17393        let vips_blob = unsafe {
17394            vips_blob_new(
17395                None,
17396                buffer.as_ptr() as _,
17397                buffer.len() as _,
17398            )
17399        };
17400        let blob = VipsBlob::from(vips_blob);
17401        let mut out_out = VipsImage::from(null_mut());
17402        let vips_op_response = call(
17403            "webpload_buffer",
17404            VOption::new()
17405                .set(
17406                    "buffer",
17407                    &blob,
17408                )
17409                .set(
17410                    "out",
17411                    &mut out_out,
17412                ),
17413        );
17414        blob.area_unref();
17415        utils::result(
17416            vips_op_response,
17417            out_out,
17418            Error::OperationError("WebploadBuffer (vips_webpload_buffer) failed".to_string()),
17419        )
17420    }
17421
17422    /// VipsForeignLoadWebpBuffer (webpload_buffer), load webp from buffer, priority=200, is_a_buffer, get_flags, get_flags_filename, header, load
17423    /// returns `VipsImage` - Output image
17424    ///
17425    /// buffer: `&[u8]` -> Buffer to load from
17426    ///
17427    /// <ins>Optional arguments</ins>
17428    ///
17429    /// page: `i32` -> First page to load
17430    ///
17431    /// n: `i32` -> Number of pages to load, -1 for all
17432    ///
17433    /// scale: `f64` -> Factor to scale by
17434    ///
17435    /// flags: [`ForeignFlags`] -> Flags for this file
17436    ///
17437    /// memory: `bool` -> Force open via memory
17438    ///
17439    /// access: [`Access`] -> Required access pattern for this file
17440    ///
17441    /// fail_on: [`FailOn`] -> Error level to fail on
17442    ///
17443    /// revalidate: `bool` -> Don't use a cached result for this operation
17444    pub fn webpload_buffer_with_opts(buffer: &[u8], option: VOption) -> Result<VipsImage> {
17445        let vips_blob = unsafe {
17446            vips_blob_new(
17447                None,
17448                buffer.as_ptr() as _,
17449                buffer.len() as _,
17450            )
17451        };
17452        let blob = VipsBlob::from(vips_blob);
17453        let mut out_out = VipsImage::from(null_mut());
17454        let vips_op_response = call(
17455            "webpload_buffer",
17456            option
17457                .set(
17458                    "buffer",
17459                    &blob,
17460                )
17461                .set(
17462                    "out",
17463                    &mut out_out,
17464                ),
17465        );
17466        blob.area_unref();
17467        utils::result(
17468            vips_op_response,
17469            out_out,
17470            Error::OperationError("WebploadBuffer (vips_webpload_buffer) failed".to_string()),
17471        )
17472    }
17473
17474    /// VipsForeignLoadWebpSource (webpload_source), load webp from source, priority=200, is_a_source, get_flags, get_flags_filename, header, load
17475    /// returns `VipsImage` - Output image
17476    ///
17477    /// source: `&VipsSource` -> Source to load from
17478    pub fn webpload_source(source: &VipsSource) -> Result<VipsImage> {
17479        let mut out_out = VipsImage::from(null_mut());
17480        let vips_op_response = call(
17481            "webpload_source",
17482            VOption::new()
17483                .set(
17484                    "source",
17485                    source,
17486                )
17487                .set(
17488                    "out",
17489                    &mut out_out,
17490                ),
17491        );
17492
17493        utils::result(
17494            vips_op_response,
17495            out_out,
17496            Error::OperationError("WebploadSource (vips_webpload_source) failed".to_string()),
17497        )
17498    }
17499
17500    /// VipsForeignLoadWebpSource (webpload_source), load webp from source, priority=200, is_a_source, get_flags, get_flags_filename, header, load
17501    /// returns `VipsImage` - Output image
17502    ///
17503    /// source: `&VipsSource` -> Source to load from
17504    ///
17505    /// <ins>Optional arguments</ins>
17506    ///
17507    /// page: `i32` -> First page to load
17508    ///
17509    /// n: `i32` -> Number of pages to load, -1 for all
17510    ///
17511    /// scale: `f64` -> Factor to scale by
17512    ///
17513    /// flags: [`ForeignFlags`] -> Flags for this file
17514    ///
17515    /// memory: `bool` -> Force open via memory
17516    ///
17517    /// access: [`Access`] -> Required access pattern for this file
17518    ///
17519    /// fail_on: [`FailOn`] -> Error level to fail on
17520    ///
17521    /// revalidate: `bool` -> Don't use a cached result for this operation
17522    pub fn webpload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
17523        let mut out_out = VipsImage::from(null_mut());
17524        let vips_op_response = call(
17525            "webpload_source",
17526            option
17527                .set(
17528                    "source",
17529                    source,
17530                )
17531                .set(
17532                    "out",
17533                    &mut out_out,
17534                ),
17535        );
17536
17537        utils::result(
17538            vips_op_response,
17539            out_out,
17540            Error::OperationError("WebploadSource (vips_webpload_source) failed".to_string()),
17541        )
17542    }
17543
17544    /// VipsForeignSaveWebpFile (webpsave), save as WebP (.webp), priority=0, rgb alpha
17545    ///
17546    /// filename: `&str` -> Filename to save to
17547    pub fn webpsave(&self, filename: &str) -> Result<()> {
17548        let vips_op_response = call(
17549            "webpsave",
17550            VOption::new()
17551                .set("in", self)
17552                .set(
17553                    "filename",
17554                    filename,
17555                ),
17556        );
17557
17558        utils::result(
17559            vips_op_response,
17560            (),
17561            Error::OperationError("Webpsave (vips_webpsave) failed".to_string()),
17562        )
17563    }
17564
17565    /// VipsForeignSaveWebpFile (webpsave), save as WebP (.webp), priority=0, rgb alpha
17566    ///
17567    /// filename: `&str` -> Filename to save to
17568    ///
17569    /// <ins>Optional arguments</ins>
17570    ///
17571    /// Q: `i32` -> Q factor
17572    ///
17573    /// lossless: `bool` -> Enable lossless compression
17574    ///
17575    /// preset: [`ForeignWebpPreset`] -> Preset for lossy compression
17576    ///
17577    /// smart_subsample: `bool` -> Enable high quality chroma subsampling
17578    ///
17579    /// near_lossless: `bool` -> Enable preprocessing in lossless mode (uses Q)
17580    ///
17581    /// alpha_q: `i32` -> Change alpha plane fidelity for lossy compression
17582    ///
17583    /// min_size: `bool` -> Optimise for minimum size
17584    ///
17585    /// kmin: `i32` -> Minimum number of frames between key frames
17586    ///
17587    /// kmax: `i32` -> Maximum number of frames between key frames
17588    ///
17589    /// effort: `i32` -> Level of CPU effort to reduce file size
17590    ///
17591    /// target_size: `i32` -> Desired target size in bytes
17592    ///
17593    /// mixed: `bool` -> Allow mixed encoding (might reduce file size)
17594    ///
17595    /// smart_deblock: `bool` -> Enable auto-adjusting of the deblocking filter
17596    ///
17597    /// passes: `i32` -> Number of entropy-analysis passes (in [1..10])
17598    ///
17599    /// keep: [`ForeignKeep`] -> Which metadata to retain
17600    ///
17601    /// background: `&[f64]` -> Background value
17602    ///
17603    /// page_height: `i32` -> Set page height for multipage save
17604    ///
17605    /// profile: `&str` -> Filename of ICC profile to embed
17606    pub fn webpsave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
17607        let vips_op_response = call(
17608            "webpsave",
17609            option
17610                .set("in", self)
17611                .set(
17612                    "filename",
17613                    filename,
17614                ),
17615        );
17616
17617        utils::result(
17618            vips_op_response,
17619            (),
17620            Error::OperationError("Webpsave (vips_webpsave) failed".to_string()),
17621        )
17622    }
17623
17624    /// VipsForeignSaveWebpBuffer (webpsave_buffer), save as WebP (.webp), priority=0, rgb alpha
17625    /// returns `Vec<u8>` - Buffer to save to
17626    pub fn webpsave_buffer(&self) -> Result<Vec<u8>> {
17627        let mut buffer_out = VipsBlob::from(null_mut());
17628        let vips_op_response = call(
17629            "webpsave_buffer",
17630            VOption::new()
17631                .set("in", self)
17632                .set(
17633                    "buffer",
17634                    &mut buffer_out,
17635                ),
17636        );
17637
17638        utils::result(
17639            vips_op_response,
17640            buffer_out.into(),
17641            Error::OperationError("WebpsaveBuffer (vips_webpsave_buffer) failed".to_string()),
17642        )
17643    }
17644
17645    /// VipsForeignSaveWebpBuffer (webpsave_buffer), save as WebP (.webp), priority=0, rgb alpha
17646    /// returns `Vec<u8>` - Buffer to save to
17647    ///
17648    /// <ins>Optional arguments</ins>
17649    ///
17650    /// Q: `i32` -> Q factor
17651    ///
17652    /// lossless: `bool` -> Enable lossless compression
17653    ///
17654    /// preset: [`ForeignWebpPreset`] -> Preset for lossy compression
17655    ///
17656    /// smart_subsample: `bool` -> Enable high quality chroma subsampling
17657    ///
17658    /// near_lossless: `bool` -> Enable preprocessing in lossless mode (uses Q)
17659    ///
17660    /// alpha_q: `i32` -> Change alpha plane fidelity for lossy compression
17661    ///
17662    /// min_size: `bool` -> Optimise for minimum size
17663    ///
17664    /// kmin: `i32` -> Minimum number of frames between key frames
17665    ///
17666    /// kmax: `i32` -> Maximum number of frames between key frames
17667    ///
17668    /// effort: `i32` -> Level of CPU effort to reduce file size
17669    ///
17670    /// target_size: `i32` -> Desired target size in bytes
17671    ///
17672    /// mixed: `bool` -> Allow mixed encoding (might reduce file size)
17673    ///
17674    /// smart_deblock: `bool` -> Enable auto-adjusting of the deblocking filter
17675    ///
17676    /// passes: `i32` -> Number of entropy-analysis passes (in [1..10])
17677    ///
17678    /// keep: [`ForeignKeep`] -> Which metadata to retain
17679    ///
17680    /// background: `&[f64]` -> Background value
17681    ///
17682    /// page_height: `i32` -> Set page height for multipage save
17683    ///
17684    /// profile: `&str` -> Filename of ICC profile to embed
17685    pub fn webpsave_buffer_with_opts(&self, option: VOption) -> Result<Vec<u8>> {
17686        let mut buffer_out = VipsBlob::from(null_mut());
17687        let vips_op_response = call(
17688            "webpsave_buffer",
17689            option
17690                .set("in", self)
17691                .set(
17692                    "buffer",
17693                    &mut buffer_out,
17694                ),
17695        );
17696
17697        utils::result(
17698            vips_op_response,
17699            buffer_out.into(),
17700            Error::OperationError("WebpsaveBuffer (vips_webpsave_buffer) failed".to_string()),
17701        )
17702    }
17703
17704    /// VipsForeignSaveWebpMime (webpsave_mime), save image to webp mime (.webp), priority=0, rgb alpha
17705    pub fn webpsave_mime(&self) -> Result<()> {
17706        let vips_op_response = call(
17707            "webpsave_mime",
17708            VOption::new().set("in", self),
17709        );
17710
17711        utils::result(
17712            vips_op_response,
17713            (),
17714            Error::OperationError("WebpsaveMime (vips_webpsave_mime) failed".to_string()),
17715        )
17716    }
17717
17718    /// VipsForeignSaveWebpMime (webpsave_mime), save image to webp mime (.webp), priority=0, rgb alpha
17719    ///
17720    /// <ins>Optional arguments</ins>
17721    ///
17722    /// Q: `i32` -> Q factor
17723    ///
17724    /// lossless: `bool` -> Enable lossless compression
17725    ///
17726    /// preset: [`ForeignWebpPreset`] -> Preset for lossy compression
17727    ///
17728    /// smart_subsample: `bool` -> Enable high quality chroma subsampling
17729    ///
17730    /// near_lossless: `bool` -> Enable preprocessing in lossless mode (uses Q)
17731    ///
17732    /// alpha_q: `i32` -> Change alpha plane fidelity for lossy compression
17733    ///
17734    /// min_size: `bool` -> Optimise for minimum size
17735    ///
17736    /// kmin: `i32` -> Minimum number of frames between key frames
17737    ///
17738    /// kmax: `i32` -> Maximum number of frames between key frames
17739    ///
17740    /// effort: `i32` -> Level of CPU effort to reduce file size
17741    ///
17742    /// target_size: `i32` -> Desired target size in bytes
17743    ///
17744    /// mixed: `bool` -> Allow mixed encoding (might reduce file size)
17745    ///
17746    /// smart_deblock: `bool` -> Enable auto-adjusting of the deblocking filter
17747    ///
17748    /// passes: `i32` -> Number of entropy-analysis passes (in [1..10])
17749    ///
17750    /// keep: [`ForeignKeep`] -> Which metadata to retain
17751    ///
17752    /// background: `&[f64]` -> Background value
17753    ///
17754    /// page_height: `i32` -> Set page height for multipage save
17755    ///
17756    /// profile: `&str` -> Filename of ICC profile to embed
17757    pub fn webpsave_mime_with_opts(&self, option: VOption) -> Result<()> {
17758        let vips_op_response = call(
17759            "webpsave_mime",
17760            option.set("in", self),
17761        );
17762
17763        utils::result(
17764            vips_op_response,
17765            (),
17766            Error::OperationError("WebpsaveMime (vips_webpsave_mime) failed".to_string()),
17767        )
17768    }
17769
17770    /// VipsForeignSaveWebpTarget (webpsave_target), save as WebP (.webp), priority=0, rgb alpha
17771    ///
17772    /// target: `&VipsTarget` -> Target to save to
17773    pub fn webpsave_target(&self, target: &VipsTarget) -> Result<()> {
17774        let vips_op_response = call(
17775            "webpsave_target",
17776            VOption::new()
17777                .set("in", self)
17778                .set(
17779                    "target",
17780                    target,
17781                ),
17782        );
17783
17784        utils::result(
17785            vips_op_response,
17786            (),
17787            Error::OperationError("WebpsaveTarget (vips_webpsave_target) failed".to_string()),
17788        )
17789    }
17790
17791    /// VipsForeignSaveWebpTarget (webpsave_target), save as WebP (.webp), priority=0, rgb alpha
17792    ///
17793    /// target: `&VipsTarget` -> Target to save to
17794    ///
17795    /// <ins>Optional arguments</ins>
17796    ///
17797    /// Q: `i32` -> Q factor
17798    ///
17799    /// lossless: `bool` -> Enable lossless compression
17800    ///
17801    /// preset: [`ForeignWebpPreset`] -> Preset for lossy compression
17802    ///
17803    /// smart_subsample: `bool` -> Enable high quality chroma subsampling
17804    ///
17805    /// near_lossless: `bool` -> Enable preprocessing in lossless mode (uses Q)
17806    ///
17807    /// alpha_q: `i32` -> Change alpha plane fidelity for lossy compression
17808    ///
17809    /// min_size: `bool` -> Optimise for minimum size
17810    ///
17811    /// kmin: `i32` -> Minimum number of frames between key frames
17812    ///
17813    /// kmax: `i32` -> Maximum number of frames between key frames
17814    ///
17815    /// effort: `i32` -> Level of CPU effort to reduce file size
17816    ///
17817    /// target_size: `i32` -> Desired target size in bytes
17818    ///
17819    /// mixed: `bool` -> Allow mixed encoding (might reduce file size)
17820    ///
17821    /// smart_deblock: `bool` -> Enable auto-adjusting of the deblocking filter
17822    ///
17823    /// passes: `i32` -> Number of entropy-analysis passes (in [1..10])
17824    ///
17825    /// keep: [`ForeignKeep`] -> Which metadata to retain
17826    ///
17827    /// background: `&[f64]` -> Background value
17828    ///
17829    /// page_height: `i32` -> Set page height for multipage save
17830    ///
17831    /// profile: `&str` -> Filename of ICC profile to embed
17832    pub fn webpsave_target_with_opts(&self, target: &VipsTarget, option: VOption) -> Result<()> {
17833        let vips_op_response = call(
17834            "webpsave_target",
17835            option
17836                .set("in", self)
17837                .set(
17838                    "target",
17839                    target,
17840                ),
17841        );
17842
17843        utils::result(
17844            vips_op_response,
17845            (),
17846            Error::OperationError("WebpsaveTarget (vips_webpsave_target) failed".to_string()),
17847        )
17848    }
17849
17850    /// VipsWorley (worley), make a worley noise image
17851    /// returns `VipsImage` - Output image
17852    ///
17853    /// width: `i32` -> Image width in pixels
17854    ///
17855    /// height: `i32` -> Image height in pixels
17856    pub fn worley(width: i32, height: i32) -> Result<VipsImage> {
17857        let mut out_out = VipsImage::from(null_mut());
17858        let vips_op_response = call(
17859            "worley",
17860            VOption::new()
17861                .set(
17862                    "out",
17863                    &mut out_out,
17864                )
17865                .set(
17866                    "width",
17867                    width,
17868                )
17869                .set(
17870                    "height",
17871                    height,
17872                ),
17873        );
17874
17875        utils::result(
17876            vips_op_response,
17877            out_out,
17878            Error::OperationError("Worley (vips_worley) failed".to_string()),
17879        )
17880    }
17881
17882    /// VipsWorley (worley), make a worley noise image
17883    /// returns `VipsImage` - Output image
17884    ///
17885    /// width: `i32` -> Image width in pixels
17886    ///
17887    /// height: `i32` -> Image height in pixels
17888    ///
17889    /// <ins>Optional arguments</ins>
17890    ///
17891    /// cell_size: `i32` -> Size of Worley cells
17892    ///
17893    /// seed: `i32` -> Random number seed
17894    pub fn worley_with_opts(width: i32, height: i32, option: VOption) -> Result<VipsImage> {
17895        let mut out_out = VipsImage::from(null_mut());
17896        let vips_op_response = call(
17897            "worley",
17898            option
17899                .set(
17900                    "out",
17901                    &mut out_out,
17902                )
17903                .set(
17904                    "width",
17905                    width,
17906                )
17907                .set(
17908                    "height",
17909                    height,
17910                ),
17911        );
17912
17913        utils::result(
17914            vips_op_response,
17915            out_out,
17916            Error::OperationError("Worley (vips_worley) failed".to_string()),
17917        )
17918    }
17919
17920    /// VipsWrap (wrap), wrap image origin
17921    /// returns `VipsImage` - Output image
17922    pub fn wrap(&self) -> Result<VipsImage> {
17923        let mut out_out = VipsImage::from(null_mut());
17924        let vips_op_response = call(
17925            "wrap",
17926            VOption::new()
17927                .set("in", self)
17928                .set(
17929                    "out",
17930                    &mut out_out,
17931                ),
17932        );
17933
17934        utils::result(
17935            vips_op_response,
17936            out_out,
17937            Error::OperationError("Wrap (vips_wrap) failed".to_string()),
17938        )
17939    }
17940
17941    /// VipsWrap (wrap), wrap image origin
17942    /// returns `VipsImage` - Output image
17943    ///
17944    /// <ins>Optional arguments</ins>
17945    ///
17946    /// x: `i32` -> Left edge of input in output
17947    ///
17948    /// y: `i32` -> Top edge of input in output
17949    pub fn wrap_with_opts(&self, option: VOption) -> Result<VipsImage> {
17950        let mut out_out = VipsImage::from(null_mut());
17951        let vips_op_response = call(
17952            "wrap",
17953            option
17954                .set("in", self)
17955                .set(
17956                    "out",
17957                    &mut out_out,
17958                ),
17959        );
17960
17961        utils::result(
17962            vips_op_response,
17963            out_out,
17964            Error::OperationError("Wrap (vips_wrap) failed".to_string()),
17965        )
17966    }
17967
17968    /// VipsXyz (xyz), make an image where pixel values are coordinates
17969    /// returns `VipsImage` - Output image
17970    ///
17971    /// width: `i32` -> Image width in pixels
17972    ///
17973    /// height: `i32` -> Image height in pixels
17974    pub fn xyz(width: i32, height: i32) -> Result<VipsImage> {
17975        let mut out_out = VipsImage::from(null_mut());
17976        let vips_op_response = call(
17977            "xyz",
17978            VOption::new()
17979                .set(
17980                    "out",
17981                    &mut out_out,
17982                )
17983                .set(
17984                    "width",
17985                    width,
17986                )
17987                .set(
17988                    "height",
17989                    height,
17990                ),
17991        );
17992
17993        utils::result(
17994            vips_op_response,
17995            out_out,
17996            Error::OperationError("Xyz (vips_xyz) failed".to_string()),
17997        )
17998    }
17999
18000    /// VipsXyz (xyz), make an image where pixel values are coordinates
18001    /// returns `VipsImage` - Output image
18002    ///
18003    /// width: `i32` -> Image width in pixels
18004    ///
18005    /// height: `i32` -> Image height in pixels
18006    ///
18007    /// <ins>Optional arguments</ins>
18008    ///
18009    /// csize: `i32` -> Size of third dimension
18010    ///
18011    /// dsize: `i32` -> Size of fourth dimension
18012    ///
18013    /// esize: `i32` -> Size of fifth dimension
18014    pub fn xyz_with_opts(width: i32, height: i32, option: VOption) -> Result<VipsImage> {
18015        let mut out_out = VipsImage::from(null_mut());
18016        let vips_op_response = call(
18017            "xyz",
18018            option
18019                .set(
18020                    "out",
18021                    &mut out_out,
18022                )
18023                .set(
18024                    "width",
18025                    width,
18026                )
18027                .set(
18028                    "height",
18029                    height,
18030                ),
18031        );
18032
18033        utils::result(
18034            vips_op_response,
18035            out_out,
18036            Error::OperationError("Xyz (vips_xyz) failed".to_string()),
18037        )
18038    }
18039
18040    /// VipsZone (zone), make a zone plate
18041    /// returns `VipsImage` - Output image
18042    ///
18043    /// width: `i32` -> Image width in pixels
18044    ///
18045    /// height: `i32` -> Image height in pixels
18046    pub fn zone(width: i32, height: i32) -> Result<VipsImage> {
18047        let mut out_out = VipsImage::from(null_mut());
18048        let vips_op_response = call(
18049            "zone",
18050            VOption::new()
18051                .set(
18052                    "out",
18053                    &mut out_out,
18054                )
18055                .set(
18056                    "width",
18057                    width,
18058                )
18059                .set(
18060                    "height",
18061                    height,
18062                ),
18063        );
18064
18065        utils::result(
18066            vips_op_response,
18067            out_out,
18068            Error::OperationError("Zone (vips_zone) failed".to_string()),
18069        )
18070    }
18071
18072    /// VipsZone (zone), make a zone plate
18073    /// returns `VipsImage` - Output image
18074    ///
18075    /// width: `i32` -> Image width in pixels
18076    ///
18077    /// height: `i32` -> Image height in pixels
18078    ///
18079    /// <ins>Optional arguments</ins>
18080    ///
18081    /// uchar: `bool` -> Output an unsigned char image
18082    pub fn zone_with_opts(width: i32, height: i32, option: VOption) -> Result<VipsImage> {
18083        let mut out_out = VipsImage::from(null_mut());
18084        let vips_op_response = call(
18085            "zone",
18086            option
18087                .set(
18088                    "out",
18089                    &mut out_out,
18090                )
18091                .set(
18092                    "width",
18093                    width,
18094                )
18095                .set(
18096                    "height",
18097                    height,
18098                ),
18099        );
18100
18101        utils::result(
18102            vips_op_response,
18103            out_out,
18104            Error::OperationError("Zone (vips_zone) failed".to_string()),
18105        )
18106    }
18107
18108    /// VipsZoom (zoom), zoom an image
18109    /// returns `VipsImage` - Output image
18110    ///
18111    /// xfac: `i32` -> Horizontal zoom factor
18112    ///
18113    /// yfac: `i32` -> Vertical zoom factor
18114    pub fn zoom(&self, xfac: i32, yfac: i32) -> Result<VipsImage> {
18115        let mut out_out = VipsImage::from(null_mut());
18116        let vips_op_response = call(
18117            "zoom",
18118            VOption::new()
18119                .set(
18120                    "input",
18121                    self,
18122                )
18123                .set(
18124                    "out",
18125                    &mut out_out,
18126                )
18127                .set(
18128                    "xfac",
18129                    xfac,
18130                )
18131                .set(
18132                    "yfac",
18133                    yfac,
18134                ),
18135        );
18136
18137        utils::result(
18138            vips_op_response,
18139            out_out,
18140            Error::OperationError("Zoom (vips_zoom) failed".to_string()),
18141        )
18142    }
18143
18144    // Alias for operator overload
18145    pub(crate) fn add_image(&self, right: &VipsImage) -> Result<VipsImage> {
18146        self.add(right)
18147    }
18148
18149    /// VipsBandjoin (bandjoin), bandwise join two images
18150    /// returns `VipsImage` - Output image
18151    ///
18152    /// other: `VipsImage` -> Input images
18153    pub fn bandjoin_with(self, other: VipsImage) -> Result<VipsImage> {
18154        Self::bandjoin(&[self, other])
18155    }
18156
18157    /// VipsMedian (median), median filter of the specified size.
18158    pub fn median(&self, size: i32) -> Result<VipsImage> {
18159        self.rank(
18160            size,
18161            size,
18162            (size * size) / 2,
18163        )
18164    }
18165}