rs_vips/
ops.rs

1#![allow(clippy::too_many_arguments)]
2#![allow(clippy::upper_case_acronyms)]
3use crate::bindings::{vips_area_unref, vips_blob_new};
4use crate::connection::VipsSource;
5use crate::connection::VipsTarget;
6use crate::error::*;
7use crate::region::VipsBlob;
8use crate::utils;
9use crate::voption::{call, Setter, VOption};
10use crate::Result;
11use crate::VipsImage;
12use std::ffi::c_void;
13use std::ptr::null_mut;
14
15const NULL: *const c_void = null_mut();
16
17#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
18pub enum Access {
19    ///  `Random` -> VIPS_ACCESS_RANDOM = 0
20    Random = 0,
21    ///  `Sequential` -> VIPS_ACCESS_SEQUENTIAL = 1
22    Sequential = 1,
23    ///  `SequentialUnbuffered` -> VIPS_ACCESS_SEQUENTIAL_UNBUFFERED = 2
24    SequentialUnbuffered = 2,
25    ///  `Last` -> VIPS_ACCESS_LAST = 3
26    Last = 3,
27}
28
29#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
30pub enum Align {
31    ///  `Low` -> VIPS_ALIGN_LOW = 0
32    Low = 0,
33    ///  `Centre` -> VIPS_ALIGN_CENTRE = 1
34    Centre = 1,
35    ///  `High` -> VIPS_ALIGN_HIGH = 2
36    High = 2,
37    ///  `Last` -> VIPS_ALIGN_LAST = 3
38    Last = 3,
39}
40
41#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
42pub enum Angle {
43    ///  `D0` -> VIPS_ANGLE_D0 = 0
44    D0 = 0,
45    ///  `D90` -> VIPS_ANGLE_D90 = 1
46    D90 = 1,
47    ///  `D180` -> VIPS_ANGLE_D180 = 2
48    D180 = 2,
49    ///  `D270` -> VIPS_ANGLE_D270 = 3
50    D270 = 3,
51    ///  `Last` -> VIPS_ANGLE_LAST = 4
52    Last = 4,
53}
54
55#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
56pub enum Angle45 {
57    ///  `D0` -> VIPS_ANGLE45_D0 = 0
58    D0 = 0,
59    ///  `D45` -> VIPS_ANGLE45_D45 = 1
60    D45 = 1,
61    ///  `D90` -> VIPS_ANGLE45_D90 = 2
62    D90 = 2,
63    ///  `D135` -> VIPS_ANGLE45_D135 = 3
64    D135 = 3,
65    ///  `D180` -> VIPS_ANGLE45_D180 = 4
66    D180 = 4,
67    ///  `D225` -> VIPS_ANGLE45_D225 = 5
68    D225 = 5,
69    ///  `D270` -> VIPS_ANGLE45_D270 = 6
70    D270 = 6,
71    ///  `D315` -> VIPS_ANGLE45_D315 = 7
72    D315 = 7,
73    ///  `Last` -> VIPS_ANGLE45_LAST = 8
74    Last = 8,
75}
76
77#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
78pub enum BandFormat {
79    ///  `Notset` -> VIPS_FORMAT_NOTSET = -1
80    Notset = -1,
81    ///  `Uchar` -> VIPS_FORMAT_UCHAR = 0
82    Uchar = 0,
83    ///  `Char` -> VIPS_FORMAT_CHAR = 1
84    Char = 1,
85    ///  `Ushort` -> VIPS_FORMAT_USHORT = 2
86    Ushort = 2,
87    ///  `Short` -> VIPS_FORMAT_SHORT = 3
88    Short = 3,
89    ///  `Uint` -> VIPS_FORMAT_UINT = 4
90    Uint = 4,
91    ///  `Int` -> VIPS_FORMAT_INT = 5
92    Int = 5,
93    ///  `Float` -> VIPS_FORMAT_FLOAT = 6
94    Float = 6,
95    ///  `Complex` -> VIPS_FORMAT_COMPLEX = 7
96    Complex = 7,
97    ///  `Double` -> VIPS_FORMAT_DOUBLE = 8
98    Double = 8,
99    ///  `Dpcomplex` -> VIPS_FORMAT_DPCOMPLEX = 9
100    Dpcomplex = 9,
101    ///  `Last` -> VIPS_FORMAT_LAST = 10
102    Last = 10,
103}
104
105#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
106pub enum BlendMode {
107    ///  `Clear` -> VIPS_BLEND_MODE_CLEAR = 0
108    Clear = 0,
109    ///  `Source` -> VIPS_BLEND_MODE_SOURCE = 1
110    Source = 1,
111    ///  `Over` -> VIPS_BLEND_MODE_OVER = 2
112    Over = 2,
113    ///  `In` -> VIPS_BLEND_MODE_IN = 3
114    In = 3,
115    ///  `Out` -> VIPS_BLEND_MODE_OUT = 4
116    Out = 4,
117    ///  `Atop` -> VIPS_BLEND_MODE_ATOP = 5
118    Atop = 5,
119    ///  `Dest` -> VIPS_BLEND_MODE_DEST = 6
120    Dest = 6,
121    ///  `DestOver` -> VIPS_BLEND_MODE_DEST_OVER = 7
122    DestOver = 7,
123    ///  `DestIn` -> VIPS_BLEND_MODE_DEST_IN = 8
124    DestIn = 8,
125    ///  `DestOut` -> VIPS_BLEND_MODE_DEST_OUT = 9
126    DestOut = 9,
127    ///  `DestAtop` -> VIPS_BLEND_MODE_DEST_ATOP = 10
128    DestAtop = 10,
129    ///  `Xor` -> VIPS_BLEND_MODE_XOR = 11
130    Xor = 11,
131    ///  `Add` -> VIPS_BLEND_MODE_ADD = 12
132    Add = 12,
133    ///  `Saturate` -> VIPS_BLEND_MODE_SATURATE = 13
134    Saturate = 13,
135    ///  `Multiply` -> VIPS_BLEND_MODE_MULTIPLY = 14
136    Multiply = 14,
137    ///  `Screen` -> VIPS_BLEND_MODE_SCREEN = 15
138    Screen = 15,
139    ///  `Overlay` -> VIPS_BLEND_MODE_OVERLAY = 16
140    Overlay = 16,
141    ///  `Darken` -> VIPS_BLEND_MODE_DARKEN = 17
142    Darken = 17,
143    ///  `Lighten` -> VIPS_BLEND_MODE_LIGHTEN = 18
144    Lighten = 18,
145    ///  `ColourDodge` -> VIPS_BLEND_MODE_COLOUR_DODGE = 19
146    ColourDodge = 19,
147    ///  `ColourBurn` -> VIPS_BLEND_MODE_COLOUR_BURN = 20
148    ColourBurn = 20,
149    ///  `HardLight` -> VIPS_BLEND_MODE_HARD_LIGHT = 21
150    HardLight = 21,
151    ///  `SoftLight` -> VIPS_BLEND_MODE_SOFT_LIGHT = 22
152    SoftLight = 22,
153    ///  `Difference` -> VIPS_BLEND_MODE_DIFFERENCE = 23
154    Difference = 23,
155    ///  `Exclusion` -> VIPS_BLEND_MODE_EXCLUSION = 24
156    Exclusion = 24,
157    ///  `Last` -> VIPS_BLEND_MODE_LAST = 25
158    Last = 25,
159}
160
161#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
162pub enum Coding {
163    ///  `Error` -> VIPS_CODING_ERROR = -1
164    Error = -1,
165    ///  `None` -> VIPS_CODING_NONE = 0
166    None = 0,
167    ///  `Labq` -> VIPS_CODING_LABQ = 2
168    Labq = 2,
169    ///  `Rad` -> VIPS_CODING_RAD = 6
170    Rad = 6,
171    ///  `Last` -> VIPS_CODING_LAST = 7
172    Last = 7,
173}
174
175#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
176pub enum Combine {
177    ///  `Max` -> VIPS_COMBINE_MAX = 0
178    Max = 0,
179    ///  `Sum` -> VIPS_COMBINE_SUM = 1
180    Sum = 1,
181    ///  `Min` -> VIPS_COMBINE_MIN = 2
182    Min = 2,
183    ///  `Last` -> VIPS_COMBINE_LAST = 3
184    Last = 3,
185}
186
187#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
188pub enum CombineMode {
189    ///  `Set` -> VIPS_COMBINE_MODE_SET = 0
190    Set = 0,
191    ///  `Add` -> VIPS_COMBINE_MODE_ADD = 1
192    Add = 1,
193    ///  `Last` -> VIPS_COMBINE_MODE_LAST = 2
194    Last = 2,
195}
196
197#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
198pub enum CompassDirection {
199    ///  `Centre` -> VIPS_COMPASS_DIRECTION_CENTRE = 0
200    Centre = 0,
201    ///  `North` -> VIPS_COMPASS_DIRECTION_NORTH = 1
202    North = 1,
203    ///  `East` -> VIPS_COMPASS_DIRECTION_EAST = 2
204    East = 2,
205    ///  `South` -> VIPS_COMPASS_DIRECTION_SOUTH = 3
206    South = 3,
207    ///  `West` -> VIPS_COMPASS_DIRECTION_WEST = 4
208    West = 4,
209    ///  `NorthEast` -> VIPS_COMPASS_DIRECTION_NORTH_EAST = 5
210    NorthEast = 5,
211    ///  `SouthEast` -> VIPS_COMPASS_DIRECTION_SOUTH_EAST = 6
212    SouthEast = 6,
213    ///  `SouthWest` -> VIPS_COMPASS_DIRECTION_SOUTH_WEST = 7
214    SouthWest = 7,
215    ///  `NorthWest` -> VIPS_COMPASS_DIRECTION_NORTH_WEST = 8
216    NorthWest = 8,
217    ///  `Last` -> VIPS_COMPASS_DIRECTION_LAST = 9
218    Last = 9,
219}
220
221#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
222pub enum Direction {
223    ///  `Horizontal` -> VIPS_DIRECTION_HORIZONTAL = 0
224    Horizontal = 0,
225    ///  `Vertical` -> VIPS_DIRECTION_VERTICAL = 1
226    Vertical = 1,
227    ///  `Last` -> VIPS_DIRECTION_LAST = 2
228    Last = 2,
229}
230
231#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
232pub enum Extend {
233    ///  `Black` -> VIPS_EXTEND_BLACK = 0
234    Black = 0,
235    ///  `Copy` -> VIPS_EXTEND_COPY = 1
236    Copy = 1,
237    ///  `Repeat` -> VIPS_EXTEND_REPEAT = 2
238    Repeat = 2,
239    ///  `Mirror` -> VIPS_EXTEND_MIRROR = 3
240    Mirror = 3,
241    ///  `White` -> VIPS_EXTEND_WHITE = 4
242    White = 4,
243    ///  `Background` -> VIPS_EXTEND_BACKGROUND = 5
244    Background = 5,
245    ///  `Last` -> VIPS_EXTEND_LAST = 6
246    Last = 6,
247}
248
249#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
250pub enum FailOn {
251    ///  `None` -> VIPS_FAIL_ON_NONE = 0
252    None = 0,
253    ///  `Truncated` -> VIPS_FAIL_ON_TRUNCATED = 1
254    Truncated = 1,
255    ///  `Error` -> VIPS_FAIL_ON_ERROR = 2
256    Error = 2,
257    ///  `Warning` -> VIPS_FAIL_ON_WARNING = 3
258    Warning = 3,
259    ///  `Last` -> VIPS_FAIL_ON_LAST = 4
260    Last = 4,
261}
262
263#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
264pub enum ForeignDzContainer {
265    ///  `Fs` -> VIPS_FOREIGN_DZ_CONTAINER_FS = 0
266    Fs = 0,
267    ///  `Zip` -> VIPS_FOREIGN_DZ_CONTAINER_ZIP = 1
268    Zip = 1,
269    ///  `Szi` -> VIPS_FOREIGN_DZ_CONTAINER_SZI = 2
270    Szi = 2,
271    ///  `Last` -> VIPS_FOREIGN_DZ_CONTAINER_LAST = 3
272    Last = 3,
273}
274
275#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
276pub enum ForeignDzDepth {
277    ///  `Onepixel` -> VIPS_FOREIGN_DZ_DEPTH_ONEPIXEL = 0
278    Onepixel = 0,
279    ///  `Onetile` -> VIPS_FOREIGN_DZ_DEPTH_ONETILE = 1
280    Onetile = 1,
281    ///  `One` -> VIPS_FOREIGN_DZ_DEPTH_ONE = 2
282    One = 2,
283    ///  `Last` -> VIPS_FOREIGN_DZ_DEPTH_LAST = 3
284    Last = 3,
285}
286
287#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
288pub enum ForeignDzLayout {
289    ///  `Dz` -> VIPS_FOREIGN_DZ_LAYOUT_DZ = 0
290    Dz = 0,
291    ///  `Zoomify` -> VIPS_FOREIGN_DZ_LAYOUT_ZOOMIFY = 1
292    Zoomify = 1,
293    ///  `Google` -> VIPS_FOREIGN_DZ_LAYOUT_GOOGLE = 2
294    Google = 2,
295    ///  `Iiif` -> VIPS_FOREIGN_DZ_LAYOUT_IIIF = 3
296    Iiif = 3,
297    ///  `Iiif3` -> VIPS_FOREIGN_DZ_LAYOUT_IIIF3 = 4
298    Iiif3 = 4,
299    ///  `Last` -> VIPS_FOREIGN_DZ_LAYOUT_LAST = 5
300    Last = 5,
301}
302
303#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
304pub enum ForeignFlags {
305    ///  `None` -> VIPS_FOREIGN_NONE = 0
306    None = 0,
307    ///  `Partial` -> VIPS_FOREIGN_PARTIAL = 1
308    Partial = 1,
309    ///  `Bigendian` -> VIPS_FOREIGN_BIGENDIAN = 2
310    Bigendian = 2,
311    ///  `Sequential` -> VIPS_FOREIGN_SEQUENTIAL = 4
312    Sequential = 4,
313    ///  `All` -> VIPS_FOREIGN_ALL = 7
314    All = 7,
315}
316
317#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
318pub enum ForeignHeifCompression {
319    ///  `Hevc` -> VIPS_FOREIGN_HEIF_COMPRESSION_HEVC = 1
320    Hevc = 1,
321    ///  `Avc` -> VIPS_FOREIGN_HEIF_COMPRESSION_AVC = 2
322    Avc = 2,
323    ///  `Jpeg` -> VIPS_FOREIGN_HEIF_COMPRESSION_JPEG = 3
324    Jpeg = 3,
325    ///  `Av1` -> VIPS_FOREIGN_HEIF_COMPRESSION_AV1 = 4
326    Av1 = 4,
327    ///  `Last` -> VIPS_FOREIGN_HEIF_COMPRESSION_LAST = 5
328    Last = 5,
329}
330
331#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
332pub enum ForeignHeifEncoder {
333    ///  `Auto` -> VIPS_FOREIGN_HEIF_ENCODER_AUTO = 0
334    Auto = 0,
335    ///  `Aom` -> VIPS_FOREIGN_HEIF_ENCODER_AOM = 1
336    Aom = 1,
337    ///  `Rav1E` -> VIPS_FOREIGN_HEIF_ENCODER_RAV1E = 2
338    Rav1E = 2,
339    ///  `Svt` -> VIPS_FOREIGN_HEIF_ENCODER_SVT = 3
340    Svt = 3,
341    ///  `X265` -> VIPS_FOREIGN_HEIF_ENCODER_X265 = 4
342    X265 = 4,
343    ///  `Last` -> VIPS_FOREIGN_HEIF_ENCODER_LAST = 5
344    Last = 5,
345}
346
347#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
348pub enum ForeignKeep {
349    ///  `None` -> VIPS_FOREIGN_KEEP_NONE = 0
350    None = 0,
351    ///  `Exif` -> VIPS_FOREIGN_KEEP_EXIF = 1
352    Exif = 1,
353    ///  `Xmp` -> VIPS_FOREIGN_KEEP_XMP = 2
354    Xmp = 2,
355    ///  `Iptc` -> VIPS_FOREIGN_KEEP_IPTC = 4
356    Iptc = 4,
357    ///  `Icc` -> VIPS_FOREIGN_KEEP_ICC = 8
358    Icc = 8,
359    ///  `Other` -> VIPS_FOREIGN_KEEP_OTHER = 16
360    Other = 16,
361    ///  `All` -> VIPS_FOREIGN_KEEP_ALL = 31
362    All = 31,
363}
364
365#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
366pub enum ForeignPngFilter {
367    ///  `None` -> VIPS_FOREIGN_PNG_FILTER_NONE = 8
368    None = 8,
369    ///  `Sub` -> VIPS_FOREIGN_PNG_FILTER_SUB = 16
370    Sub = 16,
371    ///  `Up` -> VIPS_FOREIGN_PNG_FILTER_UP = 32
372    Up = 32,
373    ///  `Avg` -> VIPS_FOREIGN_PNG_FILTER_AVG = 64
374    Avg = 64,
375    ///  `Paeth` -> VIPS_FOREIGN_PNG_FILTER_PAETH = 128
376    Paeth = 128,
377    ///  `All` -> VIPS_FOREIGN_PNG_FILTER_ALL = 248
378    All = 248,
379}
380
381#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
382pub enum ForeignPpmFormat {
383    ///  `Pbm` -> VIPS_FOREIGN_PPM_FORMAT_PBM = 0
384    Pbm = 0,
385    ///  `Pgm` -> VIPS_FOREIGN_PPM_FORMAT_PGM = 1
386    Pgm = 1,
387    ///  `Ppm` -> VIPS_FOREIGN_PPM_FORMAT_PPM = 2
388    Ppm = 2,
389    ///  `Pfm` -> VIPS_FOREIGN_PPM_FORMAT_PFM = 3
390    Pfm = 3,
391    ///  `Pnm` -> VIPS_FOREIGN_PPM_FORMAT_PNM = 4
392    Pnm = 4,
393    ///  `Last` -> VIPS_FOREIGN_PPM_FORMAT_LAST = 5
394    Last = 5,
395}
396
397#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
398pub enum ForeignSubsample {
399    ///  `Auto` -> VIPS_FOREIGN_SUBSAMPLE_AUTO = 0
400    Auto = 0,
401    ///  `On` -> VIPS_FOREIGN_SUBSAMPLE_ON = 1
402    On = 1,
403    ///  `Off` -> VIPS_FOREIGN_SUBSAMPLE_OFF = 2
404    Off = 2,
405    ///  `Last` -> VIPS_FOREIGN_SUBSAMPLE_LAST = 3
406    Last = 3,
407}
408
409#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
410pub enum ForeignTiffCompression {
411    ///  `None` -> VIPS_FOREIGN_TIFF_COMPRESSION_NONE = 0
412    None = 0,
413    ///  `Jpeg` -> VIPS_FOREIGN_TIFF_COMPRESSION_JPEG = 1
414    Jpeg = 1,
415    ///  `Deflate` -> VIPS_FOREIGN_TIFF_COMPRESSION_DEFLATE = 2
416    Deflate = 2,
417    ///  `Packbits` -> VIPS_FOREIGN_TIFF_COMPRESSION_PACKBITS = 3
418    Packbits = 3,
419    ///  `Ccittfax4` -> VIPS_FOREIGN_TIFF_COMPRESSION_CCITTFAX4 = 4
420    Ccittfax4 = 4,
421    ///  `Lzw` -> VIPS_FOREIGN_TIFF_COMPRESSION_LZW = 5
422    Lzw = 5,
423    ///  `Webp` -> VIPS_FOREIGN_TIFF_COMPRESSION_WEBP = 6
424    Webp = 6,
425    ///  `Zstd` -> VIPS_FOREIGN_TIFF_COMPRESSION_ZSTD = 7
426    Zstd = 7,
427    ///  `Jp2K` -> VIPS_FOREIGN_TIFF_COMPRESSION_JP2K = 8
428    Jp2K = 8,
429    ///  `Last` -> VIPS_FOREIGN_TIFF_COMPRESSION_LAST = 9
430    Last = 9,
431}
432
433#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
434pub enum ForeignTiffPredictor {
435    ///  `None` -> VIPS_FOREIGN_TIFF_PREDICTOR_NONE = 1
436    None = 1,
437    ///  `Horizontal` -> VIPS_FOREIGN_TIFF_PREDICTOR_HORIZONTAL = 2
438    Horizontal = 2,
439    ///  `Float` -> VIPS_FOREIGN_TIFF_PREDICTOR_FLOAT = 3
440    Float = 3,
441    ///  `Last` -> VIPS_FOREIGN_TIFF_PREDICTOR_LAST = 4
442    Last = 4,
443}
444
445#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
446pub enum ForeignTiffResunit {
447    ///  `Cm` -> VIPS_FOREIGN_TIFF_RESUNIT_CM = 0
448    Cm = 0,
449    ///  `Inch` -> VIPS_FOREIGN_TIFF_RESUNIT_INCH = 1
450    Inch = 1,
451    ///  `Last` -> VIPS_FOREIGN_TIFF_RESUNIT_LAST = 2
452    Last = 2,
453}
454
455#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
456pub enum ForeignWebpPreset {
457    ///  `Default` -> VIPS_FOREIGN_WEBP_PRESET_DEFAULT = 0
458    Default = 0,
459    ///  `Picture` -> VIPS_FOREIGN_WEBP_PRESET_PICTURE = 1
460    Picture = 1,
461    ///  `Photo` -> VIPS_FOREIGN_WEBP_PRESET_PHOTO = 2
462    Photo = 2,
463    ///  `Drawing` -> VIPS_FOREIGN_WEBP_PRESET_DRAWING = 3
464    Drawing = 3,
465    ///  `Icon` -> VIPS_FOREIGN_WEBP_PRESET_ICON = 4
466    Icon = 4,
467    ///  `Text` -> VIPS_FOREIGN_WEBP_PRESET_TEXT = 5
468    Text = 5,
469    ///  `Last` -> VIPS_FOREIGN_WEBP_PRESET_LAST = 6
470    Last = 6,
471}
472
473#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
474pub enum Intent {
475    ///  `Perceptual` -> VIPS_INTENT_PERCEPTUAL = 0
476    Perceptual = 0,
477    ///  `Relative` -> VIPS_INTENT_RELATIVE = 1
478    Relative = 1,
479    ///  `Saturation` -> VIPS_INTENT_SATURATION = 2
480    Saturation = 2,
481    ///  `Absolute` -> VIPS_INTENT_ABSOLUTE = 3
482    Absolute = 3,
483    ///  `Auto` -> VIPS_INTENT_AUTO = 32
484    Auto = 32,
485    ///  `Last` -> VIPS_INTENT_LAST = 33
486    Last = 33,
487}
488
489#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
490pub enum Interesting {
491    ///  `None` -> VIPS_INTERESTING_NONE = 0
492    None = 0,
493    ///  `Centre` -> VIPS_INTERESTING_CENTRE = 1
494    Centre = 1,
495    ///  `Entropy` -> VIPS_INTERESTING_ENTROPY = 2
496    Entropy = 2,
497    ///  `Attention` -> VIPS_INTERESTING_ATTENTION = 3
498    Attention = 3,
499    ///  `Low` -> VIPS_INTERESTING_LOW = 4
500    Low = 4,
501    ///  `High` -> VIPS_INTERESTING_HIGH = 5
502    High = 5,
503    ///  `All` -> VIPS_INTERESTING_ALL = 6
504    All = 6,
505    ///  `Last` -> VIPS_INTERESTING_LAST = 7
506    Last = 7,
507}
508
509#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
510pub enum Interpretation {
511    ///  `Error` -> VIPS_INTERPRETATION_ERROR = -1
512    Error = -1,
513    ///  `Multiband` -> VIPS_INTERPRETATION_MULTIBAND = 0
514    Multiband = 0,
515    ///  `BW` -> VIPS_INTERPRETATION_B_W = 1
516    BW = 1,
517    ///  `Histogram` -> VIPS_INTERPRETATION_HISTOGRAM = 10
518    Histogram = 10,
519    ///  `Xyz` -> VIPS_INTERPRETATION_XYZ = 12
520    Xyz = 12,
521    ///  `Lab` -> VIPS_INTERPRETATION_LAB = 13
522    Lab = 13,
523    ///  `Cmyk` -> VIPS_INTERPRETATION_CMYK = 15
524    Cmyk = 15,
525    ///  `Labq` -> VIPS_INTERPRETATION_LABQ = 16
526    Labq = 16,
527    ///  `Rgb` -> VIPS_INTERPRETATION_RGB = 17
528    Rgb = 17,
529    ///  `Cmc` -> VIPS_INTERPRETATION_CMC = 18
530    Cmc = 18,
531    ///  `Lch` -> VIPS_INTERPRETATION_LCH = 19
532    Lch = 19,
533    ///  `Labs` -> VIPS_INTERPRETATION_LABS = 21
534    Labs = 21,
535    ///  `Srgb` -> VIPS_INTERPRETATION_sRGB = 22
536    Srgb = 22,
537    ///  `Yxy` -> VIPS_INTERPRETATION_YXY = 23
538    Yxy = 23,
539    ///  `Fourier` -> VIPS_INTERPRETATION_FOURIER = 24
540    Fourier = 24,
541    ///  `Rgb16` -> VIPS_INTERPRETATION_RGB16 = 25
542    Rgb16 = 25,
543    ///  `Grey16` -> VIPS_INTERPRETATION_GREY16 = 26
544    Grey16 = 26,
545    ///  `Matrix` -> VIPS_INTERPRETATION_MATRIX = 27
546    Matrix = 27,
547    ///  `Scrgb` -> VIPS_INTERPRETATION_scRGB = 28
548    Scrgb = 28,
549    ///  `Hsv` -> VIPS_INTERPRETATION_HSV = 29
550    Hsv = 29,
551    ///  `Last` -> VIPS_INTERPRETATION_LAST = 30
552    Last = 30,
553}
554
555#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
556pub enum Kernel {
557    ///  `Nearest` -> VIPS_KERNEL_NEAREST = 0
558    Nearest = 0,
559    ///  `Linear` -> VIPS_KERNEL_LINEAR = 1
560    Linear = 1,
561    ///  `Cubic` -> VIPS_KERNEL_CUBIC = 2
562    Cubic = 2,
563    ///  `Mitchell` -> VIPS_KERNEL_MITCHELL = 3
564    Mitchell = 3,
565    ///  `Lanczos2` -> VIPS_KERNEL_LANCZOS2 = 4
566    Lanczos2 = 4,
567    ///  `Lanczos3` -> VIPS_KERNEL_LANCZOS3 = 5
568    Lanczos3 = 5,
569    ///  `Mks2013` -> VIPS_KERNEL_MKS2013 = 6
570    Mks2013 = 6,
571    ///  `Mks2021` -> VIPS_KERNEL_MKS2021 = 7
572    Mks2021 = 7,
573    ///  `Last` -> VIPS_KERNEL_LAST = 8
574    Last = 8,
575}
576
577#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
578pub enum OperationBoolean {
579    ///  `And` -> VIPS_OPERATION_BOOLEAN_AND = 0
580    And = 0,
581    ///  `Or` -> VIPS_OPERATION_BOOLEAN_OR = 1
582    Or = 1,
583    ///  `Eor` -> VIPS_OPERATION_BOOLEAN_EOR = 2
584    Eor = 2,
585    ///  `Lshift` -> VIPS_OPERATION_BOOLEAN_LSHIFT = 3
586    Lshift = 3,
587    ///  `Rshift` -> VIPS_OPERATION_BOOLEAN_RSHIFT = 4
588    Rshift = 4,
589    ///  `Last` -> VIPS_OPERATION_BOOLEAN_LAST = 5
590    Last = 5,
591}
592
593#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
594pub enum OperationComplex {
595    ///  `Polar` -> VIPS_OPERATION_COMPLEX_POLAR = 0
596    Polar = 0,
597    ///  `Rect` -> VIPS_OPERATION_COMPLEX_RECT = 1
598    Rect = 1,
599    ///  `Conj` -> VIPS_OPERATION_COMPLEX_CONJ = 2
600    Conj = 2,
601    ///  `Last` -> VIPS_OPERATION_COMPLEX_LAST = 3
602    Last = 3,
603}
604
605#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
606pub enum OperationComplex2 {
607    ///  `CrossPhase` -> VIPS_OPERATION_COMPLEX2_CROSS_PHASE = 0
608    CrossPhase = 0,
609    ///  `Last` -> VIPS_OPERATION_COMPLEX2_LAST = 1
610    Last = 1,
611}
612
613#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
614pub enum OperationComplexget {
615    ///  `Real` -> VIPS_OPERATION_COMPLEXGET_REAL = 0
616    Real = 0,
617    ///  `Imag` -> VIPS_OPERATION_COMPLEXGET_IMAG = 1
618    Imag = 1,
619    ///  `Last` -> VIPS_OPERATION_COMPLEXGET_LAST = 2
620    Last = 2,
621}
622
623#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
624pub enum OperationMath {
625    ///  `Sin` -> VIPS_OPERATION_MATH_SIN = 0
626    Sin = 0,
627    ///  `Cos` -> VIPS_OPERATION_MATH_COS = 1
628    Cos = 1,
629    ///  `Tan` -> VIPS_OPERATION_MATH_TAN = 2
630    Tan = 2,
631    ///  `Asin` -> VIPS_OPERATION_MATH_ASIN = 3
632    Asin = 3,
633    ///  `Acos` -> VIPS_OPERATION_MATH_ACOS = 4
634    Acos = 4,
635    ///  `Atan` -> VIPS_OPERATION_MATH_ATAN = 5
636    Atan = 5,
637    ///  `Log` -> VIPS_OPERATION_MATH_LOG = 6
638    Log = 6,
639    ///  `Log10` -> VIPS_OPERATION_MATH_LOG10 = 7
640    Log10 = 7,
641    ///  `Exp` -> VIPS_OPERATION_MATH_EXP = 8
642    Exp = 8,
643    ///  `Exp10` -> VIPS_OPERATION_MATH_EXP10 = 9
644    Exp10 = 9,
645    ///  `Sinh` -> VIPS_OPERATION_MATH_SINH = 10
646    Sinh = 10,
647    ///  `Cosh` -> VIPS_OPERATION_MATH_COSH = 11
648    Cosh = 11,
649    ///  `Tanh` -> VIPS_OPERATION_MATH_TANH = 12
650    Tanh = 12,
651    ///  `Asinh` -> VIPS_OPERATION_MATH_ASINH = 13
652    Asinh = 13,
653    ///  `Acosh` -> VIPS_OPERATION_MATH_ACOSH = 14
654    Acosh = 14,
655    ///  `Atanh` -> VIPS_OPERATION_MATH_ATANH = 15
656    Atanh = 15,
657    ///  `Last` -> VIPS_OPERATION_MATH_LAST = 16
658    Last = 16,
659}
660
661#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
662pub enum OperationMath2 {
663    ///  `Pow` -> VIPS_OPERATION_MATH2_POW = 0
664    Pow = 0,
665    ///  `Wop` -> VIPS_OPERATION_MATH2_WOP = 1
666    Wop = 1,
667    ///  `Atan2` -> VIPS_OPERATION_MATH2_ATAN2 = 2
668    Atan2 = 2,
669    ///  `Last` -> VIPS_OPERATION_MATH2_LAST = 3
670    Last = 3,
671}
672
673#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
674pub enum OperationMorphology {
675    ///  `Erode` -> VIPS_OPERATION_MORPHOLOGY_ERODE = 0
676    Erode = 0,
677    ///  `Dilate` -> VIPS_OPERATION_MORPHOLOGY_DILATE = 1
678    Dilate = 1,
679    ///  `Last` -> VIPS_OPERATION_MORPHOLOGY_LAST = 2
680    Last = 2,
681}
682
683#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
684pub enum OperationRelational {
685    ///  `Equal` -> VIPS_OPERATION_RELATIONAL_EQUAL = 0
686    Equal = 0,
687    ///  `Noteq` -> VIPS_OPERATION_RELATIONAL_NOTEQ = 1
688    Noteq = 1,
689    ///  `Less` -> VIPS_OPERATION_RELATIONAL_LESS = 2
690    Less = 2,
691    ///  `Lesseq` -> VIPS_OPERATION_RELATIONAL_LESSEQ = 3
692    Lesseq = 3,
693    ///  `More` -> VIPS_OPERATION_RELATIONAL_MORE = 4
694    More = 4,
695    ///  `Moreeq` -> VIPS_OPERATION_RELATIONAL_MOREEQ = 5
696    Moreeq = 5,
697    ///  `Last` -> VIPS_OPERATION_RELATIONAL_LAST = 6
698    Last = 6,
699}
700
701#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
702pub enum OperationRound {
703    ///  `Rint` -> VIPS_OPERATION_ROUND_RINT = 0
704    Rint = 0,
705    ///  `Ceil` -> VIPS_OPERATION_ROUND_CEIL = 1
706    Ceil = 1,
707    ///  `Floor` -> VIPS_OPERATION_ROUND_FLOOR = 2
708    Floor = 2,
709    ///  `Last` -> VIPS_OPERATION_ROUND_LAST = 3
710    Last = 3,
711}
712
713#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
714pub enum PCS {
715    ///  `Lab` -> VIPS_PCS_LAB = 0
716    Lab = 0,
717    ///  `Xyz` -> VIPS_PCS_XYZ = 1
718    Xyz = 1,
719    ///  `Last` -> VIPS_PCS_LAST = 2
720    Last = 2,
721}
722
723#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
724pub enum Precision {
725    ///  `Integer` -> VIPS_PRECISION_INTEGER = 0
726    Integer = 0,
727    ///  `Float` -> VIPS_PRECISION_FLOAT = 1
728    Float = 1,
729    ///  `Approximate` -> VIPS_PRECISION_APPROXIMATE = 2
730    Approximate = 2,
731    ///  `Last` -> VIPS_PRECISION_LAST = 3
732    Last = 3,
733}
734
735#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
736pub enum RegionShrink {
737    ///  `Mean` -> VIPS_REGION_SHRINK_MEAN = 0
738    Mean = 0,
739    ///  `Median` -> VIPS_REGION_SHRINK_MEDIAN = 1
740    Median = 1,
741    ///  `Mode` -> VIPS_REGION_SHRINK_MODE = 2
742    Mode = 2,
743    ///  `Max` -> VIPS_REGION_SHRINK_MAX = 3
744    Max = 3,
745    ///  `Min` -> VIPS_REGION_SHRINK_MIN = 4
746    Min = 4,
747    ///  `Nearest` -> VIPS_REGION_SHRINK_NEAREST = 5
748    Nearest = 5,
749    ///  `Last` -> VIPS_REGION_SHRINK_LAST = 6
750    Last = 6,
751}
752
753#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
754pub enum SdfShape {
755    ///  `Circle` -> VIPS_SDF_SHAPE_CIRCLE = 0
756    Circle = 0,
757    ///  `Box` -> VIPS_SDF_SHAPE_BOX = 1
758    Box = 1,
759    ///  `RoundedBox` -> VIPS_SDF_SHAPE_ROUNDED_BOX = 2
760    RoundedBox = 2,
761    ///  `Line` -> VIPS_SDF_SHAPE_LINE = 3
762    Line = 3,
763    ///  `Last` -> VIPS_SDF_SHAPE_LAST = 4
764    Last = 4,
765}
766
767#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
768pub enum Size {
769    ///  `Both` -> VIPS_SIZE_BOTH = 0
770    Both = 0,
771    ///  `Up` -> VIPS_SIZE_UP = 1
772    Up = 1,
773    ///  `Down` -> VIPS_SIZE_DOWN = 2
774    Down = 2,
775    ///  `Force` -> VIPS_SIZE_FORCE = 3
776    Force = 3,
777    ///  `Last` -> VIPS_SIZE_LAST = 4
778    Last = 4,
779}
780
781#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
782pub enum TextWrap {
783    ///  `Word` -> VIPS_TEXT_WRAP_WORD = 0
784    Word = 0,
785    ///  `Char` -> VIPS_TEXT_WRAP_CHAR = 1
786    Char = 1,
787    ///  `WordChar` -> VIPS_TEXT_WRAP_WORD_CHAR = 2
788    WordChar = 2,
789    ///  `None` -> VIPS_TEXT_WRAP_NONE = 3
790    None = 3,
791    ///  `Last` -> VIPS_TEXT_WRAP_LAST = 4
792    Last = 4,
793}
794
795impl VipsImage {
796    /// VipsCMC2LCh (CMC2LCh), transform LCh to CMC
797    /// returns `VipsImage` - Output image
798    pub fn CMC2LCh(&self) -> Result<VipsImage> {
799        let mut out_out = VipsImage::from(null_mut());
800        let vips_op_response = call(
801            "CMC2LCh",
802            VOption::new()
803                .set("in", self)
804                .set(
805                    "out",
806                    &mut out_out,
807                ),
808        );
809
810        utils::result(
811            vips_op_response,
812            out_out,
813            Error::OperationError("Cmc2LCh (vips_CMC2LCh) failed".to_string()),
814        )
815    }
816
817    /// VipsCMYK2XYZ (CMYK2XYZ), transform CMYK to XYZ
818    /// returns `VipsImage` - Output image
819    pub fn CMYK2XYZ(&self) -> Result<VipsImage> {
820        let mut out_out = VipsImage::from(null_mut());
821        let vips_op_response = call(
822            "CMYK2XYZ",
823            VOption::new()
824                .set("in", self)
825                .set(
826                    "out",
827                    &mut out_out,
828                ),
829        );
830
831        utils::result(
832            vips_op_response,
833            out_out,
834            Error::OperationError("Cmyk2Xyz (vips_CMYK2XYZ) failed".to_string()),
835        )
836    }
837
838    /// VipsHSV2sRGB (HSV2sRGB), transform HSV to sRGB
839    /// returns `VipsImage` - Output image
840    pub fn HSV2sRGB(&self) -> Result<VipsImage> {
841        let mut out_out = VipsImage::from(null_mut());
842        let vips_op_response = call(
843            "HSV2sRGB",
844            VOption::new()
845                .set("in", self)
846                .set(
847                    "out",
848                    &mut out_out,
849                ),
850        );
851
852        utils::result(
853            vips_op_response,
854            out_out,
855            Error::OperationError("Hsv2SRgb (vips_HSV2sRGB) failed".to_string()),
856        )
857    }
858
859    /// VipsLCh2CMC (LCh2CMC), transform LCh to CMC
860    /// returns `VipsImage` - Output image
861    pub fn LCh2CMC(&self) -> Result<VipsImage> {
862        let mut out_out = VipsImage::from(null_mut());
863        let vips_op_response = call(
864            "LCh2CMC",
865            VOption::new()
866                .set("in", self)
867                .set(
868                    "out",
869                    &mut out_out,
870                ),
871        );
872
873        utils::result(
874            vips_op_response,
875            out_out,
876            Error::OperationError("LCh2Cmc (vips_LCh2CMC) failed".to_string()),
877        )
878    }
879
880    /// VipsLCh2Lab (LCh2Lab), transform LCh to Lab
881    /// returns `VipsImage` - Output image
882    pub fn LCh2Lab(&self) -> Result<VipsImage> {
883        let mut out_out = VipsImage::from(null_mut());
884        let vips_op_response = call(
885            "LCh2Lab",
886            VOption::new()
887                .set("in", self)
888                .set(
889                    "out",
890                    &mut out_out,
891                ),
892        );
893
894        utils::result(
895            vips_op_response,
896            out_out,
897            Error::OperationError("LCh2Lab (vips_LCh2Lab) failed".to_string()),
898        )
899    }
900
901    /// VipsLab2LCh (Lab2LCh), transform Lab to LCh
902    /// returns `VipsImage` - Output image
903    pub fn Lab2LCh(&self) -> Result<VipsImage> {
904        let mut out_out = VipsImage::from(null_mut());
905        let vips_op_response = call(
906            "Lab2LCh",
907            VOption::new()
908                .set("in", self)
909                .set(
910                    "out",
911                    &mut out_out,
912                ),
913        );
914
915        utils::result(
916            vips_op_response,
917            out_out,
918            Error::OperationError("Lab2LCh (vips_Lab2LCh) failed".to_string()),
919        )
920    }
921
922    /// VipsLab2LabQ (Lab2LabQ), transform float Lab to LabQ coding
923    /// returns `VipsImage` - Output image
924    pub fn Lab2LabQ(&self) -> Result<VipsImage> {
925        let mut out_out = VipsImage::from(null_mut());
926        let vips_op_response = call(
927            "Lab2LabQ",
928            VOption::new()
929                .set("in", self)
930                .set(
931                    "out",
932                    &mut out_out,
933                ),
934        );
935
936        utils::result(
937            vips_op_response,
938            out_out,
939            Error::OperationError("Lab2LabQ (vips_Lab2LabQ) failed".to_string()),
940        )
941    }
942
943    /// VipsLab2LabS (Lab2LabS), transform float Lab to signed short
944    /// returns `VipsImage` - Output image
945    pub fn Lab2LabS(&self) -> Result<VipsImage> {
946        let mut out_out = VipsImage::from(null_mut());
947        let vips_op_response = call(
948            "Lab2LabS",
949            VOption::new()
950                .set("in", self)
951                .set(
952                    "out",
953                    &mut out_out,
954                ),
955        );
956
957        utils::result(
958            vips_op_response,
959            out_out,
960            Error::OperationError("Lab2LabSs (vips_Lab2LabS) failed".to_string()),
961        )
962    }
963
964    /// VipsLab2XYZ (Lab2XYZ), transform CIELAB to XYZ
965    /// returns `VipsImage` - Output image
966    pub fn Lab2XYZ(&self) -> Result<VipsImage> {
967        let mut out_out = VipsImage::from(null_mut());
968        let vips_op_response = call(
969            "Lab2XYZ",
970            VOption::new()
971                .set("in", self)
972                .set(
973                    "out",
974                    &mut out_out,
975                ),
976        );
977
978        utils::result(
979            vips_op_response,
980            out_out,
981            Error::OperationError("Lab2Xyz (vips_Lab2XYZ) failed".to_string()),
982        )
983    }
984
985    /// VipsLab2XYZ (Lab2XYZ), transform CIELAB to XYZ
986    /// returns `VipsImage` - Output image
987    ///
988    /// <ins>Optional arguments</ins>
989    ///
990    /// temp: `&[f64]` -> Color temperature
991    pub fn Lab2XYZ_with_opts(&self, option: VOption) -> Result<VipsImage> {
992        let mut out_out = VipsImage::from(null_mut());
993        let vips_op_response = call(
994            "Lab2XYZ",
995            option
996                .set("in", self)
997                .set(
998                    "out",
999                    &mut out_out,
1000                ),
1001        );
1002
1003        utils::result(
1004            vips_op_response,
1005            out_out,
1006            Error::OperationError("Lab2Xyz (vips_Lab2XYZ) failed".to_string()),
1007        )
1008    }
1009
1010    /// VipsLabQ2Lab (LabQ2Lab), unpack a LabQ image to float Lab
1011    /// returns `VipsImage` - Output image
1012    pub fn LabQ2Lab(&self) -> Result<VipsImage> {
1013        let mut out_out = VipsImage::from(null_mut());
1014        let vips_op_response = call(
1015            "LabQ2Lab",
1016            VOption::new()
1017                .set("in", self)
1018                .set(
1019                    "out",
1020                    &mut out_out,
1021                ),
1022        );
1023
1024        utils::result(
1025            vips_op_response,
1026            out_out,
1027            Error::OperationError("LabQ2Lab (vips_LabQ2Lab) failed".to_string()),
1028        )
1029    }
1030
1031    /// VipsLabQ2LabS (LabQ2LabS), unpack a LabQ image to short Lab
1032    /// returns `VipsImage` - Output image
1033    pub fn LabQ2LabS(&self) -> Result<VipsImage> {
1034        let mut out_out = VipsImage::from(null_mut());
1035        let vips_op_response = call(
1036            "LabQ2LabS",
1037            VOption::new()
1038                .set("in", self)
1039                .set(
1040                    "out",
1041                    &mut out_out,
1042                ),
1043        );
1044
1045        utils::result(
1046            vips_op_response,
1047            out_out,
1048            Error::OperationError("LabQ2LabSs (vips_LabQ2LabS) failed".to_string()),
1049        )
1050    }
1051
1052    /// VipsLabQ2sRGB (LabQ2sRGB), convert a LabQ image to sRGB
1053    /// returns `VipsImage` - Output image
1054    pub fn LabQ2sRGB(&self) -> Result<VipsImage> {
1055        let mut out_out = VipsImage::from(null_mut());
1056        let vips_op_response = call(
1057            "LabQ2sRGB",
1058            VOption::new()
1059                .set("in", self)
1060                .set(
1061                    "out",
1062                    &mut out_out,
1063                ),
1064        );
1065
1066        utils::result(
1067            vips_op_response,
1068            out_out,
1069            Error::OperationError("LabQ2SRgb (vips_LabQ2sRGB) failed".to_string()),
1070        )
1071    }
1072
1073    /// VipsLabS2Lab (LabS2Lab), transform signed short Lab to float
1074    /// returns `VipsImage` - Output image
1075    pub fn LabS2Lab(&self) -> Result<VipsImage> {
1076        let mut out_out = VipsImage::from(null_mut());
1077        let vips_op_response = call(
1078            "LabS2Lab",
1079            VOption::new()
1080                .set("in", self)
1081                .set(
1082                    "out",
1083                    &mut out_out,
1084                ),
1085        );
1086
1087        utils::result(
1088            vips_op_response,
1089            out_out,
1090            Error::OperationError("LabS2Lab (vips_LabS2Lab) failed".to_string()),
1091        )
1092    }
1093
1094    /// VipsLabS2LabQ (LabS2LabQ), transform short Lab to LabQ coding
1095    /// returns `VipsImage` - Output image
1096    pub fn LabS2LabQ(&self) -> Result<VipsImage> {
1097        let mut out_out = VipsImage::from(null_mut());
1098        let vips_op_response = call(
1099            "LabS2LabQ",
1100            VOption::new()
1101                .set("in", self)
1102                .set(
1103                    "out",
1104                    &mut out_out,
1105                ),
1106        );
1107
1108        utils::result(
1109            vips_op_response,
1110            out_out,
1111            Error::OperationError("LabS2LabQ (vips_LabS2LabQ) failed".to_string()),
1112        )
1113    }
1114
1115    /// VipsXYZ2CMYK (XYZ2CMYK), transform XYZ to CMYK
1116    /// returns `VipsImage` - Output image
1117    pub fn XYZ2CMYK(&self) -> Result<VipsImage> {
1118        let mut out_out = VipsImage::from(null_mut());
1119        let vips_op_response = call(
1120            "XYZ2CMYK",
1121            VOption::new()
1122                .set("in", self)
1123                .set(
1124                    "out",
1125                    &mut out_out,
1126                ),
1127        );
1128
1129        utils::result(
1130            vips_op_response,
1131            out_out,
1132            Error::OperationError("Xyz2Cmyk (vips_XYZ2CMYK) failed".to_string()),
1133        )
1134    }
1135
1136    /// VipsXYZ2Lab (XYZ2Lab), transform XYZ to Lab
1137    /// returns `VipsImage` - Output image
1138    pub fn XYZ2Lab(&self) -> Result<VipsImage> {
1139        let mut out_out = VipsImage::from(null_mut());
1140        let vips_op_response = call(
1141            "XYZ2Lab",
1142            VOption::new()
1143                .set("in", self)
1144                .set(
1145                    "out",
1146                    &mut out_out,
1147                ),
1148        );
1149
1150        utils::result(
1151            vips_op_response,
1152            out_out,
1153            Error::OperationError("Xyz2Lab (vips_XYZ2Lab) failed".to_string()),
1154        )
1155    }
1156
1157    /// VipsXYZ2Lab (XYZ2Lab), transform XYZ to Lab
1158    /// returns `VipsImage` - Output image
1159    ///
1160    /// <ins>Optional arguments</ins>
1161    ///
1162    /// temp: `&[f64]` -> Colour temperature
1163    pub fn XYZ2Lab_with_opts(&self, option: VOption) -> Result<VipsImage> {
1164        let mut out_out = VipsImage::from(null_mut());
1165        let vips_op_response = call(
1166            "XYZ2Lab",
1167            option
1168                .set("in", self)
1169                .set(
1170                    "out",
1171                    &mut out_out,
1172                ),
1173        );
1174
1175        utils::result(
1176            vips_op_response,
1177            out_out,
1178            Error::OperationError("Xyz2Lab (vips_XYZ2Lab) failed".to_string()),
1179        )
1180    }
1181
1182    /// VipsXYZ2Yxy (XYZ2Yxy), transform XYZ to Yxy
1183    /// returns `VipsImage` - Output image
1184    pub fn XYZ2Yxy(&self) -> Result<VipsImage> {
1185        let mut out_out = VipsImage::from(null_mut());
1186        let vips_op_response = call(
1187            "XYZ2Yxy",
1188            VOption::new()
1189                .set("in", self)
1190                .set(
1191                    "out",
1192                    &mut out_out,
1193                ),
1194        );
1195
1196        utils::result(
1197            vips_op_response,
1198            out_out,
1199            Error::OperationError("Xyz2Yxy (vips_XYZ2Yxy) failed".to_string()),
1200        )
1201    }
1202
1203    /// VipsXYZ2scRGB (XYZ2scRGB), transform XYZ to scRGB
1204    /// returns `VipsImage` - Output image
1205    pub fn XYZ2scRGB(&self) -> Result<VipsImage> {
1206        let mut out_out = VipsImage::from(null_mut());
1207        let vips_op_response = call(
1208            "XYZ2scRGB",
1209            VOption::new()
1210                .set("in", self)
1211                .set(
1212                    "out",
1213                    &mut out_out,
1214                ),
1215        );
1216
1217        utils::result(
1218            vips_op_response,
1219            out_out,
1220            Error::OperationError("Xyz2ScRgb (vips_XYZ2scRGB) failed".to_string()),
1221        )
1222    }
1223
1224    /// VipsYxy2XYZ (Yxy2XYZ), transform Yxy to XYZ
1225    /// returns `VipsImage` - Output image
1226    pub fn Yxy2XYZ(&self) -> Result<VipsImage> {
1227        let mut out_out = VipsImage::from(null_mut());
1228        let vips_op_response = call(
1229            "Yxy2XYZ",
1230            VOption::new()
1231                .set("in", self)
1232                .set(
1233                    "out",
1234                    &mut out_out,
1235                ),
1236        );
1237
1238        utils::result(
1239            vips_op_response,
1240            out_out,
1241            Error::OperationError("Yxy2Xyz (vips_Yxy2XYZ) failed".to_string()),
1242        )
1243    }
1244
1245    /// VipsAbs (abs), absolute value of an image
1246    /// returns `VipsImage` - Output image
1247    pub fn abs(&self) -> Result<VipsImage> {
1248        let mut out_out = VipsImage::from(null_mut());
1249        let vips_op_response = call(
1250            "abs",
1251            VOption::new()
1252                .set("in", self)
1253                .set(
1254                    "out",
1255                    &mut out_out,
1256                ),
1257        );
1258
1259        utils::result(
1260            vips_op_response,
1261            out_out,
1262            Error::OperationError("Abs (vips_abs) failed".to_string()),
1263        )
1264    }
1265
1266    /// VipsAdd (add), add two images
1267    /// returns `VipsImage` - Output image
1268    ///
1269    /// right: `&VipsImage` -> Right-hand image argument
1270    pub fn add(&self, right: &VipsImage) -> Result<VipsImage> {
1271        let mut out_out = VipsImage::from(null_mut());
1272        let vips_op_response = call(
1273            "add",
1274            VOption::new()
1275                .set(
1276                    "left",
1277                    self,
1278                )
1279                .set(
1280                    "right",
1281                    right,
1282                )
1283                .set(
1284                    "out",
1285                    &mut out_out,
1286                ),
1287        );
1288
1289        utils::result(
1290            vips_op_response,
1291            out_out,
1292            Error::OperationError("Add (vips_add) failed".to_string()),
1293        )
1294    }
1295
1296    /// VipsAddAlpha (addalpha), append an alpha channel
1297    /// returns `VipsImage` - Output image
1298    pub fn addalpha(&self) -> Result<VipsImage> {
1299        let mut out_out = VipsImage::from(null_mut());
1300        let vips_op_response = call(
1301            "addalpha",
1302            VOption::new()
1303                .set("in", self)
1304                .set(
1305                    "out",
1306                    &mut out_out,
1307                ),
1308        );
1309
1310        utils::result(
1311            vips_op_response,
1312            out_out,
1313            Error::OperationError("Addalpha (vips_addalpha) failed".to_string()),
1314        )
1315    }
1316
1317    /// VipsAffine (affine), affine transform of an image
1318    /// returns `VipsImage` - Output image
1319    ///
1320    /// matrix: `&[f64]` -> Transformation matrix
1321    pub fn affine(&self, matrix: &[f64]) -> Result<VipsImage> {
1322        let mut out_out = VipsImage::from(null_mut());
1323        let vips_op_response = call(
1324            "affine",
1325            VOption::new()
1326                .set("in", self)
1327                .set(
1328                    "out",
1329                    &mut out_out,
1330                )
1331                .set(
1332                    "matrix",
1333                    matrix,
1334                ),
1335        );
1336
1337        utils::result(
1338            vips_op_response,
1339            out_out,
1340            Error::OperationError("Affine (vips_affine) failed".to_string()),
1341        )
1342    }
1343
1344    /// VipsAffine (affine), affine transform of an image
1345    /// returns `VipsImage` - Output image
1346    ///
1347    /// matrix: `&[f64]` -> Transformation matrix
1348    ///
1349    /// <ins>Optional arguments</ins>
1350    ///
1351    /// interpolate: `&VipsInterpolate` -> Interpolate pixels with this
1352    ///
1353    /// oarea: `&[i32]` -> Area of output to generate
1354    ///
1355    /// odx: `f64` -> Horizontal output displacement
1356    ///
1357    /// ody: `f64` -> Vertical output displacement
1358    ///
1359    /// idx: `f64` -> Horizontal input displacement
1360    ///
1361    /// idy: `f64` -> Vertical input displacement
1362    ///
1363    /// background: `&[f64]` -> Background value
1364    ///
1365    /// premultiplied: `bool` -> Images have premultiplied alpha
1366    ///
1367    /// extend: [`Extend`] -> How to generate the extra pixels
1368    pub fn affine_with_opts(&self, matrix: &[f64], option: VOption) -> Result<VipsImage> {
1369        let mut out_out = VipsImage::from(null_mut());
1370        let vips_op_response = call(
1371            "affine",
1372            option
1373                .set("in", self)
1374                .set(
1375                    "out",
1376                    &mut out_out,
1377                )
1378                .set(
1379                    "matrix",
1380                    matrix,
1381                ),
1382        );
1383
1384        utils::result(
1385            vips_op_response,
1386            out_out,
1387            Error::OperationError("Affine (vips_affine) failed".to_string()),
1388        )
1389    }
1390
1391    /// VipsForeignLoadAnalyze (analyzeload), load an Analyze6 image (.img, .hdr), priority=-50, untrusted, is_a, get_flags, get_flags_filename, header, load
1392    /// returns `VipsImage` - Output image
1393    ///
1394    /// filename: `&str` -> Filename to load from
1395    pub fn analyzeload(filename: &str) -> Result<VipsImage> {
1396        let mut out_out = VipsImage::from(null_mut());
1397        let vips_op_response = call(
1398            "analyzeload",
1399            VOption::new()
1400                .set(
1401                    "filename",
1402                    filename,
1403                )
1404                .set(
1405                    "out",
1406                    &mut out_out,
1407                ),
1408        );
1409
1410        utils::result(
1411            vips_op_response,
1412            out_out,
1413            Error::OperationError("Analyzeload (vips_analyzeload) failed".to_string()),
1414        )
1415    }
1416
1417    /// VipsForeignLoadAnalyze (analyzeload), load an Analyze6 image (.img, .hdr), priority=-50, untrusted, is_a, get_flags, get_flags_filename, header, load
1418    /// returns `VipsImage` - Output image
1419    ///
1420    /// filename: `&str` -> Filename to load from
1421    ///
1422    /// <ins>Optional arguments</ins>
1423    ///
1424    /// flags: [`ForeignFlags`] -> Flags for this file
1425    ///
1426    /// memory: `bool` -> Force open via memory
1427    ///
1428    /// access: [`Access`] -> Required access pattern for this file
1429    ///
1430    /// fail_on: [`FailOn`] -> Error level to fail on
1431    ///
1432    /// revalidate: `bool` -> Don't use a cached result for this operation
1433    pub fn analyzeload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
1434        let mut out_out = VipsImage::from(null_mut());
1435        let vips_op_response = call(
1436            "analyzeload",
1437            option
1438                .set(
1439                    "filename",
1440                    filename,
1441                )
1442                .set(
1443                    "out",
1444                    &mut out_out,
1445                ),
1446        );
1447
1448        utils::result(
1449            vips_op_response,
1450            out_out,
1451            Error::OperationError("Analyzeload (vips_analyzeload) failed".to_string()),
1452        )
1453    }
1454
1455    /// VipsArrayjoin (arrayjoin), join an array of images
1456    /// returns `VipsImage` - Output image
1457    ///
1458    /// inp: `&[VipsImage]` -> Array of input images
1459    pub fn arrayjoin(inp: &[VipsImage]) -> Result<VipsImage> {
1460        let mut out_out = VipsImage::from(null_mut());
1461        let vips_op_response = call(
1462            "arrayjoin",
1463            VOption::new()
1464                .set("in", inp)
1465                .set(
1466                    "out",
1467                    &mut out_out,
1468                ),
1469        );
1470
1471        utils::result(
1472            vips_op_response,
1473            out_out,
1474            Error::OperationError("Arrayjoin (vips_arrayjoin) failed".to_string()),
1475        )
1476    }
1477
1478    /// VipsArrayjoin (arrayjoin), join an array of images
1479    /// returns `VipsImage` - Output image
1480    ///
1481    /// inp: `&[VipsImage]` -> Array of input images
1482    ///
1483    /// <ins>Optional arguments</ins>
1484    ///
1485    /// across: `i32` -> Number of images across grid
1486    ///
1487    /// shim: `i32` -> Pixels between images
1488    ///
1489    /// background: `&[f64]` -> Colour for new pixels
1490    ///
1491    /// halign: [`Align`] -> Align on the left, centre or right
1492    ///
1493    /// valign: [`Align`] -> Align on the top, centre or bottom
1494    ///
1495    /// hspacing: `i32` -> Horizontal spacing between images
1496    ///
1497    /// vspacing: `i32` -> Vertical spacing between images
1498    pub fn arrayjoin_with_opts(inp: &[VipsImage], option: VOption) -> Result<VipsImage> {
1499        let mut out_out = VipsImage::from(null_mut());
1500        let vips_op_response = call(
1501            "arrayjoin",
1502            option
1503                .set("in", inp)
1504                .set(
1505                    "out",
1506                    &mut out_out,
1507                ),
1508        );
1509
1510        utils::result(
1511            vips_op_response,
1512            out_out,
1513            Error::OperationError("Arrayjoin (vips_arrayjoin) failed".to_string()),
1514        )
1515    }
1516
1517    /// VipsAutorot (autorot), autorotate image by exif tag
1518    /// returns `VipsImage` - Output image
1519    pub fn autorot(&self) -> Result<VipsImage> {
1520        let mut out_out = VipsImage::from(null_mut());
1521        let vips_op_response = call(
1522            "autorot",
1523            VOption::new()
1524                .set("in", self)
1525                .set(
1526                    "out",
1527                    &mut out_out,
1528                ),
1529        );
1530
1531        utils::result(
1532            vips_op_response,
1533            out_out,
1534            Error::OperationError("Autorot (vips_autorot) failed".to_string()),
1535        )
1536    }
1537
1538    /// VipsAutorot (autorot), autorotate image by exif tag
1539    /// returns `VipsImage` - Output image
1540    ///
1541    /// <ins>Optional arguments</ins>
1542    ///
1543    /// angle: [`Angle`] -> Angle image was rotated by
1544    ///
1545    /// flip: `&mut bool` -> Whether the image was flipped or not
1546    pub fn autorot_with_opts(&self, option: VOption) -> Result<VipsImage> {
1547        let mut out_out = VipsImage::from(null_mut());
1548        let vips_op_response = call(
1549            "autorot",
1550            option
1551                .set("in", self)
1552                .set(
1553                    "out",
1554                    &mut out_out,
1555                ),
1556        );
1557
1558        utils::result(
1559            vips_op_response,
1560            out_out,
1561            Error::OperationError("Autorot (vips_autorot) failed".to_string()),
1562        )
1563    }
1564
1565    /// VipsAvg (avg), find image average
1566    /// returns `f64` - Output value
1567    pub fn avg(&self) -> Result<f64> {
1568        let mut out_out: f64 = 0.0;
1569        let vips_op_response = call(
1570            "avg",
1571            VOption::new()
1572                .set("in", self)
1573                .set(
1574                    "out",
1575                    &mut out_out,
1576                ),
1577        );
1578
1579        utils::result(
1580            vips_op_response,
1581            out_out,
1582            Error::OperationError("Avg (vips_avg) failed".to_string()),
1583        )
1584    }
1585
1586    /// VipsBandbool (bandbool), boolean operation across image bands
1587    /// returns `VipsImage` - Output image
1588    ///
1589    /// boolean: `OperationBoolean` -> Boolean to perform
1590    pub fn bandbool(&self, boolean: OperationBoolean) -> Result<VipsImage> {
1591        let mut out_out = VipsImage::from(null_mut());
1592        let vips_op_response = call(
1593            "bandbool",
1594            VOption::new()
1595                .set("in", self)
1596                .set(
1597                    "out",
1598                    &mut out_out,
1599                )
1600                .set(
1601                    "boolean",
1602                    boolean as i32,
1603                ),
1604        );
1605
1606        utils::result(
1607            vips_op_response,
1608            out_out,
1609            Error::OperationError("Bandbool (vips_bandbool) failed".to_string()),
1610        )
1611    }
1612
1613    /// VipsBandfold (bandfold), fold up x axis into bands
1614    /// returns `VipsImage` - Output image
1615    pub fn bandfold(&self) -> Result<VipsImage> {
1616        let mut out_out = VipsImage::from(null_mut());
1617        let vips_op_response = call(
1618            "bandfold",
1619            VOption::new()
1620                .set("in", self)
1621                .set(
1622                    "out",
1623                    &mut out_out,
1624                ),
1625        );
1626
1627        utils::result(
1628            vips_op_response,
1629            out_out,
1630            Error::OperationError("Bandfold (vips_bandfold) failed".to_string()),
1631        )
1632    }
1633
1634    /// VipsBandfold (bandfold), fold up x axis into bands
1635    /// returns `VipsImage` - Output image
1636    ///
1637    /// <ins>Optional arguments</ins>
1638    ///
1639    /// factor: `i32` -> Fold by this factor
1640    pub fn bandfold_with_opts(&self, option: VOption) -> Result<VipsImage> {
1641        let mut out_out = VipsImage::from(null_mut());
1642        let vips_op_response = call(
1643            "bandfold",
1644            option
1645                .set("in", self)
1646                .set(
1647                    "out",
1648                    &mut out_out,
1649                ),
1650        );
1651
1652        utils::result(
1653            vips_op_response,
1654            out_out,
1655            Error::OperationError("Bandfold (vips_bandfold) failed".to_string()),
1656        )
1657    }
1658
1659    /// VipsBandjoin (bandjoin), bandwise join a set of images
1660    /// returns `VipsImage` - Output image
1661    ///
1662    /// inp: `&[VipsImage]` -> Array of input images
1663    pub fn bandjoin(inp: &[VipsImage]) -> Result<VipsImage> {
1664        let mut out_out = VipsImage::from(null_mut());
1665        let vips_op_response = call(
1666            "bandjoin",
1667            VOption::new()
1668                .set("in", inp)
1669                .set(
1670                    "out",
1671                    &mut out_out,
1672                ),
1673        );
1674
1675        utils::result(
1676            vips_op_response,
1677            out_out,
1678            Error::OperationError("Bandjoin (vips_bandjoin) failed".to_string()),
1679        )
1680    }
1681
1682    /// VipsBandjoinConst (bandjoin_const), append a constant band to an image
1683    /// returns `VipsImage` - Output image
1684    ///
1685    /// c: `&[f64]` -> Array of constants to add
1686    pub fn bandjoin_const(&self, c: &[f64]) -> Result<VipsImage> {
1687        let mut out_out = VipsImage::from(null_mut());
1688        let vips_op_response = call(
1689            "bandjoin_const",
1690            VOption::new()
1691                .set("in", self)
1692                .set(
1693                    "out",
1694                    &mut out_out,
1695                )
1696                .set("c", c),
1697        );
1698
1699        utils::result(
1700            vips_op_response,
1701            out_out,
1702            Error::OperationError("BandjoinConst (vips_bandjoin_const) failed".to_string()),
1703        )
1704    }
1705
1706    /// VipsBandmean (bandmean), band-wise average
1707    /// returns `VipsImage` - Output image
1708    pub fn bandmean(&self) -> Result<VipsImage> {
1709        let mut out_out = VipsImage::from(null_mut());
1710        let vips_op_response = call(
1711            "bandmean",
1712            VOption::new()
1713                .set("in", self)
1714                .set(
1715                    "out",
1716                    &mut out_out,
1717                ),
1718        );
1719
1720        utils::result(
1721            vips_op_response,
1722            out_out,
1723            Error::OperationError("Bandmean (vips_bandmean) failed".to_string()),
1724        )
1725    }
1726
1727    /// VipsBandrank (bandrank), band-wise rank of a set of images
1728    /// returns `VipsImage` - Output image
1729    ///
1730    /// inp: `&[VipsImage]` -> Array of input images
1731    pub fn bandrank(inp: &[VipsImage]) -> Result<VipsImage> {
1732        let mut out_out = VipsImage::from(null_mut());
1733        let vips_op_response = call(
1734            "bandrank",
1735            VOption::new()
1736                .set("in", inp)
1737                .set(
1738                    "out",
1739                    &mut out_out,
1740                ),
1741        );
1742
1743        utils::result(
1744            vips_op_response,
1745            out_out,
1746            Error::OperationError("Bandrank (vips_bandrank) failed".to_string()),
1747        )
1748    }
1749
1750    /// VipsBandrank (bandrank), band-wise rank of a set of images
1751    /// returns `VipsImage` - Output image
1752    ///
1753    /// inp: `&[VipsImage]` -> Array of input images
1754    ///
1755    /// <ins>Optional arguments</ins>
1756    ///
1757    /// index: `i32` -> Select this band element from sorted list
1758    pub fn bandrank_with_opts(inp: &[VipsImage], option: VOption) -> Result<VipsImage> {
1759        let mut out_out = VipsImage::from(null_mut());
1760        let vips_op_response = call(
1761            "bandrank",
1762            option
1763                .set("in", inp)
1764                .set(
1765                    "out",
1766                    &mut out_out,
1767                ),
1768        );
1769
1770        utils::result(
1771            vips_op_response,
1772            out_out,
1773            Error::OperationError("Bandrank (vips_bandrank) failed".to_string()),
1774        )
1775    }
1776
1777    /// VipsBandunfold (bandunfold), unfold image bands into x axis
1778    /// returns `VipsImage` - Output image
1779    pub fn bandunfold(&self) -> Result<VipsImage> {
1780        let mut out_out = VipsImage::from(null_mut());
1781        let vips_op_response = call(
1782            "bandunfold",
1783            VOption::new()
1784                .set("in", self)
1785                .set(
1786                    "out",
1787                    &mut out_out,
1788                ),
1789        );
1790
1791        utils::result(
1792            vips_op_response,
1793            out_out,
1794            Error::OperationError("Bandunfold (vips_bandunfold) failed".to_string()),
1795        )
1796    }
1797
1798    /// VipsBandunfold (bandunfold), unfold image bands into x axis
1799    /// returns `VipsImage` - Output image
1800    ///
1801    /// <ins>Optional arguments</ins>
1802    ///
1803    /// factor: `i32` -> Unfold by this factor
1804    pub fn bandunfold_with_opts(&self, option: VOption) -> Result<VipsImage> {
1805        let mut out_out = VipsImage::from(null_mut());
1806        let vips_op_response = call(
1807            "bandunfold",
1808            option
1809                .set("in", self)
1810                .set(
1811                    "out",
1812                    &mut out_out,
1813                ),
1814        );
1815
1816        utils::result(
1817            vips_op_response,
1818            out_out,
1819            Error::OperationError("Bandunfold (vips_bandunfold) failed".to_string()),
1820        )
1821    }
1822
1823    /// VipsBlack (black), make a black image
1824    /// returns `VipsImage` - Output image
1825    ///
1826    /// width: `i32` -> Image width in pixels
1827    ///
1828    /// height: `i32` -> Image height in pixels
1829    pub fn black(width: i32, height: i32) -> Result<VipsImage> {
1830        let mut out_out = VipsImage::from(null_mut());
1831        let vips_op_response = call(
1832            "black",
1833            VOption::new()
1834                .set(
1835                    "out",
1836                    &mut out_out,
1837                )
1838                .set(
1839                    "width",
1840                    width,
1841                )
1842                .set(
1843                    "height",
1844                    height,
1845                ),
1846        );
1847
1848        utils::result(
1849            vips_op_response,
1850            out_out,
1851            Error::OperationError("Black (vips_black) failed".to_string()),
1852        )
1853    }
1854
1855    /// VipsBlack (black), make a black image
1856    /// returns `VipsImage` - Output image
1857    ///
1858    /// width: `i32` -> Image width in pixels
1859    ///
1860    /// height: `i32` -> Image height in pixels
1861    ///
1862    /// <ins>Optional arguments</ins>
1863    ///
1864    /// bands: `i32` -> Number of bands in image
1865    pub fn black_with_opts(width: i32, height: i32, option: VOption) -> Result<VipsImage> {
1866        let mut out_out = VipsImage::from(null_mut());
1867        let vips_op_response = call(
1868            "black",
1869            option
1870                .set(
1871                    "out",
1872                    &mut out_out,
1873                )
1874                .set(
1875                    "width",
1876                    width,
1877                )
1878                .set(
1879                    "height",
1880                    height,
1881                ),
1882        );
1883
1884        utils::result(
1885            vips_op_response,
1886            out_out,
1887            Error::OperationError("Black (vips_black) failed".to_string()),
1888        )
1889    }
1890
1891    /// VipsBoolean (boolean), boolean operation on two images
1892    /// returns `VipsImage` - Output image
1893    ///
1894    /// right: `&VipsImage` -> Right-hand image argument
1895    ///
1896    /// boolean: `OperationBoolean` -> Boolean to perform
1897    pub fn boolean(&self, right: &VipsImage, boolean: OperationBoolean) -> Result<VipsImage> {
1898        let mut out_out = VipsImage::from(null_mut());
1899        let vips_op_response = call(
1900            "boolean",
1901            VOption::new()
1902                .set(
1903                    "left",
1904                    self,
1905                )
1906                .set(
1907                    "right",
1908                    right,
1909                )
1910                .set(
1911                    "out",
1912                    &mut out_out,
1913                )
1914                .set(
1915                    "boolean",
1916                    boolean as i32,
1917                ),
1918        );
1919
1920        utils::result(
1921            vips_op_response,
1922            out_out,
1923            Error::OperationError("Boolean (vips_boolean) failed".to_string()),
1924        )
1925    }
1926
1927    /// VipsBooleanConst (boolean_const), boolean operations against a constant
1928    /// returns `VipsImage` - Output image
1929    ///
1930    /// boolean: `OperationBoolean` -> Boolean to perform
1931    ///
1932    /// c: `&[f64]` -> Array of constants
1933    pub fn boolean_const(&self, boolean: OperationBoolean, c: &[f64]) -> Result<VipsImage> {
1934        let mut out_out = VipsImage::from(null_mut());
1935        let vips_op_response = call(
1936            "boolean_const",
1937            VOption::new()
1938                .set("in", self)
1939                .set(
1940                    "out",
1941                    &mut out_out,
1942                )
1943                .set(
1944                    "boolean",
1945                    boolean as i32,
1946                )
1947                .set("c", c),
1948        );
1949
1950        utils::result(
1951            vips_op_response,
1952            out_out,
1953            Error::OperationError("BooleanConst (vips_boolean_const) failed".to_string()),
1954        )
1955    }
1956
1957    /// VipsBuildlut (buildlut), build a look-up table
1958    /// returns `VipsImage` - Output image
1959    pub fn buildlut(&self) -> Result<VipsImage> {
1960        let mut out_out = VipsImage::from(null_mut());
1961        let vips_op_response = call(
1962            "buildlut",
1963            VOption::new()
1964                .set("in", self)
1965                .set(
1966                    "out",
1967                    &mut out_out,
1968                ),
1969        );
1970
1971        utils::result(
1972            vips_op_response,
1973            out_out,
1974            Error::OperationError("Buildlut (vips_buildlut) failed".to_string()),
1975        )
1976    }
1977
1978    /// VipsByteswap (byteswap), byteswap an image
1979    /// returns `VipsImage` - Output image
1980    pub fn byteswap(&self) -> Result<VipsImage> {
1981        let mut out_out = VipsImage::from(null_mut());
1982        let vips_op_response = call(
1983            "byteswap",
1984            VOption::new()
1985                .set("in", self)
1986                .set(
1987                    "out",
1988                    &mut out_out,
1989                ),
1990        );
1991
1992        utils::result(
1993            vips_op_response,
1994            out_out,
1995            Error::OperationError("Byteswap (vips_byteswap) failed".to_string()),
1996        )
1997    }
1998
1999    /// VipsCanny (canny), Canny edge detector
2000    /// returns `VipsImage` - Output image
2001    pub fn canny(&self) -> Result<VipsImage> {
2002        let mut out_out = VipsImage::from(null_mut());
2003        let vips_op_response = call(
2004            "canny",
2005            VOption::new()
2006                .set("in", self)
2007                .set(
2008                    "out",
2009                    &mut out_out,
2010                ),
2011        );
2012
2013        utils::result(
2014            vips_op_response,
2015            out_out,
2016            Error::OperationError("Canny (vips_canny) failed".to_string()),
2017        )
2018    }
2019
2020    /// VipsCanny (canny), Canny edge detector
2021    /// returns `VipsImage` - Output image
2022    ///
2023    /// <ins>Optional arguments</ins>
2024    ///
2025    /// sigma: `f64` -> Sigma of Gaussian
2026    ///
2027    /// precision: [`Precision`] -> Convolve with this precision
2028    pub fn canny_with_opts(&self, option: VOption) -> Result<VipsImage> {
2029        let mut out_out = VipsImage::from(null_mut());
2030        let vips_op_response = call(
2031            "canny",
2032            option
2033                .set("in", self)
2034                .set(
2035                    "out",
2036                    &mut out_out,
2037                ),
2038        );
2039
2040        utils::result(
2041            vips_op_response,
2042            out_out,
2043            Error::OperationError("Canny (vips_canny) failed".to_string()),
2044        )
2045    }
2046
2047    /// VipsCase (case), use pixel values to pick cases from an array of images
2048    /// returns `VipsImage` - Output image
2049    ///
2050    /// cases: `&[VipsImage]` -> Array of case images
2051    pub fn case(&self, cases: &[VipsImage]) -> Result<VipsImage> {
2052        let mut out_out = VipsImage::from(null_mut());
2053        let vips_op_response = call(
2054            "case",
2055            VOption::new()
2056                .set(
2057                    "index",
2058                    self,
2059                )
2060                .set(
2061                    "cases",
2062                    cases,
2063                )
2064                .set(
2065                    "out",
2066                    &mut out_out,
2067                ),
2068        );
2069
2070        utils::result(
2071            vips_op_response,
2072            out_out,
2073            Error::OperationError("Case (vips_case) failed".to_string()),
2074        )
2075    }
2076
2077    /// VipsCast (cast), cast an image
2078    /// returns `VipsImage` - Output image
2079    ///
2080    /// format: `BandFormat` -> Format to cast to
2081    pub fn cast(&self, format: BandFormat) -> Result<VipsImage> {
2082        let mut out_out = VipsImage::from(null_mut());
2083        let vips_op_response = call(
2084            "cast",
2085            VOption::new()
2086                .set("in", self)
2087                .set(
2088                    "out",
2089                    &mut out_out,
2090                )
2091                .set(
2092                    "format",
2093                    format as i32,
2094                ),
2095        );
2096
2097        utils::result(
2098            vips_op_response,
2099            out_out,
2100            Error::OperationError("Cast (vips_cast) failed".to_string()),
2101        )
2102    }
2103
2104    /// VipsCast (cast), cast an image
2105    /// returns `VipsImage` - Output image
2106    ///
2107    /// format: `BandFormat` -> Format to cast to
2108    ///
2109    /// <ins>Optional arguments</ins>
2110    ///
2111    /// shift: `bool` -> Shift integer values up and down
2112    pub fn cast_with_opts(&self, format: BandFormat, option: VOption) -> Result<VipsImage> {
2113        let mut out_out = VipsImage::from(null_mut());
2114        let vips_op_response = call(
2115            "cast",
2116            option
2117                .set("in", self)
2118                .set(
2119                    "out",
2120                    &mut out_out,
2121                )
2122                .set(
2123                    "format",
2124                    format as i32,
2125                ),
2126        );
2127
2128        utils::result(
2129            vips_op_response,
2130            out_out,
2131            Error::OperationError("Cast (vips_cast) failed".to_string()),
2132        )
2133    }
2134
2135    /// VipsClamp (clamp), clamp values of an image
2136    /// returns `VipsImage` - Output image
2137    pub fn clamp(&self) -> Result<VipsImage> {
2138        let mut out_out = VipsImage::from(null_mut());
2139        let vips_op_response = call(
2140            "clamp",
2141            VOption::new()
2142                .set("in", self)
2143                .set(
2144                    "out",
2145                    &mut out_out,
2146                ),
2147        );
2148
2149        utils::result(
2150            vips_op_response,
2151            out_out,
2152            Error::OperationError("Clamp (vips_clamp) failed".to_string()),
2153        )
2154    }
2155
2156    /// VipsClamp (clamp), clamp values of an image
2157    /// returns `VipsImage` - Output image
2158    ///
2159    /// <ins>Optional arguments</ins>
2160    ///
2161    /// min: `f64` -> Minimum value
2162    ///
2163    /// max: `f64` -> Maximum value
2164    pub fn clamp_with_opts(&self, option: VOption) -> Result<VipsImage> {
2165        let mut out_out = VipsImage::from(null_mut());
2166        let vips_op_response = call(
2167            "clamp",
2168            option
2169                .set("in", self)
2170                .set(
2171                    "out",
2172                    &mut out_out,
2173                ),
2174        );
2175
2176        utils::result(
2177            vips_op_response,
2178            out_out,
2179            Error::OperationError("Clamp (vips_clamp) failed".to_string()),
2180        )
2181    }
2182
2183    /// VipsColourspace (colourspace), convert to a new colorspace
2184    /// returns `VipsImage` - Output image
2185    ///
2186    /// space: `Interpretation` -> Destination color space
2187    pub fn colourspace(&self, space: Interpretation) -> Result<VipsImage> {
2188        let mut out_out = VipsImage::from(null_mut());
2189        let vips_op_response = call(
2190            "colourspace",
2191            VOption::new()
2192                .set("in", self)
2193                .set(
2194                    "out",
2195                    &mut out_out,
2196                )
2197                .set(
2198                    "space",
2199                    space as i32,
2200                ),
2201        );
2202
2203        utils::result(
2204            vips_op_response,
2205            out_out,
2206            Error::OperationError("Colourspace (vips_colourspace) failed".to_string()),
2207        )
2208    }
2209
2210    /// VipsColourspace (colourspace), convert to a new colorspace
2211    /// returns `VipsImage` - Output image
2212    ///
2213    /// space: `Interpretation` -> Destination color space
2214    ///
2215    /// <ins>Optional arguments</ins>
2216    ///
2217    /// source_space: [`Interpretation`] -> Source color space
2218    pub fn colourspace_with_opts(
2219        &self,
2220        space: Interpretation,
2221        option: VOption,
2222    ) -> Result<VipsImage> {
2223        let mut out_out = VipsImage::from(null_mut());
2224        let vips_op_response = call(
2225            "colourspace",
2226            option
2227                .set("in", self)
2228                .set(
2229                    "out",
2230                    &mut out_out,
2231                )
2232                .set(
2233                    "space",
2234                    space as i32,
2235                ),
2236        );
2237
2238        utils::result(
2239            vips_op_response,
2240            out_out,
2241            Error::OperationError("Colourspace (vips_colourspace) failed".to_string()),
2242        )
2243    }
2244
2245    /// VipsCompass (compass), convolve with rotating mask
2246    /// returns `VipsImage` - Output image
2247    ///
2248    /// mask: `&VipsImage` -> Input matrix image
2249    pub fn compass(&self, mask: &VipsImage) -> Result<VipsImage> {
2250        let mut out_out = VipsImage::from(null_mut());
2251        let vips_op_response = call(
2252            "compass",
2253            VOption::new()
2254                .set("in", self)
2255                .set(
2256                    "out",
2257                    &mut out_out,
2258                )
2259                .set(
2260                    "mask",
2261                    mask,
2262                ),
2263        );
2264
2265        utils::result(
2266            vips_op_response,
2267            out_out,
2268            Error::OperationError("Compass (vips_compass) failed".to_string()),
2269        )
2270    }
2271
2272    /// VipsCompass (compass), convolve with rotating mask
2273    /// returns `VipsImage` - Output image
2274    ///
2275    /// mask: `&VipsImage` -> Input matrix image
2276    ///
2277    /// <ins>Optional arguments</ins>
2278    ///
2279    /// times: `i32` -> Rotate and convolve this many times
2280    ///
2281    /// angle: [`Angle45`] -> Rotate mask by this much between convolutions
2282    ///
2283    /// combine: [`Combine`] -> Combine convolution results like this
2284    ///
2285    /// precision: [`Precision`] -> Convolve with this precision
2286    ///
2287    /// layers: `i32` -> Use this many layers in approximation
2288    ///
2289    /// cluster: `i32` -> Cluster lines closer than this in approximation
2290    pub fn compass_with_opts(&self, mask: &VipsImage, option: VOption) -> Result<VipsImage> {
2291        let mut out_out = VipsImage::from(null_mut());
2292        let vips_op_response = call(
2293            "compass",
2294            option
2295                .set("in", self)
2296                .set(
2297                    "out",
2298                    &mut out_out,
2299                )
2300                .set(
2301                    "mask",
2302                    mask,
2303                ),
2304        );
2305
2306        utils::result(
2307            vips_op_response,
2308            out_out,
2309            Error::OperationError("Compass (vips_compass) failed".to_string()),
2310        )
2311    }
2312
2313    /// VipsComplex2 (complex2), complex binary operations on two images
2314    /// returns `VipsImage` - Output image
2315    ///
2316    /// right: `&VipsImage` -> Right-hand image argument
2317    ///
2318    /// cmplx: `OperationComplex2` -> Binary complex operation to perform
2319    pub fn complex2(&self, right: &VipsImage, cmplx: OperationComplex2) -> Result<VipsImage> {
2320        let mut out_out = VipsImage::from(null_mut());
2321        let vips_op_response = call(
2322            "complex2",
2323            VOption::new()
2324                .set(
2325                    "left",
2326                    self,
2327                )
2328                .set(
2329                    "right",
2330                    right,
2331                )
2332                .set(
2333                    "out",
2334                    &mut out_out,
2335                )
2336                .set(
2337                    "cmplx",
2338                    cmplx as i32,
2339                ),
2340        );
2341
2342        utils::result(
2343            vips_op_response,
2344            out_out,
2345            Error::OperationError("Complex2 (vips_complex2) failed".to_string()),
2346        )
2347    }
2348
2349    /// VipsComplex (complex), perform a complex operation on an image
2350    /// returns `VipsImage` - Output image
2351    ///
2352    /// cmplx: `OperationComplex` -> Complex to perform
2353    pub fn complex(&self, cmplx: OperationComplex) -> Result<VipsImage> {
2354        let mut out_out = VipsImage::from(null_mut());
2355        let vips_op_response = call(
2356            "complex",
2357            VOption::new()
2358                .set("in", self)
2359                .set(
2360                    "out",
2361                    &mut out_out,
2362                )
2363                .set(
2364                    "cmplx",
2365                    cmplx as i32,
2366                ),
2367        );
2368
2369        utils::result(
2370            vips_op_response,
2371            out_out,
2372            Error::OperationError("Complex (vips_complex) failed".to_string()),
2373        )
2374    }
2375
2376    /// VipsComplexform (complexform), form a complex image from two real images
2377    /// returns `VipsImage` - Output image
2378    ///
2379    /// right: `&VipsImage` -> Right-hand image argument
2380    pub fn complexform(&self, right: &VipsImage) -> Result<VipsImage> {
2381        let mut out_out = VipsImage::from(null_mut());
2382        let vips_op_response = call(
2383            "complexform",
2384            VOption::new()
2385                .set(
2386                    "left",
2387                    self,
2388                )
2389                .set(
2390                    "right",
2391                    right,
2392                )
2393                .set(
2394                    "out",
2395                    &mut out_out,
2396                ),
2397        );
2398
2399        utils::result(
2400            vips_op_response,
2401            out_out,
2402            Error::OperationError("Complexform (vips_complexform) failed".to_string()),
2403        )
2404    }
2405
2406    /// VipsComplexget (complexget), get a component from a complex image
2407    /// returns `VipsImage` - Output image
2408    ///
2409    /// get: `OperationComplexget` -> Complex to perform
2410    pub fn complexget(&self, get: OperationComplexget) -> Result<VipsImage> {
2411        let mut out_out = VipsImage::from(null_mut());
2412        let vips_op_response = call(
2413            "complexget",
2414            VOption::new()
2415                .set("in", self)
2416                .set(
2417                    "out",
2418                    &mut out_out,
2419                )
2420                .set(
2421                    "get",
2422                    get as i32,
2423                ),
2424        );
2425
2426        utils::result(
2427            vips_op_response,
2428            out_out,
2429            Error::OperationError("Complexget (vips_complexget) failed".to_string()),
2430        )
2431    }
2432
2433    /// VipsComposite2 (composite2), blend a pair of images with a blend mode
2434    /// returns `VipsImage` - Output image
2435    ///
2436    /// overlay: `&VipsImage` -> Overlay image
2437    ///
2438    /// mode: `BlendMode` -> VipsBlendMode to join with
2439    pub fn composite2(&self, overlay: &VipsImage, mode: BlendMode) -> Result<VipsImage> {
2440        let mut out_out = VipsImage::from(null_mut());
2441        let vips_op_response = call(
2442            "composite2",
2443            VOption::new()
2444                .set(
2445                    "base",
2446                    self,
2447                )
2448                .set(
2449                    "overlay",
2450                    overlay,
2451                )
2452                .set(
2453                    "out",
2454                    &mut out_out,
2455                )
2456                .set(
2457                    "mode",
2458                    mode as i32,
2459                ),
2460        );
2461
2462        utils::result(
2463            vips_op_response,
2464            out_out,
2465            Error::OperationError("Composite2 (vips_composite2) failed".to_string()),
2466        )
2467    }
2468
2469    /// VipsComposite2 (composite2), blend a pair of images with a blend mode
2470    /// returns `VipsImage` - Output image
2471    ///
2472    /// overlay: `&VipsImage` -> Overlay image
2473    ///
2474    /// mode: `BlendMode` -> VipsBlendMode to join with
2475    ///
2476    /// <ins>Optional arguments</ins>
2477    ///
2478    /// x: `i32` -> x position of overlay
2479    ///
2480    /// y: `i32` -> y position of overlay
2481    ///
2482    /// compositing_space: [`Interpretation`] -> Composite images in this colour space
2483    ///
2484    /// premultiplied: `bool` -> Images have premultiplied alpha
2485    pub fn composite2_with_opts(
2486        &self,
2487        overlay: &VipsImage,
2488        mode: BlendMode,
2489        option: VOption,
2490    ) -> Result<VipsImage> {
2491        let mut out_out = VipsImage::from(null_mut());
2492        let vips_op_response = call(
2493            "composite2",
2494            option
2495                .set(
2496                    "base",
2497                    self,
2498                )
2499                .set(
2500                    "overlay",
2501                    overlay,
2502                )
2503                .set(
2504                    "out",
2505                    &mut out_out,
2506                )
2507                .set(
2508                    "mode",
2509                    mode as i32,
2510                ),
2511        );
2512
2513        utils::result(
2514            vips_op_response,
2515            out_out,
2516            Error::OperationError("Composite2 (vips_composite2) failed".to_string()),
2517        )
2518    }
2519
2520    /// VipsComposite (composite), blend an array of images with an array of blend modes
2521    /// returns `VipsImage` - Output image
2522    ///
2523    /// inp: `&[VipsImage]` -> Array of input images
2524    ///
2525    /// mode: `&[i32]` -> Array of VipsBlendMode to join with
2526    pub fn composite(inp: &[VipsImage], mode: &[i32]) -> Result<VipsImage> {
2527        let mut out_out = VipsImage::from(null_mut());
2528        let vips_op_response = call(
2529            "composite",
2530            VOption::new()
2531                .set("in", inp)
2532                .set(
2533                    "out",
2534                    &mut out_out,
2535                )
2536                .set(
2537                    "mode",
2538                    mode,
2539                ),
2540        );
2541
2542        utils::result(
2543            vips_op_response,
2544            out_out,
2545            Error::OperationError("Composite (vips_composite) failed".to_string()),
2546        )
2547    }
2548
2549    /// VipsComposite (composite), blend an array of images with an array of blend modes
2550    /// returns `VipsImage` - Output image
2551    ///
2552    /// inp: `&[VipsImage]` -> Array of input images
2553    ///
2554    /// mode: `&[i32]` -> Array of VipsBlendMode to join with
2555    ///
2556    /// <ins>Optional arguments</ins>
2557    ///
2558    /// x: `&[i32]` -> Array of x coordinates to join at
2559    ///
2560    /// y: `&[i32]` -> Array of y coordinates to join at
2561    ///
2562    /// compositing_space: [`Interpretation`] -> Composite images in this colour space
2563    ///
2564    /// premultiplied: `bool` -> Images have premultiplied alpha
2565    pub fn composite_with_opts(
2566        inp: &[VipsImage],
2567        mode: &[i32],
2568        option: VOption,
2569    ) -> Result<VipsImage> {
2570        let mut out_out = VipsImage::from(null_mut());
2571        let vips_op_response = call(
2572            "composite",
2573            option
2574                .set("in", inp)
2575                .set(
2576                    "out",
2577                    &mut out_out,
2578                )
2579                .set(
2580                    "mode",
2581                    mode,
2582                ),
2583        );
2584
2585        utils::result(
2586            vips_op_response,
2587            out_out,
2588            Error::OperationError("Composite (vips_composite) failed".to_string()),
2589        )
2590    }
2591
2592    /// VipsConv (conv), convolution operation
2593    /// returns `VipsImage` - Output image
2594    ///
2595    /// mask: `&VipsImage` -> Input matrix image
2596    pub fn conv(&self, mask: &VipsImage) -> Result<VipsImage> {
2597        let mut out_out = VipsImage::from(null_mut());
2598        let vips_op_response = call(
2599            "conv",
2600            VOption::new()
2601                .set("in", self)
2602                .set(
2603                    "out",
2604                    &mut out_out,
2605                )
2606                .set(
2607                    "mask",
2608                    mask,
2609                ),
2610        );
2611
2612        utils::result(
2613            vips_op_response,
2614            out_out,
2615            Error::OperationError("Conv (vips_conv) failed".to_string()),
2616        )
2617    }
2618
2619    /// VipsConv (conv), convolution operation
2620    /// returns `VipsImage` - Output image
2621    ///
2622    /// mask: `&VipsImage` -> Input matrix image
2623    ///
2624    /// <ins>Optional arguments</ins>
2625    ///
2626    /// precision: [`Precision`] -> Convolve with this precision
2627    ///
2628    /// layers: `i32` -> Use this many layers in approximation
2629    ///
2630    /// cluster: `i32` -> Cluster lines closer than this in approximation
2631    pub fn conv_with_opts(&self, mask: &VipsImage, option: VOption) -> Result<VipsImage> {
2632        let mut out_out = VipsImage::from(null_mut());
2633        let vips_op_response = call(
2634            "conv",
2635            option
2636                .set("in", self)
2637                .set(
2638                    "out",
2639                    &mut out_out,
2640                )
2641                .set(
2642                    "mask",
2643                    mask,
2644                ),
2645        );
2646
2647        utils::result(
2648            vips_op_response,
2649            out_out,
2650            Error::OperationError("Conv (vips_conv) failed".to_string()),
2651        )
2652    }
2653
2654    /// VipsConva (conva), approximate integer convolution
2655    /// returns `VipsImage` - Output image
2656    ///
2657    /// mask: `&VipsImage` -> Input matrix image
2658    pub fn conva(&self, mask: &VipsImage) -> Result<VipsImage> {
2659        let mut out_out = VipsImage::from(null_mut());
2660        let vips_op_response = call(
2661            "conva",
2662            VOption::new()
2663                .set("in", self)
2664                .set(
2665                    "out",
2666                    &mut out_out,
2667                )
2668                .set(
2669                    "mask",
2670                    mask,
2671                ),
2672        );
2673
2674        utils::result(
2675            vips_op_response,
2676            out_out,
2677            Error::OperationError("Conva (vips_conva) failed".to_string()),
2678        )
2679    }
2680
2681    /// VipsConva (conva), approximate integer convolution
2682    /// returns `VipsImage` - Output image
2683    ///
2684    /// mask: `&VipsImage` -> Input matrix image
2685    ///
2686    /// <ins>Optional arguments</ins>
2687    ///
2688    /// layers: `i32` -> Use this many layers in approximation
2689    ///
2690    /// cluster: `i32` -> Cluster lines closer than this in approximation
2691    pub fn conva_with_opts(&self, mask: &VipsImage, option: VOption) -> Result<VipsImage> {
2692        let mut out_out = VipsImage::from(null_mut());
2693        let vips_op_response = call(
2694            "conva",
2695            option
2696                .set("in", self)
2697                .set(
2698                    "out",
2699                    &mut out_out,
2700                )
2701                .set(
2702                    "mask",
2703                    mask,
2704                ),
2705        );
2706
2707        utils::result(
2708            vips_op_response,
2709            out_out,
2710            Error::OperationError("Conva (vips_conva) failed".to_string()),
2711        )
2712    }
2713
2714    /// VipsConvasep (convasep), approximate separable integer convolution
2715    /// returns `VipsImage` - Output image
2716    ///
2717    /// mask: `&VipsImage` -> Input matrix image
2718    pub fn convasep(&self, mask: &VipsImage) -> Result<VipsImage> {
2719        let mut out_out = VipsImage::from(null_mut());
2720        let vips_op_response = call(
2721            "convasep",
2722            VOption::new()
2723                .set("in", self)
2724                .set(
2725                    "out",
2726                    &mut out_out,
2727                )
2728                .set(
2729                    "mask",
2730                    mask,
2731                ),
2732        );
2733
2734        utils::result(
2735            vips_op_response,
2736            out_out,
2737            Error::OperationError("Convasep (vips_convasep) failed".to_string()),
2738        )
2739    }
2740
2741    /// VipsConvasep (convasep), approximate separable integer convolution
2742    /// returns `VipsImage` - Output image
2743    ///
2744    /// mask: `&VipsImage` -> Input matrix image
2745    ///
2746    /// <ins>Optional arguments</ins>
2747    ///
2748    /// layers: `i32` -> Use this many layers in approximation
2749    pub fn convasep_with_opts(&self, mask: &VipsImage, option: VOption) -> Result<VipsImage> {
2750        let mut out_out = VipsImage::from(null_mut());
2751        let vips_op_response = call(
2752            "convasep",
2753            option
2754                .set("in", self)
2755                .set(
2756                    "out",
2757                    &mut out_out,
2758                )
2759                .set(
2760                    "mask",
2761                    mask,
2762                ),
2763        );
2764
2765        utils::result(
2766            vips_op_response,
2767            out_out,
2768            Error::OperationError("Convasep (vips_convasep) failed".to_string()),
2769        )
2770    }
2771
2772    /// VipsConvf (convf), float convolution operation
2773    /// returns `VipsImage` - Output image
2774    ///
2775    /// mask: `&VipsImage` -> Input matrix image
2776    pub fn convf(&self, mask: &VipsImage) -> Result<VipsImage> {
2777        let mut out_out = VipsImage::from(null_mut());
2778        let vips_op_response = call(
2779            "convf",
2780            VOption::new()
2781                .set("in", self)
2782                .set(
2783                    "out",
2784                    &mut out_out,
2785                )
2786                .set(
2787                    "mask",
2788                    mask,
2789                ),
2790        );
2791
2792        utils::result(
2793            vips_op_response,
2794            out_out,
2795            Error::OperationError("Convf (vips_convf) failed".to_string()),
2796        )
2797    }
2798
2799    /// VipsConvi (convi), int convolution operation
2800    /// returns `VipsImage` - Output image
2801    ///
2802    /// mask: `&VipsImage` -> Input matrix image
2803    pub fn convi(&self, mask: &VipsImage) -> Result<VipsImage> {
2804        let mut out_out = VipsImage::from(null_mut());
2805        let vips_op_response = call(
2806            "convi",
2807            VOption::new()
2808                .set("in", self)
2809                .set(
2810                    "out",
2811                    &mut out_out,
2812                )
2813                .set(
2814                    "mask",
2815                    mask,
2816                ),
2817        );
2818
2819        utils::result(
2820            vips_op_response,
2821            out_out,
2822            Error::OperationError("Convi (vips_convi) failed".to_string()),
2823        )
2824    }
2825
2826    /// VipsConvsep (convsep), separable convolution operation
2827    /// returns `VipsImage` - Output image
2828    ///
2829    /// mask: `&VipsImage` -> Input matrix image
2830    pub fn convsep(&self, mask: &VipsImage) -> Result<VipsImage> {
2831        let mut out_out = VipsImage::from(null_mut());
2832        let vips_op_response = call(
2833            "convsep",
2834            VOption::new()
2835                .set("in", self)
2836                .set(
2837                    "out",
2838                    &mut out_out,
2839                )
2840                .set(
2841                    "mask",
2842                    mask,
2843                ),
2844        );
2845
2846        utils::result(
2847            vips_op_response,
2848            out_out,
2849            Error::OperationError("Convsep (vips_convsep) failed".to_string()),
2850        )
2851    }
2852
2853    /// VipsConvsep (convsep), separable convolution operation
2854    /// returns `VipsImage` - Output image
2855    ///
2856    /// mask: `&VipsImage` -> Input matrix image
2857    ///
2858    /// <ins>Optional arguments</ins>
2859    ///
2860    /// precision: [`Precision`] -> Convolve with this precision
2861    ///
2862    /// layers: `i32` -> Use this many layers in approximation
2863    ///
2864    /// cluster: `i32` -> Cluster lines closer than this in approximation
2865    pub fn convsep_with_opts(&self, mask: &VipsImage, option: VOption) -> Result<VipsImage> {
2866        let mut out_out = VipsImage::from(null_mut());
2867        let vips_op_response = call(
2868            "convsep",
2869            option
2870                .set("in", self)
2871                .set(
2872                    "out",
2873                    &mut out_out,
2874                )
2875                .set(
2876                    "mask",
2877                    mask,
2878                ),
2879        );
2880
2881        utils::result(
2882            vips_op_response,
2883            out_out,
2884            Error::OperationError("Convsep (vips_convsep) failed".to_string()),
2885        )
2886    }
2887
2888    /// VipsCopy (copy), copy an image
2889    /// returns `VipsImage` - Output image
2890    pub fn copy(&self) -> Result<VipsImage> {
2891        let mut out_out = VipsImage::from(null_mut());
2892        let vips_op_response = call(
2893            "copy",
2894            VOption::new()
2895                .set("in", self)
2896                .set(
2897                    "out",
2898                    &mut out_out,
2899                ),
2900        );
2901
2902        utils::result(
2903            vips_op_response,
2904            out_out,
2905            Error::OperationError("Copy (vips_copy) failed".to_string()),
2906        )
2907    }
2908
2909    /// VipsCopy (copy), copy an image
2910    /// returns `VipsImage` - Output image
2911    ///
2912    /// <ins>Optional arguments</ins>
2913    ///
2914    /// width: `i32` -> Image width in pixels
2915    ///
2916    /// height: `i32` -> Image height in pixels
2917    ///
2918    /// bands: `i32` -> Number of bands in image
2919    ///
2920    /// format: [`BandFormat`] -> Pixel format in image
2921    ///
2922    /// coding: [`Coding`] -> Pixel coding
2923    ///
2924    /// interpretation: [`Interpretation`] -> Pixel interpretation
2925    ///
2926    /// xres: `f64` -> Horizontal resolution in pixels/mm
2927    ///
2928    /// yres: `f64` -> Vertical resolution in pixels/mm
2929    ///
2930    /// xoffset: `i32` -> Horizontal offset of origin
2931    ///
2932    /// yoffset: `i32` -> Vertical offset of origin
2933    pub fn copy_with_opts(&self, option: VOption) -> Result<VipsImage> {
2934        let mut out_out = VipsImage::from(null_mut());
2935        let vips_op_response = call(
2936            "copy",
2937            option
2938                .set("in", self)
2939                .set(
2940                    "out",
2941                    &mut out_out,
2942                ),
2943        );
2944
2945        utils::result(
2946            vips_op_response,
2947            out_out,
2948            Error::OperationError("Copy (vips_copy) failed".to_string()),
2949        )
2950    }
2951
2952    /// VipsCountlines (countlines), count lines in an image
2953    /// returns `f64` - Number of lines
2954    ///
2955    /// direction: `Direction` -> Countlines left-right or up-down
2956    pub fn countlines(&self, direction: Direction) -> Result<f64> {
2957        let mut nolines_out: f64 = 0.0;
2958        let vips_op_response = call(
2959            "countlines",
2960            VOption::new()
2961                .set("in", self)
2962                .set(
2963                    "nolines",
2964                    &mut nolines_out,
2965                )
2966                .set(
2967                    "direction",
2968                    direction as i32,
2969                ),
2970        );
2971
2972        utils::result(
2973            vips_op_response,
2974            nolines_out,
2975            Error::OperationError("Countlines (vips_countlines) failed".to_string()),
2976        )
2977    }
2978
2979    /// VipsForeignLoadCsvFile (csvload), load csv (.csv), priority=0, untrusted, get_flags, get_flags_filename, header, load
2980    /// returns `VipsImage` - Output image
2981    ///
2982    /// filename: `&str` -> Filename to load from
2983    pub fn csvload(filename: &str) -> Result<VipsImage> {
2984        let mut out_out = VipsImage::from(null_mut());
2985        let vips_op_response = call(
2986            "csvload",
2987            VOption::new()
2988                .set(
2989                    "filename",
2990                    filename,
2991                )
2992                .set(
2993                    "out",
2994                    &mut out_out,
2995                ),
2996        );
2997
2998        utils::result(
2999            vips_op_response,
3000            out_out,
3001            Error::OperationError("Csvload (vips_csvload) failed".to_string()),
3002        )
3003    }
3004
3005    /// VipsForeignLoadCsvFile (csvload), load csv (.csv), priority=0, untrusted, get_flags, get_flags_filename, header, load
3006    /// returns `VipsImage` - Output image
3007    ///
3008    /// filename: `&str` -> Filename to load from
3009    ///
3010    /// <ins>Optional arguments</ins>
3011    ///
3012    /// skip: `i32` -> Skip this many lines at the start of the file
3013    ///
3014    /// lines: `i32` -> Read this many lines from the file
3015    ///
3016    /// whitespace: `&str` -> Set of whitespace characters
3017    ///
3018    /// separator: `&str` -> Set of separator characters
3019    ///
3020    /// flags: [`ForeignFlags`] -> Flags for this file
3021    ///
3022    /// memory: `bool` -> Force open via memory
3023    ///
3024    /// access: [`Access`] -> Required access pattern for this file
3025    ///
3026    /// fail_on: [`FailOn`] -> Error level to fail on
3027    ///
3028    /// revalidate: `bool` -> Don't use a cached result for this operation
3029    pub fn csvload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
3030        let mut out_out = VipsImage::from(null_mut());
3031        let vips_op_response = call(
3032            "csvload",
3033            option
3034                .set(
3035                    "filename",
3036                    filename,
3037                )
3038                .set(
3039                    "out",
3040                    &mut out_out,
3041                ),
3042        );
3043
3044        utils::result(
3045            vips_op_response,
3046            out_out,
3047            Error::OperationError("Csvload (vips_csvload) failed".to_string()),
3048        )
3049    }
3050
3051    /// VipsForeignLoadCsvSource (csvload_source), load csv, priority=0, untrusted, is_a_source, get_flags, header, load
3052    /// returns `VipsImage` - Output image
3053    ///
3054    /// source: `&VipsSource` -> Source to load from
3055    pub fn csvload_source(source: &VipsSource) -> Result<VipsImage> {
3056        let mut out_out = VipsImage::from(null_mut());
3057        let vips_op_response = call(
3058            "csvload_source",
3059            VOption::new()
3060                .set(
3061                    "source",
3062                    source,
3063                )
3064                .set(
3065                    "out",
3066                    &mut out_out,
3067                ),
3068        );
3069
3070        utils::result(
3071            vips_op_response,
3072            out_out,
3073            Error::OperationError("CsvloadSource (vips_csvload_source) failed".to_string()),
3074        )
3075    }
3076
3077    /// VipsForeignLoadCsvSource (csvload_source), load csv, priority=0, untrusted, is_a_source, get_flags, header, load
3078    /// returns `VipsImage` - Output image
3079    ///
3080    /// source: `&VipsSource` -> Source to load from
3081    ///
3082    /// <ins>Optional arguments</ins>
3083    ///
3084    /// skip: `i32` -> Skip this many lines at the start of the file
3085    ///
3086    /// lines: `i32` -> Read this many lines from the file
3087    ///
3088    /// whitespace: `&str` -> Set of whitespace characters
3089    ///
3090    /// separator: `&str` -> Set of separator characters
3091    ///
3092    /// flags: [`ForeignFlags`] -> Flags for this file
3093    ///
3094    /// memory: `bool` -> Force open via memory
3095    ///
3096    /// access: [`Access`] -> Required access pattern for this file
3097    ///
3098    /// fail_on: [`FailOn`] -> Error level to fail on
3099    ///
3100    /// revalidate: `bool` -> Don't use a cached result for this operation
3101    pub fn csvload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
3102        let mut out_out = VipsImage::from(null_mut());
3103        let vips_op_response = call(
3104            "csvload_source",
3105            option
3106                .set(
3107                    "source",
3108                    source,
3109                )
3110                .set(
3111                    "out",
3112                    &mut out_out,
3113                ),
3114        );
3115
3116        utils::result(
3117            vips_op_response,
3118            out_out,
3119            Error::OperationError("CsvloadSource (vips_csvload_source) failed".to_string()),
3120        )
3121    }
3122
3123    /// VipsForeignSaveCsvFile (csvsave), save image to csv (.csv), priority=0, mono
3124    ///
3125    /// filename: `&str` -> Filename to save to
3126    pub fn csvsave(&self, filename: &str) -> Result<()> {
3127        let vips_op_response = call(
3128            "csvsave",
3129            VOption::new()
3130                .set("in", self)
3131                .set(
3132                    "filename",
3133                    filename,
3134                ),
3135        );
3136
3137        utils::result(
3138            vips_op_response,
3139            (),
3140            Error::OperationError("Csvsave (vips_csvsave) failed".to_string()),
3141        )
3142    }
3143
3144    /// VipsForeignSaveCsvFile (csvsave), save image to csv (.csv), priority=0, mono
3145    ///
3146    /// filename: `&str` -> Filename to save to
3147    ///
3148    /// <ins>Optional arguments</ins>
3149    ///
3150    /// separator: `&str` -> Separator characters
3151    ///
3152    /// keep: [`ForeignKeep`] -> Which metadata to retain
3153    ///
3154    /// background: `&[f64]` -> Background value
3155    ///
3156    /// page_height: `i32` -> Set page height for multipage save
3157    ///
3158    /// profile: `&str` -> Filename of ICC profile to embed
3159    pub fn csvsave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
3160        let vips_op_response = call(
3161            "csvsave",
3162            option
3163                .set("in", self)
3164                .set(
3165                    "filename",
3166                    filename,
3167                ),
3168        );
3169
3170        utils::result(
3171            vips_op_response,
3172            (),
3173            Error::OperationError("Csvsave (vips_csvsave) failed".to_string()),
3174        )
3175    }
3176
3177    /// VipsForeignSaveCsvTarget (csvsave_target), save image to csv (.csv), priority=0, mono
3178    ///
3179    /// target: `&VipsTarget` -> Target to save to
3180    pub fn csvsave_target(&self, target: &VipsTarget) -> Result<()> {
3181        let vips_op_response = call(
3182            "csvsave_target",
3183            VOption::new()
3184                .set("in", self)
3185                .set(
3186                    "target",
3187                    target,
3188                ),
3189        );
3190
3191        utils::result(
3192            vips_op_response,
3193            (),
3194            Error::OperationError("CsvsaveTarget (vips_csvsave_target) failed".to_string()),
3195        )
3196    }
3197
3198    /// VipsForeignSaveCsvTarget (csvsave_target), save image to csv (.csv), priority=0, mono
3199    ///
3200    /// target: `&VipsTarget` -> Target to save to
3201    ///
3202    /// <ins>Optional arguments</ins>
3203    ///
3204    /// separator: `&str` -> Separator characters
3205    ///
3206    /// keep: [`ForeignKeep`] -> Which metadata to retain
3207    ///
3208    /// background: `&[f64]` -> Background value
3209    ///
3210    /// page_height: `i32` -> Set page height for multipage save
3211    ///
3212    /// profile: `&str` -> Filename of ICC profile to embed
3213    pub fn csvsave_target_with_opts(&self, target: &VipsTarget, option: VOption) -> Result<()> {
3214        let vips_op_response = call(
3215            "csvsave_target",
3216            option
3217                .set("in", self)
3218                .set(
3219                    "target",
3220                    target,
3221                ),
3222        );
3223
3224        utils::result(
3225            vips_op_response,
3226            (),
3227            Error::OperationError("CsvsaveTarget (vips_csvsave_target) failed".to_string()),
3228        )
3229    }
3230
3231    /// VipsdE00 (dE00), calculate dE00
3232    /// returns `VipsImage` - Output image
3233    ///
3234    /// right: `&VipsImage` -> Right-hand input image
3235    pub fn dE00(&self, right: &VipsImage) -> Result<VipsImage> {
3236        let mut out_out = VipsImage::from(null_mut());
3237        let vips_op_response = call(
3238            "dE00",
3239            VOption::new()
3240                .set(
3241                    "left",
3242                    self,
3243                )
3244                .set(
3245                    "right",
3246                    right,
3247                )
3248                .set(
3249                    "out",
3250                    &mut out_out,
3251                ),
3252        );
3253
3254        utils::result(
3255            vips_op_response,
3256            out_out,
3257            Error::OperationError("DE00 (vips_dE00) failed".to_string()),
3258        )
3259    }
3260
3261    /// VipsdE76 (dE76), calculate dE76
3262    /// returns `VipsImage` - Output image
3263    ///
3264    /// right: `&VipsImage` -> Right-hand input image
3265    pub fn dE76(&self, right: &VipsImage) -> Result<VipsImage> {
3266        let mut out_out = VipsImage::from(null_mut());
3267        let vips_op_response = call(
3268            "dE76",
3269            VOption::new()
3270                .set(
3271                    "left",
3272                    self,
3273                )
3274                .set(
3275                    "right",
3276                    right,
3277                )
3278                .set(
3279                    "out",
3280                    &mut out_out,
3281                ),
3282        );
3283
3284        utils::result(
3285            vips_op_response,
3286            out_out,
3287            Error::OperationError("DE76 (vips_dE76) failed".to_string()),
3288        )
3289    }
3290
3291    /// VipsdECMC (dECMC), calculate dECMC
3292    /// returns `VipsImage` - Output image
3293    ///
3294    /// right: `&VipsImage` -> Right-hand input image
3295    pub fn dECMC(&self, right: &VipsImage) -> Result<VipsImage> {
3296        let mut out_out = VipsImage::from(null_mut());
3297        let vips_op_response = call(
3298            "dECMC",
3299            VOption::new()
3300                .set(
3301                    "left",
3302                    self,
3303                )
3304                .set(
3305                    "right",
3306                    right,
3307                )
3308                .set(
3309                    "out",
3310                    &mut out_out,
3311                ),
3312        );
3313
3314        utils::result(
3315            vips_op_response,
3316            out_out,
3317            Error::OperationError("DEcmc (vips_dECMC) failed".to_string()),
3318        )
3319    }
3320
3321    /// VipsDeviate (deviate), find image standard deviation
3322    /// returns `f64` - Output value
3323    pub fn deviate(&self) -> Result<f64> {
3324        let mut out_out: f64 = 0.0;
3325        let vips_op_response = call(
3326            "deviate",
3327            VOption::new()
3328                .set("in", self)
3329                .set(
3330                    "out",
3331                    &mut out_out,
3332                ),
3333        );
3334
3335        utils::result(
3336            vips_op_response,
3337            out_out,
3338            Error::OperationError("Deviate (vips_deviate) failed".to_string()),
3339        )
3340    }
3341
3342    /// VipsDivide (divide), divide two images
3343    /// returns `VipsImage` - Output image
3344    ///
3345    /// right: `&VipsImage` -> Right-hand image argument
3346    pub fn divide(&self, right: &VipsImage) -> Result<VipsImage> {
3347        let mut out_out = VipsImage::from(null_mut());
3348        let vips_op_response = call(
3349            "divide",
3350            VOption::new()
3351                .set(
3352                    "left",
3353                    self,
3354                )
3355                .set(
3356                    "right",
3357                    right,
3358                )
3359                .set(
3360                    "out",
3361                    &mut out_out,
3362                ),
3363        );
3364
3365        utils::result(
3366            vips_op_response,
3367            out_out,
3368            Error::OperationError("Divide (vips_divide) failed".to_string()),
3369        )
3370    }
3371
3372    /// VipsDrawCircle (draw_circle), draw a circle on an image
3373    ///
3374    /// ink: `&[f64]` -> Color for pixels
3375    ///
3376    /// cx: `i32` -> Centre of draw_circle
3377    ///
3378    /// cy: `i32` -> Centre of draw_circle
3379    ///
3380    /// radius: `i32` -> Radius in pixels
3381    pub fn draw_circle(&self, ink: &[f64], cx: i32, cy: i32, radius: i32) -> Result<()> {
3382        let vips_op_response = call(
3383            "draw_circle",
3384            VOption::new()
3385                .set(
3386                    "image",
3387                    self,
3388                )
3389                .set("ink", ink)
3390                .set("cx", cx)
3391                .set("cy", cy)
3392                .set(
3393                    "radius",
3394                    radius,
3395                ),
3396        );
3397
3398        utils::result(
3399            vips_op_response,
3400            (),
3401            Error::OperationError("DrawCircle (vips_draw_circle) failed".to_string()),
3402        )
3403    }
3404
3405    /// VipsDrawCircle (draw_circle), draw a circle on an image
3406    ///
3407    /// ink: `&[f64]` -> Color for pixels
3408    ///
3409    /// cx: `i32` -> Centre of draw_circle
3410    ///
3411    /// cy: `i32` -> Centre of draw_circle
3412    ///
3413    /// radius: `i32` -> Radius in pixels
3414    ///
3415    /// <ins>Optional arguments</ins>
3416    ///
3417    /// fill: `bool` -> Draw a solid object
3418    pub fn draw_circle_with_opts(
3419        &self,
3420        ink: &[f64],
3421        cx: i32,
3422        cy: i32,
3423        radius: i32,
3424        option: VOption,
3425    ) -> Result<()> {
3426        let vips_op_response = call(
3427            "draw_circle",
3428            option
3429                .set(
3430                    "image",
3431                    self,
3432                )
3433                .set("ink", ink)
3434                .set("cx", cx)
3435                .set("cy", cy)
3436                .set(
3437                    "radius",
3438                    radius,
3439                ),
3440        );
3441
3442        utils::result(
3443            vips_op_response,
3444            (),
3445            Error::OperationError("DrawCircle (vips_draw_circle) failed".to_string()),
3446        )
3447    }
3448
3449    /// VipsDrawFlood (draw_flood), flood-fill an area
3450    ///
3451    /// ink: `&[f64]` -> Color for pixels
3452    ///
3453    /// x: `i32` -> DrawFlood start point
3454    ///
3455    /// y: `i32` -> DrawFlood start point
3456    pub fn draw_flood(&self, ink: &[f64], x: i32, y: i32) -> Result<()> {
3457        let vips_op_response = call(
3458            "draw_flood",
3459            VOption::new()
3460                .set(
3461                    "image",
3462                    self,
3463                )
3464                .set("ink", ink)
3465                .set("x", x)
3466                .set("y", y),
3467        );
3468
3469        utils::result(
3470            vips_op_response,
3471            (),
3472            Error::OperationError("DrawFlood (vips_draw_flood) failed".to_string()),
3473        )
3474    }
3475
3476    /// VipsDrawFlood (draw_flood), flood-fill an area
3477    ///
3478    /// ink: `&[f64]` -> Color for pixels
3479    ///
3480    /// x: `i32` -> DrawFlood start point
3481    ///
3482    /// y: `i32` -> DrawFlood start point
3483    ///
3484    /// <ins>Optional arguments</ins>
3485    ///
3486    /// test: `` -> Test pixels in this image
3487    ///
3488    /// equal: `bool` -> DrawFlood while equal to edge
3489    ///
3490    /// left: `&mut i32` -> Left edge of modified area
3491    ///
3492    /// top: `&mut i32` -> Top edge of modified area
3493    ///
3494    /// width: `&mut i32` -> Width of modified area
3495    ///
3496    /// height: `&mut i32` -> Height of modified area
3497    pub fn draw_flood_with_opts(&self, ink: &[f64], x: i32, y: i32, option: VOption) -> Result<()> {
3498        let vips_op_response = call(
3499            "draw_flood",
3500            option
3501                .set(
3502                    "image",
3503                    self,
3504                )
3505                .set("ink", ink)
3506                .set("x", x)
3507                .set("y", y),
3508        );
3509
3510        utils::result(
3511            vips_op_response,
3512            (),
3513            Error::OperationError("DrawFlood (vips_draw_flood) failed".to_string()),
3514        )
3515    }
3516
3517    /// VipsDrawImage (draw_image), paint an image into another image
3518    ///
3519    /// sub: `&VipsImage` -> Sub-image to insert into main image
3520    ///
3521    /// x: `i32` -> Draw image here
3522    ///
3523    /// y: `i32` -> Draw image here
3524    pub fn draw_image(&self, sub: &VipsImage, x: i32, y: i32) -> Result<()> {
3525        let vips_op_response = call(
3526            "draw_image",
3527            VOption::new()
3528                .set(
3529                    "image",
3530                    self,
3531                )
3532                .set("sub", sub)
3533                .set("x", x)
3534                .set("y", y),
3535        );
3536
3537        utils::result(
3538            vips_op_response,
3539            (),
3540            Error::OperationError("DrawImage (vips_draw_image) failed".to_string()),
3541        )
3542    }
3543
3544    /// VipsDrawImage (draw_image), paint an image into another image
3545    ///
3546    /// sub: `&VipsImage` -> Sub-image to insert into main image
3547    ///
3548    /// x: `i32` -> Draw image here
3549    ///
3550    /// y: `i32` -> Draw image here
3551    ///
3552    /// <ins>Optional arguments</ins>
3553    ///
3554    /// mode: [`CombineMode`] -> Combining mode
3555    pub fn draw_image_with_opts(
3556        &self,
3557        sub: &VipsImage,
3558        x: i32,
3559        y: i32,
3560        option: VOption,
3561    ) -> Result<()> {
3562        let vips_op_response = call(
3563            "draw_image",
3564            option
3565                .set(
3566                    "image",
3567                    self,
3568                )
3569                .set("sub", sub)
3570                .set("x", x)
3571                .set("y", y),
3572        );
3573
3574        utils::result(
3575            vips_op_response,
3576            (),
3577            Error::OperationError("DrawImage (vips_draw_image) failed".to_string()),
3578        )
3579    }
3580
3581    /// VipsDrawLine (draw_line), draw a line on an image
3582    ///
3583    /// ink: `&[f64]` -> Color for pixels
3584    ///
3585    /// x1: `i32` -> Start of draw_line
3586    ///
3587    /// y1: `i32` -> Start of draw_line
3588    ///
3589    /// x2: `i32` -> End of draw_line
3590    ///
3591    /// y2: `i32` -> End of draw_line
3592    pub fn draw_line(&self, ink: &[f64], x1: i32, y1: i32, x2: i32, y2: i32) -> Result<()> {
3593        let vips_op_response = call(
3594            "draw_line",
3595            VOption::new()
3596                .set(
3597                    "image",
3598                    self,
3599                )
3600                .set("ink", ink)
3601                .set("x1", x1)
3602                .set("y1", y1)
3603                .set("x2", x2)
3604                .set("y2", y2),
3605        );
3606
3607        utils::result(
3608            vips_op_response,
3609            (),
3610            Error::OperationError("DrawLine (vips_draw_line) failed".to_string()),
3611        )
3612    }
3613
3614    /// VipsDrawMask (draw_mask), draw a mask on an image
3615    ///
3616    /// ink: `&[f64]` -> Color for pixels
3617    ///
3618    /// mask: `&VipsImage` -> Mask of pixels to draw
3619    ///
3620    /// x: `i32` -> Draw mask here
3621    ///
3622    /// y: `i32` -> Draw mask here
3623    pub fn draw_mask(&self, ink: &[f64], mask: &VipsImage, x: i32, y: i32) -> Result<()> {
3624        let vips_op_response = call(
3625            "draw_mask",
3626            VOption::new()
3627                .set(
3628                    "image",
3629                    self,
3630                )
3631                .set("ink", ink)
3632                .set(
3633                    "mask",
3634                    mask,
3635                )
3636                .set("x", x)
3637                .set("y", y),
3638        );
3639
3640        utils::result(
3641            vips_op_response,
3642            (),
3643            Error::OperationError("DrawMask (vips_draw_mask) failed".to_string()),
3644        )
3645    }
3646
3647    /// VipsDrawRect (draw_rect), paint a rectangle on an image
3648    ///
3649    /// ink: `&[f64]` -> Color for pixels
3650    ///
3651    /// left: `i32` -> Rect to fill
3652    ///
3653    /// top: `i32` -> Rect to fill
3654    ///
3655    /// width: `i32` -> Rect to fill
3656    ///
3657    /// height: `i32` -> Rect to fill
3658    pub fn draw_rect(
3659        &self,
3660        ink: &[f64],
3661        left: i32,
3662        top: i32,
3663        width: i32,
3664        height: i32,
3665    ) -> Result<()> {
3666        let vips_op_response = call(
3667            "draw_rect",
3668            VOption::new()
3669                .set(
3670                    "image",
3671                    self,
3672                )
3673                .set("ink", ink)
3674                .set(
3675                    "left",
3676                    left,
3677                )
3678                .set("top", top)
3679                .set(
3680                    "width",
3681                    width,
3682                )
3683                .set(
3684                    "height",
3685                    height,
3686                ),
3687        );
3688
3689        utils::result(
3690            vips_op_response,
3691            (),
3692            Error::OperationError("DrawRect (vips_draw_rect) failed".to_string()),
3693        )
3694    }
3695
3696    /// VipsDrawRect (draw_rect), paint a rectangle on an image
3697    ///
3698    /// ink: `&[f64]` -> Color for pixels
3699    ///
3700    /// left: `i32` -> Rect to fill
3701    ///
3702    /// top: `i32` -> Rect to fill
3703    ///
3704    /// width: `i32` -> Rect to fill
3705    ///
3706    /// height: `i32` -> Rect to fill
3707    ///
3708    /// <ins>Optional arguments</ins>
3709    ///
3710    /// fill: `bool` -> Draw a solid object
3711    pub fn draw_rect_with_opts(
3712        &self,
3713        ink: &[f64],
3714        left: i32,
3715        top: i32,
3716        width: i32,
3717        height: i32,
3718        option: VOption,
3719    ) -> Result<()> {
3720        let vips_op_response = call(
3721            "draw_rect",
3722            option
3723                .set(
3724                    "image",
3725                    self,
3726                )
3727                .set("ink", ink)
3728                .set(
3729                    "left",
3730                    left,
3731                )
3732                .set("top", top)
3733                .set(
3734                    "width",
3735                    width,
3736                )
3737                .set(
3738                    "height",
3739                    height,
3740                ),
3741        );
3742
3743        utils::result(
3744            vips_op_response,
3745            (),
3746            Error::OperationError("DrawRect (vips_draw_rect) failed".to_string()),
3747        )
3748    }
3749
3750    /// VipsDrawSmudge (draw_smudge), blur a rectangle on an image
3751    ///
3752    /// left: `i32` -> Rect to fill
3753    ///
3754    /// top: `i32` -> Rect to fill
3755    ///
3756    /// width: `i32` -> Rect to fill
3757    ///
3758    /// height: `i32` -> Rect to fill
3759    pub fn draw_smudge(&self, left: i32, top: i32, width: i32, height: i32) -> Result<()> {
3760        let vips_op_response = call(
3761            "draw_smudge",
3762            VOption::new()
3763                .set(
3764                    "image",
3765                    self,
3766                )
3767                .set(
3768                    "left",
3769                    left,
3770                )
3771                .set("top", top)
3772                .set(
3773                    "width",
3774                    width,
3775                )
3776                .set(
3777                    "height",
3778                    height,
3779                ),
3780        );
3781
3782        utils::result(
3783            vips_op_response,
3784            (),
3785            Error::OperationError("DrawSmudge (vips_draw_smudge) failed".to_string()),
3786        )
3787    }
3788
3789    /// VipsForeignSaveDzFile (dzsave), save image to deepzoom file (.dz, .szi), priority=0,
3790    ///
3791    /// filename: `&str` -> Filename to save to
3792    pub fn dzsave(&self, filename: &str) -> Result<()> {
3793        let vips_op_response = call(
3794            "dzsave",
3795            VOption::new()
3796                .set("in", self)
3797                .set(
3798                    "filename",
3799                    filename,
3800                ),
3801        );
3802
3803        utils::result(
3804            vips_op_response,
3805            (),
3806            Error::OperationError("Dzsave (vips_dzsave) failed".to_string()),
3807        )
3808    }
3809
3810    /// VipsForeignSaveDzFile (dzsave), save image to deepzoom file (.dz, .szi), priority=0,
3811    ///
3812    /// filename: `&str` -> Filename to save to
3813    ///
3814    /// <ins>Optional arguments</ins>
3815    ///
3816    /// imagename: `&str` -> Image name
3817    ///
3818    /// layout: [`ForeignDzLayout`] -> Directory layout
3819    ///
3820    /// suffix: `&str` -> Filename suffix for tiles
3821    ///
3822    /// overlap: `i32` -> Tile overlap in pixels
3823    ///
3824    /// tile_size: `i32` -> Tile size in pixels
3825    ///
3826    /// centre: `bool` -> Center image in tile
3827    ///
3828    /// depth: [`ForeignDzDepth`] -> Pyramid depth
3829    ///
3830    /// angle: [`Angle`] -> Rotate image during save
3831    ///
3832    /// container: [`ForeignDzContainer`] -> Pyramid container type
3833    ///
3834    /// compression: `i32` -> ZIP deflate compression level
3835    ///
3836    /// region_shrink: [`RegionShrink`] -> Method to shrink regions
3837    ///
3838    /// skip_blanks: `i32` -> Skip tiles which are nearly equal to the background
3839    ///
3840    /// id: `&str` -> Resource ID
3841    ///
3842    /// Q: `i32` -> Q factor
3843    ///
3844    /// keep: [`ForeignKeep`] -> Which metadata to retain
3845    ///
3846    /// background: `&[f64]` -> Background value
3847    ///
3848    /// page_height: `i32` -> Set page height for multipage save
3849    ///
3850    /// profile: `&str` -> Filename of ICC profile to embed
3851    pub fn dzsave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
3852        let vips_op_response = call(
3853            "dzsave",
3854            option
3855                .set("in", self)
3856                .set(
3857                    "filename",
3858                    filename,
3859                ),
3860        );
3861
3862        utils::result(
3863            vips_op_response,
3864            (),
3865            Error::OperationError("Dzsave (vips_dzsave) failed".to_string()),
3866        )
3867    }
3868
3869    /// VipsForeignSaveDzBuffer (dzsave_buffer), save image to dz buffer (.dz, .szi), priority=0,
3870    /// returns `Vec<u8>` - Buffer to save to
3871    pub fn dzsave_buffer(&self) -> Result<Vec<u8>> {
3872        let mut buffer_out = VipsBlob::from(null_mut());
3873        let vips_op_response = call(
3874            "dzsave_buffer",
3875            VOption::new()
3876                .set("in", self)
3877                .set(
3878                    "buffer",
3879                    &mut buffer_out,
3880                ),
3881        );
3882
3883        utils::result(
3884            vips_op_response,
3885            buffer_out.into(),
3886            Error::OperationError("DzsaveBuffer (vips_dzsave_buffer) failed".to_string()),
3887        )
3888    }
3889
3890    /// VipsForeignSaveDzBuffer (dzsave_buffer), save image to dz buffer (.dz, .szi), priority=0,
3891    /// returns `Vec<u8>` - Buffer to save to
3892    ///
3893    /// <ins>Optional arguments</ins>
3894    ///
3895    /// imagename: `&str` -> Image name
3896    ///
3897    /// layout: [`ForeignDzLayout`] -> Directory layout
3898    ///
3899    /// suffix: `&str` -> Filename suffix for tiles
3900    ///
3901    /// overlap: `i32` -> Tile overlap in pixels
3902    ///
3903    /// tile_size: `i32` -> Tile size in pixels
3904    ///
3905    /// centre: `bool` -> Center image in tile
3906    ///
3907    /// depth: [`ForeignDzDepth`] -> Pyramid depth
3908    ///
3909    /// angle: [`Angle`] -> Rotate image during save
3910    ///
3911    /// container: [`ForeignDzContainer`] -> Pyramid container type
3912    ///
3913    /// compression: `i32` -> ZIP deflate compression level
3914    ///
3915    /// region_shrink: [`RegionShrink`] -> Method to shrink regions
3916    ///
3917    /// skip_blanks: `i32` -> Skip tiles which are nearly equal to the background
3918    ///
3919    /// id: `&str` -> Resource ID
3920    ///
3921    /// Q: `i32` -> Q factor
3922    ///
3923    /// keep: [`ForeignKeep`] -> Which metadata to retain
3924    ///
3925    /// background: `&[f64]` -> Background value
3926    ///
3927    /// page_height: `i32` -> Set page height for multipage save
3928    ///
3929    /// profile: `&str` -> Filename of ICC profile to embed
3930    pub fn dzsave_buffer_with_opts(&self, option: VOption) -> Result<Vec<u8>> {
3931        let mut buffer_out = VipsBlob::from(null_mut());
3932        let vips_op_response = call(
3933            "dzsave_buffer",
3934            option
3935                .set("in", self)
3936                .set(
3937                    "buffer",
3938                    &mut buffer_out,
3939                ),
3940        );
3941
3942        utils::result(
3943            vips_op_response,
3944            buffer_out.into(),
3945            Error::OperationError("DzsaveBuffer (vips_dzsave_buffer) failed".to_string()),
3946        )
3947    }
3948
3949    /// VipsForeignSaveDzTarget (dzsave_target), save image to deepzoom target (.dz, .szi), priority=0,
3950    ///
3951    /// target: `&VipsTarget` -> Target to save to
3952    pub fn dzsave_target(&self, target: &VipsTarget) -> Result<()> {
3953        let vips_op_response = call(
3954            "dzsave_target",
3955            VOption::new()
3956                .set("in", self)
3957                .set(
3958                    "target",
3959                    target,
3960                ),
3961        );
3962
3963        utils::result(
3964            vips_op_response,
3965            (),
3966            Error::OperationError("DzsaveTarget (vips_dzsave_target) failed".to_string()),
3967        )
3968    }
3969
3970    /// VipsForeignSaveDzTarget (dzsave_target), save image to deepzoom target (.dz, .szi), priority=0,
3971    ///
3972    /// target: `&VipsTarget` -> Target to save to
3973    ///
3974    /// <ins>Optional arguments</ins>
3975    ///
3976    /// imagename: `&str` -> Image name
3977    ///
3978    /// layout: [`ForeignDzLayout`] -> Directory layout
3979    ///
3980    /// suffix: `&str` -> Filename suffix for tiles
3981    ///
3982    /// overlap: `i32` -> Tile overlap in pixels
3983    ///
3984    /// tile_size: `i32` -> Tile size in pixels
3985    ///
3986    /// centre: `bool` -> Center image in tile
3987    ///
3988    /// depth: [`ForeignDzDepth`] -> Pyramid depth
3989    ///
3990    /// angle: [`Angle`] -> Rotate image during save
3991    ///
3992    /// container: [`ForeignDzContainer`] -> Pyramid container type
3993    ///
3994    /// compression: `i32` -> ZIP deflate compression level
3995    ///
3996    /// region_shrink: [`RegionShrink`] -> Method to shrink regions
3997    ///
3998    /// skip_blanks: `i32` -> Skip tiles which are nearly equal to the background
3999    ///
4000    /// id: `&str` -> Resource ID
4001    ///
4002    /// Q: `i32` -> Q factor
4003    ///
4004    /// keep: [`ForeignKeep`] -> Which metadata to retain
4005    ///
4006    /// background: `&[f64]` -> Background value
4007    ///
4008    /// page_height: `i32` -> Set page height for multipage save
4009    ///
4010    /// profile: `&str` -> Filename of ICC profile to embed
4011    pub fn dzsave_target_with_opts(&self, target: &VipsTarget, option: VOption) -> Result<()> {
4012        let vips_op_response = call(
4013            "dzsave_target",
4014            option
4015                .set("in", self)
4016                .set(
4017                    "target",
4018                    target,
4019                ),
4020        );
4021
4022        utils::result(
4023            vips_op_response,
4024            (),
4025            Error::OperationError("DzsaveTarget (vips_dzsave_target) failed".to_string()),
4026        )
4027    }
4028
4029    /// VipsEmbed (embed), embed an image in a larger image
4030    /// returns `VipsImage` - Output image
4031    ///
4032    /// x: `i32` -> Left edge of input in output
4033    ///
4034    /// y: `i32` -> Top edge of input in output
4035    ///
4036    /// width: `i32` -> Image width in pixels
4037    ///
4038    /// height: `i32` -> Image height in pixels
4039    pub fn embed(&self, x: i32, y: i32, width: i32, height: i32) -> Result<VipsImage> {
4040        let mut out_out = VipsImage::from(null_mut());
4041        let vips_op_response = call(
4042            "embed",
4043            VOption::new()
4044                .set("in", self)
4045                .set(
4046                    "out",
4047                    &mut out_out,
4048                )
4049                .set("x", x)
4050                .set("y", y)
4051                .set(
4052                    "width",
4053                    width,
4054                )
4055                .set(
4056                    "height",
4057                    height,
4058                ),
4059        );
4060
4061        utils::result(
4062            vips_op_response,
4063            out_out,
4064            Error::OperationError("Embed (vips_embed) failed".to_string()),
4065        )
4066    }
4067
4068    /// VipsEmbed (embed), embed an image in a larger image
4069    /// returns `VipsImage` - Output image
4070    ///
4071    /// x: `i32` -> Left edge of input in output
4072    ///
4073    /// y: `i32` -> Top edge of input in output
4074    ///
4075    /// width: `i32` -> Image width in pixels
4076    ///
4077    /// height: `i32` -> Image height in pixels
4078    ///
4079    /// <ins>Optional arguments</ins>
4080    ///
4081    /// extend: [`Extend`] -> How to generate the extra pixels
4082    ///
4083    /// background: `&[f64]` -> Color for background pixels
4084    pub fn embed_with_opts(
4085        &self,
4086        x: i32,
4087        y: i32,
4088        width: i32,
4089        height: i32,
4090        option: VOption,
4091    ) -> Result<VipsImage> {
4092        let mut out_out = VipsImage::from(null_mut());
4093        let vips_op_response = call(
4094            "embed",
4095            option
4096                .set("in", self)
4097                .set(
4098                    "out",
4099                    &mut out_out,
4100                )
4101                .set("x", x)
4102                .set("y", y)
4103                .set(
4104                    "width",
4105                    width,
4106                )
4107                .set(
4108                    "height",
4109                    height,
4110                ),
4111        );
4112
4113        utils::result(
4114            vips_op_response,
4115            out_out,
4116            Error::OperationError("Embed (vips_embed) failed".to_string()),
4117        )
4118    }
4119
4120    /// VipsExtractArea (extract_area), extract an area from an image
4121    /// returns `VipsImage` - Output image
4122    ///
4123    /// left: `i32` -> Left edge of extract area
4124    ///
4125    /// top: `i32` -> Top edge of extract area
4126    ///
4127    /// width: `i32` -> Width of extract area
4128    ///
4129    /// height: `i32` -> Height of extract area
4130    pub fn extract_area(&self, left: i32, top: i32, width: i32, height: i32) -> Result<VipsImage> {
4131        let mut out_out = VipsImage::from(null_mut());
4132        let vips_op_response = call(
4133            "extract_area",
4134            VOption::new()
4135                .set(
4136                    "input",
4137                    self,
4138                )
4139                .set(
4140                    "out",
4141                    &mut out_out,
4142                )
4143                .set(
4144                    "left",
4145                    left,
4146                )
4147                .set("top", top)
4148                .set(
4149                    "width",
4150                    width,
4151                )
4152                .set(
4153                    "height",
4154                    height,
4155                ),
4156        );
4157
4158        utils::result(
4159            vips_op_response,
4160            out_out,
4161            Error::OperationError("ExtractArea (vips_extract_area) failed".to_string()),
4162        )
4163    }
4164
4165    /// crop (extract_area), extract an area from an image
4166    /// returns `VipsImage` - Output image
4167    ///
4168    /// left: `i32` -> Left edge of extract area
4169    ///
4170    /// top: `i32` -> Top edge of extract area
4171    ///
4172    /// width: `i32` -> Width of extract area
4173    ///
4174    /// height: `i32` -> Height of extract area
4175    pub fn crop(&self, left: i32, top: i32, width: i32, height: i32) -> Result<VipsImage> {
4176        let mut out_out = VipsImage::from(null_mut());
4177        let vips_op_response = call(
4178            "crop",
4179            VOption::new()
4180                .set(
4181                    "input",
4182                    self,
4183                )
4184                .set(
4185                    "out",
4186                    &mut out_out,
4187                )
4188                .set(
4189                    "left",
4190                    left,
4191                )
4192                .set("top", top)
4193                .set(
4194                    "width",
4195                    width,
4196                )
4197                .set(
4198                    "height",
4199                    height,
4200                ),
4201        );
4202
4203        utils::result(
4204            vips_op_response,
4205            out_out,
4206            Error::OperationError("Crop (vips_crop) failed".to_string()),
4207        )
4208    }
4209
4210    /// VipsExtractBand (extract_band), extract band from an image
4211    /// returns `VipsImage` - Output image
4212    ///
4213    /// band: `i32` -> Band to extract
4214    pub fn extract_band(&self, band: i32) -> Result<VipsImage> {
4215        let mut out_out = VipsImage::from(null_mut());
4216        let vips_op_response = call(
4217            "extract_band",
4218            VOption::new()
4219                .set("in", self)
4220                .set(
4221                    "out",
4222                    &mut out_out,
4223                )
4224                .set(
4225                    "band",
4226                    band,
4227                ),
4228        );
4229
4230        utils::result(
4231            vips_op_response,
4232            out_out,
4233            Error::OperationError("ExtractBand (vips_extract_band) failed".to_string()),
4234        )
4235    }
4236
4237    /// VipsExtractBand (extract_band), extract band from an image
4238    /// returns `VipsImage` - Output image
4239    ///
4240    /// band: `i32` -> Band to extract
4241    ///
4242    /// <ins>Optional arguments</ins>
4243    ///
4244    /// n: `i32` -> Number of bands to extract
4245    pub fn extract_band_with_opts(&self, band: i32, option: VOption) -> Result<VipsImage> {
4246        let mut out_out = VipsImage::from(null_mut());
4247        let vips_op_response = call(
4248            "extract_band",
4249            option
4250                .set("in", self)
4251                .set(
4252                    "out",
4253                    &mut out_out,
4254                )
4255                .set(
4256                    "band",
4257                    band,
4258                ),
4259        );
4260
4261        utils::result(
4262            vips_op_response,
4263            out_out,
4264            Error::OperationError("ExtractBand (vips_extract_band) failed".to_string()),
4265        )
4266    }
4267
4268    /// VipsEye (eye), make an image showing the eye's spatial response
4269    /// returns `VipsImage` - Output image
4270    ///
4271    /// width: `i32` -> Image width in pixels
4272    ///
4273    /// height: `i32` -> Image height in pixels
4274    pub fn eye(width: i32, height: i32) -> Result<VipsImage> {
4275        let mut out_out = VipsImage::from(null_mut());
4276        let vips_op_response = call(
4277            "eye",
4278            VOption::new()
4279                .set(
4280                    "out",
4281                    &mut out_out,
4282                )
4283                .set(
4284                    "width",
4285                    width,
4286                )
4287                .set(
4288                    "height",
4289                    height,
4290                ),
4291        );
4292
4293        utils::result(
4294            vips_op_response,
4295            out_out,
4296            Error::OperationError("Eye (vips_eye) failed".to_string()),
4297        )
4298    }
4299
4300    /// VipsEye (eye), make an image showing the eye's spatial response
4301    /// returns `VipsImage` - Output image
4302    ///
4303    /// width: `i32` -> Image width in pixels
4304    ///
4305    /// height: `i32` -> Image height in pixels
4306    ///
4307    /// <ins>Optional arguments</ins>
4308    ///
4309    /// uchar: `bool` -> Output an unsigned char image
4310    ///
4311    /// factor: `f64` -> Maximum spatial frequency
4312    pub fn eye_with_opts(width: i32, height: i32, option: VOption) -> Result<VipsImage> {
4313        let mut out_out = VipsImage::from(null_mut());
4314        let vips_op_response = call(
4315            "eye",
4316            option
4317                .set(
4318                    "out",
4319                    &mut out_out,
4320                )
4321                .set(
4322                    "width",
4323                    width,
4324                )
4325                .set(
4326                    "height",
4327                    height,
4328                ),
4329        );
4330
4331        utils::result(
4332            vips_op_response,
4333            out_out,
4334            Error::OperationError("Eye (vips_eye) failed".to_string()),
4335        )
4336    }
4337
4338    /// VipsFalsecolour (falsecolour), false-color an image
4339    /// returns `VipsImage` - Output image
4340    pub fn falsecolour(&self) -> Result<VipsImage> {
4341        let mut out_out = VipsImage::from(null_mut());
4342        let vips_op_response = call(
4343            "falsecolour",
4344            VOption::new()
4345                .set("in", self)
4346                .set(
4347                    "out",
4348                    &mut out_out,
4349                ),
4350        );
4351
4352        utils::result(
4353            vips_op_response,
4354            out_out,
4355            Error::OperationError("Falsecolour (vips_falsecolour) failed".to_string()),
4356        )
4357    }
4358
4359    /// VipsFastcor (fastcor), fast correlation
4360    /// returns `VipsImage` - Output image
4361    ///
4362    /// refp: `&VipsImage` -> Input reference image
4363    pub fn fastcor(&self, refp: &VipsImage) -> Result<VipsImage> {
4364        let mut out_out = VipsImage::from(null_mut());
4365        let vips_op_response = call(
4366            "fastcor",
4367            VOption::new()
4368                .set("in", self)
4369                .set(
4370                    "ref", refp,
4371                )
4372                .set(
4373                    "out",
4374                    &mut out_out,
4375                ),
4376        );
4377
4378        utils::result(
4379            vips_op_response,
4380            out_out,
4381            Error::OperationError("Fastcor (vips_fastcor) failed".to_string()),
4382        )
4383    }
4384
4385    /// VipsFillNearest (fill_nearest), fill image zeros with nearest non-zero pixel
4386    /// returns `VipsImage` - Value of nearest non-zero pixel
4387    pub fn fill_nearest(&self) -> Result<VipsImage> {
4388        let mut out_out = VipsImage::from(null_mut());
4389        let vips_op_response = call(
4390            "fill_nearest",
4391            VOption::new()
4392                .set("in", self)
4393                .set(
4394                    "out",
4395                    &mut out_out,
4396                ),
4397        );
4398
4399        utils::result(
4400            vips_op_response,
4401            out_out,
4402            Error::OperationError("FillNearest (vips_fill_nearest) failed".to_string()),
4403        )
4404    }
4405
4406    /// VipsFillNearest (fill_nearest), fill image zeros with nearest non-zero pixel
4407    /// returns `VipsImage` - Value of nearest non-zero pixel
4408    ///
4409    /// <ins>Optional arguments</ins>
4410    ///
4411    /// distance: `&mut VipsImage` -> Distance to nearest non-zero pixel
4412    pub fn fill_nearest_with_opts(&self, option: VOption) -> Result<VipsImage> {
4413        let mut out_out = VipsImage::from(null_mut());
4414        let vips_op_response = call(
4415            "fill_nearest",
4416            option
4417                .set("in", self)
4418                .set(
4419                    "out",
4420                    &mut out_out,
4421                ),
4422        );
4423
4424        utils::result(
4425            vips_op_response,
4426            out_out,
4427            Error::OperationError("FillNearest (vips_fill_nearest) failed".to_string()),
4428        )
4429    }
4430
4431    /// VipsFindTrim (find_trim), search an image for non-edge areas
4432    /// Tuple (
4433    /// i32 - Left edge of image
4434    /// i32 - Top edge of extract area
4435    /// i32 - Width of extract area
4436    /// i32 - Height of extract area
4437    ///)
4438    pub fn find_trim(
4439        &self,
4440    ) -> Result<(
4441        i32,
4442        i32,
4443        i32,
4444        i32,
4445    )> {
4446        let mut left_out: i32 = 1;
4447        let mut top_out: i32 = 0;
4448        let mut width_out: i32 = 1;
4449        let mut height_out: i32 = 1;
4450        let vips_op_response = call(
4451            "find_trim",
4452            VOption::new()
4453                .set("in", self)
4454                .set(
4455                    "left",
4456                    &mut left_out,
4457                )
4458                .set(
4459                    "top",
4460                    &mut top_out,
4461                )
4462                .set(
4463                    "width",
4464                    &mut width_out,
4465                )
4466                .set(
4467                    "height",
4468                    &mut height_out,
4469                ),
4470        );
4471
4472        utils::result(
4473            vips_op_response,
4474            (
4475                left_out,
4476                top_out,
4477                width_out,
4478                height_out,
4479            ),
4480            Error::OperationError("FindTrim (vips_find_trim) failed".to_string()),
4481        )
4482    }
4483
4484    /// VipsFindTrim (find_trim), search an image for non-edge areas
4485    /// Tuple (
4486    /// i32 - Left edge of image
4487    /// i32 - Top edge of extract area
4488    /// i32 - Width of extract area
4489    /// i32 - Height of extract area
4490    ///)
4491    ///
4492    /// <ins>Optional arguments</ins>
4493    ///
4494    /// threshold: `f64` -> Object threshold
4495    ///
4496    /// background: `&[f64]` -> Color for background pixels
4497    ///
4498    /// line_art: `bool` -> Enable line art mode
4499    pub fn find_trim_with_opts(
4500        &self,
4501        option: VOption,
4502    ) -> Result<(
4503        i32,
4504        i32,
4505        i32,
4506        i32,
4507    )> {
4508        let mut left_out: i32 = 1;
4509        let mut top_out: i32 = 0;
4510        let mut width_out: i32 = 1;
4511        let mut height_out: i32 = 1;
4512        let vips_op_response = call(
4513            "find_trim",
4514            option
4515                .set("in", self)
4516                .set(
4517                    "left",
4518                    &mut left_out,
4519                )
4520                .set(
4521                    "top",
4522                    &mut top_out,
4523                )
4524                .set(
4525                    "width",
4526                    &mut width_out,
4527                )
4528                .set(
4529                    "height",
4530                    &mut height_out,
4531                ),
4532        );
4533
4534        utils::result(
4535            vips_op_response,
4536            (
4537                left_out,
4538                top_out,
4539                width_out,
4540                height_out,
4541            ),
4542            Error::OperationError("FindTrim (vips_find_trim) failed".to_string()),
4543        )
4544    }
4545
4546    /// VipsForeignLoadFitsFile (fitsload), load a FITS image (.fits, .fit, .fts), priority=-50, untrusted, is_a, get_flags, get_flags_filename, header, load
4547    /// returns `VipsImage` - Output image
4548    ///
4549    /// filename: `&str` -> Filename to load from
4550    pub fn fitsload(filename: &str) -> Result<VipsImage> {
4551        let mut out_out = VipsImage::from(null_mut());
4552        let vips_op_response = call(
4553            "fitsload",
4554            VOption::new()
4555                .set(
4556                    "filename",
4557                    filename,
4558                )
4559                .set(
4560                    "out",
4561                    &mut out_out,
4562                ),
4563        );
4564
4565        utils::result(
4566            vips_op_response,
4567            out_out,
4568            Error::OperationError("Fitsload (vips_fitsload) failed".to_string()),
4569        )
4570    }
4571
4572    /// VipsForeignLoadFitsFile (fitsload), load a FITS image (.fits, .fit, .fts), priority=-50, untrusted, is_a, get_flags, get_flags_filename, header, load
4573    /// returns `VipsImage` - Output image
4574    ///
4575    /// filename: `&str` -> Filename to load from
4576    ///
4577    /// <ins>Optional arguments</ins>
4578    ///
4579    /// flags: [`ForeignFlags`] -> Flags for this file
4580    ///
4581    /// memory: `bool` -> Force open via memory
4582    ///
4583    /// access: [`Access`] -> Required access pattern for this file
4584    ///
4585    /// fail_on: [`FailOn`] -> Error level to fail on
4586    ///
4587    /// revalidate: `bool` -> Don't use a cached result for this operation
4588    pub fn fitsload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
4589        let mut out_out = VipsImage::from(null_mut());
4590        let vips_op_response = call(
4591            "fitsload",
4592            option
4593                .set(
4594                    "filename",
4595                    filename,
4596                )
4597                .set(
4598                    "out",
4599                    &mut out_out,
4600                ),
4601        );
4602
4603        utils::result(
4604            vips_op_response,
4605            out_out,
4606            Error::OperationError("Fitsload (vips_fitsload) failed".to_string()),
4607        )
4608    }
4609
4610    /// VipsForeignLoadFitsSource (fitsload_source), load FITS from a source, priority=-50, untrusted, is_a, is_a_source, get_flags, get_flags_filename, header, load
4611    /// returns `VipsImage` - Output image
4612    ///
4613    /// source: `&VipsSource` -> Source to load from
4614    pub fn fitsload_source(source: &VipsSource) -> Result<VipsImage> {
4615        let mut out_out = VipsImage::from(null_mut());
4616        let vips_op_response = call(
4617            "fitsload_source",
4618            VOption::new()
4619                .set(
4620                    "source",
4621                    source,
4622                )
4623                .set(
4624                    "out",
4625                    &mut out_out,
4626                ),
4627        );
4628
4629        utils::result(
4630            vips_op_response,
4631            out_out,
4632            Error::OperationError("FitsloadSource (vips_fitsload_source) failed".to_string()),
4633        )
4634    }
4635
4636    /// VipsForeignLoadFitsSource (fitsload_source), load FITS from a source, priority=-50, untrusted, is_a, is_a_source, get_flags, get_flags_filename, header, load
4637    /// returns `VipsImage` - Output image
4638    ///
4639    /// source: `&VipsSource` -> Source to load from
4640    ///
4641    /// <ins>Optional arguments</ins>
4642    ///
4643    /// flags: [`ForeignFlags`] -> Flags for this file
4644    ///
4645    /// memory: `bool` -> Force open via memory
4646    ///
4647    /// access: [`Access`] -> Required access pattern for this file
4648    ///
4649    /// fail_on: [`FailOn`] -> Error level to fail on
4650    ///
4651    /// revalidate: `bool` -> Don't use a cached result for this operation
4652    pub fn fitsload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
4653        let mut out_out = VipsImage::from(null_mut());
4654        let vips_op_response = call(
4655            "fitsload_source",
4656            option
4657                .set(
4658                    "source",
4659                    source,
4660                )
4661                .set(
4662                    "out",
4663                    &mut out_out,
4664                ),
4665        );
4666
4667        utils::result(
4668            vips_op_response,
4669            out_out,
4670            Error::OperationError("FitsloadSource (vips_fitsload_source) failed".to_string()),
4671        )
4672    }
4673
4674    /// VipsForeignSaveFits (fitssave), save image to fits file (.fits, .fit, .fts), priority=0, untrusted,
4675    ///
4676    /// filename: `&str` -> Filename to save to
4677    pub fn fitssave(&self, filename: &str) -> Result<()> {
4678        let vips_op_response = call(
4679            "fitssave",
4680            VOption::new()
4681                .set("in", self)
4682                .set(
4683                    "filename",
4684                    filename,
4685                ),
4686        );
4687
4688        utils::result(
4689            vips_op_response,
4690            (),
4691            Error::OperationError("Fitssave (vips_fitssave) failed".to_string()),
4692        )
4693    }
4694
4695    /// VipsForeignSaveFits (fitssave), save image to fits file (.fits, .fit, .fts), priority=0, untrusted,
4696    ///
4697    /// filename: `&str` -> Filename to save to
4698    ///
4699    /// <ins>Optional arguments</ins>
4700    ///
4701    /// keep: [`ForeignKeep`] -> Which metadata to retain
4702    ///
4703    /// background: `&[f64]` -> Background value
4704    ///
4705    /// page_height: `i32` -> Set page height for multipage save
4706    ///
4707    /// profile: `&str` -> Filename of ICC profile to embed
4708    pub fn fitssave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
4709        let vips_op_response = call(
4710            "fitssave",
4711            option
4712                .set("in", self)
4713                .set(
4714                    "filename",
4715                    filename,
4716                ),
4717        );
4718
4719        utils::result(
4720            vips_op_response,
4721            (),
4722            Error::OperationError("Fitssave (vips_fitssave) failed".to_string()),
4723        )
4724    }
4725
4726    /// VipsFlatten (flatten), flatten alpha out of an image
4727    /// returns `VipsImage` - Output image
4728    pub fn flatten(&self) -> Result<VipsImage> {
4729        let mut out_out = VipsImage::from(null_mut());
4730        let vips_op_response = call(
4731            "flatten",
4732            VOption::new()
4733                .set("in", self)
4734                .set(
4735                    "out",
4736                    &mut out_out,
4737                ),
4738        );
4739
4740        utils::result(
4741            vips_op_response,
4742            out_out,
4743            Error::OperationError("Flatten (vips_flatten) failed".to_string()),
4744        )
4745    }
4746
4747    /// VipsFlatten (flatten), flatten alpha out of an image
4748    /// returns `VipsImage` - Output image
4749    ///
4750    /// <ins>Optional arguments</ins>
4751    ///
4752    /// background: `&[f64]` -> Background value
4753    ///
4754    /// max_alpha: `f64` -> Maximum value of alpha channel
4755    pub fn flatten_with_opts(&self, option: VOption) -> Result<VipsImage> {
4756        let mut out_out = VipsImage::from(null_mut());
4757        let vips_op_response = call(
4758            "flatten",
4759            option
4760                .set("in", self)
4761                .set(
4762                    "out",
4763                    &mut out_out,
4764                ),
4765        );
4766
4767        utils::result(
4768            vips_op_response,
4769            out_out,
4770            Error::OperationError("Flatten (vips_flatten) failed".to_string()),
4771        )
4772    }
4773
4774    /// VipsFlip (flip), flip an image
4775    /// returns `VipsImage` - Output image
4776    ///
4777    /// direction: `Direction` -> Direction to flip image
4778    pub fn flip(&self, direction: Direction) -> Result<VipsImage> {
4779        let mut out_out = VipsImage::from(null_mut());
4780        let vips_op_response = call(
4781            "flip",
4782            VOption::new()
4783                .set("in", self)
4784                .set(
4785                    "out",
4786                    &mut out_out,
4787                )
4788                .set(
4789                    "direction",
4790                    direction as i32,
4791                ),
4792        );
4793
4794        utils::result(
4795            vips_op_response,
4796            out_out,
4797            Error::OperationError("Flip (vips_flip) failed".to_string()),
4798        )
4799    }
4800
4801    /// VipsFloat2rad (float2rad), transform float RGB to Radiance coding
4802    /// returns `VipsImage` - Output image
4803    pub fn float2rad(&self) -> Result<VipsImage> {
4804        let mut out_out = VipsImage::from(null_mut());
4805        let vips_op_response = call(
4806            "float2rad",
4807            VOption::new()
4808                .set("in", self)
4809                .set(
4810                    "out",
4811                    &mut out_out,
4812                ),
4813        );
4814
4815        utils::result(
4816            vips_op_response,
4817            out_out,
4818            Error::OperationError("Float2Rad (vips_float2rad) failed".to_string()),
4819        )
4820    }
4821
4822    /// VipsFractsurf (fractsurf), make a fractal surface
4823    /// returns `VipsImage` - Output image
4824    ///
4825    /// width: `i32` -> Image width in pixels
4826    ///
4827    /// height: `i32` -> Image height in pixels
4828    ///
4829    /// fractal_dimension: `f64` -> Fractal dimension
4830    pub fn fractsurf(width: i32, height: i32, fractal_dimension: f64) -> Result<VipsImage> {
4831        let mut out_out = VipsImage::from(null_mut());
4832        let vips_op_response = call(
4833            "fractsurf",
4834            VOption::new()
4835                .set(
4836                    "out",
4837                    &mut out_out,
4838                )
4839                .set(
4840                    "width",
4841                    width,
4842                )
4843                .set(
4844                    "height",
4845                    height,
4846                )
4847                .set(
4848                    "fractal-dimension",
4849                    fractal_dimension,
4850                ),
4851        );
4852
4853        utils::result(
4854            vips_op_response,
4855            out_out,
4856            Error::OperationError("Fractsurf (vips_fractsurf) failed".to_string()),
4857        )
4858    }
4859
4860    /// VipsFreqmult (freqmult), frequency-domain filtering
4861    /// returns `VipsImage` - Output image
4862    ///
4863    /// mask: `&VipsImage` -> Input mask image
4864    pub fn freqmult(&self, mask: &VipsImage) -> Result<VipsImage> {
4865        let mut out_out = VipsImage::from(null_mut());
4866        let vips_op_response = call(
4867            "freqmult",
4868            VOption::new()
4869                .set("in", self)
4870                .set(
4871                    "mask",
4872                    mask,
4873                )
4874                .set(
4875                    "out",
4876                    &mut out_out,
4877                ),
4878        );
4879
4880        utils::result(
4881            vips_op_response,
4882            out_out,
4883            Error::OperationError("Freqmult (vips_freqmult) failed".to_string()),
4884        )
4885    }
4886
4887    /// VipsFwfft (fwfft), forward FFT
4888    /// returns `VipsImage` - Output image
4889    pub fn fwfft(&self) -> Result<VipsImage> {
4890        let mut out_out = VipsImage::from(null_mut());
4891        let vips_op_response = call(
4892            "fwfft",
4893            VOption::new()
4894                .set("in", self)
4895                .set(
4896                    "out",
4897                    &mut out_out,
4898                ),
4899        );
4900
4901        utils::result(
4902            vips_op_response,
4903            out_out,
4904            Error::OperationError("Fwfft (vips_fwfft) failed".to_string()),
4905        )
4906    }
4907
4908    /// VipsGamma (gamma), gamma an image
4909    /// returns `VipsImage` - Output image
4910    pub fn gamma(&self) -> Result<VipsImage> {
4911        let mut out_out = VipsImage::from(null_mut());
4912        let vips_op_response = call(
4913            "gamma",
4914            VOption::new()
4915                .set("in", self)
4916                .set(
4917                    "out",
4918                    &mut out_out,
4919                ),
4920        );
4921
4922        utils::result(
4923            vips_op_response,
4924            out_out,
4925            Error::OperationError("Gamma (vips_gamma) failed".to_string()),
4926        )
4927    }
4928
4929    /// VipsGamma (gamma), gamma an image
4930    /// returns `VipsImage` - Output image
4931    ///
4932    /// <ins>Optional arguments</ins>
4933    ///
4934    /// exponent: `f64` -> Gamma factor
4935    pub fn gamma_with_opts(&self, option: VOption) -> Result<VipsImage> {
4936        let mut out_out = VipsImage::from(null_mut());
4937        let vips_op_response = call(
4938            "gamma",
4939            option
4940                .set("in", self)
4941                .set(
4942                    "out",
4943                    &mut out_out,
4944                ),
4945        );
4946
4947        utils::result(
4948            vips_op_response,
4949            out_out,
4950            Error::OperationError("Gamma (vips_gamma) failed".to_string()),
4951        )
4952    }
4953
4954    /// VipsGaussblur (gaussblur), gaussian blur
4955    /// returns `VipsImage` - Output image
4956    ///
4957    /// sigma: `f64` -> Sigma of Gaussian
4958    pub fn gaussblur(&self, sigma: f64) -> Result<VipsImage> {
4959        let mut out_out = VipsImage::from(null_mut());
4960        let vips_op_response = call(
4961            "gaussblur",
4962            VOption::new()
4963                .set("in", self)
4964                .set(
4965                    "out",
4966                    &mut out_out,
4967                )
4968                .set(
4969                    "sigma",
4970                    sigma,
4971                ),
4972        );
4973
4974        utils::result(
4975            vips_op_response,
4976            out_out,
4977            Error::OperationError("Gaussblur (vips_gaussblur) failed".to_string()),
4978        )
4979    }
4980
4981    /// VipsGaussblur (gaussblur), gaussian blur
4982    /// returns `VipsImage` - Output image
4983    ///
4984    /// sigma: `f64` -> Sigma of Gaussian
4985    ///
4986    /// <ins>Optional arguments</ins>
4987    ///
4988    /// min_ampl: `f64` -> Minimum amplitude of Gaussian
4989    ///
4990    /// precision: [`Precision`] -> Convolve with this precision
4991    pub fn gaussblur_with_opts(&self, sigma: f64, option: VOption) -> Result<VipsImage> {
4992        let mut out_out = VipsImage::from(null_mut());
4993        let vips_op_response = call(
4994            "gaussblur",
4995            option
4996                .set("in", self)
4997                .set(
4998                    "out",
4999                    &mut out_out,
5000                )
5001                .set(
5002                    "sigma",
5003                    sigma,
5004                ),
5005        );
5006
5007        utils::result(
5008            vips_op_response,
5009            out_out,
5010            Error::OperationError("Gaussblur (vips_gaussblur) failed".to_string()),
5011        )
5012    }
5013
5014    /// VipsGaussmat (gaussmat), make a gaussian image
5015    /// returns `VipsImage` - Output image
5016    ///
5017    /// sigma: `f64` -> Sigma of Gaussian
5018    ///
5019    /// min_ampl: `f64` -> Minimum amplitude of Gaussian
5020    pub fn gaussmat(sigma: f64, min_ampl: f64) -> Result<VipsImage> {
5021        let mut out_out = VipsImage::from(null_mut());
5022        let vips_op_response = call(
5023            "gaussmat",
5024            VOption::new()
5025                .set(
5026                    "out",
5027                    &mut out_out,
5028                )
5029                .set(
5030                    "sigma",
5031                    sigma,
5032                )
5033                .set(
5034                    "min-ampl",
5035                    min_ampl,
5036                ),
5037        );
5038
5039        utils::result(
5040            vips_op_response,
5041            out_out,
5042            Error::OperationError("Gaussmat (vips_gaussmat) failed".to_string()),
5043        )
5044    }
5045
5046    /// VipsGaussmat (gaussmat), make a gaussian image
5047    /// returns `VipsImage` - Output image
5048    ///
5049    /// sigma: `f64` -> Sigma of Gaussian
5050    ///
5051    /// min_ampl: `f64` -> Minimum amplitude of Gaussian
5052    ///
5053    /// <ins>Optional arguments</ins>
5054    ///
5055    /// separable: `bool` -> Generate separable Gaussian
5056    ///
5057    /// precision: [`Precision`] -> Generate with this precision
5058    pub fn gaussmat_with_opts(sigma: f64, min_ampl: f64, option: VOption) -> Result<VipsImage> {
5059        let mut out_out = VipsImage::from(null_mut());
5060        let vips_op_response = call(
5061            "gaussmat",
5062            option
5063                .set(
5064                    "out",
5065                    &mut out_out,
5066                )
5067                .set(
5068                    "sigma",
5069                    sigma,
5070                )
5071                .set(
5072                    "min-ampl",
5073                    min_ampl,
5074                ),
5075        );
5076
5077        utils::result(
5078            vips_op_response,
5079            out_out,
5080            Error::OperationError("Gaussmat (vips_gaussmat) failed".to_string()),
5081        )
5082    }
5083
5084    /// VipsGaussnoise (gaussnoise), make a gaussnoise image
5085    /// returns `VipsImage` - Output image
5086    ///
5087    /// width: `i32` -> Image width in pixels
5088    ///
5089    /// height: `i32` -> Image height in pixels
5090    pub fn gaussnoise(width: i32, height: i32) -> Result<VipsImage> {
5091        let mut out_out = VipsImage::from(null_mut());
5092        let vips_op_response = call(
5093            "gaussnoise",
5094            VOption::new()
5095                .set(
5096                    "out",
5097                    &mut out_out,
5098                )
5099                .set(
5100                    "width",
5101                    width,
5102                )
5103                .set(
5104                    "height",
5105                    height,
5106                ),
5107        );
5108
5109        utils::result(
5110            vips_op_response,
5111            out_out,
5112            Error::OperationError("Gaussnoise (vips_gaussnoise) failed".to_string()),
5113        )
5114    }
5115
5116    /// VipsGaussnoise (gaussnoise), make a gaussnoise image
5117    /// returns `VipsImage` - Output image
5118    ///
5119    /// width: `i32` -> Image width in pixels
5120    ///
5121    /// height: `i32` -> Image height in pixels
5122    ///
5123    /// <ins>Optional arguments</ins>
5124    ///
5125    /// sigma: `f64` -> Standard deviation of pixels in generated image
5126    ///
5127    /// mean: `f64` -> Mean of pixels in generated image
5128    ///
5129    /// seed: `i32` -> Random number seed
5130    pub fn gaussnoise_with_opts(width: i32, height: i32, option: VOption) -> Result<VipsImage> {
5131        let mut out_out = VipsImage::from(null_mut());
5132        let vips_op_response = call(
5133            "gaussnoise",
5134            option
5135                .set(
5136                    "out",
5137                    &mut out_out,
5138                )
5139                .set(
5140                    "width",
5141                    width,
5142                )
5143                .set(
5144                    "height",
5145                    height,
5146                ),
5147        );
5148
5149        utils::result(
5150            vips_op_response,
5151            out_out,
5152            Error::OperationError("Gaussnoise (vips_gaussnoise) failed".to_string()),
5153        )
5154    }
5155
5156    /// VipsGetpoint (getpoint), read a point from an image
5157    /// returns `Vec<f64>` - Array of output values
5158    ///
5159    /// x: `i32` -> Point to read
5160    ///
5161    /// y: `i32` -> Point to read
5162    pub fn getpoint(&self, x: i32, y: i32) -> Result<Vec<f64>> {
5163        let mut out_array_out: Vec<f64> = Vec::new();
5164        let vips_op_response = call(
5165            "getpoint",
5166            VOption::new()
5167                .set("in", self)
5168                .set(
5169                    "out-array",
5170                    &mut out_array_out,
5171                )
5172                .set("x", x)
5173                .set("y", y),
5174        );
5175
5176        utils::result(
5177            vips_op_response,
5178            out_array_out,
5179            Error::OperationError("Getpoint (vips_getpoint) failed".to_string()),
5180        )
5181    }
5182
5183    /// VipsGetpoint (getpoint), read a point from an image
5184    /// returns `Vec<f64>` - Array of output values
5185    ///
5186    /// x: `i32` -> Point to read
5187    ///
5188    /// y: `i32` -> Point to read
5189    ///
5190    /// <ins>Optional arguments</ins>
5191    ///
5192    /// unpack_complex: `bool` -> Complex pixels should be unpacked
5193    pub fn getpoint_with_opts(&self, x: i32, y: i32, option: VOption) -> Result<Vec<f64>> {
5194        let mut out_array_out: Vec<f64> = Vec::new();
5195        let vips_op_response = call(
5196            "getpoint",
5197            option
5198                .set("in", self)
5199                .set(
5200                    "out-array",
5201                    &mut out_array_out,
5202                )
5203                .set("x", x)
5204                .set("y", y),
5205        );
5206
5207        utils::result(
5208            vips_op_response,
5209            out_array_out,
5210            Error::OperationError("Getpoint (vips_getpoint) failed".to_string()),
5211        )
5212    }
5213
5214    /// VipsForeignLoadNsgifFile (gifload), load GIF with libnsgif (.gif), priority=50, is_a, get_flags, get_flags_filename, header, load
5215    /// returns `VipsImage` - Output image
5216    ///
5217    /// filename: `&str` -> Filename to load from
5218    pub fn gifload(filename: &str) -> Result<VipsImage> {
5219        let mut out_out = VipsImage::from(null_mut());
5220        let vips_op_response = call(
5221            "gifload",
5222            VOption::new()
5223                .set(
5224                    "filename",
5225                    filename,
5226                )
5227                .set(
5228                    "out",
5229                    &mut out_out,
5230                ),
5231        );
5232
5233        utils::result(
5234            vips_op_response,
5235            out_out,
5236            Error::OperationError("Gifload (vips_gifload) failed".to_string()),
5237        )
5238    }
5239
5240    /// VipsForeignLoadNsgifFile (gifload), load GIF with libnsgif (.gif), priority=50, is_a, get_flags, get_flags_filename, header, load
5241    /// returns `VipsImage` - Output image
5242    ///
5243    /// filename: `&str` -> Filename to load from
5244    ///
5245    /// <ins>Optional arguments</ins>
5246    ///
5247    /// n: `i32` -> Number of pages to load, -1 for all
5248    ///
5249    /// page: `i32` -> First page to load
5250    ///
5251    /// flags: [`ForeignFlags`] -> Flags for this file
5252    ///
5253    /// memory: `bool` -> Force open via memory
5254    ///
5255    /// access: [`Access`] -> Required access pattern for this file
5256    ///
5257    /// fail_on: [`FailOn`] -> Error level to fail on
5258    ///
5259    /// revalidate: `bool` -> Don't use a cached result for this operation
5260    pub fn gifload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
5261        let mut out_out = VipsImage::from(null_mut());
5262        let vips_op_response = call(
5263            "gifload",
5264            option
5265                .set(
5266                    "filename",
5267                    filename,
5268                )
5269                .set(
5270                    "out",
5271                    &mut out_out,
5272                ),
5273        );
5274
5275        utils::result(
5276            vips_op_response,
5277            out_out,
5278            Error::OperationError("Gifload (vips_gifload) failed".to_string()),
5279        )
5280    }
5281
5282    /// VipsForeignLoadNsgifBuffer (gifload_buffer), load GIF with libnsgif, priority=50, is_a_buffer, get_flags, get_flags_filename, header, load
5283    /// returns `VipsImage` - Output image
5284    ///
5285    /// buffer: `&[u8]` -> Buffer to load from
5286    pub fn gifload_buffer(buffer: &[u8]) -> Result<VipsImage> {
5287        let blob = unsafe {
5288            vips_blob_new(
5289                None,
5290                buffer.as_ptr() as _,
5291                buffer.len() as _,
5292            )
5293        };
5294        let mut out_out = VipsImage::from(null_mut());
5295        let vips_op_response = call(
5296            "gifload_buffer",
5297            VOption::new()
5298                .set(
5299                    "buffer",
5300                    &VipsBlob::from(blob),
5301                )
5302                .set(
5303                    "out",
5304                    &mut out_out,
5305                ),
5306        );
5307        unsafe { vips_area_unref(&mut (*blob).area) };
5308        utils::result(
5309            vips_op_response,
5310            out_out,
5311            Error::OperationError("GifloadBuffer (vips_gifload_buffer) failed".to_string()),
5312        )
5313    }
5314
5315    /// VipsForeignLoadNsgifBuffer (gifload_buffer), load GIF with libnsgif, priority=50, is_a_buffer, get_flags, get_flags_filename, header, load
5316    /// returns `VipsImage` - Output image
5317    ///
5318    /// buffer: `&[u8]` -> Buffer to load from
5319    ///
5320    /// <ins>Optional arguments</ins>
5321    ///
5322    /// n: `i32` -> Number of pages to load, -1 for all
5323    ///
5324    /// page: `i32` -> First page to load
5325    ///
5326    /// flags: [`ForeignFlags`] -> Flags for this file
5327    ///
5328    /// memory: `bool` -> Force open via memory
5329    ///
5330    /// access: [`Access`] -> Required access pattern for this file
5331    ///
5332    /// fail_on: [`FailOn`] -> Error level to fail on
5333    ///
5334    /// revalidate: `bool` -> Don't use a cached result for this operation
5335    pub fn gifload_buffer_with_opts(buffer: &[u8], option: VOption) -> Result<VipsImage> {
5336        let blob = unsafe {
5337            vips_blob_new(
5338                None,
5339                buffer.as_ptr() as _,
5340                buffer.len() as _,
5341            )
5342        };
5343        let mut out_out = VipsImage::from(null_mut());
5344        let vips_op_response = call(
5345            "gifload_buffer",
5346            option
5347                .set(
5348                    "buffer",
5349                    &VipsBlob::from(blob),
5350                )
5351                .set(
5352                    "out",
5353                    &mut out_out,
5354                ),
5355        );
5356        unsafe { vips_area_unref(&mut (*blob).area) };
5357        utils::result(
5358            vips_op_response,
5359            out_out,
5360            Error::OperationError("GifloadBuffer (vips_gifload_buffer) failed".to_string()),
5361        )
5362    }
5363
5364    /// VipsForeignLoadNsgifSource (gifload_source), load gif from source, priority=50, is_a_source, get_flags, get_flags_filename, header, load
5365    /// returns `VipsImage` - Output image
5366    ///
5367    /// source: `&VipsSource` -> Source to load from
5368    pub fn gifload_source(source: &VipsSource) -> Result<VipsImage> {
5369        let mut out_out = VipsImage::from(null_mut());
5370        let vips_op_response = call(
5371            "gifload_source",
5372            VOption::new()
5373                .set(
5374                    "source",
5375                    source,
5376                )
5377                .set(
5378                    "out",
5379                    &mut out_out,
5380                ),
5381        );
5382
5383        utils::result(
5384            vips_op_response,
5385            out_out,
5386            Error::OperationError("GifloadSource (vips_gifload_source) failed".to_string()),
5387        )
5388    }
5389
5390    /// VipsForeignLoadNsgifSource (gifload_source), load gif from source, priority=50, is_a_source, get_flags, get_flags_filename, header, load
5391    /// returns `VipsImage` - Output image
5392    ///
5393    /// source: `&VipsSource` -> Source to load from
5394    ///
5395    /// <ins>Optional arguments</ins>
5396    ///
5397    /// n: `i32` -> Number of pages to load, -1 for all
5398    ///
5399    /// page: `i32` -> First page to load
5400    ///
5401    /// flags: [`ForeignFlags`] -> Flags for this file
5402    ///
5403    /// memory: `bool` -> Force open via memory
5404    ///
5405    /// access: [`Access`] -> Required access pattern for this file
5406    ///
5407    /// fail_on: [`FailOn`] -> Error level to fail on
5408    ///
5409    /// revalidate: `bool` -> Don't use a cached result for this operation
5410    pub fn gifload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
5411        let mut out_out = VipsImage::from(null_mut());
5412        let vips_op_response = call(
5413            "gifload_source",
5414            option
5415                .set(
5416                    "source",
5417                    source,
5418                )
5419                .set(
5420                    "out",
5421                    &mut out_out,
5422                ),
5423        );
5424
5425        utils::result(
5426            vips_op_response,
5427            out_out,
5428            Error::OperationError("GifloadSource (vips_gifload_source) failed".to_string()),
5429        )
5430    }
5431
5432    /// VipsForeignSaveCgifFile (gifsave), save as gif (.gif), priority=0, rgb alpha
5433    ///
5434    /// filename: `&str` -> Filename to save to
5435    pub fn gifsave(&self, filename: &str) -> Result<()> {
5436        let vips_op_response = call(
5437            "gifsave",
5438            VOption::new()
5439                .set("in", self)
5440                .set(
5441                    "filename",
5442                    filename,
5443                ),
5444        );
5445
5446        utils::result(
5447            vips_op_response,
5448            (),
5449            Error::OperationError("Gifsave (vips_gifsave) failed".to_string()),
5450        )
5451    }
5452
5453    /// VipsForeignSaveCgifFile (gifsave), save as gif (.gif), priority=0, rgb alpha
5454    ///
5455    /// filename: `&str` -> Filename to save to
5456    ///
5457    /// <ins>Optional arguments</ins>
5458    ///
5459    /// dither: `f64` -> Amount of dithering
5460    ///
5461    /// effort: `i32` -> Quantisation effort
5462    ///
5463    /// bitdepth: `i32` -> Number of bits per pixel
5464    ///
5465    /// interframe_maxerror: `f64` -> Maximum inter-frame error for transparency
5466    ///
5467    /// reuse: `bool` -> Reuse palette from input
5468    ///
5469    /// interpalette_maxerror: `f64` -> Maximum inter-palette error for palette reusage
5470    ///
5471    /// interlace: `bool` -> Generate an interlaced (progressive) GIF
5472    ///
5473    /// keep_duplicate_frames: `bool` -> Keep duplicate frames in the output instead of combining them
5474    ///
5475    /// keep: [`ForeignKeep`] -> Which metadata to retain
5476    ///
5477    /// background: `&[f64]` -> Background value
5478    ///
5479    /// page_height: `i32` -> Set page height for multipage save
5480    ///
5481    /// profile: `&str` -> Filename of ICC profile to embed
5482    pub fn gifsave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
5483        let vips_op_response = call(
5484            "gifsave",
5485            option
5486                .set("in", self)
5487                .set(
5488                    "filename",
5489                    filename,
5490                ),
5491        );
5492
5493        utils::result(
5494            vips_op_response,
5495            (),
5496            Error::OperationError("Gifsave (vips_gifsave) failed".to_string()),
5497        )
5498    }
5499
5500    /// VipsForeignSaveCgifBuffer (gifsave_buffer), save as gif (.gif), priority=0, rgb alpha
5501    /// returns `Vec<u8>` - Buffer to save to
5502    pub fn gifsave_buffer(&self) -> Result<Vec<u8>> {
5503        let mut buffer_out = VipsBlob::from(null_mut());
5504        let vips_op_response = call(
5505            "gifsave_buffer",
5506            VOption::new()
5507                .set("in", self)
5508                .set(
5509                    "buffer",
5510                    &mut buffer_out,
5511                ),
5512        );
5513
5514        utils::result(
5515            vips_op_response,
5516            buffer_out.into(),
5517            Error::OperationError("GifsaveBuffer (vips_gifsave_buffer) failed".to_string()),
5518        )
5519    }
5520
5521    /// VipsForeignSaveCgifBuffer (gifsave_buffer), save as gif (.gif), priority=0, rgb alpha
5522    /// returns `Vec<u8>` - Buffer to save to
5523    ///
5524    /// <ins>Optional arguments</ins>
5525    ///
5526    /// dither: `f64` -> Amount of dithering
5527    ///
5528    /// effort: `i32` -> Quantisation effort
5529    ///
5530    /// bitdepth: `i32` -> Number of bits per pixel
5531    ///
5532    /// interframe_maxerror: `f64` -> Maximum inter-frame error for transparency
5533    ///
5534    /// reuse: `bool` -> Reuse palette from input
5535    ///
5536    /// interpalette_maxerror: `f64` -> Maximum inter-palette error for palette reusage
5537    ///
5538    /// interlace: `bool` -> Generate an interlaced (progressive) GIF
5539    ///
5540    /// keep_duplicate_frames: `bool` -> Keep duplicate frames in the output instead of combining them
5541    ///
5542    /// keep: [`ForeignKeep`] -> Which metadata to retain
5543    ///
5544    /// background: `&[f64]` -> Background value
5545    ///
5546    /// page_height: `i32` -> Set page height for multipage save
5547    ///
5548    /// profile: `&str` -> Filename of ICC profile to embed
5549    pub fn gifsave_buffer_with_opts(&self, option: VOption) -> Result<Vec<u8>> {
5550        let mut buffer_out = VipsBlob::from(null_mut());
5551        let vips_op_response = call(
5552            "gifsave_buffer",
5553            option
5554                .set("in", self)
5555                .set(
5556                    "buffer",
5557                    &mut buffer_out,
5558                ),
5559        );
5560
5561        utils::result(
5562            vips_op_response,
5563            buffer_out.into(),
5564            Error::OperationError("GifsaveBuffer (vips_gifsave_buffer) failed".to_string()),
5565        )
5566    }
5567
5568    /// VipsForeignSaveCgifTarget (gifsave_target), save as gif (.gif), priority=0, rgb alpha
5569    ///
5570    /// target: `&VipsTarget` -> Target to save to
5571    pub fn gifsave_target(&self, target: &VipsTarget) -> Result<()> {
5572        let vips_op_response = call(
5573            "gifsave_target",
5574            VOption::new()
5575                .set("in", self)
5576                .set(
5577                    "target",
5578                    target,
5579                ),
5580        );
5581
5582        utils::result(
5583            vips_op_response,
5584            (),
5585            Error::OperationError("GifsaveTarget (vips_gifsave_target) failed".to_string()),
5586        )
5587    }
5588
5589    /// VipsForeignSaveCgifTarget (gifsave_target), save as gif (.gif), priority=0, rgb alpha
5590    ///
5591    /// target: `&VipsTarget` -> Target to save to
5592    ///
5593    /// <ins>Optional arguments</ins>
5594    ///
5595    /// dither: `f64` -> Amount of dithering
5596    ///
5597    /// effort: `i32` -> Quantisation effort
5598    ///
5599    /// bitdepth: `i32` -> Number of bits per pixel
5600    ///
5601    /// interframe_maxerror: `f64` -> Maximum inter-frame error for transparency
5602    ///
5603    /// reuse: `bool` -> Reuse palette from input
5604    ///
5605    /// interpalette_maxerror: `f64` -> Maximum inter-palette error for palette reusage
5606    ///
5607    /// interlace: `bool` -> Generate an interlaced (progressive) GIF
5608    ///
5609    /// keep_duplicate_frames: `bool` -> Keep duplicate frames in the output instead of combining them
5610    ///
5611    /// keep: [`ForeignKeep`] -> Which metadata to retain
5612    ///
5613    /// background: `&[f64]` -> Background value
5614    ///
5615    /// page_height: `i32` -> Set page height for multipage save
5616    ///
5617    /// profile: `&str` -> Filename of ICC profile to embed
5618    pub fn gifsave_target_with_opts(&self, target: &VipsTarget, option: VOption) -> Result<()> {
5619        let vips_op_response = call(
5620            "gifsave_target",
5621            option
5622                .set("in", self)
5623                .set(
5624                    "target",
5625                    target,
5626                ),
5627        );
5628
5629        utils::result(
5630            vips_op_response,
5631            (),
5632            Error::OperationError("GifsaveTarget (vips_gifsave_target) failed".to_string()),
5633        )
5634    }
5635
5636    /// VipsGlobalbalance (globalbalance), global balance an image mosaic
5637    /// returns `VipsImage` - Output image
5638    pub fn globalbalance(&self) -> Result<VipsImage> {
5639        let mut out_out = VipsImage::from(null_mut());
5640        let vips_op_response = call(
5641            "globalbalance",
5642            VOption::new()
5643                .set("in", self)
5644                .set(
5645                    "out",
5646                    &mut out_out,
5647                ),
5648        );
5649
5650        utils::result(
5651            vips_op_response,
5652            out_out,
5653            Error::OperationError("Globalbalance (vips_globalbalance) failed".to_string()),
5654        )
5655    }
5656
5657    /// VipsGlobalbalance (globalbalance), global balance an image mosaic
5658    /// returns `VipsImage` - Output image
5659    ///
5660    /// <ins>Optional arguments</ins>
5661    ///
5662    /// gamma: `f64` -> Image gamma
5663    ///
5664    /// int_output: `bool` -> Integer output
5665    pub fn globalbalance_with_opts(&self, option: VOption) -> Result<VipsImage> {
5666        let mut out_out = VipsImage::from(null_mut());
5667        let vips_op_response = call(
5668            "globalbalance",
5669            option
5670                .set("in", self)
5671                .set(
5672                    "out",
5673                    &mut out_out,
5674                ),
5675        );
5676
5677        utils::result(
5678            vips_op_response,
5679            out_out,
5680            Error::OperationError("Globalbalance (vips_globalbalance) failed".to_string()),
5681        )
5682    }
5683
5684    /// VipsGravity (gravity), place an image within a larger image with a certain gravity
5685    /// returns `VipsImage` - Output image
5686    ///
5687    /// direction: `CompassDirection` -> Direction to place image within width/height
5688    ///
5689    /// width: `i32` -> Image width in pixels
5690    ///
5691    /// height: `i32` -> Image height in pixels
5692    pub fn gravity(
5693        &self,
5694        direction: CompassDirection,
5695        width: i32,
5696        height: i32,
5697    ) -> Result<VipsImage> {
5698        let mut out_out = VipsImage::from(null_mut());
5699        let vips_op_response = call(
5700            "gravity",
5701            VOption::new()
5702                .set("in", self)
5703                .set(
5704                    "out",
5705                    &mut out_out,
5706                )
5707                .set(
5708                    "direction",
5709                    direction as i32,
5710                )
5711                .set(
5712                    "width",
5713                    width,
5714                )
5715                .set(
5716                    "height",
5717                    height,
5718                ),
5719        );
5720
5721        utils::result(
5722            vips_op_response,
5723            out_out,
5724            Error::OperationError("Gravity (vips_gravity) failed".to_string()),
5725        )
5726    }
5727
5728    /// VipsGravity (gravity), place an image within a larger image with a certain gravity
5729    /// returns `VipsImage` - Output image
5730    ///
5731    /// direction: `CompassDirection` -> Direction to place image within width/height
5732    ///
5733    /// width: `i32` -> Image width in pixels
5734    ///
5735    /// height: `i32` -> Image height in pixels
5736    ///
5737    /// <ins>Optional arguments</ins>
5738    ///
5739    /// extend: [`Extend`] -> How to generate the extra pixels
5740    ///
5741    /// background: `&[f64]` -> Color for background pixels
5742    pub fn gravity_with_opts(
5743        &self,
5744        direction: CompassDirection,
5745        width: i32,
5746        height: i32,
5747        option: VOption,
5748    ) -> Result<VipsImage> {
5749        let mut out_out = VipsImage::from(null_mut());
5750        let vips_op_response = call(
5751            "gravity",
5752            option
5753                .set("in", self)
5754                .set(
5755                    "out",
5756                    &mut out_out,
5757                )
5758                .set(
5759                    "direction",
5760                    direction as i32,
5761                )
5762                .set(
5763                    "width",
5764                    width,
5765                )
5766                .set(
5767                    "height",
5768                    height,
5769                ),
5770        );
5771
5772        utils::result(
5773            vips_op_response,
5774            out_out,
5775            Error::OperationError("Gravity (vips_gravity) failed".to_string()),
5776        )
5777    }
5778
5779    /// VipsGrey (grey), make a grey ramp image
5780    /// returns `VipsImage` - Output image
5781    ///
5782    /// width: `i32` -> Image width in pixels
5783    ///
5784    /// height: `i32` -> Image height in pixels
5785    pub fn grey(width: i32, height: i32) -> Result<VipsImage> {
5786        let mut out_out = VipsImage::from(null_mut());
5787        let vips_op_response = call(
5788            "grey",
5789            VOption::new()
5790                .set(
5791                    "out",
5792                    &mut out_out,
5793                )
5794                .set(
5795                    "width",
5796                    width,
5797                )
5798                .set(
5799                    "height",
5800                    height,
5801                ),
5802        );
5803
5804        utils::result(
5805            vips_op_response,
5806            out_out,
5807            Error::OperationError("Grey (vips_grey) failed".to_string()),
5808        )
5809    }
5810
5811    /// VipsGrey (grey), make a grey ramp image
5812    /// returns `VipsImage` - Output image
5813    ///
5814    /// width: `i32` -> Image width in pixels
5815    ///
5816    /// height: `i32` -> Image height in pixels
5817    ///
5818    /// <ins>Optional arguments</ins>
5819    ///
5820    /// uchar: `bool` -> Output an unsigned char image
5821    pub fn grey_with_opts(width: i32, height: i32, option: VOption) -> Result<VipsImage> {
5822        let mut out_out = VipsImage::from(null_mut());
5823        let vips_op_response = call(
5824            "grey",
5825            option
5826                .set(
5827                    "out",
5828                    &mut out_out,
5829                )
5830                .set(
5831                    "width",
5832                    width,
5833                )
5834                .set(
5835                    "height",
5836                    height,
5837                ),
5838        );
5839
5840        utils::result(
5841            vips_op_response,
5842            out_out,
5843            Error::OperationError("Grey (vips_grey) failed".to_string()),
5844        )
5845    }
5846
5847    /// VipsGrid (grid), grid an image
5848    /// returns `VipsImage` - Output image
5849    ///
5850    /// tile_height: `i32` -> Chop into tiles this high
5851    ///
5852    /// across: `i32` -> Number of tiles across
5853    ///
5854    /// down: `i32` -> Number of tiles down
5855    pub fn grid(&self, tile_height: i32, across: i32, down: i32) -> Result<VipsImage> {
5856        let mut out_out = VipsImage::from(null_mut());
5857        let vips_op_response = call(
5858            "grid",
5859            VOption::new()
5860                .set("in", self)
5861                .set(
5862                    "out",
5863                    &mut out_out,
5864                )
5865                .set(
5866                    "tile-height",
5867                    tile_height,
5868                )
5869                .set(
5870                    "across",
5871                    across,
5872                )
5873                .set(
5874                    "down",
5875                    down,
5876                ),
5877        );
5878
5879        utils::result(
5880            vips_op_response,
5881            out_out,
5882            Error::OperationError("Grid (vips_grid) failed".to_string()),
5883        )
5884    }
5885
5886    /// VipsForeignLoadHeifFile (heifload), load a HEIF image (.heic, .heif, .avif), priority=0, is_a, get_flags, header, load
5887    /// returns `VipsImage` - Output image
5888    ///
5889    /// filename: `&str` -> Filename to load from
5890    pub fn heifload(filename: &str) -> Result<VipsImage> {
5891        let mut out_out = VipsImage::from(null_mut());
5892        let vips_op_response = call(
5893            "heifload",
5894            VOption::new()
5895                .set(
5896                    "filename",
5897                    filename,
5898                )
5899                .set(
5900                    "out",
5901                    &mut out_out,
5902                ),
5903        );
5904
5905        utils::result(
5906            vips_op_response,
5907            out_out,
5908            Error::OperationError("Heifload (vips_heifload) failed".to_string()),
5909        )
5910    }
5911
5912    /// VipsForeignLoadHeifFile (heifload), load a HEIF image (.heic, .heif, .avif), priority=0, is_a, get_flags, header, load
5913    /// returns `VipsImage` - Output image
5914    ///
5915    /// filename: `&str` -> Filename to load from
5916    ///
5917    /// <ins>Optional arguments</ins>
5918    ///
5919    /// page: `i32` -> First page to load
5920    ///
5921    /// n: `i32` -> Number of pages to load, -1 for all
5922    ///
5923    /// thumbnail: `bool` -> Fetch thumbnail image
5924    ///
5925    /// unlimited: `bool` -> Remove all denial of service limits
5926    ///
5927    /// flags: [`ForeignFlags`] -> Flags for this file
5928    ///
5929    /// memory: `bool` -> Force open via memory
5930    ///
5931    /// access: [`Access`] -> Required access pattern for this file
5932    ///
5933    /// fail_on: [`FailOn`] -> Error level to fail on
5934    ///
5935    /// revalidate: `bool` -> Don't use a cached result for this operation
5936    pub fn heifload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
5937        let mut out_out = VipsImage::from(null_mut());
5938        let vips_op_response = call(
5939            "heifload",
5940            option
5941                .set(
5942                    "filename",
5943                    filename,
5944                )
5945                .set(
5946                    "out",
5947                    &mut out_out,
5948                ),
5949        );
5950
5951        utils::result(
5952            vips_op_response,
5953            out_out,
5954            Error::OperationError("Heifload (vips_heifload) failed".to_string()),
5955        )
5956    }
5957
5958    /// VipsForeignLoadHeifBuffer (heifload_buffer), load a HEIF image, priority=0, is_a_buffer, get_flags, header, load
5959    /// returns `VipsImage` - Output image
5960    ///
5961    /// buffer: `&[u8]` -> Buffer to load from
5962    pub fn heifload_buffer(buffer: &[u8]) -> Result<VipsImage> {
5963        let blob = unsafe {
5964            vips_blob_new(
5965                None,
5966                buffer.as_ptr() as _,
5967                buffer.len() as _,
5968            )
5969        };
5970        let mut out_out = VipsImage::from(null_mut());
5971        let vips_op_response = call(
5972            "heifload_buffer",
5973            VOption::new()
5974                .set(
5975                    "buffer",
5976                    &VipsBlob::from(blob),
5977                )
5978                .set(
5979                    "out",
5980                    &mut out_out,
5981                ),
5982        );
5983        unsafe { vips_area_unref(&mut (*blob).area) };
5984        utils::result(
5985            vips_op_response,
5986            out_out,
5987            Error::OperationError("HeifloadBuffer (vips_heifload_buffer) failed".to_string()),
5988        )
5989    }
5990
5991    /// VipsForeignLoadHeifBuffer (heifload_buffer), load a HEIF image, priority=0, is_a_buffer, get_flags, header, load
5992    /// returns `VipsImage` - Output image
5993    ///
5994    /// buffer: `&[u8]` -> Buffer to load from
5995    ///
5996    /// <ins>Optional arguments</ins>
5997    ///
5998    /// page: `i32` -> First page to load
5999    ///
6000    /// n: `i32` -> Number of pages to load, -1 for all
6001    ///
6002    /// thumbnail: `bool` -> Fetch thumbnail image
6003    ///
6004    /// unlimited: `bool` -> Remove all denial of service limits
6005    ///
6006    /// flags: [`ForeignFlags`] -> Flags for this file
6007    ///
6008    /// memory: `bool` -> Force open via memory
6009    ///
6010    /// access: [`Access`] -> Required access pattern for this file
6011    ///
6012    /// fail_on: [`FailOn`] -> Error level to fail on
6013    ///
6014    /// revalidate: `bool` -> Don't use a cached result for this operation
6015    pub fn heifload_buffer_with_opts(buffer: &[u8], option: VOption) -> Result<VipsImage> {
6016        let blob = unsafe {
6017            vips_blob_new(
6018                None,
6019                buffer.as_ptr() as _,
6020                buffer.len() as _,
6021            )
6022        };
6023        let mut out_out = VipsImage::from(null_mut());
6024        let vips_op_response = call(
6025            "heifload_buffer",
6026            option
6027                .set(
6028                    "buffer",
6029                    &VipsBlob::from(blob),
6030                )
6031                .set(
6032                    "out",
6033                    &mut out_out,
6034                ),
6035        );
6036        unsafe { vips_area_unref(&mut (*blob).area) };
6037        utils::result(
6038            vips_op_response,
6039            out_out,
6040            Error::OperationError("HeifloadBuffer (vips_heifload_buffer) failed".to_string()),
6041        )
6042    }
6043
6044    /// VipsForeignLoadHeifSource (heifload_source), load a HEIF image, priority=0, is_a_source, get_flags, header, load
6045    /// returns `VipsImage` - Output image
6046    ///
6047    /// source: `&VipsSource` -> Source to load from
6048    pub fn heifload_source(source: &VipsSource) -> Result<VipsImage> {
6049        let mut out_out = VipsImage::from(null_mut());
6050        let vips_op_response = call(
6051            "heifload_source",
6052            VOption::new()
6053                .set(
6054                    "source",
6055                    source,
6056                )
6057                .set(
6058                    "out",
6059                    &mut out_out,
6060                ),
6061        );
6062
6063        utils::result(
6064            vips_op_response,
6065            out_out,
6066            Error::OperationError("HeifloadSource (vips_heifload_source) failed".to_string()),
6067        )
6068    }
6069
6070    /// VipsForeignLoadHeifSource (heifload_source), load a HEIF image, priority=0, is_a_source, get_flags, header, load
6071    /// returns `VipsImage` - Output image
6072    ///
6073    /// source: `&VipsSource` -> Source to load from
6074    ///
6075    /// <ins>Optional arguments</ins>
6076    ///
6077    /// page: `i32` -> First page to load
6078    ///
6079    /// n: `i32` -> Number of pages to load, -1 for all
6080    ///
6081    /// thumbnail: `bool` -> Fetch thumbnail image
6082    ///
6083    /// unlimited: `bool` -> Remove all denial of service limits
6084    ///
6085    /// flags: [`ForeignFlags`] -> Flags for this file
6086    ///
6087    /// memory: `bool` -> Force open via memory
6088    ///
6089    /// access: [`Access`] -> Required access pattern for this file
6090    ///
6091    /// fail_on: [`FailOn`] -> Error level to fail on
6092    ///
6093    /// revalidate: `bool` -> Don't use a cached result for this operation
6094    pub fn heifload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
6095        let mut out_out = VipsImage::from(null_mut());
6096        let vips_op_response = call(
6097            "heifload_source",
6098            option
6099                .set(
6100                    "source",
6101                    source,
6102                )
6103                .set(
6104                    "out",
6105                    &mut out_out,
6106                ),
6107        );
6108
6109        utils::result(
6110            vips_op_response,
6111            out_out,
6112            Error::OperationError("HeifloadSource (vips_heifload_source) failed".to_string()),
6113        )
6114    }
6115
6116    /// VipsForeignSaveHeifFile (heifsave), save image in HEIF format (.heic, .heif, .avif), priority=0, rgb alpha
6117    ///
6118    /// filename: `&str` -> Filename to save to
6119    pub fn heifsave(&self, filename: &str) -> Result<()> {
6120        let vips_op_response = call(
6121            "heifsave",
6122            VOption::new()
6123                .set("in", self)
6124                .set(
6125                    "filename",
6126                    filename,
6127                ),
6128        );
6129
6130        utils::result(
6131            vips_op_response,
6132            (),
6133            Error::OperationError("Heifsave (vips_heifsave) failed".to_string()),
6134        )
6135    }
6136
6137    /// VipsForeignSaveHeifFile (heifsave), save image in HEIF format (.heic, .heif, .avif), priority=0, rgb alpha
6138    ///
6139    /// filename: `&str` -> Filename to save to
6140    ///
6141    /// <ins>Optional arguments</ins>
6142    ///
6143    /// Q: `i32` -> Q factor
6144    ///
6145    /// bitdepth: `i32` -> Number of bits per pixel
6146    ///
6147    /// lossless: `bool` -> Enable lossless compression
6148    ///
6149    /// compression: [`ForeignHeifCompression`] -> Compression format
6150    ///
6151    /// effort: `i32` -> CPU effort
6152    ///
6153    /// subsample_mode: [`ForeignSubsample`] -> Select chroma subsample operation mode
6154    ///
6155    /// encoder: [`ForeignHeifEncoder`] -> Select encoder to use
6156    ///
6157    /// keep: [`ForeignKeep`] -> Which metadata to retain
6158    ///
6159    /// background: `&[f64]` -> Background value
6160    ///
6161    /// page_height: `i32` -> Set page height for multipage save
6162    ///
6163    /// profile: `&str` -> Filename of ICC profile to embed
6164    pub fn heifsave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
6165        let vips_op_response = call(
6166            "heifsave",
6167            option
6168                .set("in", self)
6169                .set(
6170                    "filename",
6171                    filename,
6172                ),
6173        );
6174
6175        utils::result(
6176            vips_op_response,
6177            (),
6178            Error::OperationError("Heifsave (vips_heifsave) failed".to_string()),
6179        )
6180    }
6181
6182    /// VipsForeignSaveHeifBuffer (heifsave_buffer), save image in HEIF format (.heic, .heif), priority=0, rgb alpha
6183    /// returns `Vec<u8>` - Buffer to save to
6184    pub fn heifsave_buffer(&self) -> Result<Vec<u8>> {
6185        let mut buffer_out = VipsBlob::from(null_mut());
6186        let vips_op_response = call(
6187            "heifsave_buffer",
6188            VOption::new()
6189                .set("in", self)
6190                .set(
6191                    "buffer",
6192                    &mut buffer_out,
6193                ),
6194        );
6195
6196        utils::result(
6197            vips_op_response,
6198            buffer_out.into(),
6199            Error::OperationError("HeifsaveBuffer (vips_heifsave_buffer) failed".to_string()),
6200        )
6201    }
6202
6203    /// VipsForeignSaveHeifBuffer (heifsave_buffer), save image in HEIF format (.heic, .heif), priority=0, rgb alpha
6204    /// returns `Vec<u8>` - Buffer to save to
6205    ///
6206    /// <ins>Optional arguments</ins>
6207    ///
6208    /// Q: `i32` -> Q factor
6209    ///
6210    /// bitdepth: `i32` -> Number of bits per pixel
6211    ///
6212    /// lossless: `bool` -> Enable lossless compression
6213    ///
6214    /// compression: [`ForeignHeifCompression`] -> Compression format
6215    ///
6216    /// effort: `i32` -> CPU effort
6217    ///
6218    /// subsample_mode: [`ForeignSubsample`] -> Select chroma subsample operation mode
6219    ///
6220    /// encoder: [`ForeignHeifEncoder`] -> Select encoder to use
6221    ///
6222    /// keep: [`ForeignKeep`] -> Which metadata to retain
6223    ///
6224    /// background: `&[f64]` -> Background value
6225    ///
6226    /// page_height: `i32` -> Set page height for multipage save
6227    ///
6228    /// profile: `&str` -> Filename of ICC profile to embed
6229    pub fn heifsave_buffer_with_opts(&self, option: VOption) -> Result<Vec<u8>> {
6230        let mut buffer_out = VipsBlob::from(null_mut());
6231        let vips_op_response = call(
6232            "heifsave_buffer",
6233            option
6234                .set("in", self)
6235                .set(
6236                    "buffer",
6237                    &mut buffer_out,
6238                ),
6239        );
6240
6241        utils::result(
6242            vips_op_response,
6243            buffer_out.into(),
6244            Error::OperationError("HeifsaveBuffer (vips_heifsave_buffer) failed".to_string()),
6245        )
6246    }
6247
6248    /// VipsForeignSaveHeifTarget (heifsave_target), save image in HEIF format (.heic, .heif), priority=0, rgb alpha
6249    ///
6250    /// target: `&VipsTarget` -> Target to save to
6251    pub fn heifsave_target(&self, target: &VipsTarget) -> Result<()> {
6252        let vips_op_response = call(
6253            "heifsave_target",
6254            VOption::new()
6255                .set("in", self)
6256                .set(
6257                    "target",
6258                    target,
6259                ),
6260        );
6261
6262        utils::result(
6263            vips_op_response,
6264            (),
6265            Error::OperationError("HeifsaveTarget (vips_heifsave_target) failed".to_string()),
6266        )
6267    }
6268
6269    /// VipsForeignSaveHeifTarget (heifsave_target), save image in HEIF format (.heic, .heif), priority=0, rgb alpha
6270    ///
6271    /// target: `&VipsTarget` -> Target to save to
6272    ///
6273    /// <ins>Optional arguments</ins>
6274    ///
6275    /// Q: `i32` -> Q factor
6276    ///
6277    /// bitdepth: `i32` -> Number of bits per pixel
6278    ///
6279    /// lossless: `bool` -> Enable lossless compression
6280    ///
6281    /// compression: [`ForeignHeifCompression`] -> Compression format
6282    ///
6283    /// effort: `i32` -> CPU effort
6284    ///
6285    /// subsample_mode: [`ForeignSubsample`] -> Select chroma subsample operation mode
6286    ///
6287    /// encoder: [`ForeignHeifEncoder`] -> Select encoder to use
6288    ///
6289    /// keep: [`ForeignKeep`] -> Which metadata to retain
6290    ///
6291    /// background: `&[f64]` -> Background value
6292    ///
6293    /// page_height: `i32` -> Set page height for multipage save
6294    ///
6295    /// profile: `&str` -> Filename of ICC profile to embed
6296    pub fn heifsave_target_with_opts(&self, target: &VipsTarget, option: VOption) -> Result<()> {
6297        let vips_op_response = call(
6298            "heifsave_target",
6299            option
6300                .set("in", self)
6301                .set(
6302                    "target",
6303                    target,
6304                ),
6305        );
6306
6307        utils::result(
6308            vips_op_response,
6309            (),
6310            Error::OperationError("HeifsaveTarget (vips_heifsave_target) failed".to_string()),
6311        )
6312    }
6313
6314    /// VipsHistCum (hist_cum), form cumulative histogram
6315    /// returns `VipsImage` - Output image
6316    pub fn hist_cum(&self) -> Result<VipsImage> {
6317        let mut out_out = VipsImage::from(null_mut());
6318        let vips_op_response = call(
6319            "hist_cum",
6320            VOption::new()
6321                .set("in", self)
6322                .set(
6323                    "out",
6324                    &mut out_out,
6325                ),
6326        );
6327
6328        utils::result(
6329            vips_op_response,
6330            out_out,
6331            Error::OperationError("HistCum (vips_hist_cum) failed".to_string()),
6332        )
6333    }
6334
6335    /// VipsHistEntropy (hist_entropy), estimate image entropy
6336    /// returns `f64` - Output value
6337    pub fn hist_entropy(&self) -> Result<f64> {
6338        let mut out_out: f64 = 0.0;
6339        let vips_op_response = call(
6340            "hist_entropy",
6341            VOption::new()
6342                .set("in", self)
6343                .set(
6344                    "out",
6345                    &mut out_out,
6346                ),
6347        );
6348
6349        utils::result(
6350            vips_op_response,
6351            out_out,
6352            Error::OperationError("HistEntropy (vips_hist_entropy) failed".to_string()),
6353        )
6354    }
6355
6356    /// VipsHistEqual (hist_equal), histogram equalisation
6357    /// returns `VipsImage` - Output image
6358    pub fn hist_equal(&self) -> Result<VipsImage> {
6359        let mut out_out = VipsImage::from(null_mut());
6360        let vips_op_response = call(
6361            "hist_equal",
6362            VOption::new()
6363                .set("in", self)
6364                .set(
6365                    "out",
6366                    &mut out_out,
6367                ),
6368        );
6369
6370        utils::result(
6371            vips_op_response,
6372            out_out,
6373            Error::OperationError("HistEqual (vips_hist_equal) failed".to_string()),
6374        )
6375    }
6376
6377    /// VipsHistEqual (hist_equal), histogram equalisation
6378    /// returns `VipsImage` - Output image
6379    ///
6380    /// <ins>Optional arguments</ins>
6381    ///
6382    /// band: `i32` -> Equalise with this band
6383    pub fn hist_equal_with_opts(&self, option: VOption) -> Result<VipsImage> {
6384        let mut out_out = VipsImage::from(null_mut());
6385        let vips_op_response = call(
6386            "hist_equal",
6387            option
6388                .set("in", self)
6389                .set(
6390                    "out",
6391                    &mut out_out,
6392                ),
6393        );
6394
6395        utils::result(
6396            vips_op_response,
6397            out_out,
6398            Error::OperationError("HistEqual (vips_hist_equal) failed".to_string()),
6399        )
6400    }
6401
6402    /// VipsHistFind (hist_find), find image histogram
6403    /// returns `VipsImage` - Output histogram
6404    pub fn hist_find(&self) -> Result<VipsImage> {
6405        let mut out_out = VipsImage::from(null_mut());
6406        let vips_op_response = call(
6407            "hist_find",
6408            VOption::new()
6409                .set("in", self)
6410                .set(
6411                    "out",
6412                    &mut out_out,
6413                ),
6414        );
6415
6416        utils::result(
6417            vips_op_response,
6418            out_out,
6419            Error::OperationError("HistFind (vips_hist_find) failed".to_string()),
6420        )
6421    }
6422
6423    /// VipsHistFind (hist_find), find image histogram
6424    /// returns `VipsImage` - Output histogram
6425    ///
6426    /// <ins>Optional arguments</ins>
6427    ///
6428    /// band: `i32` -> Find histogram of band
6429    pub fn hist_find_with_opts(&self, option: VOption) -> Result<VipsImage> {
6430        let mut out_out = VipsImage::from(null_mut());
6431        let vips_op_response = call(
6432            "hist_find",
6433            option
6434                .set("in", self)
6435                .set(
6436                    "out",
6437                    &mut out_out,
6438                ),
6439        );
6440
6441        utils::result(
6442            vips_op_response,
6443            out_out,
6444            Error::OperationError("HistFind (vips_hist_find) failed".to_string()),
6445        )
6446    }
6447
6448    /// VipsHistFindIndexed (hist_find_indexed), find indexed image histogram
6449    /// returns `VipsImage` - Output histogram
6450    ///
6451    /// index: `&VipsImage` -> Index image
6452    pub fn hist_find_indexed(&self, index: &VipsImage) -> Result<VipsImage> {
6453        let mut out_out = VipsImage::from(null_mut());
6454        let vips_op_response = call(
6455            "hist_find_indexed",
6456            VOption::new()
6457                .set("in", self)
6458                .set(
6459                    "index",
6460                    index,
6461                )
6462                .set(
6463                    "out",
6464                    &mut out_out,
6465                ),
6466        );
6467
6468        utils::result(
6469            vips_op_response,
6470            out_out,
6471            Error::OperationError("HistFindIndexed (vips_hist_find_indexed) failed".to_string()),
6472        )
6473    }
6474
6475    /// VipsHistFindIndexed (hist_find_indexed), find indexed image histogram
6476    /// returns `VipsImage` - Output histogram
6477    ///
6478    /// index: `&VipsImage` -> Index image
6479    ///
6480    /// <ins>Optional arguments</ins>
6481    ///
6482    /// combine: [`Combine`] -> Combine bins like this
6483    pub fn hist_find_indexed_with_opts(
6484        &self,
6485        index: &VipsImage,
6486        option: VOption,
6487    ) -> Result<VipsImage> {
6488        let mut out_out = VipsImage::from(null_mut());
6489        let vips_op_response = call(
6490            "hist_find_indexed",
6491            option
6492                .set("in", self)
6493                .set(
6494                    "index",
6495                    index,
6496                )
6497                .set(
6498                    "out",
6499                    &mut out_out,
6500                ),
6501        );
6502
6503        utils::result(
6504            vips_op_response,
6505            out_out,
6506            Error::OperationError("HistFindIndexed (vips_hist_find_indexed) failed".to_string()),
6507        )
6508    }
6509
6510    /// VipsHistFindNDim (hist_find_ndim), find n-dimensional image histogram
6511    /// returns `VipsImage` - Output histogram
6512    pub fn hist_find_ndim(&self) -> Result<VipsImage> {
6513        let mut out_out = VipsImage::from(null_mut());
6514        let vips_op_response = call(
6515            "hist_find_ndim",
6516            VOption::new()
6517                .set("in", self)
6518                .set(
6519                    "out",
6520                    &mut out_out,
6521                ),
6522        );
6523
6524        utils::result(
6525            vips_op_response,
6526            out_out,
6527            Error::OperationError("HistFindNdim (vips_hist_find_ndim) failed".to_string()),
6528        )
6529    }
6530
6531    /// VipsHistFindNDim (hist_find_ndim), find n-dimensional image histogram
6532    /// returns `VipsImage` - Output histogram
6533    ///
6534    /// <ins>Optional arguments</ins>
6535    ///
6536    /// bins: `i32` -> Number of bins in each dimension
6537    pub fn hist_find_ndim_with_opts(&self, option: VOption) -> Result<VipsImage> {
6538        let mut out_out = VipsImage::from(null_mut());
6539        let vips_op_response = call(
6540            "hist_find_ndim",
6541            option
6542                .set("in", self)
6543                .set(
6544                    "out",
6545                    &mut out_out,
6546                ),
6547        );
6548
6549        utils::result(
6550            vips_op_response,
6551            out_out,
6552            Error::OperationError("HistFindNdim (vips_hist_find_ndim) failed".to_string()),
6553        )
6554    }
6555
6556    /// VipsHistIsmonotonic (hist_ismonotonic), test for monotonicity
6557    /// returns `bool` - true if in is monotonic
6558    pub fn hist_ismonotonic(&self) -> Result<bool> {
6559        let mut monotonic_out: bool = false;
6560        let vips_op_response = call(
6561            "hist_ismonotonic",
6562            VOption::new()
6563                .set("in", self)
6564                .set(
6565                    "monotonic",
6566                    &mut monotonic_out,
6567                ),
6568        );
6569
6570        utils::result(
6571            vips_op_response,
6572            monotonic_out,
6573            Error::OperationError("HistIsmonotonic (vips_hist_ismonotonic) failed".to_string()),
6574        )
6575    }
6576
6577    /// VipsHistLocal (hist_local), local histogram equalisation
6578    /// returns `VipsImage` - Output image
6579    ///
6580    /// width: `i32` -> Window width in pixels
6581    ///
6582    /// height: `i32` -> Window height in pixels
6583    pub fn hist_local(&self, width: i32, height: i32) -> Result<VipsImage> {
6584        let mut out_out = VipsImage::from(null_mut());
6585        let vips_op_response = call(
6586            "hist_local",
6587            VOption::new()
6588                .set("in", self)
6589                .set(
6590                    "out",
6591                    &mut out_out,
6592                )
6593                .set(
6594                    "width",
6595                    width,
6596                )
6597                .set(
6598                    "height",
6599                    height,
6600                ),
6601        );
6602
6603        utils::result(
6604            vips_op_response,
6605            out_out,
6606            Error::OperationError("HistLocal (vips_hist_local) failed".to_string()),
6607        )
6608    }
6609
6610    /// VipsHistLocal (hist_local), local histogram equalisation
6611    /// returns `VipsImage` - Output image
6612    ///
6613    /// width: `i32` -> Window width in pixels
6614    ///
6615    /// height: `i32` -> Window height in pixels
6616    ///
6617    /// <ins>Optional arguments</ins>
6618    ///
6619    /// max_slope: `i32` -> Maximum slope (CLAHE)
6620    pub fn hist_local_with_opts(
6621        &self,
6622        width: i32,
6623        height: i32,
6624        option: VOption,
6625    ) -> Result<VipsImage> {
6626        let mut out_out = VipsImage::from(null_mut());
6627        let vips_op_response = call(
6628            "hist_local",
6629            option
6630                .set("in", self)
6631                .set(
6632                    "out",
6633                    &mut out_out,
6634                )
6635                .set(
6636                    "width",
6637                    width,
6638                )
6639                .set(
6640                    "height",
6641                    height,
6642                ),
6643        );
6644
6645        utils::result(
6646            vips_op_response,
6647            out_out,
6648            Error::OperationError("HistLocal (vips_hist_local) failed".to_string()),
6649        )
6650    }
6651
6652    /// VipsHistMatch (hist_match), match two histograms
6653    /// returns `VipsImage` - Output image
6654    ///
6655    /// refp: `&VipsImage` -> Reference histogram
6656    pub fn hist_match(&self, refp: &VipsImage) -> Result<VipsImage> {
6657        let mut out_out = VipsImage::from(null_mut());
6658        let vips_op_response = call(
6659            "hist_match",
6660            VOption::new()
6661                .set("in", self)
6662                .set(
6663                    "ref", refp,
6664                )
6665                .set(
6666                    "out",
6667                    &mut out_out,
6668                ),
6669        );
6670
6671        utils::result(
6672            vips_op_response,
6673            out_out,
6674            Error::OperationError("HistMatch (vips_hist_match) failed".to_string()),
6675        )
6676    }
6677
6678    /// VipsHistNorm (hist_norm), normalise histogram
6679    /// returns `VipsImage` - Output image
6680    pub fn hist_norm(&self) -> Result<VipsImage> {
6681        let mut out_out = VipsImage::from(null_mut());
6682        let vips_op_response = call(
6683            "hist_norm",
6684            VOption::new()
6685                .set("in", self)
6686                .set(
6687                    "out",
6688                    &mut out_out,
6689                ),
6690        );
6691
6692        utils::result(
6693            vips_op_response,
6694            out_out,
6695            Error::OperationError("HistNorm (vips_hist_norm) failed".to_string()),
6696        )
6697    }
6698
6699    /// VipsHistPlot (hist_plot), plot histogram
6700    /// returns `VipsImage` - Output image
6701    pub fn hist_plot(&self) -> Result<VipsImage> {
6702        let mut out_out = VipsImage::from(null_mut());
6703        let vips_op_response = call(
6704            "hist_plot",
6705            VOption::new()
6706                .set("in", self)
6707                .set(
6708                    "out",
6709                    &mut out_out,
6710                ),
6711        );
6712
6713        utils::result(
6714            vips_op_response,
6715            out_out,
6716            Error::OperationError("HistPlot (vips_hist_plot) failed".to_string()),
6717        )
6718    }
6719
6720    /// VipsHoughCircle (hough_circle), find hough circle transform
6721    /// returns `VipsImage` - Output image
6722    pub fn hough_circle(&self) -> Result<VipsImage> {
6723        let mut out_out = VipsImage::from(null_mut());
6724        let vips_op_response = call(
6725            "hough_circle",
6726            VOption::new()
6727                .set("in", self)
6728                .set(
6729                    "out",
6730                    &mut out_out,
6731                ),
6732        );
6733
6734        utils::result(
6735            vips_op_response,
6736            out_out,
6737            Error::OperationError("HoughCircle (vips_hough_circle) failed".to_string()),
6738        )
6739    }
6740
6741    /// VipsHoughCircle (hough_circle), find hough circle transform
6742    /// returns `VipsImage` - Output image
6743    ///
6744    /// <ins>Optional arguments</ins>
6745    ///
6746    /// scale: `i32` -> Scale down dimensions by this factor
6747    ///
6748    /// min_radius: `i32` -> Smallest radius to search for
6749    ///
6750    /// max_radius: `i32` -> Largest radius to search for
6751    pub fn hough_circle_with_opts(&self, option: VOption) -> Result<VipsImage> {
6752        let mut out_out = VipsImage::from(null_mut());
6753        let vips_op_response = call(
6754            "hough_circle",
6755            option
6756                .set("in", self)
6757                .set(
6758                    "out",
6759                    &mut out_out,
6760                ),
6761        );
6762
6763        utils::result(
6764            vips_op_response,
6765            out_out,
6766            Error::OperationError("HoughCircle (vips_hough_circle) failed".to_string()),
6767        )
6768    }
6769
6770    /// VipsHoughLine (hough_line), find hough line transform
6771    /// returns `VipsImage` - Output image
6772    pub fn hough_line(&self) -> Result<VipsImage> {
6773        let mut out_out = VipsImage::from(null_mut());
6774        let vips_op_response = call(
6775            "hough_line",
6776            VOption::new()
6777                .set("in", self)
6778                .set(
6779                    "out",
6780                    &mut out_out,
6781                ),
6782        );
6783
6784        utils::result(
6785            vips_op_response,
6786            out_out,
6787            Error::OperationError("HoughLine (vips_hough_line) failed".to_string()),
6788        )
6789    }
6790
6791    /// VipsHoughLine (hough_line), find hough line transform
6792    /// returns `VipsImage` - Output image
6793    ///
6794    /// <ins>Optional arguments</ins>
6795    ///
6796    /// width: `i32` -> Horizontal size of parameter space
6797    ///
6798    /// height: `i32` -> Vertical size of parameter space
6799    pub fn hough_line_with_opts(&self, option: VOption) -> Result<VipsImage> {
6800        let mut out_out = VipsImage::from(null_mut());
6801        let vips_op_response = call(
6802            "hough_line",
6803            option
6804                .set("in", self)
6805                .set(
6806                    "out",
6807                    &mut out_out,
6808                ),
6809        );
6810
6811        utils::result(
6812            vips_op_response,
6813            out_out,
6814            Error::OperationError("HoughLine (vips_hough_line) failed".to_string()),
6815        )
6816    }
6817
6818    /// VipsIccExport (icc_export), output to device with ICC profile
6819    /// returns `VipsImage` - Output image
6820    pub fn icc_export(&self) -> Result<VipsImage> {
6821        let mut out_out = VipsImage::from(null_mut());
6822        let vips_op_response = call(
6823            "icc_export",
6824            VOption::new()
6825                .set("in", self)
6826                .set(
6827                    "out",
6828                    &mut out_out,
6829                ),
6830        );
6831
6832        utils::result(
6833            vips_op_response,
6834            out_out,
6835            Error::OperationError("IccExport (vips_icc_export) failed".to_string()),
6836        )
6837    }
6838
6839    /// VipsIccExport (icc_export), output to device with ICC profile
6840    /// returns `VipsImage` - Output image
6841    ///
6842    /// <ins>Optional arguments</ins>
6843    ///
6844    /// pcs: [`PCS`] -> Set Profile Connection Space
6845    ///
6846    /// intent: [`Intent`] -> Rendering intent
6847    ///
6848    /// black_point_compensation: `bool` -> Enable black point compensation
6849    ///
6850    /// output_profile: `&str` -> Filename to load output profile from
6851    ///
6852    /// depth: `i32` -> Output device space depth in bits
6853    pub fn icc_export_with_opts(&self, option: VOption) -> Result<VipsImage> {
6854        let mut out_out = VipsImage::from(null_mut());
6855        let vips_op_response = call(
6856            "icc_export",
6857            option
6858                .set("in", self)
6859                .set(
6860                    "out",
6861                    &mut out_out,
6862                ),
6863        );
6864
6865        utils::result(
6866            vips_op_response,
6867            out_out,
6868            Error::OperationError("IccExport (vips_icc_export) failed".to_string()),
6869        )
6870    }
6871
6872    /// VipsIccImport (icc_import), import from device with ICC profile
6873    /// returns `VipsImage` - Output image
6874    pub fn icc_import(&self) -> Result<VipsImage> {
6875        let mut out_out = VipsImage::from(null_mut());
6876        let vips_op_response = call(
6877            "icc_import",
6878            VOption::new()
6879                .set("in", self)
6880                .set(
6881                    "out",
6882                    &mut out_out,
6883                ),
6884        );
6885
6886        utils::result(
6887            vips_op_response,
6888            out_out,
6889            Error::OperationError("IccImport (vips_icc_import) failed".to_string()),
6890        )
6891    }
6892
6893    /// VipsIccImport (icc_import), import from device with ICC profile
6894    /// returns `VipsImage` - Output image
6895    ///
6896    /// <ins>Optional arguments</ins>
6897    ///
6898    /// pcs: [`PCS`] -> Set Profile Connection Space
6899    ///
6900    /// intent: [`Intent`] -> Rendering intent
6901    ///
6902    /// black_point_compensation: `bool` -> Enable black point compensation
6903    ///
6904    /// embedded: `bool` -> Use embedded input profile, if available
6905    ///
6906    /// input_profile: `&str` -> Filename to load input profile from
6907    pub fn icc_import_with_opts(&self, option: VOption) -> Result<VipsImage> {
6908        let mut out_out = VipsImage::from(null_mut());
6909        let vips_op_response = call(
6910            "icc_import",
6911            option
6912                .set("in", self)
6913                .set(
6914                    "out",
6915                    &mut out_out,
6916                ),
6917        );
6918
6919        utils::result(
6920            vips_op_response,
6921            out_out,
6922            Error::OperationError("IccImport (vips_icc_import) failed".to_string()),
6923        )
6924    }
6925
6926    /// VipsIccTransform (icc_transform), transform between devices with ICC profiles
6927    /// returns `VipsImage` - Output image
6928    ///
6929    /// output_profile: `&str` -> Filename to load output profile from
6930    pub fn icc_transform(&self, output_profile: &str) -> Result<VipsImage> {
6931        let mut out_out = VipsImage::from(null_mut());
6932        let vips_op_response = call(
6933            "icc_transform",
6934            VOption::new()
6935                .set("in", self)
6936                .set(
6937                    "out",
6938                    &mut out_out,
6939                )
6940                .set(
6941                    "output-profile",
6942                    output_profile,
6943                ),
6944        );
6945
6946        utils::result(
6947            vips_op_response,
6948            out_out,
6949            Error::OperationError("IccTransform (vips_icc_transform) failed".to_string()),
6950        )
6951    }
6952
6953    /// VipsIccTransform (icc_transform), transform between devices with ICC profiles
6954    /// returns `VipsImage` - Output image
6955    ///
6956    /// output_profile: `&str` -> Filename to load output profile from
6957    ///
6958    /// <ins>Optional arguments</ins>
6959    ///
6960    /// pcs: [`PCS`] -> Set Profile Connection Space
6961    ///
6962    /// intent: [`Intent`] -> Rendering intent
6963    ///
6964    /// black_point_compensation: `bool` -> Enable black point compensation
6965    ///
6966    /// embedded: `bool` -> Use embedded input profile, if available
6967    ///
6968    /// input_profile: `&str` -> Filename to load input profile from
6969    ///
6970    /// depth: `i32` -> Output device space depth in bits
6971    pub fn icc_transform_with_opts(
6972        &self,
6973        output_profile: &str,
6974        option: VOption,
6975    ) -> Result<VipsImage> {
6976        let mut out_out = VipsImage::from(null_mut());
6977        let vips_op_response = call(
6978            "icc_transform",
6979            option
6980                .set("in", self)
6981                .set(
6982                    "out",
6983                    &mut out_out,
6984                )
6985                .set(
6986                    "output-profile",
6987                    output_profile,
6988                ),
6989        );
6990
6991        utils::result(
6992            vips_op_response,
6993            out_out,
6994            Error::OperationError("IccTransform (vips_icc_transform) failed".to_string()),
6995        )
6996    }
6997
6998    /// VipsIdentity (identity), make a 1D image where pixel values are indexes
6999    /// returns `VipsImage` - Output image
7000    pub fn identity() -> Result<VipsImage> {
7001        let mut out_out = VipsImage::from(null_mut());
7002        let vips_op_response = call(
7003            "identity",
7004            VOption::new().set(
7005                "out",
7006                &mut out_out,
7007            ),
7008        );
7009
7010        utils::result(
7011            vips_op_response,
7012            out_out,
7013            Error::OperationError("Identity (vips_identity) failed".to_string()),
7014        )
7015    }
7016
7017    /// VipsIdentity (identity), make a 1D image where pixel values are indexes
7018    /// returns `VipsImage` - Output image
7019    ///
7020    /// <ins>Optional arguments</ins>
7021    ///
7022    /// bands: `i32` -> Number of bands in LUT
7023    ///
7024    /// ushort: `bool` -> Create a 16-bit LUT
7025    ///
7026    /// size: `i32` -> Size of 16-bit LUT
7027    pub fn identity_with_opts(option: VOption) -> Result<VipsImage> {
7028        let mut out_out = VipsImage::from(null_mut());
7029        let vips_op_response = call(
7030            "identity",
7031            option.set(
7032                "out",
7033                &mut out_out,
7034            ),
7035        );
7036
7037        utils::result(
7038            vips_op_response,
7039            out_out,
7040            Error::OperationError("Identity (vips_identity) failed".to_string()),
7041        )
7042    }
7043
7044    /// VipsIfthenelse (ifthenelse), ifthenelse an image
7045    /// returns `VipsImage` - Output image
7046    ///
7047    /// in1: `&VipsImage` -> Source for TRUE pixels
7048    ///
7049    /// in2: `&VipsImage` -> Source for FALSE pixels
7050    pub fn ifthenelse(&self, in1: &VipsImage, in2: &VipsImage) -> Result<VipsImage> {
7051        let mut out_out = VipsImage::from(null_mut());
7052        let vips_op_response = call(
7053            "ifthenelse",
7054            VOption::new()
7055                .set(
7056                    "cond",
7057                    self,
7058                )
7059                .set("in1", in1)
7060                .set("in2", in2)
7061                .set(
7062                    "out",
7063                    &mut out_out,
7064                ),
7065        );
7066
7067        utils::result(
7068            vips_op_response,
7069            out_out,
7070            Error::OperationError("Ifthenelse (vips_ifthenelse) failed".to_string()),
7071        )
7072    }
7073
7074    /// VipsIfthenelse (ifthenelse), ifthenelse an image
7075    /// returns `VipsImage` - Output image
7076    ///
7077    /// in1: `&VipsImage` -> Source for TRUE pixels
7078    ///
7079    /// in2: `&VipsImage` -> Source for FALSE pixels
7080    ///
7081    /// <ins>Optional arguments</ins>
7082    ///
7083    /// blend: `bool` -> Blend smoothly between then and else parts
7084    pub fn ifthenelse_with_opts(
7085        &self,
7086        in1: &VipsImage,
7087        in2: &VipsImage,
7088        option: VOption,
7089    ) -> Result<VipsImage> {
7090        let mut out_out = VipsImage::from(null_mut());
7091        let vips_op_response = call(
7092            "ifthenelse",
7093            option
7094                .set(
7095                    "cond",
7096                    self,
7097                )
7098                .set("in1", in1)
7099                .set("in2", in2)
7100                .set(
7101                    "out",
7102                    &mut out_out,
7103                ),
7104        );
7105
7106        utils::result(
7107            vips_op_response,
7108            out_out,
7109            Error::OperationError("Ifthenelse (vips_ifthenelse) failed".to_string()),
7110        )
7111    }
7112
7113    /// VipsInsert (insert), insert image @sub into @main at @x, @y
7114    /// returns `VipsImage` - Output image
7115    ///
7116    /// sub: `&VipsImage` -> Sub-image to insert into main image
7117    ///
7118    /// x: `i32` -> Left edge of sub in main
7119    ///
7120    /// y: `i32` -> Top edge of sub in main
7121    pub fn insert(&self, sub: &VipsImage, x: i32, y: i32) -> Result<VipsImage> {
7122        let mut out_out = VipsImage::from(null_mut());
7123        let vips_op_response = call(
7124            "insert",
7125            VOption::new()
7126                .set(
7127                    "main",
7128                    self,
7129                )
7130                .set("sub", sub)
7131                .set(
7132                    "out",
7133                    &mut out_out,
7134                )
7135                .set("x", x)
7136                .set("y", y),
7137        );
7138
7139        utils::result(
7140            vips_op_response,
7141            out_out,
7142            Error::OperationError("Insert (vips_insert) failed".to_string()),
7143        )
7144    }
7145
7146    /// VipsInsert (insert), insert image @sub into @main at @x, @y
7147    /// returns `VipsImage` - Output image
7148    ///
7149    /// sub: `&VipsImage` -> Sub-image to insert into main image
7150    ///
7151    /// x: `i32` -> Left edge of sub in main
7152    ///
7153    /// y: `i32` -> Top edge of sub in main
7154    ///
7155    /// <ins>Optional arguments</ins>
7156    ///
7157    /// expand: `bool` -> Expand output to hold all of both inputs
7158    ///
7159    /// background: `&[f64]` -> Color for new pixels
7160    pub fn insert_with_opts(
7161        &self,
7162        sub: &VipsImage,
7163        x: i32,
7164        y: i32,
7165        option: VOption,
7166    ) -> Result<VipsImage> {
7167        let mut out_out = VipsImage::from(null_mut());
7168        let vips_op_response = call(
7169            "insert",
7170            option
7171                .set(
7172                    "main",
7173                    self,
7174                )
7175                .set("sub", sub)
7176                .set(
7177                    "out",
7178                    &mut out_out,
7179                )
7180                .set("x", x)
7181                .set("y", y),
7182        );
7183
7184        utils::result(
7185            vips_op_response,
7186            out_out,
7187            Error::OperationError("Insert (vips_insert) failed".to_string()),
7188        )
7189    }
7190
7191    /// VipsInvert (invert), invert an image
7192    /// returns `VipsImage` - Output image
7193    pub fn invert(&self) -> Result<VipsImage> {
7194        let mut out_out = VipsImage::from(null_mut());
7195        let vips_op_response = call(
7196            "invert",
7197            VOption::new()
7198                .set("in", self)
7199                .set(
7200                    "out",
7201                    &mut out_out,
7202                ),
7203        );
7204
7205        utils::result(
7206            vips_op_response,
7207            out_out,
7208            Error::OperationError("Invert (vips_invert) failed".to_string()),
7209        )
7210    }
7211
7212    /// VipsInvertlut (invertlut), build an inverted look-up table
7213    /// returns `VipsImage` - Output image
7214    pub fn invertlut(&self) -> Result<VipsImage> {
7215        let mut out_out = VipsImage::from(null_mut());
7216        let vips_op_response = call(
7217            "invertlut",
7218            VOption::new()
7219                .set("in", self)
7220                .set(
7221                    "out",
7222                    &mut out_out,
7223                ),
7224        );
7225
7226        utils::result(
7227            vips_op_response,
7228            out_out,
7229            Error::OperationError("Invertlut (vips_invertlut) failed".to_string()),
7230        )
7231    }
7232
7233    /// VipsInvertlut (invertlut), build an inverted look-up table
7234    /// returns `VipsImage` - Output image
7235    ///
7236    /// <ins>Optional arguments</ins>
7237    ///
7238    /// size: `i32` -> LUT size to generate
7239    pub fn invertlut_with_opts(&self, option: VOption) -> Result<VipsImage> {
7240        let mut out_out = VipsImage::from(null_mut());
7241        let vips_op_response = call(
7242            "invertlut",
7243            option
7244                .set("in", self)
7245                .set(
7246                    "out",
7247                    &mut out_out,
7248                ),
7249        );
7250
7251        utils::result(
7252            vips_op_response,
7253            out_out,
7254            Error::OperationError("Invertlut (vips_invertlut) failed".to_string()),
7255        )
7256    }
7257
7258    /// VipsInvfft (invfft), inverse FFT
7259    /// returns `VipsImage` - Output image
7260    pub fn invfft(&self) -> Result<VipsImage> {
7261        let mut out_out = VipsImage::from(null_mut());
7262        let vips_op_response = call(
7263            "invfft",
7264            VOption::new()
7265                .set("in", self)
7266                .set(
7267                    "out",
7268                    &mut out_out,
7269                ),
7270        );
7271
7272        utils::result(
7273            vips_op_response,
7274            out_out,
7275            Error::OperationError("Invfft (vips_invfft) failed".to_string()),
7276        )
7277    }
7278
7279    /// VipsInvfft (invfft), inverse FFT
7280    /// returns `VipsImage` - Output image
7281    ///
7282    /// <ins>Optional arguments</ins>
7283    ///
7284    /// real: `bool` -> Output only the real part of the transform
7285    pub fn invfft_with_opts(&self, option: VOption) -> Result<VipsImage> {
7286        let mut out_out = VipsImage::from(null_mut());
7287        let vips_op_response = call(
7288            "invfft",
7289            option
7290                .set("in", self)
7291                .set(
7292                    "out",
7293                    &mut out_out,
7294                ),
7295        );
7296
7297        utils::result(
7298            vips_op_response,
7299            out_out,
7300            Error::OperationError("Invfft (vips_invfft) failed".to_string()),
7301        )
7302    }
7303
7304    /// VipsJoin (join), join a pair of images
7305    /// returns `VipsImage` - Output image
7306    ///
7307    /// in2: `&VipsImage` -> Second input image
7308    ///
7309    /// direction: `Direction` -> Join left-right or up-down
7310    pub fn join(&self, in2: &VipsImage, direction: Direction) -> Result<VipsImage> {
7311        let mut out_out = VipsImage::from(null_mut());
7312        let vips_op_response = call(
7313            "join",
7314            VOption::new()
7315                .set(
7316                    "in1", self,
7317                )
7318                .set("in2", in2)
7319                .set(
7320                    "out",
7321                    &mut out_out,
7322                )
7323                .set(
7324                    "direction",
7325                    direction as i32,
7326                ),
7327        );
7328
7329        utils::result(
7330            vips_op_response,
7331            out_out,
7332            Error::OperationError("Join (vips_join) failed".to_string()),
7333        )
7334    }
7335
7336    /// VipsJoin (join), join a pair of images
7337    /// returns `VipsImage` - Output image
7338    ///
7339    /// in2: `&VipsImage` -> Second input image
7340    ///
7341    /// direction: `Direction` -> Join left-right or up-down
7342    ///
7343    /// <ins>Optional arguments</ins>
7344    ///
7345    /// expand: `bool` -> Expand output to hold all of both inputs
7346    ///
7347    /// shim: `i32` -> Pixels between images
7348    ///
7349    /// background: `&[f64]` -> Colour for new pixels
7350    ///
7351    /// align: [`Align`] -> Align on the low, centre or high coordinate edge
7352    pub fn join_with_opts(
7353        &self,
7354        in2: &VipsImage,
7355        direction: Direction,
7356        option: VOption,
7357    ) -> Result<VipsImage> {
7358        let mut out_out = VipsImage::from(null_mut());
7359        let vips_op_response = call(
7360            "join",
7361            option
7362                .set(
7363                    "in1", self,
7364                )
7365                .set("in2", in2)
7366                .set(
7367                    "out",
7368                    &mut out_out,
7369                )
7370                .set(
7371                    "direction",
7372                    direction as i32,
7373                ),
7374        );
7375
7376        utils::result(
7377            vips_op_response,
7378            out_out,
7379            Error::OperationError("Join (vips_join) failed".to_string()),
7380        )
7381    }
7382
7383    /// VipsForeignLoadJp2kFile (jp2kload), load JPEG2000 image (.j2k, .jp2, .jpt, .j2c, .jpc), priority=0, untrusted, is_a, get_flags, header, load
7384    /// returns `VipsImage` - Output image
7385    ///
7386    /// filename: `&str` -> Filename to load from
7387    pub fn jp2kload(filename: &str) -> Result<VipsImage> {
7388        let mut out_out = VipsImage::from(null_mut());
7389        let vips_op_response = call(
7390            "jp2kload",
7391            VOption::new()
7392                .set(
7393                    "filename",
7394                    filename,
7395                )
7396                .set(
7397                    "out",
7398                    &mut out_out,
7399                ),
7400        );
7401
7402        utils::result(
7403            vips_op_response,
7404            out_out,
7405            Error::OperationError("Jp2Kload (vips_jp2kload) failed".to_string()),
7406        )
7407    }
7408
7409    /// VipsForeignLoadJp2kFile (jp2kload), load JPEG2000 image (.j2k, .jp2, .jpt, .j2c, .jpc), priority=0, untrusted, is_a, get_flags, header, load
7410    /// returns `VipsImage` - Output image
7411    ///
7412    /// filename: `&str` -> Filename to load from
7413    ///
7414    /// <ins>Optional arguments</ins>
7415    ///
7416    /// page: `i32` -> Load this page from the image
7417    ///
7418    /// oneshot: `bool` -> Load images a frame at a time
7419    ///
7420    /// flags: [`ForeignFlags`] -> Flags for this file
7421    ///
7422    /// memory: `bool` -> Force open via memory
7423    ///
7424    /// access: [`Access`] -> Required access pattern for this file
7425    ///
7426    /// fail_on: [`FailOn`] -> Error level to fail on
7427    ///
7428    /// revalidate: `bool` -> Don't use a cached result for this operation
7429    pub fn jp2kload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
7430        let mut out_out = VipsImage::from(null_mut());
7431        let vips_op_response = call(
7432            "jp2kload",
7433            option
7434                .set(
7435                    "filename",
7436                    filename,
7437                )
7438                .set(
7439                    "out",
7440                    &mut out_out,
7441                ),
7442        );
7443
7444        utils::result(
7445            vips_op_response,
7446            out_out,
7447            Error::OperationError("Jp2Kload (vips_jp2kload) failed".to_string()),
7448        )
7449    }
7450
7451    /// VipsForeignLoadJp2kBuffer (jp2kload_buffer), load JPEG2000 image, priority=0, untrusted, is_a_buffer, get_flags, header, load
7452    /// returns `VipsImage` - Output image
7453    ///
7454    /// buffer: `&[u8]` -> Buffer to load from
7455    pub fn jp2kload_buffer(buffer: &[u8]) -> Result<VipsImage> {
7456        let blob = unsafe {
7457            vips_blob_new(
7458                None,
7459                buffer.as_ptr() as _,
7460                buffer.len() as _,
7461            )
7462        };
7463        let mut out_out = VipsImage::from(null_mut());
7464        let vips_op_response = call(
7465            "jp2kload_buffer",
7466            VOption::new()
7467                .set(
7468                    "buffer",
7469                    &VipsBlob::from(blob),
7470                )
7471                .set(
7472                    "out",
7473                    &mut out_out,
7474                ),
7475        );
7476        unsafe { vips_area_unref(&mut (*blob).area) };
7477        utils::result(
7478            vips_op_response,
7479            out_out,
7480            Error::OperationError("Jp2KloadBuffer (vips_jp2kload_buffer) failed".to_string()),
7481        )
7482    }
7483
7484    /// VipsForeignLoadJp2kBuffer (jp2kload_buffer), load JPEG2000 image, priority=0, untrusted, is_a_buffer, get_flags, header, load
7485    /// returns `VipsImage` - Output image
7486    ///
7487    /// buffer: `&[u8]` -> Buffer to load from
7488    ///
7489    /// <ins>Optional arguments</ins>
7490    ///
7491    /// page: `i32` -> Load this page from the image
7492    ///
7493    /// oneshot: `bool` -> Load images a frame at a time
7494    ///
7495    /// flags: [`ForeignFlags`] -> Flags for this file
7496    ///
7497    /// memory: `bool` -> Force open via memory
7498    ///
7499    /// access: [`Access`] -> Required access pattern for this file
7500    ///
7501    /// fail_on: [`FailOn`] -> Error level to fail on
7502    ///
7503    /// revalidate: `bool` -> Don't use a cached result for this operation
7504    pub fn jp2kload_buffer_with_opts(buffer: &[u8], option: VOption) -> Result<VipsImage> {
7505        let blob = unsafe {
7506            vips_blob_new(
7507                None,
7508                buffer.as_ptr() as _,
7509                buffer.len() as _,
7510            )
7511        };
7512        let mut out_out = VipsImage::from(null_mut());
7513        let vips_op_response = call(
7514            "jp2kload_buffer",
7515            option
7516                .set(
7517                    "buffer",
7518                    &VipsBlob::from(blob),
7519                )
7520                .set(
7521                    "out",
7522                    &mut out_out,
7523                ),
7524        );
7525        unsafe { vips_area_unref(&mut (*blob).area) };
7526        utils::result(
7527            vips_op_response,
7528            out_out,
7529            Error::OperationError("Jp2KloadBuffer (vips_jp2kload_buffer) failed".to_string()),
7530        )
7531    }
7532
7533    /// VipsForeignLoadJp2kSource (jp2kload_source), load JPEG2000 image, priority=0, untrusted, is_a_source, get_flags, header, load
7534    /// returns `VipsImage` - Output image
7535    ///
7536    /// source: `&VipsSource` -> Source to load from
7537    pub fn jp2kload_source(source: &VipsSource) -> Result<VipsImage> {
7538        let mut out_out = VipsImage::from(null_mut());
7539        let vips_op_response = call(
7540            "jp2kload_source",
7541            VOption::new()
7542                .set(
7543                    "source",
7544                    source,
7545                )
7546                .set(
7547                    "out",
7548                    &mut out_out,
7549                ),
7550        );
7551
7552        utils::result(
7553            vips_op_response,
7554            out_out,
7555            Error::OperationError("Jp2KloadSource (vips_jp2kload_source) failed".to_string()),
7556        )
7557    }
7558
7559    /// VipsForeignLoadJp2kSource (jp2kload_source), load JPEG2000 image, priority=0, untrusted, is_a_source, get_flags, header, load
7560    /// returns `VipsImage` - Output image
7561    ///
7562    /// source: `&VipsSource` -> Source to load from
7563    ///
7564    /// <ins>Optional arguments</ins>
7565    ///
7566    /// page: `i32` -> Load this page from the image
7567    ///
7568    /// oneshot: `bool` -> Load images a frame at a time
7569    ///
7570    /// flags: [`ForeignFlags`] -> Flags for this file
7571    ///
7572    /// memory: `bool` -> Force open via memory
7573    ///
7574    /// access: [`Access`] -> Required access pattern for this file
7575    ///
7576    /// fail_on: [`FailOn`] -> Error level to fail on
7577    ///
7578    /// revalidate: `bool` -> Don't use a cached result for this operation
7579    pub fn jp2kload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
7580        let mut out_out = VipsImage::from(null_mut());
7581        let vips_op_response = call(
7582            "jp2kload_source",
7583            option
7584                .set(
7585                    "source",
7586                    source,
7587                )
7588                .set(
7589                    "out",
7590                    &mut out_out,
7591                ),
7592        );
7593
7594        utils::result(
7595            vips_op_response,
7596            out_out,
7597            Error::OperationError("Jp2KloadSource (vips_jp2kload_source) failed".to_string()),
7598        )
7599    }
7600
7601    /// VipsForeignSaveJp2kFile (jp2ksave), save image in JPEG2000 format (.j2k, .jp2, .jpt, .j2c, .jpc), priority=0,
7602    ///
7603    /// filename: `&str` -> Filename to save to
7604    pub fn jp2ksave(&self, filename: &str) -> Result<()> {
7605        let vips_op_response = call(
7606            "jp2ksave",
7607            VOption::new()
7608                .set("in", self)
7609                .set(
7610                    "filename",
7611                    filename,
7612                ),
7613        );
7614
7615        utils::result(
7616            vips_op_response,
7617            (),
7618            Error::OperationError("Jp2Ksave (vips_jp2ksave) failed".to_string()),
7619        )
7620    }
7621
7622    /// VipsForeignSaveJp2kFile (jp2ksave), save image in JPEG2000 format (.j2k, .jp2, .jpt, .j2c, .jpc), priority=0,
7623    ///
7624    /// filename: `&str` -> Filename to save to
7625    ///
7626    /// <ins>Optional arguments</ins>
7627    ///
7628    /// tile_width: `i32` -> Tile width in pixels
7629    ///
7630    /// tile_height: `i32` -> Tile height in pixels
7631    ///
7632    /// lossless: `bool` -> Enable lossless compression
7633    ///
7634    /// Q: `i32` -> Q factor
7635    ///
7636    /// subsample_mode: [`ForeignSubsample`] -> Select chroma subsample operation mode
7637    ///
7638    /// keep: [`ForeignKeep`] -> Which metadata to retain
7639    ///
7640    /// background: `&[f64]` -> Background value
7641    ///
7642    /// page_height: `i32` -> Set page height for multipage save
7643    ///
7644    /// profile: `&str` -> Filename of ICC profile to embed
7645    pub fn jp2ksave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
7646        let vips_op_response = call(
7647            "jp2ksave",
7648            option
7649                .set("in", self)
7650                .set(
7651                    "filename",
7652                    filename,
7653                ),
7654        );
7655
7656        utils::result(
7657            vips_op_response,
7658            (),
7659            Error::OperationError("Jp2Ksave (vips_jp2ksave) failed".to_string()),
7660        )
7661    }
7662
7663    /// VipsForeignSaveJp2kBuffer (jp2ksave_buffer), save image in JPEG2000 format (.j2k, .jp2, .jpt, .j2c, .jpc), priority=0,
7664    /// returns `Vec<u8>` - Buffer to save to
7665    pub fn jp2ksave_buffer(&self) -> Result<Vec<u8>> {
7666        let mut buffer_out = VipsBlob::from(null_mut());
7667        let vips_op_response = call(
7668            "jp2ksave_buffer",
7669            VOption::new()
7670                .set("in", self)
7671                .set(
7672                    "buffer",
7673                    &mut buffer_out,
7674                ),
7675        );
7676
7677        utils::result(
7678            vips_op_response,
7679            buffer_out.into(),
7680            Error::OperationError("Jp2KsaveBuffer (vips_jp2ksave_buffer) failed".to_string()),
7681        )
7682    }
7683
7684    /// VipsForeignSaveJp2kBuffer (jp2ksave_buffer), save image in JPEG2000 format (.j2k, .jp2, .jpt, .j2c, .jpc), priority=0,
7685    /// returns `Vec<u8>` - Buffer to save to
7686    ///
7687    /// <ins>Optional arguments</ins>
7688    ///
7689    /// tile_width: `i32` -> Tile width in pixels
7690    ///
7691    /// tile_height: `i32` -> Tile height in pixels
7692    ///
7693    /// lossless: `bool` -> Enable lossless compression
7694    ///
7695    /// Q: `i32` -> Q factor
7696    ///
7697    /// subsample_mode: [`ForeignSubsample`] -> Select chroma subsample operation mode
7698    ///
7699    /// keep: [`ForeignKeep`] -> Which metadata to retain
7700    ///
7701    /// background: `&[f64]` -> Background value
7702    ///
7703    /// page_height: `i32` -> Set page height for multipage save
7704    ///
7705    /// profile: `&str` -> Filename of ICC profile to embed
7706    pub fn jp2ksave_buffer_with_opts(&self, option: VOption) -> Result<Vec<u8>> {
7707        let mut buffer_out = VipsBlob::from(null_mut());
7708        let vips_op_response = call(
7709            "jp2ksave_buffer",
7710            option
7711                .set("in", self)
7712                .set(
7713                    "buffer",
7714                    &mut buffer_out,
7715                ),
7716        );
7717
7718        utils::result(
7719            vips_op_response,
7720            buffer_out.into(),
7721            Error::OperationError("Jp2KsaveBuffer (vips_jp2ksave_buffer) failed".to_string()),
7722        )
7723    }
7724
7725    /// VipsForeignSaveJp2kTarget (jp2ksave_target), save image in JPEG2000 format (.j2k, .jp2, .jpt, .j2c, .jpc), priority=0,
7726    ///
7727    /// target: `&VipsTarget` -> Target to save to
7728    pub fn jp2ksave_target(&self, target: &VipsTarget) -> Result<()> {
7729        let vips_op_response = call(
7730            "jp2ksave_target",
7731            VOption::new()
7732                .set("in", self)
7733                .set(
7734                    "target",
7735                    target,
7736                ),
7737        );
7738
7739        utils::result(
7740            vips_op_response,
7741            (),
7742            Error::OperationError("Jp2KsaveTarget (vips_jp2ksave_target) failed".to_string()),
7743        )
7744    }
7745
7746    /// VipsForeignSaveJp2kTarget (jp2ksave_target), save image in JPEG2000 format (.j2k, .jp2, .jpt, .j2c, .jpc), priority=0,
7747    ///
7748    /// target: `&VipsTarget` -> Target to save to
7749    ///
7750    /// <ins>Optional arguments</ins>
7751    ///
7752    /// tile_width: `i32` -> Tile width in pixels
7753    ///
7754    /// tile_height: `i32` -> Tile height in pixels
7755    ///
7756    /// lossless: `bool` -> Enable lossless compression
7757    ///
7758    /// Q: `i32` -> Q factor
7759    ///
7760    /// subsample_mode: [`ForeignSubsample`] -> Select chroma subsample operation mode
7761    ///
7762    /// keep: [`ForeignKeep`] -> Which metadata to retain
7763    ///
7764    /// background: `&[f64]` -> Background value
7765    ///
7766    /// page_height: `i32` -> Set page height for multipage save
7767    ///
7768    /// profile: `&str` -> Filename of ICC profile to embed
7769    pub fn jp2ksave_target_with_opts(&self, target: &VipsTarget, option: VOption) -> Result<()> {
7770        let vips_op_response = call(
7771            "jp2ksave_target",
7772            option
7773                .set("in", self)
7774                .set(
7775                    "target",
7776                    target,
7777                ),
7778        );
7779
7780        utils::result(
7781            vips_op_response,
7782            (),
7783            Error::OperationError("Jp2KsaveTarget (vips_jp2ksave_target) failed".to_string()),
7784        )
7785    }
7786
7787    /// VipsForeignLoadJpegFile (jpegload), load jpeg from file (.jpg, .jpeg, .jpe, .jfif), priority=50, is_a, get_flags, get_flags_filename, header, load
7788    /// returns `VipsImage` - Output image
7789    ///
7790    /// filename: `&str` -> Filename to load from
7791    pub fn jpegload(filename: &str) -> Result<VipsImage> {
7792        let mut out_out = VipsImage::from(null_mut());
7793        let vips_op_response = call(
7794            "jpegload",
7795            VOption::new()
7796                .set(
7797                    "filename",
7798                    filename,
7799                )
7800                .set(
7801                    "out",
7802                    &mut out_out,
7803                ),
7804        );
7805
7806        utils::result(
7807            vips_op_response,
7808            out_out,
7809            Error::OperationError("Jpegload (vips_jpegload) failed".to_string()),
7810        )
7811    }
7812
7813    /// VipsForeignLoadJpegFile (jpegload), load jpeg from file (.jpg, .jpeg, .jpe, .jfif), priority=50, is_a, get_flags, get_flags_filename, header, load
7814    /// returns `VipsImage` - Output image
7815    ///
7816    /// filename: `&str` -> Filename to load from
7817    ///
7818    /// <ins>Optional arguments</ins>
7819    ///
7820    /// shrink: `i32` -> Shrink factor on load
7821    ///
7822    /// autorotate: `bool` -> Rotate image using exif orientation
7823    ///
7824    /// unlimited: `bool` -> Remove all denial of service limits
7825    ///
7826    /// flags: [`ForeignFlags`] -> Flags for this file
7827    ///
7828    /// memory: `bool` -> Force open via memory
7829    ///
7830    /// access: [`Access`] -> Required access pattern for this file
7831    ///
7832    /// fail_on: [`FailOn`] -> Error level to fail on
7833    ///
7834    /// revalidate: `bool` -> Don't use a cached result for this operation
7835    pub fn jpegload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
7836        let mut out_out = VipsImage::from(null_mut());
7837        let vips_op_response = call(
7838            "jpegload",
7839            option
7840                .set(
7841                    "filename",
7842                    filename,
7843                )
7844                .set(
7845                    "out",
7846                    &mut out_out,
7847                ),
7848        );
7849
7850        utils::result(
7851            vips_op_response,
7852            out_out,
7853            Error::OperationError("Jpegload (vips_jpegload) failed".to_string()),
7854        )
7855    }
7856
7857    /// VipsForeignLoadJpegBuffer (jpegload_buffer), load jpeg from buffer, priority=50, is_a_buffer, get_flags, get_flags_filename, header, load
7858    /// returns `VipsImage` - Output image
7859    ///
7860    /// buffer: `&[u8]` -> Buffer to load from
7861    pub fn jpegload_buffer(buffer: &[u8]) -> Result<VipsImage> {
7862        let blob = unsafe {
7863            vips_blob_new(
7864                None,
7865                buffer.as_ptr() as _,
7866                buffer.len() as _,
7867            )
7868        };
7869        let mut out_out = VipsImage::from(null_mut());
7870        let vips_op_response = call(
7871            "jpegload_buffer",
7872            VOption::new()
7873                .set(
7874                    "buffer",
7875                    &VipsBlob::from(blob),
7876                )
7877                .set(
7878                    "out",
7879                    &mut out_out,
7880                ),
7881        );
7882        unsafe { vips_area_unref(&mut (*blob).area) };
7883        utils::result(
7884            vips_op_response,
7885            out_out,
7886            Error::OperationError("JpegloadBuffer (vips_jpegload_buffer) failed".to_string()),
7887        )
7888    }
7889
7890    /// VipsForeignLoadJpegBuffer (jpegload_buffer), load jpeg from buffer, priority=50, is_a_buffer, get_flags, get_flags_filename, header, load
7891    /// returns `VipsImage` - Output image
7892    ///
7893    /// buffer: `&[u8]` -> Buffer to load from
7894    ///
7895    /// <ins>Optional arguments</ins>
7896    ///
7897    /// shrink: `i32` -> Shrink factor on load
7898    ///
7899    /// autorotate: `bool` -> Rotate image using exif orientation
7900    ///
7901    /// unlimited: `bool` -> Remove all denial of service limits
7902    ///
7903    /// flags: [`ForeignFlags`] -> Flags for this file
7904    ///
7905    /// memory: `bool` -> Force open via memory
7906    ///
7907    /// access: [`Access`] -> Required access pattern for this file
7908    ///
7909    /// fail_on: [`FailOn`] -> Error level to fail on
7910    ///
7911    /// revalidate: `bool` -> Don't use a cached result for this operation
7912    pub fn jpegload_buffer_with_opts(buffer: &[u8], option: VOption) -> Result<VipsImage> {
7913        let blob = unsafe {
7914            vips_blob_new(
7915                None,
7916                buffer.as_ptr() as _,
7917                buffer.len() as _,
7918            )
7919        };
7920        let mut out_out = VipsImage::from(null_mut());
7921        let vips_op_response = call(
7922            "jpegload_buffer",
7923            option
7924                .set(
7925                    "buffer",
7926                    &VipsBlob::from(blob),
7927                )
7928                .set(
7929                    "out",
7930                    &mut out_out,
7931                ),
7932        );
7933        unsafe { vips_area_unref(&mut (*blob).area) };
7934        utils::result(
7935            vips_op_response,
7936            out_out,
7937            Error::OperationError("JpegloadBuffer (vips_jpegload_buffer) failed".to_string()),
7938        )
7939    }
7940
7941    /// VipsForeignLoadJpegSource (jpegload_source), load image from jpeg source, priority=50, is_a_source, get_flags, get_flags_filename, header, load
7942    /// returns `VipsImage` - Output image
7943    ///
7944    /// source: `&VipsSource` -> Source to load from
7945    pub fn jpegload_source(source: &VipsSource) -> Result<VipsImage> {
7946        let mut out_out = VipsImage::from(null_mut());
7947        let vips_op_response = call(
7948            "jpegload_source",
7949            VOption::new()
7950                .set(
7951                    "source",
7952                    source,
7953                )
7954                .set(
7955                    "out",
7956                    &mut out_out,
7957                ),
7958        );
7959
7960        utils::result(
7961            vips_op_response,
7962            out_out,
7963            Error::OperationError("JpegloadSource (vips_jpegload_source) failed".to_string()),
7964        )
7965    }
7966
7967    /// VipsForeignLoadJpegSource (jpegload_source), load image from jpeg source, priority=50, is_a_source, get_flags, get_flags_filename, header, load
7968    /// returns `VipsImage` - Output image
7969    ///
7970    /// source: `&VipsSource` -> Source to load from
7971    ///
7972    /// <ins>Optional arguments</ins>
7973    ///
7974    /// shrink: `i32` -> Shrink factor on load
7975    ///
7976    /// autorotate: `bool` -> Rotate image using exif orientation
7977    ///
7978    /// unlimited: `bool` -> Remove all denial of service limits
7979    ///
7980    /// flags: [`ForeignFlags`] -> Flags for this file
7981    ///
7982    /// memory: `bool` -> Force open via memory
7983    ///
7984    /// access: [`Access`] -> Required access pattern for this file
7985    ///
7986    /// fail_on: [`FailOn`] -> Error level to fail on
7987    ///
7988    /// revalidate: `bool` -> Don't use a cached result for this operation
7989    pub fn jpegload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
7990        let mut out_out = VipsImage::from(null_mut());
7991        let vips_op_response = call(
7992            "jpegload_source",
7993            option
7994                .set(
7995                    "source",
7996                    source,
7997                )
7998                .set(
7999                    "out",
8000                    &mut out_out,
8001                ),
8002        );
8003
8004        utils::result(
8005            vips_op_response,
8006            out_out,
8007            Error::OperationError("JpegloadSource (vips_jpegload_source) failed".to_string()),
8008        )
8009    }
8010
8011    /// VipsForeignSaveJpegFile (jpegsave), save image to jpeg file (.jpg, .jpeg, .jpe, .jfif), priority=0, mono rgb cmyk
8012    ///
8013    /// filename: `&str` -> Filename to save to
8014    pub fn jpegsave(&self, filename: &str) -> Result<()> {
8015        let vips_op_response = call(
8016            "jpegsave",
8017            VOption::new()
8018                .set("in", self)
8019                .set(
8020                    "filename",
8021                    filename,
8022                ),
8023        );
8024
8025        utils::result(
8026            vips_op_response,
8027            (),
8028            Error::OperationError("Jpegsave (vips_jpegsave) failed".to_string()),
8029        )
8030    }
8031
8032    /// VipsForeignSaveJpegFile (jpegsave), save image to jpeg file (.jpg, .jpeg, .jpe, .jfif), priority=0, mono rgb cmyk
8033    ///
8034    /// filename: `&str` -> Filename to save to
8035    ///
8036    /// <ins>Optional arguments</ins>
8037    ///
8038    /// Q: `i32` -> Q factor
8039    ///
8040    /// optimize_coding: `bool` -> Compute optimal Huffman coding tables
8041    ///
8042    /// interlace: `bool` -> Generate an interlaced (progressive) jpeg
8043    ///
8044    /// trellis_quant: `bool` -> Apply trellis quantisation to each 8x8 block
8045    ///
8046    /// overshoot_deringing: `bool` -> Apply overshooting to samples with extreme values
8047    ///
8048    /// optimize_scans: `bool` -> Split spectrum of DCT coefficients into separate scans
8049    ///
8050    /// quant_table: `i32` -> Use predefined quantization table with given index
8051    ///
8052    /// subsample_mode: [`ForeignSubsample`] -> Select chroma subsample operation mode
8053    ///
8054    /// restart_interval: `i32` -> Add restart markers every specified number of mcu
8055    ///
8056    /// keep: [`ForeignKeep`] -> Which metadata to retain
8057    ///
8058    /// background: `&[f64]` -> Background value
8059    ///
8060    /// page_height: `i32` -> Set page height for multipage save
8061    ///
8062    /// profile: `&str` -> Filename of ICC profile to embed
8063    pub fn jpegsave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
8064        let vips_op_response = call(
8065            "jpegsave",
8066            option
8067                .set("in", self)
8068                .set(
8069                    "filename",
8070                    filename,
8071                ),
8072        );
8073
8074        utils::result(
8075            vips_op_response,
8076            (),
8077            Error::OperationError("Jpegsave (vips_jpegsave) failed".to_string()),
8078        )
8079    }
8080
8081    /// VipsForeignSaveJpegBuffer (jpegsave_buffer), save image to jpeg buffer (.jpg, .jpeg, .jpe, .jfif), priority=0, mono rgb cmyk
8082    /// returns `Vec<u8>` - Buffer to save to
8083    pub fn jpegsave_buffer(&self) -> Result<Vec<u8>> {
8084        let mut buffer_out = VipsBlob::from(null_mut());
8085        let vips_op_response = call(
8086            "jpegsave_buffer",
8087            VOption::new()
8088                .set("in", self)
8089                .set(
8090                    "buffer",
8091                    &mut buffer_out,
8092                ),
8093        );
8094
8095        utils::result(
8096            vips_op_response,
8097            buffer_out.into(),
8098            Error::OperationError("JpegsaveBuffer (vips_jpegsave_buffer) failed".to_string()),
8099        )
8100    }
8101
8102    /// VipsForeignSaveJpegBuffer (jpegsave_buffer), save image to jpeg buffer (.jpg, .jpeg, .jpe, .jfif), priority=0, mono rgb cmyk
8103    /// returns `Vec<u8>` - Buffer to save to
8104    ///
8105    /// <ins>Optional arguments</ins>
8106    ///
8107    /// Q: `i32` -> Q factor
8108    ///
8109    /// optimize_coding: `bool` -> Compute optimal Huffman coding tables
8110    ///
8111    /// interlace: `bool` -> Generate an interlaced (progressive) jpeg
8112    ///
8113    /// trellis_quant: `bool` -> Apply trellis quantisation to each 8x8 block
8114    ///
8115    /// overshoot_deringing: `bool` -> Apply overshooting to samples with extreme values
8116    ///
8117    /// optimize_scans: `bool` -> Split spectrum of DCT coefficients into separate scans
8118    ///
8119    /// quant_table: `i32` -> Use predefined quantization table with given index
8120    ///
8121    /// subsample_mode: [`ForeignSubsample`] -> Select chroma subsample operation mode
8122    ///
8123    /// restart_interval: `i32` -> Add restart markers every specified number of mcu
8124    ///
8125    /// keep: [`ForeignKeep`] -> Which metadata to retain
8126    ///
8127    /// background: `&[f64]` -> Background value
8128    ///
8129    /// page_height: `i32` -> Set page height for multipage save
8130    ///
8131    /// profile: `&str` -> Filename of ICC profile to embed
8132    pub fn jpegsave_buffer_with_opts(&self, option: VOption) -> Result<Vec<u8>> {
8133        let mut buffer_out = VipsBlob::from(null_mut());
8134        let vips_op_response = call(
8135            "jpegsave_buffer",
8136            option
8137                .set("in", self)
8138                .set(
8139                    "buffer",
8140                    &mut buffer_out,
8141                ),
8142        );
8143
8144        utils::result(
8145            vips_op_response,
8146            buffer_out.into(),
8147            Error::OperationError("JpegsaveBuffer (vips_jpegsave_buffer) failed".to_string()),
8148        )
8149    }
8150
8151    /// VipsForeignSaveJpegMime (jpegsave_mime), save image to jpeg mime (.jpg, .jpeg, .jpe, .jfif), priority=0, mono rgb cmyk
8152    pub fn jpegsave_mime(&self) -> Result<()> {
8153        let vips_op_response = call(
8154            "jpegsave_mime",
8155            VOption::new().set("in", self),
8156        );
8157
8158        utils::result(
8159            vips_op_response,
8160            (),
8161            Error::OperationError("JpegsaveMime (vips_jpegsave_mime) failed".to_string()),
8162        )
8163    }
8164
8165    /// VipsForeignSaveJpegMime (jpegsave_mime), save image to jpeg mime (.jpg, .jpeg, .jpe, .jfif), priority=0, mono rgb cmyk
8166    ///
8167    /// <ins>Optional arguments</ins>
8168    ///
8169    /// Q: `i32` -> Q factor
8170    ///
8171    /// optimize_coding: `bool` -> Compute optimal Huffman coding tables
8172    ///
8173    /// interlace: `bool` -> Generate an interlaced (progressive) jpeg
8174    ///
8175    /// trellis_quant: `bool` -> Apply trellis quantisation to each 8x8 block
8176    ///
8177    /// overshoot_deringing: `bool` -> Apply overshooting to samples with extreme values
8178    ///
8179    /// optimize_scans: `bool` -> Split spectrum of DCT coefficients into separate scans
8180    ///
8181    /// quant_table: `i32` -> Use predefined quantization table with given index
8182    ///
8183    /// subsample_mode: [`ForeignSubsample`] -> Select chroma subsample operation mode
8184    ///
8185    /// restart_interval: `i32` -> Add restart markers every specified number of mcu
8186    ///
8187    /// keep: [`ForeignKeep`] -> Which metadata to retain
8188    ///
8189    /// background: `&[f64]` -> Background value
8190    ///
8191    /// page_height: `i32` -> Set page height for multipage save
8192    ///
8193    /// profile: `&str` -> Filename of ICC profile to embed
8194    pub fn jpegsave_mime_with_opts(&self, option: VOption) -> Result<()> {
8195        let vips_op_response = call(
8196            "jpegsave_mime",
8197            option.set("in", self),
8198        );
8199
8200        utils::result(
8201            vips_op_response,
8202            (),
8203            Error::OperationError("JpegsaveMime (vips_jpegsave_mime) failed".to_string()),
8204        )
8205    }
8206
8207    /// VipsForeignSaveJpegTarget (jpegsave_target), save image to jpeg target (.jpg, .jpeg, .jpe, .jfif), priority=0, mono rgb cmyk
8208    ///
8209    /// target: `&VipsTarget` -> Target to save to
8210    pub fn jpegsave_target(&self, target: &VipsTarget) -> Result<()> {
8211        let vips_op_response = call(
8212            "jpegsave_target",
8213            VOption::new()
8214                .set("in", self)
8215                .set(
8216                    "target",
8217                    target,
8218                ),
8219        );
8220
8221        utils::result(
8222            vips_op_response,
8223            (),
8224            Error::OperationError("JpegsaveTarget (vips_jpegsave_target) failed".to_string()),
8225        )
8226    }
8227
8228    /// VipsForeignSaveJpegTarget (jpegsave_target), save image to jpeg target (.jpg, .jpeg, .jpe, .jfif), priority=0, mono rgb cmyk
8229    ///
8230    /// target: `&VipsTarget` -> Target to save to
8231    ///
8232    /// <ins>Optional arguments</ins>
8233    ///
8234    /// Q: `i32` -> Q factor
8235    ///
8236    /// optimize_coding: `bool` -> Compute optimal Huffman coding tables
8237    ///
8238    /// interlace: `bool` -> Generate an interlaced (progressive) jpeg
8239    ///
8240    /// trellis_quant: `bool` -> Apply trellis quantisation to each 8x8 block
8241    ///
8242    /// overshoot_deringing: `bool` -> Apply overshooting to samples with extreme values
8243    ///
8244    /// optimize_scans: `bool` -> Split spectrum of DCT coefficients into separate scans
8245    ///
8246    /// quant_table: `i32` -> Use predefined quantization table with given index
8247    ///
8248    /// subsample_mode: [`ForeignSubsample`] -> Select chroma subsample operation mode
8249    ///
8250    /// restart_interval: `i32` -> Add restart markers every specified number of mcu
8251    ///
8252    /// keep: [`ForeignKeep`] -> Which metadata to retain
8253    ///
8254    /// background: `&[f64]` -> Background value
8255    ///
8256    /// page_height: `i32` -> Set page height for multipage save
8257    ///
8258    /// profile: `&str` -> Filename of ICC profile to embed
8259    pub fn jpegsave_target_with_opts(&self, target: &VipsTarget, option: VOption) -> Result<()> {
8260        let vips_op_response = call(
8261            "jpegsave_target",
8262            option
8263                .set("in", self)
8264                .set(
8265                    "target",
8266                    target,
8267                ),
8268        );
8269
8270        utils::result(
8271            vips_op_response,
8272            (),
8273            Error::OperationError("JpegsaveTarget (vips_jpegsave_target) failed".to_string()),
8274        )
8275    }
8276
8277    /// VipsForeignLoadJxlFile (jxlload), load JPEG-XL image (.jxl), priority=0, untrusted, is_a, get_flags, header, load
8278    /// returns `VipsImage` - Output image
8279    ///
8280    /// filename: `&str` -> Filename to load from
8281    pub fn jxlload(filename: &str) -> Result<VipsImage> {
8282        let mut out_out = VipsImage::from(null_mut());
8283        let vips_op_response = call(
8284            "jxlload",
8285            VOption::new()
8286                .set(
8287                    "filename",
8288                    filename,
8289                )
8290                .set(
8291                    "out",
8292                    &mut out_out,
8293                ),
8294        );
8295
8296        utils::result(
8297            vips_op_response,
8298            out_out,
8299            Error::OperationError("Jxlload (vips_jxlload) failed".to_string()),
8300        )
8301    }
8302
8303    /// VipsForeignLoadJxlFile (jxlload), load JPEG-XL image (.jxl), priority=0, untrusted, is_a, get_flags, header, load
8304    /// returns `VipsImage` - Output image
8305    ///
8306    /// filename: `&str` -> Filename to load from
8307    ///
8308    /// <ins>Optional arguments</ins>
8309    ///
8310    /// page: `i32` -> First page to load
8311    ///
8312    /// n: `i32` -> Number of pages to load, -1 for all
8313    ///
8314    /// flags: [`ForeignFlags`] -> Flags for this file
8315    ///
8316    /// memory: `bool` -> Force open via memory
8317    ///
8318    /// access: [`Access`] -> Required access pattern for this file
8319    ///
8320    /// fail_on: [`FailOn`] -> Error level to fail on
8321    ///
8322    /// revalidate: `bool` -> Don't use a cached result for this operation
8323    pub fn jxlload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
8324        let mut out_out = VipsImage::from(null_mut());
8325        let vips_op_response = call(
8326            "jxlload",
8327            option
8328                .set(
8329                    "filename",
8330                    filename,
8331                )
8332                .set(
8333                    "out",
8334                    &mut out_out,
8335                ),
8336        );
8337
8338        utils::result(
8339            vips_op_response,
8340            out_out,
8341            Error::OperationError("Jxlload (vips_jxlload) failed".to_string()),
8342        )
8343    }
8344
8345    /// VipsForeignLoadJxlBuffer (jxlload_buffer), load JPEG-XL image, priority=0, untrusted, is_a_buffer, get_flags, header, load
8346    /// returns `VipsImage` - Output image
8347    ///
8348    /// buffer: `&[u8]` -> Buffer to load from
8349    pub fn jxlload_buffer(buffer: &[u8]) -> Result<VipsImage> {
8350        let blob = unsafe {
8351            vips_blob_new(
8352                None,
8353                buffer.as_ptr() as _,
8354                buffer.len() as _,
8355            )
8356        };
8357        let mut out_out = VipsImage::from(null_mut());
8358        let vips_op_response = call(
8359            "jxlload_buffer",
8360            VOption::new()
8361                .set(
8362                    "buffer",
8363                    &VipsBlob::from(blob),
8364                )
8365                .set(
8366                    "out",
8367                    &mut out_out,
8368                ),
8369        );
8370        unsafe { vips_area_unref(&mut (*blob).area) };
8371        utils::result(
8372            vips_op_response,
8373            out_out,
8374            Error::OperationError("JxlloadBuffer (vips_jxlload_buffer) failed".to_string()),
8375        )
8376    }
8377
8378    /// VipsForeignLoadJxlBuffer (jxlload_buffer), load JPEG-XL image, priority=0, untrusted, is_a_buffer, get_flags, header, load
8379    /// returns `VipsImage` - Output image
8380    ///
8381    /// buffer: `&[u8]` -> Buffer to load from
8382    ///
8383    /// <ins>Optional arguments</ins>
8384    ///
8385    /// page: `i32` -> First page to load
8386    ///
8387    /// n: `i32` -> Number of pages to load, -1 for all
8388    ///
8389    /// flags: [`ForeignFlags`] -> Flags for this file
8390    ///
8391    /// memory: `bool` -> Force open via memory
8392    ///
8393    /// access: [`Access`] -> Required access pattern for this file
8394    ///
8395    /// fail_on: [`FailOn`] -> Error level to fail on
8396    ///
8397    /// revalidate: `bool` -> Don't use a cached result for this operation
8398    pub fn jxlload_buffer_with_opts(buffer: &[u8], option: VOption) -> Result<VipsImage> {
8399        let blob = unsafe {
8400            vips_blob_new(
8401                None,
8402                buffer.as_ptr() as _,
8403                buffer.len() as _,
8404            )
8405        };
8406        let mut out_out = VipsImage::from(null_mut());
8407        let vips_op_response = call(
8408            "jxlload_buffer",
8409            option
8410                .set(
8411                    "buffer",
8412                    &VipsBlob::from(blob),
8413                )
8414                .set(
8415                    "out",
8416                    &mut out_out,
8417                ),
8418        );
8419        unsafe { vips_area_unref(&mut (*blob).area) };
8420        utils::result(
8421            vips_op_response,
8422            out_out,
8423            Error::OperationError("JxlloadBuffer (vips_jxlload_buffer) failed".to_string()),
8424        )
8425    }
8426
8427    /// VipsForeignLoadJxlSource (jxlload_source), load JPEG-XL image, priority=0, untrusted, is_a_source, get_flags, header, load
8428    /// returns `VipsImage` - Output image
8429    ///
8430    /// source: `&VipsSource` -> Source to load from
8431    pub fn jxlload_source(source: &VipsSource) -> Result<VipsImage> {
8432        let mut out_out = VipsImage::from(null_mut());
8433        let vips_op_response = call(
8434            "jxlload_source",
8435            VOption::new()
8436                .set(
8437                    "source",
8438                    source,
8439                )
8440                .set(
8441                    "out",
8442                    &mut out_out,
8443                ),
8444        );
8445
8446        utils::result(
8447            vips_op_response,
8448            out_out,
8449            Error::OperationError("JxlloadSource (vips_jxlload_source) failed".to_string()),
8450        )
8451    }
8452
8453    /// VipsForeignLoadJxlSource (jxlload_source), load JPEG-XL image, priority=0, untrusted, is_a_source, get_flags, header, load
8454    /// returns `VipsImage` - Output image
8455    ///
8456    /// source: `&VipsSource` -> Source to load from
8457    ///
8458    /// <ins>Optional arguments</ins>
8459    ///
8460    /// page: `i32` -> First page to load
8461    ///
8462    /// n: `i32` -> Number of pages to load, -1 for all
8463    ///
8464    /// flags: [`ForeignFlags`] -> Flags for this file
8465    ///
8466    /// memory: `bool` -> Force open via memory
8467    ///
8468    /// access: [`Access`] -> Required access pattern for this file
8469    ///
8470    /// fail_on: [`FailOn`] -> Error level to fail on
8471    ///
8472    /// revalidate: `bool` -> Don't use a cached result for this operation
8473    pub fn jxlload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
8474        let mut out_out = VipsImage::from(null_mut());
8475        let vips_op_response = call(
8476            "jxlload_source",
8477            option
8478                .set(
8479                    "source",
8480                    source,
8481                )
8482                .set(
8483                    "out",
8484                    &mut out_out,
8485                ),
8486        );
8487
8488        utils::result(
8489            vips_op_response,
8490            out_out,
8491            Error::OperationError("JxlloadSource (vips_jxlload_source) failed".to_string()),
8492        )
8493    }
8494
8495    /// VipsForeignSaveJxlFile (jxlsave), save image in JPEG-XL format (.jxl), priority=0, untrusted,
8496    ///
8497    /// filename: `&str` -> Filename to save to
8498    pub fn jxlsave(&self, filename: &str) -> Result<()> {
8499        let vips_op_response = call(
8500            "jxlsave",
8501            VOption::new()
8502                .set("in", self)
8503                .set(
8504                    "filename",
8505                    filename,
8506                ),
8507        );
8508
8509        utils::result(
8510            vips_op_response,
8511            (),
8512            Error::OperationError("Jxlsave (vips_jxlsave) failed".to_string()),
8513        )
8514    }
8515
8516    /// VipsForeignSaveJxlFile (jxlsave), save image in JPEG-XL format (.jxl), priority=0, untrusted,
8517    ///
8518    /// filename: `&str` -> Filename to save to
8519    ///
8520    /// <ins>Optional arguments</ins>
8521    ///
8522    /// tier: `i32` -> Decode speed tier
8523    ///
8524    /// distance: `f64` -> Target butteraugli distance
8525    ///
8526    /// effort: `i32` -> Encoding effort
8527    ///
8528    /// lossless: `bool` -> Enable lossless compression
8529    ///
8530    /// Q: `i32` -> Quality factor
8531    ///
8532    /// keep: [`ForeignKeep`] -> Which metadata to retain
8533    ///
8534    /// background: `&[f64]` -> Background value
8535    ///
8536    /// page_height: `i32` -> Set page height for multipage save
8537    ///
8538    /// profile: `&str` -> Filename of ICC profile to embed
8539    pub fn jxlsave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
8540        let vips_op_response = call(
8541            "jxlsave",
8542            option
8543                .set("in", self)
8544                .set(
8545                    "filename",
8546                    filename,
8547                ),
8548        );
8549
8550        utils::result(
8551            vips_op_response,
8552            (),
8553            Error::OperationError("Jxlsave (vips_jxlsave) failed".to_string()),
8554        )
8555    }
8556
8557    /// VipsForeignSaveJxlBuffer (jxlsave_buffer), save image in JPEG-XL format (.jxl), priority=0, untrusted,
8558    /// returns `Vec<u8>` - Buffer to save to
8559    pub fn jxlsave_buffer(&self) -> Result<Vec<u8>> {
8560        let mut buffer_out = VipsBlob::from(null_mut());
8561        let vips_op_response = call(
8562            "jxlsave_buffer",
8563            VOption::new()
8564                .set("in", self)
8565                .set(
8566                    "buffer",
8567                    &mut buffer_out,
8568                ),
8569        );
8570
8571        utils::result(
8572            vips_op_response,
8573            buffer_out.into(),
8574            Error::OperationError("JxlsaveBuffer (vips_jxlsave_buffer) failed".to_string()),
8575        )
8576    }
8577
8578    /// VipsForeignSaveJxlBuffer (jxlsave_buffer), save image in JPEG-XL format (.jxl), priority=0, untrusted,
8579    /// returns `Vec<u8>` - Buffer to save to
8580    ///
8581    /// <ins>Optional arguments</ins>
8582    ///
8583    /// tier: `i32` -> Decode speed tier
8584    ///
8585    /// distance: `f64` -> Target butteraugli distance
8586    ///
8587    /// effort: `i32` -> Encoding effort
8588    ///
8589    /// lossless: `bool` -> Enable lossless compression
8590    ///
8591    /// Q: `i32` -> Quality factor
8592    ///
8593    /// keep: [`ForeignKeep`] -> Which metadata to retain
8594    ///
8595    /// background: `&[f64]` -> Background value
8596    ///
8597    /// page_height: `i32` -> Set page height for multipage save
8598    ///
8599    /// profile: `&str` -> Filename of ICC profile to embed
8600    pub fn jxlsave_buffer_with_opts(&self, option: VOption) -> Result<Vec<u8>> {
8601        let mut buffer_out = VipsBlob::from(null_mut());
8602        let vips_op_response = call(
8603            "jxlsave_buffer",
8604            option
8605                .set("in", self)
8606                .set(
8607                    "buffer",
8608                    &mut buffer_out,
8609                ),
8610        );
8611
8612        utils::result(
8613            vips_op_response,
8614            buffer_out.into(),
8615            Error::OperationError("JxlsaveBuffer (vips_jxlsave_buffer) failed".to_string()),
8616        )
8617    }
8618
8619    /// VipsForeignSaveJxlTarget (jxlsave_target), save image in JPEG-XL format (.jxl), priority=0, untrusted,
8620    ///
8621    /// target: `&VipsTarget` -> Target to save to
8622    pub fn jxlsave_target(&self, target: &VipsTarget) -> Result<()> {
8623        let vips_op_response = call(
8624            "jxlsave_target",
8625            VOption::new()
8626                .set("in", self)
8627                .set(
8628                    "target",
8629                    target,
8630                ),
8631        );
8632
8633        utils::result(
8634            vips_op_response,
8635            (),
8636            Error::OperationError("JxlsaveTarget (vips_jxlsave_target) failed".to_string()),
8637        )
8638    }
8639
8640    /// VipsForeignSaveJxlTarget (jxlsave_target), save image in JPEG-XL format (.jxl), priority=0, untrusted,
8641    ///
8642    /// target: `&VipsTarget` -> Target to save to
8643    ///
8644    /// <ins>Optional arguments</ins>
8645    ///
8646    /// tier: `i32` -> Decode speed tier
8647    ///
8648    /// distance: `f64` -> Target butteraugli distance
8649    ///
8650    /// effort: `i32` -> Encoding effort
8651    ///
8652    /// lossless: `bool` -> Enable lossless compression
8653    ///
8654    /// Q: `i32` -> Quality factor
8655    ///
8656    /// keep: [`ForeignKeep`] -> Which metadata to retain
8657    ///
8658    /// background: `&[f64]` -> Background value
8659    ///
8660    /// page_height: `i32` -> Set page height for multipage save
8661    ///
8662    /// profile: `&str` -> Filename of ICC profile to embed
8663    pub fn jxlsave_target_with_opts(&self, target: &VipsTarget, option: VOption) -> Result<()> {
8664        let vips_op_response = call(
8665            "jxlsave_target",
8666            option
8667                .set("in", self)
8668                .set(
8669                    "target",
8670                    target,
8671                ),
8672        );
8673
8674        utils::result(
8675            vips_op_response,
8676            (),
8677            Error::OperationError("JxlsaveTarget (vips_jxlsave_target) failed".to_string()),
8678        )
8679    }
8680
8681    /// VipsLabelregions (labelregions), label regions in an image
8682    /// returns `VipsImage` - Mask of region labels
8683    pub fn labelregions(&self) -> Result<VipsImage> {
8684        let mut mask_out = VipsImage::from(null_mut());
8685        let vips_op_response = call(
8686            "labelregions",
8687            VOption::new()
8688                .set("in", self)
8689                .set(
8690                    "mask",
8691                    &mut mask_out,
8692                ),
8693        );
8694
8695        utils::result(
8696            vips_op_response,
8697            mask_out,
8698            Error::OperationError("Labelregions (vips_labelregions) failed".to_string()),
8699        )
8700    }
8701
8702    /// VipsLabelregions (labelregions), label regions in an image
8703    /// returns `VipsImage` - Mask of region labels
8704    ///
8705    /// <ins>Optional arguments</ins>
8706    ///
8707    /// segments: `&mut i32` -> Number of discrete contiguous regions
8708    pub fn labelregions_with_opts(&self, option: VOption) -> Result<VipsImage> {
8709        let mut mask_out = VipsImage::from(null_mut());
8710        let vips_op_response = call(
8711            "labelregions",
8712            option
8713                .set("in", self)
8714                .set(
8715                    "mask",
8716                    &mut mask_out,
8717                ),
8718        );
8719
8720        utils::result(
8721            vips_op_response,
8722            mask_out,
8723            Error::OperationError("Labelregions (vips_labelregions) failed".to_string()),
8724        )
8725    }
8726
8727    /// VipsLinear (linear), calculate (a * in + b)
8728    /// returns `VipsImage` - Output image
8729    ///
8730    /// a: `&[f64]` -> Multiply by this
8731    ///
8732    /// b: `&[f64]` -> Add this
8733    pub fn linear(&self, a: &[f64], b: &[f64]) -> Result<VipsImage> {
8734        let mut out_out = VipsImage::from(null_mut());
8735        let vips_op_response = call(
8736            "linear",
8737            VOption::new()
8738                .set("in", self)
8739                .set(
8740                    "out",
8741                    &mut out_out,
8742                )
8743                .set("a", a)
8744                .set("b", b),
8745        );
8746
8747        utils::result(
8748            vips_op_response,
8749            out_out,
8750            Error::OperationError("Linear (vips_linear) failed".to_string()),
8751        )
8752    }
8753
8754    /// VipsLinear (linear), calculate (a * in + b)
8755    /// returns `VipsImage` - Output image
8756    ///
8757    /// a: `&[f64]` -> Multiply by this
8758    ///
8759    /// b: `&[f64]` -> Add this
8760    ///
8761    /// <ins>Optional arguments</ins>
8762    ///
8763    /// uchar: `bool` -> Output should be uchar
8764    pub fn linear_with_opts(&self, a: &[f64], b: &[f64], option: VOption) -> Result<VipsImage> {
8765        let mut out_out = VipsImage::from(null_mut());
8766        let vips_op_response = call(
8767            "linear",
8768            option
8769                .set("in", self)
8770                .set(
8771                    "out",
8772                    &mut out_out,
8773                )
8774                .set("a", a)
8775                .set("b", b),
8776        );
8777
8778        utils::result(
8779            vips_op_response,
8780            out_out,
8781            Error::OperationError("Linear (vips_linear) failed".to_string()),
8782        )
8783    }
8784
8785    /// VipsLineCache (linecache), cache an image as a set of lines
8786    /// returns `VipsImage` - Output image
8787    pub fn linecache(&self) -> Result<VipsImage> {
8788        let mut out_out = VipsImage::from(null_mut());
8789        let vips_op_response = call(
8790            "linecache",
8791            VOption::new()
8792                .set("in", self)
8793                .set(
8794                    "out",
8795                    &mut out_out,
8796                ),
8797        );
8798
8799        utils::result(
8800            vips_op_response,
8801            out_out,
8802            Error::OperationError("Linecache (vips_linecache) failed".to_string()),
8803        )
8804    }
8805
8806    /// VipsLineCache (linecache), cache an image as a set of lines
8807    /// returns `VipsImage` - Output image
8808    ///
8809    /// <ins>Optional arguments</ins>
8810    ///
8811    /// tile_height: `i32` -> Tile height in pixels
8812    ///
8813    /// access: [`Access`] -> Expected access pattern
8814    ///
8815    /// threaded: `bool` -> Allow threaded access
8816    ///
8817    /// persistent: `bool` -> Keep cache between evaluations
8818    pub fn linecache_with_opts(&self, option: VOption) -> Result<VipsImage> {
8819        let mut out_out = VipsImage::from(null_mut());
8820        let vips_op_response = call(
8821            "linecache",
8822            option
8823                .set("in", self)
8824                .set(
8825                    "out",
8826                    &mut out_out,
8827                ),
8828        );
8829
8830        utils::result(
8831            vips_op_response,
8832            out_out,
8833            Error::OperationError("Linecache (vips_linecache) failed".to_string()),
8834        )
8835    }
8836
8837    /// VipsLogmat (logmat), make a Laplacian of Gaussian image
8838    /// returns `VipsImage` - Output image
8839    ///
8840    /// sigma: `f64` -> Radius of Gaussian
8841    ///
8842    /// min_ampl: `f64` -> Minimum amplitude of Gaussian
8843    pub fn logmat(sigma: f64, min_ampl: f64) -> Result<VipsImage> {
8844        let mut out_out = VipsImage::from(null_mut());
8845        let vips_op_response = call(
8846            "logmat",
8847            VOption::new()
8848                .set(
8849                    "out",
8850                    &mut out_out,
8851                )
8852                .set(
8853                    "sigma",
8854                    sigma,
8855                )
8856                .set(
8857                    "min-ampl",
8858                    min_ampl,
8859                ),
8860        );
8861
8862        utils::result(
8863            vips_op_response,
8864            out_out,
8865            Error::OperationError("Logmat (vips_logmat) failed".to_string()),
8866        )
8867    }
8868
8869    /// VipsLogmat (logmat), make a Laplacian of Gaussian image
8870    /// returns `VipsImage` - Output image
8871    ///
8872    /// sigma: `f64` -> Radius of Gaussian
8873    ///
8874    /// min_ampl: `f64` -> Minimum amplitude of Gaussian
8875    ///
8876    /// <ins>Optional arguments</ins>
8877    ///
8878    /// separable: `bool` -> Generate separable Gaussian
8879    ///
8880    /// precision: [`Precision`] -> Generate with this precision
8881    pub fn logmat_with_opts(sigma: f64, min_ampl: f64, option: VOption) -> Result<VipsImage> {
8882        let mut out_out = VipsImage::from(null_mut());
8883        let vips_op_response = call(
8884            "logmat",
8885            option
8886                .set(
8887                    "out",
8888                    &mut out_out,
8889                )
8890                .set(
8891                    "sigma",
8892                    sigma,
8893                )
8894                .set(
8895                    "min-ampl",
8896                    min_ampl,
8897                ),
8898        );
8899
8900        utils::result(
8901            vips_op_response,
8902            out_out,
8903            Error::OperationError("Logmat (vips_logmat) failed".to_string()),
8904        )
8905    }
8906
8907    /// VipsForeignLoadMagickFile (magickload), load file with ImageMagick, priority=-100, untrusted, is_a, get_flags, get_flags_filename, header
8908    /// returns `VipsImage` - Output image
8909    ///
8910    /// filename: `&str` -> Filename to load from
8911    pub fn magickload(filename: &str) -> Result<VipsImage> {
8912        let mut out_out = VipsImage::from(null_mut());
8913        let vips_op_response = call(
8914            "magickload",
8915            VOption::new()
8916                .set(
8917                    "filename",
8918                    filename,
8919                )
8920                .set(
8921                    "out",
8922                    &mut out_out,
8923                ),
8924        );
8925
8926        utils::result(
8927            vips_op_response,
8928            out_out,
8929            Error::OperationError("Magickload (vips_magickload) failed".to_string()),
8930        )
8931    }
8932
8933    /// VipsForeignLoadMagickFile (magickload), load file with ImageMagick, priority=-100, untrusted, is_a, get_flags, get_flags_filename, header
8934    /// returns `VipsImage` - Output image
8935    ///
8936    /// filename: `&str` -> Filename to load from
8937    ///
8938    /// <ins>Optional arguments</ins>
8939    ///
8940    /// density: `&str` -> Canvas resolution for rendering vector formats like SVG
8941    ///
8942    /// page: `i32` -> First page to load
8943    ///
8944    /// n: `i32` -> Number of pages to load, -1 for all
8945    ///
8946    /// flags: [`ForeignFlags`] -> Flags for this file
8947    ///
8948    /// memory: `bool` -> Force open via memory
8949    ///
8950    /// access: [`Access`] -> Required access pattern for this file
8951    ///
8952    /// fail_on: [`FailOn`] -> Error level to fail on
8953    ///
8954    /// revalidate: `bool` -> Don't use a cached result for this operation
8955    pub fn magickload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
8956        let mut out_out = VipsImage::from(null_mut());
8957        let vips_op_response = call(
8958            "magickload",
8959            option
8960                .set(
8961                    "filename",
8962                    filename,
8963                )
8964                .set(
8965                    "out",
8966                    &mut out_out,
8967                ),
8968        );
8969
8970        utils::result(
8971            vips_op_response,
8972            out_out,
8973            Error::OperationError("Magickload (vips_magickload) failed".to_string()),
8974        )
8975    }
8976
8977    /// VipsForeignLoadMagickBuffer (magickload_buffer), load buffer with ImageMagick, priority=-100, untrusted, is_a_buffer, get_flags, get_flags_filename, header
8978    /// returns `VipsImage` - Output image
8979    ///
8980    /// buffer: `&[u8]` -> Buffer to load from
8981    pub fn magickload_buffer(buffer: &[u8]) -> Result<VipsImage> {
8982        let blob = unsafe {
8983            vips_blob_new(
8984                None,
8985                buffer.as_ptr() as _,
8986                buffer.len() as _,
8987            )
8988        };
8989        let mut out_out = VipsImage::from(null_mut());
8990        let vips_op_response = call(
8991            "magickload_buffer",
8992            VOption::new()
8993                .set(
8994                    "buffer",
8995                    &VipsBlob::from(blob),
8996                )
8997                .set(
8998                    "out",
8999                    &mut out_out,
9000                ),
9001        );
9002        unsafe { vips_area_unref(&mut (*blob).area) };
9003        utils::result(
9004            vips_op_response,
9005            out_out,
9006            Error::OperationError("MagickloadBuffer (vips_magickload_buffer) failed".to_string()),
9007        )
9008    }
9009
9010    /// VipsForeignLoadMagickBuffer (magickload_buffer), load buffer with ImageMagick, priority=-100, untrusted, is_a_buffer, get_flags, get_flags_filename, header
9011    /// returns `VipsImage` - Output image
9012    ///
9013    /// buffer: `&[u8]` -> Buffer to load from
9014    ///
9015    /// <ins>Optional arguments</ins>
9016    ///
9017    /// density: `&str` -> Canvas resolution for rendering vector formats like SVG
9018    ///
9019    /// page: `i32` -> First page to load
9020    ///
9021    /// n: `i32` -> Number of pages to load, -1 for all
9022    ///
9023    /// flags: [`ForeignFlags`] -> Flags for this file
9024    ///
9025    /// memory: `bool` -> Force open via memory
9026    ///
9027    /// access: [`Access`] -> Required access pattern for this file
9028    ///
9029    /// fail_on: [`FailOn`] -> Error level to fail on
9030    ///
9031    /// revalidate: `bool` -> Don't use a cached result for this operation
9032    pub fn magickload_buffer_with_opts(buffer: &[u8], option: VOption) -> Result<VipsImage> {
9033        let blob = unsafe {
9034            vips_blob_new(
9035                None,
9036                buffer.as_ptr() as _,
9037                buffer.len() as _,
9038            )
9039        };
9040        let mut out_out = VipsImage::from(null_mut());
9041        let vips_op_response = call(
9042            "magickload_buffer",
9043            option
9044                .set(
9045                    "buffer",
9046                    &VipsBlob::from(blob),
9047                )
9048                .set(
9049                    "out",
9050                    &mut out_out,
9051                ),
9052        );
9053        unsafe { vips_area_unref(&mut (*blob).area) };
9054        utils::result(
9055            vips_op_response,
9056            out_out,
9057            Error::OperationError("MagickloadBuffer (vips_magickload_buffer) failed".to_string()),
9058        )
9059    }
9060
9061    /// VipsForeignSaveMagickFile (magicksave), save file with ImageMagick (), priority=-100, untrusted,
9062    ///
9063    /// filename: `&str` -> Filename to save to
9064    pub fn magicksave(&self, filename: &str) -> Result<()> {
9065        let vips_op_response = call(
9066            "magicksave",
9067            VOption::new()
9068                .set("in", self)
9069                .set(
9070                    "filename",
9071                    filename,
9072                ),
9073        );
9074
9075        utils::result(
9076            vips_op_response,
9077            (),
9078            Error::OperationError("Magicksave (vips_magicksave) failed".to_string()),
9079        )
9080    }
9081
9082    /// VipsForeignSaveMagickFile (magicksave), save file with ImageMagick (), priority=-100, untrusted,
9083    ///
9084    /// filename: `&str` -> Filename to save to
9085    ///
9086    /// <ins>Optional arguments</ins>
9087    ///
9088    /// format: `&str` -> Format to save in
9089    ///
9090    /// quality: `i32` -> Quality to use
9091    ///
9092    /// optimize_gif_frames: `bool` -> Apply GIF frames optimization
9093    ///
9094    /// optimize_gif_transparency: `bool` -> Apply GIF transparency optimization
9095    ///
9096    /// bitdepth: `i32` -> Number of bits per pixel
9097    ///
9098    /// keep: [`ForeignKeep`] -> Which metadata to retain
9099    ///
9100    /// background: `&[f64]` -> Background value
9101    ///
9102    /// page_height: `i32` -> Set page height for multipage save
9103    ///
9104    /// profile: `&str` -> Filename of ICC profile to embed
9105    pub fn magicksave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
9106        let vips_op_response = call(
9107            "magicksave",
9108            option
9109                .set("in", self)
9110                .set(
9111                    "filename",
9112                    filename,
9113                ),
9114        );
9115
9116        utils::result(
9117            vips_op_response,
9118            (),
9119            Error::OperationError("Magicksave (vips_magicksave) failed".to_string()),
9120        )
9121    }
9122
9123    /// VipsForeignSaveMagickBuffer (magicksave_buffer), save image to magick buffer (), priority=-100, untrusted,
9124    /// returns `Vec<u8>` - Buffer to save to
9125    pub fn magicksave_buffer(&self) -> Result<Vec<u8>> {
9126        let mut buffer_out = VipsBlob::from(null_mut());
9127        let vips_op_response = call(
9128            "magicksave_buffer",
9129            VOption::new()
9130                .set("in", self)
9131                .set(
9132                    "buffer",
9133                    &mut buffer_out,
9134                ),
9135        );
9136
9137        utils::result(
9138            vips_op_response,
9139            buffer_out.into(),
9140            Error::OperationError("MagicksaveBuffer (vips_magicksave_buffer) failed".to_string()),
9141        )
9142    }
9143
9144    /// VipsForeignSaveMagickBuffer (magicksave_buffer), save image to magick buffer (), priority=-100, untrusted,
9145    /// returns `Vec<u8>` - Buffer to save to
9146    ///
9147    /// <ins>Optional arguments</ins>
9148    ///
9149    /// format: `&str` -> Format to save in
9150    ///
9151    /// quality: `i32` -> Quality to use
9152    ///
9153    /// optimize_gif_frames: `bool` -> Apply GIF frames optimization
9154    ///
9155    /// optimize_gif_transparency: `bool` -> Apply GIF transparency optimization
9156    ///
9157    /// bitdepth: `i32` -> Number of bits per pixel
9158    ///
9159    /// keep: [`ForeignKeep`] -> Which metadata to retain
9160    ///
9161    /// background: `&[f64]` -> Background value
9162    ///
9163    /// page_height: `i32` -> Set page height for multipage save
9164    ///
9165    /// profile: `&str` -> Filename of ICC profile to embed
9166    pub fn magicksave_buffer_with_opts(&self, option: VOption) -> Result<Vec<u8>> {
9167        let mut buffer_out = VipsBlob::from(null_mut());
9168        let vips_op_response = call(
9169            "magicksave_buffer",
9170            option
9171                .set("in", self)
9172                .set(
9173                    "buffer",
9174                    &mut buffer_out,
9175                ),
9176        );
9177
9178        utils::result(
9179            vips_op_response,
9180            buffer_out.into(),
9181            Error::OperationError("MagicksaveBuffer (vips_magicksave_buffer) failed".to_string()),
9182        )
9183    }
9184
9185    /// VipsMapim (mapim), resample with a map image
9186    /// returns `VipsImage` - Output image
9187    ///
9188    /// index: `&VipsImage` -> Index pixels with this
9189    pub fn mapim(&self, index: &VipsImage) -> Result<VipsImage> {
9190        let mut out_out = VipsImage::from(null_mut());
9191        let vips_op_response = call(
9192            "mapim",
9193            VOption::new()
9194                .set("in", self)
9195                .set(
9196                    "out",
9197                    &mut out_out,
9198                )
9199                .set(
9200                    "index",
9201                    index,
9202                ),
9203        );
9204
9205        utils::result(
9206            vips_op_response,
9207            out_out,
9208            Error::OperationError("Mapim (vips_mapim) failed".to_string()),
9209        )
9210    }
9211
9212    /// VipsMapim (mapim), resample with a map image
9213    /// returns `VipsImage` - Output image
9214    ///
9215    /// index: `&VipsImage` -> Index pixels with this
9216    ///
9217    /// <ins>Optional arguments</ins>
9218    ///
9219    /// interpolate: `&VipsInterpolate` -> Interpolate pixels with this
9220    ///
9221    /// background: `&[f64]` -> Background value
9222    ///
9223    /// premultiplied: `bool` -> Images have premultiplied alpha
9224    ///
9225    /// extend: [`Extend`] -> How to generate the extra pixels
9226    pub fn mapim_with_opts(&self, index: &VipsImage, option: VOption) -> Result<VipsImage> {
9227        let mut out_out = VipsImage::from(null_mut());
9228        let vips_op_response = call(
9229            "mapim",
9230            option
9231                .set("in", self)
9232                .set(
9233                    "out",
9234                    &mut out_out,
9235                )
9236                .set(
9237                    "index",
9238                    index,
9239                ),
9240        );
9241
9242        utils::result(
9243            vips_op_response,
9244            out_out,
9245            Error::OperationError("Mapim (vips_mapim) failed".to_string()),
9246        )
9247    }
9248
9249    /// VipsMaplut (maplut), map an image though a lut
9250    /// returns `VipsImage` - Output image
9251    ///
9252    /// lut: `&VipsImage` -> Look-up table image
9253    pub fn maplut(&self, lut: &VipsImage) -> Result<VipsImage> {
9254        let mut out_out = VipsImage::from(null_mut());
9255        let vips_op_response = call(
9256            "maplut",
9257            VOption::new()
9258                .set("in", self)
9259                .set(
9260                    "out",
9261                    &mut out_out,
9262                )
9263                .set("lut", lut),
9264        );
9265
9266        utils::result(
9267            vips_op_response,
9268            out_out,
9269            Error::OperationError("Maplut (vips_maplut) failed".to_string()),
9270        )
9271    }
9272
9273    /// VipsMaplut (maplut), map an image though a lut
9274    /// returns `VipsImage` - Output image
9275    ///
9276    /// lut: `&VipsImage` -> Look-up table image
9277    ///
9278    /// <ins>Optional arguments</ins>
9279    ///
9280    /// band: `i32` -> Apply one-band lut to this band of in
9281    pub fn maplut_with_opts(&self, lut: &VipsImage, option: VOption) -> Result<VipsImage> {
9282        let mut out_out = VipsImage::from(null_mut());
9283        let vips_op_response = call(
9284            "maplut",
9285            option
9286                .set("in", self)
9287                .set(
9288                    "out",
9289                    &mut out_out,
9290                )
9291                .set("lut", lut),
9292        );
9293
9294        utils::result(
9295            vips_op_response,
9296            out_out,
9297            Error::OperationError("Maplut (vips_maplut) failed".to_string()),
9298        )
9299    }
9300
9301    /// VipsMaskButterworth (mask_butterworth), make a butterworth filter
9302    /// returns `VipsImage` - Output image
9303    ///
9304    /// width: `i32` -> Image width in pixels
9305    ///
9306    /// height: `i32` -> Image height in pixels
9307    ///
9308    /// order: `f64` -> Filter order
9309    ///
9310    /// frequency_cutoff: `f64` -> Frequency cutoff
9311    ///
9312    /// amplitude_cutoff: `f64` -> Amplitude cutoff
9313    pub fn mask_butterworth(
9314        width: i32,
9315        height: i32,
9316        order: f64,
9317        frequency_cutoff: f64,
9318        amplitude_cutoff: f64,
9319    ) -> Result<VipsImage> {
9320        let mut out_out = VipsImage::from(null_mut());
9321        let vips_op_response = call(
9322            "mask_butterworth",
9323            VOption::new()
9324                .set(
9325                    "out",
9326                    &mut out_out,
9327                )
9328                .set(
9329                    "width",
9330                    width,
9331                )
9332                .set(
9333                    "height",
9334                    height,
9335                )
9336                .set(
9337                    "order",
9338                    order,
9339                )
9340                .set(
9341                    "frequency-cutoff",
9342                    frequency_cutoff,
9343                )
9344                .set(
9345                    "amplitude-cutoff",
9346                    amplitude_cutoff,
9347                ),
9348        );
9349
9350        utils::result(
9351            vips_op_response,
9352            out_out,
9353            Error::OperationError("MaskButterworth (vips_mask_butterworth) failed".to_string()),
9354        )
9355    }
9356
9357    /// VipsMaskButterworth (mask_butterworth), make a butterworth filter
9358    /// returns `VipsImage` - Output image
9359    ///
9360    /// width: `i32` -> Image width in pixels
9361    ///
9362    /// height: `i32` -> Image height in pixels
9363    ///
9364    /// order: `f64` -> Filter order
9365    ///
9366    /// frequency_cutoff: `f64` -> Frequency cutoff
9367    ///
9368    /// amplitude_cutoff: `f64` -> Amplitude cutoff
9369    ///
9370    /// <ins>Optional arguments</ins>
9371    ///
9372    /// uchar: `bool` -> Output an unsigned char image
9373    ///
9374    /// nodc: `bool` -> Remove DC component
9375    ///
9376    /// reject: `bool` -> Invert the sense of the filter
9377    ///
9378    /// optical: `bool` -> Rotate quadrants to optical space
9379    pub fn mask_butterworth_with_opts(
9380        width: i32,
9381        height: i32,
9382        order: f64,
9383        frequency_cutoff: f64,
9384        amplitude_cutoff: f64,
9385        option: VOption,
9386    ) -> Result<VipsImage> {
9387        let mut out_out = VipsImage::from(null_mut());
9388        let vips_op_response = call(
9389            "mask_butterworth",
9390            option
9391                .set(
9392                    "out",
9393                    &mut out_out,
9394                )
9395                .set(
9396                    "width",
9397                    width,
9398                )
9399                .set(
9400                    "height",
9401                    height,
9402                )
9403                .set(
9404                    "order",
9405                    order,
9406                )
9407                .set(
9408                    "frequency-cutoff",
9409                    frequency_cutoff,
9410                )
9411                .set(
9412                    "amplitude-cutoff",
9413                    amplitude_cutoff,
9414                ),
9415        );
9416
9417        utils::result(
9418            vips_op_response,
9419            out_out,
9420            Error::OperationError("MaskButterworth (vips_mask_butterworth) failed".to_string()),
9421        )
9422    }
9423
9424    /// VipsMaskButterworthBand (mask_butterworth_band), make a butterworth_band filter
9425    /// returns `VipsImage` - Output image
9426    ///
9427    /// width: `i32` -> Image width in pixels
9428    ///
9429    /// height: `i32` -> Image height in pixels
9430    ///
9431    /// order: `f64` -> Filter order
9432    ///
9433    /// frequency_cutoff_x: `f64` -> Frequency cutoff x
9434    ///
9435    /// frequency_cutoff_y: `f64` -> Frequency cutoff y
9436    ///
9437    /// radius: `f64` -> Radius of circle
9438    ///
9439    /// amplitude_cutoff: `f64` -> Amplitude cutoff
9440    pub fn mask_butterworth_band(
9441        width: i32,
9442        height: i32,
9443        order: f64,
9444        frequency_cutoff_x: f64,
9445        frequency_cutoff_y: f64,
9446        radius: f64,
9447        amplitude_cutoff: f64,
9448    ) -> Result<VipsImage> {
9449        let mut out_out = VipsImage::from(null_mut());
9450        let vips_op_response = call(
9451            "mask_butterworth_band",
9452            VOption::new()
9453                .set(
9454                    "out",
9455                    &mut out_out,
9456                )
9457                .set(
9458                    "width",
9459                    width,
9460                )
9461                .set(
9462                    "height",
9463                    height,
9464                )
9465                .set(
9466                    "order",
9467                    order,
9468                )
9469                .set(
9470                    "frequency-cutoff-x",
9471                    frequency_cutoff_x,
9472                )
9473                .set(
9474                    "frequency-cutoff-y",
9475                    frequency_cutoff_y,
9476                )
9477                .set(
9478                    "radius",
9479                    radius,
9480                )
9481                .set(
9482                    "amplitude-cutoff",
9483                    amplitude_cutoff,
9484                ),
9485        );
9486
9487        utils::result(
9488            vips_op_response,
9489            out_out,
9490            Error::OperationError(
9491                "MaskButterworthBand (vips_mask_butterworth_band) failed".to_string(),
9492            ),
9493        )
9494    }
9495
9496    /// VipsMaskButterworthBand (mask_butterworth_band), make a butterworth_band filter
9497    /// returns `VipsImage` - Output image
9498    ///
9499    /// width: `i32` -> Image width in pixels
9500    ///
9501    /// height: `i32` -> Image height in pixels
9502    ///
9503    /// order: `f64` -> Filter order
9504    ///
9505    /// frequency_cutoff_x: `f64` -> Frequency cutoff x
9506    ///
9507    /// frequency_cutoff_y: `f64` -> Frequency cutoff y
9508    ///
9509    /// radius: `f64` -> Radius of circle
9510    ///
9511    /// amplitude_cutoff: `f64` -> Amplitude cutoff
9512    ///
9513    /// <ins>Optional arguments</ins>
9514    ///
9515    /// uchar: `bool` -> Output an unsigned char image
9516    ///
9517    /// nodc: `bool` -> Remove DC component
9518    ///
9519    /// reject: `bool` -> Invert the sense of the filter
9520    ///
9521    /// optical: `bool` -> Rotate quadrants to optical space
9522    pub fn mask_butterworth_band_with_opts(
9523        width: i32,
9524        height: i32,
9525        order: f64,
9526        frequency_cutoff_x: f64,
9527        frequency_cutoff_y: f64,
9528        radius: f64,
9529        amplitude_cutoff: f64,
9530        option: VOption,
9531    ) -> Result<VipsImage> {
9532        let mut out_out = VipsImage::from(null_mut());
9533        let vips_op_response = call(
9534            "mask_butterworth_band",
9535            option
9536                .set(
9537                    "out",
9538                    &mut out_out,
9539                )
9540                .set(
9541                    "width",
9542                    width,
9543                )
9544                .set(
9545                    "height",
9546                    height,
9547                )
9548                .set(
9549                    "order",
9550                    order,
9551                )
9552                .set(
9553                    "frequency-cutoff-x",
9554                    frequency_cutoff_x,
9555                )
9556                .set(
9557                    "frequency-cutoff-y",
9558                    frequency_cutoff_y,
9559                )
9560                .set(
9561                    "radius",
9562                    radius,
9563                )
9564                .set(
9565                    "amplitude-cutoff",
9566                    amplitude_cutoff,
9567                ),
9568        );
9569
9570        utils::result(
9571            vips_op_response,
9572            out_out,
9573            Error::OperationError(
9574                "MaskButterworthBand (vips_mask_butterworth_band) failed".to_string(),
9575            ),
9576        )
9577    }
9578
9579    /// VipsMaskButterworthRing (mask_butterworth_ring), make a butterworth ring filter
9580    /// returns `VipsImage` - Output image
9581    ///
9582    /// width: `i32` -> Image width in pixels
9583    ///
9584    /// height: `i32` -> Image height in pixels
9585    ///
9586    /// order: `f64` -> Filter order
9587    ///
9588    /// frequency_cutoff: `f64` -> Frequency cutoff
9589    ///
9590    /// amplitude_cutoff: `f64` -> Amplitude cutoff
9591    ///
9592    /// ringwidth: `f64` -> Ringwidth
9593    pub fn mask_butterworth_ring(
9594        width: i32,
9595        height: i32,
9596        order: f64,
9597        frequency_cutoff: f64,
9598        amplitude_cutoff: f64,
9599        ringwidth: f64,
9600    ) -> Result<VipsImage> {
9601        let mut out_out = VipsImage::from(null_mut());
9602        let vips_op_response = call(
9603            "mask_butterworth_ring",
9604            VOption::new()
9605                .set(
9606                    "out",
9607                    &mut out_out,
9608                )
9609                .set(
9610                    "width",
9611                    width,
9612                )
9613                .set(
9614                    "height",
9615                    height,
9616                )
9617                .set(
9618                    "order",
9619                    order,
9620                )
9621                .set(
9622                    "frequency-cutoff",
9623                    frequency_cutoff,
9624                )
9625                .set(
9626                    "amplitude-cutoff",
9627                    amplitude_cutoff,
9628                )
9629                .set(
9630                    "ringwidth",
9631                    ringwidth,
9632                ),
9633        );
9634
9635        utils::result(
9636            vips_op_response,
9637            out_out,
9638            Error::OperationError(
9639                "MaskButterworthRing (vips_mask_butterworth_ring) failed".to_string(),
9640            ),
9641        )
9642    }
9643
9644    /// VipsMaskButterworthRing (mask_butterworth_ring), make a butterworth ring filter
9645    /// returns `VipsImage` - Output image
9646    ///
9647    /// width: `i32` -> Image width in pixels
9648    ///
9649    /// height: `i32` -> Image height in pixels
9650    ///
9651    /// order: `f64` -> Filter order
9652    ///
9653    /// frequency_cutoff: `f64` -> Frequency cutoff
9654    ///
9655    /// amplitude_cutoff: `f64` -> Amplitude cutoff
9656    ///
9657    /// ringwidth: `f64` -> Ringwidth
9658    ///
9659    /// <ins>Optional arguments</ins>
9660    ///
9661    /// uchar: `bool` -> Output an unsigned char image
9662    ///
9663    /// nodc: `bool` -> Remove DC component
9664    ///
9665    /// reject: `bool` -> Invert the sense of the filter
9666    ///
9667    /// optical: `bool` -> Rotate quadrants to optical space
9668    pub fn mask_butterworth_ring_with_opts(
9669        width: i32,
9670        height: i32,
9671        order: f64,
9672        frequency_cutoff: f64,
9673        amplitude_cutoff: f64,
9674        ringwidth: f64,
9675        option: VOption,
9676    ) -> Result<VipsImage> {
9677        let mut out_out = VipsImage::from(null_mut());
9678        let vips_op_response = call(
9679            "mask_butterworth_ring",
9680            option
9681                .set(
9682                    "out",
9683                    &mut out_out,
9684                )
9685                .set(
9686                    "width",
9687                    width,
9688                )
9689                .set(
9690                    "height",
9691                    height,
9692                )
9693                .set(
9694                    "order",
9695                    order,
9696                )
9697                .set(
9698                    "frequency-cutoff",
9699                    frequency_cutoff,
9700                )
9701                .set(
9702                    "amplitude-cutoff",
9703                    amplitude_cutoff,
9704                )
9705                .set(
9706                    "ringwidth",
9707                    ringwidth,
9708                ),
9709        );
9710
9711        utils::result(
9712            vips_op_response,
9713            out_out,
9714            Error::OperationError(
9715                "MaskButterworthRing (vips_mask_butterworth_ring) failed".to_string(),
9716            ),
9717        )
9718    }
9719
9720    /// VipsMaskFractal (mask_fractal), make fractal filter
9721    /// returns `VipsImage` - Output image
9722    ///
9723    /// width: `i32` -> Image width in pixels
9724    ///
9725    /// height: `i32` -> Image height in pixels
9726    ///
9727    /// fractal_dimension: `f64` -> Fractal dimension
9728    pub fn mask_fractal(width: i32, height: i32, fractal_dimension: f64) -> Result<VipsImage> {
9729        let mut out_out = VipsImage::from(null_mut());
9730        let vips_op_response = call(
9731            "mask_fractal",
9732            VOption::new()
9733                .set(
9734                    "out",
9735                    &mut out_out,
9736                )
9737                .set(
9738                    "width",
9739                    width,
9740                )
9741                .set(
9742                    "height",
9743                    height,
9744                )
9745                .set(
9746                    "fractal-dimension",
9747                    fractal_dimension,
9748                ),
9749        );
9750
9751        utils::result(
9752            vips_op_response,
9753            out_out,
9754            Error::OperationError("MaskFractal (vips_mask_fractal) failed".to_string()),
9755        )
9756    }
9757
9758    /// VipsMaskFractal (mask_fractal), make fractal filter
9759    /// returns `VipsImage` - Output image
9760    ///
9761    /// width: `i32` -> Image width in pixels
9762    ///
9763    /// height: `i32` -> Image height in pixels
9764    ///
9765    /// fractal_dimension: `f64` -> Fractal dimension
9766    ///
9767    /// <ins>Optional arguments</ins>
9768    ///
9769    /// uchar: `bool` -> Output an unsigned char image
9770    ///
9771    /// nodc: `bool` -> Remove DC component
9772    ///
9773    /// reject: `bool` -> Invert the sense of the filter
9774    ///
9775    /// optical: `bool` -> Rotate quadrants to optical space
9776    pub fn mask_fractal_with_opts(
9777        width: i32,
9778        height: i32,
9779        fractal_dimension: f64,
9780        option: VOption,
9781    ) -> Result<VipsImage> {
9782        let mut out_out = VipsImage::from(null_mut());
9783        let vips_op_response = call(
9784            "mask_fractal",
9785            option
9786                .set(
9787                    "out",
9788                    &mut out_out,
9789                )
9790                .set(
9791                    "width",
9792                    width,
9793                )
9794                .set(
9795                    "height",
9796                    height,
9797                )
9798                .set(
9799                    "fractal-dimension",
9800                    fractal_dimension,
9801                ),
9802        );
9803
9804        utils::result(
9805            vips_op_response,
9806            out_out,
9807            Error::OperationError("MaskFractal (vips_mask_fractal) failed".to_string()),
9808        )
9809    }
9810
9811    /// VipsMaskGaussian (mask_gaussian), make a gaussian filter
9812    /// returns `VipsImage` - Output image
9813    ///
9814    /// width: `i32` -> Image width in pixels
9815    ///
9816    /// height: `i32` -> Image height in pixels
9817    ///
9818    /// frequency_cutoff: `f64` -> Frequency cutoff
9819    ///
9820    /// amplitude_cutoff: `f64` -> Amplitude cutoff
9821    pub fn mask_gaussian(
9822        width: i32,
9823        height: i32,
9824        frequency_cutoff: f64,
9825        amplitude_cutoff: f64,
9826    ) -> Result<VipsImage> {
9827        let mut out_out = VipsImage::from(null_mut());
9828        let vips_op_response = call(
9829            "mask_gaussian",
9830            VOption::new()
9831                .set(
9832                    "out",
9833                    &mut out_out,
9834                )
9835                .set(
9836                    "width",
9837                    width,
9838                )
9839                .set(
9840                    "height",
9841                    height,
9842                )
9843                .set(
9844                    "frequency-cutoff",
9845                    frequency_cutoff,
9846                )
9847                .set(
9848                    "amplitude-cutoff",
9849                    amplitude_cutoff,
9850                ),
9851        );
9852
9853        utils::result(
9854            vips_op_response,
9855            out_out,
9856            Error::OperationError("MaskGaussian (vips_mask_gaussian) failed".to_string()),
9857        )
9858    }
9859
9860    /// VipsMaskGaussian (mask_gaussian), make a gaussian filter
9861    /// returns `VipsImage` - Output image
9862    ///
9863    /// width: `i32` -> Image width in pixels
9864    ///
9865    /// height: `i32` -> Image height in pixels
9866    ///
9867    /// frequency_cutoff: `f64` -> Frequency cutoff
9868    ///
9869    /// amplitude_cutoff: `f64` -> Amplitude cutoff
9870    ///
9871    /// <ins>Optional arguments</ins>
9872    ///
9873    /// uchar: `bool` -> Output an unsigned char image
9874    ///
9875    /// nodc: `bool` -> Remove DC component
9876    ///
9877    /// reject: `bool` -> Invert the sense of the filter
9878    ///
9879    /// optical: `bool` -> Rotate quadrants to optical space
9880    pub fn mask_gaussian_with_opts(
9881        width: i32,
9882        height: i32,
9883        frequency_cutoff: f64,
9884        amplitude_cutoff: f64,
9885        option: VOption,
9886    ) -> Result<VipsImage> {
9887        let mut out_out = VipsImage::from(null_mut());
9888        let vips_op_response = call(
9889            "mask_gaussian",
9890            option
9891                .set(
9892                    "out",
9893                    &mut out_out,
9894                )
9895                .set(
9896                    "width",
9897                    width,
9898                )
9899                .set(
9900                    "height",
9901                    height,
9902                )
9903                .set(
9904                    "frequency-cutoff",
9905                    frequency_cutoff,
9906                )
9907                .set(
9908                    "amplitude-cutoff",
9909                    amplitude_cutoff,
9910                ),
9911        );
9912
9913        utils::result(
9914            vips_op_response,
9915            out_out,
9916            Error::OperationError("MaskGaussian (vips_mask_gaussian) failed".to_string()),
9917        )
9918    }
9919
9920    /// VipsMaskGaussianBand (mask_gaussian_band), make a gaussian filter
9921    /// returns `VipsImage` - Output image
9922    ///
9923    /// width: `i32` -> Image width in pixels
9924    ///
9925    /// height: `i32` -> Image height in pixels
9926    ///
9927    /// frequency_cutoff_x: `f64` -> Frequency cutoff x
9928    ///
9929    /// frequency_cutoff_y: `f64` -> Frequency cutoff y
9930    ///
9931    /// radius: `f64` -> Radius of circle
9932    ///
9933    /// amplitude_cutoff: `f64` -> Amplitude cutoff
9934    pub fn mask_gaussian_band(
9935        width: i32,
9936        height: i32,
9937        frequency_cutoff_x: f64,
9938        frequency_cutoff_y: f64,
9939        radius: f64,
9940        amplitude_cutoff: f64,
9941    ) -> Result<VipsImage> {
9942        let mut out_out = VipsImage::from(null_mut());
9943        let vips_op_response = call(
9944            "mask_gaussian_band",
9945            VOption::new()
9946                .set(
9947                    "out",
9948                    &mut out_out,
9949                )
9950                .set(
9951                    "width",
9952                    width,
9953                )
9954                .set(
9955                    "height",
9956                    height,
9957                )
9958                .set(
9959                    "frequency-cutoff-x",
9960                    frequency_cutoff_x,
9961                )
9962                .set(
9963                    "frequency-cutoff-y",
9964                    frequency_cutoff_y,
9965                )
9966                .set(
9967                    "radius",
9968                    radius,
9969                )
9970                .set(
9971                    "amplitude-cutoff",
9972                    amplitude_cutoff,
9973                ),
9974        );
9975
9976        utils::result(
9977            vips_op_response,
9978            out_out,
9979            Error::OperationError("MaskGaussianBand (vips_mask_gaussian_band) failed".to_string()),
9980        )
9981    }
9982
9983    /// VipsMaskGaussianBand (mask_gaussian_band), make a gaussian filter
9984    /// returns `VipsImage` - Output image
9985    ///
9986    /// width: `i32` -> Image width in pixels
9987    ///
9988    /// height: `i32` -> Image height in pixels
9989    ///
9990    /// frequency_cutoff_x: `f64` -> Frequency cutoff x
9991    ///
9992    /// frequency_cutoff_y: `f64` -> Frequency cutoff y
9993    ///
9994    /// radius: `f64` -> Radius of circle
9995    ///
9996    /// amplitude_cutoff: `f64` -> Amplitude cutoff
9997    ///
9998    /// <ins>Optional arguments</ins>
9999    ///
10000    /// uchar: `bool` -> Output an unsigned char image
10001    ///
10002    /// nodc: `bool` -> Remove DC component
10003    ///
10004    /// reject: `bool` -> Invert the sense of the filter
10005    ///
10006    /// optical: `bool` -> Rotate quadrants to optical space
10007    pub fn mask_gaussian_band_with_opts(
10008        width: i32,
10009        height: i32,
10010        frequency_cutoff_x: f64,
10011        frequency_cutoff_y: f64,
10012        radius: f64,
10013        amplitude_cutoff: f64,
10014        option: VOption,
10015    ) -> Result<VipsImage> {
10016        let mut out_out = VipsImage::from(null_mut());
10017        let vips_op_response = call(
10018            "mask_gaussian_band",
10019            option
10020                .set(
10021                    "out",
10022                    &mut out_out,
10023                )
10024                .set(
10025                    "width",
10026                    width,
10027                )
10028                .set(
10029                    "height",
10030                    height,
10031                )
10032                .set(
10033                    "frequency-cutoff-x",
10034                    frequency_cutoff_x,
10035                )
10036                .set(
10037                    "frequency-cutoff-y",
10038                    frequency_cutoff_y,
10039                )
10040                .set(
10041                    "radius",
10042                    radius,
10043                )
10044                .set(
10045                    "amplitude-cutoff",
10046                    amplitude_cutoff,
10047                ),
10048        );
10049
10050        utils::result(
10051            vips_op_response,
10052            out_out,
10053            Error::OperationError("MaskGaussianBand (vips_mask_gaussian_band) failed".to_string()),
10054        )
10055    }
10056
10057    /// VipsMaskGaussianRing (mask_gaussian_ring), make a gaussian ring filter
10058    /// returns `VipsImage` - Output image
10059    ///
10060    /// width: `i32` -> Image width in pixels
10061    ///
10062    /// height: `i32` -> Image height in pixels
10063    ///
10064    /// frequency_cutoff: `f64` -> Frequency cutoff
10065    ///
10066    /// amplitude_cutoff: `f64` -> Amplitude cutoff
10067    ///
10068    /// ringwidth: `f64` -> Ringwidth
10069    pub fn mask_gaussian_ring(
10070        width: i32,
10071        height: i32,
10072        frequency_cutoff: f64,
10073        amplitude_cutoff: f64,
10074        ringwidth: f64,
10075    ) -> Result<VipsImage> {
10076        let mut out_out = VipsImage::from(null_mut());
10077        let vips_op_response = call(
10078            "mask_gaussian_ring",
10079            VOption::new()
10080                .set(
10081                    "out",
10082                    &mut out_out,
10083                )
10084                .set(
10085                    "width",
10086                    width,
10087                )
10088                .set(
10089                    "height",
10090                    height,
10091                )
10092                .set(
10093                    "frequency-cutoff",
10094                    frequency_cutoff,
10095                )
10096                .set(
10097                    "amplitude-cutoff",
10098                    amplitude_cutoff,
10099                )
10100                .set(
10101                    "ringwidth",
10102                    ringwidth,
10103                ),
10104        );
10105
10106        utils::result(
10107            vips_op_response,
10108            out_out,
10109            Error::OperationError("MaskGaussianRing (vips_mask_gaussian_ring) failed".to_string()),
10110        )
10111    }
10112
10113    /// VipsMaskGaussianRing (mask_gaussian_ring), make a gaussian ring filter
10114    /// returns `VipsImage` - Output image
10115    ///
10116    /// width: `i32` -> Image width in pixels
10117    ///
10118    /// height: `i32` -> Image height in pixels
10119    ///
10120    /// frequency_cutoff: `f64` -> Frequency cutoff
10121    ///
10122    /// amplitude_cutoff: `f64` -> Amplitude cutoff
10123    ///
10124    /// ringwidth: `f64` -> Ringwidth
10125    ///
10126    /// <ins>Optional arguments</ins>
10127    ///
10128    /// uchar: `bool` -> Output an unsigned char image
10129    ///
10130    /// nodc: `bool` -> Remove DC component
10131    ///
10132    /// reject: `bool` -> Invert the sense of the filter
10133    ///
10134    /// optical: `bool` -> Rotate quadrants to optical space
10135    pub fn mask_gaussian_ring_with_opts(
10136        width: i32,
10137        height: i32,
10138        frequency_cutoff: f64,
10139        amplitude_cutoff: f64,
10140        ringwidth: f64,
10141        option: VOption,
10142    ) -> Result<VipsImage> {
10143        let mut out_out = VipsImage::from(null_mut());
10144        let vips_op_response = call(
10145            "mask_gaussian_ring",
10146            option
10147                .set(
10148                    "out",
10149                    &mut out_out,
10150                )
10151                .set(
10152                    "width",
10153                    width,
10154                )
10155                .set(
10156                    "height",
10157                    height,
10158                )
10159                .set(
10160                    "frequency-cutoff",
10161                    frequency_cutoff,
10162                )
10163                .set(
10164                    "amplitude-cutoff",
10165                    amplitude_cutoff,
10166                )
10167                .set(
10168                    "ringwidth",
10169                    ringwidth,
10170                ),
10171        );
10172
10173        utils::result(
10174            vips_op_response,
10175            out_out,
10176            Error::OperationError("MaskGaussianRing (vips_mask_gaussian_ring) failed".to_string()),
10177        )
10178    }
10179
10180    /// VipsMaskIdeal (mask_ideal), make an ideal filter
10181    /// returns `VipsImage` - Output image
10182    ///
10183    /// width: `i32` -> Image width in pixels
10184    ///
10185    /// height: `i32` -> Image height in pixels
10186    ///
10187    /// frequency_cutoff: `f64` -> Frequency cutoff
10188    pub fn mask_ideal(width: i32, height: i32, frequency_cutoff: f64) -> Result<VipsImage> {
10189        let mut out_out = VipsImage::from(null_mut());
10190        let vips_op_response = call(
10191            "mask_ideal",
10192            VOption::new()
10193                .set(
10194                    "out",
10195                    &mut out_out,
10196                )
10197                .set(
10198                    "width",
10199                    width,
10200                )
10201                .set(
10202                    "height",
10203                    height,
10204                )
10205                .set(
10206                    "frequency-cutoff",
10207                    frequency_cutoff,
10208                ),
10209        );
10210
10211        utils::result(
10212            vips_op_response,
10213            out_out,
10214            Error::OperationError("MaskIdeal (vips_mask_ideal) failed".to_string()),
10215        )
10216    }
10217
10218    /// VipsMaskIdeal (mask_ideal), make an ideal filter
10219    /// returns `VipsImage` - Output image
10220    ///
10221    /// width: `i32` -> Image width in pixels
10222    ///
10223    /// height: `i32` -> Image height in pixels
10224    ///
10225    /// frequency_cutoff: `f64` -> Frequency cutoff
10226    ///
10227    /// <ins>Optional arguments</ins>
10228    ///
10229    /// uchar: `bool` -> Output an unsigned char image
10230    ///
10231    /// nodc: `bool` -> Remove DC component
10232    ///
10233    /// reject: `bool` -> Invert the sense of the filter
10234    ///
10235    /// optical: `bool` -> Rotate quadrants to optical space
10236    pub fn mask_ideal_with_opts(
10237        width: i32,
10238        height: i32,
10239        frequency_cutoff: f64,
10240        option: VOption,
10241    ) -> Result<VipsImage> {
10242        let mut out_out = VipsImage::from(null_mut());
10243        let vips_op_response = call(
10244            "mask_ideal",
10245            option
10246                .set(
10247                    "out",
10248                    &mut out_out,
10249                )
10250                .set(
10251                    "width",
10252                    width,
10253                )
10254                .set(
10255                    "height",
10256                    height,
10257                )
10258                .set(
10259                    "frequency-cutoff",
10260                    frequency_cutoff,
10261                ),
10262        );
10263
10264        utils::result(
10265            vips_op_response,
10266            out_out,
10267            Error::OperationError("MaskIdeal (vips_mask_ideal) failed".to_string()),
10268        )
10269    }
10270
10271    /// VipsMaskIdealBand (mask_ideal_band), make an ideal band filter
10272    /// returns `VipsImage` - Output image
10273    ///
10274    /// width: `i32` -> Image width in pixels
10275    ///
10276    /// height: `i32` -> Image height in pixels
10277    ///
10278    /// frequency_cutoff_x: `f64` -> Frequency cutoff x
10279    ///
10280    /// frequency_cutoff_y: `f64` -> Frequency cutoff y
10281    ///
10282    /// radius: `f64` -> Radius of circle
10283    pub fn mask_ideal_band(
10284        width: i32,
10285        height: i32,
10286        frequency_cutoff_x: f64,
10287        frequency_cutoff_y: f64,
10288        radius: f64,
10289    ) -> Result<VipsImage> {
10290        let mut out_out = VipsImage::from(null_mut());
10291        let vips_op_response = call(
10292            "mask_ideal_band",
10293            VOption::new()
10294                .set(
10295                    "out",
10296                    &mut out_out,
10297                )
10298                .set(
10299                    "width",
10300                    width,
10301                )
10302                .set(
10303                    "height",
10304                    height,
10305                )
10306                .set(
10307                    "frequency-cutoff-x",
10308                    frequency_cutoff_x,
10309                )
10310                .set(
10311                    "frequency-cutoff-y",
10312                    frequency_cutoff_y,
10313                )
10314                .set(
10315                    "radius",
10316                    radius,
10317                ),
10318        );
10319
10320        utils::result(
10321            vips_op_response,
10322            out_out,
10323            Error::OperationError("MaskIdealBand (vips_mask_ideal_band) failed".to_string()),
10324        )
10325    }
10326
10327    /// VipsMaskIdealBand (mask_ideal_band), make an ideal band filter
10328    /// returns `VipsImage` - Output image
10329    ///
10330    /// width: `i32` -> Image width in pixels
10331    ///
10332    /// height: `i32` -> Image height in pixels
10333    ///
10334    /// frequency_cutoff_x: `f64` -> Frequency cutoff x
10335    ///
10336    /// frequency_cutoff_y: `f64` -> Frequency cutoff y
10337    ///
10338    /// radius: `f64` -> Radius of circle
10339    ///
10340    /// <ins>Optional arguments</ins>
10341    ///
10342    /// uchar: `bool` -> Output an unsigned char image
10343    ///
10344    /// nodc: `bool` -> Remove DC component
10345    ///
10346    /// reject: `bool` -> Invert the sense of the filter
10347    ///
10348    /// optical: `bool` -> Rotate quadrants to optical space
10349    pub fn mask_ideal_band_with_opts(
10350        width: i32,
10351        height: i32,
10352        frequency_cutoff_x: f64,
10353        frequency_cutoff_y: f64,
10354        radius: f64,
10355        option: VOption,
10356    ) -> Result<VipsImage> {
10357        let mut out_out = VipsImage::from(null_mut());
10358        let vips_op_response = call(
10359            "mask_ideal_band",
10360            option
10361                .set(
10362                    "out",
10363                    &mut out_out,
10364                )
10365                .set(
10366                    "width",
10367                    width,
10368                )
10369                .set(
10370                    "height",
10371                    height,
10372                )
10373                .set(
10374                    "frequency-cutoff-x",
10375                    frequency_cutoff_x,
10376                )
10377                .set(
10378                    "frequency-cutoff-y",
10379                    frequency_cutoff_y,
10380                )
10381                .set(
10382                    "radius",
10383                    radius,
10384                ),
10385        );
10386
10387        utils::result(
10388            vips_op_response,
10389            out_out,
10390            Error::OperationError("MaskIdealBand (vips_mask_ideal_band) failed".to_string()),
10391        )
10392    }
10393
10394    /// VipsMaskIdealRing (mask_ideal_ring), make an ideal ring filter
10395    /// returns `VipsImage` - Output image
10396    ///
10397    /// width: `i32` -> Image width in pixels
10398    ///
10399    /// height: `i32` -> Image height in pixels
10400    ///
10401    /// frequency_cutoff: `f64` -> Frequency cutoff
10402    ///
10403    /// ringwidth: `f64` -> Ringwidth
10404    pub fn mask_ideal_ring(
10405        width: i32,
10406        height: i32,
10407        frequency_cutoff: f64,
10408        ringwidth: f64,
10409    ) -> Result<VipsImage> {
10410        let mut out_out = VipsImage::from(null_mut());
10411        let vips_op_response = call(
10412            "mask_ideal_ring",
10413            VOption::new()
10414                .set(
10415                    "out",
10416                    &mut out_out,
10417                )
10418                .set(
10419                    "width",
10420                    width,
10421                )
10422                .set(
10423                    "height",
10424                    height,
10425                )
10426                .set(
10427                    "frequency-cutoff",
10428                    frequency_cutoff,
10429                )
10430                .set(
10431                    "ringwidth",
10432                    ringwidth,
10433                ),
10434        );
10435
10436        utils::result(
10437            vips_op_response,
10438            out_out,
10439            Error::OperationError("MaskIdealRing (vips_mask_ideal_ring) failed".to_string()),
10440        )
10441    }
10442
10443    /// VipsMaskIdealRing (mask_ideal_ring), make an ideal ring filter
10444    /// returns `VipsImage` - Output image
10445    ///
10446    /// width: `i32` -> Image width in pixels
10447    ///
10448    /// height: `i32` -> Image height in pixels
10449    ///
10450    /// frequency_cutoff: `f64` -> Frequency cutoff
10451    ///
10452    /// ringwidth: `f64` -> Ringwidth
10453    ///
10454    /// <ins>Optional arguments</ins>
10455    ///
10456    /// uchar: `bool` -> Output an unsigned char image
10457    ///
10458    /// nodc: `bool` -> Remove DC component
10459    ///
10460    /// reject: `bool` -> Invert the sense of the filter
10461    ///
10462    /// optical: `bool` -> Rotate quadrants to optical space
10463    pub fn mask_ideal_ring_with_opts(
10464        width: i32,
10465        height: i32,
10466        frequency_cutoff: f64,
10467        ringwidth: f64,
10468        option: VOption,
10469    ) -> Result<VipsImage> {
10470        let mut out_out = VipsImage::from(null_mut());
10471        let vips_op_response = call(
10472            "mask_ideal_ring",
10473            option
10474                .set(
10475                    "out",
10476                    &mut out_out,
10477                )
10478                .set(
10479                    "width",
10480                    width,
10481                )
10482                .set(
10483                    "height",
10484                    height,
10485                )
10486                .set(
10487                    "frequency-cutoff",
10488                    frequency_cutoff,
10489                )
10490                .set(
10491                    "ringwidth",
10492                    ringwidth,
10493                ),
10494        );
10495
10496        utils::result(
10497            vips_op_response,
10498            out_out,
10499            Error::OperationError("MaskIdealRing (vips_mask_ideal_ring) failed".to_string()),
10500        )
10501    }
10502
10503    /// VipsMatch (match), first-order match of two images
10504    /// returns `VipsImage` - Output image
10505    ///
10506    /// sec: `&VipsImage` -> Secondary image
10507    ///
10508    /// xr1: `i32` -> Position of first reference tie-point
10509    ///
10510    /// yr1: `i32` -> Position of first reference tie-point
10511    ///
10512    /// xs1: `i32` -> Position of first secondary tie-point
10513    ///
10514    /// ys1: `i32` -> Position of first secondary tie-point
10515    ///
10516    /// xr2: `i32` -> Position of second reference tie-point
10517    ///
10518    /// yr2: `i32` -> Position of second reference tie-point
10519    ///
10520    /// xs2: `i32` -> Position of second secondary tie-point
10521    ///
10522    /// ys2: `i32` -> Position of second secondary tie-point
10523    pub fn matches(
10524        &self,
10525        sec: &VipsImage,
10526        xr1: i32,
10527        yr1: i32,
10528        xs1: i32,
10529        ys1: i32,
10530        xr2: i32,
10531        yr2: i32,
10532        xs2: i32,
10533        ys2: i32,
10534    ) -> Result<VipsImage> {
10535        let mut out_out = VipsImage::from(null_mut());
10536        let vips_op_response = call(
10537            "match",
10538            VOption::new()
10539                .set(
10540                    "ref", self,
10541                )
10542                .set("sec", sec)
10543                .set(
10544                    "out",
10545                    &mut out_out,
10546                )
10547                .set("xr1", xr1)
10548                .set("yr1", yr1)
10549                .set("xs1", xs1)
10550                .set("ys1", ys1)
10551                .set("xr2", xr2)
10552                .set("yr2", yr2)
10553                .set("xs2", xs2)
10554                .set("ys2", ys2),
10555        );
10556
10557        utils::result(
10558            vips_op_response,
10559            out_out,
10560            Error::OperationError("Matchs (vips_match) failed".to_string()),
10561        )
10562    }
10563
10564    /// VipsMatch (match), first-order match of two images
10565    /// returns `VipsImage` - Output image
10566    ///
10567    /// sec: `&VipsImage` -> Secondary image
10568    ///
10569    /// xr1: `i32` -> Position of first reference tie-point
10570    ///
10571    /// yr1: `i32` -> Position of first reference tie-point
10572    ///
10573    /// xs1: `i32` -> Position of first secondary tie-point
10574    ///
10575    /// ys1: `i32` -> Position of first secondary tie-point
10576    ///
10577    /// xr2: `i32` -> Position of second reference tie-point
10578    ///
10579    /// yr2: `i32` -> Position of second reference tie-point
10580    ///
10581    /// xs2: `i32` -> Position of second secondary tie-point
10582    ///
10583    /// ys2: `i32` -> Position of second secondary tie-point
10584    ///
10585    /// <ins>Optional arguments</ins>
10586    ///
10587    /// hwindow: `i32` -> Half window size
10588    ///
10589    /// harea: `i32` -> Half area size
10590    ///
10591    /// search: `bool` -> Search to improve tie-points
10592    ///
10593    /// interpolate: `&VipsInterpolate` -> Interpolate pixels with this
10594    pub fn matches_with_opts(
10595        &self,
10596        sec: &VipsImage,
10597        xr1: i32,
10598        yr1: i32,
10599        xs1: i32,
10600        ys1: i32,
10601        xr2: i32,
10602        yr2: i32,
10603        xs2: i32,
10604        ys2: i32,
10605        option: VOption,
10606    ) -> Result<VipsImage> {
10607        let mut out_out = VipsImage::from(null_mut());
10608        let vips_op_response = call(
10609            "match",
10610            option
10611                .set(
10612                    "ref", self,
10613                )
10614                .set("sec", sec)
10615                .set(
10616                    "out",
10617                    &mut out_out,
10618                )
10619                .set("xr1", xr1)
10620                .set("yr1", yr1)
10621                .set("xs1", xs1)
10622                .set("ys1", ys1)
10623                .set("xr2", xr2)
10624                .set("yr2", yr2)
10625                .set("xs2", xs2)
10626                .set("ys2", ys2),
10627        );
10628
10629        utils::result(
10630            vips_op_response,
10631            out_out,
10632            Error::OperationError("Matchs (vips_match) failed".to_string()),
10633        )
10634    }
10635
10636    /// VipsMath2 (math2), binary math operations
10637    /// returns `VipsImage` - Output image
10638    ///
10639    /// right: `&VipsImage` -> Right-hand image argument
10640    ///
10641    /// math2: `OperationMath2` -> Math to perform
10642    pub fn math2(&self, right: &VipsImage, math2: OperationMath2) -> Result<VipsImage> {
10643        let mut out_out = VipsImage::from(null_mut());
10644        let vips_op_response = call(
10645            "math2",
10646            VOption::new()
10647                .set(
10648                    "left",
10649                    self,
10650                )
10651                .set(
10652                    "right",
10653                    right,
10654                )
10655                .set(
10656                    "out",
10657                    &mut out_out,
10658                )
10659                .set(
10660                    "math2",
10661                    math2 as i32,
10662                ),
10663        );
10664
10665        utils::result(
10666            vips_op_response,
10667            out_out,
10668            Error::OperationError("Math2 (vips_math2) failed".to_string()),
10669        )
10670    }
10671
10672    /// VipsMath2Const (math2_const), binary math operations with a constant
10673    /// returns `VipsImage` - Output image
10674    ///
10675    /// math2: `OperationMath2` -> Math to perform
10676    ///
10677    /// c: `&[f64]` -> Array of constants
10678    pub fn math2_const(&self, math2: OperationMath2, c: &[f64]) -> Result<VipsImage> {
10679        let mut out_out = VipsImage::from(null_mut());
10680        let vips_op_response = call(
10681            "math2_const",
10682            VOption::new()
10683                .set("in", self)
10684                .set(
10685                    "out",
10686                    &mut out_out,
10687                )
10688                .set(
10689                    "math2",
10690                    math2 as i32,
10691                )
10692                .set("c", c),
10693        );
10694
10695        utils::result(
10696            vips_op_response,
10697            out_out,
10698            Error::OperationError("Math2Const (vips_math2_const) failed".to_string()),
10699        )
10700    }
10701
10702    /// VipsMath (math), apply a math operation to an image
10703    /// returns `VipsImage` - Output image
10704    ///
10705    /// math: `OperationMath` -> Math to perform
10706    pub fn math(&self, math: OperationMath) -> Result<VipsImage> {
10707        let mut out_out = VipsImage::from(null_mut());
10708        let vips_op_response = call(
10709            "math",
10710            VOption::new()
10711                .set("in", self)
10712                .set(
10713                    "out",
10714                    &mut out_out,
10715                )
10716                .set(
10717                    "math",
10718                    math as i32,
10719                ),
10720        );
10721
10722        utils::result(
10723            vips_op_response,
10724            out_out,
10725            Error::OperationError("Math (vips_math) failed".to_string()),
10726        )
10727    }
10728
10729    /// VipsForeignLoadMat (matload), load mat from file (.mat), priority=0, untrusted, is_a, get_flags, get_flags_filename, header, load
10730    /// returns `VipsImage` - Output image
10731    ///
10732    /// filename: `&str` -> Filename to load from
10733    pub fn matload(filename: &str) -> Result<VipsImage> {
10734        let mut out_out = VipsImage::from(null_mut());
10735        let vips_op_response = call(
10736            "matload",
10737            VOption::new()
10738                .set(
10739                    "filename",
10740                    filename,
10741                )
10742                .set(
10743                    "out",
10744                    &mut out_out,
10745                ),
10746        );
10747
10748        utils::result(
10749            vips_op_response,
10750            out_out,
10751            Error::OperationError("Matload (vips_matload) failed".to_string()),
10752        )
10753    }
10754
10755    /// VipsForeignLoadMat (matload), load mat from file (.mat), priority=0, untrusted, is_a, get_flags, get_flags_filename, header, load
10756    /// returns `VipsImage` - Output image
10757    ///
10758    /// filename: `&str` -> Filename to load from
10759    ///
10760    /// <ins>Optional arguments</ins>
10761    ///
10762    /// flags: [`ForeignFlags`] -> Flags for this file
10763    ///
10764    /// memory: `bool` -> Force open via memory
10765    ///
10766    /// access: [`Access`] -> Required access pattern for this file
10767    ///
10768    /// fail_on: [`FailOn`] -> Error level to fail on
10769    ///
10770    /// revalidate: `bool` -> Don't use a cached result for this operation
10771    pub fn matload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
10772        let mut out_out = VipsImage::from(null_mut());
10773        let vips_op_response = call(
10774            "matload",
10775            option
10776                .set(
10777                    "filename",
10778                    filename,
10779                )
10780                .set(
10781                    "out",
10782                    &mut out_out,
10783                ),
10784        );
10785
10786        utils::result(
10787            vips_op_response,
10788            out_out,
10789            Error::OperationError("Matload (vips_matload) failed".to_string()),
10790        )
10791    }
10792
10793    /// VipsMatrixinvert (matrixinvert), invert a matrix
10794    /// returns `VipsImage` - Output matrix
10795    pub fn matrixinvert(&self) -> Result<VipsImage> {
10796        let mut out_out = VipsImage::from(null_mut());
10797        let vips_op_response = call(
10798            "matrixinvert",
10799            VOption::new()
10800                .set("in", self)
10801                .set(
10802                    "out",
10803                    &mut out_out,
10804                ),
10805        );
10806
10807        utils::result(
10808            vips_op_response,
10809            out_out,
10810            Error::OperationError("Matrixinvert (vips_matrixinvert) failed".to_string()),
10811        )
10812    }
10813
10814    /// VipsForeignLoadMatrixFile (matrixload), load matrix (.mat), priority=0, is_a, get_flags, get_flags_filename, header, load
10815    /// returns `VipsImage` - Output image
10816    ///
10817    /// filename: `&str` -> Filename to load from
10818    pub fn matrixload(filename: &str) -> Result<VipsImage> {
10819        let mut out_out = VipsImage::from(null_mut());
10820        let vips_op_response = call(
10821            "matrixload",
10822            VOption::new()
10823                .set(
10824                    "filename",
10825                    filename,
10826                )
10827                .set(
10828                    "out",
10829                    &mut out_out,
10830                ),
10831        );
10832
10833        utils::result(
10834            vips_op_response,
10835            out_out,
10836            Error::OperationError("Matrixload (vips_matrixload) failed".to_string()),
10837        )
10838    }
10839
10840    /// VipsForeignLoadMatrixFile (matrixload), load matrix (.mat), priority=0, is_a, get_flags, get_flags_filename, header, load
10841    /// returns `VipsImage` - Output image
10842    ///
10843    /// filename: `&str` -> Filename to load from
10844    ///
10845    /// <ins>Optional arguments</ins>
10846    ///
10847    /// flags: [`ForeignFlags`] -> Flags for this file
10848    ///
10849    /// memory: `bool` -> Force open via memory
10850    ///
10851    /// access: [`Access`] -> Required access pattern for this file
10852    ///
10853    /// fail_on: [`FailOn`] -> Error level to fail on
10854    ///
10855    /// revalidate: `bool` -> Don't use a cached result for this operation
10856    pub fn matrixload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
10857        let mut out_out = VipsImage::from(null_mut());
10858        let vips_op_response = call(
10859            "matrixload",
10860            option
10861                .set(
10862                    "filename",
10863                    filename,
10864                )
10865                .set(
10866                    "out",
10867                    &mut out_out,
10868                ),
10869        );
10870
10871        utils::result(
10872            vips_op_response,
10873            out_out,
10874            Error::OperationError("Matrixload (vips_matrixload) failed".to_string()),
10875        )
10876    }
10877
10878    /// VipsForeignLoadMatrixSource (matrixload_source), load matrix, priority=0, is_a_source, get_flags, header, load
10879    /// returns `VipsImage` - Output image
10880    ///
10881    /// source: `&VipsSource` -> Source to load from
10882    pub fn matrixload_source(source: &VipsSource) -> Result<VipsImage> {
10883        let mut out_out = VipsImage::from(null_mut());
10884        let vips_op_response = call(
10885            "matrixload_source",
10886            VOption::new()
10887                .set(
10888                    "source",
10889                    source,
10890                )
10891                .set(
10892                    "out",
10893                    &mut out_out,
10894                ),
10895        );
10896
10897        utils::result(
10898            vips_op_response,
10899            out_out,
10900            Error::OperationError("MatrixloadSource (vips_matrixload_source) failed".to_string()),
10901        )
10902    }
10903
10904    /// VipsForeignLoadMatrixSource (matrixload_source), load matrix, priority=0, is_a_source, get_flags, header, load
10905    /// returns `VipsImage` - Output image
10906    ///
10907    /// source: `&VipsSource` -> Source to load from
10908    ///
10909    /// <ins>Optional arguments</ins>
10910    ///
10911    /// flags: [`ForeignFlags`] -> Flags for this file
10912    ///
10913    /// memory: `bool` -> Force open via memory
10914    ///
10915    /// access: [`Access`] -> Required access pattern for this file
10916    ///
10917    /// fail_on: [`FailOn`] -> Error level to fail on
10918    ///
10919    /// revalidate: `bool` -> Don't use a cached result for this operation
10920    pub fn matrixload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
10921        let mut out_out = VipsImage::from(null_mut());
10922        let vips_op_response = call(
10923            "matrixload_source",
10924            option
10925                .set(
10926                    "source",
10927                    source,
10928                )
10929                .set(
10930                    "out",
10931                    &mut out_out,
10932                ),
10933        );
10934
10935        utils::result(
10936            vips_op_response,
10937            out_out,
10938            Error::OperationError("MatrixloadSource (vips_matrixload_source) failed".to_string()),
10939        )
10940    }
10941
10942    /// VipsMatrixmultiply (matrixmultiply), multiply two matrices
10943    /// returns `VipsImage` - Output matrix
10944    ///
10945    /// right: `&VipsImage` -> Second matrix to multiply
10946    pub fn matrixmultiply(&self, right: &VipsImage) -> Result<VipsImage> {
10947        let mut out_out = VipsImage::from(null_mut());
10948        let vips_op_response = call(
10949            "matrixmultiply",
10950            VOption::new()
10951                .set(
10952                    "left",
10953                    self,
10954                )
10955                .set(
10956                    "right",
10957                    right,
10958                )
10959                .set(
10960                    "out",
10961                    &mut out_out,
10962                ),
10963        );
10964
10965        utils::result(
10966            vips_op_response,
10967            out_out,
10968            Error::OperationError("Matrixmultiply (vips_matrixmultiply) failed".to_string()),
10969        )
10970    }
10971
10972    /// VipsForeignPrintMatrix (matrixprint), print matrix (.mat), priority=0, mono
10973    pub fn matrixprint(&self) -> Result<()> {
10974        let vips_op_response = call(
10975            "matrixprint",
10976            VOption::new().set("in", self),
10977        );
10978
10979        utils::result(
10980            vips_op_response,
10981            (),
10982            Error::OperationError("Matrixprint (vips_matrixprint) failed".to_string()),
10983        )
10984    }
10985
10986    /// VipsForeignPrintMatrix (matrixprint), print matrix (.mat), priority=0, mono
10987    ///
10988    /// <ins>Optional arguments</ins>
10989    ///
10990    /// keep: [`ForeignKeep`] -> Which metadata to retain
10991    ///
10992    /// background: `&[f64]` -> Background value
10993    ///
10994    /// page_height: `i32` -> Set page height for multipage save
10995    ///
10996    /// profile: `&str` -> Filename of ICC profile to embed
10997    pub fn matrixprint_with_opts(&self, option: VOption) -> Result<()> {
10998        let vips_op_response = call(
10999            "matrixprint",
11000            option.set("in", self),
11001        );
11002
11003        utils::result(
11004            vips_op_response,
11005            (),
11006            Error::OperationError("Matrixprint (vips_matrixprint) failed".to_string()),
11007        )
11008    }
11009
11010    /// VipsForeignSaveMatrixFile (matrixsave), save image to matrix (.mat), priority=0, mono
11011    ///
11012    /// filename: `&str` -> Filename to save to
11013    pub fn matrixsave(&self, filename: &str) -> Result<()> {
11014        let vips_op_response = call(
11015            "matrixsave",
11016            VOption::new()
11017                .set("in", self)
11018                .set(
11019                    "filename",
11020                    filename,
11021                ),
11022        );
11023
11024        utils::result(
11025            vips_op_response,
11026            (),
11027            Error::OperationError("Matrixsave (vips_matrixsave) failed".to_string()),
11028        )
11029    }
11030
11031    /// VipsForeignSaveMatrixFile (matrixsave), save image to matrix (.mat), priority=0, mono
11032    ///
11033    /// filename: `&str` -> Filename to save to
11034    ///
11035    /// <ins>Optional arguments</ins>
11036    ///
11037    /// keep: [`ForeignKeep`] -> Which metadata to retain
11038    ///
11039    /// background: `&[f64]` -> Background value
11040    ///
11041    /// page_height: `i32` -> Set page height for multipage save
11042    ///
11043    /// profile: `&str` -> Filename of ICC profile to embed
11044    pub fn matrixsave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
11045        let vips_op_response = call(
11046            "matrixsave",
11047            option
11048                .set("in", self)
11049                .set(
11050                    "filename",
11051                    filename,
11052                ),
11053        );
11054
11055        utils::result(
11056            vips_op_response,
11057            (),
11058            Error::OperationError("Matrixsave (vips_matrixsave) failed".to_string()),
11059        )
11060    }
11061
11062    /// VipsForeignSaveMatrixTarget (matrixsave_target), save image to matrix (.mat), priority=0, mono
11063    ///
11064    /// target: `&VipsTarget` -> Target to save to
11065    pub fn matrixsave_target(&self, target: &VipsTarget) -> Result<()> {
11066        let vips_op_response = call(
11067            "matrixsave_target",
11068            VOption::new()
11069                .set("in", self)
11070                .set(
11071                    "target",
11072                    target,
11073                ),
11074        );
11075
11076        utils::result(
11077            vips_op_response,
11078            (),
11079            Error::OperationError("MatrixsaveTarget (vips_matrixsave_target) failed".to_string()),
11080        )
11081    }
11082
11083    /// VipsForeignSaveMatrixTarget (matrixsave_target), save image to matrix (.mat), priority=0, mono
11084    ///
11085    /// target: `&VipsTarget` -> Target to save to
11086    ///
11087    /// <ins>Optional arguments</ins>
11088    ///
11089    /// keep: [`ForeignKeep`] -> Which metadata to retain
11090    ///
11091    /// background: `&[f64]` -> Background value
11092    ///
11093    /// page_height: `i32` -> Set page height for multipage save
11094    ///
11095    /// profile: `&str` -> Filename of ICC profile to embed
11096    pub fn matrixsave_target_with_opts(&self, target: &VipsTarget, option: VOption) -> Result<()> {
11097        let vips_op_response = call(
11098            "matrixsave_target",
11099            option
11100                .set("in", self)
11101                .set(
11102                    "target",
11103                    target,
11104                ),
11105        );
11106
11107        utils::result(
11108            vips_op_response,
11109            (),
11110            Error::OperationError("MatrixsaveTarget (vips_matrixsave_target) failed".to_string()),
11111        )
11112    }
11113
11114    /// VipsMax (max), find image maximum
11115    /// returns `f64` - Output value
11116    pub fn max(&self) -> Result<f64> {
11117        let mut out_out: f64 = 0.0;
11118        let vips_op_response = call(
11119            "max",
11120            VOption::new()
11121                .set("in", self)
11122                .set(
11123                    "out",
11124                    &mut out_out,
11125                ),
11126        );
11127
11128        utils::result(
11129            vips_op_response,
11130            out_out,
11131            Error::OperationError("Max (vips_max) failed".to_string()),
11132        )
11133    }
11134
11135    /// VipsMax (max), find image maximum
11136    /// returns `f64` - Output value
11137    ///
11138    /// <ins>Optional arguments</ins>
11139    ///
11140    /// x: `&mut i32` -> Horizontal position of maximum
11141    ///
11142    /// y: `&mut i32` -> Vertical position of maximum
11143    ///
11144    /// size: `i32` -> Number of maximum values to find
11145    ///
11146    /// out_array: `&mut Vec<f64>` -> Array of output values
11147    ///
11148    /// x_array: `&[i32]` -> Array of horizontal positions
11149    ///
11150    /// y_array: `&[i32]` -> Array of vertical positions
11151    pub fn max_with_opts(&self, option: VOption) -> Result<f64> {
11152        let mut out_out: f64 = 0.0;
11153        let vips_op_response = call(
11154            "max",
11155            option
11156                .set("in", self)
11157                .set(
11158                    "out",
11159                    &mut out_out,
11160                ),
11161        );
11162
11163        utils::result(
11164            vips_op_response,
11165            out_out,
11166            Error::OperationError("Max (vips_max) failed".to_string()),
11167        )
11168    }
11169
11170    /// VipsMaxpair (maxpair), maximum of a pair of images
11171    /// returns `VipsImage` - Output image
11172    ///
11173    /// right: `&VipsImage` -> Right-hand image argument
11174    pub fn maxpair(&self, right: &VipsImage) -> Result<VipsImage> {
11175        let mut out_out = VipsImage::from(null_mut());
11176        let vips_op_response = call(
11177            "maxpair",
11178            VOption::new()
11179                .set(
11180                    "left",
11181                    self,
11182                )
11183                .set(
11184                    "right",
11185                    right,
11186                )
11187                .set(
11188                    "out",
11189                    &mut out_out,
11190                ),
11191        );
11192
11193        utils::result(
11194            vips_op_response,
11195            out_out,
11196            Error::OperationError("Maxpair (vips_maxpair) failed".to_string()),
11197        )
11198    }
11199
11200    /// VipsMeasure (measure), measure a set of patches on a color chart
11201    /// returns `VipsImage` - Output array of statistics
11202    ///
11203    /// h: `i32` -> Number of patches across chart
11204    ///
11205    /// v: `i32` -> Number of patches down chart
11206    pub fn measure(&self, h: i32, v: i32) -> Result<VipsImage> {
11207        let mut out_out = VipsImage::from(null_mut());
11208        let vips_op_response = call(
11209            "measure",
11210            VOption::new()
11211                .set("in", self)
11212                .set(
11213                    "out",
11214                    &mut out_out,
11215                )
11216                .set("h", h)
11217                .set("v", v),
11218        );
11219
11220        utils::result(
11221            vips_op_response,
11222            out_out,
11223            Error::OperationError("Measure (vips_measure) failed".to_string()),
11224        )
11225    }
11226
11227    /// VipsMeasure (measure), measure a set of patches on a color chart
11228    /// returns `VipsImage` - Output array of statistics
11229    ///
11230    /// h: `i32` -> Number of patches across chart
11231    ///
11232    /// v: `i32` -> Number of patches down chart
11233    ///
11234    /// <ins>Optional arguments</ins>
11235    ///
11236    /// left: `i32` -> Left edge of extract area
11237    ///
11238    /// top: `i32` -> Top edge of extract area
11239    ///
11240    /// width: `i32` -> Width of extract area
11241    ///
11242    /// height: `i32` -> Height of extract area
11243    pub fn measure_with_opts(&self, h: i32, v: i32, option: VOption) -> Result<VipsImage> {
11244        let mut out_out = VipsImage::from(null_mut());
11245        let vips_op_response = call(
11246            "measure",
11247            option
11248                .set("in", self)
11249                .set(
11250                    "out",
11251                    &mut out_out,
11252                )
11253                .set("h", h)
11254                .set("v", v),
11255        );
11256
11257        utils::result(
11258            vips_op_response,
11259            out_out,
11260            Error::OperationError("Measure (vips_measure) failed".to_string()),
11261        )
11262    }
11263
11264    /// VipsMerge (merge), merge two images
11265    /// returns `VipsImage` - Output image
11266    ///
11267    /// sec: `&VipsImage` -> Secondary image
11268    ///
11269    /// direction: `Direction` -> Horizontal or vertical merge
11270    ///
11271    /// dx: `i32` -> Horizontal displacement from sec to ref
11272    ///
11273    /// dy: `i32` -> Vertical displacement from sec to ref
11274    pub fn merge(
11275        &self,
11276        sec: &VipsImage,
11277        direction: Direction,
11278        dx: i32,
11279        dy: i32,
11280    ) -> Result<VipsImage> {
11281        let mut out_out = VipsImage::from(null_mut());
11282        let vips_op_response = call(
11283            "merge",
11284            VOption::new()
11285                .set(
11286                    "ref", self,
11287                )
11288                .set("sec", sec)
11289                .set(
11290                    "out",
11291                    &mut out_out,
11292                )
11293                .set(
11294                    "direction",
11295                    direction as i32,
11296                )
11297                .set("dx", dx)
11298                .set("dy", dy),
11299        );
11300
11301        utils::result(
11302            vips_op_response,
11303            out_out,
11304            Error::OperationError("Merge (vips_merge) failed".to_string()),
11305        )
11306    }
11307
11308    /// VipsMerge (merge), merge two images
11309    /// returns `VipsImage` - Output image
11310    ///
11311    /// sec: `&VipsImage` -> Secondary image
11312    ///
11313    /// direction: `Direction` -> Horizontal or vertical merge
11314    ///
11315    /// dx: `i32` -> Horizontal displacement from sec to ref
11316    ///
11317    /// dy: `i32` -> Vertical displacement from sec to ref
11318    ///
11319    /// <ins>Optional arguments</ins>
11320    ///
11321    /// mblend: `i32` -> Maximum blend size
11322    pub fn merge_with_opts(
11323        &self,
11324        sec: &VipsImage,
11325        direction: Direction,
11326        dx: i32,
11327        dy: i32,
11328        option: VOption,
11329    ) -> Result<VipsImage> {
11330        let mut out_out = VipsImage::from(null_mut());
11331        let vips_op_response = call(
11332            "merge",
11333            option
11334                .set(
11335                    "ref", self,
11336                )
11337                .set("sec", sec)
11338                .set(
11339                    "out",
11340                    &mut out_out,
11341                )
11342                .set(
11343                    "direction",
11344                    direction as i32,
11345                )
11346                .set("dx", dx)
11347                .set("dy", dy),
11348        );
11349
11350        utils::result(
11351            vips_op_response,
11352            out_out,
11353            Error::OperationError("Merge (vips_merge) failed".to_string()),
11354        )
11355    }
11356
11357    /// VipsMin (min), find image minimum
11358    /// returns `f64` - Output value
11359    pub fn min(&self) -> Result<f64> {
11360        let mut out_out: f64 = 0.0;
11361        let vips_op_response = call(
11362            "min",
11363            VOption::new()
11364                .set("in", self)
11365                .set(
11366                    "out",
11367                    &mut out_out,
11368                ),
11369        );
11370
11371        utils::result(
11372            vips_op_response,
11373            out_out,
11374            Error::OperationError("Min (vips_min) failed".to_string()),
11375        )
11376    }
11377
11378    /// VipsMin (min), find image minimum
11379    /// returns `f64` - Output value
11380    ///
11381    /// <ins>Optional arguments</ins>
11382    ///
11383    /// x: `&mut i32` -> Horizontal position of minimum
11384    ///
11385    /// y: `&mut i32` -> Vertical position of minimum
11386    ///
11387    /// size: `i32` -> Number of minimum values to find
11388    ///
11389    /// out_array: `&mut Vec<f64>` -> Array of output values
11390    ///
11391    /// x_array: `&[i32]` -> Array of horizontal positions
11392    ///
11393    /// y_array: `&[i32]` -> Array of vertical positions
11394    pub fn min_with_opts(&self, option: VOption) -> Result<f64> {
11395        let mut out_out: f64 = 0.0;
11396        let vips_op_response = call(
11397            "min",
11398            option
11399                .set("in", self)
11400                .set(
11401                    "out",
11402                    &mut out_out,
11403                ),
11404        );
11405
11406        utils::result(
11407            vips_op_response,
11408            out_out,
11409            Error::OperationError("Min (vips_min) failed".to_string()),
11410        )
11411    }
11412
11413    /// VipsMinpair (minpair), minimum of a pair of images
11414    /// returns `VipsImage` - Output image
11415    ///
11416    /// right: `&VipsImage` -> Right-hand image argument
11417    pub fn minpair(&self, right: &VipsImage) -> Result<VipsImage> {
11418        let mut out_out = VipsImage::from(null_mut());
11419        let vips_op_response = call(
11420            "minpair",
11421            VOption::new()
11422                .set(
11423                    "left",
11424                    self,
11425                )
11426                .set(
11427                    "right",
11428                    right,
11429                )
11430                .set(
11431                    "out",
11432                    &mut out_out,
11433                ),
11434        );
11435
11436        utils::result(
11437            vips_op_response,
11438            out_out,
11439            Error::OperationError("Minpair (vips_minpair) failed".to_string()),
11440        )
11441    }
11442
11443    /// VipsMorph (morph), morphology operation
11444    /// returns `VipsImage` - Output image
11445    ///
11446    /// mask: `&VipsImage` -> Input matrix image
11447    ///
11448    /// morph: `OperationMorphology` -> Morphological operation to perform
11449    pub fn morph(&self, mask: &VipsImage, morph: OperationMorphology) -> Result<VipsImage> {
11450        let mut out_out = VipsImage::from(null_mut());
11451        let vips_op_response = call(
11452            "morph",
11453            VOption::new()
11454                .set("in", self)
11455                .set(
11456                    "out",
11457                    &mut out_out,
11458                )
11459                .set(
11460                    "mask",
11461                    mask,
11462                )
11463                .set(
11464                    "morph",
11465                    morph as i32,
11466                ),
11467        );
11468
11469        utils::result(
11470            vips_op_response,
11471            out_out,
11472            Error::OperationError("Morph (vips_morph) failed".to_string()),
11473        )
11474    }
11475
11476    /// VipsMosaic1 (mosaic1), first-order mosaic of two images
11477    /// returns `VipsImage` - Output image
11478    ///
11479    /// sec: `&VipsImage` -> Secondary image
11480    ///
11481    /// direction: `Direction` -> Horizontal or vertical mosaic
11482    ///
11483    /// xr1: `i32` -> Position of first reference tie-point
11484    ///
11485    /// yr1: `i32` -> Position of first reference tie-point
11486    ///
11487    /// xs1: `i32` -> Position of first secondary tie-point
11488    ///
11489    /// ys1: `i32` -> Position of first secondary tie-point
11490    ///
11491    /// xr2: `i32` -> Position of second reference tie-point
11492    ///
11493    /// yr2: `i32` -> Position of second reference tie-point
11494    ///
11495    /// xs2: `i32` -> Position of second secondary tie-point
11496    ///
11497    /// ys2: `i32` -> Position of second secondary tie-point
11498    pub fn mosaic1(
11499        &self,
11500        sec: &VipsImage,
11501        direction: Direction,
11502        xr1: i32,
11503        yr1: i32,
11504        xs1: i32,
11505        ys1: i32,
11506        xr2: i32,
11507        yr2: i32,
11508        xs2: i32,
11509        ys2: i32,
11510    ) -> Result<VipsImage> {
11511        let mut out_out = VipsImage::from(null_mut());
11512        let vips_op_response = call(
11513            "mosaic1",
11514            VOption::new()
11515                .set(
11516                    "ref", self,
11517                )
11518                .set("sec", sec)
11519                .set(
11520                    "out",
11521                    &mut out_out,
11522                )
11523                .set(
11524                    "direction",
11525                    direction as i32,
11526                )
11527                .set("xr1", xr1)
11528                .set("yr1", yr1)
11529                .set("xs1", xs1)
11530                .set("ys1", ys1)
11531                .set("xr2", xr2)
11532                .set("yr2", yr2)
11533                .set("xs2", xs2)
11534                .set("ys2", ys2),
11535        );
11536
11537        utils::result(
11538            vips_op_response,
11539            out_out,
11540            Error::OperationError("Mosaic1 (vips_mosaic1) failed".to_string()),
11541        )
11542    }
11543
11544    /// VipsMosaic1 (mosaic1), first-order mosaic of two images
11545    /// returns `VipsImage` - Output image
11546    ///
11547    /// sec: `&VipsImage` -> Secondary image
11548    ///
11549    /// direction: `Direction` -> Horizontal or vertical mosaic
11550    ///
11551    /// xr1: `i32` -> Position of first reference tie-point
11552    ///
11553    /// yr1: `i32` -> Position of first reference tie-point
11554    ///
11555    /// xs1: `i32` -> Position of first secondary tie-point
11556    ///
11557    /// ys1: `i32` -> Position of first secondary tie-point
11558    ///
11559    /// xr2: `i32` -> Position of second reference tie-point
11560    ///
11561    /// yr2: `i32` -> Position of second reference tie-point
11562    ///
11563    /// xs2: `i32` -> Position of second secondary tie-point
11564    ///
11565    /// ys2: `i32` -> Position of second secondary tie-point
11566    ///
11567    /// <ins>Optional arguments</ins>
11568    ///
11569    /// hwindow: `i32` -> Half window size
11570    ///
11571    /// harea: `i32` -> Half area size
11572    ///
11573    /// search: `bool` -> Search to improve tie-points
11574    ///
11575    /// interpolate: `&VipsInterpolate` -> Interpolate pixels with this
11576    ///
11577    /// mblend: `i32` -> Maximum blend size
11578    pub fn mosaic1_with_opts(
11579        &self,
11580        sec: &VipsImage,
11581        direction: Direction,
11582        xr1: i32,
11583        yr1: i32,
11584        xs1: i32,
11585        ys1: i32,
11586        xr2: i32,
11587        yr2: i32,
11588        xs2: i32,
11589        ys2: i32,
11590        option: VOption,
11591    ) -> Result<VipsImage> {
11592        let mut out_out = VipsImage::from(null_mut());
11593        let vips_op_response = call(
11594            "mosaic1",
11595            option
11596                .set(
11597                    "ref", self,
11598                )
11599                .set("sec", sec)
11600                .set(
11601                    "out",
11602                    &mut out_out,
11603                )
11604                .set(
11605                    "direction",
11606                    direction as i32,
11607                )
11608                .set("xr1", xr1)
11609                .set("yr1", yr1)
11610                .set("xs1", xs1)
11611                .set("ys1", ys1)
11612                .set("xr2", xr2)
11613                .set("yr2", yr2)
11614                .set("xs2", xs2)
11615                .set("ys2", ys2),
11616        );
11617
11618        utils::result(
11619            vips_op_response,
11620            out_out,
11621            Error::OperationError("Mosaic1 (vips_mosaic1) failed".to_string()),
11622        )
11623    }
11624
11625    /// VipsMosaic (mosaic), mosaic two images
11626    /// returns `VipsImage` - Output image
11627    ///
11628    /// sec: `&VipsImage` -> Secondary image
11629    ///
11630    /// direction: `Direction` -> Horizontal or vertical mosaic
11631    ///
11632    /// xref: `i32` -> Position of reference tie-point
11633    ///
11634    /// yref: `i32` -> Position of reference tie-point
11635    ///
11636    /// xsec: `i32` -> Position of secondary tie-point
11637    ///
11638    /// ysec: `i32` -> Position of secondary tie-point
11639    pub fn mosaic(
11640        &self,
11641        sec: &VipsImage,
11642        direction: Direction,
11643        xref: i32,
11644        yref: i32,
11645        xsec: i32,
11646        ysec: i32,
11647    ) -> Result<VipsImage> {
11648        let mut out_out = VipsImage::from(null_mut());
11649        let vips_op_response = call(
11650            "mosaic",
11651            VOption::new()
11652                .set(
11653                    "ref", self,
11654                )
11655                .set("sec", sec)
11656                .set(
11657                    "out",
11658                    &mut out_out,
11659                )
11660                .set(
11661                    "direction",
11662                    direction as i32,
11663                )
11664                .set(
11665                    "xref",
11666                    xref,
11667                )
11668                .set(
11669                    "yref",
11670                    yref,
11671                )
11672                .set(
11673                    "xsec",
11674                    xsec,
11675                )
11676                .set(
11677                    "ysec",
11678                    ysec,
11679                ),
11680        );
11681
11682        utils::result(
11683            vips_op_response,
11684            out_out,
11685            Error::OperationError("Mosaic (vips_mosaic) failed".to_string()),
11686        )
11687    }
11688
11689    /// VipsMosaic (mosaic), mosaic two images
11690    /// returns `VipsImage` - Output image
11691    ///
11692    /// sec: `&VipsImage` -> Secondary image
11693    ///
11694    /// direction: `Direction` -> Horizontal or vertical mosaic
11695    ///
11696    /// xref: `i32` -> Position of reference tie-point
11697    ///
11698    /// yref: `i32` -> Position of reference tie-point
11699    ///
11700    /// xsec: `i32` -> Position of secondary tie-point
11701    ///
11702    /// ysec: `i32` -> Position of secondary tie-point
11703    ///
11704    /// <ins>Optional arguments</ins>
11705    ///
11706    /// hwindow: `i32` -> Half window size
11707    ///
11708    /// harea: `i32` -> Half area size
11709    ///
11710    /// mblend: `i32` -> Maximum blend size
11711    ///
11712    /// bandno: `i32` -> Band to search for features on
11713    ///
11714    /// dx0: `&mut i32` -> Detected integer offset
11715    ///
11716    /// dy0: `&mut i32` -> Detected integer offset
11717    ///
11718    /// scale1: `&mut f64` -> Detected scale
11719    ///
11720    /// angle1: `&mut f64` -> Detected rotation
11721    ///
11722    /// dy1: `&mut f64` -> Detected first-order displacement
11723    ///
11724    /// dx1: `&mut f64` -> Detected first-order displacement
11725    pub fn mosaic_with_opts(
11726        &self,
11727        sec: &VipsImage,
11728        direction: Direction,
11729        xref: i32,
11730        yref: i32,
11731        xsec: i32,
11732        ysec: i32,
11733        option: VOption,
11734    ) -> Result<VipsImage> {
11735        let mut out_out = VipsImage::from(null_mut());
11736        let vips_op_response = call(
11737            "mosaic",
11738            option
11739                .set(
11740                    "ref", self,
11741                )
11742                .set("sec", sec)
11743                .set(
11744                    "out",
11745                    &mut out_out,
11746                )
11747                .set(
11748                    "direction",
11749                    direction as i32,
11750                )
11751                .set(
11752                    "xref",
11753                    xref,
11754                )
11755                .set(
11756                    "yref",
11757                    yref,
11758                )
11759                .set(
11760                    "xsec",
11761                    xsec,
11762                )
11763                .set(
11764                    "ysec",
11765                    ysec,
11766                ),
11767        );
11768
11769        utils::result(
11770            vips_op_response,
11771            out_out,
11772            Error::OperationError("Mosaic (vips_mosaic) failed".to_string()),
11773        )
11774    }
11775
11776    /// VipsMsb (msb), pick most-significant byte from an image
11777    /// returns `VipsImage` - Output image
11778    pub fn msb(&self) -> Result<VipsImage> {
11779        let mut out_out = VipsImage::from(null_mut());
11780        let vips_op_response = call(
11781            "msb",
11782            VOption::new()
11783                .set("in", self)
11784                .set(
11785                    "out",
11786                    &mut out_out,
11787                ),
11788        );
11789
11790        utils::result(
11791            vips_op_response,
11792            out_out,
11793            Error::OperationError("Msb (vips_msb) failed".to_string()),
11794        )
11795    }
11796
11797    /// VipsMsb (msb), pick most-significant byte from an image
11798    /// returns `VipsImage` - Output image
11799    ///
11800    /// <ins>Optional arguments</ins>
11801    ///
11802    /// band: `i32` -> Band to msb
11803    pub fn msb_with_opts(&self, option: VOption) -> Result<VipsImage> {
11804        let mut out_out = VipsImage::from(null_mut());
11805        let vips_op_response = call(
11806            "msb",
11807            option
11808                .set("in", self)
11809                .set(
11810                    "out",
11811                    &mut out_out,
11812                ),
11813        );
11814
11815        utils::result(
11816            vips_op_response,
11817            out_out,
11818            Error::OperationError("Msb (vips_msb) failed".to_string()),
11819        )
11820    }
11821
11822    /// VipsMultiply (multiply), multiply two images
11823    /// returns `VipsImage` - Output image
11824    ///
11825    /// right: `&VipsImage` -> Right-hand image argument
11826    pub fn multiply(&self, right: &VipsImage) -> Result<VipsImage> {
11827        let mut out_out = VipsImage::from(null_mut());
11828        let vips_op_response = call(
11829            "multiply",
11830            VOption::new()
11831                .set(
11832                    "left",
11833                    self,
11834                )
11835                .set(
11836                    "right",
11837                    right,
11838                )
11839                .set(
11840                    "out",
11841                    &mut out_out,
11842                ),
11843        );
11844
11845        utils::result(
11846            vips_op_response,
11847            out_out,
11848            Error::OperationError("Multiply (vips_multiply) failed".to_string()),
11849        )
11850    }
11851
11852    /// VipsForeignLoadOpenexr (openexrload), load an OpenEXR image (.exr), priority=200, untrusted, is_a, get_flags, get_flags_filename, header, load
11853    /// returns `VipsImage` - Output image
11854    ///
11855    /// filename: `&str` -> Filename to load from
11856    pub fn openexrload(filename: &str) -> Result<VipsImage> {
11857        let mut out_out = VipsImage::from(null_mut());
11858        let vips_op_response = call(
11859            "openexrload",
11860            VOption::new()
11861                .set(
11862                    "filename",
11863                    filename,
11864                )
11865                .set(
11866                    "out",
11867                    &mut out_out,
11868                ),
11869        );
11870
11871        utils::result(
11872            vips_op_response,
11873            out_out,
11874            Error::OperationError("Openexrload (vips_openexrload) failed".to_string()),
11875        )
11876    }
11877
11878    /// VipsForeignLoadOpenexr (openexrload), load an OpenEXR image (.exr), priority=200, untrusted, is_a, get_flags, get_flags_filename, header, load
11879    /// returns `VipsImage` - Output image
11880    ///
11881    /// filename: `&str` -> Filename to load from
11882    ///
11883    /// <ins>Optional arguments</ins>
11884    ///
11885    /// flags: [`ForeignFlags`] -> Flags for this file
11886    ///
11887    /// memory: `bool` -> Force open via memory
11888    ///
11889    /// access: [`Access`] -> Required access pattern for this file
11890    ///
11891    /// fail_on: [`FailOn`] -> Error level to fail on
11892    ///
11893    /// revalidate: `bool` -> Don't use a cached result for this operation
11894    pub fn openexrload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
11895        let mut out_out = VipsImage::from(null_mut());
11896        let vips_op_response = call(
11897            "openexrload",
11898            option
11899                .set(
11900                    "filename",
11901                    filename,
11902                )
11903                .set(
11904                    "out",
11905                    &mut out_out,
11906                ),
11907        );
11908
11909        utils::result(
11910            vips_op_response,
11911            out_out,
11912            Error::OperationError("Openexrload (vips_openexrload) failed".to_string()),
11913        )
11914    }
11915
11916    /// 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
11917    /// returns `VipsImage` - Output image
11918    ///
11919    /// filename: `&str` -> Filename to load from
11920    pub fn openslideload(filename: &str) -> Result<VipsImage> {
11921        let mut out_out = VipsImage::from(null_mut());
11922        let vips_op_response = call(
11923            "openslideload",
11924            VOption::new()
11925                .set(
11926                    "filename",
11927                    filename,
11928                )
11929                .set(
11930                    "out",
11931                    &mut out_out,
11932                ),
11933        );
11934
11935        utils::result(
11936            vips_op_response,
11937            out_out,
11938            Error::OperationError("Openslideload (vips_openslideload) failed".to_string()),
11939        )
11940    }
11941
11942    /// 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
11943    /// returns `VipsImage` - Output image
11944    ///
11945    /// filename: `&str` -> Filename to load from
11946    ///
11947    /// <ins>Optional arguments</ins>
11948    ///
11949    /// level: `i32` -> Load this level from the file
11950    ///
11951    /// autocrop: `bool` -> Crop to image bounds
11952    ///
11953    /// associated: `&str` -> Load this associated image
11954    ///
11955    /// attach_associated: `bool` -> Attach all associated images
11956    ///
11957    /// rgb: `bool` -> Output RGB (not RGBA)
11958    ///
11959    /// flags: [`ForeignFlags`] -> Flags for this file
11960    ///
11961    /// memory: `bool` -> Force open via memory
11962    ///
11963    /// access: [`Access`] -> Required access pattern for this file
11964    ///
11965    /// fail_on: [`FailOn`] -> Error level to fail on
11966    ///
11967    /// revalidate: `bool` -> Don't use a cached result for this operation
11968    pub fn openslideload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
11969        let mut out_out = VipsImage::from(null_mut());
11970        let vips_op_response = call(
11971            "openslideload",
11972            option
11973                .set(
11974                    "filename",
11975                    filename,
11976                )
11977                .set(
11978                    "out",
11979                    &mut out_out,
11980                ),
11981        );
11982
11983        utils::result(
11984            vips_op_response,
11985            out_out,
11986            Error::OperationError("Openslideload (vips_openslideload) failed".to_string()),
11987        )
11988    }
11989
11990    /// VipsForeignLoadOpenslideSource (openslideload_source), load source with OpenSlide, priority=100, untrusted, is_a_source, get_flags, get_flags_filename, header, load
11991    /// returns `VipsImage` - Output image
11992    ///
11993    /// source: `&VipsSource` -> Source to load from
11994    pub fn openslideload_source(source: &VipsSource) -> Result<VipsImage> {
11995        let mut out_out = VipsImage::from(null_mut());
11996        let vips_op_response = call(
11997            "openslideload_source",
11998            VOption::new()
11999                .set(
12000                    "source",
12001                    source,
12002                )
12003                .set(
12004                    "out",
12005                    &mut out_out,
12006                ),
12007        );
12008
12009        utils::result(
12010            vips_op_response,
12011            out_out,
12012            Error::OperationError(
12013                "OpenslideloadSource (vips_openslideload_source) failed".to_string(),
12014            ),
12015        )
12016    }
12017
12018    /// VipsForeignLoadOpenslideSource (openslideload_source), load source with OpenSlide, priority=100, untrusted, is_a_source, get_flags, get_flags_filename, header, load
12019    /// returns `VipsImage` - Output image
12020    ///
12021    /// source: `&VipsSource` -> Source to load from
12022    ///
12023    /// <ins>Optional arguments</ins>
12024    ///
12025    /// level: `i32` -> Load this level from the file
12026    ///
12027    /// autocrop: `bool` -> Crop to image bounds
12028    ///
12029    /// associated: `&str` -> Load this associated image
12030    ///
12031    /// attach_associated: `bool` -> Attach all associated images
12032    ///
12033    /// rgb: `bool` -> Output RGB (not RGBA)
12034    ///
12035    /// flags: [`ForeignFlags`] -> Flags for this file
12036    ///
12037    /// memory: `bool` -> Force open via memory
12038    ///
12039    /// access: [`Access`] -> Required access pattern for this file
12040    ///
12041    /// fail_on: [`FailOn`] -> Error level to fail on
12042    ///
12043    /// revalidate: `bool` -> Don't use a cached result for this operation
12044    pub fn openslideload_source_with_opts(
12045        source: &VipsSource,
12046        option: VOption,
12047    ) -> Result<VipsImage> {
12048        let mut out_out = VipsImage::from(null_mut());
12049        let vips_op_response = call(
12050            "openslideload_source",
12051            option
12052                .set(
12053                    "source",
12054                    source,
12055                )
12056                .set(
12057                    "out",
12058                    &mut out_out,
12059                ),
12060        );
12061
12062        utils::result(
12063            vips_op_response,
12064            out_out,
12065            Error::OperationError(
12066                "OpenslideloadSource (vips_openslideload_source) failed".to_string(),
12067            ),
12068        )
12069    }
12070
12071    /// VipsForeignLoadPdfFile (pdfload), load PDF from file (.pdf), priority=0, untrusted, is_a, get_flags, get_flags_filename, header, load
12072    /// returns `VipsImage` - Output image
12073    ///
12074    /// filename: `&str` -> Filename to load from
12075    pub fn pdfload(filename: &str) -> Result<VipsImage> {
12076        let mut out_out = VipsImage::from(null_mut());
12077        let vips_op_response = call(
12078            "pdfload",
12079            VOption::new()
12080                .set(
12081                    "filename",
12082                    filename,
12083                )
12084                .set(
12085                    "out",
12086                    &mut out_out,
12087                ),
12088        );
12089
12090        utils::result(
12091            vips_op_response,
12092            out_out,
12093            Error::OperationError("Pdfload (vips_pdfload) failed".to_string()),
12094        )
12095    }
12096
12097    /// VipsForeignLoadPdfFile (pdfload), load PDF from file (.pdf), priority=0, untrusted, is_a, get_flags, get_flags_filename, header, load
12098    /// returns `VipsImage` - Output image
12099    ///
12100    /// filename: `&str` -> Filename to load from
12101    ///
12102    /// <ins>Optional arguments</ins>
12103    ///
12104    /// page: `i32` -> First page to load
12105    ///
12106    /// n: `i32` -> Number of pages to load, -1 for all
12107    ///
12108    /// dpi: `f64` -> DPI to render at
12109    ///
12110    /// scale: `f64` -> Factor to scale by
12111    ///
12112    /// background: `&[f64]` -> Background colour
12113    ///
12114    /// password: `&str` -> Password to decrypt with
12115    ///
12116    /// flags: [`ForeignFlags`] -> Flags for this file
12117    ///
12118    /// memory: `bool` -> Force open via memory
12119    ///
12120    /// access: [`Access`] -> Required access pattern for this file
12121    ///
12122    /// fail_on: [`FailOn`] -> Error level to fail on
12123    ///
12124    /// revalidate: `bool` -> Don't use a cached result for this operation
12125    pub fn pdfload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
12126        let mut out_out = VipsImage::from(null_mut());
12127        let vips_op_response = call(
12128            "pdfload",
12129            option
12130                .set(
12131                    "filename",
12132                    filename,
12133                )
12134                .set(
12135                    "out",
12136                    &mut out_out,
12137                ),
12138        );
12139
12140        utils::result(
12141            vips_op_response,
12142            out_out,
12143            Error::OperationError("Pdfload (vips_pdfload) failed".to_string()),
12144        )
12145    }
12146
12147    /// VipsForeignLoadPdfBuffer (pdfload_buffer), load PDF from buffer, priority=0, untrusted, is_a_buffer, get_flags, get_flags_filename, header, load
12148    /// returns `VipsImage` - Output image
12149    ///
12150    /// buffer: `&[u8]` -> Buffer to load from
12151    pub fn pdfload_buffer(buffer: &[u8]) -> Result<VipsImage> {
12152        let blob = unsafe {
12153            vips_blob_new(
12154                None,
12155                buffer.as_ptr() as _,
12156                buffer.len() as _,
12157            )
12158        };
12159        let mut out_out = VipsImage::from(null_mut());
12160        let vips_op_response = call(
12161            "pdfload_buffer",
12162            VOption::new()
12163                .set(
12164                    "buffer",
12165                    &VipsBlob::from(blob),
12166                )
12167                .set(
12168                    "out",
12169                    &mut out_out,
12170                ),
12171        );
12172        unsafe { vips_area_unref(&mut (*blob).area) };
12173        utils::result(
12174            vips_op_response,
12175            out_out,
12176            Error::OperationError("PdfloadBuffer (vips_pdfload_buffer) failed".to_string()),
12177        )
12178    }
12179
12180    /// VipsForeignLoadPdfBuffer (pdfload_buffer), load PDF from buffer, priority=0, untrusted, is_a_buffer, get_flags, get_flags_filename, header, load
12181    /// returns `VipsImage` - Output image
12182    ///
12183    /// buffer: `&[u8]` -> Buffer to load from
12184    ///
12185    /// <ins>Optional arguments</ins>
12186    ///
12187    /// page: `i32` -> First page to load
12188    ///
12189    /// n: `i32` -> Number of pages to load, -1 for all
12190    ///
12191    /// dpi: `f64` -> DPI to render at
12192    ///
12193    /// scale: `f64` -> Factor to scale by
12194    ///
12195    /// background: `&[f64]` -> Background colour
12196    ///
12197    /// password: `&str` -> Password to decrypt with
12198    ///
12199    /// flags: [`ForeignFlags`] -> Flags for this file
12200    ///
12201    /// memory: `bool` -> Force open via memory
12202    ///
12203    /// access: [`Access`] -> Required access pattern for this file
12204    ///
12205    /// fail_on: [`FailOn`] -> Error level to fail on
12206    ///
12207    /// revalidate: `bool` -> Don't use a cached result for this operation
12208    pub fn pdfload_buffer_with_opts(buffer: &[u8], option: VOption) -> Result<VipsImage> {
12209        let blob = unsafe {
12210            vips_blob_new(
12211                None,
12212                buffer.as_ptr() as _,
12213                buffer.len() as _,
12214            )
12215        };
12216        let mut out_out = VipsImage::from(null_mut());
12217        let vips_op_response = call(
12218            "pdfload_buffer",
12219            option
12220                .set(
12221                    "buffer",
12222                    &VipsBlob::from(blob),
12223                )
12224                .set(
12225                    "out",
12226                    &mut out_out,
12227                ),
12228        );
12229        unsafe { vips_area_unref(&mut (*blob).area) };
12230        utils::result(
12231            vips_op_response,
12232            out_out,
12233            Error::OperationError("PdfloadBuffer (vips_pdfload_buffer) failed".to_string()),
12234        )
12235    }
12236
12237    /// VipsForeignLoadPdfSource (pdfload_source), load PDF from source, priority=0, untrusted, is_a_source, get_flags, get_flags_filename, header, load
12238    /// returns `VipsImage` - Output image
12239    ///
12240    /// source: `&VipsSource` -> Source to load from
12241    pub fn pdfload_source(source: &VipsSource) -> Result<VipsImage> {
12242        let mut out_out = VipsImage::from(null_mut());
12243        let vips_op_response = call(
12244            "pdfload_source",
12245            VOption::new()
12246                .set(
12247                    "source",
12248                    source,
12249                )
12250                .set(
12251                    "out",
12252                    &mut out_out,
12253                ),
12254        );
12255
12256        utils::result(
12257            vips_op_response,
12258            out_out,
12259            Error::OperationError("PdfloadSource (vips_pdfload_source) failed".to_string()),
12260        )
12261    }
12262
12263    /// VipsForeignLoadPdfSource (pdfload_source), load PDF from source, priority=0, untrusted, is_a_source, get_flags, get_flags_filename, header, load
12264    /// returns `VipsImage` - Output image
12265    ///
12266    /// source: `&VipsSource` -> Source to load from
12267    ///
12268    /// <ins>Optional arguments</ins>
12269    ///
12270    /// page: `i32` -> First page to load
12271    ///
12272    /// n: `i32` -> Number of pages to load, -1 for all
12273    ///
12274    /// dpi: `f64` -> DPI to render at
12275    ///
12276    /// scale: `f64` -> Factor to scale by
12277    ///
12278    /// background: `&[f64]` -> Background colour
12279    ///
12280    /// password: `&str` -> Password to decrypt with
12281    ///
12282    /// flags: [`ForeignFlags`] -> Flags for this file
12283    ///
12284    /// memory: `bool` -> Force open via memory
12285    ///
12286    /// access: [`Access`] -> Required access pattern for this file
12287    ///
12288    /// fail_on: [`FailOn`] -> Error level to fail on
12289    ///
12290    /// revalidate: `bool` -> Don't use a cached result for this operation
12291    pub fn pdfload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
12292        let mut out_out = VipsImage::from(null_mut());
12293        let vips_op_response = call(
12294            "pdfload_source",
12295            option
12296                .set(
12297                    "source",
12298                    source,
12299                )
12300                .set(
12301                    "out",
12302                    &mut out_out,
12303                ),
12304        );
12305
12306        utils::result(
12307            vips_op_response,
12308            out_out,
12309            Error::OperationError("PdfloadSource (vips_pdfload_source) failed".to_string()),
12310        )
12311    }
12312
12313    /// VipsPercent (percent), find threshold for percent of pixels
12314    /// returns `i32` - Threshold above which lie percent of pixels
12315    ///
12316    /// percent: `f64` -> Percent of pixels
12317    pub fn percent(&self, percent: f64) -> Result<i32> {
12318        let mut threshold_out: i32 = 0;
12319        let vips_op_response = call(
12320            "percent",
12321            VOption::new()
12322                .set("in", self)
12323                .set(
12324                    "percent",
12325                    percent,
12326                )
12327                .set(
12328                    "threshold",
12329                    &mut threshold_out,
12330                ),
12331        );
12332
12333        utils::result(
12334            vips_op_response,
12335            threshold_out,
12336            Error::OperationError("Percent (vips_percent) failed".to_string()),
12337        )
12338    }
12339
12340    /// VipsPerlin (perlin), make a perlin noise image
12341    /// returns `VipsImage` - Output image
12342    ///
12343    /// width: `i32` -> Image width in pixels
12344    ///
12345    /// height: `i32` -> Image height in pixels
12346    pub fn perlin(width: i32, height: i32) -> Result<VipsImage> {
12347        let mut out_out = VipsImage::from(null_mut());
12348        let vips_op_response = call(
12349            "perlin",
12350            VOption::new()
12351                .set(
12352                    "out",
12353                    &mut out_out,
12354                )
12355                .set(
12356                    "width",
12357                    width,
12358                )
12359                .set(
12360                    "height",
12361                    height,
12362                ),
12363        );
12364
12365        utils::result(
12366            vips_op_response,
12367            out_out,
12368            Error::OperationError("Perlin (vips_perlin) failed".to_string()),
12369        )
12370    }
12371
12372    /// VipsPerlin (perlin), make a perlin noise image
12373    /// returns `VipsImage` - Output image
12374    ///
12375    /// width: `i32` -> Image width in pixels
12376    ///
12377    /// height: `i32` -> Image height in pixels
12378    ///
12379    /// <ins>Optional arguments</ins>
12380    ///
12381    /// cell_size: `i32` -> Size of Perlin cells
12382    ///
12383    /// uchar: `bool` -> Output an unsigned char image
12384    ///
12385    /// seed: `i32` -> Random number seed
12386    pub fn perlin_with_opts(width: i32, height: i32, option: VOption) -> Result<VipsImage> {
12387        let mut out_out = VipsImage::from(null_mut());
12388        let vips_op_response = call(
12389            "perlin",
12390            option
12391                .set(
12392                    "out",
12393                    &mut out_out,
12394                )
12395                .set(
12396                    "width",
12397                    width,
12398                )
12399                .set(
12400                    "height",
12401                    height,
12402                ),
12403        );
12404
12405        utils::result(
12406            vips_op_response,
12407            out_out,
12408            Error::OperationError("Perlin (vips_perlin) failed".to_string()),
12409        )
12410    }
12411
12412    /// VipsPhasecor (phasecor), calculate phase correlation
12413    /// returns `VipsImage` - Output image
12414    ///
12415    /// in2: `&VipsImage` -> Second input image
12416    pub fn phasecor(&self, in2: &VipsImage) -> Result<VipsImage> {
12417        let mut out_out = VipsImage::from(null_mut());
12418        let vips_op_response = call(
12419            "phasecor",
12420            VOption::new()
12421                .set("in", self)
12422                .set("in2", in2)
12423                .set(
12424                    "out",
12425                    &mut out_out,
12426                ),
12427        );
12428
12429        utils::result(
12430            vips_op_response,
12431            out_out,
12432            Error::OperationError("Phasecor (vips_phasecor) failed".to_string()),
12433        )
12434    }
12435
12436    /// VipsForeignLoadPngFile (pngload), load png from file (.png), priority=200, is_a, get_flags, get_flags_filename, header, load
12437    /// returns `VipsImage` - Output image
12438    ///
12439    /// filename: `&str` -> Filename to load from
12440    pub fn pngload(filename: &str) -> Result<VipsImage> {
12441        let mut out_out = VipsImage::from(null_mut());
12442        let vips_op_response = call(
12443            "pngload",
12444            VOption::new()
12445                .set(
12446                    "filename",
12447                    filename,
12448                )
12449                .set(
12450                    "out",
12451                    &mut out_out,
12452                ),
12453        );
12454
12455        utils::result(
12456            vips_op_response,
12457            out_out,
12458            Error::OperationError("Pngload (vips_pngload) failed".to_string()),
12459        )
12460    }
12461
12462    /// VipsForeignLoadPngFile (pngload), load png from file (.png), priority=200, is_a, get_flags, get_flags_filename, header, load
12463    /// returns `VipsImage` - Output image
12464    ///
12465    /// filename: `&str` -> Filename to load from
12466    ///
12467    /// <ins>Optional arguments</ins>
12468    ///
12469    /// unlimited: `bool` -> Remove all denial of service limits
12470    ///
12471    /// flags: [`ForeignFlags`] -> Flags for this file
12472    ///
12473    /// memory: `bool` -> Force open via memory
12474    ///
12475    /// access: [`Access`] -> Required access pattern for this file
12476    ///
12477    /// fail_on: [`FailOn`] -> Error level to fail on
12478    ///
12479    /// revalidate: `bool` -> Don't use a cached result for this operation
12480    pub fn pngload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
12481        let mut out_out = VipsImage::from(null_mut());
12482        let vips_op_response = call(
12483            "pngload",
12484            option
12485                .set(
12486                    "filename",
12487                    filename,
12488                )
12489                .set(
12490                    "out",
12491                    &mut out_out,
12492                ),
12493        );
12494
12495        utils::result(
12496            vips_op_response,
12497            out_out,
12498            Error::OperationError("Pngload (vips_pngload) failed".to_string()),
12499        )
12500    }
12501
12502    /// VipsForeignLoadPngBuffer (pngload_buffer), load png from buffer, priority=200, is_a_buffer, get_flags, get_flags_filename, header, load
12503    /// returns `VipsImage` - Output image
12504    ///
12505    /// buffer: `&[u8]` -> Buffer to load from
12506    pub fn pngload_buffer(buffer: &[u8]) -> Result<VipsImage> {
12507        let blob = unsafe {
12508            vips_blob_new(
12509                None,
12510                buffer.as_ptr() as _,
12511                buffer.len() as _,
12512            )
12513        };
12514        let mut out_out = VipsImage::from(null_mut());
12515        let vips_op_response = call(
12516            "pngload_buffer",
12517            VOption::new()
12518                .set(
12519                    "buffer",
12520                    &VipsBlob::from(blob),
12521                )
12522                .set(
12523                    "out",
12524                    &mut out_out,
12525                ),
12526        );
12527        unsafe { vips_area_unref(&mut (*blob).area) };
12528        utils::result(
12529            vips_op_response,
12530            out_out,
12531            Error::OperationError("PngloadBuffer (vips_pngload_buffer) failed".to_string()),
12532        )
12533    }
12534
12535    /// VipsForeignLoadPngBuffer (pngload_buffer), load png from buffer, priority=200, is_a_buffer, get_flags, get_flags_filename, header, load
12536    /// returns `VipsImage` - Output image
12537    ///
12538    /// buffer: `&[u8]` -> Buffer to load from
12539    ///
12540    /// <ins>Optional arguments</ins>
12541    ///
12542    /// unlimited: `bool` -> Remove all denial of service limits
12543    ///
12544    /// flags: [`ForeignFlags`] -> Flags for this file
12545    ///
12546    /// memory: `bool` -> Force open via memory
12547    ///
12548    /// access: [`Access`] -> Required access pattern for this file
12549    ///
12550    /// fail_on: [`FailOn`] -> Error level to fail on
12551    ///
12552    /// revalidate: `bool` -> Don't use a cached result for this operation
12553    pub fn pngload_buffer_with_opts(buffer: &[u8], option: VOption) -> Result<VipsImage> {
12554        let blob = unsafe {
12555            vips_blob_new(
12556                None,
12557                buffer.as_ptr() as _,
12558                buffer.len() as _,
12559            )
12560        };
12561        let mut out_out = VipsImage::from(null_mut());
12562        let vips_op_response = call(
12563            "pngload_buffer",
12564            option
12565                .set(
12566                    "buffer",
12567                    &VipsBlob::from(blob),
12568                )
12569                .set(
12570                    "out",
12571                    &mut out_out,
12572                ),
12573        );
12574        unsafe { vips_area_unref(&mut (*blob).area) };
12575        utils::result(
12576            vips_op_response,
12577            out_out,
12578            Error::OperationError("PngloadBuffer (vips_pngload_buffer) failed".to_string()),
12579        )
12580    }
12581
12582    /// VipsForeignLoadPngSource (pngload_source), load png from source, priority=200, is_a_source, get_flags, get_flags_filename, header, load
12583    /// returns `VipsImage` - Output image
12584    ///
12585    /// source: `&VipsSource` -> Source to load from
12586    pub fn pngload_source(source: &VipsSource) -> Result<VipsImage> {
12587        let mut out_out = VipsImage::from(null_mut());
12588        let vips_op_response = call(
12589            "pngload_source",
12590            VOption::new()
12591                .set(
12592                    "source",
12593                    source,
12594                )
12595                .set(
12596                    "out",
12597                    &mut out_out,
12598                ),
12599        );
12600
12601        utils::result(
12602            vips_op_response,
12603            out_out,
12604            Error::OperationError("PngloadSource (vips_pngload_source) failed".to_string()),
12605        )
12606    }
12607
12608    /// VipsForeignLoadPngSource (pngload_source), load png from source, priority=200, is_a_source, get_flags, get_flags_filename, header, load
12609    /// returns `VipsImage` - Output image
12610    ///
12611    /// source: `&VipsSource` -> Source to load from
12612    ///
12613    /// <ins>Optional arguments</ins>
12614    ///
12615    /// unlimited: `bool` -> Remove all denial of service limits
12616    ///
12617    /// flags: [`ForeignFlags`] -> Flags for this file
12618    ///
12619    /// memory: `bool` -> Force open via memory
12620    ///
12621    /// access: [`Access`] -> Required access pattern for this file
12622    ///
12623    /// fail_on: [`FailOn`] -> Error level to fail on
12624    ///
12625    /// revalidate: `bool` -> Don't use a cached result for this operation
12626    pub fn pngload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
12627        let mut out_out = VipsImage::from(null_mut());
12628        let vips_op_response = call(
12629            "pngload_source",
12630            option
12631                .set(
12632                    "source",
12633                    source,
12634                )
12635                .set(
12636                    "out",
12637                    &mut out_out,
12638                ),
12639        );
12640
12641        utils::result(
12642            vips_op_response,
12643            out_out,
12644            Error::OperationError("PngloadSource (vips_pngload_source) failed".to_string()),
12645        )
12646    }
12647
12648    /// VipsForeignSaveSpngFile (pngsave), save image to file as PNG (.png), priority=0, mono rgb alpha
12649    ///
12650    /// filename: `&str` -> Filename to save to
12651    pub fn pngsave(&self, filename: &str) -> Result<()> {
12652        let vips_op_response = call(
12653            "pngsave",
12654            VOption::new()
12655                .set("in", self)
12656                .set(
12657                    "filename",
12658                    filename,
12659                ),
12660        );
12661
12662        utils::result(
12663            vips_op_response,
12664            (),
12665            Error::OperationError("Pngsave (vips_pngsave) failed".to_string()),
12666        )
12667    }
12668
12669    /// VipsForeignSaveSpngFile (pngsave), save image to file as PNG (.png), priority=0, mono rgb alpha
12670    ///
12671    /// filename: `&str` -> Filename to save to
12672    ///
12673    /// <ins>Optional arguments</ins>
12674    ///
12675    /// compression: `i32` -> Compression factor
12676    ///
12677    /// interlace: `bool` -> Interlace image
12678    ///
12679    /// filter: [`ForeignPngFilter`] -> libspng row filter flag(s)
12680    ///
12681    /// palette: `bool` -> Quantise to 8bpp palette
12682    ///
12683    /// Q: `i32` -> Quantisation quality
12684    ///
12685    /// dither: `f64` -> Amount of dithering
12686    ///
12687    /// bitdepth: `i32` -> Write as a 1, 2, 4, 8 or 16 bit image
12688    ///
12689    /// effort: `i32` -> Quantisation CPU effort
12690    ///
12691    /// keep: [`ForeignKeep`] -> Which metadata to retain
12692    ///
12693    /// background: `&[f64]` -> Background value
12694    ///
12695    /// page_height: `i32` -> Set page height for multipage save
12696    ///
12697    /// profile: `&str` -> Filename of ICC profile to embed
12698    pub fn pngsave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
12699        let vips_op_response = call(
12700            "pngsave",
12701            option
12702                .set("in", self)
12703                .set(
12704                    "filename",
12705                    filename,
12706                ),
12707        );
12708
12709        utils::result(
12710            vips_op_response,
12711            (),
12712            Error::OperationError("Pngsave (vips_pngsave) failed".to_string()),
12713        )
12714    }
12715
12716    /// VipsForeignSaveSpngBuffer (pngsave_buffer), save image to buffer as PNG (.png), priority=0, mono rgb alpha
12717    /// returns `Vec<u8>` - Buffer to save to
12718    pub fn pngsave_buffer(&self) -> Result<Vec<u8>> {
12719        let mut buffer_out = VipsBlob::from(null_mut());
12720        let vips_op_response = call(
12721            "pngsave_buffer",
12722            VOption::new()
12723                .set("in", self)
12724                .set(
12725                    "buffer",
12726                    &mut buffer_out,
12727                ),
12728        );
12729
12730        utils::result(
12731            vips_op_response,
12732            buffer_out.into(),
12733            Error::OperationError("PngsaveBuffer (vips_pngsave_buffer) failed".to_string()),
12734        )
12735    }
12736
12737    /// VipsForeignSaveSpngBuffer (pngsave_buffer), save image to buffer as PNG (.png), priority=0, mono rgb alpha
12738    /// returns `Vec<u8>` - Buffer to save to
12739    ///
12740    /// <ins>Optional arguments</ins>
12741    ///
12742    /// compression: `i32` -> Compression factor
12743    ///
12744    /// interlace: `bool` -> Interlace image
12745    ///
12746    /// filter: [`ForeignPngFilter`] -> libspng row filter flag(s)
12747    ///
12748    /// palette: `bool` -> Quantise to 8bpp palette
12749    ///
12750    /// Q: `i32` -> Quantisation quality
12751    ///
12752    /// dither: `f64` -> Amount of dithering
12753    ///
12754    /// bitdepth: `i32` -> Write as a 1, 2, 4, 8 or 16 bit image
12755    ///
12756    /// effort: `i32` -> Quantisation CPU effort
12757    ///
12758    /// keep: [`ForeignKeep`] -> Which metadata to retain
12759    ///
12760    /// background: `&[f64]` -> Background value
12761    ///
12762    /// page_height: `i32` -> Set page height for multipage save
12763    ///
12764    /// profile: `&str` -> Filename of ICC profile to embed
12765    pub fn pngsave_buffer_with_opts(&self, option: VOption) -> Result<Vec<u8>> {
12766        let mut buffer_out = VipsBlob::from(null_mut());
12767        let vips_op_response = call(
12768            "pngsave_buffer",
12769            option
12770                .set("in", self)
12771                .set(
12772                    "buffer",
12773                    &mut buffer_out,
12774                ),
12775        );
12776
12777        utils::result(
12778            vips_op_response,
12779            buffer_out.into(),
12780            Error::OperationError("PngsaveBuffer (vips_pngsave_buffer) failed".to_string()),
12781        )
12782    }
12783
12784    /// VipsForeignSaveSpngTarget (pngsave_target), save image to target as PNG (.png), priority=0, mono rgb alpha
12785    ///
12786    /// target: `&VipsTarget` -> Target to save to
12787    pub fn pngsave_target(&self, target: &VipsTarget) -> Result<()> {
12788        let vips_op_response = call(
12789            "pngsave_target",
12790            VOption::new()
12791                .set("in", self)
12792                .set(
12793                    "target",
12794                    target,
12795                ),
12796        );
12797
12798        utils::result(
12799            vips_op_response,
12800            (),
12801            Error::OperationError("PngsaveTarget (vips_pngsave_target) failed".to_string()),
12802        )
12803    }
12804
12805    /// VipsForeignSaveSpngTarget (pngsave_target), save image to target as PNG (.png), priority=0, mono rgb alpha
12806    ///
12807    /// target: `&VipsTarget` -> Target to save to
12808    ///
12809    /// <ins>Optional arguments</ins>
12810    ///
12811    /// compression: `i32` -> Compression factor
12812    ///
12813    /// interlace: `bool` -> Interlace image
12814    ///
12815    /// filter: [`ForeignPngFilter`] -> libspng row filter flag(s)
12816    ///
12817    /// palette: `bool` -> Quantise to 8bpp palette
12818    ///
12819    /// Q: `i32` -> Quantisation quality
12820    ///
12821    /// dither: `f64` -> Amount of dithering
12822    ///
12823    /// bitdepth: `i32` -> Write as a 1, 2, 4, 8 or 16 bit image
12824    ///
12825    /// effort: `i32` -> Quantisation CPU effort
12826    ///
12827    /// keep: [`ForeignKeep`] -> Which metadata to retain
12828    ///
12829    /// background: `&[f64]` -> Background value
12830    ///
12831    /// page_height: `i32` -> Set page height for multipage save
12832    ///
12833    /// profile: `&str` -> Filename of ICC profile to embed
12834    pub fn pngsave_target_with_opts(&self, target: &VipsTarget, option: VOption) -> Result<()> {
12835        let vips_op_response = call(
12836            "pngsave_target",
12837            option
12838                .set("in", self)
12839                .set(
12840                    "target",
12841                    target,
12842                ),
12843        );
12844
12845        utils::result(
12846            vips_op_response,
12847            (),
12848            Error::OperationError("PngsaveTarget (vips_pngsave_target) failed".to_string()),
12849        )
12850    }
12851
12852    /// VipsForeignLoadPpmFile (ppmload), load ppm from file (.pbm, .pgm, .ppm, .pfm, .pnm), priority=200, untrusted, is_a, get_flags, header, load
12853    /// returns `VipsImage` - Output image
12854    ///
12855    /// filename: `&str` -> Filename to load from
12856    pub fn ppmload(filename: &str) -> Result<VipsImage> {
12857        let mut out_out = VipsImage::from(null_mut());
12858        let vips_op_response = call(
12859            "ppmload",
12860            VOption::new()
12861                .set(
12862                    "filename",
12863                    filename,
12864                )
12865                .set(
12866                    "out",
12867                    &mut out_out,
12868                ),
12869        );
12870
12871        utils::result(
12872            vips_op_response,
12873            out_out,
12874            Error::OperationError("Ppmload (vips_ppmload) failed".to_string()),
12875        )
12876    }
12877
12878    /// VipsForeignLoadPpmFile (ppmload), load ppm from file (.pbm, .pgm, .ppm, .pfm, .pnm), priority=200, untrusted, is_a, get_flags, header, load
12879    /// returns `VipsImage` - Output image
12880    ///
12881    /// filename: `&str` -> Filename to load from
12882    ///
12883    /// <ins>Optional arguments</ins>
12884    ///
12885    /// flags: [`ForeignFlags`] -> Flags for this file
12886    ///
12887    /// memory: `bool` -> Force open via memory
12888    ///
12889    /// access: [`Access`] -> Required access pattern for this file
12890    ///
12891    /// fail_on: [`FailOn`] -> Error level to fail on
12892    ///
12893    /// revalidate: `bool` -> Don't use a cached result for this operation
12894    pub fn ppmload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
12895        let mut out_out = VipsImage::from(null_mut());
12896        let vips_op_response = call(
12897            "ppmload",
12898            option
12899                .set(
12900                    "filename",
12901                    filename,
12902                )
12903                .set(
12904                    "out",
12905                    &mut out_out,
12906                ),
12907        );
12908
12909        utils::result(
12910            vips_op_response,
12911            out_out,
12912            Error::OperationError("Ppmload (vips_ppmload) failed".to_string()),
12913        )
12914    }
12915
12916    /// VipsForeignLoadPpmBuffer (ppmload_buffer), load ppm from buffer (.pbm, .pgm, .ppm, .pfm, .pnm), priority=200, untrusted, is_a_buffer, get_flags, header, load
12917    /// returns `VipsImage` - Output image
12918    ///
12919    /// buffer: `&[u8]` -> Buffer to load from
12920    pub fn ppmload_buffer(buffer: &[u8]) -> Result<VipsImage> {
12921        let blob = unsafe {
12922            vips_blob_new(
12923                None,
12924                buffer.as_ptr() as _,
12925                buffer.len() as _,
12926            )
12927        };
12928        let mut out_out = VipsImage::from(null_mut());
12929        let vips_op_response = call(
12930            "ppmload_buffer",
12931            VOption::new()
12932                .set(
12933                    "buffer",
12934                    &VipsBlob::from(blob),
12935                )
12936                .set(
12937                    "out",
12938                    &mut out_out,
12939                ),
12940        );
12941        unsafe { vips_area_unref(&mut (*blob).area) };
12942        utils::result(
12943            vips_op_response,
12944            out_out,
12945            Error::OperationError("PpmloadBuffer (vips_ppmload_buffer) failed".to_string()),
12946        )
12947    }
12948
12949    /// VipsForeignLoadPpmBuffer (ppmload_buffer), load ppm from buffer (.pbm, .pgm, .ppm, .pfm, .pnm), priority=200, untrusted, is_a_buffer, get_flags, header, load
12950    /// returns `VipsImage` - Output image
12951    ///
12952    /// buffer: `&[u8]` -> Buffer to load from
12953    ///
12954    /// <ins>Optional arguments</ins>
12955    ///
12956    /// flags: [`ForeignFlags`] -> Flags for this file
12957    ///
12958    /// memory: `bool` -> Force open via memory
12959    ///
12960    /// access: [`Access`] -> Required access pattern for this file
12961    ///
12962    /// fail_on: [`FailOn`] -> Error level to fail on
12963    ///
12964    /// revalidate: `bool` -> Don't use a cached result for this operation
12965    pub fn ppmload_buffer_with_opts(buffer: &[u8], option: VOption) -> Result<VipsImage> {
12966        let blob = unsafe {
12967            vips_blob_new(
12968                None,
12969                buffer.as_ptr() as _,
12970                buffer.len() as _,
12971            )
12972        };
12973        let mut out_out = VipsImage::from(null_mut());
12974        let vips_op_response = call(
12975            "ppmload_buffer",
12976            option
12977                .set(
12978                    "buffer",
12979                    &VipsBlob::from(blob),
12980                )
12981                .set(
12982                    "out",
12983                    &mut out_out,
12984                ),
12985        );
12986        unsafe { vips_area_unref(&mut (*blob).area) };
12987        utils::result(
12988            vips_op_response,
12989            out_out,
12990            Error::OperationError("PpmloadBuffer (vips_ppmload_buffer) failed".to_string()),
12991        )
12992    }
12993
12994    /// VipsForeignLoadPpmSource (ppmload_source), load ppm from source (.pbm, .pgm, .ppm, .pfm, .pnm), priority=200, untrusted, is_a_source, get_flags, header, load
12995    /// returns `VipsImage` - Output image
12996    ///
12997    /// source: `&VipsSource` -> Source to load from
12998    pub fn ppmload_source(source: &VipsSource) -> Result<VipsImage> {
12999        let mut out_out = VipsImage::from(null_mut());
13000        let vips_op_response = call(
13001            "ppmload_source",
13002            VOption::new()
13003                .set(
13004                    "source",
13005                    source,
13006                )
13007                .set(
13008                    "out",
13009                    &mut out_out,
13010                ),
13011        );
13012
13013        utils::result(
13014            vips_op_response,
13015            out_out,
13016            Error::OperationError("PpmloadSource (vips_ppmload_source) failed".to_string()),
13017        )
13018    }
13019
13020    /// VipsForeignLoadPpmSource (ppmload_source), load ppm from source (.pbm, .pgm, .ppm, .pfm, .pnm), priority=200, untrusted, is_a_source, get_flags, header, load
13021    /// returns `VipsImage` - Output image
13022    ///
13023    /// source: `&VipsSource` -> Source to load from
13024    ///
13025    /// <ins>Optional arguments</ins>
13026    ///
13027    /// flags: [`ForeignFlags`] -> Flags for this file
13028    ///
13029    /// memory: `bool` -> Force open via memory
13030    ///
13031    /// access: [`Access`] -> Required access pattern for this file
13032    ///
13033    /// fail_on: [`FailOn`] -> Error level to fail on
13034    ///
13035    /// revalidate: `bool` -> Don't use a cached result for this operation
13036    pub fn ppmload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
13037        let mut out_out = VipsImage::from(null_mut());
13038        let vips_op_response = call(
13039            "ppmload_source",
13040            option
13041                .set(
13042                    "source",
13043                    source,
13044                )
13045                .set(
13046                    "out",
13047                    &mut out_out,
13048                ),
13049        );
13050
13051        utils::result(
13052            vips_op_response,
13053            out_out,
13054            Error::OperationError("PpmloadSource (vips_ppmload_source) failed".to_string()),
13055        )
13056    }
13057
13058    /// VipsForeignSavePpmFile (ppmsave), save image to ppm file (.pbm, .pgm, .ppm, .pfm, .pnm), priority=0,
13059    ///
13060    /// filename: `&str` -> Filename to save to
13061    pub fn ppmsave(&self, filename: &str) -> Result<()> {
13062        let vips_op_response = call(
13063            "ppmsave",
13064            VOption::new()
13065                .set("in", self)
13066                .set(
13067                    "filename",
13068                    filename,
13069                ),
13070        );
13071
13072        utils::result(
13073            vips_op_response,
13074            (),
13075            Error::OperationError("Ppmsave (vips_ppmsave) failed".to_string()),
13076        )
13077    }
13078
13079    /// VipsForeignSavePpmFile (ppmsave), save image to ppm file (.pbm, .pgm, .ppm, .pfm, .pnm), priority=0,
13080    ///
13081    /// filename: `&str` -> Filename to save to
13082    ///
13083    /// <ins>Optional arguments</ins>
13084    ///
13085    /// format: [`ForeignPpmFormat`] -> Format to save in
13086    ///
13087    /// ascii: `bool` -> Save as ascii
13088    ///
13089    /// bitdepth: `i32` -> Set to 1 to write as a 1 bit image
13090    ///
13091    /// keep: [`ForeignKeep`] -> Which metadata to retain
13092    ///
13093    /// background: `&[f64]` -> Background value
13094    ///
13095    /// page_height: `i32` -> Set page height for multipage save
13096    ///
13097    /// profile: `&str` -> Filename of ICC profile to embed
13098    pub fn ppmsave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
13099        let vips_op_response = call(
13100            "ppmsave",
13101            option
13102                .set("in", self)
13103                .set(
13104                    "filename",
13105                    filename,
13106                ),
13107        );
13108
13109        utils::result(
13110            vips_op_response,
13111            (),
13112            Error::OperationError("Ppmsave (vips_ppmsave) failed".to_string()),
13113        )
13114    }
13115
13116    /// VipsForeignSavePpmTarget (ppmsave_target), save to ppm (.ppm), priority=0,
13117    ///
13118    /// target: `&VipsTarget` -> Target to save to
13119    pub fn ppmsave_target(&self, target: &VipsTarget) -> Result<()> {
13120        let vips_op_response = call(
13121            "ppmsave_target",
13122            VOption::new()
13123                .set("in", self)
13124                .set(
13125                    "target",
13126                    target,
13127                ),
13128        );
13129
13130        utils::result(
13131            vips_op_response,
13132            (),
13133            Error::OperationError("PpmsaveTarget (vips_ppmsave_target) failed".to_string()),
13134        )
13135    }
13136
13137    /// VipsForeignSavePpmTarget (ppmsave_target), save to ppm (.ppm), priority=0,
13138    ///
13139    /// target: `&VipsTarget` -> Target to save to
13140    ///
13141    /// <ins>Optional arguments</ins>
13142    ///
13143    /// format: [`ForeignPpmFormat`] -> Format to save in
13144    ///
13145    /// ascii: `bool` -> Save as ascii
13146    ///
13147    /// bitdepth: `i32` -> Set to 1 to write as a 1 bit image
13148    ///
13149    /// keep: [`ForeignKeep`] -> Which metadata to retain
13150    ///
13151    /// background: `&[f64]` -> Background value
13152    ///
13153    /// page_height: `i32` -> Set page height for multipage save
13154    ///
13155    /// profile: `&str` -> Filename of ICC profile to embed
13156    pub fn ppmsave_target_with_opts(&self, target: &VipsTarget, option: VOption) -> Result<()> {
13157        let vips_op_response = call(
13158            "ppmsave_target",
13159            option
13160                .set("in", self)
13161                .set(
13162                    "target",
13163                    target,
13164                ),
13165        );
13166
13167        utils::result(
13168            vips_op_response,
13169            (),
13170            Error::OperationError("PpmsaveTarget (vips_ppmsave_target) failed".to_string()),
13171        )
13172    }
13173
13174    /// VipsPremultiply (premultiply), premultiply image alpha
13175    /// returns `VipsImage` - Output image
13176    pub fn premultiply(&self) -> Result<VipsImage> {
13177        let mut out_out = VipsImage::from(null_mut());
13178        let vips_op_response = call(
13179            "premultiply",
13180            VOption::new()
13181                .set("in", self)
13182                .set(
13183                    "out",
13184                    &mut out_out,
13185                ),
13186        );
13187
13188        utils::result(
13189            vips_op_response,
13190            out_out,
13191            Error::OperationError("Premultiply (vips_premultiply) failed".to_string()),
13192        )
13193    }
13194
13195    /// VipsPremultiply (premultiply), premultiply image alpha
13196    /// returns `VipsImage` - Output image
13197    ///
13198    /// <ins>Optional arguments</ins>
13199    ///
13200    /// max_alpha: `f64` -> Maximum value of alpha channel
13201    pub fn premultiply_with_opts(&self, option: VOption) -> Result<VipsImage> {
13202        let mut out_out = VipsImage::from(null_mut());
13203        let vips_op_response = call(
13204            "premultiply",
13205            option
13206                .set("in", self)
13207                .set(
13208                    "out",
13209                    &mut out_out,
13210                ),
13211        );
13212
13213        utils::result(
13214            vips_op_response,
13215            out_out,
13216            Error::OperationError("Premultiply (vips_premultiply) failed".to_string()),
13217        )
13218    }
13219
13220    /// VipsPrewitt (prewitt), Prewitt edge detector
13221    /// returns `VipsImage` - Output image
13222    pub fn prewitt(&self) -> Result<VipsImage> {
13223        let mut out_out = VipsImage::from(null_mut());
13224        let vips_op_response = call(
13225            "prewitt",
13226            VOption::new()
13227                .set("in", self)
13228                .set(
13229                    "out",
13230                    &mut out_out,
13231                ),
13232        );
13233
13234        utils::result(
13235            vips_op_response,
13236            out_out,
13237            Error::OperationError("Prewitt (vips_prewitt) failed".to_string()),
13238        )
13239    }
13240
13241    /// VipsProfile (profile), find image profiles
13242    /// Tuple (
13243    /// VipsImage - First non-zero pixel in column
13244    /// VipsImage - First non-zero pixel in row
13245    ///)
13246    pub fn profile(
13247        &self,
13248    ) -> Result<(
13249        VipsImage,
13250        VipsImage,
13251    )> {
13252        let mut columns_out = VipsImage::from(null_mut());
13253        let mut rows_out = VipsImage::from(null_mut());
13254        let vips_op_response = call(
13255            "profile",
13256            VOption::new()
13257                .set("in", self)
13258                .set(
13259                    "columns",
13260                    &mut columns_out,
13261                )
13262                .set(
13263                    "rows",
13264                    &mut rows_out,
13265                ),
13266        );
13267
13268        utils::result(
13269            vips_op_response,
13270            (
13271                columns_out,
13272                rows_out,
13273            ),
13274            Error::OperationError("Profile (vips_profile) failed".to_string()),
13275        )
13276    }
13277
13278    /// VipsProfileLoad (profile_load), load named ICC profile
13279    /// returns `Vec<u8>` - Loaded profile
13280    ///
13281    /// name: `&str` -> Profile name
13282    pub fn profile_load(name: &str) -> Result<Vec<u8>> {
13283        let mut profile_out = VipsBlob::from(null_mut());
13284        let vips_op_response = call(
13285            "profile_load",
13286            VOption::new()
13287                .set(
13288                    "name",
13289                    name,
13290                )
13291                .set(
13292                    "profile",
13293                    &mut profile_out,
13294                ),
13295        );
13296
13297        utils::result(
13298            vips_op_response,
13299            profile_out.into(),
13300            Error::OperationError("ProfileLoad (vips_profile_load) failed".to_string()),
13301        )
13302    }
13303
13304    /// VipsProject (project), find image projections
13305    /// Tuple (
13306    /// VipsImage - Sums of columns
13307    /// VipsImage - Sums of rows
13308    ///)
13309    pub fn project(
13310        &self,
13311    ) -> Result<(
13312        VipsImage,
13313        VipsImage,
13314    )> {
13315        let mut columns_out = VipsImage::from(null_mut());
13316        let mut rows_out = VipsImage::from(null_mut());
13317        let vips_op_response = call(
13318            "project",
13319            VOption::new()
13320                .set("in", self)
13321                .set(
13322                    "columns",
13323                    &mut columns_out,
13324                )
13325                .set(
13326                    "rows",
13327                    &mut rows_out,
13328                ),
13329        );
13330
13331        utils::result(
13332            vips_op_response,
13333            (
13334                columns_out,
13335                rows_out,
13336            ),
13337            Error::OperationError("Project (vips_project) failed".to_string()),
13338        )
13339    }
13340
13341    /// VipsQuadratic (quadratic), resample an image with a quadratic transform
13342    /// returns `VipsImage` - Output image
13343    ///
13344    /// coeff: `&VipsImage` -> Coefficient matrix
13345    pub fn quadratic(&self, coeff: &VipsImage) -> Result<VipsImage> {
13346        let mut out_out = VipsImage::from(null_mut());
13347        let vips_op_response = call(
13348            "quadratic",
13349            VOption::new()
13350                .set("in", self)
13351                .set(
13352                    "out",
13353                    &mut out_out,
13354                )
13355                .set(
13356                    "coeff",
13357                    coeff,
13358                ),
13359        );
13360
13361        utils::result(
13362            vips_op_response,
13363            out_out,
13364            Error::OperationError("Quadratic (vips_quadratic) failed".to_string()),
13365        )
13366    }
13367
13368    /// VipsQuadratic (quadratic), resample an image with a quadratic transform
13369    /// returns `VipsImage` - Output image
13370    ///
13371    /// coeff: `&VipsImage` -> Coefficient matrix
13372    ///
13373    /// <ins>Optional arguments</ins>
13374    ///
13375    /// interpolate: `&VipsInterpolate` -> Interpolate values with this
13376    pub fn quadratic_with_opts(&self, coeff: &VipsImage, option: VOption) -> Result<VipsImage> {
13377        let mut out_out = VipsImage::from(null_mut());
13378        let vips_op_response = call(
13379            "quadratic",
13380            option
13381                .set("in", self)
13382                .set(
13383                    "out",
13384                    &mut out_out,
13385                )
13386                .set(
13387                    "coeff",
13388                    coeff,
13389                ),
13390        );
13391
13392        utils::result(
13393            vips_op_response,
13394            out_out,
13395            Error::OperationError("Quadratic (vips_quadratic) failed".to_string()),
13396        )
13397    }
13398
13399    /// VipsRad2float (rad2float), unpack Radiance coding to float RGB
13400    /// returns `VipsImage` - Output image
13401    pub fn rad2float(&self) -> Result<VipsImage> {
13402        let mut out_out = VipsImage::from(null_mut());
13403        let vips_op_response = call(
13404            "rad2float",
13405            VOption::new()
13406                .set("in", self)
13407                .set(
13408                    "out",
13409                    &mut out_out,
13410                ),
13411        );
13412
13413        utils::result(
13414            vips_op_response,
13415            out_out,
13416            Error::OperationError("Rad2Float (vips_rad2float) failed".to_string()),
13417        )
13418    }
13419
13420    /// VipsForeignLoadRadFile (radload), load a Radiance image from a file (.hdr), priority=-50, untrusted, is_a, get_flags, get_flags_filename, header, load
13421    /// returns `VipsImage` - Output image
13422    ///
13423    /// filename: `&str` -> Filename to load from
13424    pub fn radload(filename: &str) -> Result<VipsImage> {
13425        let mut out_out = VipsImage::from(null_mut());
13426        let vips_op_response = call(
13427            "radload",
13428            VOption::new()
13429                .set(
13430                    "filename",
13431                    filename,
13432                )
13433                .set(
13434                    "out",
13435                    &mut out_out,
13436                ),
13437        );
13438
13439        utils::result(
13440            vips_op_response,
13441            out_out,
13442            Error::OperationError("Radload (vips_radload) failed".to_string()),
13443        )
13444    }
13445
13446    /// VipsForeignLoadRadFile (radload), load a Radiance image from a file (.hdr), priority=-50, untrusted, is_a, get_flags, get_flags_filename, header, load
13447    /// returns `VipsImage` - Output image
13448    ///
13449    /// filename: `&str` -> Filename to load from
13450    ///
13451    /// <ins>Optional arguments</ins>
13452    ///
13453    /// flags: [`ForeignFlags`] -> Flags for this file
13454    ///
13455    /// memory: `bool` -> Force open via memory
13456    ///
13457    /// access: [`Access`] -> Required access pattern for this file
13458    ///
13459    /// fail_on: [`FailOn`] -> Error level to fail on
13460    ///
13461    /// revalidate: `bool` -> Don't use a cached result for this operation
13462    pub fn radload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
13463        let mut out_out = VipsImage::from(null_mut());
13464        let vips_op_response = call(
13465            "radload",
13466            option
13467                .set(
13468                    "filename",
13469                    filename,
13470                )
13471                .set(
13472                    "out",
13473                    &mut out_out,
13474                ),
13475        );
13476
13477        utils::result(
13478            vips_op_response,
13479            out_out,
13480            Error::OperationError("Radload (vips_radload) failed".to_string()),
13481        )
13482    }
13483
13484    /// VipsForeignLoadRadBuffer (radload_buffer), load rad from buffer, priority=-50, untrusted, is_a_buffer, get_flags, get_flags_filename, header, load
13485    /// returns `VipsImage` - Output image
13486    ///
13487    /// buffer: `&[u8]` -> Buffer to load from
13488    pub fn radload_buffer(buffer: &[u8]) -> Result<VipsImage> {
13489        let blob = unsafe {
13490            vips_blob_new(
13491                None,
13492                buffer.as_ptr() as _,
13493                buffer.len() as _,
13494            )
13495        };
13496        let mut out_out = VipsImage::from(null_mut());
13497        let vips_op_response = call(
13498            "radload_buffer",
13499            VOption::new()
13500                .set(
13501                    "buffer",
13502                    &VipsBlob::from(blob),
13503                )
13504                .set(
13505                    "out",
13506                    &mut out_out,
13507                ),
13508        );
13509        unsafe { vips_area_unref(&mut (*blob).area) };
13510        utils::result(
13511            vips_op_response,
13512            out_out,
13513            Error::OperationError("RadloadBuffer (vips_radload_buffer) failed".to_string()),
13514        )
13515    }
13516
13517    /// VipsForeignLoadRadBuffer (radload_buffer), load rad from buffer, priority=-50, untrusted, is_a_buffer, get_flags, get_flags_filename, header, load
13518    /// returns `VipsImage` - Output image
13519    ///
13520    /// buffer: `&[u8]` -> Buffer to load from
13521    ///
13522    /// <ins>Optional arguments</ins>
13523    ///
13524    /// flags: [`ForeignFlags`] -> Flags for this file
13525    ///
13526    /// memory: `bool` -> Force open via memory
13527    ///
13528    /// access: [`Access`] -> Required access pattern for this file
13529    ///
13530    /// fail_on: [`FailOn`] -> Error level to fail on
13531    ///
13532    /// revalidate: `bool` -> Don't use a cached result for this operation
13533    pub fn radload_buffer_with_opts(buffer: &[u8], option: VOption) -> Result<VipsImage> {
13534        let blob = unsafe {
13535            vips_blob_new(
13536                None,
13537                buffer.as_ptr() as _,
13538                buffer.len() as _,
13539            )
13540        };
13541        let mut out_out = VipsImage::from(null_mut());
13542        let vips_op_response = call(
13543            "radload_buffer",
13544            option
13545                .set(
13546                    "buffer",
13547                    &VipsBlob::from(blob),
13548                )
13549                .set(
13550                    "out",
13551                    &mut out_out,
13552                ),
13553        );
13554        unsafe { vips_area_unref(&mut (*blob).area) };
13555        utils::result(
13556            vips_op_response,
13557            out_out,
13558            Error::OperationError("RadloadBuffer (vips_radload_buffer) failed".to_string()),
13559        )
13560    }
13561
13562    /// VipsForeignLoadRadSource (radload_source), load rad from source, priority=-50, untrusted, is_a_source, get_flags, get_flags_filename, header, load
13563    /// returns `VipsImage` - Output image
13564    ///
13565    /// source: `&VipsSource` -> Source to load from
13566    pub fn radload_source(source: &VipsSource) -> Result<VipsImage> {
13567        let mut out_out = VipsImage::from(null_mut());
13568        let vips_op_response = call(
13569            "radload_source",
13570            VOption::new()
13571                .set(
13572                    "source",
13573                    source,
13574                )
13575                .set(
13576                    "out",
13577                    &mut out_out,
13578                ),
13579        );
13580
13581        utils::result(
13582            vips_op_response,
13583            out_out,
13584            Error::OperationError("RadloadSource (vips_radload_source) failed".to_string()),
13585        )
13586    }
13587
13588    /// VipsForeignLoadRadSource (radload_source), load rad from source, priority=-50, untrusted, is_a_source, get_flags, get_flags_filename, header, load
13589    /// returns `VipsImage` - Output image
13590    ///
13591    /// source: `&VipsSource` -> Source to load from
13592    ///
13593    /// <ins>Optional arguments</ins>
13594    ///
13595    /// flags: [`ForeignFlags`] -> Flags for this file
13596    ///
13597    /// memory: `bool` -> Force open via memory
13598    ///
13599    /// access: [`Access`] -> Required access pattern for this file
13600    ///
13601    /// fail_on: [`FailOn`] -> Error level to fail on
13602    ///
13603    /// revalidate: `bool` -> Don't use a cached result for this operation
13604    pub fn radload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
13605        let mut out_out = VipsImage::from(null_mut());
13606        let vips_op_response = call(
13607            "radload_source",
13608            option
13609                .set(
13610                    "source",
13611                    source,
13612                )
13613                .set(
13614                    "out",
13615                    &mut out_out,
13616                ),
13617        );
13618
13619        utils::result(
13620            vips_op_response,
13621            out_out,
13622            Error::OperationError("RadloadSource (vips_radload_source) failed".to_string()),
13623        )
13624    }
13625
13626    /// VipsForeignSaveRadFile (radsave), save image to Radiance file (.hdr), priority=0, mono rgb
13627    ///
13628    /// filename: `&str` -> Filename to save to
13629    pub fn radsave(&self, filename: &str) -> Result<()> {
13630        let vips_op_response = call(
13631            "radsave",
13632            VOption::new()
13633                .set("in", self)
13634                .set(
13635                    "filename",
13636                    filename,
13637                ),
13638        );
13639
13640        utils::result(
13641            vips_op_response,
13642            (),
13643            Error::OperationError("Radsave (vips_radsave) failed".to_string()),
13644        )
13645    }
13646
13647    /// VipsForeignSaveRadFile (radsave), save image to Radiance file (.hdr), priority=0, mono rgb
13648    ///
13649    /// filename: `&str` -> Filename to save to
13650    ///
13651    /// <ins>Optional arguments</ins>
13652    ///
13653    /// keep: [`ForeignKeep`] -> Which metadata to retain
13654    ///
13655    /// background: `&[f64]` -> Background value
13656    ///
13657    /// page_height: `i32` -> Set page height for multipage save
13658    ///
13659    /// profile: `&str` -> Filename of ICC profile to embed
13660    pub fn radsave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
13661        let vips_op_response = call(
13662            "radsave",
13663            option
13664                .set("in", self)
13665                .set(
13666                    "filename",
13667                    filename,
13668                ),
13669        );
13670
13671        utils::result(
13672            vips_op_response,
13673            (),
13674            Error::OperationError("Radsave (vips_radsave) failed".to_string()),
13675        )
13676    }
13677
13678    /// VipsForeignSaveRadBuffer (radsave_buffer), save image to Radiance buffer (.hdr), priority=0, mono rgb
13679    /// returns `Vec<u8>` - Buffer to save to
13680    pub fn radsave_buffer(&self) -> Result<Vec<u8>> {
13681        let mut buffer_out = VipsBlob::from(null_mut());
13682        let vips_op_response = call(
13683            "radsave_buffer",
13684            VOption::new()
13685                .set("in", self)
13686                .set(
13687                    "buffer",
13688                    &mut buffer_out,
13689                ),
13690        );
13691
13692        utils::result(
13693            vips_op_response,
13694            buffer_out.into(),
13695            Error::OperationError("RadsaveBuffer (vips_radsave_buffer) failed".to_string()),
13696        )
13697    }
13698
13699    /// VipsForeignSaveRadBuffer (radsave_buffer), save image to Radiance buffer (.hdr), priority=0, mono rgb
13700    /// returns `Vec<u8>` - Buffer to save to
13701    ///
13702    /// <ins>Optional arguments</ins>
13703    ///
13704    /// keep: [`ForeignKeep`] -> Which metadata to retain
13705    ///
13706    /// background: `&[f64]` -> Background value
13707    ///
13708    /// page_height: `i32` -> Set page height for multipage save
13709    ///
13710    /// profile: `&str` -> Filename of ICC profile to embed
13711    pub fn radsave_buffer_with_opts(&self, option: VOption) -> Result<Vec<u8>> {
13712        let mut buffer_out = VipsBlob::from(null_mut());
13713        let vips_op_response = call(
13714            "radsave_buffer",
13715            option
13716                .set("in", self)
13717                .set(
13718                    "buffer",
13719                    &mut buffer_out,
13720                ),
13721        );
13722
13723        utils::result(
13724            vips_op_response,
13725            buffer_out.into(),
13726            Error::OperationError("RadsaveBuffer (vips_radsave_buffer) failed".to_string()),
13727        )
13728    }
13729
13730    /// VipsForeignSaveRadTarget (radsave_target), save image to Radiance target (.hdr), priority=0, mono rgb
13731    ///
13732    /// target: `&VipsTarget` -> Target to save to
13733    pub fn radsave_target(&self, target: &VipsTarget) -> Result<()> {
13734        let vips_op_response = call(
13735            "radsave_target",
13736            VOption::new()
13737                .set("in", self)
13738                .set(
13739                    "target",
13740                    target,
13741                ),
13742        );
13743
13744        utils::result(
13745            vips_op_response,
13746            (),
13747            Error::OperationError("RadsaveTarget (vips_radsave_target) failed".to_string()),
13748        )
13749    }
13750
13751    /// VipsForeignSaveRadTarget (radsave_target), save image to Radiance target (.hdr), priority=0, mono rgb
13752    ///
13753    /// target: `&VipsTarget` -> Target to save to
13754    ///
13755    /// <ins>Optional arguments</ins>
13756    ///
13757    /// keep: [`ForeignKeep`] -> Which metadata to retain
13758    ///
13759    /// background: `&[f64]` -> Background value
13760    ///
13761    /// page_height: `i32` -> Set page height for multipage save
13762    ///
13763    /// profile: `&str` -> Filename of ICC profile to embed
13764    pub fn radsave_target_with_opts(&self, target: &VipsTarget, option: VOption) -> Result<()> {
13765        let vips_op_response = call(
13766            "radsave_target",
13767            option
13768                .set("in", self)
13769                .set(
13770                    "target",
13771                    target,
13772                ),
13773        );
13774
13775        utils::result(
13776            vips_op_response,
13777            (),
13778            Error::OperationError("RadsaveTarget (vips_radsave_target) failed".to_string()),
13779        )
13780    }
13781
13782    /// VipsRank (rank), rank filter
13783    /// returns `VipsImage` - Output image
13784    ///
13785    /// width: `i32` -> Window width in pixels
13786    ///
13787    /// height: `i32` -> Window height in pixels
13788    ///
13789    /// index: `i32` -> Select pixel at index
13790    pub fn rank(&self, width: i32, height: i32, index: i32) -> Result<VipsImage> {
13791        let mut out_out = VipsImage::from(null_mut());
13792        let vips_op_response = call(
13793            "rank",
13794            VOption::new()
13795                .set("in", self)
13796                .set(
13797                    "out",
13798                    &mut out_out,
13799                )
13800                .set(
13801                    "width",
13802                    width,
13803                )
13804                .set(
13805                    "height",
13806                    height,
13807                )
13808                .set(
13809                    "index",
13810                    index,
13811                ),
13812        );
13813
13814        utils::result(
13815            vips_op_response,
13816            out_out,
13817            Error::OperationError("Rank (vips_rank) failed".to_string()),
13818        )
13819    }
13820
13821    /// VipsForeignLoadRaw (rawload), load raw data from a file, priority=0, untrusted, get_flags, get_flags_filename, header
13822    /// returns `VipsImage` - Output image
13823    ///
13824    /// filename: `&str` -> Filename to load from
13825    ///
13826    /// width: `i32` -> Image width in pixels
13827    ///
13828    /// height: `i32` -> Image height in pixels
13829    ///
13830    /// bands: `i32` -> Number of bands in image
13831    pub fn rawload(filename: &str, width: i32, height: i32, bands: i32) -> Result<VipsImage> {
13832        let mut out_out = VipsImage::from(null_mut());
13833        let vips_op_response = call(
13834            "rawload",
13835            VOption::new()
13836                .set(
13837                    "filename",
13838                    filename,
13839                )
13840                .set(
13841                    "out",
13842                    &mut out_out,
13843                )
13844                .set(
13845                    "width",
13846                    width,
13847                )
13848                .set(
13849                    "height",
13850                    height,
13851                )
13852                .set(
13853                    "bands",
13854                    bands,
13855                ),
13856        );
13857
13858        utils::result(
13859            vips_op_response,
13860            out_out,
13861            Error::OperationError("Rawload (vips_rawload) failed".to_string()),
13862        )
13863    }
13864
13865    /// VipsForeignLoadRaw (rawload), load raw data from a file, priority=0, untrusted, get_flags, get_flags_filename, header
13866    /// returns `VipsImage` - Output image
13867    ///
13868    /// filename: `&str` -> Filename to load from
13869    ///
13870    /// width: `i32` -> Image width in pixels
13871    ///
13872    /// height: `i32` -> Image height in pixels
13873    ///
13874    /// bands: `i32` -> Number of bands in image
13875    ///
13876    /// <ins>Optional arguments</ins>
13877    ///
13878    /// offset: `u64` -> Offset in bytes from start of file
13879    ///
13880    /// format: [`BandFormat`] -> Pixel format in image
13881    ///
13882    /// interpretation: [`Interpretation`] -> Pixel interpretation
13883    ///
13884    /// flags: [`ForeignFlags`] -> Flags for this file
13885    ///
13886    /// memory: `bool` -> Force open via memory
13887    ///
13888    /// access: [`Access`] -> Required access pattern for this file
13889    ///
13890    /// fail_on: [`FailOn`] -> Error level to fail on
13891    ///
13892    /// revalidate: `bool` -> Don't use a cached result for this operation
13893    pub fn rawload_with_opts(
13894        filename: &str,
13895        width: i32,
13896        height: i32,
13897        bands: i32,
13898        option: VOption,
13899    ) -> Result<VipsImage> {
13900        let mut out_out = VipsImage::from(null_mut());
13901        let vips_op_response = call(
13902            "rawload",
13903            option
13904                .set(
13905                    "filename",
13906                    filename,
13907                )
13908                .set(
13909                    "out",
13910                    &mut out_out,
13911                )
13912                .set(
13913                    "width",
13914                    width,
13915                )
13916                .set(
13917                    "height",
13918                    height,
13919                )
13920                .set(
13921                    "bands",
13922                    bands,
13923                ),
13924        );
13925
13926        utils::result(
13927            vips_op_response,
13928            out_out,
13929            Error::OperationError("Rawload (vips_rawload) failed".to_string()),
13930        )
13931    }
13932
13933    /// VipsForeignSaveRawFile (rawsave), save image to raw file (.raw), priority=0,
13934    ///
13935    /// filename: `&str` -> Filename to save to
13936    pub fn rawsave(&self, filename: &str) -> Result<()> {
13937        let vips_op_response = call(
13938            "rawsave",
13939            VOption::new()
13940                .set("in", self)
13941                .set(
13942                    "filename",
13943                    filename,
13944                ),
13945        );
13946
13947        utils::result(
13948            vips_op_response,
13949            (),
13950            Error::OperationError("Rawsave (vips_rawsave) failed".to_string()),
13951        )
13952    }
13953
13954    /// VipsForeignSaveRawFile (rawsave), save image to raw file (.raw), priority=0,
13955    ///
13956    /// filename: `&str` -> Filename to save to
13957    ///
13958    /// <ins>Optional arguments</ins>
13959    ///
13960    /// keep: [`ForeignKeep`] -> Which metadata to retain
13961    ///
13962    /// background: `&[f64]` -> Background value
13963    ///
13964    /// page_height: `i32` -> Set page height for multipage save
13965    ///
13966    /// profile: `&str` -> Filename of ICC profile to embed
13967    pub fn rawsave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
13968        let vips_op_response = call(
13969            "rawsave",
13970            option
13971                .set("in", self)
13972                .set(
13973                    "filename",
13974                    filename,
13975                ),
13976        );
13977
13978        utils::result(
13979            vips_op_response,
13980            (),
13981            Error::OperationError("Rawsave (vips_rawsave) failed".to_string()),
13982        )
13983    }
13984
13985    /// VipsForeignSaveRawBuffer (rawsave_buffer), write raw image to buffer (.raw), priority=0,
13986    /// returns `Vec<u8>` - Buffer to save to
13987    pub fn rawsave_buffer(&self) -> Result<Vec<u8>> {
13988        let mut buffer_out = VipsBlob::from(null_mut());
13989        let vips_op_response = call(
13990            "rawsave_buffer",
13991            VOption::new()
13992                .set("in", self)
13993                .set(
13994                    "buffer",
13995                    &mut buffer_out,
13996                ),
13997        );
13998
13999        utils::result(
14000            vips_op_response,
14001            buffer_out.into(),
14002            Error::OperationError("RawsaveBuffer (vips_rawsave_buffer) failed".to_string()),
14003        )
14004    }
14005
14006    /// VipsForeignSaveRawBuffer (rawsave_buffer), write raw image to buffer (.raw), priority=0,
14007    /// returns `Vec<u8>` - Buffer to save to
14008    ///
14009    /// <ins>Optional arguments</ins>
14010    ///
14011    /// keep: [`ForeignKeep`] -> Which metadata to retain
14012    ///
14013    /// background: `&[f64]` -> Background value
14014    ///
14015    /// page_height: `i32` -> Set page height for multipage save
14016    ///
14017    /// profile: `&str` -> Filename of ICC profile to embed
14018    pub fn rawsave_buffer_with_opts(&self, option: VOption) -> Result<Vec<u8>> {
14019        let mut buffer_out = VipsBlob::from(null_mut());
14020        let vips_op_response = call(
14021            "rawsave_buffer",
14022            option
14023                .set("in", self)
14024                .set(
14025                    "buffer",
14026                    &mut buffer_out,
14027                ),
14028        );
14029
14030        utils::result(
14031            vips_op_response,
14032            buffer_out.into(),
14033            Error::OperationError("RawsaveBuffer (vips_rawsave_buffer) failed".to_string()),
14034        )
14035    }
14036
14037    /// VipsForeignSaveRawTarget (rawsave_target), write raw image to target (.raw), priority=0,
14038    ///
14039    /// target: `&VipsTarget` -> Target to save to
14040    pub fn rawsave_target(&self, target: &VipsTarget) -> Result<()> {
14041        let vips_op_response = call(
14042            "rawsave_target",
14043            VOption::new()
14044                .set("in", self)
14045                .set(
14046                    "target",
14047                    target,
14048                ),
14049        );
14050
14051        utils::result(
14052            vips_op_response,
14053            (),
14054            Error::OperationError("RawsaveTarget (vips_rawsave_target) failed".to_string()),
14055        )
14056    }
14057
14058    /// VipsForeignSaveRawTarget (rawsave_target), write raw image to target (.raw), priority=0,
14059    ///
14060    /// target: `&VipsTarget` -> Target to save to
14061    ///
14062    /// <ins>Optional arguments</ins>
14063    ///
14064    /// keep: [`ForeignKeep`] -> Which metadata to retain
14065    ///
14066    /// background: `&[f64]` -> Background value
14067    ///
14068    /// page_height: `i32` -> Set page height for multipage save
14069    ///
14070    /// profile: `&str` -> Filename of ICC profile to embed
14071    pub fn rawsave_target_with_opts(&self, target: &VipsTarget, option: VOption) -> Result<()> {
14072        let vips_op_response = call(
14073            "rawsave_target",
14074            option
14075                .set("in", self)
14076                .set(
14077                    "target",
14078                    target,
14079                ),
14080        );
14081
14082        utils::result(
14083            vips_op_response,
14084            (),
14085            Error::OperationError("RawsaveTarget (vips_rawsave_target) failed".to_string()),
14086        )
14087    }
14088
14089    /// VipsRecomb (recomb), linear recombination with matrix
14090    /// returns `VipsImage` - Output image
14091    ///
14092    /// m: `&VipsImage` -> Matrix of coefficients
14093    pub fn recomb(&self, m: &VipsImage) -> Result<VipsImage> {
14094        let mut out_out = VipsImage::from(null_mut());
14095        let vips_op_response = call(
14096            "recomb",
14097            VOption::new()
14098                .set("in", self)
14099                .set(
14100                    "out",
14101                    &mut out_out,
14102                )
14103                .set("m", m),
14104        );
14105
14106        utils::result(
14107            vips_op_response,
14108            out_out,
14109            Error::OperationError("Recomb (vips_recomb) failed".to_string()),
14110        )
14111    }
14112
14113    /// VipsReduce (reduce), reduce an image
14114    /// returns `VipsImage` - Output image
14115    ///
14116    /// hshrink: `f64` -> Horizontal shrink factor
14117    ///
14118    /// vshrink: `f64` -> Vertical shrink factor
14119    pub fn reduce(&self, hshrink: f64, vshrink: f64) -> Result<VipsImage> {
14120        let mut out_out = VipsImage::from(null_mut());
14121        let vips_op_response = call(
14122            "reduce",
14123            VOption::new()
14124                .set("in", self)
14125                .set(
14126                    "out",
14127                    &mut out_out,
14128                )
14129                .set(
14130                    "hshrink",
14131                    hshrink,
14132                )
14133                .set(
14134                    "vshrink",
14135                    vshrink,
14136                ),
14137        );
14138
14139        utils::result(
14140            vips_op_response,
14141            out_out,
14142            Error::OperationError("Reduce (vips_reduce) failed".to_string()),
14143        )
14144    }
14145
14146    /// VipsReduce (reduce), reduce an image
14147    /// returns `VipsImage` - Output image
14148    ///
14149    /// hshrink: `f64` -> Horizontal shrink factor
14150    ///
14151    /// vshrink: `f64` -> Vertical shrink factor
14152    ///
14153    /// <ins>Optional arguments</ins>
14154    ///
14155    /// kernel: [`Kernel`] -> Resampling kernel
14156    ///
14157    /// gap: `f64` -> Reducing gap
14158    pub fn reduce_with_opts(
14159        &self,
14160        hshrink: f64,
14161        vshrink: f64,
14162        option: VOption,
14163    ) -> Result<VipsImage> {
14164        let mut out_out = VipsImage::from(null_mut());
14165        let vips_op_response = call(
14166            "reduce",
14167            option
14168                .set("in", self)
14169                .set(
14170                    "out",
14171                    &mut out_out,
14172                )
14173                .set(
14174                    "hshrink",
14175                    hshrink,
14176                )
14177                .set(
14178                    "vshrink",
14179                    vshrink,
14180                ),
14181        );
14182
14183        utils::result(
14184            vips_op_response,
14185            out_out,
14186            Error::OperationError("Reduce (vips_reduce) failed".to_string()),
14187        )
14188    }
14189
14190    /// VipsReduceh (reduceh), shrink an image horizontally
14191    /// returns `VipsImage` - Output image
14192    ///
14193    /// hshrink: `f64` -> Horizontal shrink factor
14194    pub fn reduceh(&self, hshrink: f64) -> Result<VipsImage> {
14195        let mut out_out = VipsImage::from(null_mut());
14196        let vips_op_response = call(
14197            "reduceh",
14198            VOption::new()
14199                .set("in", self)
14200                .set(
14201                    "out",
14202                    &mut out_out,
14203                )
14204                .set(
14205                    "hshrink",
14206                    hshrink,
14207                ),
14208        );
14209
14210        utils::result(
14211            vips_op_response,
14212            out_out,
14213            Error::OperationError("Reduceh (vips_reduceh) failed".to_string()),
14214        )
14215    }
14216
14217    /// VipsReduceh (reduceh), shrink an image horizontally
14218    /// returns `VipsImage` - Output image
14219    ///
14220    /// hshrink: `f64` -> Horizontal shrink factor
14221    ///
14222    /// <ins>Optional arguments</ins>
14223    ///
14224    /// kernel: [`Kernel`] -> Resampling kernel
14225    ///
14226    /// gap: `f64` -> Reducing gap
14227    pub fn reduceh_with_opts(&self, hshrink: f64, option: VOption) -> Result<VipsImage> {
14228        let mut out_out = VipsImage::from(null_mut());
14229        let vips_op_response = call(
14230            "reduceh",
14231            option
14232                .set("in", self)
14233                .set(
14234                    "out",
14235                    &mut out_out,
14236                )
14237                .set(
14238                    "hshrink",
14239                    hshrink,
14240                ),
14241        );
14242
14243        utils::result(
14244            vips_op_response,
14245            out_out,
14246            Error::OperationError("Reduceh (vips_reduceh) failed".to_string()),
14247        )
14248    }
14249
14250    /// VipsReducev (reducev), shrink an image vertically
14251    /// returns `VipsImage` - Output image
14252    ///
14253    /// vshrink: `f64` -> Vertical shrink factor
14254    pub fn reducev(&self, vshrink: f64) -> Result<VipsImage> {
14255        let mut out_out = VipsImage::from(null_mut());
14256        let vips_op_response = call(
14257            "reducev",
14258            VOption::new()
14259                .set("in", self)
14260                .set(
14261                    "out",
14262                    &mut out_out,
14263                )
14264                .set(
14265                    "vshrink",
14266                    vshrink,
14267                ),
14268        );
14269
14270        utils::result(
14271            vips_op_response,
14272            out_out,
14273            Error::OperationError("Reducev (vips_reducev) failed".to_string()),
14274        )
14275    }
14276
14277    /// VipsReducev (reducev), shrink an image vertically
14278    /// returns `VipsImage` - Output image
14279    ///
14280    /// vshrink: `f64` -> Vertical shrink factor
14281    ///
14282    /// <ins>Optional arguments</ins>
14283    ///
14284    /// kernel: [`Kernel`] -> Resampling kernel
14285    ///
14286    /// gap: `f64` -> Reducing gap
14287    pub fn reducev_with_opts(&self, vshrink: f64, option: VOption) -> Result<VipsImage> {
14288        let mut out_out = VipsImage::from(null_mut());
14289        let vips_op_response = call(
14290            "reducev",
14291            option
14292                .set("in", self)
14293                .set(
14294                    "out",
14295                    &mut out_out,
14296                )
14297                .set(
14298                    "vshrink",
14299                    vshrink,
14300                ),
14301        );
14302
14303        utils::result(
14304            vips_op_response,
14305            out_out,
14306            Error::OperationError("Reducev (vips_reducev) failed".to_string()),
14307        )
14308    }
14309
14310    /// VipsRelational (relational), relational operation on two images
14311    /// returns `VipsImage` - Output image
14312    ///
14313    /// right: `&VipsImage` -> Right-hand image argument
14314    ///
14315    /// relational: `OperationRelational` -> Relational to perform
14316    pub fn relational(
14317        &self,
14318        right: &VipsImage,
14319        relational: OperationRelational,
14320    ) -> Result<VipsImage> {
14321        let mut out_out = VipsImage::from(null_mut());
14322        let vips_op_response = call(
14323            "relational",
14324            VOption::new()
14325                .set(
14326                    "left",
14327                    self,
14328                )
14329                .set(
14330                    "right",
14331                    right,
14332                )
14333                .set(
14334                    "out",
14335                    &mut out_out,
14336                )
14337                .set(
14338                    "relational",
14339                    relational as i32,
14340                ),
14341        );
14342
14343        utils::result(
14344            vips_op_response,
14345            out_out,
14346            Error::OperationError("Relational (vips_relational) failed".to_string()),
14347        )
14348    }
14349
14350    /// VipsRelationalConst (relational_const), relational operations against a constant
14351    /// returns `VipsImage` - Output image
14352    ///
14353    /// relational: `OperationRelational` -> Relational to perform
14354    ///
14355    /// c: `&[f64]` -> Array of constants
14356    pub fn relational_const(
14357        &self,
14358        relational: OperationRelational,
14359        c: &[f64],
14360    ) -> Result<VipsImage> {
14361        let mut out_out = VipsImage::from(null_mut());
14362        let vips_op_response = call(
14363            "relational_const",
14364            VOption::new()
14365                .set("in", self)
14366                .set(
14367                    "out",
14368                    &mut out_out,
14369                )
14370                .set(
14371                    "relational",
14372                    relational as i32,
14373                )
14374                .set("c", c),
14375        );
14376
14377        utils::result(
14378            vips_op_response,
14379            out_out,
14380            Error::OperationError("RelationalConst (vips_relational_const) failed".to_string()),
14381        )
14382    }
14383
14384    /// VipsRemainder (remainder), remainder after integer division of two images
14385    /// returns `VipsImage` - Output image
14386    ///
14387    /// right: `&VipsImage` -> Right-hand image argument
14388    pub fn remainder(&self, right: &VipsImage) -> Result<VipsImage> {
14389        let mut out_out = VipsImage::from(null_mut());
14390        let vips_op_response = call(
14391            "remainder",
14392            VOption::new()
14393                .set(
14394                    "left",
14395                    self,
14396                )
14397                .set(
14398                    "right",
14399                    right,
14400                )
14401                .set(
14402                    "out",
14403                    &mut out_out,
14404                ),
14405        );
14406
14407        utils::result(
14408            vips_op_response,
14409            out_out,
14410            Error::OperationError("Remainder (vips_remainder) failed".to_string()),
14411        )
14412    }
14413
14414    /// VipsRemainderConst (remainder_const), remainder after integer division of an image and a constant
14415    /// returns `VipsImage` - Output image
14416    ///
14417    /// c: `&[f64]` -> Array of constants
14418    pub fn remainder_const(&self, c: &[f64]) -> Result<VipsImage> {
14419        let mut out_out = VipsImage::from(null_mut());
14420        let vips_op_response = call(
14421            "remainder_const",
14422            VOption::new()
14423                .set("in", self)
14424                .set(
14425                    "out",
14426                    &mut out_out,
14427                )
14428                .set("c", c),
14429        );
14430
14431        utils::result(
14432            vips_op_response,
14433            out_out,
14434            Error::OperationError("RemainderConst (vips_remainder_const) failed".to_string()),
14435        )
14436    }
14437
14438    /// VipsRemosaic (remosaic), rebuild an mosaiced image
14439    /// returns `VipsImage` - Output image
14440    ///
14441    /// old_str: `&str` -> Search for this string
14442    ///
14443    /// new_str: `&str` -> And swap for this string
14444    pub fn remosaic(&self, old_str: &str, new_str: &str) -> Result<VipsImage> {
14445        let mut out_out = VipsImage::from(null_mut());
14446        let vips_op_response = call(
14447            "remosaic",
14448            VOption::new()
14449                .set("in", self)
14450                .set(
14451                    "out",
14452                    &mut out_out,
14453                )
14454                .set(
14455                    "old-str",
14456                    old_str,
14457                )
14458                .set(
14459                    "new-str",
14460                    new_str,
14461                ),
14462        );
14463
14464        utils::result(
14465            vips_op_response,
14466            out_out,
14467            Error::OperationError("Remosaic (vips_remosaic) failed".to_string()),
14468        )
14469    }
14470
14471    /// VipsReplicate (replicate), replicate an image
14472    /// returns `VipsImage` - Output image
14473    ///
14474    /// across: `i32` -> Repeat this many times horizontally
14475    ///
14476    /// down: `i32` -> Repeat this many times vertically
14477    pub fn replicate(&self, across: i32, down: i32) -> Result<VipsImage> {
14478        let mut out_out = VipsImage::from(null_mut());
14479        let vips_op_response = call(
14480            "replicate",
14481            VOption::new()
14482                .set("in", self)
14483                .set(
14484                    "out",
14485                    &mut out_out,
14486                )
14487                .set(
14488                    "across",
14489                    across,
14490                )
14491                .set(
14492                    "down",
14493                    down,
14494                ),
14495        );
14496
14497        utils::result(
14498            vips_op_response,
14499            out_out,
14500            Error::OperationError("Replicate (vips_replicate) failed".to_string()),
14501        )
14502    }
14503
14504    /// VipsResize (resize), resize an image
14505    /// returns `VipsImage` - Output image
14506    ///
14507    /// scale: `f64` -> Scale image by this factor
14508    pub fn resize(&self, scale: f64) -> Result<VipsImage> {
14509        let mut out_out = VipsImage::from(null_mut());
14510        let vips_op_response = call(
14511            "resize",
14512            VOption::new()
14513                .set("in", self)
14514                .set(
14515                    "out",
14516                    &mut out_out,
14517                )
14518                .set(
14519                    "scale",
14520                    scale,
14521                ),
14522        );
14523
14524        utils::result(
14525            vips_op_response,
14526            out_out,
14527            Error::OperationError("Resize (vips_resize) failed".to_string()),
14528        )
14529    }
14530
14531    /// VipsResize (resize), resize an image
14532    /// returns `VipsImage` - Output image
14533    ///
14534    /// scale: `f64` -> Scale image by this factor
14535    ///
14536    /// <ins>Optional arguments</ins>
14537    ///
14538    /// kernel: [`Kernel`] -> Resampling kernel
14539    ///
14540    /// gap: `f64` -> Reducing gap
14541    ///
14542    /// vscale: `f64` -> Vertical scale image by this factor
14543    pub fn resize_with_opts(&self, scale: f64, option: VOption) -> Result<VipsImage> {
14544        let mut out_out = VipsImage::from(null_mut());
14545        let vips_op_response = call(
14546            "resize",
14547            option
14548                .set("in", self)
14549                .set(
14550                    "out",
14551                    &mut out_out,
14552                )
14553                .set(
14554                    "scale",
14555                    scale,
14556                ),
14557        );
14558
14559        utils::result(
14560            vips_op_response,
14561            out_out,
14562            Error::OperationError("Resize (vips_resize) failed".to_string()),
14563        )
14564    }
14565
14566    /// VipsRot45 (rot45), rotate an image
14567    /// returns `VipsImage` - Output image
14568    pub fn rot45(&self) -> Result<VipsImage> {
14569        let mut out_out = VipsImage::from(null_mut());
14570        let vips_op_response = call(
14571            "rot45",
14572            VOption::new()
14573                .set("in", self)
14574                .set(
14575                    "out",
14576                    &mut out_out,
14577                ),
14578        );
14579
14580        utils::result(
14581            vips_op_response,
14582            out_out,
14583            Error::OperationError("Rot45 (vips_rot45) failed".to_string()),
14584        )
14585    }
14586
14587    /// VipsRot45 (rot45), rotate an image
14588    /// returns `VipsImage` - Output image
14589    ///
14590    /// <ins>Optional arguments</ins>
14591    ///
14592    /// angle: [`Angle45`] -> Angle to rotate image
14593    pub fn rot45_with_opts(&self, option: VOption) -> Result<VipsImage> {
14594        let mut out_out = VipsImage::from(null_mut());
14595        let vips_op_response = call(
14596            "rot45",
14597            option
14598                .set("in", self)
14599                .set(
14600                    "out",
14601                    &mut out_out,
14602                ),
14603        );
14604
14605        utils::result(
14606            vips_op_response,
14607            out_out,
14608            Error::OperationError("Rot45 (vips_rot45) failed".to_string()),
14609        )
14610    }
14611
14612    /// VipsRot (rot), rotate an image
14613    /// returns `VipsImage` - Output image
14614    ///
14615    /// angle: `Angle` -> Angle to rotate image
14616    pub fn rot(&self, angle: Angle) -> Result<VipsImage> {
14617        let mut out_out = VipsImage::from(null_mut());
14618        let vips_op_response = call(
14619            "rot",
14620            VOption::new()
14621                .set("in", self)
14622                .set(
14623                    "out",
14624                    &mut out_out,
14625                )
14626                .set(
14627                    "angle",
14628                    angle as i32,
14629                ),
14630        );
14631
14632        utils::result(
14633            vips_op_response,
14634            out_out,
14635            Error::OperationError("Rot (vips_rot) failed".to_string()),
14636        )
14637    }
14638
14639    /// VipsRotate (rotate), rotate an image by a number of degrees
14640    /// returns `VipsImage` - Output image
14641    ///
14642    /// angle: `f64` -> Rotate clockwise by this many degrees
14643    pub fn rotate(&self, angle: f64) -> Result<VipsImage> {
14644        let mut out_out = VipsImage::from(null_mut());
14645        let vips_op_response = call(
14646            "rotate",
14647            VOption::new()
14648                .set("in", self)
14649                .set(
14650                    "out",
14651                    &mut out_out,
14652                )
14653                .set(
14654                    "angle",
14655                    angle,
14656                ),
14657        );
14658
14659        utils::result(
14660            vips_op_response,
14661            out_out,
14662            Error::OperationError("Rotate (vips_rotate) failed".to_string()),
14663        )
14664    }
14665
14666    /// VipsRotate (rotate), rotate an image by a number of degrees
14667    /// returns `VipsImage` - Output image
14668    ///
14669    /// angle: `f64` -> Rotate clockwise by this many degrees
14670    ///
14671    /// <ins>Optional arguments</ins>
14672    ///
14673    /// interpolate: `&VipsInterpolate` -> Interpolate pixels with this
14674    ///
14675    /// background: `&[f64]` -> Background value
14676    ///
14677    /// odx: `f64` -> Horizontal output displacement
14678    ///
14679    /// ody: `f64` -> Vertical output displacement
14680    ///
14681    /// idx: `f64` -> Horizontal input displacement
14682    ///
14683    /// idy: `f64` -> Vertical input displacement
14684    pub fn rotate_with_opts(&self, angle: f64, option: VOption) -> Result<VipsImage> {
14685        let mut out_out = VipsImage::from(null_mut());
14686        let vips_op_response = call(
14687            "rotate",
14688            option
14689                .set("in", self)
14690                .set(
14691                    "out",
14692                    &mut out_out,
14693                )
14694                .set(
14695                    "angle",
14696                    angle,
14697                ),
14698        );
14699
14700        utils::result(
14701            vips_op_response,
14702            out_out,
14703            Error::OperationError("Rotate (vips_rotate) failed".to_string()),
14704        )
14705    }
14706
14707    /// VipsRound (round), perform a round function on an image
14708    /// returns `VipsImage` - Output image
14709    ///
14710    /// round: `OperationRound` -> Rounding operation to perform
14711    pub fn round(&self, round: OperationRound) -> Result<VipsImage> {
14712        let mut out_out = VipsImage::from(null_mut());
14713        let vips_op_response = call(
14714            "round",
14715            VOption::new()
14716                .set("in", self)
14717                .set(
14718                    "out",
14719                    &mut out_out,
14720                )
14721                .set(
14722                    "round",
14723                    round as i32,
14724                ),
14725        );
14726
14727        utils::result(
14728            vips_op_response,
14729            out_out,
14730            Error::OperationError("Round (vips_round) failed".to_string()),
14731        )
14732    }
14733
14734    /// VipssRGB2HSV (sRGB2HSV), transform sRGB to HSV
14735    /// returns `VipsImage` - Output image
14736    pub fn sRGB2HSV(&self) -> Result<VipsImage> {
14737        let mut out_out = VipsImage::from(null_mut());
14738        let vips_op_response = call(
14739            "sRGB2HSV",
14740            VOption::new()
14741                .set("in", self)
14742                .set(
14743                    "out",
14744                    &mut out_out,
14745                ),
14746        );
14747
14748        utils::result(
14749            vips_op_response,
14750            out_out,
14751            Error::OperationError("SRgb2Hsv (vips_sRGB2HSV) failed".to_string()),
14752        )
14753    }
14754
14755    /// VipssRGB2scRGB (sRGB2scRGB), convert an sRGB image to scRGB
14756    /// returns `VipsImage` - Output image
14757    pub fn sRGB2scRGB(&self) -> Result<VipsImage> {
14758        let mut out_out = VipsImage::from(null_mut());
14759        let vips_op_response = call(
14760            "sRGB2scRGB",
14761            VOption::new()
14762                .set("in", self)
14763                .set(
14764                    "out",
14765                    &mut out_out,
14766                ),
14767        );
14768
14769        utils::result(
14770            vips_op_response,
14771            out_out,
14772            Error::OperationError("SRgb2ScRgb (vips_sRGB2scRGB) failed".to_string()),
14773        )
14774    }
14775
14776    /// VipsscRGB2BW (scRGB2BW), convert scRGB to BW
14777    /// returns `VipsImage` - Output image
14778    pub fn scRGB2BW(&self) -> Result<VipsImage> {
14779        let mut out_out = VipsImage::from(null_mut());
14780        let vips_op_response = call(
14781            "scRGB2BW",
14782            VOption::new()
14783                .set("in", self)
14784                .set(
14785                    "out",
14786                    &mut out_out,
14787                ),
14788        );
14789
14790        utils::result(
14791            vips_op_response,
14792            out_out,
14793            Error::OperationError("ScRgb2Bw (vips_scRGB2BW) failed".to_string()),
14794        )
14795    }
14796
14797    /// VipsscRGB2BW (scRGB2BW), convert scRGB to BW
14798    /// returns `VipsImage` - Output image
14799    ///
14800    /// <ins>Optional arguments</ins>
14801    ///
14802    /// depth: `i32` -> Output device space depth in bits
14803    pub fn scRGB2BW_with_opts(&self, option: VOption) -> Result<VipsImage> {
14804        let mut out_out = VipsImage::from(null_mut());
14805        let vips_op_response = call(
14806            "scRGB2BW",
14807            option
14808                .set("in", self)
14809                .set(
14810                    "out",
14811                    &mut out_out,
14812                ),
14813        );
14814
14815        utils::result(
14816            vips_op_response,
14817            out_out,
14818            Error::OperationError("ScRgb2Bw (vips_scRGB2BW) failed".to_string()),
14819        )
14820    }
14821
14822    /// VipsscRGB2XYZ (scRGB2XYZ), transform scRGB to XYZ
14823    /// returns `VipsImage` - Output image
14824    pub fn scRGB2XYZ(&self) -> Result<VipsImage> {
14825        let mut out_out = VipsImage::from(null_mut());
14826        let vips_op_response = call(
14827            "scRGB2XYZ",
14828            VOption::new()
14829                .set("in", self)
14830                .set(
14831                    "out",
14832                    &mut out_out,
14833                ),
14834        );
14835
14836        utils::result(
14837            vips_op_response,
14838            out_out,
14839            Error::OperationError("ScRgb2Xyz (vips_scRGB2XYZ) failed".to_string()),
14840        )
14841    }
14842
14843    /// VipsscRGB2sRGB (scRGB2sRGB), convert scRGB to sRGB
14844    /// returns `VipsImage` - Output image
14845    pub fn scRGB2sRGB(&self) -> Result<VipsImage> {
14846        let mut out_out = VipsImage::from(null_mut());
14847        let vips_op_response = call(
14848            "scRGB2sRGB",
14849            VOption::new()
14850                .set("in", self)
14851                .set(
14852                    "out",
14853                    &mut out_out,
14854                ),
14855        );
14856
14857        utils::result(
14858            vips_op_response,
14859            out_out,
14860            Error::OperationError("ScRgb2SRgb (vips_scRGB2sRGB) failed".to_string()),
14861        )
14862    }
14863
14864    /// VipsscRGB2sRGB (scRGB2sRGB), convert scRGB to sRGB
14865    /// returns `VipsImage` - Output image
14866    ///
14867    /// <ins>Optional arguments</ins>
14868    ///
14869    /// depth: `i32` -> Output device space depth in bits
14870    pub fn scRGB2sRGB_with_opts(&self, option: VOption) -> Result<VipsImage> {
14871        let mut out_out = VipsImage::from(null_mut());
14872        let vips_op_response = call(
14873            "scRGB2sRGB",
14874            option
14875                .set("in", self)
14876                .set(
14877                    "out",
14878                    &mut out_out,
14879                ),
14880        );
14881
14882        utils::result(
14883            vips_op_response,
14884            out_out,
14885            Error::OperationError("ScRgb2SRgb (vips_scRGB2sRGB) failed".to_string()),
14886        )
14887    }
14888
14889    /// VipsScale (scale), scale an image to uchar
14890    /// returns `VipsImage` - Output image
14891    pub fn scale(&self) -> Result<VipsImage> {
14892        let mut out_out = VipsImage::from(null_mut());
14893        let vips_op_response = call(
14894            "scale",
14895            VOption::new()
14896                .set("in", self)
14897                .set(
14898                    "out",
14899                    &mut out_out,
14900                ),
14901        );
14902
14903        utils::result(
14904            vips_op_response,
14905            out_out,
14906            Error::OperationError("Scale (vips_scale) failed".to_string()),
14907        )
14908    }
14909
14910    /// VipsScale (scale), scale an image to uchar
14911    /// returns `VipsImage` - Output image
14912    ///
14913    /// <ins>Optional arguments</ins>
14914    ///
14915    /// exp: `f64` -> Exponent for log scale
14916    ///
14917    /// log: `bool` -> Log scale
14918    pub fn scale_with_opts(&self, option: VOption) -> Result<VipsImage> {
14919        let mut out_out = VipsImage::from(null_mut());
14920        let vips_op_response = call(
14921            "scale",
14922            option
14923                .set("in", self)
14924                .set(
14925                    "out",
14926                    &mut out_out,
14927                ),
14928        );
14929
14930        utils::result(
14931            vips_op_response,
14932            out_out,
14933            Error::OperationError("Scale (vips_scale) failed".to_string()),
14934        )
14935    }
14936
14937    /// VipsScharr (scharr), Scharr edge detector
14938    /// returns `VipsImage` - Output image
14939    pub fn scharr(&self) -> Result<VipsImage> {
14940        let mut out_out = VipsImage::from(null_mut());
14941        let vips_op_response = call(
14942            "scharr",
14943            VOption::new()
14944                .set("in", self)
14945                .set(
14946                    "out",
14947                    &mut out_out,
14948                ),
14949        );
14950
14951        utils::result(
14952            vips_op_response,
14953            out_out,
14954            Error::OperationError("Scharr (vips_scharr) failed".to_string()),
14955        )
14956    }
14957
14958    /// VipsSdf (sdf), create an SDF image
14959    /// returns `VipsImage` - Output image
14960    ///
14961    /// width: `i32` -> Image width in pixels
14962    ///
14963    /// height: `i32` -> Image height in pixels
14964    ///
14965    /// shape: `SdfShape` -> SDF shape to create
14966    pub fn sdf(width: i32, height: i32, shape: SdfShape) -> Result<VipsImage> {
14967        let mut out_out = VipsImage::from(null_mut());
14968        let vips_op_response = call(
14969            "sdf",
14970            VOption::new()
14971                .set(
14972                    "out",
14973                    &mut out_out,
14974                )
14975                .set(
14976                    "width",
14977                    width,
14978                )
14979                .set(
14980                    "height",
14981                    height,
14982                )
14983                .set(
14984                    "shape",
14985                    shape as i32,
14986                ),
14987        );
14988
14989        utils::result(
14990            vips_op_response,
14991            out_out,
14992            Error::OperationError("Sdf (vips_sdf) failed".to_string()),
14993        )
14994    }
14995
14996    /// VipsSdf (sdf), create an SDF image
14997    /// returns `VipsImage` - Output image
14998    ///
14999    /// width: `i32` -> Image width in pixels
15000    ///
15001    /// height: `i32` -> Image height in pixels
15002    ///
15003    /// shape: `SdfShape` -> SDF shape to create
15004    ///
15005    /// <ins>Optional arguments</ins>
15006    ///
15007    /// r: `f64` -> Radius
15008    ///
15009    /// a: `&[f64]` -> Point a
15010    ///
15011    /// b: `&[f64]` -> Point b
15012    ///
15013    /// corners: `&[f64]` -> Corner radii
15014    pub fn sdf_with_opts(
15015        width: i32,
15016        height: i32,
15017        shape: SdfShape,
15018        option: VOption,
15019    ) -> Result<VipsImage> {
15020        let mut out_out = VipsImage::from(null_mut());
15021        let vips_op_response = call(
15022            "sdf",
15023            option
15024                .set(
15025                    "out",
15026                    &mut out_out,
15027                )
15028                .set(
15029                    "width",
15030                    width,
15031                )
15032                .set(
15033                    "height",
15034                    height,
15035                )
15036                .set(
15037                    "shape",
15038                    shape as i32,
15039                ),
15040        );
15041
15042        utils::result(
15043            vips_op_response,
15044            out_out,
15045            Error::OperationError("Sdf (vips_sdf) failed".to_string()),
15046        )
15047    }
15048
15049    /// VipsSequential (sequential), check sequential access
15050    /// returns `VipsImage` - Output image
15051    pub fn sequential(&self) -> Result<VipsImage> {
15052        let mut out_out = VipsImage::from(null_mut());
15053        let vips_op_response = call(
15054            "sequential",
15055            VOption::new()
15056                .set("in", self)
15057                .set(
15058                    "out",
15059                    &mut out_out,
15060                ),
15061        );
15062
15063        utils::result(
15064            vips_op_response,
15065            out_out,
15066            Error::OperationError("Sequential (vips_sequential) failed".to_string()),
15067        )
15068    }
15069
15070    /// VipsSequential (sequential), check sequential access
15071    /// returns `VipsImage` - Output image
15072    ///
15073    /// <ins>Optional arguments</ins>
15074    ///
15075    /// tile_height: `i32` -> Tile height in pixels
15076    pub fn sequential_with_opts(&self, option: VOption) -> Result<VipsImage> {
15077        let mut out_out = VipsImage::from(null_mut());
15078        let vips_op_response = call(
15079            "sequential",
15080            option
15081                .set("in", self)
15082                .set(
15083                    "out",
15084                    &mut out_out,
15085                ),
15086        );
15087
15088        utils::result(
15089            vips_op_response,
15090            out_out,
15091            Error::OperationError("Sequential (vips_sequential) failed".to_string()),
15092        )
15093    }
15094
15095    /// VipsSharpen (sharpen), unsharp masking for print
15096    /// returns `VipsImage` - Output image
15097    pub fn sharpen(&self) -> Result<VipsImage> {
15098        let mut out_out = VipsImage::from(null_mut());
15099        let vips_op_response = call(
15100            "sharpen",
15101            VOption::new()
15102                .set("in", self)
15103                .set(
15104                    "out",
15105                    &mut out_out,
15106                ),
15107        );
15108
15109        utils::result(
15110            vips_op_response,
15111            out_out,
15112            Error::OperationError("Sharpen (vips_sharpen) failed".to_string()),
15113        )
15114    }
15115
15116    /// VipsSharpen (sharpen), unsharp masking for print
15117    /// returns `VipsImage` - Output image
15118    ///
15119    /// <ins>Optional arguments</ins>
15120    ///
15121    /// sigma: `f64` -> Sigma of Gaussian
15122    ///
15123    /// x1: `f64` -> Flat/jaggy threshold
15124    ///
15125    /// y2: `f64` -> Maximum brightening
15126    ///
15127    /// y3: `f64` -> Maximum darkening
15128    ///
15129    /// m1: `f64` -> Slope for flat areas
15130    ///
15131    /// m2: `f64` -> Slope for jaggy areas
15132    pub fn sharpen_with_opts(&self, option: VOption) -> Result<VipsImage> {
15133        let mut out_out = VipsImage::from(null_mut());
15134        let vips_op_response = call(
15135            "sharpen",
15136            option
15137                .set("in", self)
15138                .set(
15139                    "out",
15140                    &mut out_out,
15141                ),
15142        );
15143
15144        utils::result(
15145            vips_op_response,
15146            out_out,
15147            Error::OperationError("Sharpen (vips_sharpen) failed".to_string()),
15148        )
15149    }
15150
15151    /// VipsShrink (shrink), shrink an image
15152    /// returns `VipsImage` - Output image
15153    ///
15154    /// hshrink: `f64` -> Horizontal shrink factor
15155    ///
15156    /// vshrink: `f64` -> Vertical shrink factor
15157    pub fn shrink(&self, hshrink: f64, vshrink: f64) -> Result<VipsImage> {
15158        let mut out_out = VipsImage::from(null_mut());
15159        let vips_op_response = call(
15160            "shrink",
15161            VOption::new()
15162                .set("in", self)
15163                .set(
15164                    "out",
15165                    &mut out_out,
15166                )
15167                .set(
15168                    "hshrink",
15169                    hshrink,
15170                )
15171                .set(
15172                    "vshrink",
15173                    vshrink,
15174                ),
15175        );
15176
15177        utils::result(
15178            vips_op_response,
15179            out_out,
15180            Error::OperationError("Shrink (vips_shrink) failed".to_string()),
15181        )
15182    }
15183
15184    /// VipsShrink (shrink), shrink an image
15185    /// returns `VipsImage` - Output image
15186    ///
15187    /// hshrink: `f64` -> Horizontal shrink factor
15188    ///
15189    /// vshrink: `f64` -> Vertical shrink factor
15190    ///
15191    /// <ins>Optional arguments</ins>
15192    ///
15193    /// ceil: `bool` -> Round-up output dimensions
15194    pub fn shrink_with_opts(
15195        &self,
15196        hshrink: f64,
15197        vshrink: f64,
15198        option: VOption,
15199    ) -> Result<VipsImage> {
15200        let mut out_out = VipsImage::from(null_mut());
15201        let vips_op_response = call(
15202            "shrink",
15203            option
15204                .set("in", self)
15205                .set(
15206                    "out",
15207                    &mut out_out,
15208                )
15209                .set(
15210                    "hshrink",
15211                    hshrink,
15212                )
15213                .set(
15214                    "vshrink",
15215                    vshrink,
15216                ),
15217        );
15218
15219        utils::result(
15220            vips_op_response,
15221            out_out,
15222            Error::OperationError("Shrink (vips_shrink) failed".to_string()),
15223        )
15224    }
15225
15226    /// VipsShrinkh (shrinkh), shrink an image horizontally
15227    /// returns `VipsImage` - Output image
15228    ///
15229    /// hshrink: `i32` -> Horizontal shrink factor
15230    pub fn shrinkh(&self, hshrink: i32) -> Result<VipsImage> {
15231        let mut out_out = VipsImage::from(null_mut());
15232        let vips_op_response = call(
15233            "shrinkh",
15234            VOption::new()
15235                .set("in", self)
15236                .set(
15237                    "out",
15238                    &mut out_out,
15239                )
15240                .set(
15241                    "hshrink",
15242                    hshrink,
15243                ),
15244        );
15245
15246        utils::result(
15247            vips_op_response,
15248            out_out,
15249            Error::OperationError("Shrinkh (vips_shrinkh) failed".to_string()),
15250        )
15251    }
15252
15253    /// VipsShrinkh (shrinkh), shrink an image horizontally
15254    /// returns `VipsImage` - Output image
15255    ///
15256    /// hshrink: `i32` -> Horizontal shrink factor
15257    ///
15258    /// <ins>Optional arguments</ins>
15259    ///
15260    /// ceil: `bool` -> Round-up output dimensions
15261    pub fn shrinkh_with_opts(&self, hshrink: i32, option: VOption) -> Result<VipsImage> {
15262        let mut out_out = VipsImage::from(null_mut());
15263        let vips_op_response = call(
15264            "shrinkh",
15265            option
15266                .set("in", self)
15267                .set(
15268                    "out",
15269                    &mut out_out,
15270                )
15271                .set(
15272                    "hshrink",
15273                    hshrink,
15274                ),
15275        );
15276
15277        utils::result(
15278            vips_op_response,
15279            out_out,
15280            Error::OperationError("Shrinkh (vips_shrinkh) failed".to_string()),
15281        )
15282    }
15283
15284    /// VipsShrinkv (shrinkv), shrink an image vertically
15285    /// returns `VipsImage` - Output image
15286    ///
15287    /// vshrink: `i32` -> Vertical shrink factor
15288    pub fn shrinkv(&self, vshrink: i32) -> Result<VipsImage> {
15289        let mut out_out = VipsImage::from(null_mut());
15290        let vips_op_response = call(
15291            "shrinkv",
15292            VOption::new()
15293                .set("in", self)
15294                .set(
15295                    "out",
15296                    &mut out_out,
15297                )
15298                .set(
15299                    "vshrink",
15300                    vshrink,
15301                ),
15302        );
15303
15304        utils::result(
15305            vips_op_response,
15306            out_out,
15307            Error::OperationError("Shrinkv (vips_shrinkv) failed".to_string()),
15308        )
15309    }
15310
15311    /// VipsShrinkv (shrinkv), shrink an image vertically
15312    /// returns `VipsImage` - Output image
15313    ///
15314    /// vshrink: `i32` -> Vertical shrink factor
15315    ///
15316    /// <ins>Optional arguments</ins>
15317    ///
15318    /// ceil: `bool` -> Round-up output dimensions
15319    pub fn shrinkv_with_opts(&self, vshrink: i32, option: VOption) -> Result<VipsImage> {
15320        let mut out_out = VipsImage::from(null_mut());
15321        let vips_op_response = call(
15322            "shrinkv",
15323            option
15324                .set("in", self)
15325                .set(
15326                    "out",
15327                    &mut out_out,
15328                )
15329                .set(
15330                    "vshrink",
15331                    vshrink,
15332                ),
15333        );
15334
15335        utils::result(
15336            vips_op_response,
15337            out_out,
15338            Error::OperationError("Shrinkv (vips_shrinkv) failed".to_string()),
15339        )
15340    }
15341
15342    /// VipsSign (sign), unit vector of pixel
15343    /// returns `VipsImage` - Output image
15344    pub fn sign(&self) -> Result<VipsImage> {
15345        let mut out_out = VipsImage::from(null_mut());
15346        let vips_op_response = call(
15347            "sign",
15348            VOption::new()
15349                .set("in", self)
15350                .set(
15351                    "out",
15352                    &mut out_out,
15353                ),
15354        );
15355
15356        utils::result(
15357            vips_op_response,
15358            out_out,
15359            Error::OperationError("Sign (vips_sign) failed".to_string()),
15360        )
15361    }
15362
15363    /// VipsSimilarity (similarity), similarity transform of an image
15364    /// returns `VipsImage` - Output image
15365    pub fn similarity(&self) -> Result<VipsImage> {
15366        let mut out_out = VipsImage::from(null_mut());
15367        let vips_op_response = call(
15368            "similarity",
15369            VOption::new()
15370                .set("in", self)
15371                .set(
15372                    "out",
15373                    &mut out_out,
15374                ),
15375        );
15376
15377        utils::result(
15378            vips_op_response,
15379            out_out,
15380            Error::OperationError("Similarity (vips_similarity) failed".to_string()),
15381        )
15382    }
15383
15384    /// VipsSimilarity (similarity), similarity transform of an image
15385    /// returns `VipsImage` - Output image
15386    ///
15387    /// <ins>Optional arguments</ins>
15388    ///
15389    /// scale: `f64` -> Scale by this factor
15390    ///
15391    /// angle: `f64` -> Rotate clockwise by this many degrees
15392    ///
15393    /// interpolate: `&VipsInterpolate` -> Interpolate pixels with this
15394    ///
15395    /// background: `&[f64]` -> Background value
15396    ///
15397    /// odx: `f64` -> Horizontal output displacement
15398    ///
15399    /// ody: `f64` -> Vertical output displacement
15400    ///
15401    /// idx: `f64` -> Horizontal input displacement
15402    ///
15403    /// idy: `f64` -> Vertical input displacement
15404    pub fn similarity_with_opts(&self, option: VOption) -> Result<VipsImage> {
15405        let mut out_out = VipsImage::from(null_mut());
15406        let vips_op_response = call(
15407            "similarity",
15408            option
15409                .set("in", self)
15410                .set(
15411                    "out",
15412                    &mut out_out,
15413                ),
15414        );
15415
15416        utils::result(
15417            vips_op_response,
15418            out_out,
15419            Error::OperationError("Similarity (vips_similarity) failed".to_string()),
15420        )
15421    }
15422
15423    /// VipsSines (sines), make a 2D sine wave
15424    /// returns `VipsImage` - Output image
15425    ///
15426    /// width: `i32` -> Image width in pixels
15427    ///
15428    /// height: `i32` -> Image height in pixels
15429    pub fn sines(width: i32, height: i32) -> Result<VipsImage> {
15430        let mut out_out = VipsImage::from(null_mut());
15431        let vips_op_response = call(
15432            "sines",
15433            VOption::new()
15434                .set(
15435                    "out",
15436                    &mut out_out,
15437                )
15438                .set(
15439                    "width",
15440                    width,
15441                )
15442                .set(
15443                    "height",
15444                    height,
15445                ),
15446        );
15447
15448        utils::result(
15449            vips_op_response,
15450            out_out,
15451            Error::OperationError("Sines (vips_sines) failed".to_string()),
15452        )
15453    }
15454
15455    /// VipsSines (sines), make a 2D sine wave
15456    /// returns `VipsImage` - Output image
15457    ///
15458    /// width: `i32` -> Image width in pixels
15459    ///
15460    /// height: `i32` -> Image height in pixels
15461    ///
15462    /// <ins>Optional arguments</ins>
15463    ///
15464    /// uchar: `bool` -> Output an unsigned char image
15465    ///
15466    /// hfreq: `f64` -> Horizontal spatial frequency
15467    ///
15468    /// vfreq: `f64` -> Vertical spatial frequency
15469    pub fn sines_with_opts(width: i32, height: i32, option: VOption) -> Result<VipsImage> {
15470        let mut out_out = VipsImage::from(null_mut());
15471        let vips_op_response = call(
15472            "sines",
15473            option
15474                .set(
15475                    "out",
15476                    &mut out_out,
15477                )
15478                .set(
15479                    "width",
15480                    width,
15481                )
15482                .set(
15483                    "height",
15484                    height,
15485                ),
15486        );
15487
15488        utils::result(
15489            vips_op_response,
15490            out_out,
15491            Error::OperationError("Sines (vips_sines) failed".to_string()),
15492        )
15493    }
15494
15495    /// VipsSmartcrop (smartcrop), extract an area from an image
15496    /// returns `VipsImage` - Output image
15497    ///
15498    /// width: `i32` -> Width of extract area
15499    ///
15500    /// height: `i32` -> Height of extract area
15501    pub fn smartcrop(&self, width: i32, height: i32) -> Result<VipsImage> {
15502        let mut out_out = VipsImage::from(null_mut());
15503        let vips_op_response = call(
15504            "smartcrop",
15505            VOption::new()
15506                .set(
15507                    "input",
15508                    self,
15509                )
15510                .set(
15511                    "out",
15512                    &mut out_out,
15513                )
15514                .set(
15515                    "width",
15516                    width,
15517                )
15518                .set(
15519                    "height",
15520                    height,
15521                ),
15522        );
15523
15524        utils::result(
15525            vips_op_response,
15526            out_out,
15527            Error::OperationError("Smartcrop (vips_smartcrop) failed".to_string()),
15528        )
15529    }
15530
15531    /// VipsSmartcrop (smartcrop), extract an area from an image
15532    /// returns `VipsImage` - Output image
15533    ///
15534    /// width: `i32` -> Width of extract area
15535    ///
15536    /// height: `i32` -> Height of extract area
15537    ///
15538    /// <ins>Optional arguments</ins>
15539    ///
15540    /// attention_x: `&mut i32` -> Horizontal position of attention centre
15541    ///
15542    /// attention_y: `&mut i32` -> Vertical position of attention centre
15543    ///
15544    /// interesting: [`Interesting`] -> How to measure interestingness
15545    ///
15546    /// premultiplied: `bool` -> Input image already has premultiplied alpha
15547    pub fn smartcrop_with_opts(
15548        &self,
15549        width: i32,
15550        height: i32,
15551        option: VOption,
15552    ) -> Result<VipsImage> {
15553        let mut out_out = VipsImage::from(null_mut());
15554        let vips_op_response = call(
15555            "smartcrop",
15556            option
15557                .set(
15558                    "input",
15559                    self,
15560                )
15561                .set(
15562                    "out",
15563                    &mut out_out,
15564                )
15565                .set(
15566                    "width",
15567                    width,
15568                )
15569                .set(
15570                    "height",
15571                    height,
15572                ),
15573        );
15574
15575        utils::result(
15576            vips_op_response,
15577            out_out,
15578            Error::OperationError("Smartcrop (vips_smartcrop) failed".to_string()),
15579        )
15580    }
15581
15582    /// VipsSobel (sobel), Sobel edge detector
15583    /// returns `VipsImage` - Output image
15584    pub fn sobel(&self) -> Result<VipsImage> {
15585        let mut out_out = VipsImage::from(null_mut());
15586        let vips_op_response = call(
15587            "sobel",
15588            VOption::new()
15589                .set("in", self)
15590                .set(
15591                    "out",
15592                    &mut out_out,
15593                ),
15594        );
15595
15596        utils::result(
15597            vips_op_response,
15598            out_out,
15599            Error::OperationError("Sobel (vips_sobel) failed".to_string()),
15600        )
15601    }
15602
15603    /// VipsSpcor (spcor), spatial correlation
15604    /// returns `VipsImage` - Output image
15605    ///
15606    /// refp: `&VipsImage` -> Input reference image
15607    pub fn spcor(&self, refp: &VipsImage) -> Result<VipsImage> {
15608        let mut out_out = VipsImage::from(null_mut());
15609        let vips_op_response = call(
15610            "spcor",
15611            VOption::new()
15612                .set("in", self)
15613                .set(
15614                    "ref", refp,
15615                )
15616                .set(
15617                    "out",
15618                    &mut out_out,
15619                ),
15620        );
15621
15622        utils::result(
15623            vips_op_response,
15624            out_out,
15625            Error::OperationError("Spcor (vips_spcor) failed".to_string()),
15626        )
15627    }
15628
15629    /// VipsSpectrum (spectrum), make displayable power spectrum
15630    /// returns `VipsImage` - Output image
15631    pub fn spectrum(&self) -> Result<VipsImage> {
15632        let mut out_out = VipsImage::from(null_mut());
15633        let vips_op_response = call(
15634            "spectrum",
15635            VOption::new()
15636                .set("in", self)
15637                .set(
15638                    "out",
15639                    &mut out_out,
15640                ),
15641        );
15642
15643        utils::result(
15644            vips_op_response,
15645            out_out,
15646            Error::OperationError("Spectrum (vips_spectrum) failed".to_string()),
15647        )
15648    }
15649
15650    /// VipsStats (stats), find many image stats
15651    /// returns `VipsImage` - Output array of statistics
15652    pub fn stats(&self) -> Result<VipsImage> {
15653        let mut out_out = VipsImage::from(null_mut());
15654        let vips_op_response = call(
15655            "stats",
15656            VOption::new()
15657                .set("in", self)
15658                .set(
15659                    "out",
15660                    &mut out_out,
15661                ),
15662        );
15663
15664        utils::result(
15665            vips_op_response,
15666            out_out,
15667            Error::OperationError("Stats (vips_stats) failed".to_string()),
15668        )
15669    }
15670
15671    /// VipsStdif (stdif), statistical difference
15672    /// returns `VipsImage` - Output image
15673    ///
15674    /// width: `i32` -> Window width in pixels
15675    ///
15676    /// height: `i32` -> Window height in pixels
15677    pub fn stdif(&self, width: i32, height: i32) -> Result<VipsImage> {
15678        let mut out_out = VipsImage::from(null_mut());
15679        let vips_op_response = call(
15680            "stdif",
15681            VOption::new()
15682                .set("in", self)
15683                .set(
15684                    "out",
15685                    &mut out_out,
15686                )
15687                .set(
15688                    "width",
15689                    width,
15690                )
15691                .set(
15692                    "height",
15693                    height,
15694                ),
15695        );
15696
15697        utils::result(
15698            vips_op_response,
15699            out_out,
15700            Error::OperationError("Stdif (vips_stdif) failed".to_string()),
15701        )
15702    }
15703
15704    /// VipsStdif (stdif), statistical difference
15705    /// returns `VipsImage` - Output image
15706    ///
15707    /// width: `i32` -> Window width in pixels
15708    ///
15709    /// height: `i32` -> Window height in pixels
15710    ///
15711    /// <ins>Optional arguments</ins>
15712    ///
15713    /// s0: `f64` -> New deviation
15714    ///
15715    /// b: `f64` -> Weight of new deviation
15716    ///
15717    /// m0: `f64` -> New mean
15718    ///
15719    /// a: `f64` -> Weight of new mean
15720    pub fn stdif_with_opts(&self, width: i32, height: i32, option: VOption) -> Result<VipsImage> {
15721        let mut out_out = VipsImage::from(null_mut());
15722        let vips_op_response = call(
15723            "stdif",
15724            option
15725                .set("in", self)
15726                .set(
15727                    "out",
15728                    &mut out_out,
15729                )
15730                .set(
15731                    "width",
15732                    width,
15733                )
15734                .set(
15735                    "height",
15736                    height,
15737                ),
15738        );
15739
15740        utils::result(
15741            vips_op_response,
15742            out_out,
15743            Error::OperationError("Stdif (vips_stdif) failed".to_string()),
15744        )
15745    }
15746
15747    /// VipsSubsample (subsample), subsample an image
15748    /// returns `VipsImage` - Output image
15749    ///
15750    /// xfac: `i32` -> Horizontal subsample factor
15751    ///
15752    /// yfac: `i32` -> Vertical subsample factor
15753    pub fn subsample(&self, xfac: i32, yfac: i32) -> Result<VipsImage> {
15754        let mut out_out = VipsImage::from(null_mut());
15755        let vips_op_response = call(
15756            "subsample",
15757            VOption::new()
15758                .set(
15759                    "input",
15760                    self,
15761                )
15762                .set(
15763                    "out",
15764                    &mut out_out,
15765                )
15766                .set(
15767                    "xfac",
15768                    xfac,
15769                )
15770                .set(
15771                    "yfac",
15772                    yfac,
15773                ),
15774        );
15775
15776        utils::result(
15777            vips_op_response,
15778            out_out,
15779            Error::OperationError("Subsample (vips_subsample) failed".to_string()),
15780        )
15781    }
15782
15783    /// VipsSubsample (subsample), subsample an image
15784    /// returns `VipsImage` - Output image
15785    ///
15786    /// xfac: `i32` -> Horizontal subsample factor
15787    ///
15788    /// yfac: `i32` -> Vertical subsample factor
15789    ///
15790    /// <ins>Optional arguments</ins>
15791    ///
15792    /// point: `bool` -> Point sample
15793    pub fn subsample_with_opts(&self, xfac: i32, yfac: i32, option: VOption) -> Result<VipsImage> {
15794        let mut out_out = VipsImage::from(null_mut());
15795        let vips_op_response = call(
15796            "subsample",
15797            option
15798                .set(
15799                    "input",
15800                    self,
15801                )
15802                .set(
15803                    "out",
15804                    &mut out_out,
15805                )
15806                .set(
15807                    "xfac",
15808                    xfac,
15809                )
15810                .set(
15811                    "yfac",
15812                    yfac,
15813                ),
15814        );
15815
15816        utils::result(
15817            vips_op_response,
15818            out_out,
15819            Error::OperationError("Subsample (vips_subsample) failed".to_string()),
15820        )
15821    }
15822
15823    /// VipsSubtract (subtract), subtract two images
15824    /// returns `VipsImage` - Output image
15825    ///
15826    /// right: `&VipsImage` -> Right-hand image argument
15827    pub fn subtract(&self, right: &VipsImage) -> Result<VipsImage> {
15828        let mut out_out = VipsImage::from(null_mut());
15829        let vips_op_response = call(
15830            "subtract",
15831            VOption::new()
15832                .set(
15833                    "left",
15834                    self,
15835                )
15836                .set(
15837                    "right",
15838                    right,
15839                )
15840                .set(
15841                    "out",
15842                    &mut out_out,
15843                ),
15844        );
15845
15846        utils::result(
15847            vips_op_response,
15848            out_out,
15849            Error::OperationError("Subtract (vips_subtract) failed".to_string()),
15850        )
15851    }
15852
15853    /// VipsSum (sum), sum an array of images
15854    /// returns `VipsImage` - Output image
15855    ///
15856    /// inp: `&[VipsImage]` -> Array of input images
15857    pub fn sum(inp: &[VipsImage]) -> Result<VipsImage> {
15858        let mut out_out = VipsImage::from(null_mut());
15859        let vips_op_response = call(
15860            "sum",
15861            VOption::new()
15862                .set("in", inp)
15863                .set(
15864                    "out",
15865                    &mut out_out,
15866                ),
15867        );
15868
15869        utils::result(
15870            vips_op_response,
15871            out_out,
15872            Error::OperationError("Sum (vips_sum) failed".to_string()),
15873        )
15874    }
15875
15876    /// VipsForeignLoadSvgFile (svgload), load SVG with rsvg (.svg, .svgz, .svg.gz), priority=-5, untrusted, is_a, get_flags, get_flags_filename, header, load
15877    /// returns `VipsImage` - Output image
15878    ///
15879    /// filename: `&str` -> Filename to load from
15880    pub fn svgload(filename: &str) -> Result<VipsImage> {
15881        let mut out_out = VipsImage::from(null_mut());
15882        let vips_op_response = call(
15883            "svgload",
15884            VOption::new()
15885                .set(
15886                    "filename",
15887                    filename,
15888                )
15889                .set(
15890                    "out",
15891                    &mut out_out,
15892                ),
15893        );
15894
15895        utils::result(
15896            vips_op_response,
15897            out_out,
15898            Error::OperationError("Svgload (vips_svgload) failed".to_string()),
15899        )
15900    }
15901
15902    /// VipsForeignLoadSvgFile (svgload), load SVG with rsvg (.svg, .svgz, .svg.gz), priority=-5, untrusted, is_a, get_flags, get_flags_filename, header, load
15903    /// returns `VipsImage` - Output image
15904    ///
15905    /// filename: `&str` -> Filename to load from
15906    ///
15907    /// <ins>Optional arguments</ins>
15908    ///
15909    /// dpi: `f64` -> Render at this DPI
15910    ///
15911    /// scale: `f64` -> Scale output by this factor
15912    ///
15913    /// unlimited: `bool` -> Allow SVG of any size
15914    ///
15915    /// stylesheet: `&str` -> Custom CSS
15916    ///
15917    /// high_bitdepth: `bool` -> Enable scRGB 128-bit output (32-bit per channel)
15918    ///
15919    /// flags: [`ForeignFlags`] -> Flags for this file
15920    ///
15921    /// memory: `bool` -> Force open via memory
15922    ///
15923    /// access: [`Access`] -> Required access pattern for this file
15924    ///
15925    /// fail_on: [`FailOn`] -> Error level to fail on
15926    ///
15927    /// revalidate: `bool` -> Don't use a cached result for this operation
15928    pub fn svgload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
15929        let mut out_out = VipsImage::from(null_mut());
15930        let vips_op_response = call(
15931            "svgload",
15932            option
15933                .set(
15934                    "filename",
15935                    filename,
15936                )
15937                .set(
15938                    "out",
15939                    &mut out_out,
15940                ),
15941        );
15942
15943        utils::result(
15944            vips_op_response,
15945            out_out,
15946            Error::OperationError("Svgload (vips_svgload) failed".to_string()),
15947        )
15948    }
15949
15950    /// VipsForeignLoadSvgBuffer (svgload_buffer), load SVG with rsvg, priority=-5, untrusted, is_a_buffer, get_flags, get_flags_filename, header, load
15951    /// returns `VipsImage` - Output image
15952    ///
15953    /// buffer: `&[u8]` -> Buffer to load from
15954    pub fn svgload_buffer(buffer: &[u8]) -> Result<VipsImage> {
15955        let blob = unsafe {
15956            vips_blob_new(
15957                None,
15958                buffer.as_ptr() as _,
15959                buffer.len() as _,
15960            )
15961        };
15962        let mut out_out = VipsImage::from(null_mut());
15963        let vips_op_response = call(
15964            "svgload_buffer",
15965            VOption::new()
15966                .set(
15967                    "buffer",
15968                    &VipsBlob::from(blob),
15969                )
15970                .set(
15971                    "out",
15972                    &mut out_out,
15973                ),
15974        );
15975        unsafe { vips_area_unref(&mut (*blob).area) };
15976        utils::result(
15977            vips_op_response,
15978            out_out,
15979            Error::OperationError("SvgloadBuffer (vips_svgload_buffer) failed".to_string()),
15980        )
15981    }
15982
15983    /// VipsForeignLoadSvgBuffer (svgload_buffer), load SVG with rsvg, priority=-5, untrusted, is_a_buffer, get_flags, get_flags_filename, header, load
15984    /// returns `VipsImage` - Output image
15985    ///
15986    /// buffer: `&[u8]` -> Buffer to load from
15987    ///
15988    /// <ins>Optional arguments</ins>
15989    ///
15990    /// dpi: `f64` -> Render at this DPI
15991    ///
15992    /// scale: `f64` -> Scale output by this factor
15993    ///
15994    /// unlimited: `bool` -> Allow SVG of any size
15995    ///
15996    /// stylesheet: `&str` -> Custom CSS
15997    ///
15998    /// high_bitdepth: `bool` -> Enable scRGB 128-bit output (32-bit per channel)
15999    ///
16000    /// flags: [`ForeignFlags`] -> Flags for this file
16001    ///
16002    /// memory: `bool` -> Force open via memory
16003    ///
16004    /// access: [`Access`] -> Required access pattern for this file
16005    ///
16006    /// fail_on: [`FailOn`] -> Error level to fail on
16007    ///
16008    /// revalidate: `bool` -> Don't use a cached result for this operation
16009    pub fn svgload_buffer_with_opts(buffer: &[u8], option: VOption) -> Result<VipsImage> {
16010        let blob = unsafe {
16011            vips_blob_new(
16012                None,
16013                buffer.as_ptr() as _,
16014                buffer.len() as _,
16015            )
16016        };
16017        let mut out_out = VipsImage::from(null_mut());
16018        let vips_op_response = call(
16019            "svgload_buffer",
16020            option
16021                .set(
16022                    "buffer",
16023                    &VipsBlob::from(blob),
16024                )
16025                .set(
16026                    "out",
16027                    &mut out_out,
16028                ),
16029        );
16030        unsafe { vips_area_unref(&mut (*blob).area) };
16031        utils::result(
16032            vips_op_response,
16033            out_out,
16034            Error::OperationError("SvgloadBuffer (vips_svgload_buffer) failed".to_string()),
16035        )
16036    }
16037
16038    /// VipsForeignLoadSvgSource (svgload_source), load svg from source, priority=-5, untrusted, is_a_source, get_flags, get_flags_filename, header, load
16039    /// returns `VipsImage` - Output image
16040    ///
16041    /// source: `&VipsSource` -> Source to load from
16042    pub fn svgload_source(source: &VipsSource) -> Result<VipsImage> {
16043        let mut out_out = VipsImage::from(null_mut());
16044        let vips_op_response = call(
16045            "svgload_source",
16046            VOption::new()
16047                .set(
16048                    "source",
16049                    source,
16050                )
16051                .set(
16052                    "out",
16053                    &mut out_out,
16054                ),
16055        );
16056
16057        utils::result(
16058            vips_op_response,
16059            out_out,
16060            Error::OperationError("SvgloadSource (vips_svgload_source) failed".to_string()),
16061        )
16062    }
16063
16064    /// VipsForeignLoadSvgSource (svgload_source), load svg from source, priority=-5, untrusted, is_a_source, get_flags, get_flags_filename, header, load
16065    /// returns `VipsImage` - Output image
16066    ///
16067    /// source: `&VipsSource` -> Source to load from
16068    ///
16069    /// <ins>Optional arguments</ins>
16070    ///
16071    /// dpi: `f64` -> Render at this DPI
16072    ///
16073    /// scale: `f64` -> Scale output by this factor
16074    ///
16075    /// unlimited: `bool` -> Allow SVG of any size
16076    ///
16077    /// stylesheet: `&str` -> Custom CSS
16078    ///
16079    /// high_bitdepth: `bool` -> Enable scRGB 128-bit output (32-bit per channel)
16080    ///
16081    /// flags: [`ForeignFlags`] -> Flags for this file
16082    ///
16083    /// memory: `bool` -> Force open via memory
16084    ///
16085    /// access: [`Access`] -> Required access pattern for this file
16086    ///
16087    /// fail_on: [`FailOn`] -> Error level to fail on
16088    ///
16089    /// revalidate: `bool` -> Don't use a cached result for this operation
16090    pub fn svgload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
16091        let mut out_out = VipsImage::from(null_mut());
16092        let vips_op_response = call(
16093            "svgload_source",
16094            option
16095                .set(
16096                    "source",
16097                    source,
16098                )
16099                .set(
16100                    "out",
16101                    &mut out_out,
16102                ),
16103        );
16104
16105        utils::result(
16106            vips_op_response,
16107            out_out,
16108            Error::OperationError("SvgloadSource (vips_svgload_source) failed".to_string()),
16109        )
16110    }
16111
16112    /// VipsSwitch (switch), find the index of the first non-zero pixel in tests
16113    /// returns `VipsImage` - Output image
16114    ///
16115    /// tests: `&[VipsImage]` -> Table of images to test
16116    pub fn switch(tests: &[VipsImage]) -> Result<VipsImage> {
16117        let mut out_out = VipsImage::from(null_mut());
16118        let vips_op_response = call(
16119            "switch",
16120            VOption::new()
16121                .set(
16122                    "tests",
16123                    tests,
16124                )
16125                .set(
16126                    "out",
16127                    &mut out_out,
16128                ),
16129        );
16130
16131        utils::result(
16132            vips_op_response,
16133            out_out,
16134            Error::OperationError("Switch (vips_switch) failed".to_string()),
16135        )
16136    }
16137
16138    /// VipsSystem (system), run an external command
16139    ///
16140    /// cmd_format: `&str` -> Command to run
16141    pub fn system(cmd_format: &str) -> Result<()> {
16142        let vips_op_response = call(
16143            "system",
16144            VOption::new().set(
16145                "cmd-format",
16146                cmd_format,
16147            ),
16148        );
16149
16150        utils::result(
16151            vips_op_response,
16152            (),
16153            Error::OperationError("System (vips_system) failed".to_string()),
16154        )
16155    }
16156
16157    /// VipsSystem (system), run an external command
16158    ///
16159    /// cmd_format: `&str` -> Command to run
16160    ///
16161    /// <ins>Optional arguments</ins>
16162    ///
16163    /// inp: `&[VipsImage]` -> Array of input images
16164    ///
16165    /// out: `&mut VipsImage` -> Output image
16166    ///
16167    /// log: `&str` -> Command log
16168    ///
16169    /// out_format: `&str` -> Format for output filename
16170    ///
16171    /// in_format: `&str` -> Format for input filename
16172    pub fn system_with_opts(cmd_format: &str, option: VOption) -> Result<()> {
16173        let vips_op_response = call(
16174            "system",
16175            option.set(
16176                "cmd-format",
16177                cmd_format,
16178            ),
16179        );
16180
16181        utils::result(
16182            vips_op_response,
16183            (),
16184            Error::OperationError("System (vips_system) failed".to_string()),
16185        )
16186    }
16187
16188    /// VipsText (text), make a text image
16189    /// returns `VipsImage` - Output image
16190    ///
16191    /// text: `&str` -> Text to render
16192    pub fn text(text: &str) -> Result<VipsImage> {
16193        let mut out_out = VipsImage::from(null_mut());
16194        let vips_op_response = call(
16195            "text",
16196            VOption::new()
16197                .set(
16198                    "out",
16199                    &mut out_out,
16200                )
16201                .set(
16202                    "text",
16203                    text,
16204                ),
16205        );
16206
16207        utils::result(
16208            vips_op_response,
16209            out_out,
16210            Error::OperationError("Text (vips_text) failed".to_string()),
16211        )
16212    }
16213
16214    /// VipsText (text), make a text image
16215    /// returns `VipsImage` - Output image
16216    ///
16217    /// text: `&str` -> Text to render
16218    ///
16219    /// <ins>Optional arguments</ins>
16220    ///
16221    /// font: `&str` -> Font to render with
16222    ///
16223    /// width: `i32` -> Maximum image width in pixels
16224    ///
16225    /// height: `i32` -> Maximum image height in pixels
16226    ///
16227    /// align: [`Align`] -> Align on the low, centre or high edge
16228    ///
16229    /// justify: `bool` -> Justify lines
16230    ///
16231    /// dpi: `i32` -> DPI to render at
16232    ///
16233    /// autofit_dpi: `&mut i32` -> DPI selected by autofit
16234    ///
16235    /// spacing: `i32` -> Line spacing
16236    ///
16237    /// fontfile: `&str` -> Load this font file
16238    ///
16239    /// rgba: `bool` -> Enable RGBA output
16240    ///
16241    /// wrap: [`TextWrap`] -> Wrap lines on word or character boundaries
16242    pub fn text_with_opts(text: &str, option: VOption) -> Result<VipsImage> {
16243        let mut out_out = VipsImage::from(null_mut());
16244        let vips_op_response = call(
16245            "text",
16246            option
16247                .set(
16248                    "out",
16249                    &mut out_out,
16250                )
16251                .set(
16252                    "text",
16253                    text,
16254                ),
16255        );
16256
16257        utils::result(
16258            vips_op_response,
16259            out_out,
16260            Error::OperationError("Text (vips_text) failed".to_string()),
16261        )
16262    }
16263
16264    /// VipsThumbnailFile (thumbnail), generate thumbnail from file
16265    /// returns `VipsImage` - Output image
16266    ///
16267    /// filename: `&str` -> Filename to read from
16268    ///
16269    /// width: `i32` -> Size to this width
16270    pub fn thumbnail(filename: &str, width: i32) -> Result<VipsImage> {
16271        let mut out_out = VipsImage::from(null_mut());
16272        let vips_op_response = call(
16273            "thumbnail",
16274            VOption::new()
16275                .set(
16276                    "filename",
16277                    filename,
16278                )
16279                .set(
16280                    "out",
16281                    &mut out_out,
16282                )
16283                .set(
16284                    "width",
16285                    width,
16286                ),
16287        );
16288
16289        utils::result(
16290            vips_op_response,
16291            out_out,
16292            Error::OperationError("Thumbnail (vips_thumbnail) failed".to_string()),
16293        )
16294    }
16295
16296    /// VipsThumbnailFile (thumbnail), generate thumbnail from file
16297    /// returns `VipsImage` - Output image
16298    ///
16299    /// filename: `&str` -> Filename to read from
16300    ///
16301    /// width: `i32` -> Size to this width
16302    ///
16303    /// <ins>Optional arguments</ins>
16304    ///
16305    /// height: `i32` -> Size to this height
16306    ///
16307    /// size: [`Size`] -> Only upsize, only downsize, or both
16308    ///
16309    /// no_rotate: `bool` -> Don't use orientation tags to rotate image upright
16310    ///
16311    /// crop: [`Interesting`] -> Reduce to fill target rectangle, then crop
16312    ///
16313    /// linear: `bool` -> Reduce in linear light
16314    ///
16315    /// input_profile: `&str` -> Fallback input profile
16316    ///
16317    /// output_profile: `&str` -> Fallback output profile
16318    ///
16319    /// intent: [`Intent`] -> Rendering intent
16320    ///
16321    /// fail_on: [`FailOn`] -> Error level to fail on
16322    pub fn thumbnail_with_opts(filename: &str, width: i32, option: VOption) -> Result<VipsImage> {
16323        let mut out_out = VipsImage::from(null_mut());
16324        let vips_op_response = call(
16325            "thumbnail",
16326            option
16327                .set(
16328                    "filename",
16329                    filename,
16330                )
16331                .set(
16332                    "out",
16333                    &mut out_out,
16334                )
16335                .set(
16336                    "width",
16337                    width,
16338                ),
16339        );
16340
16341        utils::result(
16342            vips_op_response,
16343            out_out,
16344            Error::OperationError("Thumbnail (vips_thumbnail) failed".to_string()),
16345        )
16346    }
16347
16348    /// VipsThumbnailBuffer (thumbnail_buffer), generate thumbnail from buffer
16349    /// returns `VipsImage` - Output image
16350    ///
16351    /// buffer: `&[u8]` -> Buffer to load from
16352    ///
16353    /// width: `i32` -> Size to this width
16354    pub fn thumbnail_buffer(buffer: &[u8], width: i32) -> Result<VipsImage> {
16355        let blob = unsafe {
16356            vips_blob_new(
16357                None,
16358                buffer.as_ptr() as _,
16359                buffer.len() as _,
16360            )
16361        };
16362        let mut out_out = VipsImage::from(null_mut());
16363        let vips_op_response = call(
16364            "thumbnail_buffer",
16365            VOption::new()
16366                .set(
16367                    "buffer",
16368                    &VipsBlob::from(blob),
16369                )
16370                .set(
16371                    "out",
16372                    &mut out_out,
16373                )
16374                .set(
16375                    "width",
16376                    width,
16377                ),
16378        );
16379        unsafe { vips_area_unref(&mut (*blob).area) };
16380        utils::result(
16381            vips_op_response,
16382            out_out,
16383            Error::OperationError("ThumbnailBuffer (vips_thumbnail_buffer) failed".to_string()),
16384        )
16385    }
16386
16387    /// VipsThumbnailBuffer (thumbnail_buffer), generate thumbnail from buffer
16388    /// returns `VipsImage` - Output image
16389    ///
16390    /// buffer: `&[u8]` -> Buffer to load from
16391    ///
16392    /// width: `i32` -> Size to this width
16393    ///
16394    /// <ins>Optional arguments</ins>
16395    ///
16396    /// option_string: `&str` -> Options that are passed on to the underlying loader
16397    ///
16398    /// height: `i32` -> Size to this height
16399    ///
16400    /// size: [`Size`] -> Only upsize, only downsize, or both
16401    ///
16402    /// no_rotate: `bool` -> Don't use orientation tags to rotate image upright
16403    ///
16404    /// crop: [`Interesting`] -> Reduce to fill target rectangle, then crop
16405    ///
16406    /// linear: `bool` -> Reduce in linear light
16407    ///
16408    /// input_profile: `&str` -> Fallback input profile
16409    ///
16410    /// output_profile: `&str` -> Fallback output profile
16411    ///
16412    /// intent: [`Intent`] -> Rendering intent
16413    ///
16414    /// fail_on: [`FailOn`] -> Error level to fail on
16415    pub fn thumbnail_buffer_with_opts(
16416        buffer: &[u8],
16417        width: i32,
16418        option: VOption,
16419    ) -> Result<VipsImage> {
16420        let blob = unsafe {
16421            vips_blob_new(
16422                None,
16423                buffer.as_ptr() as _,
16424                buffer.len() as _,
16425            )
16426        };
16427        let mut out_out = VipsImage::from(null_mut());
16428        let vips_op_response = call(
16429            "thumbnail_buffer",
16430            option
16431                .set(
16432                    "buffer",
16433                    &VipsBlob::from(blob),
16434                )
16435                .set(
16436                    "out",
16437                    &mut out_out,
16438                )
16439                .set(
16440                    "width",
16441                    width,
16442                ),
16443        );
16444        unsafe { vips_area_unref(&mut (*blob).area) };
16445        utils::result(
16446            vips_op_response,
16447            out_out,
16448            Error::OperationError("ThumbnailBuffer (vips_thumbnail_buffer) failed".to_string()),
16449        )
16450    }
16451
16452    /// VipsThumbnailImage (thumbnail_image), generate thumbnail from image
16453    /// returns `VipsImage` - Output image
16454    ///
16455    /// width: `i32` -> Size to this width
16456    pub fn thumbnail_image(&self, width: i32) -> Result<VipsImage> {
16457        let mut out_out = VipsImage::from(null_mut());
16458        let vips_op_response = call(
16459            "thumbnail_image",
16460            VOption::new()
16461                .set("in", self)
16462                .set(
16463                    "out",
16464                    &mut out_out,
16465                )
16466                .set(
16467                    "width",
16468                    width,
16469                ),
16470        );
16471
16472        utils::result(
16473            vips_op_response,
16474            out_out,
16475            Error::OperationError("ThumbnailImage (vips_thumbnail_image) failed".to_string()),
16476        )
16477    }
16478
16479    /// VipsThumbnailImage (thumbnail_image), generate thumbnail from image
16480    /// returns `VipsImage` - Output image
16481    ///
16482    /// width: `i32` -> Size to this width
16483    ///
16484    /// <ins>Optional arguments</ins>
16485    ///
16486    /// height: `i32` -> Size to this height
16487    ///
16488    /// size: [`Size`] -> Only upsize, only downsize, or both
16489    ///
16490    /// no_rotate: `bool` -> Don't use orientation tags to rotate image upright
16491    ///
16492    /// crop: [`Interesting`] -> Reduce to fill target rectangle, then crop
16493    ///
16494    /// linear: `bool` -> Reduce in linear light
16495    ///
16496    /// input_profile: `&str` -> Fallback input profile
16497    ///
16498    /// output_profile: `&str` -> Fallback output profile
16499    ///
16500    /// intent: [`Intent`] -> Rendering intent
16501    ///
16502    /// fail_on: [`FailOn`] -> Error level to fail on
16503    pub fn thumbnail_image_with_opts(&self, width: i32, option: VOption) -> Result<VipsImage> {
16504        let mut out_out = VipsImage::from(null_mut());
16505        let vips_op_response = call(
16506            "thumbnail_image",
16507            option
16508                .set("in", self)
16509                .set(
16510                    "out",
16511                    &mut out_out,
16512                )
16513                .set(
16514                    "width",
16515                    width,
16516                ),
16517        );
16518
16519        utils::result(
16520            vips_op_response,
16521            out_out,
16522            Error::OperationError("ThumbnailImage (vips_thumbnail_image) failed".to_string()),
16523        )
16524    }
16525
16526    /// VipsThumbnailSource (thumbnail_source), generate thumbnail from source
16527    /// returns `VipsImage` - Output image
16528    ///
16529    /// source: `&VipsSource` -> Source to load from
16530    ///
16531    /// width: `i32` -> Size to this width
16532    pub fn thumbnail_source(source: &VipsSource, width: i32) -> Result<VipsImage> {
16533        let mut out_out = VipsImage::from(null_mut());
16534        let vips_op_response = call(
16535            "thumbnail_source",
16536            VOption::new()
16537                .set(
16538                    "source",
16539                    source,
16540                )
16541                .set(
16542                    "out",
16543                    &mut out_out,
16544                )
16545                .set(
16546                    "width",
16547                    width,
16548                ),
16549        );
16550
16551        utils::result(
16552            vips_op_response,
16553            out_out,
16554            Error::OperationError("ThumbnailSource (vips_thumbnail_source) failed".to_string()),
16555        )
16556    }
16557
16558    /// VipsThumbnailSource (thumbnail_source), generate thumbnail from source
16559    /// returns `VipsImage` - Output image
16560    ///
16561    /// source: `&VipsSource` -> Source to load from
16562    ///
16563    /// width: `i32` -> Size to this width
16564    ///
16565    /// <ins>Optional arguments</ins>
16566    ///
16567    /// option_string: `&str` -> Options that are passed on to the underlying loader
16568    ///
16569    /// height: `i32` -> Size to this height
16570    ///
16571    /// size: [`Size`] -> Only upsize, only downsize, or both
16572    ///
16573    /// no_rotate: `bool` -> Don't use orientation tags to rotate image upright
16574    ///
16575    /// crop: [`Interesting`] -> Reduce to fill target rectangle, then crop
16576    ///
16577    /// linear: `bool` -> Reduce in linear light
16578    ///
16579    /// input_profile: `&str` -> Fallback input profile
16580    ///
16581    /// output_profile: `&str` -> Fallback output profile
16582    ///
16583    /// intent: [`Intent`] -> Rendering intent
16584    ///
16585    /// fail_on: [`FailOn`] -> Error level to fail on
16586    pub fn thumbnail_source_with_opts(
16587        source: &VipsSource,
16588        width: i32,
16589        option: VOption,
16590    ) -> Result<VipsImage> {
16591        let mut out_out = VipsImage::from(null_mut());
16592        let vips_op_response = call(
16593            "thumbnail_source",
16594            option
16595                .set(
16596                    "source",
16597                    source,
16598                )
16599                .set(
16600                    "out",
16601                    &mut out_out,
16602                )
16603                .set(
16604                    "width",
16605                    width,
16606                ),
16607        );
16608
16609        utils::result(
16610            vips_op_response,
16611            out_out,
16612            Error::OperationError("ThumbnailSource (vips_thumbnail_source) failed".to_string()),
16613        )
16614    }
16615
16616    /// VipsForeignLoadTiffFile (tiffload), load tiff from file (.tif, .tiff), priority=50, is_a, get_flags, get_flags_filename, header, load
16617    /// returns `VipsImage` - Output image
16618    ///
16619    /// filename: `&str` -> Filename to load from
16620    pub fn tiffload(filename: &str) -> Result<VipsImage> {
16621        let mut out_out = VipsImage::from(null_mut());
16622        let vips_op_response = call(
16623            "tiffload",
16624            VOption::new()
16625                .set(
16626                    "filename",
16627                    filename,
16628                )
16629                .set(
16630                    "out",
16631                    &mut out_out,
16632                ),
16633        );
16634
16635        utils::result(
16636            vips_op_response,
16637            out_out,
16638            Error::OperationError("Tiffload (vips_tiffload) failed".to_string()),
16639        )
16640    }
16641
16642    /// VipsForeignLoadTiffFile (tiffload), load tiff from file (.tif, .tiff), priority=50, is_a, get_flags, get_flags_filename, header, load
16643    /// returns `VipsImage` - Output image
16644    ///
16645    /// filename: `&str` -> Filename to load from
16646    ///
16647    /// <ins>Optional arguments</ins>
16648    ///
16649    /// page: `i32` -> First page to load
16650    ///
16651    /// n: `i32` -> Number of pages to load, -1 for all
16652    ///
16653    /// autorotate: `bool` -> Rotate image using orientation tag
16654    ///
16655    /// subifd: `i32` -> Subifd index
16656    ///
16657    /// unlimited: `bool` -> Remove all denial of service limits
16658    ///
16659    /// flags: [`ForeignFlags`] -> Flags for this file
16660    ///
16661    /// memory: `bool` -> Force open via memory
16662    ///
16663    /// access: [`Access`] -> Required access pattern for this file
16664    ///
16665    /// fail_on: [`FailOn`] -> Error level to fail on
16666    ///
16667    /// revalidate: `bool` -> Don't use a cached result for this operation
16668    pub fn tiffload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
16669        let mut out_out = VipsImage::from(null_mut());
16670        let vips_op_response = call(
16671            "tiffload",
16672            option
16673                .set(
16674                    "filename",
16675                    filename,
16676                )
16677                .set(
16678                    "out",
16679                    &mut out_out,
16680                ),
16681        );
16682
16683        utils::result(
16684            vips_op_response,
16685            out_out,
16686            Error::OperationError("Tiffload (vips_tiffload) failed".to_string()),
16687        )
16688    }
16689
16690    /// VipsForeignLoadTiffBuffer (tiffload_buffer), load tiff from buffer, priority=50, is_a_buffer, get_flags, get_flags_filename, header, load
16691    /// returns `VipsImage` - Output image
16692    ///
16693    /// buffer: `&[u8]` -> Buffer to load from
16694    pub fn tiffload_buffer(buffer: &[u8]) -> Result<VipsImage> {
16695        let blob = unsafe {
16696            vips_blob_new(
16697                None,
16698                buffer.as_ptr() as _,
16699                buffer.len() as _,
16700            )
16701        };
16702        let mut out_out = VipsImage::from(null_mut());
16703        let vips_op_response = call(
16704            "tiffload_buffer",
16705            VOption::new()
16706                .set(
16707                    "buffer",
16708                    &VipsBlob::from(blob),
16709                )
16710                .set(
16711                    "out",
16712                    &mut out_out,
16713                ),
16714        );
16715        unsafe { vips_area_unref(&mut (*blob).area) };
16716        utils::result(
16717            vips_op_response,
16718            out_out,
16719            Error::OperationError("TiffloadBuffer (vips_tiffload_buffer) failed".to_string()),
16720        )
16721    }
16722
16723    /// VipsForeignLoadTiffBuffer (tiffload_buffer), load tiff from buffer, priority=50, is_a_buffer, get_flags, get_flags_filename, header, load
16724    /// returns `VipsImage` - Output image
16725    ///
16726    /// buffer: `&[u8]` -> Buffer to load from
16727    ///
16728    /// <ins>Optional arguments</ins>
16729    ///
16730    /// page: `i32` -> First page to load
16731    ///
16732    /// n: `i32` -> Number of pages to load, -1 for all
16733    ///
16734    /// autorotate: `bool` -> Rotate image using orientation tag
16735    ///
16736    /// subifd: `i32` -> Subifd index
16737    ///
16738    /// unlimited: `bool` -> Remove all denial of service limits
16739    ///
16740    /// flags: [`ForeignFlags`] -> Flags for this file
16741    ///
16742    /// memory: `bool` -> Force open via memory
16743    ///
16744    /// access: [`Access`] -> Required access pattern for this file
16745    ///
16746    /// fail_on: [`FailOn`] -> Error level to fail on
16747    ///
16748    /// revalidate: `bool` -> Don't use a cached result for this operation
16749    pub fn tiffload_buffer_with_opts(buffer: &[u8], option: VOption) -> Result<VipsImage> {
16750        let blob = unsafe {
16751            vips_blob_new(
16752                None,
16753                buffer.as_ptr() as _,
16754                buffer.len() as _,
16755            )
16756        };
16757        let mut out_out = VipsImage::from(null_mut());
16758        let vips_op_response = call(
16759            "tiffload_buffer",
16760            option
16761                .set(
16762                    "buffer",
16763                    &VipsBlob::from(blob),
16764                )
16765                .set(
16766                    "out",
16767                    &mut out_out,
16768                ),
16769        );
16770        unsafe { vips_area_unref(&mut (*blob).area) };
16771        utils::result(
16772            vips_op_response,
16773            out_out,
16774            Error::OperationError("TiffloadBuffer (vips_tiffload_buffer) failed".to_string()),
16775        )
16776    }
16777
16778    /// VipsForeignLoadTiffSource (tiffload_source), load tiff from source, priority=50, is_a_source, get_flags, get_flags_filename, header, load
16779    /// returns `VipsImage` - Output image
16780    ///
16781    /// source: `&VipsSource` -> Source to load from
16782    pub fn tiffload_source(source: &VipsSource) -> Result<VipsImage> {
16783        let mut out_out = VipsImage::from(null_mut());
16784        let vips_op_response = call(
16785            "tiffload_source",
16786            VOption::new()
16787                .set(
16788                    "source",
16789                    source,
16790                )
16791                .set(
16792                    "out",
16793                    &mut out_out,
16794                ),
16795        );
16796
16797        utils::result(
16798            vips_op_response,
16799            out_out,
16800            Error::OperationError("TiffloadSource (vips_tiffload_source) failed".to_string()),
16801        )
16802    }
16803
16804    /// VipsForeignLoadTiffSource (tiffload_source), load tiff from source, priority=50, is_a_source, get_flags, get_flags_filename, header, load
16805    /// returns `VipsImage` - Output image
16806    ///
16807    /// source: `&VipsSource` -> Source to load from
16808    ///
16809    /// <ins>Optional arguments</ins>
16810    ///
16811    /// page: `i32` -> First page to load
16812    ///
16813    /// n: `i32` -> Number of pages to load, -1 for all
16814    ///
16815    /// autorotate: `bool` -> Rotate image using orientation tag
16816    ///
16817    /// subifd: `i32` -> Subifd index
16818    ///
16819    /// unlimited: `bool` -> Remove all denial of service limits
16820    ///
16821    /// flags: [`ForeignFlags`] -> Flags for this file
16822    ///
16823    /// memory: `bool` -> Force open via memory
16824    ///
16825    /// access: [`Access`] -> Required access pattern for this file
16826    ///
16827    /// fail_on: [`FailOn`] -> Error level to fail on
16828    ///
16829    /// revalidate: `bool` -> Don't use a cached result for this operation
16830    pub fn tiffload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
16831        let mut out_out = VipsImage::from(null_mut());
16832        let vips_op_response = call(
16833            "tiffload_source",
16834            option
16835                .set(
16836                    "source",
16837                    source,
16838                )
16839                .set(
16840                    "out",
16841                    &mut out_out,
16842                ),
16843        );
16844
16845        utils::result(
16846            vips_op_response,
16847            out_out,
16848            Error::OperationError("TiffloadSource (vips_tiffload_source) failed".to_string()),
16849        )
16850    }
16851
16852    /// VipsForeignSaveTiffFile (tiffsave), save image to tiff file (.tif, .tiff), priority=0,
16853    ///
16854    /// filename: `&str` -> Filename to save to
16855    pub fn tiffsave(&self, filename: &str) -> Result<()> {
16856        let vips_op_response = call(
16857            "tiffsave",
16858            VOption::new()
16859                .set("in", self)
16860                .set(
16861                    "filename",
16862                    filename,
16863                ),
16864        );
16865
16866        utils::result(
16867            vips_op_response,
16868            (),
16869            Error::OperationError("Tiffsave (vips_tiffsave) failed".to_string()),
16870        )
16871    }
16872
16873    /// VipsForeignSaveTiffFile (tiffsave), save image to tiff file (.tif, .tiff), priority=0,
16874    ///
16875    /// filename: `&str` -> Filename to save to
16876    ///
16877    /// <ins>Optional arguments</ins>
16878    ///
16879    /// compression: [`ForeignTiffCompression`] -> Compression for this file
16880    ///
16881    /// Q: `i32` -> Q factor
16882    ///
16883    /// predictor: [`ForeignTiffPredictor`] -> Compression prediction
16884    ///
16885    /// tile: `bool` -> Write a tiled tiff
16886    ///
16887    /// tile_width: `i32` -> Tile width in pixels
16888    ///
16889    /// tile_height: `i32` -> Tile height in pixels
16890    ///
16891    /// pyramid: `bool` -> Write a pyramidal tiff
16892    ///
16893    /// miniswhite: `bool` -> Use 0 for white in 1-bit images
16894    ///
16895    /// bitdepth: `i32` -> Write as a 1, 2, 4 or 8 bit image
16896    ///
16897    /// resunit: [`ForeignTiffResunit`] -> Resolution unit
16898    ///
16899    /// xres: `f64` -> Horizontal resolution in pixels/mm
16900    ///
16901    /// yres: `f64` -> Vertical resolution in pixels/mm
16902    ///
16903    /// bigtiff: `bool` -> Write a bigtiff image
16904    ///
16905    /// properties: `bool` -> Write a properties document to IMAGEDESCRIPTION
16906    ///
16907    /// region_shrink: [`RegionShrink`] -> Method to shrink regions
16908    ///
16909    /// level: `i32` -> Deflate (1-9, default 6) or ZSTD (1-22, default 9) compression level
16910    ///
16911    /// lossless: `bool` -> Enable WEBP lossless mode
16912    ///
16913    /// depth: [`ForeignDzDepth`] -> Pyramid depth
16914    ///
16915    /// subifd: `bool` -> Save pyr layers as sub-IFDs
16916    ///
16917    /// premultiply: `bool` -> Save with premultiplied alpha
16918    ///
16919    /// keep: [`ForeignKeep`] -> Which metadata to retain
16920    ///
16921    /// background: `&[f64]` -> Background value
16922    ///
16923    /// page_height: `i32` -> Set page height for multipage save
16924    ///
16925    /// profile: `&str` -> Filename of ICC profile to embed
16926    pub fn tiffsave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
16927        let vips_op_response = call(
16928            "tiffsave",
16929            option
16930                .set("in", self)
16931                .set(
16932                    "filename",
16933                    filename,
16934                ),
16935        );
16936
16937        utils::result(
16938            vips_op_response,
16939            (),
16940            Error::OperationError("Tiffsave (vips_tiffsave) failed".to_string()),
16941        )
16942    }
16943
16944    /// VipsForeignSaveTiffBuffer (tiffsave_buffer), save image to tiff buffer (.tif, .tiff), priority=0,
16945    /// returns `Vec<u8>` - Buffer to save to
16946    pub fn tiffsave_buffer(&self) -> Result<Vec<u8>> {
16947        let mut buffer_out = VipsBlob::from(null_mut());
16948        let vips_op_response = call(
16949            "tiffsave_buffer",
16950            VOption::new()
16951                .set("in", self)
16952                .set(
16953                    "buffer",
16954                    &mut buffer_out,
16955                ),
16956        );
16957
16958        utils::result(
16959            vips_op_response,
16960            buffer_out.into(),
16961            Error::OperationError("TiffsaveBuffer (vips_tiffsave_buffer) failed".to_string()),
16962        )
16963    }
16964
16965    /// VipsForeignSaveTiffBuffer (tiffsave_buffer), save image to tiff buffer (.tif, .tiff), priority=0,
16966    /// returns `Vec<u8>` - Buffer to save to
16967    ///
16968    /// <ins>Optional arguments</ins>
16969    ///
16970    /// compression: [`ForeignTiffCompression`] -> Compression for this file
16971    ///
16972    /// Q: `i32` -> Q factor
16973    ///
16974    /// predictor: [`ForeignTiffPredictor`] -> Compression prediction
16975    ///
16976    /// tile: `bool` -> Write a tiled tiff
16977    ///
16978    /// tile_width: `i32` -> Tile width in pixels
16979    ///
16980    /// tile_height: `i32` -> Tile height in pixels
16981    ///
16982    /// pyramid: `bool` -> Write a pyramidal tiff
16983    ///
16984    /// miniswhite: `bool` -> Use 0 for white in 1-bit images
16985    ///
16986    /// bitdepth: `i32` -> Write as a 1, 2, 4 or 8 bit image
16987    ///
16988    /// resunit: [`ForeignTiffResunit`] -> Resolution unit
16989    ///
16990    /// xres: `f64` -> Horizontal resolution in pixels/mm
16991    ///
16992    /// yres: `f64` -> Vertical resolution in pixels/mm
16993    ///
16994    /// bigtiff: `bool` -> Write a bigtiff image
16995    ///
16996    /// properties: `bool` -> Write a properties document to IMAGEDESCRIPTION
16997    ///
16998    /// region_shrink: [`RegionShrink`] -> Method to shrink regions
16999    ///
17000    /// level: `i32` -> Deflate (1-9, default 6) or ZSTD (1-22, default 9) compression level
17001    ///
17002    /// lossless: `bool` -> Enable WEBP lossless mode
17003    ///
17004    /// depth: [`ForeignDzDepth`] -> Pyramid depth
17005    ///
17006    /// subifd: `bool` -> Save pyr layers as sub-IFDs
17007    ///
17008    /// premultiply: `bool` -> Save with premultiplied alpha
17009    ///
17010    /// keep: [`ForeignKeep`] -> Which metadata to retain
17011    ///
17012    /// background: `&[f64]` -> Background value
17013    ///
17014    /// page_height: `i32` -> Set page height for multipage save
17015    ///
17016    /// profile: `&str` -> Filename of ICC profile to embed
17017    pub fn tiffsave_buffer_with_opts(&self, option: VOption) -> Result<Vec<u8>> {
17018        let mut buffer_out = VipsBlob::from(null_mut());
17019        let vips_op_response = call(
17020            "tiffsave_buffer",
17021            option
17022                .set("in", self)
17023                .set(
17024                    "buffer",
17025                    &mut buffer_out,
17026                ),
17027        );
17028
17029        utils::result(
17030            vips_op_response,
17031            buffer_out.into(),
17032            Error::OperationError("TiffsaveBuffer (vips_tiffsave_buffer) failed".to_string()),
17033        )
17034    }
17035
17036    /// VipsForeignSaveTiffTarget (tiffsave_target), save image to tiff target (.tif, .tiff), priority=0,
17037    ///
17038    /// target: `&VipsTarget` -> Target to save to
17039    pub fn tiffsave_target(&self, target: &VipsTarget) -> Result<()> {
17040        let vips_op_response = call(
17041            "tiffsave_target",
17042            VOption::new()
17043                .set("in", self)
17044                .set(
17045                    "target",
17046                    target,
17047                ),
17048        );
17049
17050        utils::result(
17051            vips_op_response,
17052            (),
17053            Error::OperationError("TiffsaveTarget (vips_tiffsave_target) failed".to_string()),
17054        )
17055    }
17056
17057    /// VipsForeignSaveTiffTarget (tiffsave_target), save image to tiff target (.tif, .tiff), priority=0,
17058    ///
17059    /// target: `&VipsTarget` -> Target to save to
17060    ///
17061    /// <ins>Optional arguments</ins>
17062    ///
17063    /// compression: [`ForeignTiffCompression`] -> Compression for this file
17064    ///
17065    /// Q: `i32` -> Q factor
17066    ///
17067    /// predictor: [`ForeignTiffPredictor`] -> Compression prediction
17068    ///
17069    /// tile: `bool` -> Write a tiled tiff
17070    ///
17071    /// tile_width: `i32` -> Tile width in pixels
17072    ///
17073    /// tile_height: `i32` -> Tile height in pixels
17074    ///
17075    /// pyramid: `bool` -> Write a pyramidal tiff
17076    ///
17077    /// miniswhite: `bool` -> Use 0 for white in 1-bit images
17078    ///
17079    /// bitdepth: `i32` -> Write as a 1, 2, 4 or 8 bit image
17080    ///
17081    /// resunit: [`ForeignTiffResunit`] -> Resolution unit
17082    ///
17083    /// xres: `f64` -> Horizontal resolution in pixels/mm
17084    ///
17085    /// yres: `f64` -> Vertical resolution in pixels/mm
17086    ///
17087    /// bigtiff: `bool` -> Write a bigtiff image
17088    ///
17089    /// properties: `bool` -> Write a properties document to IMAGEDESCRIPTION
17090    ///
17091    /// region_shrink: [`RegionShrink`] -> Method to shrink regions
17092    ///
17093    /// level: `i32` -> Deflate (1-9, default 6) or ZSTD (1-22, default 9) compression level
17094    ///
17095    /// lossless: `bool` -> Enable WEBP lossless mode
17096    ///
17097    /// depth: [`ForeignDzDepth`] -> Pyramid depth
17098    ///
17099    /// subifd: `bool` -> Save pyr layers as sub-IFDs
17100    ///
17101    /// premultiply: `bool` -> Save with premultiplied alpha
17102    ///
17103    /// keep: [`ForeignKeep`] -> Which metadata to retain
17104    ///
17105    /// background: `&[f64]` -> Background value
17106    ///
17107    /// page_height: `i32` -> Set page height for multipage save
17108    ///
17109    /// profile: `&str` -> Filename of ICC profile to embed
17110    pub fn tiffsave_target_with_opts(&self, target: &VipsTarget, option: VOption) -> Result<()> {
17111        let vips_op_response = call(
17112            "tiffsave_target",
17113            option
17114                .set("in", self)
17115                .set(
17116                    "target",
17117                    target,
17118                ),
17119        );
17120
17121        utils::result(
17122            vips_op_response,
17123            (),
17124            Error::OperationError("TiffsaveTarget (vips_tiffsave_target) failed".to_string()),
17125        )
17126    }
17127
17128    /// VipsTileCache (tilecache), cache an image as a set of tiles
17129    /// returns `VipsImage` - Output image
17130    pub fn tilecache(&self) -> Result<VipsImage> {
17131        let mut out_out = VipsImage::from(null_mut());
17132        let vips_op_response = call(
17133            "tilecache",
17134            VOption::new()
17135                .set("in", self)
17136                .set(
17137                    "out",
17138                    &mut out_out,
17139                ),
17140        );
17141
17142        utils::result(
17143            vips_op_response,
17144            out_out,
17145            Error::OperationError("Tilecache (vips_tilecache) failed".to_string()),
17146        )
17147    }
17148
17149    /// VipsTileCache (tilecache), cache an image as a set of tiles
17150    /// returns `VipsImage` - Output image
17151    ///
17152    /// <ins>Optional arguments</ins>
17153    ///
17154    /// tile_width: `i32` -> Tile width in pixels
17155    ///
17156    /// tile_height: `i32` -> Tile height in pixels
17157    ///
17158    /// max_tiles: `i32` -> Maximum number of tiles to cache
17159    ///
17160    /// access: [`Access`] -> Expected access pattern
17161    ///
17162    /// threaded: `bool` -> Allow threaded access
17163    ///
17164    /// persistent: `bool` -> Keep cache between evaluations
17165    pub fn tilecache_with_opts(&self, option: VOption) -> Result<VipsImage> {
17166        let mut out_out = VipsImage::from(null_mut());
17167        let vips_op_response = call(
17168            "tilecache",
17169            option
17170                .set("in", self)
17171                .set(
17172                    "out",
17173                    &mut out_out,
17174                ),
17175        );
17176
17177        utils::result(
17178            vips_op_response,
17179            out_out,
17180            Error::OperationError("Tilecache (vips_tilecache) failed".to_string()),
17181        )
17182    }
17183
17184    /// VipsTonelut (tonelut), build a look-up table
17185    /// returns `VipsImage` - Output image
17186    pub fn tonelut() -> Result<VipsImage> {
17187        let mut out_out = VipsImage::from(null_mut());
17188        let vips_op_response = call(
17189            "tonelut",
17190            VOption::new().set(
17191                "out",
17192                &mut out_out,
17193            ),
17194        );
17195
17196        utils::result(
17197            vips_op_response,
17198            out_out,
17199            Error::OperationError("Tonelut (vips_tonelut) failed".to_string()),
17200        )
17201    }
17202
17203    /// VipsTonelut (tonelut), build a look-up table
17204    /// returns `VipsImage` - Output image
17205    ///
17206    /// <ins>Optional arguments</ins>
17207    ///
17208    /// in_max: `i32` -> Size of LUT to build
17209    ///
17210    /// out_max: `i32` -> Maximum value in output LUT
17211    ///
17212    /// Lb: `f64` -> Lowest value in output
17213    ///
17214    /// Lw: `f64` -> Highest value in output
17215    ///
17216    /// Ps: `f64` -> Position of shadow
17217    ///
17218    /// Pm: `f64` -> Position of mid-tones
17219    ///
17220    /// Ph: `f64` -> Position of highlights
17221    ///
17222    /// S: `f64` -> Adjust shadows by this much
17223    ///
17224    /// M: `f64` -> Adjust mid-tones by this much
17225    ///
17226    /// H: `f64` -> Adjust highlights by this much
17227    pub fn tonelut_with_opts(option: VOption) -> Result<VipsImage> {
17228        let mut out_out = VipsImage::from(null_mut());
17229        let vips_op_response = call(
17230            "tonelut",
17231            option.set(
17232                "out",
17233                &mut out_out,
17234            ),
17235        );
17236
17237        utils::result(
17238            vips_op_response,
17239            out_out,
17240            Error::OperationError("Tonelut (vips_tonelut) failed".to_string()),
17241        )
17242    }
17243
17244    /// VipsTranspose3d (transpose3d), transpose3d an image
17245    /// returns `VipsImage` - Output image
17246    pub fn transpose3d(&self) -> Result<VipsImage> {
17247        let mut out_out = VipsImage::from(null_mut());
17248        let vips_op_response = call(
17249            "transpose3d",
17250            VOption::new()
17251                .set("in", self)
17252                .set(
17253                    "out",
17254                    &mut out_out,
17255                ),
17256        );
17257
17258        utils::result(
17259            vips_op_response,
17260            out_out,
17261            Error::OperationError("Transpose3D (vips_transpose3d) failed".to_string()),
17262        )
17263    }
17264
17265    /// VipsTranspose3d (transpose3d), transpose3d an image
17266    /// returns `VipsImage` - Output image
17267    ///
17268    /// <ins>Optional arguments</ins>
17269    ///
17270    /// page_height: `i32` -> Height of each input page
17271    pub fn transpose3d_with_opts(&self, option: VOption) -> Result<VipsImage> {
17272        let mut out_out = VipsImage::from(null_mut());
17273        let vips_op_response = call(
17274            "transpose3d",
17275            option
17276                .set("in", self)
17277                .set(
17278                    "out",
17279                    &mut out_out,
17280                ),
17281        );
17282
17283        utils::result(
17284            vips_op_response,
17285            out_out,
17286            Error::OperationError("Transpose3D (vips_transpose3d) failed".to_string()),
17287        )
17288    }
17289
17290    /// VipsUnpremultiply (unpremultiply), unpremultiply image alpha
17291    /// returns `VipsImage` - Output image
17292    pub fn unpremultiply(&self) -> Result<VipsImage> {
17293        let mut out_out = VipsImage::from(null_mut());
17294        let vips_op_response = call(
17295            "unpremultiply",
17296            VOption::new()
17297                .set("in", self)
17298                .set(
17299                    "out",
17300                    &mut out_out,
17301                ),
17302        );
17303
17304        utils::result(
17305            vips_op_response,
17306            out_out,
17307            Error::OperationError("Unpremultiply (vips_unpremultiply) failed".to_string()),
17308        )
17309    }
17310
17311    /// VipsUnpremultiply (unpremultiply), unpremultiply image alpha
17312    /// returns `VipsImage` - Output image
17313    ///
17314    /// <ins>Optional arguments</ins>
17315    ///
17316    /// max_alpha: `f64` -> Maximum value of alpha channel
17317    ///
17318    /// alpha_band: `i32` -> Unpremultiply with this alpha
17319    pub fn unpremultiply_with_opts(&self, option: VOption) -> Result<VipsImage> {
17320        let mut out_out = VipsImage::from(null_mut());
17321        let vips_op_response = call(
17322            "unpremultiply",
17323            option
17324                .set("in", self)
17325                .set(
17326                    "out",
17327                    &mut out_out,
17328                ),
17329        );
17330
17331        utils::result(
17332            vips_op_response,
17333            out_out,
17334            Error::OperationError("Unpremultiply (vips_unpremultiply) failed".to_string()),
17335        )
17336    }
17337
17338    /// VipsForeignLoadVipsFile (vipsload), load vips from file (.v, .vips), priority=200, untrusted, is_a, get_flags, get_flags_filename, header
17339    /// returns `VipsImage` - Output image
17340    ///
17341    /// filename: `&str` -> Filename to load from
17342    pub fn vipsload(filename: &str) -> Result<VipsImage> {
17343        let mut out_out = VipsImage::from(null_mut());
17344        let vips_op_response = call(
17345            "vipsload",
17346            VOption::new()
17347                .set(
17348                    "filename",
17349                    filename,
17350                )
17351                .set(
17352                    "out",
17353                    &mut out_out,
17354                ),
17355        );
17356
17357        utils::result(
17358            vips_op_response,
17359            out_out,
17360            Error::OperationError("Vipsload (vips_vipsload) failed".to_string()),
17361        )
17362    }
17363
17364    /// VipsForeignLoadVipsFile (vipsload), load vips from file (.v, .vips), priority=200, untrusted, is_a, get_flags, get_flags_filename, header
17365    /// returns `VipsImage` - Output image
17366    ///
17367    /// filename: `&str` -> Filename to load from
17368    ///
17369    /// <ins>Optional arguments</ins>
17370    ///
17371    /// flags: [`ForeignFlags`] -> Flags for this file
17372    ///
17373    /// memory: `bool` -> Force open via memory
17374    ///
17375    /// access: [`Access`] -> Required access pattern for this file
17376    ///
17377    /// fail_on: [`FailOn`] -> Error level to fail on
17378    ///
17379    /// revalidate: `bool` -> Don't use a cached result for this operation
17380    pub fn vipsload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
17381        let mut out_out = VipsImage::from(null_mut());
17382        let vips_op_response = call(
17383            "vipsload",
17384            option
17385                .set(
17386                    "filename",
17387                    filename,
17388                )
17389                .set(
17390                    "out",
17391                    &mut out_out,
17392                ),
17393        );
17394
17395        utils::result(
17396            vips_op_response,
17397            out_out,
17398            Error::OperationError("Vipsload (vips_vipsload) failed".to_string()),
17399        )
17400    }
17401
17402    /// VipsForeignLoadVipsSource (vipsload_source), load vips from source, priority=200, untrusted, is_a_source, get_flags, get_flags_filename, header
17403    /// returns `VipsImage` - Output image
17404    ///
17405    /// source: `&VipsSource` -> Source to load from
17406    pub fn vipsload_source(source: &VipsSource) -> Result<VipsImage> {
17407        let mut out_out = VipsImage::from(null_mut());
17408        let vips_op_response = call(
17409            "vipsload_source",
17410            VOption::new()
17411                .set(
17412                    "source",
17413                    source,
17414                )
17415                .set(
17416                    "out",
17417                    &mut out_out,
17418                ),
17419        );
17420
17421        utils::result(
17422            vips_op_response,
17423            out_out,
17424            Error::OperationError("VipsloadSource (vips_vipsload_source) failed".to_string()),
17425        )
17426    }
17427
17428    /// VipsForeignLoadVipsSource (vipsload_source), load vips from source, priority=200, untrusted, is_a_source, get_flags, get_flags_filename, header
17429    /// returns `VipsImage` - Output image
17430    ///
17431    /// source: `&VipsSource` -> Source to load from
17432    ///
17433    /// <ins>Optional arguments</ins>
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 vipsload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
17445        let mut out_out = VipsImage::from(null_mut());
17446        let vips_op_response = call(
17447            "vipsload_source",
17448            option
17449                .set(
17450                    "source",
17451                    source,
17452                )
17453                .set(
17454                    "out",
17455                    &mut out_out,
17456                ),
17457        );
17458
17459        utils::result(
17460            vips_op_response,
17461            out_out,
17462            Error::OperationError("VipsloadSource (vips_vipsload_source) failed".to_string()),
17463        )
17464    }
17465
17466    /// VipsForeignSaveVipsFile (vipssave), save image to file in vips format (.v, .vips), priority=0,
17467    ///
17468    /// filename: `&str` -> Filename to save to
17469    pub fn vipssave(&self, filename: &str) -> Result<()> {
17470        let vips_op_response = call(
17471            "vipssave",
17472            VOption::new()
17473                .set("in", self)
17474                .set(
17475                    "filename",
17476                    filename,
17477                ),
17478        );
17479
17480        utils::result(
17481            vips_op_response,
17482            (),
17483            Error::OperationError("Vipssave (vips_vipssave) failed".to_string()),
17484        )
17485    }
17486
17487    /// VipsForeignSaveVipsFile (vipssave), save image to file in vips format (.v, .vips), priority=0,
17488    ///
17489    /// filename: `&str` -> Filename to save to
17490    ///
17491    /// <ins>Optional arguments</ins>
17492    ///
17493    /// keep: [`ForeignKeep`] -> Which metadata to retain
17494    ///
17495    /// background: `&[f64]` -> Background value
17496    ///
17497    /// page_height: `i32` -> Set page height for multipage save
17498    ///
17499    /// profile: `&str` -> Filename of ICC profile to embed
17500    pub fn vipssave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
17501        let vips_op_response = call(
17502            "vipssave",
17503            option
17504                .set("in", self)
17505                .set(
17506                    "filename",
17507                    filename,
17508                ),
17509        );
17510
17511        utils::result(
17512            vips_op_response,
17513            (),
17514            Error::OperationError("Vipssave (vips_vipssave) failed".to_string()),
17515        )
17516    }
17517
17518    /// VipsForeignSaveVipsTarget (vipssave_target), save image to target in vips format (.v, .vips), priority=0,
17519    ///
17520    /// target: `&VipsTarget` -> Target to save to
17521    pub fn vipssave_target(&self, target: &VipsTarget) -> Result<()> {
17522        let vips_op_response = call(
17523            "vipssave_target",
17524            VOption::new()
17525                .set("in", self)
17526                .set(
17527                    "target",
17528                    target,
17529                ),
17530        );
17531
17532        utils::result(
17533            vips_op_response,
17534            (),
17535            Error::OperationError("VipssaveTarget (vips_vipssave_target) failed".to_string()),
17536        )
17537    }
17538
17539    /// VipsForeignSaveVipsTarget (vipssave_target), save image to target in vips format (.v, .vips), priority=0,
17540    ///
17541    /// target: `&VipsTarget` -> Target to save to
17542    ///
17543    /// <ins>Optional arguments</ins>
17544    ///
17545    /// keep: [`ForeignKeep`] -> Which metadata to retain
17546    ///
17547    /// background: `&[f64]` -> Background value
17548    ///
17549    /// page_height: `i32` -> Set page height for multipage save
17550    ///
17551    /// profile: `&str` -> Filename of ICC profile to embed
17552    pub fn vipssave_target_with_opts(&self, target: &VipsTarget, option: VOption) -> Result<()> {
17553        let vips_op_response = call(
17554            "vipssave_target",
17555            option
17556                .set("in", self)
17557                .set(
17558                    "target",
17559                    target,
17560                ),
17561        );
17562
17563        utils::result(
17564            vips_op_response,
17565            (),
17566            Error::OperationError("VipssaveTarget (vips_vipssave_target) failed".to_string()),
17567        )
17568    }
17569
17570    /// VipsForeignLoadWebpFile (webpload), load webp from file (.webp), priority=200, is_a, get_flags, get_flags_filename, header, load
17571    /// returns `VipsImage` - Output image
17572    ///
17573    /// filename: `&str` -> Filename to load from
17574    pub fn webpload(filename: &str) -> Result<VipsImage> {
17575        let mut out_out = VipsImage::from(null_mut());
17576        let vips_op_response = call(
17577            "webpload",
17578            VOption::new()
17579                .set(
17580                    "filename",
17581                    filename,
17582                )
17583                .set(
17584                    "out",
17585                    &mut out_out,
17586                ),
17587        );
17588
17589        utils::result(
17590            vips_op_response,
17591            out_out,
17592            Error::OperationError("Webpload (vips_webpload) failed".to_string()),
17593        )
17594    }
17595
17596    /// VipsForeignLoadWebpFile (webpload), load webp from file (.webp), priority=200, is_a, get_flags, get_flags_filename, header, load
17597    /// returns `VipsImage` - Output image
17598    ///
17599    /// filename: `&str` -> Filename to load from
17600    ///
17601    /// <ins>Optional arguments</ins>
17602    ///
17603    /// page: `i32` -> First page to load
17604    ///
17605    /// n: `i32` -> Number of pages to load, -1 for all
17606    ///
17607    /// scale: `f64` -> Factor to scale by
17608    ///
17609    /// flags: [`ForeignFlags`] -> Flags for this file
17610    ///
17611    /// memory: `bool` -> Force open via memory
17612    ///
17613    /// access: [`Access`] -> Required access pattern for this file
17614    ///
17615    /// fail_on: [`FailOn`] -> Error level to fail on
17616    ///
17617    /// revalidate: `bool` -> Don't use a cached result for this operation
17618    pub fn webpload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
17619        let mut out_out = VipsImage::from(null_mut());
17620        let vips_op_response = call(
17621            "webpload",
17622            option
17623                .set(
17624                    "filename",
17625                    filename,
17626                )
17627                .set(
17628                    "out",
17629                    &mut out_out,
17630                ),
17631        );
17632
17633        utils::result(
17634            vips_op_response,
17635            out_out,
17636            Error::OperationError("Webpload (vips_webpload) failed".to_string()),
17637        )
17638    }
17639
17640    /// VipsForeignLoadWebpBuffer (webpload_buffer), load webp from buffer, priority=200, is_a_buffer, get_flags, get_flags_filename, header, load
17641    /// returns `VipsImage` - Output image
17642    ///
17643    /// buffer: `&[u8]` -> Buffer to load from
17644    pub fn webpload_buffer(buffer: &[u8]) -> Result<VipsImage> {
17645        let blob = unsafe {
17646            vips_blob_new(
17647                None,
17648                buffer.as_ptr() as _,
17649                buffer.len() as _,
17650            )
17651        };
17652        let mut out_out = VipsImage::from(null_mut());
17653        let vips_op_response = call(
17654            "webpload_buffer",
17655            VOption::new()
17656                .set(
17657                    "buffer",
17658                    &VipsBlob::from(blob),
17659                )
17660                .set(
17661                    "out",
17662                    &mut out_out,
17663                ),
17664        );
17665        unsafe { vips_area_unref(&mut (*blob).area) };
17666        utils::result(
17667            vips_op_response,
17668            out_out,
17669            Error::OperationError("WebploadBuffer (vips_webpload_buffer) failed".to_string()),
17670        )
17671    }
17672
17673    /// VipsForeignLoadWebpBuffer (webpload_buffer), load webp from buffer, priority=200, is_a_buffer, get_flags, get_flags_filename, header, load
17674    /// returns `VipsImage` - Output image
17675    ///
17676    /// buffer: `&[u8]` -> Buffer to load from
17677    ///
17678    /// <ins>Optional arguments</ins>
17679    ///
17680    /// page: `i32` -> First page to load
17681    ///
17682    /// n: `i32` -> Number of pages to load, -1 for all
17683    ///
17684    /// scale: `f64` -> Factor to scale by
17685    ///
17686    /// flags: [`ForeignFlags`] -> Flags for this file
17687    ///
17688    /// memory: `bool` -> Force open via memory
17689    ///
17690    /// access: [`Access`] -> Required access pattern for this file
17691    ///
17692    /// fail_on: [`FailOn`] -> Error level to fail on
17693    ///
17694    /// revalidate: `bool` -> Don't use a cached result for this operation
17695    pub fn webpload_buffer_with_opts(buffer: &[u8], option: VOption) -> Result<VipsImage> {
17696        let blob = unsafe {
17697            vips_blob_new(
17698                None,
17699                buffer.as_ptr() as _,
17700                buffer.len() as _,
17701            )
17702        };
17703        let mut out_out = VipsImage::from(null_mut());
17704        let vips_op_response = call(
17705            "webpload_buffer",
17706            option
17707                .set(
17708                    "buffer",
17709                    &VipsBlob::from(blob),
17710                )
17711                .set(
17712                    "out",
17713                    &mut out_out,
17714                ),
17715        );
17716        unsafe { vips_area_unref(&mut (*blob).area) };
17717        utils::result(
17718            vips_op_response,
17719            out_out,
17720            Error::OperationError("WebploadBuffer (vips_webpload_buffer) failed".to_string()),
17721        )
17722    }
17723
17724    /// VipsForeignLoadWebpSource (webpload_source), load webp from source, priority=200, is_a_source, get_flags, get_flags_filename, header, load
17725    /// returns `VipsImage` - Output image
17726    ///
17727    /// source: `&VipsSource` -> Source to load from
17728    pub fn webpload_source(source: &VipsSource) -> Result<VipsImage> {
17729        let mut out_out = VipsImage::from(null_mut());
17730        let vips_op_response = call(
17731            "webpload_source",
17732            VOption::new()
17733                .set(
17734                    "source",
17735                    source,
17736                )
17737                .set(
17738                    "out",
17739                    &mut out_out,
17740                ),
17741        );
17742
17743        utils::result(
17744            vips_op_response,
17745            out_out,
17746            Error::OperationError("WebploadSource (vips_webpload_source) failed".to_string()),
17747        )
17748    }
17749
17750    /// VipsForeignLoadWebpSource (webpload_source), load webp from source, priority=200, is_a_source, get_flags, get_flags_filename, header, load
17751    /// returns `VipsImage` - Output image
17752    ///
17753    /// source: `&VipsSource` -> Source to load from
17754    ///
17755    /// <ins>Optional arguments</ins>
17756    ///
17757    /// page: `i32` -> First page to load
17758    ///
17759    /// n: `i32` -> Number of pages to load, -1 for all
17760    ///
17761    /// scale: `f64` -> Factor to scale by
17762    ///
17763    /// flags: [`ForeignFlags`] -> Flags for this file
17764    ///
17765    /// memory: `bool` -> Force open via memory
17766    ///
17767    /// access: [`Access`] -> Required access pattern for this file
17768    ///
17769    /// fail_on: [`FailOn`] -> Error level to fail on
17770    ///
17771    /// revalidate: `bool` -> Don't use a cached result for this operation
17772    pub fn webpload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
17773        let mut out_out = VipsImage::from(null_mut());
17774        let vips_op_response = call(
17775            "webpload_source",
17776            option
17777                .set(
17778                    "source",
17779                    source,
17780                )
17781                .set(
17782                    "out",
17783                    &mut out_out,
17784                ),
17785        );
17786
17787        utils::result(
17788            vips_op_response,
17789            out_out,
17790            Error::OperationError("WebploadSource (vips_webpload_source) failed".to_string()),
17791        )
17792    }
17793
17794    /// VipsForeignSaveWebpFile (webpsave), save as WebP (.webp), priority=0, rgb alpha
17795    ///
17796    /// filename: `&str` -> Filename to save to
17797    pub fn webpsave(&self, filename: &str) -> Result<()> {
17798        let vips_op_response = call(
17799            "webpsave",
17800            VOption::new()
17801                .set("in", self)
17802                .set(
17803                    "filename",
17804                    filename,
17805                ),
17806        );
17807
17808        utils::result(
17809            vips_op_response,
17810            (),
17811            Error::OperationError("Webpsave (vips_webpsave) failed".to_string()),
17812        )
17813    }
17814
17815    /// VipsForeignSaveWebpFile (webpsave), save as WebP (.webp), priority=0, rgb alpha
17816    ///
17817    /// filename: `&str` -> Filename to save to
17818    ///
17819    /// <ins>Optional arguments</ins>
17820    ///
17821    /// Q: `i32` -> Q factor
17822    ///
17823    /// lossless: `bool` -> Enable lossless compression
17824    ///
17825    /// preset: [`ForeignWebpPreset`] -> Preset for lossy compression
17826    ///
17827    /// smart_subsample: `bool` -> Enable high quality chroma subsampling
17828    ///
17829    /// near_lossless: `bool` -> Enable preprocessing in lossless mode (uses Q)
17830    ///
17831    /// alpha_q: `i32` -> Change alpha plane fidelity for lossy compression
17832    ///
17833    /// min_size: `bool` -> Optimise for minimum size
17834    ///
17835    /// kmin: `i32` -> Minimum number of frames between key frames
17836    ///
17837    /// kmax: `i32` -> Maximum number of frames between key frames
17838    ///
17839    /// effort: `i32` -> Level of CPU effort to reduce file size
17840    ///
17841    /// target_size: `i32` -> Desired target size in bytes
17842    ///
17843    /// mixed: `bool` -> Allow mixed encoding (might reduce file size)
17844    ///
17845    /// smart_deblock: `bool` -> Enable auto-adjusting of the deblocking filter
17846    ///
17847    /// passes: `i32` -> Number of entropy-analysis passes (in [1..10])
17848    ///
17849    /// keep: [`ForeignKeep`] -> Which metadata to retain
17850    ///
17851    /// background: `&[f64]` -> Background value
17852    ///
17853    /// page_height: `i32` -> Set page height for multipage save
17854    ///
17855    /// profile: `&str` -> Filename of ICC profile to embed
17856    pub fn webpsave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
17857        let vips_op_response = call(
17858            "webpsave",
17859            option
17860                .set("in", self)
17861                .set(
17862                    "filename",
17863                    filename,
17864                ),
17865        );
17866
17867        utils::result(
17868            vips_op_response,
17869            (),
17870            Error::OperationError("Webpsave (vips_webpsave) failed".to_string()),
17871        )
17872    }
17873
17874    /// VipsForeignSaveWebpBuffer (webpsave_buffer), save as WebP (.webp), priority=0, rgb alpha
17875    /// returns `Vec<u8>` - Buffer to save to
17876    pub fn webpsave_buffer(&self) -> Result<Vec<u8>> {
17877        let mut buffer_out = VipsBlob::from(null_mut());
17878        let vips_op_response = call(
17879            "webpsave_buffer",
17880            VOption::new()
17881                .set("in", self)
17882                .set(
17883                    "buffer",
17884                    &mut buffer_out,
17885                ),
17886        );
17887
17888        utils::result(
17889            vips_op_response,
17890            buffer_out.into(),
17891            Error::OperationError("WebpsaveBuffer (vips_webpsave_buffer) failed".to_string()),
17892        )
17893    }
17894
17895    /// VipsForeignSaveWebpBuffer (webpsave_buffer), save as WebP (.webp), priority=0, rgb alpha
17896    /// returns `Vec<u8>` - Buffer to save to
17897    ///
17898    /// <ins>Optional arguments</ins>
17899    ///
17900    /// Q: `i32` -> Q factor
17901    ///
17902    /// lossless: `bool` -> Enable lossless compression
17903    ///
17904    /// preset: [`ForeignWebpPreset`] -> Preset for lossy compression
17905    ///
17906    /// smart_subsample: `bool` -> Enable high quality chroma subsampling
17907    ///
17908    /// near_lossless: `bool` -> Enable preprocessing in lossless mode (uses Q)
17909    ///
17910    /// alpha_q: `i32` -> Change alpha plane fidelity for lossy compression
17911    ///
17912    /// min_size: `bool` -> Optimise for minimum size
17913    ///
17914    /// kmin: `i32` -> Minimum number of frames between key frames
17915    ///
17916    /// kmax: `i32` -> Maximum number of frames between key frames
17917    ///
17918    /// effort: `i32` -> Level of CPU effort to reduce file size
17919    ///
17920    /// target_size: `i32` -> Desired target size in bytes
17921    ///
17922    /// mixed: `bool` -> Allow mixed encoding (might reduce file size)
17923    ///
17924    /// smart_deblock: `bool` -> Enable auto-adjusting of the deblocking filter
17925    ///
17926    /// passes: `i32` -> Number of entropy-analysis passes (in [1..10])
17927    ///
17928    /// keep: [`ForeignKeep`] -> Which metadata to retain
17929    ///
17930    /// background: `&[f64]` -> Background value
17931    ///
17932    /// page_height: `i32` -> Set page height for multipage save
17933    ///
17934    /// profile: `&str` -> Filename of ICC profile to embed
17935    pub fn webpsave_buffer_with_opts(&self, option: VOption) -> Result<Vec<u8>> {
17936        let mut buffer_out = VipsBlob::from(null_mut());
17937        let vips_op_response = call(
17938            "webpsave_buffer",
17939            option
17940                .set("in", self)
17941                .set(
17942                    "buffer",
17943                    &mut buffer_out,
17944                ),
17945        );
17946
17947        utils::result(
17948            vips_op_response,
17949            buffer_out.into(),
17950            Error::OperationError("WebpsaveBuffer (vips_webpsave_buffer) failed".to_string()),
17951        )
17952    }
17953
17954    /// VipsForeignSaveWebpMime (webpsave_mime), save image to webp mime (.webp), priority=0, rgb alpha
17955    pub fn webpsave_mime(&self) -> Result<()> {
17956        let vips_op_response = call(
17957            "webpsave_mime",
17958            VOption::new().set("in", self),
17959        );
17960
17961        utils::result(
17962            vips_op_response,
17963            (),
17964            Error::OperationError("WebpsaveMime (vips_webpsave_mime) failed".to_string()),
17965        )
17966    }
17967
17968    /// VipsForeignSaveWebpMime (webpsave_mime), save image to webp mime (.webp), priority=0, rgb alpha
17969    ///
17970    /// <ins>Optional arguments</ins>
17971    ///
17972    /// Q: `i32` -> Q factor
17973    ///
17974    /// lossless: `bool` -> Enable lossless compression
17975    ///
17976    /// preset: [`ForeignWebpPreset`] -> Preset for lossy compression
17977    ///
17978    /// smart_subsample: `bool` -> Enable high quality chroma subsampling
17979    ///
17980    /// near_lossless: `bool` -> Enable preprocessing in lossless mode (uses Q)
17981    ///
17982    /// alpha_q: `i32` -> Change alpha plane fidelity for lossy compression
17983    ///
17984    /// min_size: `bool` -> Optimise for minimum size
17985    ///
17986    /// kmin: `i32` -> Minimum number of frames between key frames
17987    ///
17988    /// kmax: `i32` -> Maximum number of frames between key frames
17989    ///
17990    /// effort: `i32` -> Level of CPU effort to reduce file size
17991    ///
17992    /// target_size: `i32` -> Desired target size in bytes
17993    ///
17994    /// mixed: `bool` -> Allow mixed encoding (might reduce file size)
17995    ///
17996    /// smart_deblock: `bool` -> Enable auto-adjusting of the deblocking filter
17997    ///
17998    /// passes: `i32` -> Number of entropy-analysis passes (in [1..10])
17999    ///
18000    /// keep: [`ForeignKeep`] -> Which metadata to retain
18001    ///
18002    /// background: `&[f64]` -> Background value
18003    ///
18004    /// page_height: `i32` -> Set page height for multipage save
18005    ///
18006    /// profile: `&str` -> Filename of ICC profile to embed
18007    pub fn webpsave_mime_with_opts(&self, option: VOption) -> Result<()> {
18008        let vips_op_response = call(
18009            "webpsave_mime",
18010            option.set("in", self),
18011        );
18012
18013        utils::result(
18014            vips_op_response,
18015            (),
18016            Error::OperationError("WebpsaveMime (vips_webpsave_mime) failed".to_string()),
18017        )
18018    }
18019
18020    /// VipsForeignSaveWebpTarget (webpsave_target), save as WebP (.webp), priority=0, rgb alpha
18021    ///
18022    /// target: `&VipsTarget` -> Target to save to
18023    pub fn webpsave_target(&self, target: &VipsTarget) -> Result<()> {
18024        let vips_op_response = call(
18025            "webpsave_target",
18026            VOption::new()
18027                .set("in", self)
18028                .set(
18029                    "target",
18030                    target,
18031                ),
18032        );
18033
18034        utils::result(
18035            vips_op_response,
18036            (),
18037            Error::OperationError("WebpsaveTarget (vips_webpsave_target) failed".to_string()),
18038        )
18039    }
18040
18041    /// VipsForeignSaveWebpTarget (webpsave_target), save as WebP (.webp), priority=0, rgb alpha
18042    ///
18043    /// target: `&VipsTarget` -> Target to save to
18044    ///
18045    /// <ins>Optional arguments</ins>
18046    ///
18047    /// Q: `i32` -> Q factor
18048    ///
18049    /// lossless: `bool` -> Enable lossless compression
18050    ///
18051    /// preset: [`ForeignWebpPreset`] -> Preset for lossy compression
18052    ///
18053    /// smart_subsample: `bool` -> Enable high quality chroma subsampling
18054    ///
18055    /// near_lossless: `bool` -> Enable preprocessing in lossless mode (uses Q)
18056    ///
18057    /// alpha_q: `i32` -> Change alpha plane fidelity for lossy compression
18058    ///
18059    /// min_size: `bool` -> Optimise for minimum size
18060    ///
18061    /// kmin: `i32` -> Minimum number of frames between key frames
18062    ///
18063    /// kmax: `i32` -> Maximum number of frames between key frames
18064    ///
18065    /// effort: `i32` -> Level of CPU effort to reduce file size
18066    ///
18067    /// target_size: `i32` -> Desired target size in bytes
18068    ///
18069    /// mixed: `bool` -> Allow mixed encoding (might reduce file size)
18070    ///
18071    /// smart_deblock: `bool` -> Enable auto-adjusting of the deblocking filter
18072    ///
18073    /// passes: `i32` -> Number of entropy-analysis passes (in [1..10])
18074    ///
18075    /// keep: [`ForeignKeep`] -> Which metadata to retain
18076    ///
18077    /// background: `&[f64]` -> Background value
18078    ///
18079    /// page_height: `i32` -> Set page height for multipage save
18080    ///
18081    /// profile: `&str` -> Filename of ICC profile to embed
18082    pub fn webpsave_target_with_opts(&self, target: &VipsTarget, option: VOption) -> Result<()> {
18083        let vips_op_response = call(
18084            "webpsave_target",
18085            option
18086                .set("in", self)
18087                .set(
18088                    "target",
18089                    target,
18090                ),
18091        );
18092
18093        utils::result(
18094            vips_op_response,
18095            (),
18096            Error::OperationError("WebpsaveTarget (vips_webpsave_target) failed".to_string()),
18097        )
18098    }
18099
18100    /// VipsWorley (worley), make a worley noise image
18101    /// returns `VipsImage` - Output image
18102    ///
18103    /// width: `i32` -> Image width in pixels
18104    ///
18105    /// height: `i32` -> Image height in pixels
18106    pub fn worley(width: i32, height: i32) -> Result<VipsImage> {
18107        let mut out_out = VipsImage::from(null_mut());
18108        let vips_op_response = call(
18109            "worley",
18110            VOption::new()
18111                .set(
18112                    "out",
18113                    &mut out_out,
18114                )
18115                .set(
18116                    "width",
18117                    width,
18118                )
18119                .set(
18120                    "height",
18121                    height,
18122                ),
18123        );
18124
18125        utils::result(
18126            vips_op_response,
18127            out_out,
18128            Error::OperationError("Worley (vips_worley) failed".to_string()),
18129        )
18130    }
18131
18132    /// VipsWorley (worley), make a worley noise image
18133    /// returns `VipsImage` - Output image
18134    ///
18135    /// width: `i32` -> Image width in pixels
18136    ///
18137    /// height: `i32` -> Image height in pixels
18138    ///
18139    /// <ins>Optional arguments</ins>
18140    ///
18141    /// cell_size: `i32` -> Size of Worley cells
18142    ///
18143    /// seed: `i32` -> Random number seed
18144    pub fn worley_with_opts(width: i32, height: i32, option: VOption) -> Result<VipsImage> {
18145        let mut out_out = VipsImage::from(null_mut());
18146        let vips_op_response = call(
18147            "worley",
18148            option
18149                .set(
18150                    "out",
18151                    &mut out_out,
18152                )
18153                .set(
18154                    "width",
18155                    width,
18156                )
18157                .set(
18158                    "height",
18159                    height,
18160                ),
18161        );
18162
18163        utils::result(
18164            vips_op_response,
18165            out_out,
18166            Error::OperationError("Worley (vips_worley) failed".to_string()),
18167        )
18168    }
18169
18170    /// VipsWrap (wrap), wrap image origin
18171    /// returns `VipsImage` - Output image
18172    pub fn wrap(&self) -> Result<VipsImage> {
18173        let mut out_out = VipsImage::from(null_mut());
18174        let vips_op_response = call(
18175            "wrap",
18176            VOption::new()
18177                .set("in", self)
18178                .set(
18179                    "out",
18180                    &mut out_out,
18181                ),
18182        );
18183
18184        utils::result(
18185            vips_op_response,
18186            out_out,
18187            Error::OperationError("Wrap (vips_wrap) failed".to_string()),
18188        )
18189    }
18190
18191    /// VipsWrap (wrap), wrap image origin
18192    /// returns `VipsImage` - Output image
18193    ///
18194    /// <ins>Optional arguments</ins>
18195    ///
18196    /// x: `i32` -> Left edge of input in output
18197    ///
18198    /// y: `i32` -> Top edge of input in output
18199    pub fn wrap_with_opts(&self, option: VOption) -> Result<VipsImage> {
18200        let mut out_out = VipsImage::from(null_mut());
18201        let vips_op_response = call(
18202            "wrap",
18203            option
18204                .set("in", self)
18205                .set(
18206                    "out",
18207                    &mut out_out,
18208                ),
18209        );
18210
18211        utils::result(
18212            vips_op_response,
18213            out_out,
18214            Error::OperationError("Wrap (vips_wrap) failed".to_string()),
18215        )
18216    }
18217
18218    /// VipsXyz (xyz), make an image where pixel values are coordinates
18219    /// returns `VipsImage` - Output image
18220    ///
18221    /// width: `i32` -> Image width in pixels
18222    ///
18223    /// height: `i32` -> Image height in pixels
18224    pub fn xyz(width: i32, height: i32) -> Result<VipsImage> {
18225        let mut out_out = VipsImage::from(null_mut());
18226        let vips_op_response = call(
18227            "xyz",
18228            VOption::new()
18229                .set(
18230                    "out",
18231                    &mut out_out,
18232                )
18233                .set(
18234                    "width",
18235                    width,
18236                )
18237                .set(
18238                    "height",
18239                    height,
18240                ),
18241        );
18242
18243        utils::result(
18244            vips_op_response,
18245            out_out,
18246            Error::OperationError("Xyz (vips_xyz) failed".to_string()),
18247        )
18248    }
18249
18250    /// VipsXyz (xyz), make an image where pixel values are coordinates
18251    /// returns `VipsImage` - Output image
18252    ///
18253    /// width: `i32` -> Image width in pixels
18254    ///
18255    /// height: `i32` -> Image height in pixels
18256    ///
18257    /// <ins>Optional arguments</ins>
18258    ///
18259    /// csize: `i32` -> Size of third dimension
18260    ///
18261    /// dsize: `i32` -> Size of fourth dimension
18262    ///
18263    /// esize: `i32` -> Size of fifth dimension
18264    pub fn xyz_with_opts(width: i32, height: i32, option: VOption) -> Result<VipsImage> {
18265        let mut out_out = VipsImage::from(null_mut());
18266        let vips_op_response = call(
18267            "xyz",
18268            option
18269                .set(
18270                    "out",
18271                    &mut out_out,
18272                )
18273                .set(
18274                    "width",
18275                    width,
18276                )
18277                .set(
18278                    "height",
18279                    height,
18280                ),
18281        );
18282
18283        utils::result(
18284            vips_op_response,
18285            out_out,
18286            Error::OperationError("Xyz (vips_xyz) failed".to_string()),
18287        )
18288    }
18289
18290    /// VipsZone (zone), make a zone plate
18291    /// returns `VipsImage` - Output image
18292    ///
18293    /// width: `i32` -> Image width in pixels
18294    ///
18295    /// height: `i32` -> Image height in pixels
18296    pub fn zone(width: i32, height: i32) -> Result<VipsImage> {
18297        let mut out_out = VipsImage::from(null_mut());
18298        let vips_op_response = call(
18299            "zone",
18300            VOption::new()
18301                .set(
18302                    "out",
18303                    &mut out_out,
18304                )
18305                .set(
18306                    "width",
18307                    width,
18308                )
18309                .set(
18310                    "height",
18311                    height,
18312                ),
18313        );
18314
18315        utils::result(
18316            vips_op_response,
18317            out_out,
18318            Error::OperationError("Zone (vips_zone) failed".to_string()),
18319        )
18320    }
18321
18322    /// VipsZone (zone), make a zone plate
18323    /// returns `VipsImage` - Output image
18324    ///
18325    /// width: `i32` -> Image width in pixels
18326    ///
18327    /// height: `i32` -> Image height in pixels
18328    ///
18329    /// <ins>Optional arguments</ins>
18330    ///
18331    /// uchar: `bool` -> Output an unsigned char image
18332    pub fn zone_with_opts(width: i32, height: i32, option: VOption) -> Result<VipsImage> {
18333        let mut out_out = VipsImage::from(null_mut());
18334        let vips_op_response = call(
18335            "zone",
18336            option
18337                .set(
18338                    "out",
18339                    &mut out_out,
18340                )
18341                .set(
18342                    "width",
18343                    width,
18344                )
18345                .set(
18346                    "height",
18347                    height,
18348                ),
18349        );
18350
18351        utils::result(
18352            vips_op_response,
18353            out_out,
18354            Error::OperationError("Zone (vips_zone) failed".to_string()),
18355        )
18356    }
18357
18358    /// VipsZoom (zoom), zoom an image
18359    /// returns `VipsImage` - Output image
18360    ///
18361    /// xfac: `i32` -> Horizontal zoom factor
18362    ///
18363    /// yfac: `i32` -> Vertical zoom factor
18364    pub fn zoom(&self, xfac: i32, yfac: i32) -> Result<VipsImage> {
18365        let mut out_out = VipsImage::from(null_mut());
18366        let vips_op_response = call(
18367            "zoom",
18368            VOption::new()
18369                .set(
18370                    "input",
18371                    self,
18372                )
18373                .set(
18374                    "out",
18375                    &mut out_out,
18376                )
18377                .set(
18378                    "xfac",
18379                    xfac,
18380                )
18381                .set(
18382                    "yfac",
18383                    yfac,
18384                ),
18385        );
18386
18387        utils::result(
18388            vips_op_response,
18389            out_out,
18390            Error::OperationError("Zoom (vips_zoom) failed".to_string()),
18391        )
18392    }
18393
18394    // Alias for operator overload
18395    pub(crate) fn add_image(&self, right: &VipsImage) -> Result<VipsImage> {
18396        self.add(right)
18397    }
18398
18399    /// VipsBandjoin (bandjoin), bandwise join two images
18400    /// returns `VipsImage` - Output image
18401    ///
18402    /// other: `VipsImage` -> Input images
18403    pub fn bandjoin_with(self, other: VipsImage) -> Result<VipsImage> {
18404        Self::bandjoin(&[self, other])
18405    }
18406
18407    /// VipsMedian (median), median filter of the specified size.
18408    pub fn median(&self, size: i32) -> Result<VipsImage> {
18409        self.rank(
18410            size,
18411            size,
18412            (size * size) / 2,
18413        )
18414    }
18415}