rs_vips/ops.rs
1// (c) Copyright 2019-2025 OLX
2// (c) Copyright 2025 mrdkprj
3#![allow(clippy::too_many_arguments)]
4#![allow(clippy::upper_case_acronyms)]
5use crate::bindings::vips_blob_new;
6use crate::connection::VipsSource;
7use crate::connection::VipsTarget;
8use crate::error::*;
9use crate::region::VipsBlob;
10use crate::utils;
11use crate::voption::{call, Setter, VOption};
12use crate::Result;
13use crate::VipsImage;
14use std::ffi::c_void;
15use std::ptr::null_mut;
16
17const NULL: *const c_void = null_mut();
18
19#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
20pub enum Access {
21 /// `Random` -> VIPS_ACCESS_RANDOM = 0
22 Random = 0,
23 /// `Sequential` -> VIPS_ACCESS_SEQUENTIAL = 1
24 Sequential = 1,
25 /// `SequentialUnbuffered` -> VIPS_ACCESS_SEQUENTIAL_UNBUFFERED = 2
26 SequentialUnbuffered = 2,
27 /// `Last` -> VIPS_ACCESS_LAST = 3
28 Last = 3,
29}
30
31#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
32pub enum Align {
33 /// `Low` -> VIPS_ALIGN_LOW = 0
34 Low = 0,
35 /// `Centre` -> VIPS_ALIGN_CENTRE = 1
36 Centre = 1,
37 /// `High` -> VIPS_ALIGN_HIGH = 2
38 High = 2,
39 /// `Last` -> VIPS_ALIGN_LAST = 3
40 Last = 3,
41}
42
43#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
44pub enum Angle {
45 /// `D0` -> VIPS_ANGLE_D0 = 0
46 D0 = 0,
47 /// `D90` -> VIPS_ANGLE_D90 = 1
48 D90 = 1,
49 /// `D180` -> VIPS_ANGLE_D180 = 2
50 D180 = 2,
51 /// `D270` -> VIPS_ANGLE_D270 = 3
52 D270 = 3,
53 /// `Last` -> VIPS_ANGLE_LAST = 4
54 Last = 4,
55}
56
57#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
58pub enum Angle45 {
59 /// `D0` -> VIPS_ANGLE45_D0 = 0
60 D0 = 0,
61 /// `D45` -> VIPS_ANGLE45_D45 = 1
62 D45 = 1,
63 /// `D90` -> VIPS_ANGLE45_D90 = 2
64 D90 = 2,
65 /// `D135` -> VIPS_ANGLE45_D135 = 3
66 D135 = 3,
67 /// `D180` -> VIPS_ANGLE45_D180 = 4
68 D180 = 4,
69 /// `D225` -> VIPS_ANGLE45_D225 = 5
70 D225 = 5,
71 /// `D270` -> VIPS_ANGLE45_D270 = 6
72 D270 = 6,
73 /// `D315` -> VIPS_ANGLE45_D315 = 7
74 D315 = 7,
75 /// `Last` -> VIPS_ANGLE45_LAST = 8
76 Last = 8,
77}
78
79#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
80pub enum BandFormat {
81 /// `Notset` -> VIPS_FORMAT_NOTSET = -1
82 Notset = -1,
83 /// `Uchar` -> VIPS_FORMAT_UCHAR = 0
84 Uchar = 0,
85 /// `Char` -> VIPS_FORMAT_CHAR = 1
86 Char = 1,
87 /// `Ushort` -> VIPS_FORMAT_USHORT = 2
88 Ushort = 2,
89 /// `Short` -> VIPS_FORMAT_SHORT = 3
90 Short = 3,
91 /// `Uint` -> VIPS_FORMAT_UINT = 4
92 Uint = 4,
93 /// `Int` -> VIPS_FORMAT_INT = 5
94 Int = 5,
95 /// `Float` -> VIPS_FORMAT_FLOAT = 6
96 Float = 6,
97 /// `Complex` -> VIPS_FORMAT_COMPLEX = 7
98 Complex = 7,
99 /// `Double` -> VIPS_FORMAT_DOUBLE = 8
100 Double = 8,
101 /// `Dpcomplex` -> VIPS_FORMAT_DPCOMPLEX = 9
102 Dpcomplex = 9,
103 /// `Last` -> VIPS_FORMAT_LAST = 10
104 Last = 10,
105}
106
107#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
108pub enum BlendMode {
109 /// `Clear` -> VIPS_BLEND_MODE_CLEAR = 0
110 Clear = 0,
111 /// `Source` -> VIPS_BLEND_MODE_SOURCE = 1
112 Source = 1,
113 /// `Over` -> VIPS_BLEND_MODE_OVER = 2
114 Over = 2,
115 /// `In` -> VIPS_BLEND_MODE_IN = 3
116 In = 3,
117 /// `Out` -> VIPS_BLEND_MODE_OUT = 4
118 Out = 4,
119 /// `Atop` -> VIPS_BLEND_MODE_ATOP = 5
120 Atop = 5,
121 /// `Dest` -> VIPS_BLEND_MODE_DEST = 6
122 Dest = 6,
123 /// `DestOver` -> VIPS_BLEND_MODE_DEST_OVER = 7
124 DestOver = 7,
125 /// `DestIn` -> VIPS_BLEND_MODE_DEST_IN = 8
126 DestIn = 8,
127 /// `DestOut` -> VIPS_BLEND_MODE_DEST_OUT = 9
128 DestOut = 9,
129 /// `DestAtop` -> VIPS_BLEND_MODE_DEST_ATOP = 10
130 DestAtop = 10,
131 /// `Xor` -> VIPS_BLEND_MODE_XOR = 11
132 Xor = 11,
133 /// `Add` -> VIPS_BLEND_MODE_ADD = 12
134 Add = 12,
135 /// `Saturate` -> VIPS_BLEND_MODE_SATURATE = 13
136 Saturate = 13,
137 /// `Multiply` -> VIPS_BLEND_MODE_MULTIPLY = 14
138 Multiply = 14,
139 /// `Screen` -> VIPS_BLEND_MODE_SCREEN = 15
140 Screen = 15,
141 /// `Overlay` -> VIPS_BLEND_MODE_OVERLAY = 16
142 Overlay = 16,
143 /// `Darken` -> VIPS_BLEND_MODE_DARKEN = 17
144 Darken = 17,
145 /// `Lighten` -> VIPS_BLEND_MODE_LIGHTEN = 18
146 Lighten = 18,
147 /// `ColourDodge` -> VIPS_BLEND_MODE_COLOUR_DODGE = 19
148 ColourDodge = 19,
149 /// `ColourBurn` -> VIPS_BLEND_MODE_COLOUR_BURN = 20
150 ColourBurn = 20,
151 /// `HardLight` -> VIPS_BLEND_MODE_HARD_LIGHT = 21
152 HardLight = 21,
153 /// `SoftLight` -> VIPS_BLEND_MODE_SOFT_LIGHT = 22
154 SoftLight = 22,
155 /// `Difference` -> VIPS_BLEND_MODE_DIFFERENCE = 23
156 Difference = 23,
157 /// `Exclusion` -> VIPS_BLEND_MODE_EXCLUSION = 24
158 Exclusion = 24,
159 /// `Last` -> VIPS_BLEND_MODE_LAST = 25
160 Last = 25,
161}
162
163#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
164pub enum Coding {
165 /// `Error` -> VIPS_CODING_ERROR = -1
166 Error = -1,
167 /// `None` -> VIPS_CODING_NONE = 0
168 None = 0,
169 /// `Labq` -> VIPS_CODING_LABQ = 2
170 Labq = 2,
171 /// `Rad` -> VIPS_CODING_RAD = 6
172 Rad = 6,
173 /// `Last` -> VIPS_CODING_LAST = 7
174 Last = 7,
175}
176
177#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
178pub enum Combine {
179 /// `Max` -> VIPS_COMBINE_MAX = 0
180 Max = 0,
181 /// `Sum` -> VIPS_COMBINE_SUM = 1
182 Sum = 1,
183 /// `Min` -> VIPS_COMBINE_MIN = 2
184 Min = 2,
185 /// `Last` -> VIPS_COMBINE_LAST = 3
186 Last = 3,
187}
188
189#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
190pub enum CombineMode {
191 /// `Set` -> VIPS_COMBINE_MODE_SET = 0
192 Set = 0,
193 /// `Add` -> VIPS_COMBINE_MODE_ADD = 1
194 Add = 1,
195 /// `Last` -> VIPS_COMBINE_MODE_LAST = 2
196 Last = 2,
197}
198
199#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
200pub enum CompassDirection {
201 /// `Centre` -> VIPS_COMPASS_DIRECTION_CENTRE = 0
202 Centre = 0,
203 /// `North` -> VIPS_COMPASS_DIRECTION_NORTH = 1
204 North = 1,
205 /// `East` -> VIPS_COMPASS_DIRECTION_EAST = 2
206 East = 2,
207 /// `South` -> VIPS_COMPASS_DIRECTION_SOUTH = 3
208 South = 3,
209 /// `West` -> VIPS_COMPASS_DIRECTION_WEST = 4
210 West = 4,
211 /// `NorthEast` -> VIPS_COMPASS_DIRECTION_NORTH_EAST = 5
212 NorthEast = 5,
213 /// `SouthEast` -> VIPS_COMPASS_DIRECTION_SOUTH_EAST = 6
214 SouthEast = 6,
215 /// `SouthWest` -> VIPS_COMPASS_DIRECTION_SOUTH_WEST = 7
216 SouthWest = 7,
217 /// `NorthWest` -> VIPS_COMPASS_DIRECTION_NORTH_WEST = 8
218 NorthWest = 8,
219 /// `Last` -> VIPS_COMPASS_DIRECTION_LAST = 9
220 Last = 9,
221}
222
223#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
224pub enum Direction {
225 /// `Horizontal` -> VIPS_DIRECTION_HORIZONTAL = 0
226 Horizontal = 0,
227 /// `Vertical` -> VIPS_DIRECTION_VERTICAL = 1
228 Vertical = 1,
229 /// `Last` -> VIPS_DIRECTION_LAST = 2
230 Last = 2,
231}
232
233#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
234pub enum Extend {
235 /// `Black` -> VIPS_EXTEND_BLACK = 0
236 Black = 0,
237 /// `Copy` -> VIPS_EXTEND_COPY = 1
238 Copy = 1,
239 /// `Repeat` -> VIPS_EXTEND_REPEAT = 2
240 Repeat = 2,
241 /// `Mirror` -> VIPS_EXTEND_MIRROR = 3
242 Mirror = 3,
243 /// `White` -> VIPS_EXTEND_WHITE = 4
244 White = 4,
245 /// `Background` -> VIPS_EXTEND_BACKGROUND = 5
246 Background = 5,
247 /// `Last` -> VIPS_EXTEND_LAST = 6
248 Last = 6,
249}
250
251#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
252pub enum FailOn {
253 /// `None` -> VIPS_FAIL_ON_NONE = 0
254 None = 0,
255 /// `Truncated` -> VIPS_FAIL_ON_TRUNCATED = 1
256 Truncated = 1,
257 /// `Error` -> VIPS_FAIL_ON_ERROR = 2
258 Error = 2,
259 /// `Warning` -> VIPS_FAIL_ON_WARNING = 3
260 Warning = 3,
261 /// `Last` -> VIPS_FAIL_ON_LAST = 4
262 Last = 4,
263}
264
265#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
266pub enum ForeignDzContainer {
267 /// `Fs` -> VIPS_FOREIGN_DZ_CONTAINER_FS = 0
268 Fs = 0,
269 /// `Zip` -> VIPS_FOREIGN_DZ_CONTAINER_ZIP = 1
270 Zip = 1,
271 /// `Szi` -> VIPS_FOREIGN_DZ_CONTAINER_SZI = 2
272 Szi = 2,
273 /// `Last` -> VIPS_FOREIGN_DZ_CONTAINER_LAST = 3
274 Last = 3,
275}
276
277#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
278pub enum ForeignDzDepth {
279 /// `Onepixel` -> VIPS_FOREIGN_DZ_DEPTH_ONEPIXEL = 0
280 Onepixel = 0,
281 /// `Onetile` -> VIPS_FOREIGN_DZ_DEPTH_ONETILE = 1
282 Onetile = 1,
283 /// `One` -> VIPS_FOREIGN_DZ_DEPTH_ONE = 2
284 One = 2,
285 /// `Last` -> VIPS_FOREIGN_DZ_DEPTH_LAST = 3
286 Last = 3,
287}
288
289#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
290pub enum ForeignDzLayout {
291 /// `Dz` -> VIPS_FOREIGN_DZ_LAYOUT_DZ = 0
292 Dz = 0,
293 /// `Zoomify` -> VIPS_FOREIGN_DZ_LAYOUT_ZOOMIFY = 1
294 Zoomify = 1,
295 /// `Google` -> VIPS_FOREIGN_DZ_LAYOUT_GOOGLE = 2
296 Google = 2,
297 /// `Iiif` -> VIPS_FOREIGN_DZ_LAYOUT_IIIF = 3
298 Iiif = 3,
299 /// `Iiif3` -> VIPS_FOREIGN_DZ_LAYOUT_IIIF3 = 4
300 Iiif3 = 4,
301 /// `Last` -> VIPS_FOREIGN_DZ_LAYOUT_LAST = 5
302 Last = 5,
303}
304
305#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
306pub enum ForeignFlags {
307 /// `None` -> VIPS_FOREIGN_NONE = 0
308 None = 0,
309 /// `Partial` -> VIPS_FOREIGN_PARTIAL = 1
310 Partial = 1,
311 /// `Bigendian` -> VIPS_FOREIGN_BIGENDIAN = 2
312 Bigendian = 2,
313 /// `Sequential` -> VIPS_FOREIGN_SEQUENTIAL = 4
314 Sequential = 4,
315 /// `All` -> VIPS_FOREIGN_ALL = 7
316 All = 7,
317}
318
319#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
320pub enum ForeignHeifCompression {
321 /// `Hevc` -> VIPS_FOREIGN_HEIF_COMPRESSION_HEVC = 1
322 Hevc = 1,
323 /// `Avc` -> VIPS_FOREIGN_HEIF_COMPRESSION_AVC = 2
324 Avc = 2,
325 /// `Jpeg` -> VIPS_FOREIGN_HEIF_COMPRESSION_JPEG = 3
326 Jpeg = 3,
327 /// `Av1` -> VIPS_FOREIGN_HEIF_COMPRESSION_AV1 = 4
328 Av1 = 4,
329 /// `Last` -> VIPS_FOREIGN_HEIF_COMPRESSION_LAST = 5
330 Last = 5,
331}
332
333#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
334pub enum ForeignHeifEncoder {
335 /// `Auto` -> VIPS_FOREIGN_HEIF_ENCODER_AUTO = 0
336 Auto = 0,
337 /// `Aom` -> VIPS_FOREIGN_HEIF_ENCODER_AOM = 1
338 Aom = 1,
339 /// `Rav1E` -> VIPS_FOREIGN_HEIF_ENCODER_RAV1E = 2
340 Rav1E = 2,
341 /// `Svt` -> VIPS_FOREIGN_HEIF_ENCODER_SVT = 3
342 Svt = 3,
343 /// `X265` -> VIPS_FOREIGN_HEIF_ENCODER_X265 = 4
344 X265 = 4,
345 /// `Last` -> VIPS_FOREIGN_HEIF_ENCODER_LAST = 5
346 Last = 5,
347}
348
349#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
350pub enum ForeignKeep {
351 /// `None` -> VIPS_FOREIGN_KEEP_NONE = 0
352 None = 0,
353 /// `Exif` -> VIPS_FOREIGN_KEEP_EXIF = 1
354 Exif = 1,
355 /// `Xmp` -> VIPS_FOREIGN_KEEP_XMP = 2
356 Xmp = 2,
357 /// `Iptc` -> VIPS_FOREIGN_KEEP_IPTC = 4
358 Iptc = 4,
359 /// `Icc` -> VIPS_FOREIGN_KEEP_ICC = 8
360 Icc = 8,
361 /// `Other` -> VIPS_FOREIGN_KEEP_OTHER = 16
362 Other = 16,
363 /// `All` -> VIPS_FOREIGN_KEEP_ALL = 31
364 All = 31,
365}
366
367#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
368pub enum ForeignPngFilter {
369 /// `None` -> VIPS_FOREIGN_PNG_FILTER_NONE = 8
370 None = 8,
371 /// `Sub` -> VIPS_FOREIGN_PNG_FILTER_SUB = 16
372 Sub = 16,
373 /// `Up` -> VIPS_FOREIGN_PNG_FILTER_UP = 32
374 Up = 32,
375 /// `Avg` -> VIPS_FOREIGN_PNG_FILTER_AVG = 64
376 Avg = 64,
377 /// `Paeth` -> VIPS_FOREIGN_PNG_FILTER_PAETH = 128
378 Paeth = 128,
379 /// `All` -> VIPS_FOREIGN_PNG_FILTER_ALL = 248
380 All = 248,
381}
382
383#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
384pub enum ForeignPpmFormat {
385 /// `Pbm` -> VIPS_FOREIGN_PPM_FORMAT_PBM = 0
386 Pbm = 0,
387 /// `Pgm` -> VIPS_FOREIGN_PPM_FORMAT_PGM = 1
388 Pgm = 1,
389 /// `Ppm` -> VIPS_FOREIGN_PPM_FORMAT_PPM = 2
390 Ppm = 2,
391 /// `Pfm` -> VIPS_FOREIGN_PPM_FORMAT_PFM = 3
392 Pfm = 3,
393 /// `Pnm` -> VIPS_FOREIGN_PPM_FORMAT_PNM = 4
394 Pnm = 4,
395 /// `Last` -> VIPS_FOREIGN_PPM_FORMAT_LAST = 5
396 Last = 5,
397}
398
399#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
400pub enum ForeignSubsample {
401 /// `Auto` -> VIPS_FOREIGN_SUBSAMPLE_AUTO = 0
402 Auto = 0,
403 /// `On` -> VIPS_FOREIGN_SUBSAMPLE_ON = 1
404 On = 1,
405 /// `Off` -> VIPS_FOREIGN_SUBSAMPLE_OFF = 2
406 Off = 2,
407 /// `Last` -> VIPS_FOREIGN_SUBSAMPLE_LAST = 3
408 Last = 3,
409}
410
411#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
412pub enum ForeignTiffCompression {
413 /// `None` -> VIPS_FOREIGN_TIFF_COMPRESSION_NONE = 0
414 None = 0,
415 /// `Jpeg` -> VIPS_FOREIGN_TIFF_COMPRESSION_JPEG = 1
416 Jpeg = 1,
417 /// `Deflate` -> VIPS_FOREIGN_TIFF_COMPRESSION_DEFLATE = 2
418 Deflate = 2,
419 /// `Packbits` -> VIPS_FOREIGN_TIFF_COMPRESSION_PACKBITS = 3
420 Packbits = 3,
421 /// `Ccittfax4` -> VIPS_FOREIGN_TIFF_COMPRESSION_CCITTFAX4 = 4
422 Ccittfax4 = 4,
423 /// `Lzw` -> VIPS_FOREIGN_TIFF_COMPRESSION_LZW = 5
424 Lzw = 5,
425 /// `Webp` -> VIPS_FOREIGN_TIFF_COMPRESSION_WEBP = 6
426 Webp = 6,
427 /// `Zstd` -> VIPS_FOREIGN_TIFF_COMPRESSION_ZSTD = 7
428 Zstd = 7,
429 /// `Jp2K` -> VIPS_FOREIGN_TIFF_COMPRESSION_JP2K = 8
430 Jp2K = 8,
431 /// `Last` -> VIPS_FOREIGN_TIFF_COMPRESSION_LAST = 9
432 Last = 9,
433}
434
435#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
436pub enum ForeignTiffPredictor {
437 /// `None` -> VIPS_FOREIGN_TIFF_PREDICTOR_NONE = 1
438 None = 1,
439 /// `Horizontal` -> VIPS_FOREIGN_TIFF_PREDICTOR_HORIZONTAL = 2
440 Horizontal = 2,
441 /// `Float` -> VIPS_FOREIGN_TIFF_PREDICTOR_FLOAT = 3
442 Float = 3,
443 /// `Last` -> VIPS_FOREIGN_TIFF_PREDICTOR_LAST = 4
444 Last = 4,
445}
446
447#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
448pub enum ForeignTiffResunit {
449 /// `Cm` -> VIPS_FOREIGN_TIFF_RESUNIT_CM = 0
450 Cm = 0,
451 /// `Inch` -> VIPS_FOREIGN_TIFF_RESUNIT_INCH = 1
452 Inch = 1,
453 /// `Last` -> VIPS_FOREIGN_TIFF_RESUNIT_LAST = 2
454 Last = 2,
455}
456
457#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
458pub enum ForeignWebpPreset {
459 /// `Default` -> VIPS_FOREIGN_WEBP_PRESET_DEFAULT = 0
460 Default = 0,
461 /// `Picture` -> VIPS_FOREIGN_WEBP_PRESET_PICTURE = 1
462 Picture = 1,
463 /// `Photo` -> VIPS_FOREIGN_WEBP_PRESET_PHOTO = 2
464 Photo = 2,
465 /// `Drawing` -> VIPS_FOREIGN_WEBP_PRESET_DRAWING = 3
466 Drawing = 3,
467 /// `Icon` -> VIPS_FOREIGN_WEBP_PRESET_ICON = 4
468 Icon = 4,
469 /// `Text` -> VIPS_FOREIGN_WEBP_PRESET_TEXT = 5
470 Text = 5,
471 /// `Last` -> VIPS_FOREIGN_WEBP_PRESET_LAST = 6
472 Last = 6,
473}
474
475#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
476pub enum Intent {
477 /// `Perceptual` -> VIPS_INTENT_PERCEPTUAL = 0
478 Perceptual = 0,
479 /// `Relative` -> VIPS_INTENT_RELATIVE = 1
480 Relative = 1,
481 /// `Saturation` -> VIPS_INTENT_SATURATION = 2
482 Saturation = 2,
483 /// `Absolute` -> VIPS_INTENT_ABSOLUTE = 3
484 Absolute = 3,
485 /// `Auto` -> VIPS_INTENT_AUTO = 32
486 Auto = 32,
487 /// `Last` -> VIPS_INTENT_LAST = 33
488 Last = 33,
489}
490
491#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
492pub enum Interesting {
493 /// `None` -> VIPS_INTERESTING_NONE = 0
494 None = 0,
495 /// `Centre` -> VIPS_INTERESTING_CENTRE = 1
496 Centre = 1,
497 /// `Entropy` -> VIPS_INTERESTING_ENTROPY = 2
498 Entropy = 2,
499 /// `Attention` -> VIPS_INTERESTING_ATTENTION = 3
500 Attention = 3,
501 /// `Low` -> VIPS_INTERESTING_LOW = 4
502 Low = 4,
503 /// `High` -> VIPS_INTERESTING_HIGH = 5
504 High = 5,
505 /// `All` -> VIPS_INTERESTING_ALL = 6
506 All = 6,
507 /// `Last` -> VIPS_INTERESTING_LAST = 7
508 Last = 7,
509}
510
511#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
512pub enum Interpretation {
513 /// `Error` -> VIPS_INTERPRETATION_ERROR = -1
514 Error = -1,
515 /// `Multiband` -> VIPS_INTERPRETATION_MULTIBAND = 0
516 Multiband = 0,
517 /// `BW` -> VIPS_INTERPRETATION_B_W = 1
518 BW = 1,
519 /// `Histogram` -> VIPS_INTERPRETATION_HISTOGRAM = 10
520 Histogram = 10,
521 /// `Xyz` -> VIPS_INTERPRETATION_XYZ = 12
522 Xyz = 12,
523 /// `Lab` -> VIPS_INTERPRETATION_LAB = 13
524 Lab = 13,
525 /// `Cmyk` -> VIPS_INTERPRETATION_CMYK = 15
526 Cmyk = 15,
527 /// `Labq` -> VIPS_INTERPRETATION_LABQ = 16
528 Labq = 16,
529 /// `Rgb` -> VIPS_INTERPRETATION_RGB = 17
530 Rgb = 17,
531 /// `Cmc` -> VIPS_INTERPRETATION_CMC = 18
532 Cmc = 18,
533 /// `Lch` -> VIPS_INTERPRETATION_LCH = 19
534 Lch = 19,
535 /// `Labs` -> VIPS_INTERPRETATION_LABS = 21
536 Labs = 21,
537 /// `Srgb` -> VIPS_INTERPRETATION_sRGB = 22
538 Srgb = 22,
539 /// `Yxy` -> VIPS_INTERPRETATION_YXY = 23
540 Yxy = 23,
541 /// `Fourier` -> VIPS_INTERPRETATION_FOURIER = 24
542 Fourier = 24,
543 /// `Rgb16` -> VIPS_INTERPRETATION_RGB16 = 25
544 Rgb16 = 25,
545 /// `Grey16` -> VIPS_INTERPRETATION_GREY16 = 26
546 Grey16 = 26,
547 /// `Matrix` -> VIPS_INTERPRETATION_MATRIX = 27
548 Matrix = 27,
549 /// `Scrgb` -> VIPS_INTERPRETATION_scRGB = 28
550 Scrgb = 28,
551 /// `Hsv` -> VIPS_INTERPRETATION_HSV = 29
552 Hsv = 29,
553 /// `Last` -> VIPS_INTERPRETATION_LAST = 30
554 Last = 30,
555}
556
557#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
558pub enum Kernel {
559 /// `Nearest` -> VIPS_KERNEL_NEAREST = 0
560 Nearest = 0,
561 /// `Linear` -> VIPS_KERNEL_LINEAR = 1
562 Linear = 1,
563 /// `Cubic` -> VIPS_KERNEL_CUBIC = 2
564 Cubic = 2,
565 /// `Mitchell` -> VIPS_KERNEL_MITCHELL = 3
566 Mitchell = 3,
567 /// `Lanczos2` -> VIPS_KERNEL_LANCZOS2 = 4
568 Lanczos2 = 4,
569 /// `Lanczos3` -> VIPS_KERNEL_LANCZOS3 = 5
570 Lanczos3 = 5,
571 /// `Mks2013` -> VIPS_KERNEL_MKS2013 = 6
572 Mks2013 = 6,
573 /// `Mks2021` -> VIPS_KERNEL_MKS2021 = 7
574 Mks2021 = 7,
575 /// `Last` -> VIPS_KERNEL_LAST = 8
576 Last = 8,
577}
578
579#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
580pub enum OperationBoolean {
581 /// `And` -> VIPS_OPERATION_BOOLEAN_AND = 0
582 And = 0,
583 /// `Or` -> VIPS_OPERATION_BOOLEAN_OR = 1
584 Or = 1,
585 /// `Eor` -> VIPS_OPERATION_BOOLEAN_EOR = 2
586 Eor = 2,
587 /// `Lshift` -> VIPS_OPERATION_BOOLEAN_LSHIFT = 3
588 Lshift = 3,
589 /// `Rshift` -> VIPS_OPERATION_BOOLEAN_RSHIFT = 4
590 Rshift = 4,
591 /// `Last` -> VIPS_OPERATION_BOOLEAN_LAST = 5
592 Last = 5,
593}
594
595#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
596pub enum OperationComplex {
597 /// `Polar` -> VIPS_OPERATION_COMPLEX_POLAR = 0
598 Polar = 0,
599 /// `Rect` -> VIPS_OPERATION_COMPLEX_RECT = 1
600 Rect = 1,
601 /// `Conj` -> VIPS_OPERATION_COMPLEX_CONJ = 2
602 Conj = 2,
603 /// `Last` -> VIPS_OPERATION_COMPLEX_LAST = 3
604 Last = 3,
605}
606
607#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
608pub enum OperationComplex2 {
609 /// `CrossPhase` -> VIPS_OPERATION_COMPLEX2_CROSS_PHASE = 0
610 CrossPhase = 0,
611 /// `Last` -> VIPS_OPERATION_COMPLEX2_LAST = 1
612 Last = 1,
613}
614
615#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
616pub enum OperationComplexget {
617 /// `Real` -> VIPS_OPERATION_COMPLEXGET_REAL = 0
618 Real = 0,
619 /// `Imag` -> VIPS_OPERATION_COMPLEXGET_IMAG = 1
620 Imag = 1,
621 /// `Last` -> VIPS_OPERATION_COMPLEXGET_LAST = 2
622 Last = 2,
623}
624
625#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
626pub enum OperationMath {
627 /// `Sin` -> VIPS_OPERATION_MATH_SIN = 0
628 Sin = 0,
629 /// `Cos` -> VIPS_OPERATION_MATH_COS = 1
630 Cos = 1,
631 /// `Tan` -> VIPS_OPERATION_MATH_TAN = 2
632 Tan = 2,
633 /// `Asin` -> VIPS_OPERATION_MATH_ASIN = 3
634 Asin = 3,
635 /// `Acos` -> VIPS_OPERATION_MATH_ACOS = 4
636 Acos = 4,
637 /// `Atan` -> VIPS_OPERATION_MATH_ATAN = 5
638 Atan = 5,
639 /// `Log` -> VIPS_OPERATION_MATH_LOG = 6
640 Log = 6,
641 /// `Log10` -> VIPS_OPERATION_MATH_LOG10 = 7
642 Log10 = 7,
643 /// `Exp` -> VIPS_OPERATION_MATH_EXP = 8
644 Exp = 8,
645 /// `Exp10` -> VIPS_OPERATION_MATH_EXP10 = 9
646 Exp10 = 9,
647 /// `Sinh` -> VIPS_OPERATION_MATH_SINH = 10
648 Sinh = 10,
649 /// `Cosh` -> VIPS_OPERATION_MATH_COSH = 11
650 Cosh = 11,
651 /// `Tanh` -> VIPS_OPERATION_MATH_TANH = 12
652 Tanh = 12,
653 /// `Asinh` -> VIPS_OPERATION_MATH_ASINH = 13
654 Asinh = 13,
655 /// `Acosh` -> VIPS_OPERATION_MATH_ACOSH = 14
656 Acosh = 14,
657 /// `Atanh` -> VIPS_OPERATION_MATH_ATANH = 15
658 Atanh = 15,
659 /// `Last` -> VIPS_OPERATION_MATH_LAST = 16
660 Last = 16,
661}
662
663#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
664pub enum OperationMath2 {
665 /// `Pow` -> VIPS_OPERATION_MATH2_POW = 0
666 Pow = 0,
667 /// `Wop` -> VIPS_OPERATION_MATH2_WOP = 1
668 Wop = 1,
669 /// `Atan2` -> VIPS_OPERATION_MATH2_ATAN2 = 2
670 Atan2 = 2,
671 /// `Last` -> VIPS_OPERATION_MATH2_LAST = 3
672 Last = 3,
673}
674
675#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
676pub enum OperationMorphology {
677 /// `Erode` -> VIPS_OPERATION_MORPHOLOGY_ERODE = 0
678 Erode = 0,
679 /// `Dilate` -> VIPS_OPERATION_MORPHOLOGY_DILATE = 1
680 Dilate = 1,
681 /// `Last` -> VIPS_OPERATION_MORPHOLOGY_LAST = 2
682 Last = 2,
683}
684
685#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
686pub enum OperationRelational {
687 /// `Equal` -> VIPS_OPERATION_RELATIONAL_EQUAL = 0
688 Equal = 0,
689 /// `Noteq` -> VIPS_OPERATION_RELATIONAL_NOTEQ = 1
690 Noteq = 1,
691 /// `Less` -> VIPS_OPERATION_RELATIONAL_LESS = 2
692 Less = 2,
693 /// `Lesseq` -> VIPS_OPERATION_RELATIONAL_LESSEQ = 3
694 Lesseq = 3,
695 /// `More` -> VIPS_OPERATION_RELATIONAL_MORE = 4
696 More = 4,
697 /// `Moreeq` -> VIPS_OPERATION_RELATIONAL_MOREEQ = 5
698 Moreeq = 5,
699 /// `Last` -> VIPS_OPERATION_RELATIONAL_LAST = 6
700 Last = 6,
701}
702
703#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
704pub enum OperationRound {
705 /// `Rint` -> VIPS_OPERATION_ROUND_RINT = 0
706 Rint = 0,
707 /// `Ceil` -> VIPS_OPERATION_ROUND_CEIL = 1
708 Ceil = 1,
709 /// `Floor` -> VIPS_OPERATION_ROUND_FLOOR = 2
710 Floor = 2,
711 /// `Last` -> VIPS_OPERATION_ROUND_LAST = 3
712 Last = 3,
713}
714
715#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
716pub enum PCS {
717 /// `Lab` -> VIPS_PCS_LAB = 0
718 Lab = 0,
719 /// `Xyz` -> VIPS_PCS_XYZ = 1
720 Xyz = 1,
721 /// `Last` -> VIPS_PCS_LAST = 2
722 Last = 2,
723}
724
725#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
726pub enum Precision {
727 /// `Integer` -> VIPS_PRECISION_INTEGER = 0
728 Integer = 0,
729 /// `Float` -> VIPS_PRECISION_FLOAT = 1
730 Float = 1,
731 /// `Approximate` -> VIPS_PRECISION_APPROXIMATE = 2
732 Approximate = 2,
733 /// `Last` -> VIPS_PRECISION_LAST = 3
734 Last = 3,
735}
736
737#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
738pub enum RegionShrink {
739 /// `Mean` -> VIPS_REGION_SHRINK_MEAN = 0
740 Mean = 0,
741 /// `Median` -> VIPS_REGION_SHRINK_MEDIAN = 1
742 Median = 1,
743 /// `Mode` -> VIPS_REGION_SHRINK_MODE = 2
744 Mode = 2,
745 /// `Max` -> VIPS_REGION_SHRINK_MAX = 3
746 Max = 3,
747 /// `Min` -> VIPS_REGION_SHRINK_MIN = 4
748 Min = 4,
749 /// `Nearest` -> VIPS_REGION_SHRINK_NEAREST = 5
750 Nearest = 5,
751 /// `Last` -> VIPS_REGION_SHRINK_LAST = 6
752 Last = 6,
753}
754
755#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
756pub enum SdfShape {
757 /// `Circle` -> VIPS_SDF_SHAPE_CIRCLE = 0
758 Circle = 0,
759 /// `Box` -> VIPS_SDF_SHAPE_BOX = 1
760 Box = 1,
761 /// `RoundedBox` -> VIPS_SDF_SHAPE_ROUNDED_BOX = 2
762 RoundedBox = 2,
763 /// `Line` -> VIPS_SDF_SHAPE_LINE = 3
764 Line = 3,
765 /// `Last` -> VIPS_SDF_SHAPE_LAST = 4
766 Last = 4,
767}
768
769#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
770pub enum Size {
771 /// `Both` -> VIPS_SIZE_BOTH = 0
772 Both = 0,
773 /// `Up` -> VIPS_SIZE_UP = 1
774 Up = 1,
775 /// `Down` -> VIPS_SIZE_DOWN = 2
776 Down = 2,
777 /// `Force` -> VIPS_SIZE_FORCE = 3
778 Force = 3,
779 /// `Last` -> VIPS_SIZE_LAST = 4
780 Last = 4,
781}
782
783#[derive(Copy, Clone, Debug, FromPrimitive, ToPrimitive, PartialEq, PartialOrd)]
784pub enum TextWrap {
785 /// `Word` -> VIPS_TEXT_WRAP_WORD = 0
786 Word = 0,
787 /// `Char` -> VIPS_TEXT_WRAP_CHAR = 1
788 Char = 1,
789 /// `WordChar` -> VIPS_TEXT_WRAP_WORD_CHAR = 2
790 WordChar = 2,
791 /// `None` -> VIPS_TEXT_WRAP_NONE = 3
792 None = 3,
793 /// `Last` -> VIPS_TEXT_WRAP_LAST = 4
794 Last = 4,
795}
796
797impl VipsImage {
798 /// VipsCMC2LCh (CMC2LCh), transform LCh to CMC
799 /// returns `VipsImage` - Output image
800 pub fn CMC2LCh(&self) -> Result<VipsImage> {
801 let mut out_out = VipsImage::from(null_mut());
802 let vips_op_response = call(
803 "CMC2LCh",
804 VOption::new()
805 .set("in", self)
806 .set(
807 "out",
808 &mut out_out,
809 ),
810 );
811
812 utils::result(
813 vips_op_response,
814 out_out,
815 Error::OperationError("Cmc2LCh (vips_CMC2LCh) failed".to_string()),
816 )
817 }
818
819 /// VipsCMYK2XYZ (CMYK2XYZ), transform CMYK to XYZ
820 /// returns `VipsImage` - Output image
821 pub fn CMYK2XYZ(&self) -> Result<VipsImage> {
822 let mut out_out = VipsImage::from(null_mut());
823 let vips_op_response = call(
824 "CMYK2XYZ",
825 VOption::new()
826 .set("in", self)
827 .set(
828 "out",
829 &mut out_out,
830 ),
831 );
832
833 utils::result(
834 vips_op_response,
835 out_out,
836 Error::OperationError("Cmyk2Xyz (vips_CMYK2XYZ) failed".to_string()),
837 )
838 }
839
840 /// VipsHSV2sRGB (HSV2sRGB), transform HSV to sRGB
841 /// returns `VipsImage` - Output image
842 pub fn HSV2sRGB(&self) -> Result<VipsImage> {
843 let mut out_out = VipsImage::from(null_mut());
844 let vips_op_response = call(
845 "HSV2sRGB",
846 VOption::new()
847 .set("in", self)
848 .set(
849 "out",
850 &mut out_out,
851 ),
852 );
853
854 utils::result(
855 vips_op_response,
856 out_out,
857 Error::OperationError("Hsv2SRgb (vips_HSV2sRGB) failed".to_string()),
858 )
859 }
860
861 /// VipsLCh2CMC (LCh2CMC), transform LCh to CMC
862 /// returns `VipsImage` - Output image
863 pub fn LCh2CMC(&self) -> Result<VipsImage> {
864 let mut out_out = VipsImage::from(null_mut());
865 let vips_op_response = call(
866 "LCh2CMC",
867 VOption::new()
868 .set("in", self)
869 .set(
870 "out",
871 &mut out_out,
872 ),
873 );
874
875 utils::result(
876 vips_op_response,
877 out_out,
878 Error::OperationError("LCh2Cmc (vips_LCh2CMC) failed".to_string()),
879 )
880 }
881
882 /// VipsLCh2Lab (LCh2Lab), transform LCh to Lab
883 /// returns `VipsImage` - Output image
884 pub fn LCh2Lab(&self) -> Result<VipsImage> {
885 let mut out_out = VipsImage::from(null_mut());
886 let vips_op_response = call(
887 "LCh2Lab",
888 VOption::new()
889 .set("in", self)
890 .set(
891 "out",
892 &mut out_out,
893 ),
894 );
895
896 utils::result(
897 vips_op_response,
898 out_out,
899 Error::OperationError("LCh2Lab (vips_LCh2Lab) failed".to_string()),
900 )
901 }
902
903 /// VipsLab2LCh (Lab2LCh), transform Lab to LCh
904 /// returns `VipsImage` - Output image
905 pub fn Lab2LCh(&self) -> Result<VipsImage> {
906 let mut out_out = VipsImage::from(null_mut());
907 let vips_op_response = call(
908 "Lab2LCh",
909 VOption::new()
910 .set("in", self)
911 .set(
912 "out",
913 &mut out_out,
914 ),
915 );
916
917 utils::result(
918 vips_op_response,
919 out_out,
920 Error::OperationError("Lab2LCh (vips_Lab2LCh) failed".to_string()),
921 )
922 }
923
924 /// VipsLab2LabQ (Lab2LabQ), transform float Lab to LabQ coding
925 /// returns `VipsImage` - Output image
926 pub fn Lab2LabQ(&self) -> Result<VipsImage> {
927 let mut out_out = VipsImage::from(null_mut());
928 let vips_op_response = call(
929 "Lab2LabQ",
930 VOption::new()
931 .set("in", self)
932 .set(
933 "out",
934 &mut out_out,
935 ),
936 );
937
938 utils::result(
939 vips_op_response,
940 out_out,
941 Error::OperationError("Lab2LabQ (vips_Lab2LabQ) failed".to_string()),
942 )
943 }
944
945 /// VipsLab2LabS (Lab2LabS), transform float Lab to signed short
946 /// returns `VipsImage` - Output image
947 pub fn Lab2LabS(&self) -> Result<VipsImage> {
948 let mut out_out = VipsImage::from(null_mut());
949 let vips_op_response = call(
950 "Lab2LabS",
951 VOption::new()
952 .set("in", self)
953 .set(
954 "out",
955 &mut out_out,
956 ),
957 );
958
959 utils::result(
960 vips_op_response,
961 out_out,
962 Error::OperationError("Lab2LabSs (vips_Lab2LabS) failed".to_string()),
963 )
964 }
965
966 /// VipsLab2XYZ (Lab2XYZ), transform CIELAB to XYZ
967 /// returns `VipsImage` - Output image
968 pub fn Lab2XYZ(&self) -> Result<VipsImage> {
969 let mut out_out = VipsImage::from(null_mut());
970 let vips_op_response = call(
971 "Lab2XYZ",
972 VOption::new()
973 .set("in", self)
974 .set(
975 "out",
976 &mut out_out,
977 ),
978 );
979
980 utils::result(
981 vips_op_response,
982 out_out,
983 Error::OperationError("Lab2Xyz (vips_Lab2XYZ) failed".to_string()),
984 )
985 }
986
987 /// VipsLab2XYZ (Lab2XYZ), transform CIELAB to XYZ
988 /// returns `VipsImage` - Output image
989 ///
990 /// <ins>Optional arguments</ins>
991 ///
992 /// temp: `&[f64]` -> Color temperature
993 pub fn Lab2XYZ_with_opts(&self, option: VOption) -> Result<VipsImage> {
994 let mut out_out = VipsImage::from(null_mut());
995 let vips_op_response = call(
996 "Lab2XYZ",
997 option
998 .set("in", self)
999 .set(
1000 "out",
1001 &mut out_out,
1002 ),
1003 );
1004
1005 utils::result(
1006 vips_op_response,
1007 out_out,
1008 Error::OperationError("Lab2Xyz (vips_Lab2XYZ) failed".to_string()),
1009 )
1010 }
1011
1012 /// VipsLabQ2Lab (LabQ2Lab), unpack a LabQ image to float Lab
1013 /// returns `VipsImage` - Output image
1014 pub fn LabQ2Lab(&self) -> Result<VipsImage> {
1015 let mut out_out = VipsImage::from(null_mut());
1016 let vips_op_response = call(
1017 "LabQ2Lab",
1018 VOption::new()
1019 .set("in", self)
1020 .set(
1021 "out",
1022 &mut out_out,
1023 ),
1024 );
1025
1026 utils::result(
1027 vips_op_response,
1028 out_out,
1029 Error::OperationError("LabQ2Lab (vips_LabQ2Lab) failed".to_string()),
1030 )
1031 }
1032
1033 /// VipsLabQ2LabS (LabQ2LabS), unpack a LabQ image to short Lab
1034 /// returns `VipsImage` - Output image
1035 pub fn LabQ2LabS(&self) -> Result<VipsImage> {
1036 let mut out_out = VipsImage::from(null_mut());
1037 let vips_op_response = call(
1038 "LabQ2LabS",
1039 VOption::new()
1040 .set("in", self)
1041 .set(
1042 "out",
1043 &mut out_out,
1044 ),
1045 );
1046
1047 utils::result(
1048 vips_op_response,
1049 out_out,
1050 Error::OperationError("LabQ2LabSs (vips_LabQ2LabS) failed".to_string()),
1051 )
1052 }
1053
1054 /// VipsLabQ2sRGB (LabQ2sRGB), convert a LabQ image to sRGB
1055 /// returns `VipsImage` - Output image
1056 pub fn LabQ2sRGB(&self) -> Result<VipsImage> {
1057 let mut out_out = VipsImage::from(null_mut());
1058 let vips_op_response = call(
1059 "LabQ2sRGB",
1060 VOption::new()
1061 .set("in", self)
1062 .set(
1063 "out",
1064 &mut out_out,
1065 ),
1066 );
1067
1068 utils::result(
1069 vips_op_response,
1070 out_out,
1071 Error::OperationError("LabQ2SRgb (vips_LabQ2sRGB) failed".to_string()),
1072 )
1073 }
1074
1075 /// VipsLabS2Lab (LabS2Lab), transform signed short Lab to float
1076 /// returns `VipsImage` - Output image
1077 pub fn LabS2Lab(&self) -> Result<VipsImage> {
1078 let mut out_out = VipsImage::from(null_mut());
1079 let vips_op_response = call(
1080 "LabS2Lab",
1081 VOption::new()
1082 .set("in", self)
1083 .set(
1084 "out",
1085 &mut out_out,
1086 ),
1087 );
1088
1089 utils::result(
1090 vips_op_response,
1091 out_out,
1092 Error::OperationError("LabS2Lab (vips_LabS2Lab) failed".to_string()),
1093 )
1094 }
1095
1096 /// VipsLabS2LabQ (LabS2LabQ), transform short Lab to LabQ coding
1097 /// returns `VipsImage` - Output image
1098 pub fn LabS2LabQ(&self) -> Result<VipsImage> {
1099 let mut out_out = VipsImage::from(null_mut());
1100 let vips_op_response = call(
1101 "LabS2LabQ",
1102 VOption::new()
1103 .set("in", self)
1104 .set(
1105 "out",
1106 &mut out_out,
1107 ),
1108 );
1109
1110 utils::result(
1111 vips_op_response,
1112 out_out,
1113 Error::OperationError("LabS2LabQ (vips_LabS2LabQ) failed".to_string()),
1114 )
1115 }
1116
1117 /// VipsXYZ2CMYK (XYZ2CMYK), transform XYZ to CMYK
1118 /// returns `VipsImage` - Output image
1119 pub fn XYZ2CMYK(&self) -> Result<VipsImage> {
1120 let mut out_out = VipsImage::from(null_mut());
1121 let vips_op_response = call(
1122 "XYZ2CMYK",
1123 VOption::new()
1124 .set("in", self)
1125 .set(
1126 "out",
1127 &mut out_out,
1128 ),
1129 );
1130
1131 utils::result(
1132 vips_op_response,
1133 out_out,
1134 Error::OperationError("Xyz2Cmyk (vips_XYZ2CMYK) failed".to_string()),
1135 )
1136 }
1137
1138 /// VipsXYZ2Lab (XYZ2Lab), transform XYZ to Lab
1139 /// returns `VipsImage` - Output image
1140 pub fn XYZ2Lab(&self) -> Result<VipsImage> {
1141 let mut out_out = VipsImage::from(null_mut());
1142 let vips_op_response = call(
1143 "XYZ2Lab",
1144 VOption::new()
1145 .set("in", self)
1146 .set(
1147 "out",
1148 &mut out_out,
1149 ),
1150 );
1151
1152 utils::result(
1153 vips_op_response,
1154 out_out,
1155 Error::OperationError("Xyz2Lab (vips_XYZ2Lab) failed".to_string()),
1156 )
1157 }
1158
1159 /// VipsXYZ2Lab (XYZ2Lab), transform XYZ to Lab
1160 /// returns `VipsImage` - Output image
1161 ///
1162 /// <ins>Optional arguments</ins>
1163 ///
1164 /// temp: `&[f64]` -> Colour temperature
1165 pub fn XYZ2Lab_with_opts(&self, option: VOption) -> Result<VipsImage> {
1166 let mut out_out = VipsImage::from(null_mut());
1167 let vips_op_response = call(
1168 "XYZ2Lab",
1169 option
1170 .set("in", self)
1171 .set(
1172 "out",
1173 &mut out_out,
1174 ),
1175 );
1176
1177 utils::result(
1178 vips_op_response,
1179 out_out,
1180 Error::OperationError("Xyz2Lab (vips_XYZ2Lab) failed".to_string()),
1181 )
1182 }
1183
1184 /// VipsXYZ2Yxy (XYZ2Yxy), transform XYZ to Yxy
1185 /// returns `VipsImage` - Output image
1186 pub fn XYZ2Yxy(&self) -> Result<VipsImage> {
1187 let mut out_out = VipsImage::from(null_mut());
1188 let vips_op_response = call(
1189 "XYZ2Yxy",
1190 VOption::new()
1191 .set("in", self)
1192 .set(
1193 "out",
1194 &mut out_out,
1195 ),
1196 );
1197
1198 utils::result(
1199 vips_op_response,
1200 out_out,
1201 Error::OperationError("Xyz2Yxy (vips_XYZ2Yxy) failed".to_string()),
1202 )
1203 }
1204
1205 /// VipsXYZ2scRGB (XYZ2scRGB), transform XYZ to scRGB
1206 /// returns `VipsImage` - Output image
1207 pub fn XYZ2scRGB(&self) -> Result<VipsImage> {
1208 let mut out_out = VipsImage::from(null_mut());
1209 let vips_op_response = call(
1210 "XYZ2scRGB",
1211 VOption::new()
1212 .set("in", self)
1213 .set(
1214 "out",
1215 &mut out_out,
1216 ),
1217 );
1218
1219 utils::result(
1220 vips_op_response,
1221 out_out,
1222 Error::OperationError("Xyz2ScRgb (vips_XYZ2scRGB) failed".to_string()),
1223 )
1224 }
1225
1226 /// VipsYxy2XYZ (Yxy2XYZ), transform Yxy to XYZ
1227 /// returns `VipsImage` - Output image
1228 pub fn Yxy2XYZ(&self) -> Result<VipsImage> {
1229 let mut out_out = VipsImage::from(null_mut());
1230 let vips_op_response = call(
1231 "Yxy2XYZ",
1232 VOption::new()
1233 .set("in", self)
1234 .set(
1235 "out",
1236 &mut out_out,
1237 ),
1238 );
1239
1240 utils::result(
1241 vips_op_response,
1242 out_out,
1243 Error::OperationError("Yxy2Xyz (vips_Yxy2XYZ) failed".to_string()),
1244 )
1245 }
1246
1247 /// VipsAbs (abs), absolute value of an image
1248 /// returns `VipsImage` - Output image
1249 pub fn abs(&self) -> Result<VipsImage> {
1250 let mut out_out = VipsImage::from(null_mut());
1251 let vips_op_response = call(
1252 "abs",
1253 VOption::new()
1254 .set("in", self)
1255 .set(
1256 "out",
1257 &mut out_out,
1258 ),
1259 );
1260
1261 utils::result(
1262 vips_op_response,
1263 out_out,
1264 Error::OperationError("Abs (vips_abs) failed".to_string()),
1265 )
1266 }
1267
1268 /// VipsAdd (add), add two images
1269 /// returns `VipsImage` - Output image
1270 ///
1271 /// right: `&VipsImage` -> Right-hand image argument
1272 pub fn add(&self, right: &VipsImage) -> Result<VipsImage> {
1273 let mut out_out = VipsImage::from(null_mut());
1274 let vips_op_response = call(
1275 "add",
1276 VOption::new()
1277 .set(
1278 "left",
1279 self,
1280 )
1281 .set(
1282 "right",
1283 right,
1284 )
1285 .set(
1286 "out",
1287 &mut out_out,
1288 ),
1289 );
1290
1291 utils::result(
1292 vips_op_response,
1293 out_out,
1294 Error::OperationError("Add (vips_add) failed".to_string()),
1295 )
1296 }
1297
1298 /// VipsAddAlpha (addalpha), append an alpha channel
1299 /// returns `VipsImage` - Output image
1300 pub fn addalpha(&self) -> Result<VipsImage> {
1301 let mut out_out = VipsImage::from(null_mut());
1302 let vips_op_response = call(
1303 "addalpha",
1304 VOption::new()
1305 .set("in", self)
1306 .set(
1307 "out",
1308 &mut out_out,
1309 ),
1310 );
1311
1312 utils::result(
1313 vips_op_response,
1314 out_out,
1315 Error::OperationError("Addalpha (vips_addalpha) failed".to_string()),
1316 )
1317 }
1318
1319 /// VipsAffine (affine), affine transform of an image
1320 /// returns `VipsImage` - Output image
1321 ///
1322 /// matrix: `&[f64]` -> Transformation matrix
1323 pub fn affine(&self, matrix: &[f64]) -> Result<VipsImage> {
1324 let mut out_out = VipsImage::from(null_mut());
1325 let vips_op_response = call(
1326 "affine",
1327 VOption::new()
1328 .set("in", self)
1329 .set(
1330 "out",
1331 &mut out_out,
1332 )
1333 .set(
1334 "matrix",
1335 matrix,
1336 ),
1337 );
1338
1339 utils::result(
1340 vips_op_response,
1341 out_out,
1342 Error::OperationError("Affine (vips_affine) failed".to_string()),
1343 )
1344 }
1345
1346 /// VipsAffine (affine), affine transform of an image
1347 /// returns `VipsImage` - Output image
1348 ///
1349 /// matrix: `&[f64]` -> Transformation matrix
1350 ///
1351 /// <ins>Optional arguments</ins>
1352 ///
1353 /// interpolate: `&VipsInterpolate` -> Interpolate pixels with this
1354 ///
1355 /// oarea: `&[i32]` -> Area of output to generate
1356 ///
1357 /// odx: `f64` -> Horizontal output displacement
1358 ///
1359 /// ody: `f64` -> Vertical output displacement
1360 ///
1361 /// idx: `f64` -> Horizontal input displacement
1362 ///
1363 /// idy: `f64` -> Vertical input displacement
1364 ///
1365 /// background: `&[f64]` -> Background value
1366 ///
1367 /// premultiplied: `bool` -> Images have premultiplied alpha
1368 ///
1369 /// extend: [`Extend`] -> How to generate the extra pixels
1370 pub fn affine_with_opts(&self, matrix: &[f64], option: VOption) -> Result<VipsImage> {
1371 let mut out_out = VipsImage::from(null_mut());
1372 let vips_op_response = call(
1373 "affine",
1374 option
1375 .set("in", self)
1376 .set(
1377 "out",
1378 &mut out_out,
1379 )
1380 .set(
1381 "matrix",
1382 matrix,
1383 ),
1384 );
1385
1386 utils::result(
1387 vips_op_response,
1388 out_out,
1389 Error::OperationError("Affine (vips_affine) failed".to_string()),
1390 )
1391 }
1392
1393 /// VipsForeignLoadAnalyze (analyzeload), load an Analyze6 image (.img, .hdr), priority=-50, untrusted, is_a, get_flags, get_flags_filename, header, load
1394 /// returns `VipsImage` - Output image
1395 ///
1396 /// filename: `&str` -> Filename to load from
1397 pub fn analyzeload(filename: &str) -> Result<VipsImage> {
1398 let mut out_out = VipsImage::from(null_mut());
1399 let vips_op_response = call(
1400 "analyzeload",
1401 VOption::new()
1402 .set(
1403 "filename",
1404 filename,
1405 )
1406 .set(
1407 "out",
1408 &mut out_out,
1409 ),
1410 );
1411
1412 utils::result(
1413 vips_op_response,
1414 out_out,
1415 Error::OperationError("Analyzeload (vips_analyzeload) failed".to_string()),
1416 )
1417 }
1418
1419 /// VipsForeignLoadAnalyze (analyzeload), load an Analyze6 image (.img, .hdr), priority=-50, untrusted, is_a, get_flags, get_flags_filename, header, load
1420 /// returns `VipsImage` - Output image
1421 ///
1422 /// filename: `&str` -> Filename to load from
1423 ///
1424 /// <ins>Optional arguments</ins>
1425 ///
1426 /// flags: [`ForeignFlags`] -> Flags for this file
1427 ///
1428 /// memory: `bool` -> Force open via memory
1429 ///
1430 /// access: [`Access`] -> Required access pattern for this file
1431 ///
1432 /// fail_on: [`FailOn`] -> Error level to fail on
1433 ///
1434 /// revalidate: `bool` -> Don't use a cached result for this operation
1435 pub fn analyzeload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
1436 let mut out_out = VipsImage::from(null_mut());
1437 let vips_op_response = call(
1438 "analyzeload",
1439 option
1440 .set(
1441 "filename",
1442 filename,
1443 )
1444 .set(
1445 "out",
1446 &mut out_out,
1447 ),
1448 );
1449
1450 utils::result(
1451 vips_op_response,
1452 out_out,
1453 Error::OperationError("Analyzeload (vips_analyzeload) failed".to_string()),
1454 )
1455 }
1456
1457 /// VipsArrayjoin (arrayjoin), join an array of images
1458 /// returns `VipsImage` - Output image
1459 ///
1460 /// inp: `&[VipsImage]` -> Array of input images
1461 pub fn arrayjoin(inp: &[VipsImage]) -> Result<VipsImage> {
1462 let mut out_out = VipsImage::from(null_mut());
1463 let vips_op_response = call(
1464 "arrayjoin",
1465 VOption::new()
1466 .set("in", inp)
1467 .set(
1468 "out",
1469 &mut out_out,
1470 ),
1471 );
1472
1473 utils::result(
1474 vips_op_response,
1475 out_out,
1476 Error::OperationError("Arrayjoin (vips_arrayjoin) failed".to_string()),
1477 )
1478 }
1479
1480 /// VipsArrayjoin (arrayjoin), join an array of images
1481 /// returns `VipsImage` - Output image
1482 ///
1483 /// inp: `&[VipsImage]` -> Array of input images
1484 ///
1485 /// <ins>Optional arguments</ins>
1486 ///
1487 /// across: `i32` -> Number of images across grid
1488 ///
1489 /// shim: `i32` -> Pixels between images
1490 ///
1491 /// background: `&[f64]` -> Colour for new pixels
1492 ///
1493 /// halign: [`Align`] -> Align on the left, centre or right
1494 ///
1495 /// valign: [`Align`] -> Align on the top, centre or bottom
1496 ///
1497 /// hspacing: `i32` -> Horizontal spacing between images
1498 ///
1499 /// vspacing: `i32` -> Vertical spacing between images
1500 pub fn arrayjoin_with_opts(inp: &[VipsImage], option: VOption) -> Result<VipsImage> {
1501 let mut out_out = VipsImage::from(null_mut());
1502 let vips_op_response = call(
1503 "arrayjoin",
1504 option
1505 .set("in", inp)
1506 .set(
1507 "out",
1508 &mut out_out,
1509 ),
1510 );
1511
1512 utils::result(
1513 vips_op_response,
1514 out_out,
1515 Error::OperationError("Arrayjoin (vips_arrayjoin) failed".to_string()),
1516 )
1517 }
1518
1519 /// VipsAutorot (autorot), autorotate image by exif tag
1520 /// returns `VipsImage` - Output image
1521 pub fn autorot(&self) -> Result<VipsImage> {
1522 let mut out_out = VipsImage::from(null_mut());
1523 let vips_op_response = call(
1524 "autorot",
1525 VOption::new()
1526 .set("in", self)
1527 .set(
1528 "out",
1529 &mut out_out,
1530 ),
1531 );
1532
1533 utils::result(
1534 vips_op_response,
1535 out_out,
1536 Error::OperationError("Autorot (vips_autorot) failed".to_string()),
1537 )
1538 }
1539
1540 /// VipsAutorot (autorot), autorotate image by exif tag
1541 /// returns `VipsImage` - Output image
1542 ///
1543 /// <ins>Optional arguments</ins>
1544 ///
1545 /// angle: [`Angle`] -> Angle image was rotated by
1546 ///
1547 /// flip: `&mut bool` -> Whether the image was flipped or not
1548 pub fn autorot_with_opts(&self, option: VOption) -> Result<VipsImage> {
1549 let mut out_out = VipsImage::from(null_mut());
1550 let vips_op_response = call(
1551 "autorot",
1552 option
1553 .set("in", self)
1554 .set(
1555 "out",
1556 &mut out_out,
1557 ),
1558 );
1559
1560 utils::result(
1561 vips_op_response,
1562 out_out,
1563 Error::OperationError("Autorot (vips_autorot) failed".to_string()),
1564 )
1565 }
1566
1567 /// VipsAvg (avg), find image average
1568 /// returns `f64` - Output value
1569 pub fn avg(&self) -> Result<f64> {
1570 let mut out_out: f64 = 0.0;
1571 let vips_op_response = call(
1572 "avg",
1573 VOption::new()
1574 .set("in", self)
1575 .set(
1576 "out",
1577 &mut out_out,
1578 ),
1579 );
1580
1581 utils::result(
1582 vips_op_response,
1583 out_out,
1584 Error::OperationError("Avg (vips_avg) failed".to_string()),
1585 )
1586 }
1587
1588 /// VipsBandbool (bandbool), boolean operation across image bands
1589 /// returns `VipsImage` - Output image
1590 ///
1591 /// boolean: `OperationBoolean` -> Boolean to perform
1592 pub fn bandbool(&self, boolean: OperationBoolean) -> Result<VipsImage> {
1593 let mut out_out = VipsImage::from(null_mut());
1594 let vips_op_response = call(
1595 "bandbool",
1596 VOption::new()
1597 .set("in", self)
1598 .set(
1599 "out",
1600 &mut out_out,
1601 )
1602 .set(
1603 "boolean",
1604 boolean as i32,
1605 ),
1606 );
1607
1608 utils::result(
1609 vips_op_response,
1610 out_out,
1611 Error::OperationError("Bandbool (vips_bandbool) failed".to_string()),
1612 )
1613 }
1614
1615 /// VipsBandfold (bandfold), fold up x axis into bands
1616 /// returns `VipsImage` - Output image
1617 pub fn bandfold(&self) -> Result<VipsImage> {
1618 let mut out_out = VipsImage::from(null_mut());
1619 let vips_op_response = call(
1620 "bandfold",
1621 VOption::new()
1622 .set("in", self)
1623 .set(
1624 "out",
1625 &mut out_out,
1626 ),
1627 );
1628
1629 utils::result(
1630 vips_op_response,
1631 out_out,
1632 Error::OperationError("Bandfold (vips_bandfold) failed".to_string()),
1633 )
1634 }
1635
1636 /// VipsBandfold (bandfold), fold up x axis into bands
1637 /// returns `VipsImage` - Output image
1638 ///
1639 /// <ins>Optional arguments</ins>
1640 ///
1641 /// factor: `i32` -> Fold by this factor
1642 pub fn bandfold_with_opts(&self, option: VOption) -> Result<VipsImage> {
1643 let mut out_out = VipsImage::from(null_mut());
1644 let vips_op_response = call(
1645 "bandfold",
1646 option
1647 .set("in", self)
1648 .set(
1649 "out",
1650 &mut out_out,
1651 ),
1652 );
1653
1654 utils::result(
1655 vips_op_response,
1656 out_out,
1657 Error::OperationError("Bandfold (vips_bandfold) failed".to_string()),
1658 )
1659 }
1660
1661 /// VipsBandjoin (bandjoin), bandwise join a set of images
1662 /// returns `VipsImage` - Output image
1663 ///
1664 /// inp: `&[VipsImage]` -> Array of input images
1665 pub fn bandjoin(inp: &[VipsImage]) -> Result<VipsImage> {
1666 let mut out_out = VipsImage::from(null_mut());
1667 let vips_op_response = call(
1668 "bandjoin",
1669 VOption::new()
1670 .set("in", inp)
1671 .set(
1672 "out",
1673 &mut out_out,
1674 ),
1675 );
1676
1677 utils::result(
1678 vips_op_response,
1679 out_out,
1680 Error::OperationError("Bandjoin (vips_bandjoin) failed".to_string()),
1681 )
1682 }
1683
1684 /// VipsBandjoinConst (bandjoin_const), append a constant band to an image
1685 /// returns `VipsImage` - Output image
1686 ///
1687 /// c: `&[f64]` -> Array of constants to add
1688 pub fn bandjoin_const(&self, c: &[f64]) -> Result<VipsImage> {
1689 let mut out_out = VipsImage::from(null_mut());
1690 let vips_op_response = call(
1691 "bandjoin_const",
1692 VOption::new()
1693 .set("in", self)
1694 .set(
1695 "out",
1696 &mut out_out,
1697 )
1698 .set("c", c),
1699 );
1700
1701 utils::result(
1702 vips_op_response,
1703 out_out,
1704 Error::OperationError("BandjoinConst (vips_bandjoin_const) failed".to_string()),
1705 )
1706 }
1707
1708 /// VipsBandmean (bandmean), band-wise average
1709 /// returns `VipsImage` - Output image
1710 pub fn bandmean(&self) -> Result<VipsImage> {
1711 let mut out_out = VipsImage::from(null_mut());
1712 let vips_op_response = call(
1713 "bandmean",
1714 VOption::new()
1715 .set("in", self)
1716 .set(
1717 "out",
1718 &mut out_out,
1719 ),
1720 );
1721
1722 utils::result(
1723 vips_op_response,
1724 out_out,
1725 Error::OperationError("Bandmean (vips_bandmean) failed".to_string()),
1726 )
1727 }
1728
1729 /// VipsBandrank (bandrank), band-wise rank of a set of images
1730 /// returns `VipsImage` - Output image
1731 ///
1732 /// inp: `&[VipsImage]` -> Array of input images
1733 pub fn bandrank(inp: &[VipsImage]) -> Result<VipsImage> {
1734 let mut out_out = VipsImage::from(null_mut());
1735 let vips_op_response = call(
1736 "bandrank",
1737 VOption::new()
1738 .set("in", inp)
1739 .set(
1740 "out",
1741 &mut out_out,
1742 ),
1743 );
1744
1745 utils::result(
1746 vips_op_response,
1747 out_out,
1748 Error::OperationError("Bandrank (vips_bandrank) failed".to_string()),
1749 )
1750 }
1751
1752 /// VipsBandrank (bandrank), band-wise rank of a set of images
1753 /// returns `VipsImage` - Output image
1754 ///
1755 /// inp: `&[VipsImage]` -> Array of input images
1756 ///
1757 /// <ins>Optional arguments</ins>
1758 ///
1759 /// index: `i32` -> Select this band element from sorted list
1760 pub fn bandrank_with_opts(inp: &[VipsImage], option: VOption) -> Result<VipsImage> {
1761 let mut out_out = VipsImage::from(null_mut());
1762 let vips_op_response = call(
1763 "bandrank",
1764 option
1765 .set("in", inp)
1766 .set(
1767 "out",
1768 &mut out_out,
1769 ),
1770 );
1771
1772 utils::result(
1773 vips_op_response,
1774 out_out,
1775 Error::OperationError("Bandrank (vips_bandrank) failed".to_string()),
1776 )
1777 }
1778
1779 /// VipsBandunfold (bandunfold), unfold image bands into x axis
1780 /// returns `VipsImage` - Output image
1781 pub fn bandunfold(&self) -> Result<VipsImage> {
1782 let mut out_out = VipsImage::from(null_mut());
1783 let vips_op_response = call(
1784 "bandunfold",
1785 VOption::new()
1786 .set("in", self)
1787 .set(
1788 "out",
1789 &mut out_out,
1790 ),
1791 );
1792
1793 utils::result(
1794 vips_op_response,
1795 out_out,
1796 Error::OperationError("Bandunfold (vips_bandunfold) failed".to_string()),
1797 )
1798 }
1799
1800 /// VipsBandunfold (bandunfold), unfold image bands into x axis
1801 /// returns `VipsImage` - Output image
1802 ///
1803 /// <ins>Optional arguments</ins>
1804 ///
1805 /// factor: `i32` -> Unfold by this factor
1806 pub fn bandunfold_with_opts(&self, option: VOption) -> Result<VipsImage> {
1807 let mut out_out = VipsImage::from(null_mut());
1808 let vips_op_response = call(
1809 "bandunfold",
1810 option
1811 .set("in", self)
1812 .set(
1813 "out",
1814 &mut out_out,
1815 ),
1816 );
1817
1818 utils::result(
1819 vips_op_response,
1820 out_out,
1821 Error::OperationError("Bandunfold (vips_bandunfold) failed".to_string()),
1822 )
1823 }
1824
1825 /// VipsBlack (black), make a black image
1826 /// returns `VipsImage` - Output image
1827 ///
1828 /// width: `i32` -> Image width in pixels
1829 ///
1830 /// height: `i32` -> Image height in pixels
1831 pub fn black(width: i32, height: i32) -> Result<VipsImage> {
1832 let mut out_out = VipsImage::from(null_mut());
1833 let vips_op_response = call(
1834 "black",
1835 VOption::new()
1836 .set(
1837 "out",
1838 &mut out_out,
1839 )
1840 .set(
1841 "width",
1842 width,
1843 )
1844 .set(
1845 "height",
1846 height,
1847 ),
1848 );
1849
1850 utils::result(
1851 vips_op_response,
1852 out_out,
1853 Error::OperationError("Black (vips_black) failed".to_string()),
1854 )
1855 }
1856
1857 /// VipsBlack (black), make a black image
1858 /// returns `VipsImage` - Output image
1859 ///
1860 /// width: `i32` -> Image width in pixels
1861 ///
1862 /// height: `i32` -> Image height in pixels
1863 ///
1864 /// <ins>Optional arguments</ins>
1865 ///
1866 /// bands: `i32` -> Number of bands in image
1867 pub fn black_with_opts(width: i32, height: i32, option: VOption) -> Result<VipsImage> {
1868 let mut out_out = VipsImage::from(null_mut());
1869 let vips_op_response = call(
1870 "black",
1871 option
1872 .set(
1873 "out",
1874 &mut out_out,
1875 )
1876 .set(
1877 "width",
1878 width,
1879 )
1880 .set(
1881 "height",
1882 height,
1883 ),
1884 );
1885
1886 utils::result(
1887 vips_op_response,
1888 out_out,
1889 Error::OperationError("Black (vips_black) failed".to_string()),
1890 )
1891 }
1892
1893 /// VipsBoolean (boolean), boolean operation on two images
1894 /// returns `VipsImage` - Output image
1895 ///
1896 /// right: `&VipsImage` -> Right-hand image argument
1897 ///
1898 /// boolean: `OperationBoolean` -> Boolean to perform
1899 pub fn boolean(&self, right: &VipsImage, boolean: OperationBoolean) -> Result<VipsImage> {
1900 let mut out_out = VipsImage::from(null_mut());
1901 let vips_op_response = call(
1902 "boolean",
1903 VOption::new()
1904 .set(
1905 "left",
1906 self,
1907 )
1908 .set(
1909 "right",
1910 right,
1911 )
1912 .set(
1913 "out",
1914 &mut out_out,
1915 )
1916 .set(
1917 "boolean",
1918 boolean as i32,
1919 ),
1920 );
1921
1922 utils::result(
1923 vips_op_response,
1924 out_out,
1925 Error::OperationError("Boolean (vips_boolean) failed".to_string()),
1926 )
1927 }
1928
1929 /// VipsBooleanConst (boolean_const), boolean operations against a constant
1930 /// returns `VipsImage` - Output image
1931 ///
1932 /// boolean: `OperationBoolean` -> Boolean to perform
1933 ///
1934 /// c: `&[f64]` -> Array of constants
1935 pub fn boolean_const(&self, boolean: OperationBoolean, c: &[f64]) -> Result<VipsImage> {
1936 let mut out_out = VipsImage::from(null_mut());
1937 let vips_op_response = call(
1938 "boolean_const",
1939 VOption::new()
1940 .set("in", self)
1941 .set(
1942 "out",
1943 &mut out_out,
1944 )
1945 .set(
1946 "boolean",
1947 boolean as i32,
1948 )
1949 .set("c", c),
1950 );
1951
1952 utils::result(
1953 vips_op_response,
1954 out_out,
1955 Error::OperationError("BooleanConst (vips_boolean_const) failed".to_string()),
1956 )
1957 }
1958
1959 /// VipsBuildlut (buildlut), build a look-up table
1960 /// returns `VipsImage` - Output image
1961 pub fn buildlut(&self) -> Result<VipsImage> {
1962 let mut out_out = VipsImage::from(null_mut());
1963 let vips_op_response = call(
1964 "buildlut",
1965 VOption::new()
1966 .set("in", self)
1967 .set(
1968 "out",
1969 &mut out_out,
1970 ),
1971 );
1972
1973 utils::result(
1974 vips_op_response,
1975 out_out,
1976 Error::OperationError("Buildlut (vips_buildlut) failed".to_string()),
1977 )
1978 }
1979
1980 /// VipsByteswap (byteswap), byteswap an image
1981 /// returns `VipsImage` - Output image
1982 pub fn byteswap(&self) -> Result<VipsImage> {
1983 let mut out_out = VipsImage::from(null_mut());
1984 let vips_op_response = call(
1985 "byteswap",
1986 VOption::new()
1987 .set("in", self)
1988 .set(
1989 "out",
1990 &mut out_out,
1991 ),
1992 );
1993
1994 utils::result(
1995 vips_op_response,
1996 out_out,
1997 Error::OperationError("Byteswap (vips_byteswap) failed".to_string()),
1998 )
1999 }
2000
2001 /// VipsCanny (canny), Canny edge detector
2002 /// returns `VipsImage` - Output image
2003 pub fn canny(&self) -> Result<VipsImage> {
2004 let mut out_out = VipsImage::from(null_mut());
2005 let vips_op_response = call(
2006 "canny",
2007 VOption::new()
2008 .set("in", self)
2009 .set(
2010 "out",
2011 &mut out_out,
2012 ),
2013 );
2014
2015 utils::result(
2016 vips_op_response,
2017 out_out,
2018 Error::OperationError("Canny (vips_canny) failed".to_string()),
2019 )
2020 }
2021
2022 /// VipsCanny (canny), Canny edge detector
2023 /// returns `VipsImage` - Output image
2024 ///
2025 /// <ins>Optional arguments</ins>
2026 ///
2027 /// sigma: `f64` -> Sigma of Gaussian
2028 ///
2029 /// precision: [`Precision`] -> Convolve with this precision
2030 pub fn canny_with_opts(&self, option: VOption) -> Result<VipsImage> {
2031 let mut out_out = VipsImage::from(null_mut());
2032 let vips_op_response = call(
2033 "canny",
2034 option
2035 .set("in", self)
2036 .set(
2037 "out",
2038 &mut out_out,
2039 ),
2040 );
2041
2042 utils::result(
2043 vips_op_response,
2044 out_out,
2045 Error::OperationError("Canny (vips_canny) failed".to_string()),
2046 )
2047 }
2048
2049 /// VipsCase (case), use pixel values to pick cases from an array of images
2050 /// returns `VipsImage` - Output image
2051 ///
2052 /// cases: `&[VipsImage]` -> Array of case images
2053 pub fn case(&self, cases: &[VipsImage]) -> Result<VipsImage> {
2054 let mut out_out = VipsImage::from(null_mut());
2055 let vips_op_response = call(
2056 "case",
2057 VOption::new()
2058 .set(
2059 "index",
2060 self,
2061 )
2062 .set(
2063 "cases",
2064 cases,
2065 )
2066 .set(
2067 "out",
2068 &mut out_out,
2069 ),
2070 );
2071
2072 utils::result(
2073 vips_op_response,
2074 out_out,
2075 Error::OperationError("Case (vips_case) failed".to_string()),
2076 )
2077 }
2078
2079 /// VipsCast (cast), cast an image
2080 /// returns `VipsImage` - Output image
2081 ///
2082 /// format: `BandFormat` -> Format to cast to
2083 pub fn cast(&self, format: BandFormat) -> Result<VipsImage> {
2084 let mut out_out = VipsImage::from(null_mut());
2085 let vips_op_response = call(
2086 "cast",
2087 VOption::new()
2088 .set("in", self)
2089 .set(
2090 "out",
2091 &mut out_out,
2092 )
2093 .set(
2094 "format",
2095 format as i32,
2096 ),
2097 );
2098
2099 utils::result(
2100 vips_op_response,
2101 out_out,
2102 Error::OperationError("Cast (vips_cast) failed".to_string()),
2103 )
2104 }
2105
2106 /// VipsCast (cast), cast an image
2107 /// returns `VipsImage` - Output image
2108 ///
2109 /// format: `BandFormat` -> Format to cast to
2110 ///
2111 /// <ins>Optional arguments</ins>
2112 ///
2113 /// shift: `bool` -> Shift integer values up and down
2114 pub fn cast_with_opts(&self, format: BandFormat, option: VOption) -> Result<VipsImage> {
2115 let mut out_out = VipsImage::from(null_mut());
2116 let vips_op_response = call(
2117 "cast",
2118 option
2119 .set("in", self)
2120 .set(
2121 "out",
2122 &mut out_out,
2123 )
2124 .set(
2125 "format",
2126 format as i32,
2127 ),
2128 );
2129
2130 utils::result(
2131 vips_op_response,
2132 out_out,
2133 Error::OperationError("Cast (vips_cast) failed".to_string()),
2134 )
2135 }
2136
2137 /// VipsClamp (clamp), clamp values of an image
2138 /// returns `VipsImage` - Output image
2139 pub fn clamp(&self) -> Result<VipsImage> {
2140 let mut out_out = VipsImage::from(null_mut());
2141 let vips_op_response = call(
2142 "clamp",
2143 VOption::new()
2144 .set("in", self)
2145 .set(
2146 "out",
2147 &mut out_out,
2148 ),
2149 );
2150
2151 utils::result(
2152 vips_op_response,
2153 out_out,
2154 Error::OperationError("Clamp (vips_clamp) failed".to_string()),
2155 )
2156 }
2157
2158 /// VipsClamp (clamp), clamp values of an image
2159 /// returns `VipsImage` - Output image
2160 ///
2161 /// <ins>Optional arguments</ins>
2162 ///
2163 /// min: `f64` -> Minimum value
2164 ///
2165 /// max: `f64` -> Maximum value
2166 pub fn clamp_with_opts(&self, option: VOption) -> Result<VipsImage> {
2167 let mut out_out = VipsImage::from(null_mut());
2168 let vips_op_response = call(
2169 "clamp",
2170 option
2171 .set("in", self)
2172 .set(
2173 "out",
2174 &mut out_out,
2175 ),
2176 );
2177
2178 utils::result(
2179 vips_op_response,
2180 out_out,
2181 Error::OperationError("Clamp (vips_clamp) failed".to_string()),
2182 )
2183 }
2184
2185 /// VipsColourspace (colourspace), convert to a new colorspace
2186 /// returns `VipsImage` - Output image
2187 ///
2188 /// space: `Interpretation` -> Destination color space
2189 pub fn colourspace(&self, space: Interpretation) -> Result<VipsImage> {
2190 let mut out_out = VipsImage::from(null_mut());
2191 let vips_op_response = call(
2192 "colourspace",
2193 VOption::new()
2194 .set("in", self)
2195 .set(
2196 "out",
2197 &mut out_out,
2198 )
2199 .set(
2200 "space",
2201 space as i32,
2202 ),
2203 );
2204
2205 utils::result(
2206 vips_op_response,
2207 out_out,
2208 Error::OperationError("Colourspace (vips_colourspace) failed".to_string()),
2209 )
2210 }
2211
2212 /// VipsColourspace (colourspace), convert to a new colorspace
2213 /// returns `VipsImage` - Output image
2214 ///
2215 /// space: `Interpretation` -> Destination color space
2216 ///
2217 /// <ins>Optional arguments</ins>
2218 ///
2219 /// source_space: [`Interpretation`] -> Source color space
2220 pub fn colourspace_with_opts(
2221 &self,
2222 space: Interpretation,
2223 option: VOption,
2224 ) -> Result<VipsImage> {
2225 let mut out_out = VipsImage::from(null_mut());
2226 let vips_op_response = call(
2227 "colourspace",
2228 option
2229 .set("in", self)
2230 .set(
2231 "out",
2232 &mut out_out,
2233 )
2234 .set(
2235 "space",
2236 space as i32,
2237 ),
2238 );
2239
2240 utils::result(
2241 vips_op_response,
2242 out_out,
2243 Error::OperationError("Colourspace (vips_colourspace) failed".to_string()),
2244 )
2245 }
2246
2247 /// VipsCompass (compass), convolve with rotating mask
2248 /// returns `VipsImage` - Output image
2249 ///
2250 /// mask: `&VipsImage` -> Input matrix image
2251 pub fn compass(&self, mask: &VipsImage) -> Result<VipsImage> {
2252 let mut out_out = VipsImage::from(null_mut());
2253 let vips_op_response = call(
2254 "compass",
2255 VOption::new()
2256 .set("in", self)
2257 .set(
2258 "out",
2259 &mut out_out,
2260 )
2261 .set(
2262 "mask",
2263 mask,
2264 ),
2265 );
2266
2267 utils::result(
2268 vips_op_response,
2269 out_out,
2270 Error::OperationError("Compass (vips_compass) failed".to_string()),
2271 )
2272 }
2273
2274 /// VipsCompass (compass), convolve with rotating mask
2275 /// returns `VipsImage` - Output image
2276 ///
2277 /// mask: `&VipsImage` -> Input matrix image
2278 ///
2279 /// <ins>Optional arguments</ins>
2280 ///
2281 /// times: `i32` -> Rotate and convolve this many times
2282 ///
2283 /// angle: [`Angle45`] -> Rotate mask by this much between convolutions
2284 ///
2285 /// combine: [`Combine`] -> Combine convolution results like this
2286 ///
2287 /// precision: [`Precision`] -> Convolve with this precision
2288 ///
2289 /// layers: `i32` -> Use this many layers in approximation
2290 ///
2291 /// cluster: `i32` -> Cluster lines closer than this in approximation
2292 pub fn compass_with_opts(&self, mask: &VipsImage, option: VOption) -> Result<VipsImage> {
2293 let mut out_out = VipsImage::from(null_mut());
2294 let vips_op_response = call(
2295 "compass",
2296 option
2297 .set("in", self)
2298 .set(
2299 "out",
2300 &mut out_out,
2301 )
2302 .set(
2303 "mask",
2304 mask,
2305 ),
2306 );
2307
2308 utils::result(
2309 vips_op_response,
2310 out_out,
2311 Error::OperationError("Compass (vips_compass) failed".to_string()),
2312 )
2313 }
2314
2315 /// VipsComplex2 (complex2), complex binary operations on two images
2316 /// returns `VipsImage` - Output image
2317 ///
2318 /// right: `&VipsImage` -> Right-hand image argument
2319 ///
2320 /// cmplx: `OperationComplex2` -> Binary complex operation to perform
2321 pub fn complex2(&self, right: &VipsImage, cmplx: OperationComplex2) -> Result<VipsImage> {
2322 let mut out_out = VipsImage::from(null_mut());
2323 let vips_op_response = call(
2324 "complex2",
2325 VOption::new()
2326 .set(
2327 "left",
2328 self,
2329 )
2330 .set(
2331 "right",
2332 right,
2333 )
2334 .set(
2335 "out",
2336 &mut out_out,
2337 )
2338 .set(
2339 "cmplx",
2340 cmplx as i32,
2341 ),
2342 );
2343
2344 utils::result(
2345 vips_op_response,
2346 out_out,
2347 Error::OperationError("Complex2 (vips_complex2) failed".to_string()),
2348 )
2349 }
2350
2351 /// VipsComplex (complex), perform a complex operation on an image
2352 /// returns `VipsImage` - Output image
2353 ///
2354 /// cmplx: `OperationComplex` -> Complex to perform
2355 pub fn complex(&self, cmplx: OperationComplex) -> Result<VipsImage> {
2356 let mut out_out = VipsImage::from(null_mut());
2357 let vips_op_response = call(
2358 "complex",
2359 VOption::new()
2360 .set("in", self)
2361 .set(
2362 "out",
2363 &mut out_out,
2364 )
2365 .set(
2366 "cmplx",
2367 cmplx as i32,
2368 ),
2369 );
2370
2371 utils::result(
2372 vips_op_response,
2373 out_out,
2374 Error::OperationError("Complex (vips_complex) failed".to_string()),
2375 )
2376 }
2377
2378 /// VipsComplexform (complexform), form a complex image from two real images
2379 /// returns `VipsImage` - Output image
2380 ///
2381 /// right: `&VipsImage` -> Right-hand image argument
2382 pub fn complexform(&self, right: &VipsImage) -> Result<VipsImage> {
2383 let mut out_out = VipsImage::from(null_mut());
2384 let vips_op_response = call(
2385 "complexform",
2386 VOption::new()
2387 .set(
2388 "left",
2389 self,
2390 )
2391 .set(
2392 "right",
2393 right,
2394 )
2395 .set(
2396 "out",
2397 &mut out_out,
2398 ),
2399 );
2400
2401 utils::result(
2402 vips_op_response,
2403 out_out,
2404 Error::OperationError("Complexform (vips_complexform) failed".to_string()),
2405 )
2406 }
2407
2408 /// VipsComplexget (complexget), get a component from a complex image
2409 /// returns `VipsImage` - Output image
2410 ///
2411 /// get: `OperationComplexget` -> Complex to perform
2412 pub fn complexget(&self, get: OperationComplexget) -> Result<VipsImage> {
2413 let mut out_out = VipsImage::from(null_mut());
2414 let vips_op_response = call(
2415 "complexget",
2416 VOption::new()
2417 .set("in", self)
2418 .set(
2419 "out",
2420 &mut out_out,
2421 )
2422 .set(
2423 "get",
2424 get as i32,
2425 ),
2426 );
2427
2428 utils::result(
2429 vips_op_response,
2430 out_out,
2431 Error::OperationError("Complexget (vips_complexget) failed".to_string()),
2432 )
2433 }
2434
2435 /// VipsComposite2 (composite2), blend a pair of images with a blend mode
2436 /// returns `VipsImage` - Output image
2437 ///
2438 /// overlay: `&VipsImage` -> Overlay image
2439 ///
2440 /// mode: `BlendMode` -> VipsBlendMode to join with
2441 pub fn composite2(&self, overlay: &VipsImage, mode: BlendMode) -> Result<VipsImage> {
2442 let mut out_out = VipsImage::from(null_mut());
2443 let vips_op_response = call(
2444 "composite2",
2445 VOption::new()
2446 .set(
2447 "base",
2448 self,
2449 )
2450 .set(
2451 "overlay",
2452 overlay,
2453 )
2454 .set(
2455 "out",
2456 &mut out_out,
2457 )
2458 .set(
2459 "mode",
2460 mode as i32,
2461 ),
2462 );
2463
2464 utils::result(
2465 vips_op_response,
2466 out_out,
2467 Error::OperationError("Composite2 (vips_composite2) failed".to_string()),
2468 )
2469 }
2470
2471 /// VipsComposite2 (composite2), blend a pair of images with a blend mode
2472 /// returns `VipsImage` - Output image
2473 ///
2474 /// overlay: `&VipsImage` -> Overlay image
2475 ///
2476 /// mode: `BlendMode` -> VipsBlendMode to join with
2477 ///
2478 /// <ins>Optional arguments</ins>
2479 ///
2480 /// x: `i32` -> x position of overlay
2481 ///
2482 /// y: `i32` -> y position of overlay
2483 ///
2484 /// compositing_space: [`Interpretation`] -> Composite images in this colour space
2485 ///
2486 /// premultiplied: `bool` -> Images have premultiplied alpha
2487 pub fn composite2_with_opts(
2488 &self,
2489 overlay: &VipsImage,
2490 mode: BlendMode,
2491 option: VOption,
2492 ) -> Result<VipsImage> {
2493 let mut out_out = VipsImage::from(null_mut());
2494 let vips_op_response = call(
2495 "composite2",
2496 option
2497 .set(
2498 "base",
2499 self,
2500 )
2501 .set(
2502 "overlay",
2503 overlay,
2504 )
2505 .set(
2506 "out",
2507 &mut out_out,
2508 )
2509 .set(
2510 "mode",
2511 mode as i32,
2512 ),
2513 );
2514
2515 utils::result(
2516 vips_op_response,
2517 out_out,
2518 Error::OperationError("Composite2 (vips_composite2) failed".to_string()),
2519 )
2520 }
2521
2522 /// VipsComposite (composite), blend an array of images with an array of blend modes
2523 /// returns `VipsImage` - Output image
2524 ///
2525 /// inp: `&[VipsImage]` -> Array of input images
2526 ///
2527 /// mode: `&[i32]` -> Array of VipsBlendMode to join with
2528 pub fn composite(inp: &[VipsImage], mode: &[i32]) -> Result<VipsImage> {
2529 let mut out_out = VipsImage::from(null_mut());
2530 let vips_op_response = call(
2531 "composite",
2532 VOption::new()
2533 .set("in", inp)
2534 .set(
2535 "out",
2536 &mut out_out,
2537 )
2538 .set(
2539 "mode",
2540 mode,
2541 ),
2542 );
2543
2544 utils::result(
2545 vips_op_response,
2546 out_out,
2547 Error::OperationError("Composite (vips_composite) failed".to_string()),
2548 )
2549 }
2550
2551 /// VipsComposite (composite), blend an array of images with an array of blend modes
2552 /// returns `VipsImage` - Output image
2553 ///
2554 /// inp: `&[VipsImage]` -> Array of input images
2555 ///
2556 /// mode: `&[i32]` -> Array of VipsBlendMode to join with
2557 ///
2558 /// <ins>Optional arguments</ins>
2559 ///
2560 /// x: `&[i32]` -> Array of x coordinates to join at
2561 ///
2562 /// y: `&[i32]` -> Array of y coordinates to join at
2563 ///
2564 /// compositing_space: [`Interpretation`] -> Composite images in this colour space
2565 ///
2566 /// premultiplied: `bool` -> Images have premultiplied alpha
2567 pub fn composite_with_opts(
2568 inp: &[VipsImage],
2569 mode: &[i32],
2570 option: VOption,
2571 ) -> Result<VipsImage> {
2572 let mut out_out = VipsImage::from(null_mut());
2573 let vips_op_response = call(
2574 "composite",
2575 option
2576 .set("in", inp)
2577 .set(
2578 "out",
2579 &mut out_out,
2580 )
2581 .set(
2582 "mode",
2583 mode,
2584 ),
2585 );
2586
2587 utils::result(
2588 vips_op_response,
2589 out_out,
2590 Error::OperationError("Composite (vips_composite) failed".to_string()),
2591 )
2592 }
2593
2594 /// VipsConv (conv), convolution operation
2595 /// returns `VipsImage` - Output image
2596 ///
2597 /// mask: `&VipsImage` -> Input matrix image
2598 pub fn conv(&self, mask: &VipsImage) -> Result<VipsImage> {
2599 let mut out_out = VipsImage::from(null_mut());
2600 let vips_op_response = call(
2601 "conv",
2602 VOption::new()
2603 .set("in", self)
2604 .set(
2605 "out",
2606 &mut out_out,
2607 )
2608 .set(
2609 "mask",
2610 mask,
2611 ),
2612 );
2613
2614 utils::result(
2615 vips_op_response,
2616 out_out,
2617 Error::OperationError("Conv (vips_conv) failed".to_string()),
2618 )
2619 }
2620
2621 /// VipsConv (conv), convolution operation
2622 /// returns `VipsImage` - Output image
2623 ///
2624 /// mask: `&VipsImage` -> Input matrix image
2625 ///
2626 /// <ins>Optional arguments</ins>
2627 ///
2628 /// precision: [`Precision`] -> Convolve with this precision
2629 ///
2630 /// layers: `i32` -> Use this many layers in approximation
2631 ///
2632 /// cluster: `i32` -> Cluster lines closer than this in approximation
2633 pub fn conv_with_opts(&self, mask: &VipsImage, option: VOption) -> Result<VipsImage> {
2634 let mut out_out = VipsImage::from(null_mut());
2635 let vips_op_response = call(
2636 "conv",
2637 option
2638 .set("in", self)
2639 .set(
2640 "out",
2641 &mut out_out,
2642 )
2643 .set(
2644 "mask",
2645 mask,
2646 ),
2647 );
2648
2649 utils::result(
2650 vips_op_response,
2651 out_out,
2652 Error::OperationError("Conv (vips_conv) failed".to_string()),
2653 )
2654 }
2655
2656 /// VipsConva (conva), approximate integer convolution
2657 /// returns `VipsImage` - Output image
2658 ///
2659 /// mask: `&VipsImage` -> Input matrix image
2660 pub fn conva(&self, mask: &VipsImage) -> Result<VipsImage> {
2661 let mut out_out = VipsImage::from(null_mut());
2662 let vips_op_response = call(
2663 "conva",
2664 VOption::new()
2665 .set("in", self)
2666 .set(
2667 "out",
2668 &mut out_out,
2669 )
2670 .set(
2671 "mask",
2672 mask,
2673 ),
2674 );
2675
2676 utils::result(
2677 vips_op_response,
2678 out_out,
2679 Error::OperationError("Conva (vips_conva) failed".to_string()),
2680 )
2681 }
2682
2683 /// VipsConva (conva), approximate integer convolution
2684 /// returns `VipsImage` - Output image
2685 ///
2686 /// mask: `&VipsImage` -> Input matrix image
2687 ///
2688 /// <ins>Optional arguments</ins>
2689 ///
2690 /// layers: `i32` -> Use this many layers in approximation
2691 ///
2692 /// cluster: `i32` -> Cluster lines closer than this in approximation
2693 pub fn conva_with_opts(&self, mask: &VipsImage, option: VOption) -> Result<VipsImage> {
2694 let mut out_out = VipsImage::from(null_mut());
2695 let vips_op_response = call(
2696 "conva",
2697 option
2698 .set("in", self)
2699 .set(
2700 "out",
2701 &mut out_out,
2702 )
2703 .set(
2704 "mask",
2705 mask,
2706 ),
2707 );
2708
2709 utils::result(
2710 vips_op_response,
2711 out_out,
2712 Error::OperationError("Conva (vips_conva) failed".to_string()),
2713 )
2714 }
2715
2716 /// VipsConvasep (convasep), approximate separable integer convolution
2717 /// returns `VipsImage` - Output image
2718 ///
2719 /// mask: `&VipsImage` -> Input matrix image
2720 pub fn convasep(&self, mask: &VipsImage) -> Result<VipsImage> {
2721 let mut out_out = VipsImage::from(null_mut());
2722 let vips_op_response = call(
2723 "convasep",
2724 VOption::new()
2725 .set("in", self)
2726 .set(
2727 "out",
2728 &mut out_out,
2729 )
2730 .set(
2731 "mask",
2732 mask,
2733 ),
2734 );
2735
2736 utils::result(
2737 vips_op_response,
2738 out_out,
2739 Error::OperationError("Convasep (vips_convasep) failed".to_string()),
2740 )
2741 }
2742
2743 /// VipsConvasep (convasep), approximate separable integer convolution
2744 /// returns `VipsImage` - Output image
2745 ///
2746 /// mask: `&VipsImage` -> Input matrix image
2747 ///
2748 /// <ins>Optional arguments</ins>
2749 ///
2750 /// layers: `i32` -> Use this many layers in approximation
2751 pub fn convasep_with_opts(&self, mask: &VipsImage, option: VOption) -> Result<VipsImage> {
2752 let mut out_out = VipsImage::from(null_mut());
2753 let vips_op_response = call(
2754 "convasep",
2755 option
2756 .set("in", self)
2757 .set(
2758 "out",
2759 &mut out_out,
2760 )
2761 .set(
2762 "mask",
2763 mask,
2764 ),
2765 );
2766
2767 utils::result(
2768 vips_op_response,
2769 out_out,
2770 Error::OperationError("Convasep (vips_convasep) failed".to_string()),
2771 )
2772 }
2773
2774 /// VipsConvf (convf), float convolution operation
2775 /// returns `VipsImage` - Output image
2776 ///
2777 /// mask: `&VipsImage` -> Input matrix image
2778 pub fn convf(&self, mask: &VipsImage) -> Result<VipsImage> {
2779 let mut out_out = VipsImage::from(null_mut());
2780 let vips_op_response = call(
2781 "convf",
2782 VOption::new()
2783 .set("in", self)
2784 .set(
2785 "out",
2786 &mut out_out,
2787 )
2788 .set(
2789 "mask",
2790 mask,
2791 ),
2792 );
2793
2794 utils::result(
2795 vips_op_response,
2796 out_out,
2797 Error::OperationError("Convf (vips_convf) failed".to_string()),
2798 )
2799 }
2800
2801 /// VipsConvi (convi), int convolution operation
2802 /// returns `VipsImage` - Output image
2803 ///
2804 /// mask: `&VipsImage` -> Input matrix image
2805 pub fn convi(&self, mask: &VipsImage) -> Result<VipsImage> {
2806 let mut out_out = VipsImage::from(null_mut());
2807 let vips_op_response = call(
2808 "convi",
2809 VOption::new()
2810 .set("in", self)
2811 .set(
2812 "out",
2813 &mut out_out,
2814 )
2815 .set(
2816 "mask",
2817 mask,
2818 ),
2819 );
2820
2821 utils::result(
2822 vips_op_response,
2823 out_out,
2824 Error::OperationError("Convi (vips_convi) failed".to_string()),
2825 )
2826 }
2827
2828 /// VipsConvsep (convsep), separable convolution operation
2829 /// returns `VipsImage` - Output image
2830 ///
2831 /// mask: `&VipsImage` -> Input matrix image
2832 pub fn convsep(&self, mask: &VipsImage) -> Result<VipsImage> {
2833 let mut out_out = VipsImage::from(null_mut());
2834 let vips_op_response = call(
2835 "convsep",
2836 VOption::new()
2837 .set("in", self)
2838 .set(
2839 "out",
2840 &mut out_out,
2841 )
2842 .set(
2843 "mask",
2844 mask,
2845 ),
2846 );
2847
2848 utils::result(
2849 vips_op_response,
2850 out_out,
2851 Error::OperationError("Convsep (vips_convsep) failed".to_string()),
2852 )
2853 }
2854
2855 /// VipsConvsep (convsep), separable convolution operation
2856 /// returns `VipsImage` - Output image
2857 ///
2858 /// mask: `&VipsImage` -> Input matrix image
2859 ///
2860 /// <ins>Optional arguments</ins>
2861 ///
2862 /// precision: [`Precision`] -> Convolve with this precision
2863 ///
2864 /// layers: `i32` -> Use this many layers in approximation
2865 ///
2866 /// cluster: `i32` -> Cluster lines closer than this in approximation
2867 pub fn convsep_with_opts(&self, mask: &VipsImage, option: VOption) -> Result<VipsImage> {
2868 let mut out_out = VipsImage::from(null_mut());
2869 let vips_op_response = call(
2870 "convsep",
2871 option
2872 .set("in", self)
2873 .set(
2874 "out",
2875 &mut out_out,
2876 )
2877 .set(
2878 "mask",
2879 mask,
2880 ),
2881 );
2882
2883 utils::result(
2884 vips_op_response,
2885 out_out,
2886 Error::OperationError("Convsep (vips_convsep) failed".to_string()),
2887 )
2888 }
2889
2890 /// VipsCopy (copy), copy an image
2891 /// returns `VipsImage` - Output image
2892 pub fn copy(&self) -> Result<VipsImage> {
2893 let mut out_out = VipsImage::from(null_mut());
2894 let vips_op_response = call(
2895 "copy",
2896 VOption::new()
2897 .set("in", self)
2898 .set(
2899 "out",
2900 &mut out_out,
2901 ),
2902 );
2903
2904 utils::result(
2905 vips_op_response,
2906 out_out,
2907 Error::OperationError("Copy (vips_copy) failed".to_string()),
2908 )
2909 }
2910
2911 /// VipsCopy (copy), copy an image
2912 /// returns `VipsImage` - Output image
2913 ///
2914 /// <ins>Optional arguments</ins>
2915 ///
2916 /// width: `i32` -> Image width in pixels
2917 ///
2918 /// height: `i32` -> Image height in pixels
2919 ///
2920 /// bands: `i32` -> Number of bands in image
2921 ///
2922 /// format: [`BandFormat`] -> Pixel format in image
2923 ///
2924 /// coding: [`Coding`] -> Pixel coding
2925 ///
2926 /// interpretation: [`Interpretation`] -> Pixel interpretation
2927 ///
2928 /// xres: `f64` -> Horizontal resolution in pixels/mm
2929 ///
2930 /// yres: `f64` -> Vertical resolution in pixels/mm
2931 ///
2932 /// xoffset: `i32` -> Horizontal offset of origin
2933 ///
2934 /// yoffset: `i32` -> Vertical offset of origin
2935 pub fn copy_with_opts(&self, option: VOption) -> Result<VipsImage> {
2936 let mut out_out = VipsImage::from(null_mut());
2937 let vips_op_response = call(
2938 "copy",
2939 option
2940 .set("in", self)
2941 .set(
2942 "out",
2943 &mut out_out,
2944 ),
2945 );
2946
2947 utils::result(
2948 vips_op_response,
2949 out_out,
2950 Error::OperationError("Copy (vips_copy) failed".to_string()),
2951 )
2952 }
2953
2954 /// VipsCountlines (countlines), count lines in an image
2955 /// returns `f64` - Number of lines
2956 ///
2957 /// direction: `Direction` -> Countlines left-right or up-down
2958 pub fn countlines(&self, direction: Direction) -> Result<f64> {
2959 let mut nolines_out: f64 = 0.0;
2960 let vips_op_response = call(
2961 "countlines",
2962 VOption::new()
2963 .set("in", self)
2964 .set(
2965 "nolines",
2966 &mut nolines_out,
2967 )
2968 .set(
2969 "direction",
2970 direction as i32,
2971 ),
2972 );
2973
2974 utils::result(
2975 vips_op_response,
2976 nolines_out,
2977 Error::OperationError("Countlines (vips_countlines) failed".to_string()),
2978 )
2979 }
2980
2981 /// VipsForeignLoadCsvFile (csvload), load csv (.csv), priority=0, untrusted, get_flags, get_flags_filename, header, load
2982 /// returns `VipsImage` - Output image
2983 ///
2984 /// filename: `&str` -> Filename to load from
2985 pub fn csvload(filename: &str) -> Result<VipsImage> {
2986 let mut out_out = VipsImage::from(null_mut());
2987 let vips_op_response = call(
2988 "csvload",
2989 VOption::new()
2990 .set(
2991 "filename",
2992 filename,
2993 )
2994 .set(
2995 "out",
2996 &mut out_out,
2997 ),
2998 );
2999
3000 utils::result(
3001 vips_op_response,
3002 out_out,
3003 Error::OperationError("Csvload (vips_csvload) failed".to_string()),
3004 )
3005 }
3006
3007 /// VipsForeignLoadCsvFile (csvload), load csv (.csv), priority=0, untrusted, get_flags, get_flags_filename, header, load
3008 /// returns `VipsImage` - Output image
3009 ///
3010 /// filename: `&str` -> Filename to load from
3011 ///
3012 /// <ins>Optional arguments</ins>
3013 ///
3014 /// skip: `i32` -> Skip this many lines at the start of the file
3015 ///
3016 /// lines: `i32` -> Read this many lines from the file
3017 ///
3018 /// whitespace: `&str` -> Set of whitespace characters
3019 ///
3020 /// separator: `&str` -> Set of separator characters
3021 ///
3022 /// flags: [`ForeignFlags`] -> Flags for this file
3023 ///
3024 /// memory: `bool` -> Force open via memory
3025 ///
3026 /// access: [`Access`] -> Required access pattern for this file
3027 ///
3028 /// fail_on: [`FailOn`] -> Error level to fail on
3029 ///
3030 /// revalidate: `bool` -> Don't use a cached result for this operation
3031 pub fn csvload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
3032 let mut out_out = VipsImage::from(null_mut());
3033 let vips_op_response = call(
3034 "csvload",
3035 option
3036 .set(
3037 "filename",
3038 filename,
3039 )
3040 .set(
3041 "out",
3042 &mut out_out,
3043 ),
3044 );
3045
3046 utils::result(
3047 vips_op_response,
3048 out_out,
3049 Error::OperationError("Csvload (vips_csvload) failed".to_string()),
3050 )
3051 }
3052
3053 /// VipsForeignLoadCsvSource (csvload_source), load csv, priority=0, untrusted, is_a_source, get_flags, header, load
3054 /// returns `VipsImage` - Output image
3055 ///
3056 /// source: `&VipsSource` -> Source to load from
3057 pub fn csvload_source(source: &VipsSource) -> Result<VipsImage> {
3058 let mut out_out = VipsImage::from(null_mut());
3059 let vips_op_response = call(
3060 "csvload_source",
3061 VOption::new()
3062 .set(
3063 "source",
3064 source,
3065 )
3066 .set(
3067 "out",
3068 &mut out_out,
3069 ),
3070 );
3071
3072 utils::result(
3073 vips_op_response,
3074 out_out,
3075 Error::OperationError("CsvloadSource (vips_csvload_source) failed".to_string()),
3076 )
3077 }
3078
3079 /// VipsForeignLoadCsvSource (csvload_source), load csv, priority=0, untrusted, is_a_source, get_flags, header, load
3080 /// returns `VipsImage` - Output image
3081 ///
3082 /// source: `&VipsSource` -> Source to load from
3083 ///
3084 /// <ins>Optional arguments</ins>
3085 ///
3086 /// skip: `i32` -> Skip this many lines at the start of the file
3087 ///
3088 /// lines: `i32` -> Read this many lines from the file
3089 ///
3090 /// whitespace: `&str` -> Set of whitespace characters
3091 ///
3092 /// separator: `&str` -> Set of separator characters
3093 ///
3094 /// flags: [`ForeignFlags`] -> Flags for this file
3095 ///
3096 /// memory: `bool` -> Force open via memory
3097 ///
3098 /// access: [`Access`] -> Required access pattern for this file
3099 ///
3100 /// fail_on: [`FailOn`] -> Error level to fail on
3101 ///
3102 /// revalidate: `bool` -> Don't use a cached result for this operation
3103 pub fn csvload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
3104 let mut out_out = VipsImage::from(null_mut());
3105 let vips_op_response = call(
3106 "csvload_source",
3107 option
3108 .set(
3109 "source",
3110 source,
3111 )
3112 .set(
3113 "out",
3114 &mut out_out,
3115 ),
3116 );
3117
3118 utils::result(
3119 vips_op_response,
3120 out_out,
3121 Error::OperationError("CsvloadSource (vips_csvload_source) failed".to_string()),
3122 )
3123 }
3124
3125 /// VipsForeignSaveCsvFile (csvsave), save image to csv (.csv), priority=0, mono
3126 ///
3127 /// filename: `&str` -> Filename to save to
3128 pub fn csvsave(&self, filename: &str) -> Result<()> {
3129 let vips_op_response = call(
3130 "csvsave",
3131 VOption::new()
3132 .set("in", self)
3133 .set(
3134 "filename",
3135 filename,
3136 ),
3137 );
3138
3139 utils::result(
3140 vips_op_response,
3141 (),
3142 Error::OperationError("Csvsave (vips_csvsave) failed".to_string()),
3143 )
3144 }
3145
3146 /// VipsForeignSaveCsvFile (csvsave), save image to csv (.csv), priority=0, mono
3147 ///
3148 /// filename: `&str` -> Filename to save to
3149 ///
3150 /// <ins>Optional arguments</ins>
3151 ///
3152 /// separator: `&str` -> Separator characters
3153 ///
3154 /// keep: [`ForeignKeep`] -> Which metadata to retain
3155 ///
3156 /// background: `&[f64]` -> Background value
3157 ///
3158 /// page_height: `i32` -> Set page height for multipage save
3159 ///
3160 /// profile: `&str` -> Filename of ICC profile to embed
3161 pub fn csvsave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
3162 let vips_op_response = call(
3163 "csvsave",
3164 option
3165 .set("in", self)
3166 .set(
3167 "filename",
3168 filename,
3169 ),
3170 );
3171
3172 utils::result(
3173 vips_op_response,
3174 (),
3175 Error::OperationError("Csvsave (vips_csvsave) failed".to_string()),
3176 )
3177 }
3178
3179 /// VipsForeignSaveCsvTarget (csvsave_target), save image to csv (.csv), priority=0, mono
3180 ///
3181 /// target: `&VipsTarget` -> Target to save to
3182 pub fn csvsave_target(&self, target: &VipsTarget) -> Result<()> {
3183 let vips_op_response = call(
3184 "csvsave_target",
3185 VOption::new()
3186 .set("in", self)
3187 .set(
3188 "target",
3189 target,
3190 ),
3191 );
3192
3193 utils::result(
3194 vips_op_response,
3195 (),
3196 Error::OperationError("CsvsaveTarget (vips_csvsave_target) failed".to_string()),
3197 )
3198 }
3199
3200 /// VipsForeignSaveCsvTarget (csvsave_target), save image to csv (.csv), priority=0, mono
3201 ///
3202 /// target: `&VipsTarget` -> Target to save to
3203 ///
3204 /// <ins>Optional arguments</ins>
3205 ///
3206 /// separator: `&str` -> Separator characters
3207 ///
3208 /// keep: [`ForeignKeep`] -> Which metadata to retain
3209 ///
3210 /// background: `&[f64]` -> Background value
3211 ///
3212 /// page_height: `i32` -> Set page height for multipage save
3213 ///
3214 /// profile: `&str` -> Filename of ICC profile to embed
3215 pub fn csvsave_target_with_opts(&self, target: &VipsTarget, option: VOption) -> Result<()> {
3216 let vips_op_response = call(
3217 "csvsave_target",
3218 option
3219 .set("in", self)
3220 .set(
3221 "target",
3222 target,
3223 ),
3224 );
3225
3226 utils::result(
3227 vips_op_response,
3228 (),
3229 Error::OperationError("CsvsaveTarget (vips_csvsave_target) failed".to_string()),
3230 )
3231 }
3232
3233 /// VipsdE00 (dE00), calculate dE00
3234 /// returns `VipsImage` - Output image
3235 ///
3236 /// right: `&VipsImage` -> Right-hand input image
3237 pub fn dE00(&self, right: &VipsImage) -> Result<VipsImage> {
3238 let mut out_out = VipsImage::from(null_mut());
3239 let vips_op_response = call(
3240 "dE00",
3241 VOption::new()
3242 .set(
3243 "left",
3244 self,
3245 )
3246 .set(
3247 "right",
3248 right,
3249 )
3250 .set(
3251 "out",
3252 &mut out_out,
3253 ),
3254 );
3255
3256 utils::result(
3257 vips_op_response,
3258 out_out,
3259 Error::OperationError("DE00 (vips_dE00) failed".to_string()),
3260 )
3261 }
3262
3263 /// VipsdE76 (dE76), calculate dE76
3264 /// returns `VipsImage` - Output image
3265 ///
3266 /// right: `&VipsImage` -> Right-hand input image
3267 pub fn dE76(&self, right: &VipsImage) -> Result<VipsImage> {
3268 let mut out_out = VipsImage::from(null_mut());
3269 let vips_op_response = call(
3270 "dE76",
3271 VOption::new()
3272 .set(
3273 "left",
3274 self,
3275 )
3276 .set(
3277 "right",
3278 right,
3279 )
3280 .set(
3281 "out",
3282 &mut out_out,
3283 ),
3284 );
3285
3286 utils::result(
3287 vips_op_response,
3288 out_out,
3289 Error::OperationError("DE76 (vips_dE76) failed".to_string()),
3290 )
3291 }
3292
3293 /// VipsdECMC (dECMC), calculate dECMC
3294 /// returns `VipsImage` - Output image
3295 ///
3296 /// right: `&VipsImage` -> Right-hand input image
3297 pub fn dECMC(&self, right: &VipsImage) -> Result<VipsImage> {
3298 let mut out_out = VipsImage::from(null_mut());
3299 let vips_op_response = call(
3300 "dECMC",
3301 VOption::new()
3302 .set(
3303 "left",
3304 self,
3305 )
3306 .set(
3307 "right",
3308 right,
3309 )
3310 .set(
3311 "out",
3312 &mut out_out,
3313 ),
3314 );
3315
3316 utils::result(
3317 vips_op_response,
3318 out_out,
3319 Error::OperationError("DEcmc (vips_dECMC) failed".to_string()),
3320 )
3321 }
3322
3323 /// VipsDeviate (deviate), find image standard deviation
3324 /// returns `f64` - Output value
3325 pub fn deviate(&self) -> Result<f64> {
3326 let mut out_out: f64 = 0.0;
3327 let vips_op_response = call(
3328 "deviate",
3329 VOption::new()
3330 .set("in", self)
3331 .set(
3332 "out",
3333 &mut out_out,
3334 ),
3335 );
3336
3337 utils::result(
3338 vips_op_response,
3339 out_out,
3340 Error::OperationError("Deviate (vips_deviate) failed".to_string()),
3341 )
3342 }
3343
3344 /// VipsDivide (divide), divide two images
3345 /// returns `VipsImage` - Output image
3346 ///
3347 /// right: `&VipsImage` -> Right-hand image argument
3348 pub fn divide(&self, right: &VipsImage) -> Result<VipsImage> {
3349 let mut out_out = VipsImage::from(null_mut());
3350 let vips_op_response = call(
3351 "divide",
3352 VOption::new()
3353 .set(
3354 "left",
3355 self,
3356 )
3357 .set(
3358 "right",
3359 right,
3360 )
3361 .set(
3362 "out",
3363 &mut out_out,
3364 ),
3365 );
3366
3367 utils::result(
3368 vips_op_response,
3369 out_out,
3370 Error::OperationError("Divide (vips_divide) failed".to_string()),
3371 )
3372 }
3373
3374 /// VipsDrawCircle (draw_circle), draw a circle on an image
3375 ///
3376 /// ink: `&[f64]` -> Color for pixels
3377 ///
3378 /// cx: `i32` -> Centre of draw_circle
3379 ///
3380 /// cy: `i32` -> Centre of draw_circle
3381 ///
3382 /// radius: `i32` -> Radius in pixels
3383 pub fn draw_circle(&self, ink: &[f64], cx: i32, cy: i32, radius: i32) -> Result<()> {
3384 let vips_op_response = call(
3385 "draw_circle",
3386 VOption::new()
3387 .set(
3388 "image",
3389 self,
3390 )
3391 .set("ink", ink)
3392 .set("cx", cx)
3393 .set("cy", cy)
3394 .set(
3395 "radius",
3396 radius,
3397 ),
3398 );
3399
3400 utils::result(
3401 vips_op_response,
3402 (),
3403 Error::OperationError("DrawCircle (vips_draw_circle) failed".to_string()),
3404 )
3405 }
3406
3407 /// VipsDrawCircle (draw_circle), draw a circle on an image
3408 ///
3409 /// ink: `&[f64]` -> Color for pixels
3410 ///
3411 /// cx: `i32` -> Centre of draw_circle
3412 ///
3413 /// cy: `i32` -> Centre of draw_circle
3414 ///
3415 /// radius: `i32` -> Radius in pixels
3416 ///
3417 /// <ins>Optional arguments</ins>
3418 ///
3419 /// fill: `bool` -> Draw a solid object
3420 pub fn draw_circle_with_opts(
3421 &self,
3422 ink: &[f64],
3423 cx: i32,
3424 cy: i32,
3425 radius: i32,
3426 option: VOption,
3427 ) -> Result<()> {
3428 let vips_op_response = call(
3429 "draw_circle",
3430 option
3431 .set(
3432 "image",
3433 self,
3434 )
3435 .set("ink", ink)
3436 .set("cx", cx)
3437 .set("cy", cy)
3438 .set(
3439 "radius",
3440 radius,
3441 ),
3442 );
3443
3444 utils::result(
3445 vips_op_response,
3446 (),
3447 Error::OperationError("DrawCircle (vips_draw_circle) failed".to_string()),
3448 )
3449 }
3450
3451 /// VipsDrawFlood (draw_flood), flood-fill an area
3452 ///
3453 /// ink: `&[f64]` -> Color for pixels
3454 ///
3455 /// x: `i32` -> DrawFlood start point
3456 ///
3457 /// y: `i32` -> DrawFlood start point
3458 pub fn draw_flood(&self, ink: &[f64], x: i32, y: i32) -> Result<()> {
3459 let vips_op_response = call(
3460 "draw_flood",
3461 VOption::new()
3462 .set(
3463 "image",
3464 self,
3465 )
3466 .set("ink", ink)
3467 .set("x", x)
3468 .set("y", y),
3469 );
3470
3471 utils::result(
3472 vips_op_response,
3473 (),
3474 Error::OperationError("DrawFlood (vips_draw_flood) failed".to_string()),
3475 )
3476 }
3477
3478 /// VipsDrawFlood (draw_flood), flood-fill an area
3479 ///
3480 /// ink: `&[f64]` -> Color for pixels
3481 ///
3482 /// x: `i32` -> DrawFlood start point
3483 ///
3484 /// y: `i32` -> DrawFlood start point
3485 ///
3486 /// <ins>Optional arguments</ins>
3487 ///
3488 /// test: `` -> Test pixels in this image
3489 ///
3490 /// equal: `bool` -> DrawFlood while equal to edge
3491 ///
3492 /// left: `&mut i32` -> Left edge of modified area
3493 ///
3494 /// top: `&mut i32` -> Top edge of modified area
3495 ///
3496 /// width: `&mut i32` -> Width of modified area
3497 ///
3498 /// height: `&mut i32` -> Height of modified area
3499 pub fn draw_flood_with_opts(&self, ink: &[f64], x: i32, y: i32, option: VOption) -> Result<()> {
3500 let vips_op_response = call(
3501 "draw_flood",
3502 option
3503 .set(
3504 "image",
3505 self,
3506 )
3507 .set("ink", ink)
3508 .set("x", x)
3509 .set("y", y),
3510 );
3511
3512 utils::result(
3513 vips_op_response,
3514 (),
3515 Error::OperationError("DrawFlood (vips_draw_flood) failed".to_string()),
3516 )
3517 }
3518
3519 /// VipsDrawImage (draw_image), paint an image into another image
3520 ///
3521 /// sub: `&VipsImage` -> Sub-image to insert into main image
3522 ///
3523 /// x: `i32` -> Draw image here
3524 ///
3525 /// y: `i32` -> Draw image here
3526 pub fn draw_image(&self, sub: &VipsImage, x: i32, y: i32) -> Result<()> {
3527 let vips_op_response = call(
3528 "draw_image",
3529 VOption::new()
3530 .set(
3531 "image",
3532 self,
3533 )
3534 .set("sub", sub)
3535 .set("x", x)
3536 .set("y", y),
3537 );
3538
3539 utils::result(
3540 vips_op_response,
3541 (),
3542 Error::OperationError("DrawImage (vips_draw_image) failed".to_string()),
3543 )
3544 }
3545
3546 /// VipsDrawImage (draw_image), paint an image into another image
3547 ///
3548 /// sub: `&VipsImage` -> Sub-image to insert into main image
3549 ///
3550 /// x: `i32` -> Draw image here
3551 ///
3552 /// y: `i32` -> Draw image here
3553 ///
3554 /// <ins>Optional arguments</ins>
3555 ///
3556 /// mode: [`CombineMode`] -> Combining mode
3557 pub fn draw_image_with_opts(
3558 &self,
3559 sub: &VipsImage,
3560 x: i32,
3561 y: i32,
3562 option: VOption,
3563 ) -> Result<()> {
3564 let vips_op_response = call(
3565 "draw_image",
3566 option
3567 .set(
3568 "image",
3569 self,
3570 )
3571 .set("sub", sub)
3572 .set("x", x)
3573 .set("y", y),
3574 );
3575
3576 utils::result(
3577 vips_op_response,
3578 (),
3579 Error::OperationError("DrawImage (vips_draw_image) failed".to_string()),
3580 )
3581 }
3582
3583 /// VipsDrawLine (draw_line), draw a line on an image
3584 ///
3585 /// ink: `&[f64]` -> Color for pixels
3586 ///
3587 /// x1: `i32` -> Start of draw_line
3588 ///
3589 /// y1: `i32` -> Start of draw_line
3590 ///
3591 /// x2: `i32` -> End of draw_line
3592 ///
3593 /// y2: `i32` -> End of draw_line
3594 pub fn draw_line(&self, ink: &[f64], x1: i32, y1: i32, x2: i32, y2: i32) -> Result<()> {
3595 let vips_op_response = call(
3596 "draw_line",
3597 VOption::new()
3598 .set(
3599 "image",
3600 self,
3601 )
3602 .set("ink", ink)
3603 .set("x1", x1)
3604 .set("y1", y1)
3605 .set("x2", x2)
3606 .set("y2", y2),
3607 );
3608
3609 utils::result(
3610 vips_op_response,
3611 (),
3612 Error::OperationError("DrawLine (vips_draw_line) failed".to_string()),
3613 )
3614 }
3615
3616 /// VipsDrawMask (draw_mask), draw a mask on an image
3617 ///
3618 /// ink: `&[f64]` -> Color for pixels
3619 ///
3620 /// mask: `&VipsImage` -> Mask of pixels to draw
3621 ///
3622 /// x: `i32` -> Draw mask here
3623 ///
3624 /// y: `i32` -> Draw mask here
3625 pub fn draw_mask(&self, ink: &[f64], mask: &VipsImage, x: i32, y: i32) -> Result<()> {
3626 let vips_op_response = call(
3627 "draw_mask",
3628 VOption::new()
3629 .set(
3630 "image",
3631 self,
3632 )
3633 .set("ink", ink)
3634 .set(
3635 "mask",
3636 mask,
3637 )
3638 .set("x", x)
3639 .set("y", y),
3640 );
3641
3642 utils::result(
3643 vips_op_response,
3644 (),
3645 Error::OperationError("DrawMask (vips_draw_mask) failed".to_string()),
3646 )
3647 }
3648
3649 /// VipsDrawRect (draw_rect), paint a rectangle on an image
3650 ///
3651 /// ink: `&[f64]` -> Color for pixels
3652 ///
3653 /// left: `i32` -> Rect to fill
3654 ///
3655 /// top: `i32` -> Rect to fill
3656 ///
3657 /// width: `i32` -> Rect to fill
3658 ///
3659 /// height: `i32` -> Rect to fill
3660 pub fn draw_rect(
3661 &self,
3662 ink: &[f64],
3663 left: i32,
3664 top: i32,
3665 width: i32,
3666 height: i32,
3667 ) -> Result<()> {
3668 let vips_op_response = call(
3669 "draw_rect",
3670 VOption::new()
3671 .set(
3672 "image",
3673 self,
3674 )
3675 .set("ink", ink)
3676 .set(
3677 "left",
3678 left,
3679 )
3680 .set("top", top)
3681 .set(
3682 "width",
3683 width,
3684 )
3685 .set(
3686 "height",
3687 height,
3688 ),
3689 );
3690
3691 utils::result(
3692 vips_op_response,
3693 (),
3694 Error::OperationError("DrawRect (vips_draw_rect) failed".to_string()),
3695 )
3696 }
3697
3698 /// VipsDrawRect (draw_rect), paint a rectangle on an image
3699 ///
3700 /// ink: `&[f64]` -> Color for pixels
3701 ///
3702 /// left: `i32` -> Rect to fill
3703 ///
3704 /// top: `i32` -> Rect to fill
3705 ///
3706 /// width: `i32` -> Rect to fill
3707 ///
3708 /// height: `i32` -> Rect to fill
3709 ///
3710 /// <ins>Optional arguments</ins>
3711 ///
3712 /// fill: `bool` -> Draw a solid object
3713 pub fn draw_rect_with_opts(
3714 &self,
3715 ink: &[f64],
3716 left: i32,
3717 top: i32,
3718 width: i32,
3719 height: i32,
3720 option: VOption,
3721 ) -> Result<()> {
3722 let vips_op_response = call(
3723 "draw_rect",
3724 option
3725 .set(
3726 "image",
3727 self,
3728 )
3729 .set("ink", ink)
3730 .set(
3731 "left",
3732 left,
3733 )
3734 .set("top", top)
3735 .set(
3736 "width",
3737 width,
3738 )
3739 .set(
3740 "height",
3741 height,
3742 ),
3743 );
3744
3745 utils::result(
3746 vips_op_response,
3747 (),
3748 Error::OperationError("DrawRect (vips_draw_rect) failed".to_string()),
3749 )
3750 }
3751
3752 /// VipsDrawSmudge (draw_smudge), blur a rectangle on an image
3753 ///
3754 /// left: `i32` -> Rect to fill
3755 ///
3756 /// top: `i32` -> Rect to fill
3757 ///
3758 /// width: `i32` -> Rect to fill
3759 ///
3760 /// height: `i32` -> Rect to fill
3761 pub fn draw_smudge(&self, left: i32, top: i32, width: i32, height: i32) -> Result<()> {
3762 let vips_op_response = call(
3763 "draw_smudge",
3764 VOption::new()
3765 .set(
3766 "image",
3767 self,
3768 )
3769 .set(
3770 "left",
3771 left,
3772 )
3773 .set("top", top)
3774 .set(
3775 "width",
3776 width,
3777 )
3778 .set(
3779 "height",
3780 height,
3781 ),
3782 );
3783
3784 utils::result(
3785 vips_op_response,
3786 (),
3787 Error::OperationError("DrawSmudge (vips_draw_smudge) failed".to_string()),
3788 )
3789 }
3790
3791 /// VipsForeignSaveDzFile (dzsave), save image to deepzoom file (.dz, .szi), priority=0,
3792 ///
3793 /// filename: `&str` -> Filename to save to
3794 pub fn dzsave(&self, filename: &str) -> Result<()> {
3795 let vips_op_response = call(
3796 "dzsave",
3797 VOption::new()
3798 .set("in", self)
3799 .set(
3800 "filename",
3801 filename,
3802 ),
3803 );
3804
3805 utils::result(
3806 vips_op_response,
3807 (),
3808 Error::OperationError("Dzsave (vips_dzsave) failed".to_string()),
3809 )
3810 }
3811
3812 /// VipsForeignSaveDzFile (dzsave), save image to deepzoom file (.dz, .szi), priority=0,
3813 ///
3814 /// filename: `&str` -> Filename to save to
3815 ///
3816 /// <ins>Optional arguments</ins>
3817 ///
3818 /// imagename: `&str` -> Image name
3819 ///
3820 /// layout: [`ForeignDzLayout`] -> Directory layout
3821 ///
3822 /// suffix: `&str` -> Filename suffix for tiles
3823 ///
3824 /// overlap: `i32` -> Tile overlap in pixels
3825 ///
3826 /// tile_size: `i32` -> Tile size in pixels
3827 ///
3828 /// centre: `bool` -> Center image in tile
3829 ///
3830 /// depth: [`ForeignDzDepth`] -> Pyramid depth
3831 ///
3832 /// angle: [`Angle`] -> Rotate image during save
3833 ///
3834 /// container: [`ForeignDzContainer`] -> Pyramid container type
3835 ///
3836 /// compression: `i32` -> ZIP deflate compression level
3837 ///
3838 /// region_shrink: [`RegionShrink`] -> Method to shrink regions
3839 ///
3840 /// skip_blanks: `i32` -> Skip tiles which are nearly equal to the background
3841 ///
3842 /// id: `&str` -> Resource ID
3843 ///
3844 /// Q: `i32` -> Q factor
3845 ///
3846 /// keep: [`ForeignKeep`] -> Which metadata to retain
3847 ///
3848 /// background: `&[f64]` -> Background value
3849 ///
3850 /// page_height: `i32` -> Set page height for multipage save
3851 ///
3852 /// profile: `&str` -> Filename of ICC profile to embed
3853 pub fn dzsave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
3854 let vips_op_response = call(
3855 "dzsave",
3856 option
3857 .set("in", self)
3858 .set(
3859 "filename",
3860 filename,
3861 ),
3862 );
3863
3864 utils::result(
3865 vips_op_response,
3866 (),
3867 Error::OperationError("Dzsave (vips_dzsave) failed".to_string()),
3868 )
3869 }
3870
3871 /// VipsForeignSaveDzBuffer (dzsave_buffer), save image to dz buffer (.dz, .szi), priority=0,
3872 /// returns `Vec<u8>` - Buffer to save to
3873 pub fn dzsave_buffer(&self) -> Result<Vec<u8>> {
3874 let mut buffer_out = VipsBlob::from(null_mut());
3875 let vips_op_response = call(
3876 "dzsave_buffer",
3877 VOption::new()
3878 .set("in", self)
3879 .set(
3880 "buffer",
3881 &mut buffer_out,
3882 ),
3883 );
3884
3885 utils::result(
3886 vips_op_response,
3887 buffer_out.into(),
3888 Error::OperationError("DzsaveBuffer (vips_dzsave_buffer) failed".to_string()),
3889 )
3890 }
3891
3892 /// VipsForeignSaveDzBuffer (dzsave_buffer), save image to dz buffer (.dz, .szi), priority=0,
3893 /// returns `Vec<u8>` - Buffer to save to
3894 ///
3895 /// <ins>Optional arguments</ins>
3896 ///
3897 /// imagename: `&str` -> Image name
3898 ///
3899 /// layout: [`ForeignDzLayout`] -> Directory layout
3900 ///
3901 /// suffix: `&str` -> Filename suffix for tiles
3902 ///
3903 /// overlap: `i32` -> Tile overlap in pixels
3904 ///
3905 /// tile_size: `i32` -> Tile size in pixels
3906 ///
3907 /// centre: `bool` -> Center image in tile
3908 ///
3909 /// depth: [`ForeignDzDepth`] -> Pyramid depth
3910 ///
3911 /// angle: [`Angle`] -> Rotate image during save
3912 ///
3913 /// container: [`ForeignDzContainer`] -> Pyramid container type
3914 ///
3915 /// compression: `i32` -> ZIP deflate compression level
3916 ///
3917 /// region_shrink: [`RegionShrink`] -> Method to shrink regions
3918 ///
3919 /// skip_blanks: `i32` -> Skip tiles which are nearly equal to the background
3920 ///
3921 /// id: `&str` -> Resource ID
3922 ///
3923 /// Q: `i32` -> Q factor
3924 ///
3925 /// keep: [`ForeignKeep`] -> Which metadata to retain
3926 ///
3927 /// background: `&[f64]` -> Background value
3928 ///
3929 /// page_height: `i32` -> Set page height for multipage save
3930 ///
3931 /// profile: `&str` -> Filename of ICC profile to embed
3932 pub fn dzsave_buffer_with_opts(&self, option: VOption) -> Result<Vec<u8>> {
3933 let mut buffer_out = VipsBlob::from(null_mut());
3934 let vips_op_response = call(
3935 "dzsave_buffer",
3936 option
3937 .set("in", self)
3938 .set(
3939 "buffer",
3940 &mut buffer_out,
3941 ),
3942 );
3943
3944 utils::result(
3945 vips_op_response,
3946 buffer_out.into(),
3947 Error::OperationError("DzsaveBuffer (vips_dzsave_buffer) failed".to_string()),
3948 )
3949 }
3950
3951 /// VipsForeignSaveDzTarget (dzsave_target), save image to deepzoom target (.dz, .szi), priority=0,
3952 ///
3953 /// target: `&VipsTarget` -> Target to save to
3954 pub fn dzsave_target(&self, target: &VipsTarget) -> Result<()> {
3955 let vips_op_response = call(
3956 "dzsave_target",
3957 VOption::new()
3958 .set("in", self)
3959 .set(
3960 "target",
3961 target,
3962 ),
3963 );
3964
3965 utils::result(
3966 vips_op_response,
3967 (),
3968 Error::OperationError("DzsaveTarget (vips_dzsave_target) failed".to_string()),
3969 )
3970 }
3971
3972 /// VipsForeignSaveDzTarget (dzsave_target), save image to deepzoom target (.dz, .szi), priority=0,
3973 ///
3974 /// target: `&VipsTarget` -> Target to save to
3975 ///
3976 /// <ins>Optional arguments</ins>
3977 ///
3978 /// imagename: `&str` -> Image name
3979 ///
3980 /// layout: [`ForeignDzLayout`] -> Directory layout
3981 ///
3982 /// suffix: `&str` -> Filename suffix for tiles
3983 ///
3984 /// overlap: `i32` -> Tile overlap in pixels
3985 ///
3986 /// tile_size: `i32` -> Tile size in pixels
3987 ///
3988 /// centre: `bool` -> Center image in tile
3989 ///
3990 /// depth: [`ForeignDzDepth`] -> Pyramid depth
3991 ///
3992 /// angle: [`Angle`] -> Rotate image during save
3993 ///
3994 /// container: [`ForeignDzContainer`] -> Pyramid container type
3995 ///
3996 /// compression: `i32` -> ZIP deflate compression level
3997 ///
3998 /// region_shrink: [`RegionShrink`] -> Method to shrink regions
3999 ///
4000 /// skip_blanks: `i32` -> Skip tiles which are nearly equal to the background
4001 ///
4002 /// id: `&str` -> Resource ID
4003 ///
4004 /// Q: `i32` -> Q factor
4005 ///
4006 /// keep: [`ForeignKeep`] -> Which metadata to retain
4007 ///
4008 /// background: `&[f64]` -> Background value
4009 ///
4010 /// page_height: `i32` -> Set page height for multipage save
4011 ///
4012 /// profile: `&str` -> Filename of ICC profile to embed
4013 pub fn dzsave_target_with_opts(&self, target: &VipsTarget, option: VOption) -> Result<()> {
4014 let vips_op_response = call(
4015 "dzsave_target",
4016 option
4017 .set("in", self)
4018 .set(
4019 "target",
4020 target,
4021 ),
4022 );
4023
4024 utils::result(
4025 vips_op_response,
4026 (),
4027 Error::OperationError("DzsaveTarget (vips_dzsave_target) failed".to_string()),
4028 )
4029 }
4030
4031 /// VipsEmbed (embed), embed an image in a larger image
4032 /// returns `VipsImage` - Output image
4033 ///
4034 /// x: `i32` -> Left edge of input in output
4035 ///
4036 /// y: `i32` -> Top edge of input in output
4037 ///
4038 /// width: `i32` -> Image width in pixels
4039 ///
4040 /// height: `i32` -> Image height in pixels
4041 pub fn embed(&self, x: i32, y: i32, width: i32, height: i32) -> Result<VipsImage> {
4042 let mut out_out = VipsImage::from(null_mut());
4043 let vips_op_response = call(
4044 "embed",
4045 VOption::new()
4046 .set("in", self)
4047 .set(
4048 "out",
4049 &mut out_out,
4050 )
4051 .set("x", x)
4052 .set("y", y)
4053 .set(
4054 "width",
4055 width,
4056 )
4057 .set(
4058 "height",
4059 height,
4060 ),
4061 );
4062
4063 utils::result(
4064 vips_op_response,
4065 out_out,
4066 Error::OperationError("Embed (vips_embed) failed".to_string()),
4067 )
4068 }
4069
4070 /// VipsEmbed (embed), embed an image in a larger image
4071 /// returns `VipsImage` - Output image
4072 ///
4073 /// x: `i32` -> Left edge of input in output
4074 ///
4075 /// y: `i32` -> Top edge of input in output
4076 ///
4077 /// width: `i32` -> Image width in pixels
4078 ///
4079 /// height: `i32` -> Image height in pixels
4080 ///
4081 /// <ins>Optional arguments</ins>
4082 ///
4083 /// extend: [`Extend`] -> How to generate the extra pixels
4084 ///
4085 /// background: `&[f64]` -> Color for background pixels
4086 pub fn embed_with_opts(
4087 &self,
4088 x: i32,
4089 y: i32,
4090 width: i32,
4091 height: i32,
4092 option: VOption,
4093 ) -> Result<VipsImage> {
4094 let mut out_out = VipsImage::from(null_mut());
4095 let vips_op_response = call(
4096 "embed",
4097 option
4098 .set("in", self)
4099 .set(
4100 "out",
4101 &mut out_out,
4102 )
4103 .set("x", x)
4104 .set("y", y)
4105 .set(
4106 "width",
4107 width,
4108 )
4109 .set(
4110 "height",
4111 height,
4112 ),
4113 );
4114
4115 utils::result(
4116 vips_op_response,
4117 out_out,
4118 Error::OperationError("Embed (vips_embed) failed".to_string()),
4119 )
4120 }
4121
4122 /// VipsExtractArea (extract_area), extract an area from an image
4123 /// returns `VipsImage` - Output image
4124 ///
4125 /// left: `i32` -> Left edge of extract area
4126 ///
4127 /// top: `i32` -> Top edge of extract area
4128 ///
4129 /// width: `i32` -> Width of extract area
4130 ///
4131 /// height: `i32` -> Height of extract area
4132 pub fn extract_area(&self, left: i32, top: i32, width: i32, height: i32) -> Result<VipsImage> {
4133 let mut out_out = VipsImage::from(null_mut());
4134 let vips_op_response = call(
4135 "extract_area",
4136 VOption::new()
4137 .set(
4138 "input",
4139 self,
4140 )
4141 .set(
4142 "out",
4143 &mut out_out,
4144 )
4145 .set(
4146 "left",
4147 left,
4148 )
4149 .set("top", top)
4150 .set(
4151 "width",
4152 width,
4153 )
4154 .set(
4155 "height",
4156 height,
4157 ),
4158 );
4159
4160 utils::result(
4161 vips_op_response,
4162 out_out,
4163 Error::OperationError("ExtractArea (vips_extract_area) failed".to_string()),
4164 )
4165 }
4166
4167 /// crop (extract_area), extract an area from an image
4168 /// returns `VipsImage` - Output image
4169 ///
4170 /// left: `i32` -> Left edge of extract area
4171 ///
4172 /// top: `i32` -> Top edge of extract area
4173 ///
4174 /// width: `i32` -> Width of extract area
4175 ///
4176 /// height: `i32` -> Height of extract area
4177 pub fn crop(&self, left: i32, top: i32, width: i32, height: i32) -> Result<VipsImage> {
4178 let mut out_out = VipsImage::from(null_mut());
4179 let vips_op_response = call(
4180 "crop",
4181 VOption::new()
4182 .set(
4183 "input",
4184 self,
4185 )
4186 .set(
4187 "out",
4188 &mut out_out,
4189 )
4190 .set(
4191 "left",
4192 left,
4193 )
4194 .set("top", top)
4195 .set(
4196 "width",
4197 width,
4198 )
4199 .set(
4200 "height",
4201 height,
4202 ),
4203 );
4204
4205 utils::result(
4206 vips_op_response,
4207 out_out,
4208 Error::OperationError("Crop (vips_crop) failed".to_string()),
4209 )
4210 }
4211
4212 /// VipsExtractBand (extract_band), extract band from an image
4213 /// returns `VipsImage` - Output image
4214 ///
4215 /// band: `i32` -> Band to extract
4216 pub fn extract_band(&self, band: i32) -> Result<VipsImage> {
4217 let mut out_out = VipsImage::from(null_mut());
4218 let vips_op_response = call(
4219 "extract_band",
4220 VOption::new()
4221 .set("in", self)
4222 .set(
4223 "out",
4224 &mut out_out,
4225 )
4226 .set(
4227 "band",
4228 band,
4229 ),
4230 );
4231
4232 utils::result(
4233 vips_op_response,
4234 out_out,
4235 Error::OperationError("ExtractBand (vips_extract_band) failed".to_string()),
4236 )
4237 }
4238
4239 /// VipsExtractBand (extract_band), extract band from an image
4240 /// returns `VipsImage` - Output image
4241 ///
4242 /// band: `i32` -> Band to extract
4243 ///
4244 /// <ins>Optional arguments</ins>
4245 ///
4246 /// n: `i32` -> Number of bands to extract
4247 pub fn extract_band_with_opts(&self, band: i32, option: VOption) -> Result<VipsImage> {
4248 let mut out_out = VipsImage::from(null_mut());
4249 let vips_op_response = call(
4250 "extract_band",
4251 option
4252 .set("in", self)
4253 .set(
4254 "out",
4255 &mut out_out,
4256 )
4257 .set(
4258 "band",
4259 band,
4260 ),
4261 );
4262
4263 utils::result(
4264 vips_op_response,
4265 out_out,
4266 Error::OperationError("ExtractBand (vips_extract_band) failed".to_string()),
4267 )
4268 }
4269
4270 /// VipsEye (eye), make an image showing the eye's spatial response
4271 /// returns `VipsImage` - Output image
4272 ///
4273 /// width: `i32` -> Image width in pixels
4274 ///
4275 /// height: `i32` -> Image height in pixels
4276 pub fn eye(width: i32, height: i32) -> Result<VipsImage> {
4277 let mut out_out = VipsImage::from(null_mut());
4278 let vips_op_response = call(
4279 "eye",
4280 VOption::new()
4281 .set(
4282 "out",
4283 &mut out_out,
4284 )
4285 .set(
4286 "width",
4287 width,
4288 )
4289 .set(
4290 "height",
4291 height,
4292 ),
4293 );
4294
4295 utils::result(
4296 vips_op_response,
4297 out_out,
4298 Error::OperationError("Eye (vips_eye) failed".to_string()),
4299 )
4300 }
4301
4302 /// VipsEye (eye), make an image showing the eye's spatial response
4303 /// returns `VipsImage` - Output image
4304 ///
4305 /// width: `i32` -> Image width in pixels
4306 ///
4307 /// height: `i32` -> Image height in pixels
4308 ///
4309 /// <ins>Optional arguments</ins>
4310 ///
4311 /// uchar: `bool` -> Output an unsigned char image
4312 ///
4313 /// factor: `f64` -> Maximum spatial frequency
4314 pub fn eye_with_opts(width: i32, height: i32, option: VOption) -> Result<VipsImage> {
4315 let mut out_out = VipsImage::from(null_mut());
4316 let vips_op_response = call(
4317 "eye",
4318 option
4319 .set(
4320 "out",
4321 &mut out_out,
4322 )
4323 .set(
4324 "width",
4325 width,
4326 )
4327 .set(
4328 "height",
4329 height,
4330 ),
4331 );
4332
4333 utils::result(
4334 vips_op_response,
4335 out_out,
4336 Error::OperationError("Eye (vips_eye) failed".to_string()),
4337 )
4338 }
4339
4340 /// VipsFalsecolour (falsecolour), false-color an image
4341 /// returns `VipsImage` - Output image
4342 pub fn falsecolour(&self) -> Result<VipsImage> {
4343 let mut out_out = VipsImage::from(null_mut());
4344 let vips_op_response = call(
4345 "falsecolour",
4346 VOption::new()
4347 .set("in", self)
4348 .set(
4349 "out",
4350 &mut out_out,
4351 ),
4352 );
4353
4354 utils::result(
4355 vips_op_response,
4356 out_out,
4357 Error::OperationError("Falsecolour (vips_falsecolour) failed".to_string()),
4358 )
4359 }
4360
4361 /// VipsFastcor (fastcor), fast correlation
4362 /// returns `VipsImage` - Output image
4363 ///
4364 /// refp: `&VipsImage` -> Input reference image
4365 pub fn fastcor(&self, refp: &VipsImage) -> Result<VipsImage> {
4366 let mut out_out = VipsImage::from(null_mut());
4367 let vips_op_response = call(
4368 "fastcor",
4369 VOption::new()
4370 .set("in", self)
4371 .set(
4372 "ref", refp,
4373 )
4374 .set(
4375 "out",
4376 &mut out_out,
4377 ),
4378 );
4379
4380 utils::result(
4381 vips_op_response,
4382 out_out,
4383 Error::OperationError("Fastcor (vips_fastcor) failed".to_string()),
4384 )
4385 }
4386
4387 /// VipsFillNearest (fill_nearest), fill image zeros with nearest non-zero pixel
4388 /// returns `VipsImage` - Value of nearest non-zero pixel
4389 pub fn fill_nearest(&self) -> Result<VipsImage> {
4390 let mut out_out = VipsImage::from(null_mut());
4391 let vips_op_response = call(
4392 "fill_nearest",
4393 VOption::new()
4394 .set("in", self)
4395 .set(
4396 "out",
4397 &mut out_out,
4398 ),
4399 );
4400
4401 utils::result(
4402 vips_op_response,
4403 out_out,
4404 Error::OperationError("FillNearest (vips_fill_nearest) failed".to_string()),
4405 )
4406 }
4407
4408 /// VipsFillNearest (fill_nearest), fill image zeros with nearest non-zero pixel
4409 /// returns `VipsImage` - Value of nearest non-zero pixel
4410 ///
4411 /// <ins>Optional arguments</ins>
4412 ///
4413 /// distance: `&mut VipsImage` -> Distance to nearest non-zero pixel
4414 pub fn fill_nearest_with_opts(&self, option: VOption) -> Result<VipsImage> {
4415 let mut out_out = VipsImage::from(null_mut());
4416 let vips_op_response = call(
4417 "fill_nearest",
4418 option
4419 .set("in", self)
4420 .set(
4421 "out",
4422 &mut out_out,
4423 ),
4424 );
4425
4426 utils::result(
4427 vips_op_response,
4428 out_out,
4429 Error::OperationError("FillNearest (vips_fill_nearest) failed".to_string()),
4430 )
4431 }
4432
4433 /// VipsFindTrim (find_trim), search an image for non-edge areas
4434 /// Tuple (
4435 /// i32 - Left edge of image
4436 /// i32 - Top edge of extract area
4437 /// i32 - Width of extract area
4438 /// i32 - Height of extract area
4439 ///)
4440 pub fn find_trim(
4441 &self,
4442 ) -> Result<(
4443 i32,
4444 i32,
4445 i32,
4446 i32,
4447 )> {
4448 let mut left_out: i32 = 1;
4449 let mut top_out: i32 = 0;
4450 let mut width_out: i32 = 1;
4451 let mut height_out: i32 = 1;
4452 let vips_op_response = call(
4453 "find_trim",
4454 VOption::new()
4455 .set("in", self)
4456 .set(
4457 "left",
4458 &mut left_out,
4459 )
4460 .set(
4461 "top",
4462 &mut top_out,
4463 )
4464 .set(
4465 "width",
4466 &mut width_out,
4467 )
4468 .set(
4469 "height",
4470 &mut height_out,
4471 ),
4472 );
4473
4474 utils::result(
4475 vips_op_response,
4476 (
4477 left_out,
4478 top_out,
4479 width_out,
4480 height_out,
4481 ),
4482 Error::OperationError("FindTrim (vips_find_trim) failed".to_string()),
4483 )
4484 }
4485
4486 /// VipsFindTrim (find_trim), search an image for non-edge areas
4487 /// Tuple (
4488 /// i32 - Left edge of image
4489 /// i32 - Top edge of extract area
4490 /// i32 - Width of extract area
4491 /// i32 - Height of extract area
4492 ///)
4493 ///
4494 /// <ins>Optional arguments</ins>
4495 ///
4496 /// threshold: `f64` -> Object threshold
4497 ///
4498 /// background: `&[f64]` -> Color for background pixels
4499 ///
4500 /// line_art: `bool` -> Enable line art mode
4501 pub fn find_trim_with_opts(
4502 &self,
4503 option: VOption,
4504 ) -> Result<(
4505 i32,
4506 i32,
4507 i32,
4508 i32,
4509 )> {
4510 let mut left_out: i32 = 1;
4511 let mut top_out: i32 = 0;
4512 let mut width_out: i32 = 1;
4513 let mut height_out: i32 = 1;
4514 let vips_op_response = call(
4515 "find_trim",
4516 option
4517 .set("in", self)
4518 .set(
4519 "left",
4520 &mut left_out,
4521 )
4522 .set(
4523 "top",
4524 &mut top_out,
4525 )
4526 .set(
4527 "width",
4528 &mut width_out,
4529 )
4530 .set(
4531 "height",
4532 &mut height_out,
4533 ),
4534 );
4535
4536 utils::result(
4537 vips_op_response,
4538 (
4539 left_out,
4540 top_out,
4541 width_out,
4542 height_out,
4543 ),
4544 Error::OperationError("FindTrim (vips_find_trim) failed".to_string()),
4545 )
4546 }
4547
4548 /// VipsForeignLoadFitsFile (fitsload), load a FITS image (.fits, .fit, .fts), priority=-50, untrusted, is_a, get_flags, get_flags_filename, header, load
4549 /// returns `VipsImage` - Output image
4550 ///
4551 /// filename: `&str` -> Filename to load from
4552 pub fn fitsload(filename: &str) -> Result<VipsImage> {
4553 let mut out_out = VipsImage::from(null_mut());
4554 let vips_op_response = call(
4555 "fitsload",
4556 VOption::new()
4557 .set(
4558 "filename",
4559 filename,
4560 )
4561 .set(
4562 "out",
4563 &mut out_out,
4564 ),
4565 );
4566
4567 utils::result(
4568 vips_op_response,
4569 out_out,
4570 Error::OperationError("Fitsload (vips_fitsload) failed".to_string()),
4571 )
4572 }
4573
4574 /// VipsForeignLoadFitsFile (fitsload), load a FITS image (.fits, .fit, .fts), priority=-50, untrusted, is_a, get_flags, get_flags_filename, header, load
4575 /// returns `VipsImage` - Output image
4576 ///
4577 /// filename: `&str` -> Filename to load from
4578 ///
4579 /// <ins>Optional arguments</ins>
4580 ///
4581 /// flags: [`ForeignFlags`] -> Flags for this file
4582 ///
4583 /// memory: `bool` -> Force open via memory
4584 ///
4585 /// access: [`Access`] -> Required access pattern for this file
4586 ///
4587 /// fail_on: [`FailOn`] -> Error level to fail on
4588 ///
4589 /// revalidate: `bool` -> Don't use a cached result for this operation
4590 pub fn fitsload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
4591 let mut out_out = VipsImage::from(null_mut());
4592 let vips_op_response = call(
4593 "fitsload",
4594 option
4595 .set(
4596 "filename",
4597 filename,
4598 )
4599 .set(
4600 "out",
4601 &mut out_out,
4602 ),
4603 );
4604
4605 utils::result(
4606 vips_op_response,
4607 out_out,
4608 Error::OperationError("Fitsload (vips_fitsload) failed".to_string()),
4609 )
4610 }
4611
4612 /// VipsForeignLoadFitsSource (fitsload_source), load FITS from a source, priority=-50, untrusted, is_a, is_a_source, get_flags, get_flags_filename, header, load
4613 /// returns `VipsImage` - Output image
4614 ///
4615 /// source: `&VipsSource` -> Source to load from
4616 pub fn fitsload_source(source: &VipsSource) -> Result<VipsImage> {
4617 let mut out_out = VipsImage::from(null_mut());
4618 let vips_op_response = call(
4619 "fitsload_source",
4620 VOption::new()
4621 .set(
4622 "source",
4623 source,
4624 )
4625 .set(
4626 "out",
4627 &mut out_out,
4628 ),
4629 );
4630
4631 utils::result(
4632 vips_op_response,
4633 out_out,
4634 Error::OperationError("FitsloadSource (vips_fitsload_source) failed".to_string()),
4635 )
4636 }
4637
4638 /// VipsForeignLoadFitsSource (fitsload_source), load FITS from a source, priority=-50, untrusted, is_a, is_a_source, get_flags, get_flags_filename, header, load
4639 /// returns `VipsImage` - Output image
4640 ///
4641 /// source: `&VipsSource` -> Source to load from
4642 ///
4643 /// <ins>Optional arguments</ins>
4644 ///
4645 /// flags: [`ForeignFlags`] -> Flags for this file
4646 ///
4647 /// memory: `bool` -> Force open via memory
4648 ///
4649 /// access: [`Access`] -> Required access pattern for this file
4650 ///
4651 /// fail_on: [`FailOn`] -> Error level to fail on
4652 ///
4653 /// revalidate: `bool` -> Don't use a cached result for this operation
4654 pub fn fitsload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
4655 let mut out_out = VipsImage::from(null_mut());
4656 let vips_op_response = call(
4657 "fitsload_source",
4658 option
4659 .set(
4660 "source",
4661 source,
4662 )
4663 .set(
4664 "out",
4665 &mut out_out,
4666 ),
4667 );
4668
4669 utils::result(
4670 vips_op_response,
4671 out_out,
4672 Error::OperationError("FitsloadSource (vips_fitsload_source) failed".to_string()),
4673 )
4674 }
4675
4676 /// VipsForeignSaveFits (fitssave), save image to fits file (.fits, .fit, .fts), priority=0, untrusted,
4677 ///
4678 /// filename: `&str` -> Filename to save to
4679 pub fn fitssave(&self, filename: &str) -> Result<()> {
4680 let vips_op_response = call(
4681 "fitssave",
4682 VOption::new()
4683 .set("in", self)
4684 .set(
4685 "filename",
4686 filename,
4687 ),
4688 );
4689
4690 utils::result(
4691 vips_op_response,
4692 (),
4693 Error::OperationError("Fitssave (vips_fitssave) failed".to_string()),
4694 )
4695 }
4696
4697 /// VipsForeignSaveFits (fitssave), save image to fits file (.fits, .fit, .fts), priority=0, untrusted,
4698 ///
4699 /// filename: `&str` -> Filename to save to
4700 ///
4701 /// <ins>Optional arguments</ins>
4702 ///
4703 /// keep: [`ForeignKeep`] -> Which metadata to retain
4704 ///
4705 /// background: `&[f64]` -> Background value
4706 ///
4707 /// page_height: `i32` -> Set page height for multipage save
4708 ///
4709 /// profile: `&str` -> Filename of ICC profile to embed
4710 pub fn fitssave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
4711 let vips_op_response = call(
4712 "fitssave",
4713 option
4714 .set("in", self)
4715 .set(
4716 "filename",
4717 filename,
4718 ),
4719 );
4720
4721 utils::result(
4722 vips_op_response,
4723 (),
4724 Error::OperationError("Fitssave (vips_fitssave) failed".to_string()),
4725 )
4726 }
4727
4728 /// VipsFlatten (flatten), flatten alpha out of an image
4729 /// returns `VipsImage` - Output image
4730 pub fn flatten(&self) -> Result<VipsImage> {
4731 let mut out_out = VipsImage::from(null_mut());
4732 let vips_op_response = call(
4733 "flatten",
4734 VOption::new()
4735 .set("in", self)
4736 .set(
4737 "out",
4738 &mut out_out,
4739 ),
4740 );
4741
4742 utils::result(
4743 vips_op_response,
4744 out_out,
4745 Error::OperationError("Flatten (vips_flatten) failed".to_string()),
4746 )
4747 }
4748
4749 /// VipsFlatten (flatten), flatten alpha out of an image
4750 /// returns `VipsImage` - Output image
4751 ///
4752 /// <ins>Optional arguments</ins>
4753 ///
4754 /// background: `&[f64]` -> Background value
4755 ///
4756 /// max_alpha: `f64` -> Maximum value of alpha channel
4757 pub fn flatten_with_opts(&self, option: VOption) -> Result<VipsImage> {
4758 let mut out_out = VipsImage::from(null_mut());
4759 let vips_op_response = call(
4760 "flatten",
4761 option
4762 .set("in", self)
4763 .set(
4764 "out",
4765 &mut out_out,
4766 ),
4767 );
4768
4769 utils::result(
4770 vips_op_response,
4771 out_out,
4772 Error::OperationError("Flatten (vips_flatten) failed".to_string()),
4773 )
4774 }
4775
4776 /// VipsFlip (flip), flip an image
4777 /// returns `VipsImage` - Output image
4778 ///
4779 /// direction: `Direction` -> Direction to flip image
4780 pub fn flip(&self, direction: Direction) -> Result<VipsImage> {
4781 let mut out_out = VipsImage::from(null_mut());
4782 let vips_op_response = call(
4783 "flip",
4784 VOption::new()
4785 .set("in", self)
4786 .set(
4787 "out",
4788 &mut out_out,
4789 )
4790 .set(
4791 "direction",
4792 direction as i32,
4793 ),
4794 );
4795
4796 utils::result(
4797 vips_op_response,
4798 out_out,
4799 Error::OperationError("Flip (vips_flip) failed".to_string()),
4800 )
4801 }
4802
4803 /// VipsFloat2rad (float2rad), transform float RGB to Radiance coding
4804 /// returns `VipsImage` - Output image
4805 pub fn float2rad(&self) -> Result<VipsImage> {
4806 let mut out_out = VipsImage::from(null_mut());
4807 let vips_op_response = call(
4808 "float2rad",
4809 VOption::new()
4810 .set("in", self)
4811 .set(
4812 "out",
4813 &mut out_out,
4814 ),
4815 );
4816
4817 utils::result(
4818 vips_op_response,
4819 out_out,
4820 Error::OperationError("Float2Rad (vips_float2rad) failed".to_string()),
4821 )
4822 }
4823
4824 /// VipsFractsurf (fractsurf), make a fractal surface
4825 /// returns `VipsImage` - Output image
4826 ///
4827 /// width: `i32` -> Image width in pixels
4828 ///
4829 /// height: `i32` -> Image height in pixels
4830 ///
4831 /// fractal_dimension: `f64` -> Fractal dimension
4832 pub fn fractsurf(width: i32, height: i32, fractal_dimension: f64) -> Result<VipsImage> {
4833 let mut out_out = VipsImage::from(null_mut());
4834 let vips_op_response = call(
4835 "fractsurf",
4836 VOption::new()
4837 .set(
4838 "out",
4839 &mut out_out,
4840 )
4841 .set(
4842 "width",
4843 width,
4844 )
4845 .set(
4846 "height",
4847 height,
4848 )
4849 .set(
4850 "fractal-dimension",
4851 fractal_dimension,
4852 ),
4853 );
4854
4855 utils::result(
4856 vips_op_response,
4857 out_out,
4858 Error::OperationError("Fractsurf (vips_fractsurf) failed".to_string()),
4859 )
4860 }
4861
4862 /// VipsFreqmult (freqmult), frequency-domain filtering
4863 /// returns `VipsImage` - Output image
4864 ///
4865 /// mask: `&VipsImage` -> Input mask image
4866 pub fn freqmult(&self, mask: &VipsImage) -> Result<VipsImage> {
4867 let mut out_out = VipsImage::from(null_mut());
4868 let vips_op_response = call(
4869 "freqmult",
4870 VOption::new()
4871 .set("in", self)
4872 .set(
4873 "mask",
4874 mask,
4875 )
4876 .set(
4877 "out",
4878 &mut out_out,
4879 ),
4880 );
4881
4882 utils::result(
4883 vips_op_response,
4884 out_out,
4885 Error::OperationError("Freqmult (vips_freqmult) failed".to_string()),
4886 )
4887 }
4888
4889 /// VipsFwfft (fwfft), forward FFT
4890 /// returns `VipsImage` - Output image
4891 pub fn fwfft(&self) -> Result<VipsImage> {
4892 let mut out_out = VipsImage::from(null_mut());
4893 let vips_op_response = call(
4894 "fwfft",
4895 VOption::new()
4896 .set("in", self)
4897 .set(
4898 "out",
4899 &mut out_out,
4900 ),
4901 );
4902
4903 utils::result(
4904 vips_op_response,
4905 out_out,
4906 Error::OperationError("Fwfft (vips_fwfft) failed".to_string()),
4907 )
4908 }
4909
4910 /// VipsGamma (gamma), gamma an image
4911 /// returns `VipsImage` - Output image
4912 pub fn gamma(&self) -> Result<VipsImage> {
4913 let mut out_out = VipsImage::from(null_mut());
4914 let vips_op_response = call(
4915 "gamma",
4916 VOption::new()
4917 .set("in", self)
4918 .set(
4919 "out",
4920 &mut out_out,
4921 ),
4922 );
4923
4924 utils::result(
4925 vips_op_response,
4926 out_out,
4927 Error::OperationError("Gamma (vips_gamma) failed".to_string()),
4928 )
4929 }
4930
4931 /// VipsGamma (gamma), gamma an image
4932 /// returns `VipsImage` - Output image
4933 ///
4934 /// <ins>Optional arguments</ins>
4935 ///
4936 /// exponent: `f64` -> Gamma factor
4937 pub fn gamma_with_opts(&self, option: VOption) -> Result<VipsImage> {
4938 let mut out_out = VipsImage::from(null_mut());
4939 let vips_op_response = call(
4940 "gamma",
4941 option
4942 .set("in", self)
4943 .set(
4944 "out",
4945 &mut out_out,
4946 ),
4947 );
4948
4949 utils::result(
4950 vips_op_response,
4951 out_out,
4952 Error::OperationError("Gamma (vips_gamma) failed".to_string()),
4953 )
4954 }
4955
4956 /// VipsGaussblur (gaussblur), gaussian blur
4957 /// returns `VipsImage` - Output image
4958 ///
4959 /// sigma: `f64` -> Sigma of Gaussian
4960 pub fn gaussblur(&self, sigma: f64) -> Result<VipsImage> {
4961 let mut out_out = VipsImage::from(null_mut());
4962 let vips_op_response = call(
4963 "gaussblur",
4964 VOption::new()
4965 .set("in", self)
4966 .set(
4967 "out",
4968 &mut out_out,
4969 )
4970 .set(
4971 "sigma",
4972 sigma,
4973 ),
4974 );
4975
4976 utils::result(
4977 vips_op_response,
4978 out_out,
4979 Error::OperationError("Gaussblur (vips_gaussblur) failed".to_string()),
4980 )
4981 }
4982
4983 /// VipsGaussblur (gaussblur), gaussian blur
4984 /// returns `VipsImage` - Output image
4985 ///
4986 /// sigma: `f64` -> Sigma of Gaussian
4987 ///
4988 /// <ins>Optional arguments</ins>
4989 ///
4990 /// min_ampl: `f64` -> Minimum amplitude of Gaussian
4991 ///
4992 /// precision: [`Precision`] -> Convolve with this precision
4993 pub fn gaussblur_with_opts(&self, sigma: f64, option: VOption) -> Result<VipsImage> {
4994 let mut out_out = VipsImage::from(null_mut());
4995 let vips_op_response = call(
4996 "gaussblur",
4997 option
4998 .set("in", self)
4999 .set(
5000 "out",
5001 &mut out_out,
5002 )
5003 .set(
5004 "sigma",
5005 sigma,
5006 ),
5007 );
5008
5009 utils::result(
5010 vips_op_response,
5011 out_out,
5012 Error::OperationError("Gaussblur (vips_gaussblur) failed".to_string()),
5013 )
5014 }
5015
5016 /// VipsGaussmat (gaussmat), make a gaussian image
5017 /// returns `VipsImage` - Output image
5018 ///
5019 /// sigma: `f64` -> Sigma of Gaussian
5020 ///
5021 /// min_ampl: `f64` -> Minimum amplitude of Gaussian
5022 pub fn gaussmat(sigma: f64, min_ampl: f64) -> Result<VipsImage> {
5023 let mut out_out = VipsImage::from(null_mut());
5024 let vips_op_response = call(
5025 "gaussmat",
5026 VOption::new()
5027 .set(
5028 "out",
5029 &mut out_out,
5030 )
5031 .set(
5032 "sigma",
5033 sigma,
5034 )
5035 .set(
5036 "min-ampl",
5037 min_ampl,
5038 ),
5039 );
5040
5041 utils::result(
5042 vips_op_response,
5043 out_out,
5044 Error::OperationError("Gaussmat (vips_gaussmat) failed".to_string()),
5045 )
5046 }
5047
5048 /// VipsGaussmat (gaussmat), make a gaussian image
5049 /// returns `VipsImage` - Output image
5050 ///
5051 /// sigma: `f64` -> Sigma of Gaussian
5052 ///
5053 /// min_ampl: `f64` -> Minimum amplitude of Gaussian
5054 ///
5055 /// <ins>Optional arguments</ins>
5056 ///
5057 /// separable: `bool` -> Generate separable Gaussian
5058 ///
5059 /// precision: [`Precision`] -> Generate with this precision
5060 pub fn gaussmat_with_opts(sigma: f64, min_ampl: f64, option: VOption) -> Result<VipsImage> {
5061 let mut out_out = VipsImage::from(null_mut());
5062 let vips_op_response = call(
5063 "gaussmat",
5064 option
5065 .set(
5066 "out",
5067 &mut out_out,
5068 )
5069 .set(
5070 "sigma",
5071 sigma,
5072 )
5073 .set(
5074 "min-ampl",
5075 min_ampl,
5076 ),
5077 );
5078
5079 utils::result(
5080 vips_op_response,
5081 out_out,
5082 Error::OperationError("Gaussmat (vips_gaussmat) failed".to_string()),
5083 )
5084 }
5085
5086 /// VipsGaussnoise (gaussnoise), make a gaussnoise image
5087 /// returns `VipsImage` - Output image
5088 ///
5089 /// width: `i32` -> Image width in pixels
5090 ///
5091 /// height: `i32` -> Image height in pixels
5092 pub fn gaussnoise(width: i32, height: i32) -> Result<VipsImage> {
5093 let mut out_out = VipsImage::from(null_mut());
5094 let vips_op_response = call(
5095 "gaussnoise",
5096 VOption::new()
5097 .set(
5098 "out",
5099 &mut out_out,
5100 )
5101 .set(
5102 "width",
5103 width,
5104 )
5105 .set(
5106 "height",
5107 height,
5108 ),
5109 );
5110
5111 utils::result(
5112 vips_op_response,
5113 out_out,
5114 Error::OperationError("Gaussnoise (vips_gaussnoise) failed".to_string()),
5115 )
5116 }
5117
5118 /// VipsGaussnoise (gaussnoise), make a gaussnoise image
5119 /// returns `VipsImage` - Output image
5120 ///
5121 /// width: `i32` -> Image width in pixels
5122 ///
5123 /// height: `i32` -> Image height in pixels
5124 ///
5125 /// <ins>Optional arguments</ins>
5126 ///
5127 /// sigma: `f64` -> Standard deviation of pixels in generated image
5128 ///
5129 /// mean: `f64` -> Mean of pixels in generated image
5130 ///
5131 /// seed: `i32` -> Random number seed
5132 pub fn gaussnoise_with_opts(width: i32, height: i32, option: VOption) -> Result<VipsImage> {
5133 let mut out_out = VipsImage::from(null_mut());
5134 let vips_op_response = call(
5135 "gaussnoise",
5136 option
5137 .set(
5138 "out",
5139 &mut out_out,
5140 )
5141 .set(
5142 "width",
5143 width,
5144 )
5145 .set(
5146 "height",
5147 height,
5148 ),
5149 );
5150
5151 utils::result(
5152 vips_op_response,
5153 out_out,
5154 Error::OperationError("Gaussnoise (vips_gaussnoise) failed".to_string()),
5155 )
5156 }
5157
5158 /// VipsGetpoint (getpoint), read a point from an image
5159 /// returns `Vec<f64>` - Array of output values
5160 ///
5161 /// x: `i32` -> Point to read
5162 ///
5163 /// y: `i32` -> Point to read
5164 pub fn getpoint(&self, x: i32, y: i32) -> Result<Vec<f64>> {
5165 let mut out_array_out: Vec<f64> = Vec::new();
5166 let vips_op_response = call(
5167 "getpoint",
5168 VOption::new()
5169 .set("in", self)
5170 .set(
5171 "out-array",
5172 &mut out_array_out,
5173 )
5174 .set("x", x)
5175 .set("y", y),
5176 );
5177
5178 utils::result(
5179 vips_op_response,
5180 out_array_out,
5181 Error::OperationError("Getpoint (vips_getpoint) failed".to_string()),
5182 )
5183 }
5184
5185 /// VipsGetpoint (getpoint), read a point from an image
5186 /// returns `Vec<f64>` - Array of output values
5187 ///
5188 /// x: `i32` -> Point to read
5189 ///
5190 /// y: `i32` -> Point to read
5191 ///
5192 /// <ins>Optional arguments</ins>
5193 ///
5194 /// unpack_complex: `bool` -> Complex pixels should be unpacked
5195 pub fn getpoint_with_opts(&self, x: i32, y: i32, option: VOption) -> Result<Vec<f64>> {
5196 let mut out_array_out: Vec<f64> = Vec::new();
5197 let vips_op_response = call(
5198 "getpoint",
5199 option
5200 .set("in", self)
5201 .set(
5202 "out-array",
5203 &mut out_array_out,
5204 )
5205 .set("x", x)
5206 .set("y", y),
5207 );
5208
5209 utils::result(
5210 vips_op_response,
5211 out_array_out,
5212 Error::OperationError("Getpoint (vips_getpoint) failed".to_string()),
5213 )
5214 }
5215
5216 /// VipsForeignLoadNsgifFile (gifload), load GIF with libnsgif (.gif), priority=50, is_a, get_flags, get_flags_filename, header, load
5217 /// returns `VipsImage` - Output image
5218 ///
5219 /// filename: `&str` -> Filename to load from
5220 pub fn gifload(filename: &str) -> Result<VipsImage> {
5221 let mut out_out = VipsImage::from(null_mut());
5222 let vips_op_response = call(
5223 "gifload",
5224 VOption::new()
5225 .set(
5226 "filename",
5227 filename,
5228 )
5229 .set(
5230 "out",
5231 &mut out_out,
5232 ),
5233 );
5234
5235 utils::result(
5236 vips_op_response,
5237 out_out,
5238 Error::OperationError("Gifload (vips_gifload) failed".to_string()),
5239 )
5240 }
5241
5242 /// VipsForeignLoadNsgifFile (gifload), load GIF with libnsgif (.gif), priority=50, is_a, get_flags, get_flags_filename, header, load
5243 /// returns `VipsImage` - Output image
5244 ///
5245 /// filename: `&str` -> Filename to load from
5246 ///
5247 /// <ins>Optional arguments</ins>
5248 ///
5249 /// n: `i32` -> Number of pages to load, -1 for all
5250 ///
5251 /// page: `i32` -> First page to load
5252 ///
5253 /// flags: [`ForeignFlags`] -> Flags for this file
5254 ///
5255 /// memory: `bool` -> Force open via memory
5256 ///
5257 /// access: [`Access`] -> Required access pattern for this file
5258 ///
5259 /// fail_on: [`FailOn`] -> Error level to fail on
5260 ///
5261 /// revalidate: `bool` -> Don't use a cached result for this operation
5262 pub fn gifload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
5263 let mut out_out = VipsImage::from(null_mut());
5264 let vips_op_response = call(
5265 "gifload",
5266 option
5267 .set(
5268 "filename",
5269 filename,
5270 )
5271 .set(
5272 "out",
5273 &mut out_out,
5274 ),
5275 );
5276
5277 utils::result(
5278 vips_op_response,
5279 out_out,
5280 Error::OperationError("Gifload (vips_gifload) failed".to_string()),
5281 )
5282 }
5283
5284 /// VipsForeignLoadNsgifBuffer (gifload_buffer), load GIF with libnsgif, priority=50, is_a_buffer, get_flags, get_flags_filename, header, load
5285 /// returns `VipsImage` - Output image
5286 ///
5287 /// buffer: `&[u8]` -> Buffer to load from
5288 pub fn gifload_buffer(buffer: &[u8]) -> Result<VipsImage> {
5289 let vips_blob = unsafe {
5290 vips_blob_new(
5291 None,
5292 buffer.as_ptr() as _,
5293 buffer.len() as _,
5294 )
5295 };
5296 let blob = VipsBlob::from(vips_blob);
5297 let mut out_out = VipsImage::from(null_mut());
5298 let vips_op_response = call(
5299 "gifload_buffer",
5300 VOption::new()
5301 .set(
5302 "buffer",
5303 &blob,
5304 )
5305 .set(
5306 "out",
5307 &mut out_out,
5308 ),
5309 );
5310 blob.area_unref();
5311 utils::result(
5312 vips_op_response,
5313 out_out,
5314 Error::OperationError("GifloadBuffer (vips_gifload_buffer) failed".to_string()),
5315 )
5316 }
5317
5318 /// VipsForeignLoadNsgifBuffer (gifload_buffer), load GIF with libnsgif, priority=50, is_a_buffer, get_flags, get_flags_filename, header, load
5319 /// returns `VipsImage` - Output image
5320 ///
5321 /// buffer: `&[u8]` -> Buffer to load from
5322 ///
5323 /// <ins>Optional arguments</ins>
5324 ///
5325 /// n: `i32` -> Number of pages to load, -1 for all
5326 ///
5327 /// page: `i32` -> First page to load
5328 ///
5329 /// flags: [`ForeignFlags`] -> Flags for this file
5330 ///
5331 /// memory: `bool` -> Force open via memory
5332 ///
5333 /// access: [`Access`] -> Required access pattern for this file
5334 ///
5335 /// fail_on: [`FailOn`] -> Error level to fail on
5336 ///
5337 /// revalidate: `bool` -> Don't use a cached result for this operation
5338 pub fn gifload_buffer_with_opts(buffer: &[u8], option: VOption) -> Result<VipsImage> {
5339 let vips_blob = unsafe {
5340 vips_blob_new(
5341 None,
5342 buffer.as_ptr() as _,
5343 buffer.len() as _,
5344 )
5345 };
5346 let blob = VipsBlob::from(vips_blob);
5347 let mut out_out = VipsImage::from(null_mut());
5348 let vips_op_response = call(
5349 "gifload_buffer",
5350 option
5351 .set(
5352 "buffer",
5353 &blob,
5354 )
5355 .set(
5356 "out",
5357 &mut out_out,
5358 ),
5359 );
5360 blob.area_unref();
5361 utils::result(
5362 vips_op_response,
5363 out_out,
5364 Error::OperationError("GifloadBuffer (vips_gifload_buffer) failed".to_string()),
5365 )
5366 }
5367
5368 /// VipsForeignLoadNsgifSource (gifload_source), load gif from source, priority=50, is_a_source, get_flags, get_flags_filename, header, load
5369 /// returns `VipsImage` - Output image
5370 ///
5371 /// source: `&VipsSource` -> Source to load from
5372 pub fn gifload_source(source: &VipsSource) -> Result<VipsImage> {
5373 let mut out_out = VipsImage::from(null_mut());
5374 let vips_op_response = call(
5375 "gifload_source",
5376 VOption::new()
5377 .set(
5378 "source",
5379 source,
5380 )
5381 .set(
5382 "out",
5383 &mut out_out,
5384 ),
5385 );
5386
5387 utils::result(
5388 vips_op_response,
5389 out_out,
5390 Error::OperationError("GifloadSource (vips_gifload_source) failed".to_string()),
5391 )
5392 }
5393
5394 /// VipsForeignLoadNsgifSource (gifload_source), load gif from source, priority=50, is_a_source, get_flags, get_flags_filename, header, load
5395 /// returns `VipsImage` - Output image
5396 ///
5397 /// source: `&VipsSource` -> Source to load from
5398 ///
5399 /// <ins>Optional arguments</ins>
5400 ///
5401 /// n: `i32` -> Number of pages to load, -1 for all
5402 ///
5403 /// page: `i32` -> First page to load
5404 ///
5405 /// flags: [`ForeignFlags`] -> Flags for this file
5406 ///
5407 /// memory: `bool` -> Force open via memory
5408 ///
5409 /// access: [`Access`] -> Required access pattern for this file
5410 ///
5411 /// fail_on: [`FailOn`] -> Error level to fail on
5412 ///
5413 /// revalidate: `bool` -> Don't use a cached result for this operation
5414 pub fn gifload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
5415 let mut out_out = VipsImage::from(null_mut());
5416 let vips_op_response = call(
5417 "gifload_source",
5418 option
5419 .set(
5420 "source",
5421 source,
5422 )
5423 .set(
5424 "out",
5425 &mut out_out,
5426 ),
5427 );
5428
5429 utils::result(
5430 vips_op_response,
5431 out_out,
5432 Error::OperationError("GifloadSource (vips_gifload_source) failed".to_string()),
5433 )
5434 }
5435
5436 /// VipsForeignSaveCgifFile (gifsave), save as gif (.gif), priority=0, rgb alpha
5437 ///
5438 /// filename: `&str` -> Filename to save to
5439 pub fn gifsave(&self, filename: &str) -> Result<()> {
5440 let vips_op_response = call(
5441 "gifsave",
5442 VOption::new()
5443 .set("in", self)
5444 .set(
5445 "filename",
5446 filename,
5447 ),
5448 );
5449
5450 utils::result(
5451 vips_op_response,
5452 (),
5453 Error::OperationError("Gifsave (vips_gifsave) failed".to_string()),
5454 )
5455 }
5456
5457 /// VipsForeignSaveCgifFile (gifsave), save as gif (.gif), priority=0, rgb alpha
5458 ///
5459 /// filename: `&str` -> Filename to save to
5460 ///
5461 /// <ins>Optional arguments</ins>
5462 ///
5463 /// dither: `f64` -> Amount of dithering
5464 ///
5465 /// effort: `i32` -> Quantisation effort
5466 ///
5467 /// bitdepth: `i32` -> Number of bits per pixel
5468 ///
5469 /// interframe_maxerror: `f64` -> Maximum inter-frame error for transparency
5470 ///
5471 /// reuse: `bool` -> Reuse palette from input
5472 ///
5473 /// interpalette_maxerror: `f64` -> Maximum inter-palette error for palette reusage
5474 ///
5475 /// interlace: `bool` -> Generate an interlaced (progressive) GIF
5476 ///
5477 /// keep_duplicate_frames: `bool` -> Keep duplicate frames in the output instead of combining them
5478 ///
5479 /// keep: [`ForeignKeep`] -> Which metadata to retain
5480 ///
5481 /// background: `&[f64]` -> Background value
5482 ///
5483 /// page_height: `i32` -> Set page height for multipage save
5484 ///
5485 /// profile: `&str` -> Filename of ICC profile to embed
5486 pub fn gifsave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
5487 let vips_op_response = call(
5488 "gifsave",
5489 option
5490 .set("in", self)
5491 .set(
5492 "filename",
5493 filename,
5494 ),
5495 );
5496
5497 utils::result(
5498 vips_op_response,
5499 (),
5500 Error::OperationError("Gifsave (vips_gifsave) failed".to_string()),
5501 )
5502 }
5503
5504 /// VipsForeignSaveCgifBuffer (gifsave_buffer), save as gif (.gif), priority=0, rgb alpha
5505 /// returns `Vec<u8>` - Buffer to save to
5506 pub fn gifsave_buffer(&self) -> Result<Vec<u8>> {
5507 let mut buffer_out = VipsBlob::from(null_mut());
5508 let vips_op_response = call(
5509 "gifsave_buffer",
5510 VOption::new()
5511 .set("in", self)
5512 .set(
5513 "buffer",
5514 &mut buffer_out,
5515 ),
5516 );
5517
5518 utils::result(
5519 vips_op_response,
5520 buffer_out.into(),
5521 Error::OperationError("GifsaveBuffer (vips_gifsave_buffer) failed".to_string()),
5522 )
5523 }
5524
5525 /// VipsForeignSaveCgifBuffer (gifsave_buffer), save as gif (.gif), priority=0, rgb alpha
5526 /// returns `Vec<u8>` - Buffer to save to
5527 ///
5528 /// <ins>Optional arguments</ins>
5529 ///
5530 /// dither: `f64` -> Amount of dithering
5531 ///
5532 /// effort: `i32` -> Quantisation effort
5533 ///
5534 /// bitdepth: `i32` -> Number of bits per pixel
5535 ///
5536 /// interframe_maxerror: `f64` -> Maximum inter-frame error for transparency
5537 ///
5538 /// reuse: `bool` -> Reuse palette from input
5539 ///
5540 /// interpalette_maxerror: `f64` -> Maximum inter-palette error for palette reusage
5541 ///
5542 /// interlace: `bool` -> Generate an interlaced (progressive) GIF
5543 ///
5544 /// keep_duplicate_frames: `bool` -> Keep duplicate frames in the output instead of combining them
5545 ///
5546 /// keep: [`ForeignKeep`] -> Which metadata to retain
5547 ///
5548 /// background: `&[f64]` -> Background value
5549 ///
5550 /// page_height: `i32` -> Set page height for multipage save
5551 ///
5552 /// profile: `&str` -> Filename of ICC profile to embed
5553 pub fn gifsave_buffer_with_opts(&self, option: VOption) -> Result<Vec<u8>> {
5554 let mut buffer_out = VipsBlob::from(null_mut());
5555 let vips_op_response = call(
5556 "gifsave_buffer",
5557 option
5558 .set("in", self)
5559 .set(
5560 "buffer",
5561 &mut buffer_out,
5562 ),
5563 );
5564
5565 utils::result(
5566 vips_op_response,
5567 buffer_out.into(),
5568 Error::OperationError("GifsaveBuffer (vips_gifsave_buffer) failed".to_string()),
5569 )
5570 }
5571
5572 /// VipsForeignSaveCgifTarget (gifsave_target), save as gif (.gif), priority=0, rgb alpha
5573 ///
5574 /// target: `&VipsTarget` -> Target to save to
5575 pub fn gifsave_target(&self, target: &VipsTarget) -> Result<()> {
5576 let vips_op_response = call(
5577 "gifsave_target",
5578 VOption::new()
5579 .set("in", self)
5580 .set(
5581 "target",
5582 target,
5583 ),
5584 );
5585
5586 utils::result(
5587 vips_op_response,
5588 (),
5589 Error::OperationError("GifsaveTarget (vips_gifsave_target) failed".to_string()),
5590 )
5591 }
5592
5593 /// VipsForeignSaveCgifTarget (gifsave_target), save as gif (.gif), priority=0, rgb alpha
5594 ///
5595 /// target: `&VipsTarget` -> Target to save to
5596 ///
5597 /// <ins>Optional arguments</ins>
5598 ///
5599 /// dither: `f64` -> Amount of dithering
5600 ///
5601 /// effort: `i32` -> Quantisation effort
5602 ///
5603 /// bitdepth: `i32` -> Number of bits per pixel
5604 ///
5605 /// interframe_maxerror: `f64` -> Maximum inter-frame error for transparency
5606 ///
5607 /// reuse: `bool` -> Reuse palette from input
5608 ///
5609 /// interpalette_maxerror: `f64` -> Maximum inter-palette error for palette reusage
5610 ///
5611 /// interlace: `bool` -> Generate an interlaced (progressive) GIF
5612 ///
5613 /// keep_duplicate_frames: `bool` -> Keep duplicate frames in the output instead of combining them
5614 ///
5615 /// keep: [`ForeignKeep`] -> Which metadata to retain
5616 ///
5617 /// background: `&[f64]` -> Background value
5618 ///
5619 /// page_height: `i32` -> Set page height for multipage save
5620 ///
5621 /// profile: `&str` -> Filename of ICC profile to embed
5622 pub fn gifsave_target_with_opts(&self, target: &VipsTarget, option: VOption) -> Result<()> {
5623 let vips_op_response = call(
5624 "gifsave_target",
5625 option
5626 .set("in", self)
5627 .set(
5628 "target",
5629 target,
5630 ),
5631 );
5632
5633 utils::result(
5634 vips_op_response,
5635 (),
5636 Error::OperationError("GifsaveTarget (vips_gifsave_target) failed".to_string()),
5637 )
5638 }
5639
5640 /// VipsGlobalbalance (globalbalance), global balance an image mosaic
5641 /// returns `VipsImage` - Output image
5642 pub fn globalbalance(&self) -> Result<VipsImage> {
5643 let mut out_out = VipsImage::from(null_mut());
5644 let vips_op_response = call(
5645 "globalbalance",
5646 VOption::new()
5647 .set("in", self)
5648 .set(
5649 "out",
5650 &mut out_out,
5651 ),
5652 );
5653
5654 utils::result(
5655 vips_op_response,
5656 out_out,
5657 Error::OperationError("Globalbalance (vips_globalbalance) failed".to_string()),
5658 )
5659 }
5660
5661 /// VipsGlobalbalance (globalbalance), global balance an image mosaic
5662 /// returns `VipsImage` - Output image
5663 ///
5664 /// <ins>Optional arguments</ins>
5665 ///
5666 /// gamma: `f64` -> Image gamma
5667 ///
5668 /// int_output: `bool` -> Integer output
5669 pub fn globalbalance_with_opts(&self, option: VOption) -> Result<VipsImage> {
5670 let mut out_out = VipsImage::from(null_mut());
5671 let vips_op_response = call(
5672 "globalbalance",
5673 option
5674 .set("in", self)
5675 .set(
5676 "out",
5677 &mut out_out,
5678 ),
5679 );
5680
5681 utils::result(
5682 vips_op_response,
5683 out_out,
5684 Error::OperationError("Globalbalance (vips_globalbalance) failed".to_string()),
5685 )
5686 }
5687
5688 /// VipsGravity (gravity), place an image within a larger image with a certain gravity
5689 /// returns `VipsImage` - Output image
5690 ///
5691 /// direction: `CompassDirection` -> Direction to place image within width/height
5692 ///
5693 /// width: `i32` -> Image width in pixels
5694 ///
5695 /// height: `i32` -> Image height in pixels
5696 pub fn gravity(
5697 &self,
5698 direction: CompassDirection,
5699 width: i32,
5700 height: i32,
5701 ) -> Result<VipsImage> {
5702 let mut out_out = VipsImage::from(null_mut());
5703 let vips_op_response = call(
5704 "gravity",
5705 VOption::new()
5706 .set("in", self)
5707 .set(
5708 "out",
5709 &mut out_out,
5710 )
5711 .set(
5712 "direction",
5713 direction as i32,
5714 )
5715 .set(
5716 "width",
5717 width,
5718 )
5719 .set(
5720 "height",
5721 height,
5722 ),
5723 );
5724
5725 utils::result(
5726 vips_op_response,
5727 out_out,
5728 Error::OperationError("Gravity (vips_gravity) failed".to_string()),
5729 )
5730 }
5731
5732 /// VipsGravity (gravity), place an image within a larger image with a certain gravity
5733 /// returns `VipsImage` - Output image
5734 ///
5735 /// direction: `CompassDirection` -> Direction to place image within width/height
5736 ///
5737 /// width: `i32` -> Image width in pixels
5738 ///
5739 /// height: `i32` -> Image height in pixels
5740 ///
5741 /// <ins>Optional arguments</ins>
5742 ///
5743 /// extend: [`Extend`] -> How to generate the extra pixels
5744 ///
5745 /// background: `&[f64]` -> Color for background pixels
5746 pub fn gravity_with_opts(
5747 &self,
5748 direction: CompassDirection,
5749 width: i32,
5750 height: i32,
5751 option: VOption,
5752 ) -> Result<VipsImage> {
5753 let mut out_out = VipsImage::from(null_mut());
5754 let vips_op_response = call(
5755 "gravity",
5756 option
5757 .set("in", self)
5758 .set(
5759 "out",
5760 &mut out_out,
5761 )
5762 .set(
5763 "direction",
5764 direction as i32,
5765 )
5766 .set(
5767 "width",
5768 width,
5769 )
5770 .set(
5771 "height",
5772 height,
5773 ),
5774 );
5775
5776 utils::result(
5777 vips_op_response,
5778 out_out,
5779 Error::OperationError("Gravity (vips_gravity) failed".to_string()),
5780 )
5781 }
5782
5783 /// VipsGrey (grey), make a grey ramp image
5784 /// returns `VipsImage` - Output image
5785 ///
5786 /// width: `i32` -> Image width in pixels
5787 ///
5788 /// height: `i32` -> Image height in pixels
5789 pub fn grey(width: i32, height: i32) -> Result<VipsImage> {
5790 let mut out_out = VipsImage::from(null_mut());
5791 let vips_op_response = call(
5792 "grey",
5793 VOption::new()
5794 .set(
5795 "out",
5796 &mut out_out,
5797 )
5798 .set(
5799 "width",
5800 width,
5801 )
5802 .set(
5803 "height",
5804 height,
5805 ),
5806 );
5807
5808 utils::result(
5809 vips_op_response,
5810 out_out,
5811 Error::OperationError("Grey (vips_grey) failed".to_string()),
5812 )
5813 }
5814
5815 /// VipsGrey (grey), make a grey ramp image
5816 /// returns `VipsImage` - Output image
5817 ///
5818 /// width: `i32` -> Image width in pixels
5819 ///
5820 /// height: `i32` -> Image height in pixels
5821 ///
5822 /// <ins>Optional arguments</ins>
5823 ///
5824 /// uchar: `bool` -> Output an unsigned char image
5825 pub fn grey_with_opts(width: i32, height: i32, option: VOption) -> Result<VipsImage> {
5826 let mut out_out = VipsImage::from(null_mut());
5827 let vips_op_response = call(
5828 "grey",
5829 option
5830 .set(
5831 "out",
5832 &mut out_out,
5833 )
5834 .set(
5835 "width",
5836 width,
5837 )
5838 .set(
5839 "height",
5840 height,
5841 ),
5842 );
5843
5844 utils::result(
5845 vips_op_response,
5846 out_out,
5847 Error::OperationError("Grey (vips_grey) failed".to_string()),
5848 )
5849 }
5850
5851 /// VipsGrid (grid), grid an image
5852 /// returns `VipsImage` - Output image
5853 ///
5854 /// tile_height: `i32` -> Chop into tiles this high
5855 ///
5856 /// across: `i32` -> Number of tiles across
5857 ///
5858 /// down: `i32` -> Number of tiles down
5859 pub fn grid(&self, tile_height: i32, across: i32, down: i32) -> Result<VipsImage> {
5860 let mut out_out = VipsImage::from(null_mut());
5861 let vips_op_response = call(
5862 "grid",
5863 VOption::new()
5864 .set("in", self)
5865 .set(
5866 "out",
5867 &mut out_out,
5868 )
5869 .set(
5870 "tile-height",
5871 tile_height,
5872 )
5873 .set(
5874 "across",
5875 across,
5876 )
5877 .set(
5878 "down",
5879 down,
5880 ),
5881 );
5882
5883 utils::result(
5884 vips_op_response,
5885 out_out,
5886 Error::OperationError("Grid (vips_grid) failed".to_string()),
5887 )
5888 }
5889
5890 /// VipsForeignLoadHeifFile (heifload), load a HEIF image (.heic, .heif, .avif), priority=0, is_a, get_flags, header, load
5891 /// returns `VipsImage` - Output image
5892 ///
5893 /// filename: `&str` -> Filename to load from
5894 pub fn heifload(filename: &str) -> Result<VipsImage> {
5895 let mut out_out = VipsImage::from(null_mut());
5896 let vips_op_response = call(
5897 "heifload",
5898 VOption::new()
5899 .set(
5900 "filename",
5901 filename,
5902 )
5903 .set(
5904 "out",
5905 &mut out_out,
5906 ),
5907 );
5908
5909 utils::result(
5910 vips_op_response,
5911 out_out,
5912 Error::OperationError("Heifload (vips_heifload) failed".to_string()),
5913 )
5914 }
5915
5916 /// VipsForeignLoadHeifFile (heifload), load a HEIF image (.heic, .heif, .avif), priority=0, is_a, get_flags, header, load
5917 /// returns `VipsImage` - Output image
5918 ///
5919 /// filename: `&str` -> Filename to load from
5920 ///
5921 /// <ins>Optional arguments</ins>
5922 ///
5923 /// page: `i32` -> First page to load
5924 ///
5925 /// n: `i32` -> Number of pages to load, -1 for all
5926 ///
5927 /// thumbnail: `bool` -> Fetch thumbnail image
5928 ///
5929 /// unlimited: `bool` -> Remove all denial of service limits
5930 ///
5931 /// flags: [`ForeignFlags`] -> Flags for this file
5932 ///
5933 /// memory: `bool` -> Force open via memory
5934 ///
5935 /// access: [`Access`] -> Required access pattern for this file
5936 ///
5937 /// fail_on: [`FailOn`] -> Error level to fail on
5938 ///
5939 /// revalidate: `bool` -> Don't use a cached result for this operation
5940 pub fn heifload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
5941 let mut out_out = VipsImage::from(null_mut());
5942 let vips_op_response = call(
5943 "heifload",
5944 option
5945 .set(
5946 "filename",
5947 filename,
5948 )
5949 .set(
5950 "out",
5951 &mut out_out,
5952 ),
5953 );
5954
5955 utils::result(
5956 vips_op_response,
5957 out_out,
5958 Error::OperationError("Heifload (vips_heifload) failed".to_string()),
5959 )
5960 }
5961
5962 /// VipsForeignLoadHeifBuffer (heifload_buffer), load a HEIF image, priority=0, is_a_buffer, get_flags, header, load
5963 /// returns `VipsImage` - Output image
5964 ///
5965 /// buffer: `&[u8]` -> Buffer to load from
5966 pub fn heifload_buffer(buffer: &[u8]) -> Result<VipsImage> {
5967 let vips_blob = unsafe {
5968 vips_blob_new(
5969 None,
5970 buffer.as_ptr() as _,
5971 buffer.len() as _,
5972 )
5973 };
5974 let blob = VipsBlob::from(vips_blob);
5975 let mut out_out = VipsImage::from(null_mut());
5976 let vips_op_response = call(
5977 "heifload_buffer",
5978 VOption::new()
5979 .set(
5980 "buffer",
5981 &blob,
5982 )
5983 .set(
5984 "out",
5985 &mut out_out,
5986 ),
5987 );
5988 blob.area_unref();
5989 utils::result(
5990 vips_op_response,
5991 out_out,
5992 Error::OperationError("HeifloadBuffer (vips_heifload_buffer) failed".to_string()),
5993 )
5994 }
5995
5996 /// VipsForeignLoadHeifBuffer (heifload_buffer), load a HEIF image, priority=0, is_a_buffer, get_flags, header, load
5997 /// returns `VipsImage` - Output image
5998 ///
5999 /// buffer: `&[u8]` -> Buffer to load from
6000 ///
6001 /// <ins>Optional arguments</ins>
6002 ///
6003 /// page: `i32` -> First page to load
6004 ///
6005 /// n: `i32` -> Number of pages to load, -1 for all
6006 ///
6007 /// thumbnail: `bool` -> Fetch thumbnail image
6008 ///
6009 /// unlimited: `bool` -> Remove all denial of service limits
6010 ///
6011 /// flags: [`ForeignFlags`] -> Flags for this file
6012 ///
6013 /// memory: `bool` -> Force open via memory
6014 ///
6015 /// access: [`Access`] -> Required access pattern for this file
6016 ///
6017 /// fail_on: [`FailOn`] -> Error level to fail on
6018 ///
6019 /// revalidate: `bool` -> Don't use a cached result for this operation
6020 pub fn heifload_buffer_with_opts(buffer: &[u8], option: VOption) -> Result<VipsImage> {
6021 let vips_blob = unsafe {
6022 vips_blob_new(
6023 None,
6024 buffer.as_ptr() as _,
6025 buffer.len() as _,
6026 )
6027 };
6028 let blob = VipsBlob::from(vips_blob);
6029 let mut out_out = VipsImage::from(null_mut());
6030 let vips_op_response = call(
6031 "heifload_buffer",
6032 option
6033 .set(
6034 "buffer",
6035 &blob,
6036 )
6037 .set(
6038 "out",
6039 &mut out_out,
6040 ),
6041 );
6042 blob.area_unref();
6043 utils::result(
6044 vips_op_response,
6045 out_out,
6046 Error::OperationError("HeifloadBuffer (vips_heifload_buffer) failed".to_string()),
6047 )
6048 }
6049
6050 /// VipsForeignLoadHeifSource (heifload_source), load a HEIF image, priority=0, is_a_source, get_flags, header, load
6051 /// returns `VipsImage` - Output image
6052 ///
6053 /// source: `&VipsSource` -> Source to load from
6054 pub fn heifload_source(source: &VipsSource) -> Result<VipsImage> {
6055 let mut out_out = VipsImage::from(null_mut());
6056 let vips_op_response = call(
6057 "heifload_source",
6058 VOption::new()
6059 .set(
6060 "source",
6061 source,
6062 )
6063 .set(
6064 "out",
6065 &mut out_out,
6066 ),
6067 );
6068
6069 utils::result(
6070 vips_op_response,
6071 out_out,
6072 Error::OperationError("HeifloadSource (vips_heifload_source) failed".to_string()),
6073 )
6074 }
6075
6076 /// VipsForeignLoadHeifSource (heifload_source), load a HEIF image, priority=0, is_a_source, get_flags, header, load
6077 /// returns `VipsImage` - Output image
6078 ///
6079 /// source: `&VipsSource` -> Source to load from
6080 ///
6081 /// <ins>Optional arguments</ins>
6082 ///
6083 /// page: `i32` -> First page to load
6084 ///
6085 /// n: `i32` -> Number of pages to load, -1 for all
6086 ///
6087 /// thumbnail: `bool` -> Fetch thumbnail image
6088 ///
6089 /// unlimited: `bool` -> Remove all denial of service limits
6090 ///
6091 /// flags: [`ForeignFlags`] -> Flags for this file
6092 ///
6093 /// memory: `bool` -> Force open via memory
6094 ///
6095 /// access: [`Access`] -> Required access pattern for this file
6096 ///
6097 /// fail_on: [`FailOn`] -> Error level to fail on
6098 ///
6099 /// revalidate: `bool` -> Don't use a cached result for this operation
6100 pub fn heifload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
6101 let mut out_out = VipsImage::from(null_mut());
6102 let vips_op_response = call(
6103 "heifload_source",
6104 option
6105 .set(
6106 "source",
6107 source,
6108 )
6109 .set(
6110 "out",
6111 &mut out_out,
6112 ),
6113 );
6114
6115 utils::result(
6116 vips_op_response,
6117 out_out,
6118 Error::OperationError("HeifloadSource (vips_heifload_source) failed".to_string()),
6119 )
6120 }
6121
6122 /// VipsForeignSaveHeifFile (heifsave), save image in HEIF format (.heic, .heif, .avif), priority=0, rgb alpha
6123 ///
6124 /// filename: `&str` -> Filename to save to
6125 pub fn heifsave(&self, filename: &str) -> Result<()> {
6126 let vips_op_response = call(
6127 "heifsave",
6128 VOption::new()
6129 .set("in", self)
6130 .set(
6131 "filename",
6132 filename,
6133 ),
6134 );
6135
6136 utils::result(
6137 vips_op_response,
6138 (),
6139 Error::OperationError("Heifsave (vips_heifsave) failed".to_string()),
6140 )
6141 }
6142
6143 /// VipsForeignSaveHeifFile (heifsave), save image in HEIF format (.heic, .heif, .avif), priority=0, rgb alpha
6144 ///
6145 /// filename: `&str` -> Filename to save to
6146 ///
6147 /// <ins>Optional arguments</ins>
6148 ///
6149 /// Q: `i32` -> Q factor
6150 ///
6151 /// bitdepth: `i32` -> Number of bits per pixel
6152 ///
6153 /// lossless: `bool` -> Enable lossless compression
6154 ///
6155 /// compression: [`ForeignHeifCompression`] -> Compression format
6156 ///
6157 /// effort: `i32` -> CPU effort
6158 ///
6159 /// subsample_mode: [`ForeignSubsample`] -> Select chroma subsample operation mode
6160 ///
6161 /// encoder: [`ForeignHeifEncoder`] -> Select encoder to use
6162 ///
6163 /// keep: [`ForeignKeep`] -> Which metadata to retain
6164 ///
6165 /// background: `&[f64]` -> Background value
6166 ///
6167 /// page_height: `i32` -> Set page height for multipage save
6168 ///
6169 /// profile: `&str` -> Filename of ICC profile to embed
6170 pub fn heifsave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
6171 let vips_op_response = call(
6172 "heifsave",
6173 option
6174 .set("in", self)
6175 .set(
6176 "filename",
6177 filename,
6178 ),
6179 );
6180
6181 utils::result(
6182 vips_op_response,
6183 (),
6184 Error::OperationError("Heifsave (vips_heifsave) failed".to_string()),
6185 )
6186 }
6187
6188 /// VipsForeignSaveHeifBuffer (heifsave_buffer), save image in HEIF format (.heic, .heif), priority=0, rgb alpha
6189 /// returns `Vec<u8>` - Buffer to save to
6190 pub fn heifsave_buffer(&self) -> Result<Vec<u8>> {
6191 let mut buffer_out = VipsBlob::from(null_mut());
6192 let vips_op_response = call(
6193 "heifsave_buffer",
6194 VOption::new()
6195 .set("in", self)
6196 .set(
6197 "buffer",
6198 &mut buffer_out,
6199 ),
6200 );
6201
6202 utils::result(
6203 vips_op_response,
6204 buffer_out.into(),
6205 Error::OperationError("HeifsaveBuffer (vips_heifsave_buffer) failed".to_string()),
6206 )
6207 }
6208
6209 /// VipsForeignSaveHeifBuffer (heifsave_buffer), save image in HEIF format (.heic, .heif), priority=0, rgb alpha
6210 /// returns `Vec<u8>` - Buffer to save to
6211 ///
6212 /// <ins>Optional arguments</ins>
6213 ///
6214 /// Q: `i32` -> Q factor
6215 ///
6216 /// bitdepth: `i32` -> Number of bits per pixel
6217 ///
6218 /// lossless: `bool` -> Enable lossless compression
6219 ///
6220 /// compression: [`ForeignHeifCompression`] -> Compression format
6221 ///
6222 /// effort: `i32` -> CPU effort
6223 ///
6224 /// subsample_mode: [`ForeignSubsample`] -> Select chroma subsample operation mode
6225 ///
6226 /// encoder: [`ForeignHeifEncoder`] -> Select encoder to use
6227 ///
6228 /// keep: [`ForeignKeep`] -> Which metadata to retain
6229 ///
6230 /// background: `&[f64]` -> Background value
6231 ///
6232 /// page_height: `i32` -> Set page height for multipage save
6233 ///
6234 /// profile: `&str` -> Filename of ICC profile to embed
6235 pub fn heifsave_buffer_with_opts(&self, option: VOption) -> Result<Vec<u8>> {
6236 let mut buffer_out = VipsBlob::from(null_mut());
6237 let vips_op_response = call(
6238 "heifsave_buffer",
6239 option
6240 .set("in", self)
6241 .set(
6242 "buffer",
6243 &mut buffer_out,
6244 ),
6245 );
6246
6247 utils::result(
6248 vips_op_response,
6249 buffer_out.into(),
6250 Error::OperationError("HeifsaveBuffer (vips_heifsave_buffer) failed".to_string()),
6251 )
6252 }
6253
6254 /// VipsForeignSaveHeifTarget (heifsave_target), save image in HEIF format (.heic, .heif), priority=0, rgb alpha
6255 ///
6256 /// target: `&VipsTarget` -> Target to save to
6257 pub fn heifsave_target(&self, target: &VipsTarget) -> Result<()> {
6258 let vips_op_response = call(
6259 "heifsave_target",
6260 VOption::new()
6261 .set("in", self)
6262 .set(
6263 "target",
6264 target,
6265 ),
6266 );
6267
6268 utils::result(
6269 vips_op_response,
6270 (),
6271 Error::OperationError("HeifsaveTarget (vips_heifsave_target) failed".to_string()),
6272 )
6273 }
6274
6275 /// VipsForeignSaveHeifTarget (heifsave_target), save image in HEIF format (.heic, .heif), priority=0, rgb alpha
6276 ///
6277 /// target: `&VipsTarget` -> Target to save to
6278 ///
6279 /// <ins>Optional arguments</ins>
6280 ///
6281 /// Q: `i32` -> Q factor
6282 ///
6283 /// bitdepth: `i32` -> Number of bits per pixel
6284 ///
6285 /// lossless: `bool` -> Enable lossless compression
6286 ///
6287 /// compression: [`ForeignHeifCompression`] -> Compression format
6288 ///
6289 /// effort: `i32` -> CPU effort
6290 ///
6291 /// subsample_mode: [`ForeignSubsample`] -> Select chroma subsample operation mode
6292 ///
6293 /// encoder: [`ForeignHeifEncoder`] -> Select encoder to use
6294 ///
6295 /// keep: [`ForeignKeep`] -> Which metadata to retain
6296 ///
6297 /// background: `&[f64]` -> Background value
6298 ///
6299 /// page_height: `i32` -> Set page height for multipage save
6300 ///
6301 /// profile: `&str` -> Filename of ICC profile to embed
6302 pub fn heifsave_target_with_opts(&self, target: &VipsTarget, option: VOption) -> Result<()> {
6303 let vips_op_response = call(
6304 "heifsave_target",
6305 option
6306 .set("in", self)
6307 .set(
6308 "target",
6309 target,
6310 ),
6311 );
6312
6313 utils::result(
6314 vips_op_response,
6315 (),
6316 Error::OperationError("HeifsaveTarget (vips_heifsave_target) failed".to_string()),
6317 )
6318 }
6319
6320 /// VipsHistCum (hist_cum), form cumulative histogram
6321 /// returns `VipsImage` - Output image
6322 pub fn hist_cum(&self) -> Result<VipsImage> {
6323 let mut out_out = VipsImage::from(null_mut());
6324 let vips_op_response = call(
6325 "hist_cum",
6326 VOption::new()
6327 .set("in", self)
6328 .set(
6329 "out",
6330 &mut out_out,
6331 ),
6332 );
6333
6334 utils::result(
6335 vips_op_response,
6336 out_out,
6337 Error::OperationError("HistCum (vips_hist_cum) failed".to_string()),
6338 )
6339 }
6340
6341 /// VipsHistEntropy (hist_entropy), estimate image entropy
6342 /// returns `f64` - Output value
6343 pub fn hist_entropy(&self) -> Result<f64> {
6344 let mut out_out: f64 = 0.0;
6345 let vips_op_response = call(
6346 "hist_entropy",
6347 VOption::new()
6348 .set("in", self)
6349 .set(
6350 "out",
6351 &mut out_out,
6352 ),
6353 );
6354
6355 utils::result(
6356 vips_op_response,
6357 out_out,
6358 Error::OperationError("HistEntropy (vips_hist_entropy) failed".to_string()),
6359 )
6360 }
6361
6362 /// VipsHistEqual (hist_equal), histogram equalisation
6363 /// returns `VipsImage` - Output image
6364 pub fn hist_equal(&self) -> Result<VipsImage> {
6365 let mut out_out = VipsImage::from(null_mut());
6366 let vips_op_response = call(
6367 "hist_equal",
6368 VOption::new()
6369 .set("in", self)
6370 .set(
6371 "out",
6372 &mut out_out,
6373 ),
6374 );
6375
6376 utils::result(
6377 vips_op_response,
6378 out_out,
6379 Error::OperationError("HistEqual (vips_hist_equal) failed".to_string()),
6380 )
6381 }
6382
6383 /// VipsHistEqual (hist_equal), histogram equalisation
6384 /// returns `VipsImage` - Output image
6385 ///
6386 /// <ins>Optional arguments</ins>
6387 ///
6388 /// band: `i32` -> Equalise with this band
6389 pub fn hist_equal_with_opts(&self, option: VOption) -> Result<VipsImage> {
6390 let mut out_out = VipsImage::from(null_mut());
6391 let vips_op_response = call(
6392 "hist_equal",
6393 option
6394 .set("in", self)
6395 .set(
6396 "out",
6397 &mut out_out,
6398 ),
6399 );
6400
6401 utils::result(
6402 vips_op_response,
6403 out_out,
6404 Error::OperationError("HistEqual (vips_hist_equal) failed".to_string()),
6405 )
6406 }
6407
6408 /// VipsHistFind (hist_find), find image histogram
6409 /// returns `VipsImage` - Output histogram
6410 pub fn hist_find(&self) -> Result<VipsImage> {
6411 let mut out_out = VipsImage::from(null_mut());
6412 let vips_op_response = call(
6413 "hist_find",
6414 VOption::new()
6415 .set("in", self)
6416 .set(
6417 "out",
6418 &mut out_out,
6419 ),
6420 );
6421
6422 utils::result(
6423 vips_op_response,
6424 out_out,
6425 Error::OperationError("HistFind (vips_hist_find) failed".to_string()),
6426 )
6427 }
6428
6429 /// VipsHistFind (hist_find), find image histogram
6430 /// returns `VipsImage` - Output histogram
6431 ///
6432 /// <ins>Optional arguments</ins>
6433 ///
6434 /// band: `i32` -> Find histogram of band
6435 pub fn hist_find_with_opts(&self, option: VOption) -> Result<VipsImage> {
6436 let mut out_out = VipsImage::from(null_mut());
6437 let vips_op_response = call(
6438 "hist_find",
6439 option
6440 .set("in", self)
6441 .set(
6442 "out",
6443 &mut out_out,
6444 ),
6445 );
6446
6447 utils::result(
6448 vips_op_response,
6449 out_out,
6450 Error::OperationError("HistFind (vips_hist_find) failed".to_string()),
6451 )
6452 }
6453
6454 /// VipsHistFindIndexed (hist_find_indexed), find indexed image histogram
6455 /// returns `VipsImage` - Output histogram
6456 ///
6457 /// index: `&VipsImage` -> Index image
6458 pub fn hist_find_indexed(&self, index: &VipsImage) -> Result<VipsImage> {
6459 let mut out_out = VipsImage::from(null_mut());
6460 let vips_op_response = call(
6461 "hist_find_indexed",
6462 VOption::new()
6463 .set("in", self)
6464 .set(
6465 "index",
6466 index,
6467 )
6468 .set(
6469 "out",
6470 &mut out_out,
6471 ),
6472 );
6473
6474 utils::result(
6475 vips_op_response,
6476 out_out,
6477 Error::OperationError("HistFindIndexed (vips_hist_find_indexed) failed".to_string()),
6478 )
6479 }
6480
6481 /// VipsHistFindIndexed (hist_find_indexed), find indexed image histogram
6482 /// returns `VipsImage` - Output histogram
6483 ///
6484 /// index: `&VipsImage` -> Index image
6485 ///
6486 /// <ins>Optional arguments</ins>
6487 ///
6488 /// combine: [`Combine`] -> Combine bins like this
6489 pub fn hist_find_indexed_with_opts(
6490 &self,
6491 index: &VipsImage,
6492 option: VOption,
6493 ) -> Result<VipsImage> {
6494 let mut out_out = VipsImage::from(null_mut());
6495 let vips_op_response = call(
6496 "hist_find_indexed",
6497 option
6498 .set("in", self)
6499 .set(
6500 "index",
6501 index,
6502 )
6503 .set(
6504 "out",
6505 &mut out_out,
6506 ),
6507 );
6508
6509 utils::result(
6510 vips_op_response,
6511 out_out,
6512 Error::OperationError("HistFindIndexed (vips_hist_find_indexed) failed".to_string()),
6513 )
6514 }
6515
6516 /// VipsHistFindNDim (hist_find_ndim), find n-dimensional image histogram
6517 /// returns `VipsImage` - Output histogram
6518 pub fn hist_find_ndim(&self) -> Result<VipsImage> {
6519 let mut out_out = VipsImage::from(null_mut());
6520 let vips_op_response = call(
6521 "hist_find_ndim",
6522 VOption::new()
6523 .set("in", self)
6524 .set(
6525 "out",
6526 &mut out_out,
6527 ),
6528 );
6529
6530 utils::result(
6531 vips_op_response,
6532 out_out,
6533 Error::OperationError("HistFindNdim (vips_hist_find_ndim) failed".to_string()),
6534 )
6535 }
6536
6537 /// VipsHistFindNDim (hist_find_ndim), find n-dimensional image histogram
6538 /// returns `VipsImage` - Output histogram
6539 ///
6540 /// <ins>Optional arguments</ins>
6541 ///
6542 /// bins: `i32` -> Number of bins in each dimension
6543 pub fn hist_find_ndim_with_opts(&self, option: VOption) -> Result<VipsImage> {
6544 let mut out_out = VipsImage::from(null_mut());
6545 let vips_op_response = call(
6546 "hist_find_ndim",
6547 option
6548 .set("in", self)
6549 .set(
6550 "out",
6551 &mut out_out,
6552 ),
6553 );
6554
6555 utils::result(
6556 vips_op_response,
6557 out_out,
6558 Error::OperationError("HistFindNdim (vips_hist_find_ndim) failed".to_string()),
6559 )
6560 }
6561
6562 /// VipsHistIsmonotonic (hist_ismonotonic), test for monotonicity
6563 /// returns `bool` - true if in is monotonic
6564 pub fn hist_ismonotonic(&self) -> Result<bool> {
6565 let mut monotonic_out: bool = false;
6566 let vips_op_response = call(
6567 "hist_ismonotonic",
6568 VOption::new()
6569 .set("in", self)
6570 .set(
6571 "monotonic",
6572 &mut monotonic_out,
6573 ),
6574 );
6575
6576 utils::result(
6577 vips_op_response,
6578 monotonic_out,
6579 Error::OperationError("HistIsmonotonic (vips_hist_ismonotonic) failed".to_string()),
6580 )
6581 }
6582
6583 /// VipsHistLocal (hist_local), local histogram equalisation
6584 /// returns `VipsImage` - Output image
6585 ///
6586 /// width: `i32` -> Window width in pixels
6587 ///
6588 /// height: `i32` -> Window height in pixels
6589 pub fn hist_local(&self, width: i32, height: i32) -> Result<VipsImage> {
6590 let mut out_out = VipsImage::from(null_mut());
6591 let vips_op_response = call(
6592 "hist_local",
6593 VOption::new()
6594 .set("in", self)
6595 .set(
6596 "out",
6597 &mut out_out,
6598 )
6599 .set(
6600 "width",
6601 width,
6602 )
6603 .set(
6604 "height",
6605 height,
6606 ),
6607 );
6608
6609 utils::result(
6610 vips_op_response,
6611 out_out,
6612 Error::OperationError("HistLocal (vips_hist_local) failed".to_string()),
6613 )
6614 }
6615
6616 /// VipsHistLocal (hist_local), local histogram equalisation
6617 /// returns `VipsImage` - Output image
6618 ///
6619 /// width: `i32` -> Window width in pixels
6620 ///
6621 /// height: `i32` -> Window height in pixels
6622 ///
6623 /// <ins>Optional arguments</ins>
6624 ///
6625 /// max_slope: `i32` -> Maximum slope (CLAHE)
6626 pub fn hist_local_with_opts(
6627 &self,
6628 width: i32,
6629 height: i32,
6630 option: VOption,
6631 ) -> Result<VipsImage> {
6632 let mut out_out = VipsImage::from(null_mut());
6633 let vips_op_response = call(
6634 "hist_local",
6635 option
6636 .set("in", self)
6637 .set(
6638 "out",
6639 &mut out_out,
6640 )
6641 .set(
6642 "width",
6643 width,
6644 )
6645 .set(
6646 "height",
6647 height,
6648 ),
6649 );
6650
6651 utils::result(
6652 vips_op_response,
6653 out_out,
6654 Error::OperationError("HistLocal (vips_hist_local) failed".to_string()),
6655 )
6656 }
6657
6658 /// VipsHistMatch (hist_match), match two histograms
6659 /// returns `VipsImage` - Output image
6660 ///
6661 /// refp: `&VipsImage` -> Reference histogram
6662 pub fn hist_match(&self, refp: &VipsImage) -> Result<VipsImage> {
6663 let mut out_out = VipsImage::from(null_mut());
6664 let vips_op_response = call(
6665 "hist_match",
6666 VOption::new()
6667 .set("in", self)
6668 .set(
6669 "ref", refp,
6670 )
6671 .set(
6672 "out",
6673 &mut out_out,
6674 ),
6675 );
6676
6677 utils::result(
6678 vips_op_response,
6679 out_out,
6680 Error::OperationError("HistMatch (vips_hist_match) failed".to_string()),
6681 )
6682 }
6683
6684 /// VipsHistNorm (hist_norm), normalise histogram
6685 /// returns `VipsImage` - Output image
6686 pub fn hist_norm(&self) -> Result<VipsImage> {
6687 let mut out_out = VipsImage::from(null_mut());
6688 let vips_op_response = call(
6689 "hist_norm",
6690 VOption::new()
6691 .set("in", self)
6692 .set(
6693 "out",
6694 &mut out_out,
6695 ),
6696 );
6697
6698 utils::result(
6699 vips_op_response,
6700 out_out,
6701 Error::OperationError("HistNorm (vips_hist_norm) failed".to_string()),
6702 )
6703 }
6704
6705 /// VipsHistPlot (hist_plot), plot histogram
6706 /// returns `VipsImage` - Output image
6707 pub fn hist_plot(&self) -> Result<VipsImage> {
6708 let mut out_out = VipsImage::from(null_mut());
6709 let vips_op_response = call(
6710 "hist_plot",
6711 VOption::new()
6712 .set("in", self)
6713 .set(
6714 "out",
6715 &mut out_out,
6716 ),
6717 );
6718
6719 utils::result(
6720 vips_op_response,
6721 out_out,
6722 Error::OperationError("HistPlot (vips_hist_plot) failed".to_string()),
6723 )
6724 }
6725
6726 /// VipsHoughCircle (hough_circle), find hough circle transform
6727 /// returns `VipsImage` - Output image
6728 pub fn hough_circle(&self) -> Result<VipsImage> {
6729 let mut out_out = VipsImage::from(null_mut());
6730 let vips_op_response = call(
6731 "hough_circle",
6732 VOption::new()
6733 .set("in", self)
6734 .set(
6735 "out",
6736 &mut out_out,
6737 ),
6738 );
6739
6740 utils::result(
6741 vips_op_response,
6742 out_out,
6743 Error::OperationError("HoughCircle (vips_hough_circle) failed".to_string()),
6744 )
6745 }
6746
6747 /// VipsHoughCircle (hough_circle), find hough circle transform
6748 /// returns `VipsImage` - Output image
6749 ///
6750 /// <ins>Optional arguments</ins>
6751 ///
6752 /// scale: `i32` -> Scale down dimensions by this factor
6753 ///
6754 /// min_radius: `i32` -> Smallest radius to search for
6755 ///
6756 /// max_radius: `i32` -> Largest radius to search for
6757 pub fn hough_circle_with_opts(&self, option: VOption) -> Result<VipsImage> {
6758 let mut out_out = VipsImage::from(null_mut());
6759 let vips_op_response = call(
6760 "hough_circle",
6761 option
6762 .set("in", self)
6763 .set(
6764 "out",
6765 &mut out_out,
6766 ),
6767 );
6768
6769 utils::result(
6770 vips_op_response,
6771 out_out,
6772 Error::OperationError("HoughCircle (vips_hough_circle) failed".to_string()),
6773 )
6774 }
6775
6776 /// VipsHoughLine (hough_line), find hough line transform
6777 /// returns `VipsImage` - Output image
6778 pub fn hough_line(&self) -> Result<VipsImage> {
6779 let mut out_out = VipsImage::from(null_mut());
6780 let vips_op_response = call(
6781 "hough_line",
6782 VOption::new()
6783 .set("in", self)
6784 .set(
6785 "out",
6786 &mut out_out,
6787 ),
6788 );
6789
6790 utils::result(
6791 vips_op_response,
6792 out_out,
6793 Error::OperationError("HoughLine (vips_hough_line) failed".to_string()),
6794 )
6795 }
6796
6797 /// VipsHoughLine (hough_line), find hough line transform
6798 /// returns `VipsImage` - Output image
6799 ///
6800 /// <ins>Optional arguments</ins>
6801 ///
6802 /// width: `i32` -> Horizontal size of parameter space
6803 ///
6804 /// height: `i32` -> Vertical size of parameter space
6805 pub fn hough_line_with_opts(&self, option: VOption) -> Result<VipsImage> {
6806 let mut out_out = VipsImage::from(null_mut());
6807 let vips_op_response = call(
6808 "hough_line",
6809 option
6810 .set("in", self)
6811 .set(
6812 "out",
6813 &mut out_out,
6814 ),
6815 );
6816
6817 utils::result(
6818 vips_op_response,
6819 out_out,
6820 Error::OperationError("HoughLine (vips_hough_line) failed".to_string()),
6821 )
6822 }
6823
6824 /// VipsIccExport (icc_export), output to device with ICC profile
6825 /// returns `VipsImage` - Output image
6826 pub fn icc_export(&self) -> Result<VipsImage> {
6827 let mut out_out = VipsImage::from(null_mut());
6828 let vips_op_response = call(
6829 "icc_export",
6830 VOption::new()
6831 .set("in", self)
6832 .set(
6833 "out",
6834 &mut out_out,
6835 ),
6836 );
6837
6838 utils::result(
6839 vips_op_response,
6840 out_out,
6841 Error::OperationError("IccExport (vips_icc_export) failed".to_string()),
6842 )
6843 }
6844
6845 /// VipsIccExport (icc_export), output to device with ICC profile
6846 /// returns `VipsImage` - Output image
6847 ///
6848 /// <ins>Optional arguments</ins>
6849 ///
6850 /// pcs: [`PCS`] -> Set Profile Connection Space
6851 ///
6852 /// intent: [`Intent`] -> Rendering intent
6853 ///
6854 /// black_point_compensation: `bool` -> Enable black point compensation
6855 ///
6856 /// output_profile: `&str` -> Filename to load output profile from
6857 ///
6858 /// depth: `i32` -> Output device space depth in bits
6859 pub fn icc_export_with_opts(&self, option: VOption) -> Result<VipsImage> {
6860 let mut out_out = VipsImage::from(null_mut());
6861 let vips_op_response = call(
6862 "icc_export",
6863 option
6864 .set("in", self)
6865 .set(
6866 "out",
6867 &mut out_out,
6868 ),
6869 );
6870
6871 utils::result(
6872 vips_op_response,
6873 out_out,
6874 Error::OperationError("IccExport (vips_icc_export) failed".to_string()),
6875 )
6876 }
6877
6878 /// VipsIccImport (icc_import), import from device with ICC profile
6879 /// returns `VipsImage` - Output image
6880 pub fn icc_import(&self) -> Result<VipsImage> {
6881 let mut out_out = VipsImage::from(null_mut());
6882 let vips_op_response = call(
6883 "icc_import",
6884 VOption::new()
6885 .set("in", self)
6886 .set(
6887 "out",
6888 &mut out_out,
6889 ),
6890 );
6891
6892 utils::result(
6893 vips_op_response,
6894 out_out,
6895 Error::OperationError("IccImport (vips_icc_import) failed".to_string()),
6896 )
6897 }
6898
6899 /// VipsIccImport (icc_import), import from device with ICC profile
6900 /// returns `VipsImage` - Output image
6901 ///
6902 /// <ins>Optional arguments</ins>
6903 ///
6904 /// pcs: [`PCS`] -> Set Profile Connection Space
6905 ///
6906 /// intent: [`Intent`] -> Rendering intent
6907 ///
6908 /// black_point_compensation: `bool` -> Enable black point compensation
6909 ///
6910 /// embedded: `bool` -> Use embedded input profile, if available
6911 ///
6912 /// input_profile: `&str` -> Filename to load input profile from
6913 pub fn icc_import_with_opts(&self, option: VOption) -> Result<VipsImage> {
6914 let mut out_out = VipsImage::from(null_mut());
6915 let vips_op_response = call(
6916 "icc_import",
6917 option
6918 .set("in", self)
6919 .set(
6920 "out",
6921 &mut out_out,
6922 ),
6923 );
6924
6925 utils::result(
6926 vips_op_response,
6927 out_out,
6928 Error::OperationError("IccImport (vips_icc_import) failed".to_string()),
6929 )
6930 }
6931
6932 /// VipsIccTransform (icc_transform), transform between devices with ICC profiles
6933 /// returns `VipsImage` - Output image
6934 ///
6935 /// output_profile: `&str` -> Filename to load output profile from
6936 pub fn icc_transform(&self, output_profile: &str) -> Result<VipsImage> {
6937 let mut out_out = VipsImage::from(null_mut());
6938 let vips_op_response = call(
6939 "icc_transform",
6940 VOption::new()
6941 .set("in", self)
6942 .set(
6943 "out",
6944 &mut out_out,
6945 )
6946 .set(
6947 "output-profile",
6948 output_profile,
6949 ),
6950 );
6951
6952 utils::result(
6953 vips_op_response,
6954 out_out,
6955 Error::OperationError("IccTransform (vips_icc_transform) failed".to_string()),
6956 )
6957 }
6958
6959 /// VipsIccTransform (icc_transform), transform between devices with ICC profiles
6960 /// returns `VipsImage` - Output image
6961 ///
6962 /// output_profile: `&str` -> Filename to load output profile from
6963 ///
6964 /// <ins>Optional arguments</ins>
6965 ///
6966 /// pcs: [`PCS`] -> Set Profile Connection Space
6967 ///
6968 /// intent: [`Intent`] -> Rendering intent
6969 ///
6970 /// black_point_compensation: `bool` -> Enable black point compensation
6971 ///
6972 /// embedded: `bool` -> Use embedded input profile, if available
6973 ///
6974 /// input_profile: `&str` -> Filename to load input profile from
6975 ///
6976 /// depth: `i32` -> Output device space depth in bits
6977 pub fn icc_transform_with_opts(
6978 &self,
6979 output_profile: &str,
6980 option: VOption,
6981 ) -> Result<VipsImage> {
6982 let mut out_out = VipsImage::from(null_mut());
6983 let vips_op_response = call(
6984 "icc_transform",
6985 option
6986 .set("in", self)
6987 .set(
6988 "out",
6989 &mut out_out,
6990 )
6991 .set(
6992 "output-profile",
6993 output_profile,
6994 ),
6995 );
6996
6997 utils::result(
6998 vips_op_response,
6999 out_out,
7000 Error::OperationError("IccTransform (vips_icc_transform) failed".to_string()),
7001 )
7002 }
7003
7004 /// VipsIdentity (identity), make a 1D image where pixel values are indexes
7005 /// returns `VipsImage` - Output image
7006 pub fn identity() -> Result<VipsImage> {
7007 let mut out_out = VipsImage::from(null_mut());
7008 let vips_op_response = call(
7009 "identity",
7010 VOption::new().set(
7011 "out",
7012 &mut out_out,
7013 ),
7014 );
7015
7016 utils::result(
7017 vips_op_response,
7018 out_out,
7019 Error::OperationError("Identity (vips_identity) failed".to_string()),
7020 )
7021 }
7022
7023 /// VipsIdentity (identity), make a 1D image where pixel values are indexes
7024 /// returns `VipsImage` - Output image
7025 ///
7026 /// <ins>Optional arguments</ins>
7027 ///
7028 /// bands: `i32` -> Number of bands in LUT
7029 ///
7030 /// ushort: `bool` -> Create a 16-bit LUT
7031 ///
7032 /// size: `i32` -> Size of 16-bit LUT
7033 pub fn identity_with_opts(option: VOption) -> Result<VipsImage> {
7034 let mut out_out = VipsImage::from(null_mut());
7035 let vips_op_response = call(
7036 "identity",
7037 option.set(
7038 "out",
7039 &mut out_out,
7040 ),
7041 );
7042
7043 utils::result(
7044 vips_op_response,
7045 out_out,
7046 Error::OperationError("Identity (vips_identity) failed".to_string()),
7047 )
7048 }
7049
7050 /// VipsIfthenelse (ifthenelse), ifthenelse an image
7051 /// returns `VipsImage` - Output image
7052 ///
7053 /// in1: `&VipsImage` -> Source for TRUE pixels
7054 ///
7055 /// in2: `&VipsImage` -> Source for FALSE pixels
7056 pub fn ifthenelse(&self, in1: &VipsImage, in2: &VipsImage) -> Result<VipsImage> {
7057 let mut out_out = VipsImage::from(null_mut());
7058 let vips_op_response = call(
7059 "ifthenelse",
7060 VOption::new()
7061 .set(
7062 "cond",
7063 self,
7064 )
7065 .set("in1", in1)
7066 .set("in2", in2)
7067 .set(
7068 "out",
7069 &mut out_out,
7070 ),
7071 );
7072
7073 utils::result(
7074 vips_op_response,
7075 out_out,
7076 Error::OperationError("Ifthenelse (vips_ifthenelse) failed".to_string()),
7077 )
7078 }
7079
7080 /// VipsIfthenelse (ifthenelse), ifthenelse an image
7081 /// returns `VipsImage` - Output image
7082 ///
7083 /// in1: `&VipsImage` -> Source for TRUE pixels
7084 ///
7085 /// in2: `&VipsImage` -> Source for FALSE pixels
7086 ///
7087 /// <ins>Optional arguments</ins>
7088 ///
7089 /// blend: `bool` -> Blend smoothly between then and else parts
7090 pub fn ifthenelse_with_opts(
7091 &self,
7092 in1: &VipsImage,
7093 in2: &VipsImage,
7094 option: VOption,
7095 ) -> Result<VipsImage> {
7096 let mut out_out = VipsImage::from(null_mut());
7097 let vips_op_response = call(
7098 "ifthenelse",
7099 option
7100 .set(
7101 "cond",
7102 self,
7103 )
7104 .set("in1", in1)
7105 .set("in2", in2)
7106 .set(
7107 "out",
7108 &mut out_out,
7109 ),
7110 );
7111
7112 utils::result(
7113 vips_op_response,
7114 out_out,
7115 Error::OperationError("Ifthenelse (vips_ifthenelse) failed".to_string()),
7116 )
7117 }
7118
7119 /// VipsInsert (insert), insert image @sub into @main at @x, @y
7120 /// returns `VipsImage` - Output image
7121 ///
7122 /// sub: `&VipsImage` -> Sub-image to insert into main image
7123 ///
7124 /// x: `i32` -> Left edge of sub in main
7125 ///
7126 /// y: `i32` -> Top edge of sub in main
7127 pub fn insert(&self, sub: &VipsImage, x: i32, y: i32) -> Result<VipsImage> {
7128 let mut out_out = VipsImage::from(null_mut());
7129 let vips_op_response = call(
7130 "insert",
7131 VOption::new()
7132 .set(
7133 "main",
7134 self,
7135 )
7136 .set("sub", sub)
7137 .set(
7138 "out",
7139 &mut out_out,
7140 )
7141 .set("x", x)
7142 .set("y", y),
7143 );
7144
7145 utils::result(
7146 vips_op_response,
7147 out_out,
7148 Error::OperationError("Insert (vips_insert) failed".to_string()),
7149 )
7150 }
7151
7152 /// VipsInsert (insert), insert image @sub into @main at @x, @y
7153 /// returns `VipsImage` - Output image
7154 ///
7155 /// sub: `&VipsImage` -> Sub-image to insert into main image
7156 ///
7157 /// x: `i32` -> Left edge of sub in main
7158 ///
7159 /// y: `i32` -> Top edge of sub in main
7160 ///
7161 /// <ins>Optional arguments</ins>
7162 ///
7163 /// expand: `bool` -> Expand output to hold all of both inputs
7164 ///
7165 /// background: `&[f64]` -> Color for new pixels
7166 pub fn insert_with_opts(
7167 &self,
7168 sub: &VipsImage,
7169 x: i32,
7170 y: i32,
7171 option: VOption,
7172 ) -> Result<VipsImage> {
7173 let mut out_out = VipsImage::from(null_mut());
7174 let vips_op_response = call(
7175 "insert",
7176 option
7177 .set(
7178 "main",
7179 self,
7180 )
7181 .set("sub", sub)
7182 .set(
7183 "out",
7184 &mut out_out,
7185 )
7186 .set("x", x)
7187 .set("y", y),
7188 );
7189
7190 utils::result(
7191 vips_op_response,
7192 out_out,
7193 Error::OperationError("Insert (vips_insert) failed".to_string()),
7194 )
7195 }
7196
7197 /// VipsInvert (invert), invert an image
7198 /// returns `VipsImage` - Output image
7199 pub fn invert(&self) -> Result<VipsImage> {
7200 let mut out_out = VipsImage::from(null_mut());
7201 let vips_op_response = call(
7202 "invert",
7203 VOption::new()
7204 .set("in", self)
7205 .set(
7206 "out",
7207 &mut out_out,
7208 ),
7209 );
7210
7211 utils::result(
7212 vips_op_response,
7213 out_out,
7214 Error::OperationError("Invert (vips_invert) failed".to_string()),
7215 )
7216 }
7217
7218 /// VipsInvertlut (invertlut), build an inverted look-up table
7219 /// returns `VipsImage` - Output image
7220 pub fn invertlut(&self) -> Result<VipsImage> {
7221 let mut out_out = VipsImage::from(null_mut());
7222 let vips_op_response = call(
7223 "invertlut",
7224 VOption::new()
7225 .set("in", self)
7226 .set(
7227 "out",
7228 &mut out_out,
7229 ),
7230 );
7231
7232 utils::result(
7233 vips_op_response,
7234 out_out,
7235 Error::OperationError("Invertlut (vips_invertlut) failed".to_string()),
7236 )
7237 }
7238
7239 /// VipsInvertlut (invertlut), build an inverted look-up table
7240 /// returns `VipsImage` - Output image
7241 ///
7242 /// <ins>Optional arguments</ins>
7243 ///
7244 /// size: `i32` -> LUT size to generate
7245 pub fn invertlut_with_opts(&self, option: VOption) -> Result<VipsImage> {
7246 let mut out_out = VipsImage::from(null_mut());
7247 let vips_op_response = call(
7248 "invertlut",
7249 option
7250 .set("in", self)
7251 .set(
7252 "out",
7253 &mut out_out,
7254 ),
7255 );
7256
7257 utils::result(
7258 vips_op_response,
7259 out_out,
7260 Error::OperationError("Invertlut (vips_invertlut) failed".to_string()),
7261 )
7262 }
7263
7264 /// VipsInvfft (invfft), inverse FFT
7265 /// returns `VipsImage` - Output image
7266 pub fn invfft(&self) -> Result<VipsImage> {
7267 let mut out_out = VipsImage::from(null_mut());
7268 let vips_op_response = call(
7269 "invfft",
7270 VOption::new()
7271 .set("in", self)
7272 .set(
7273 "out",
7274 &mut out_out,
7275 ),
7276 );
7277
7278 utils::result(
7279 vips_op_response,
7280 out_out,
7281 Error::OperationError("Invfft (vips_invfft) failed".to_string()),
7282 )
7283 }
7284
7285 /// VipsInvfft (invfft), inverse FFT
7286 /// returns `VipsImage` - Output image
7287 ///
7288 /// <ins>Optional arguments</ins>
7289 ///
7290 /// real: `bool` -> Output only the real part of the transform
7291 pub fn invfft_with_opts(&self, option: VOption) -> Result<VipsImage> {
7292 let mut out_out = VipsImage::from(null_mut());
7293 let vips_op_response = call(
7294 "invfft",
7295 option
7296 .set("in", self)
7297 .set(
7298 "out",
7299 &mut out_out,
7300 ),
7301 );
7302
7303 utils::result(
7304 vips_op_response,
7305 out_out,
7306 Error::OperationError("Invfft (vips_invfft) failed".to_string()),
7307 )
7308 }
7309
7310 /// VipsJoin (join), join a pair of images
7311 /// returns `VipsImage` - Output image
7312 ///
7313 /// in2: `&VipsImage` -> Second input image
7314 ///
7315 /// direction: `Direction` -> Join left-right or up-down
7316 pub fn join(&self, in2: &VipsImage, direction: Direction) -> Result<VipsImage> {
7317 let mut out_out = VipsImage::from(null_mut());
7318 let vips_op_response = call(
7319 "join",
7320 VOption::new()
7321 .set(
7322 "in1", self,
7323 )
7324 .set("in2", in2)
7325 .set(
7326 "out",
7327 &mut out_out,
7328 )
7329 .set(
7330 "direction",
7331 direction as i32,
7332 ),
7333 );
7334
7335 utils::result(
7336 vips_op_response,
7337 out_out,
7338 Error::OperationError("Join (vips_join) failed".to_string()),
7339 )
7340 }
7341
7342 /// VipsJoin (join), join a pair of images
7343 /// returns `VipsImage` - Output image
7344 ///
7345 /// in2: `&VipsImage` -> Second input image
7346 ///
7347 /// direction: `Direction` -> Join left-right or up-down
7348 ///
7349 /// <ins>Optional arguments</ins>
7350 ///
7351 /// expand: `bool` -> Expand output to hold all of both inputs
7352 ///
7353 /// shim: `i32` -> Pixels between images
7354 ///
7355 /// background: `&[f64]` -> Colour for new pixels
7356 ///
7357 /// align: [`Align`] -> Align on the low, centre or high coordinate edge
7358 pub fn join_with_opts(
7359 &self,
7360 in2: &VipsImage,
7361 direction: Direction,
7362 option: VOption,
7363 ) -> Result<VipsImage> {
7364 let mut out_out = VipsImage::from(null_mut());
7365 let vips_op_response = call(
7366 "join",
7367 option
7368 .set(
7369 "in1", self,
7370 )
7371 .set("in2", in2)
7372 .set(
7373 "out",
7374 &mut out_out,
7375 )
7376 .set(
7377 "direction",
7378 direction as i32,
7379 ),
7380 );
7381
7382 utils::result(
7383 vips_op_response,
7384 out_out,
7385 Error::OperationError("Join (vips_join) failed".to_string()),
7386 )
7387 }
7388
7389 /// VipsForeignLoadJp2kFile (jp2kload), load JPEG2000 image (.j2k, .jp2, .jpt, .j2c, .jpc), priority=0, untrusted, is_a, get_flags, header, load
7390 /// returns `VipsImage` - Output image
7391 ///
7392 /// filename: `&str` -> Filename to load from
7393 pub fn jp2kload(filename: &str) -> Result<VipsImage> {
7394 let mut out_out = VipsImage::from(null_mut());
7395 let vips_op_response = call(
7396 "jp2kload",
7397 VOption::new()
7398 .set(
7399 "filename",
7400 filename,
7401 )
7402 .set(
7403 "out",
7404 &mut out_out,
7405 ),
7406 );
7407
7408 utils::result(
7409 vips_op_response,
7410 out_out,
7411 Error::OperationError("Jp2Kload (vips_jp2kload) failed".to_string()),
7412 )
7413 }
7414
7415 /// VipsForeignLoadJp2kFile (jp2kload), load JPEG2000 image (.j2k, .jp2, .jpt, .j2c, .jpc), priority=0, untrusted, is_a, get_flags, header, load
7416 /// returns `VipsImage` - Output image
7417 ///
7418 /// filename: `&str` -> Filename to load from
7419 ///
7420 /// <ins>Optional arguments</ins>
7421 ///
7422 /// page: `i32` -> Load this page from the image
7423 ///
7424 /// oneshot: `bool` -> Load images a frame at a time
7425 ///
7426 /// flags: [`ForeignFlags`] -> Flags for this file
7427 ///
7428 /// memory: `bool` -> Force open via memory
7429 ///
7430 /// access: [`Access`] -> Required access pattern for this file
7431 ///
7432 /// fail_on: [`FailOn`] -> Error level to fail on
7433 ///
7434 /// revalidate: `bool` -> Don't use a cached result for this operation
7435 pub fn jp2kload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
7436 let mut out_out = VipsImage::from(null_mut());
7437 let vips_op_response = call(
7438 "jp2kload",
7439 option
7440 .set(
7441 "filename",
7442 filename,
7443 )
7444 .set(
7445 "out",
7446 &mut out_out,
7447 ),
7448 );
7449
7450 utils::result(
7451 vips_op_response,
7452 out_out,
7453 Error::OperationError("Jp2Kload (vips_jp2kload) failed".to_string()),
7454 )
7455 }
7456
7457 /// VipsForeignLoadJp2kBuffer (jp2kload_buffer), load JPEG2000 image, priority=0, untrusted, is_a_buffer, get_flags, header, load
7458 /// returns `VipsImage` - Output image
7459 ///
7460 /// buffer: `&[u8]` -> Buffer to load from
7461 pub fn jp2kload_buffer(buffer: &[u8]) -> Result<VipsImage> {
7462 let vips_blob = unsafe {
7463 vips_blob_new(
7464 None,
7465 buffer.as_ptr() as _,
7466 buffer.len() as _,
7467 )
7468 };
7469 let blob = VipsBlob::from(vips_blob);
7470 let mut out_out = VipsImage::from(null_mut());
7471 let vips_op_response = call(
7472 "jp2kload_buffer",
7473 VOption::new()
7474 .set(
7475 "buffer",
7476 &blob,
7477 )
7478 .set(
7479 "out",
7480 &mut out_out,
7481 ),
7482 );
7483 blob.area_unref();
7484 utils::result(
7485 vips_op_response,
7486 out_out,
7487 Error::OperationError("Jp2KloadBuffer (vips_jp2kload_buffer) failed".to_string()),
7488 )
7489 }
7490
7491 /// VipsForeignLoadJp2kBuffer (jp2kload_buffer), load JPEG2000 image, priority=0, untrusted, is_a_buffer, get_flags, header, load
7492 /// returns `VipsImage` - Output image
7493 ///
7494 /// buffer: `&[u8]` -> Buffer to load from
7495 ///
7496 /// <ins>Optional arguments</ins>
7497 ///
7498 /// page: `i32` -> Load this page from the image
7499 ///
7500 /// oneshot: `bool` -> Load images a frame at a time
7501 ///
7502 /// flags: [`ForeignFlags`] -> Flags for this file
7503 ///
7504 /// memory: `bool` -> Force open via memory
7505 ///
7506 /// access: [`Access`] -> Required access pattern for this file
7507 ///
7508 /// fail_on: [`FailOn`] -> Error level to fail on
7509 ///
7510 /// revalidate: `bool` -> Don't use a cached result for this operation
7511 pub fn jp2kload_buffer_with_opts(buffer: &[u8], option: VOption) -> Result<VipsImage> {
7512 let vips_blob = unsafe {
7513 vips_blob_new(
7514 None,
7515 buffer.as_ptr() as _,
7516 buffer.len() as _,
7517 )
7518 };
7519 let blob = VipsBlob::from(vips_blob);
7520 let mut out_out = VipsImage::from(null_mut());
7521 let vips_op_response = call(
7522 "jp2kload_buffer",
7523 option
7524 .set(
7525 "buffer",
7526 &blob,
7527 )
7528 .set(
7529 "out",
7530 &mut out_out,
7531 ),
7532 );
7533 blob.area_unref();
7534 utils::result(
7535 vips_op_response,
7536 out_out,
7537 Error::OperationError("Jp2KloadBuffer (vips_jp2kload_buffer) failed".to_string()),
7538 )
7539 }
7540
7541 /// VipsForeignLoadJp2kSource (jp2kload_source), load JPEG2000 image, priority=0, untrusted, is_a_source, get_flags, header, load
7542 /// returns `VipsImage` - Output image
7543 ///
7544 /// source: `&VipsSource` -> Source to load from
7545 pub fn jp2kload_source(source: &VipsSource) -> Result<VipsImage> {
7546 let mut out_out = VipsImage::from(null_mut());
7547 let vips_op_response = call(
7548 "jp2kload_source",
7549 VOption::new()
7550 .set(
7551 "source",
7552 source,
7553 )
7554 .set(
7555 "out",
7556 &mut out_out,
7557 ),
7558 );
7559
7560 utils::result(
7561 vips_op_response,
7562 out_out,
7563 Error::OperationError("Jp2KloadSource (vips_jp2kload_source) failed".to_string()),
7564 )
7565 }
7566
7567 /// VipsForeignLoadJp2kSource (jp2kload_source), load JPEG2000 image, priority=0, untrusted, is_a_source, get_flags, header, load
7568 /// returns `VipsImage` - Output image
7569 ///
7570 /// source: `&VipsSource` -> Source to load from
7571 ///
7572 /// <ins>Optional arguments</ins>
7573 ///
7574 /// page: `i32` -> Load this page from the image
7575 ///
7576 /// oneshot: `bool` -> Load images a frame at a time
7577 ///
7578 /// flags: [`ForeignFlags`] -> Flags for this file
7579 ///
7580 /// memory: `bool` -> Force open via memory
7581 ///
7582 /// access: [`Access`] -> Required access pattern for this file
7583 ///
7584 /// fail_on: [`FailOn`] -> Error level to fail on
7585 ///
7586 /// revalidate: `bool` -> Don't use a cached result for this operation
7587 pub fn jp2kload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
7588 let mut out_out = VipsImage::from(null_mut());
7589 let vips_op_response = call(
7590 "jp2kload_source",
7591 option
7592 .set(
7593 "source",
7594 source,
7595 )
7596 .set(
7597 "out",
7598 &mut out_out,
7599 ),
7600 );
7601
7602 utils::result(
7603 vips_op_response,
7604 out_out,
7605 Error::OperationError("Jp2KloadSource (vips_jp2kload_source) failed".to_string()),
7606 )
7607 }
7608
7609 /// VipsForeignSaveJp2kFile (jp2ksave), save image in JPEG2000 format (.j2k, .jp2, .jpt, .j2c, .jpc), priority=0,
7610 ///
7611 /// filename: `&str` -> Filename to save to
7612 pub fn jp2ksave(&self, filename: &str) -> Result<()> {
7613 let vips_op_response = call(
7614 "jp2ksave",
7615 VOption::new()
7616 .set("in", self)
7617 .set(
7618 "filename",
7619 filename,
7620 ),
7621 );
7622
7623 utils::result(
7624 vips_op_response,
7625 (),
7626 Error::OperationError("Jp2Ksave (vips_jp2ksave) failed".to_string()),
7627 )
7628 }
7629
7630 /// VipsForeignSaveJp2kFile (jp2ksave), save image in JPEG2000 format (.j2k, .jp2, .jpt, .j2c, .jpc), priority=0,
7631 ///
7632 /// filename: `&str` -> Filename to save to
7633 ///
7634 /// <ins>Optional arguments</ins>
7635 ///
7636 /// tile_width: `i32` -> Tile width in pixels
7637 ///
7638 /// tile_height: `i32` -> Tile height in pixels
7639 ///
7640 /// lossless: `bool` -> Enable lossless compression
7641 ///
7642 /// Q: `i32` -> Q factor
7643 ///
7644 /// subsample_mode: [`ForeignSubsample`] -> Select chroma subsample operation mode
7645 ///
7646 /// keep: [`ForeignKeep`] -> Which metadata to retain
7647 ///
7648 /// background: `&[f64]` -> Background value
7649 ///
7650 /// page_height: `i32` -> Set page height for multipage save
7651 ///
7652 /// profile: `&str` -> Filename of ICC profile to embed
7653 pub fn jp2ksave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
7654 let vips_op_response = call(
7655 "jp2ksave",
7656 option
7657 .set("in", self)
7658 .set(
7659 "filename",
7660 filename,
7661 ),
7662 );
7663
7664 utils::result(
7665 vips_op_response,
7666 (),
7667 Error::OperationError("Jp2Ksave (vips_jp2ksave) failed".to_string()),
7668 )
7669 }
7670
7671 /// VipsForeignSaveJp2kBuffer (jp2ksave_buffer), save image in JPEG2000 format (.j2k, .jp2, .jpt, .j2c, .jpc), priority=0,
7672 /// returns `Vec<u8>` - Buffer to save to
7673 pub fn jp2ksave_buffer(&self) -> Result<Vec<u8>> {
7674 let mut buffer_out = VipsBlob::from(null_mut());
7675 let vips_op_response = call(
7676 "jp2ksave_buffer",
7677 VOption::new()
7678 .set("in", self)
7679 .set(
7680 "buffer",
7681 &mut buffer_out,
7682 ),
7683 );
7684
7685 utils::result(
7686 vips_op_response,
7687 buffer_out.into(),
7688 Error::OperationError("Jp2KsaveBuffer (vips_jp2ksave_buffer) failed".to_string()),
7689 )
7690 }
7691
7692 /// VipsForeignSaveJp2kBuffer (jp2ksave_buffer), save image in JPEG2000 format (.j2k, .jp2, .jpt, .j2c, .jpc), priority=0,
7693 /// returns `Vec<u8>` - Buffer to save to
7694 ///
7695 /// <ins>Optional arguments</ins>
7696 ///
7697 /// tile_width: `i32` -> Tile width in pixels
7698 ///
7699 /// tile_height: `i32` -> Tile height in pixels
7700 ///
7701 /// lossless: `bool` -> Enable lossless compression
7702 ///
7703 /// Q: `i32` -> Q factor
7704 ///
7705 /// subsample_mode: [`ForeignSubsample`] -> Select chroma subsample operation mode
7706 ///
7707 /// keep: [`ForeignKeep`] -> Which metadata to retain
7708 ///
7709 /// background: `&[f64]` -> Background value
7710 ///
7711 /// page_height: `i32` -> Set page height for multipage save
7712 ///
7713 /// profile: `&str` -> Filename of ICC profile to embed
7714 pub fn jp2ksave_buffer_with_opts(&self, option: VOption) -> Result<Vec<u8>> {
7715 let mut buffer_out = VipsBlob::from(null_mut());
7716 let vips_op_response = call(
7717 "jp2ksave_buffer",
7718 option
7719 .set("in", self)
7720 .set(
7721 "buffer",
7722 &mut buffer_out,
7723 ),
7724 );
7725
7726 utils::result(
7727 vips_op_response,
7728 buffer_out.into(),
7729 Error::OperationError("Jp2KsaveBuffer (vips_jp2ksave_buffer) failed".to_string()),
7730 )
7731 }
7732
7733 /// VipsForeignSaveJp2kTarget (jp2ksave_target), save image in JPEG2000 format (.j2k, .jp2, .jpt, .j2c, .jpc), priority=0,
7734 ///
7735 /// target: `&VipsTarget` -> Target to save to
7736 pub fn jp2ksave_target(&self, target: &VipsTarget) -> Result<()> {
7737 let vips_op_response = call(
7738 "jp2ksave_target",
7739 VOption::new()
7740 .set("in", self)
7741 .set(
7742 "target",
7743 target,
7744 ),
7745 );
7746
7747 utils::result(
7748 vips_op_response,
7749 (),
7750 Error::OperationError("Jp2KsaveTarget (vips_jp2ksave_target) failed".to_string()),
7751 )
7752 }
7753
7754 /// VipsForeignSaveJp2kTarget (jp2ksave_target), save image in JPEG2000 format (.j2k, .jp2, .jpt, .j2c, .jpc), priority=0,
7755 ///
7756 /// target: `&VipsTarget` -> Target to save to
7757 ///
7758 /// <ins>Optional arguments</ins>
7759 ///
7760 /// tile_width: `i32` -> Tile width in pixels
7761 ///
7762 /// tile_height: `i32` -> Tile height in pixels
7763 ///
7764 /// lossless: `bool` -> Enable lossless compression
7765 ///
7766 /// Q: `i32` -> Q factor
7767 ///
7768 /// subsample_mode: [`ForeignSubsample`] -> Select chroma subsample operation mode
7769 ///
7770 /// keep: [`ForeignKeep`] -> Which metadata to retain
7771 ///
7772 /// background: `&[f64]` -> Background value
7773 ///
7774 /// page_height: `i32` -> Set page height for multipage save
7775 ///
7776 /// profile: `&str` -> Filename of ICC profile to embed
7777 pub fn jp2ksave_target_with_opts(&self, target: &VipsTarget, option: VOption) -> Result<()> {
7778 let vips_op_response = call(
7779 "jp2ksave_target",
7780 option
7781 .set("in", self)
7782 .set(
7783 "target",
7784 target,
7785 ),
7786 );
7787
7788 utils::result(
7789 vips_op_response,
7790 (),
7791 Error::OperationError("Jp2KsaveTarget (vips_jp2ksave_target) failed".to_string()),
7792 )
7793 }
7794
7795 /// VipsForeignLoadJpegFile (jpegload), load jpeg from file (.jpg, .jpeg, .jpe, .jfif), priority=50, is_a, get_flags, get_flags_filename, header, load
7796 /// returns `VipsImage` - Output image
7797 ///
7798 /// filename: `&str` -> Filename to load from
7799 pub fn jpegload(filename: &str) -> Result<VipsImage> {
7800 let mut out_out = VipsImage::from(null_mut());
7801 let vips_op_response = call(
7802 "jpegload",
7803 VOption::new()
7804 .set(
7805 "filename",
7806 filename,
7807 )
7808 .set(
7809 "out",
7810 &mut out_out,
7811 ),
7812 );
7813
7814 utils::result(
7815 vips_op_response,
7816 out_out,
7817 Error::OperationError("Jpegload (vips_jpegload) failed".to_string()),
7818 )
7819 }
7820
7821 /// VipsForeignLoadJpegFile (jpegload), load jpeg from file (.jpg, .jpeg, .jpe, .jfif), priority=50, is_a, get_flags, get_flags_filename, header, load
7822 /// returns `VipsImage` - Output image
7823 ///
7824 /// filename: `&str` -> Filename to load from
7825 ///
7826 /// <ins>Optional arguments</ins>
7827 ///
7828 /// shrink: `i32` -> Shrink factor on load
7829 ///
7830 /// autorotate: `bool` -> Rotate image using exif orientation
7831 ///
7832 /// unlimited: `bool` -> Remove all denial of service limits
7833 ///
7834 /// flags: [`ForeignFlags`] -> Flags for this file
7835 ///
7836 /// memory: `bool` -> Force open via memory
7837 ///
7838 /// access: [`Access`] -> Required access pattern for this file
7839 ///
7840 /// fail_on: [`FailOn`] -> Error level to fail on
7841 ///
7842 /// revalidate: `bool` -> Don't use a cached result for this operation
7843 pub fn jpegload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
7844 let mut out_out = VipsImage::from(null_mut());
7845 let vips_op_response = call(
7846 "jpegload",
7847 option
7848 .set(
7849 "filename",
7850 filename,
7851 )
7852 .set(
7853 "out",
7854 &mut out_out,
7855 ),
7856 );
7857
7858 utils::result(
7859 vips_op_response,
7860 out_out,
7861 Error::OperationError("Jpegload (vips_jpegload) failed".to_string()),
7862 )
7863 }
7864
7865 /// VipsForeignLoadJpegBuffer (jpegload_buffer), load jpeg from buffer, priority=50, is_a_buffer, get_flags, get_flags_filename, header, load
7866 /// returns `VipsImage` - Output image
7867 ///
7868 /// buffer: `&[u8]` -> Buffer to load from
7869 pub fn jpegload_buffer(buffer: &[u8]) -> Result<VipsImage> {
7870 let vips_blob = unsafe {
7871 vips_blob_new(
7872 None,
7873 buffer.as_ptr() as _,
7874 buffer.len() as _,
7875 )
7876 };
7877 let blob = VipsBlob::from(vips_blob);
7878 let mut out_out = VipsImage::from(null_mut());
7879 let vips_op_response = call(
7880 "jpegload_buffer",
7881 VOption::new()
7882 .set(
7883 "buffer",
7884 &blob,
7885 )
7886 .set(
7887 "out",
7888 &mut out_out,
7889 ),
7890 );
7891 blob.area_unref();
7892 utils::result(
7893 vips_op_response,
7894 out_out,
7895 Error::OperationError("JpegloadBuffer (vips_jpegload_buffer) failed".to_string()),
7896 )
7897 }
7898
7899 /// VipsForeignLoadJpegBuffer (jpegload_buffer), load jpeg from buffer, priority=50, is_a_buffer, get_flags, get_flags_filename, header, load
7900 /// returns `VipsImage` - Output image
7901 ///
7902 /// buffer: `&[u8]` -> Buffer to load from
7903 ///
7904 /// <ins>Optional arguments</ins>
7905 ///
7906 /// shrink: `i32` -> Shrink factor on load
7907 ///
7908 /// autorotate: `bool` -> Rotate image using exif orientation
7909 ///
7910 /// unlimited: `bool` -> Remove all denial of service limits
7911 ///
7912 /// flags: [`ForeignFlags`] -> Flags for this file
7913 ///
7914 /// memory: `bool` -> Force open via memory
7915 ///
7916 /// access: [`Access`] -> Required access pattern for this file
7917 ///
7918 /// fail_on: [`FailOn`] -> Error level to fail on
7919 ///
7920 /// revalidate: `bool` -> Don't use a cached result for this operation
7921 pub fn jpegload_buffer_with_opts(buffer: &[u8], option: VOption) -> Result<VipsImage> {
7922 let vips_blob = unsafe {
7923 vips_blob_new(
7924 None,
7925 buffer.as_ptr() as _,
7926 buffer.len() as _,
7927 )
7928 };
7929 let blob = VipsBlob::from(vips_blob);
7930 let mut out_out = VipsImage::from(null_mut());
7931 let vips_op_response = call(
7932 "jpegload_buffer",
7933 option
7934 .set(
7935 "buffer",
7936 &blob,
7937 )
7938 .set(
7939 "out",
7940 &mut out_out,
7941 ),
7942 );
7943 blob.area_unref();
7944 utils::result(
7945 vips_op_response,
7946 out_out,
7947 Error::OperationError("JpegloadBuffer (vips_jpegload_buffer) failed".to_string()),
7948 )
7949 }
7950
7951 /// VipsForeignLoadJpegSource (jpegload_source), load image from jpeg source, priority=50, is_a_source, get_flags, get_flags_filename, header, load
7952 /// returns `VipsImage` - Output image
7953 ///
7954 /// source: `&VipsSource` -> Source to load from
7955 pub fn jpegload_source(source: &VipsSource) -> Result<VipsImage> {
7956 let mut out_out = VipsImage::from(null_mut());
7957 let vips_op_response = call(
7958 "jpegload_source",
7959 VOption::new()
7960 .set(
7961 "source",
7962 source,
7963 )
7964 .set(
7965 "out",
7966 &mut out_out,
7967 ),
7968 );
7969
7970 utils::result(
7971 vips_op_response,
7972 out_out,
7973 Error::OperationError("JpegloadSource (vips_jpegload_source) failed".to_string()),
7974 )
7975 }
7976
7977 /// VipsForeignLoadJpegSource (jpegload_source), load image from jpeg source, priority=50, is_a_source, get_flags, get_flags_filename, header, load
7978 /// returns `VipsImage` - Output image
7979 ///
7980 /// source: `&VipsSource` -> Source to load from
7981 ///
7982 /// <ins>Optional arguments</ins>
7983 ///
7984 /// shrink: `i32` -> Shrink factor on load
7985 ///
7986 /// autorotate: `bool` -> Rotate image using exif orientation
7987 ///
7988 /// unlimited: `bool` -> Remove all denial of service limits
7989 ///
7990 /// flags: [`ForeignFlags`] -> Flags for this file
7991 ///
7992 /// memory: `bool` -> Force open via memory
7993 ///
7994 /// access: [`Access`] -> Required access pattern for this file
7995 ///
7996 /// fail_on: [`FailOn`] -> Error level to fail on
7997 ///
7998 /// revalidate: `bool` -> Don't use a cached result for this operation
7999 pub fn jpegload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
8000 let mut out_out = VipsImage::from(null_mut());
8001 let vips_op_response = call(
8002 "jpegload_source",
8003 option
8004 .set(
8005 "source",
8006 source,
8007 )
8008 .set(
8009 "out",
8010 &mut out_out,
8011 ),
8012 );
8013
8014 utils::result(
8015 vips_op_response,
8016 out_out,
8017 Error::OperationError("JpegloadSource (vips_jpegload_source) failed".to_string()),
8018 )
8019 }
8020
8021 /// VipsForeignSaveJpegFile (jpegsave), save image to jpeg file (.jpg, .jpeg, .jpe, .jfif), priority=0, mono rgb cmyk
8022 ///
8023 /// filename: `&str` -> Filename to save to
8024 pub fn jpegsave(&self, filename: &str) -> Result<()> {
8025 let vips_op_response = call(
8026 "jpegsave",
8027 VOption::new()
8028 .set("in", self)
8029 .set(
8030 "filename",
8031 filename,
8032 ),
8033 );
8034
8035 utils::result(
8036 vips_op_response,
8037 (),
8038 Error::OperationError("Jpegsave (vips_jpegsave) failed".to_string()),
8039 )
8040 }
8041
8042 /// VipsForeignSaveJpegFile (jpegsave), save image to jpeg file (.jpg, .jpeg, .jpe, .jfif), priority=0, mono rgb cmyk
8043 ///
8044 /// filename: `&str` -> Filename to save to
8045 ///
8046 /// <ins>Optional arguments</ins>
8047 ///
8048 /// Q: `i32` -> Q factor
8049 ///
8050 /// optimize_coding: `bool` -> Compute optimal Huffman coding tables
8051 ///
8052 /// interlace: `bool` -> Generate an interlaced (progressive) jpeg
8053 ///
8054 /// trellis_quant: `bool` -> Apply trellis quantisation to each 8x8 block
8055 ///
8056 /// overshoot_deringing: `bool` -> Apply overshooting to samples with extreme values
8057 ///
8058 /// optimize_scans: `bool` -> Split spectrum of DCT coefficients into separate scans
8059 ///
8060 /// quant_table: `i32` -> Use predefined quantization table with given index
8061 ///
8062 /// subsample_mode: [`ForeignSubsample`] -> Select chroma subsample operation mode
8063 ///
8064 /// restart_interval: `i32` -> Add restart markers every specified number of mcu
8065 ///
8066 /// keep: [`ForeignKeep`] -> Which metadata to retain
8067 ///
8068 /// background: `&[f64]` -> Background value
8069 ///
8070 /// page_height: `i32` -> Set page height for multipage save
8071 ///
8072 /// profile: `&str` -> Filename of ICC profile to embed
8073 pub fn jpegsave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
8074 let vips_op_response = call(
8075 "jpegsave",
8076 option
8077 .set("in", self)
8078 .set(
8079 "filename",
8080 filename,
8081 ),
8082 );
8083
8084 utils::result(
8085 vips_op_response,
8086 (),
8087 Error::OperationError("Jpegsave (vips_jpegsave) failed".to_string()),
8088 )
8089 }
8090
8091 /// VipsForeignSaveJpegBuffer (jpegsave_buffer), save image to jpeg buffer (.jpg, .jpeg, .jpe, .jfif), priority=0, mono rgb cmyk
8092 /// returns `Vec<u8>` - Buffer to save to
8093 pub fn jpegsave_buffer(&self) -> Result<Vec<u8>> {
8094 let mut buffer_out = VipsBlob::from(null_mut());
8095 let vips_op_response = call(
8096 "jpegsave_buffer",
8097 VOption::new()
8098 .set("in", self)
8099 .set(
8100 "buffer",
8101 &mut buffer_out,
8102 ),
8103 );
8104
8105 utils::result(
8106 vips_op_response,
8107 buffer_out.into(),
8108 Error::OperationError("JpegsaveBuffer (vips_jpegsave_buffer) failed".to_string()),
8109 )
8110 }
8111
8112 /// VipsForeignSaveJpegBuffer (jpegsave_buffer), save image to jpeg buffer (.jpg, .jpeg, .jpe, .jfif), priority=0, mono rgb cmyk
8113 /// returns `Vec<u8>` - Buffer to save to
8114 ///
8115 /// <ins>Optional arguments</ins>
8116 ///
8117 /// Q: `i32` -> Q factor
8118 ///
8119 /// optimize_coding: `bool` -> Compute optimal Huffman coding tables
8120 ///
8121 /// interlace: `bool` -> Generate an interlaced (progressive) jpeg
8122 ///
8123 /// trellis_quant: `bool` -> Apply trellis quantisation to each 8x8 block
8124 ///
8125 /// overshoot_deringing: `bool` -> Apply overshooting to samples with extreme values
8126 ///
8127 /// optimize_scans: `bool` -> Split spectrum of DCT coefficients into separate scans
8128 ///
8129 /// quant_table: `i32` -> Use predefined quantization table with given index
8130 ///
8131 /// subsample_mode: [`ForeignSubsample`] -> Select chroma subsample operation mode
8132 ///
8133 /// restart_interval: `i32` -> Add restart markers every specified number of mcu
8134 ///
8135 /// keep: [`ForeignKeep`] -> Which metadata to retain
8136 ///
8137 /// background: `&[f64]` -> Background value
8138 ///
8139 /// page_height: `i32` -> Set page height for multipage save
8140 ///
8141 /// profile: `&str` -> Filename of ICC profile to embed
8142 pub fn jpegsave_buffer_with_opts(&self, option: VOption) -> Result<Vec<u8>> {
8143 let mut buffer_out = VipsBlob::from(null_mut());
8144 let vips_op_response = call(
8145 "jpegsave_buffer",
8146 option
8147 .set("in", self)
8148 .set(
8149 "buffer",
8150 &mut buffer_out,
8151 ),
8152 );
8153
8154 utils::result(
8155 vips_op_response,
8156 buffer_out.into(),
8157 Error::OperationError("JpegsaveBuffer (vips_jpegsave_buffer) failed".to_string()),
8158 )
8159 }
8160
8161 /// VipsForeignSaveJpegMime (jpegsave_mime), save image to jpeg mime (.jpg, .jpeg, .jpe, .jfif), priority=0, mono rgb cmyk
8162 pub fn jpegsave_mime(&self) -> Result<()> {
8163 let vips_op_response = call(
8164 "jpegsave_mime",
8165 VOption::new().set("in", self),
8166 );
8167
8168 utils::result(
8169 vips_op_response,
8170 (),
8171 Error::OperationError("JpegsaveMime (vips_jpegsave_mime) failed".to_string()),
8172 )
8173 }
8174
8175 /// VipsForeignSaveJpegMime (jpegsave_mime), save image to jpeg mime (.jpg, .jpeg, .jpe, .jfif), priority=0, mono rgb cmyk
8176 ///
8177 /// <ins>Optional arguments</ins>
8178 ///
8179 /// Q: `i32` -> Q factor
8180 ///
8181 /// optimize_coding: `bool` -> Compute optimal Huffman coding tables
8182 ///
8183 /// interlace: `bool` -> Generate an interlaced (progressive) jpeg
8184 ///
8185 /// trellis_quant: `bool` -> Apply trellis quantisation to each 8x8 block
8186 ///
8187 /// overshoot_deringing: `bool` -> Apply overshooting to samples with extreme values
8188 ///
8189 /// optimize_scans: `bool` -> Split spectrum of DCT coefficients into separate scans
8190 ///
8191 /// quant_table: `i32` -> Use predefined quantization table with given index
8192 ///
8193 /// subsample_mode: [`ForeignSubsample`] -> Select chroma subsample operation mode
8194 ///
8195 /// restart_interval: `i32` -> Add restart markers every specified number of mcu
8196 ///
8197 /// keep: [`ForeignKeep`] -> Which metadata to retain
8198 ///
8199 /// background: `&[f64]` -> Background value
8200 ///
8201 /// page_height: `i32` -> Set page height for multipage save
8202 ///
8203 /// profile: `&str` -> Filename of ICC profile to embed
8204 pub fn jpegsave_mime_with_opts(&self, option: VOption) -> Result<()> {
8205 let vips_op_response = call(
8206 "jpegsave_mime",
8207 option.set("in", self),
8208 );
8209
8210 utils::result(
8211 vips_op_response,
8212 (),
8213 Error::OperationError("JpegsaveMime (vips_jpegsave_mime) failed".to_string()),
8214 )
8215 }
8216
8217 /// VipsForeignSaveJpegTarget (jpegsave_target), save image to jpeg target (.jpg, .jpeg, .jpe, .jfif), priority=0, mono rgb cmyk
8218 ///
8219 /// target: `&VipsTarget` -> Target to save to
8220 pub fn jpegsave_target(&self, target: &VipsTarget) -> Result<()> {
8221 let vips_op_response = call(
8222 "jpegsave_target",
8223 VOption::new()
8224 .set("in", self)
8225 .set(
8226 "target",
8227 target,
8228 ),
8229 );
8230
8231 utils::result(
8232 vips_op_response,
8233 (),
8234 Error::OperationError("JpegsaveTarget (vips_jpegsave_target) failed".to_string()),
8235 )
8236 }
8237
8238 /// VipsForeignSaveJpegTarget (jpegsave_target), save image to jpeg target (.jpg, .jpeg, .jpe, .jfif), priority=0, mono rgb cmyk
8239 ///
8240 /// target: `&VipsTarget` -> Target to save to
8241 ///
8242 /// <ins>Optional arguments</ins>
8243 ///
8244 /// Q: `i32` -> Q factor
8245 ///
8246 /// optimize_coding: `bool` -> Compute optimal Huffman coding tables
8247 ///
8248 /// interlace: `bool` -> Generate an interlaced (progressive) jpeg
8249 ///
8250 /// trellis_quant: `bool` -> Apply trellis quantisation to each 8x8 block
8251 ///
8252 /// overshoot_deringing: `bool` -> Apply overshooting to samples with extreme values
8253 ///
8254 /// optimize_scans: `bool` -> Split spectrum of DCT coefficients into separate scans
8255 ///
8256 /// quant_table: `i32` -> Use predefined quantization table with given index
8257 ///
8258 /// subsample_mode: [`ForeignSubsample`] -> Select chroma subsample operation mode
8259 ///
8260 /// restart_interval: `i32` -> Add restart markers every specified number of mcu
8261 ///
8262 /// keep: [`ForeignKeep`] -> Which metadata to retain
8263 ///
8264 /// background: `&[f64]` -> Background value
8265 ///
8266 /// page_height: `i32` -> Set page height for multipage save
8267 ///
8268 /// profile: `&str` -> Filename of ICC profile to embed
8269 pub fn jpegsave_target_with_opts(&self, target: &VipsTarget, option: VOption) -> Result<()> {
8270 let vips_op_response = call(
8271 "jpegsave_target",
8272 option
8273 .set("in", self)
8274 .set(
8275 "target",
8276 target,
8277 ),
8278 );
8279
8280 utils::result(
8281 vips_op_response,
8282 (),
8283 Error::OperationError("JpegsaveTarget (vips_jpegsave_target) failed".to_string()),
8284 )
8285 }
8286
8287 /// VipsForeignLoadJxlFile (jxlload), load JPEG-XL image (.jxl), priority=0, untrusted, is_a, get_flags, header, load
8288 /// returns `VipsImage` - Output image
8289 ///
8290 /// filename: `&str` -> Filename to load from
8291 pub fn jxlload(filename: &str) -> Result<VipsImage> {
8292 let mut out_out = VipsImage::from(null_mut());
8293 let vips_op_response = call(
8294 "jxlload",
8295 VOption::new()
8296 .set(
8297 "filename",
8298 filename,
8299 )
8300 .set(
8301 "out",
8302 &mut out_out,
8303 ),
8304 );
8305
8306 utils::result(
8307 vips_op_response,
8308 out_out,
8309 Error::OperationError("Jxlload (vips_jxlload) failed".to_string()),
8310 )
8311 }
8312
8313 /// VipsForeignLoadJxlFile (jxlload), load JPEG-XL image (.jxl), priority=0, untrusted, is_a, get_flags, header, load
8314 /// returns `VipsImage` - Output image
8315 ///
8316 /// filename: `&str` -> Filename to load from
8317 ///
8318 /// <ins>Optional arguments</ins>
8319 ///
8320 /// page: `i32` -> First page to load
8321 ///
8322 /// n: `i32` -> Number of pages to load, -1 for all
8323 ///
8324 /// flags: [`ForeignFlags`] -> Flags for this file
8325 ///
8326 /// memory: `bool` -> Force open via memory
8327 ///
8328 /// access: [`Access`] -> Required access pattern for this file
8329 ///
8330 /// fail_on: [`FailOn`] -> Error level to fail on
8331 ///
8332 /// revalidate: `bool` -> Don't use a cached result for this operation
8333 pub fn jxlload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
8334 let mut out_out = VipsImage::from(null_mut());
8335 let vips_op_response = call(
8336 "jxlload",
8337 option
8338 .set(
8339 "filename",
8340 filename,
8341 )
8342 .set(
8343 "out",
8344 &mut out_out,
8345 ),
8346 );
8347
8348 utils::result(
8349 vips_op_response,
8350 out_out,
8351 Error::OperationError("Jxlload (vips_jxlload) failed".to_string()),
8352 )
8353 }
8354
8355 /// VipsForeignLoadJxlBuffer (jxlload_buffer), load JPEG-XL image, priority=0, untrusted, is_a_buffer, get_flags, header, load
8356 /// returns `VipsImage` - Output image
8357 ///
8358 /// buffer: `&[u8]` -> Buffer to load from
8359 pub fn jxlload_buffer(buffer: &[u8]) -> Result<VipsImage> {
8360 let vips_blob = unsafe {
8361 vips_blob_new(
8362 None,
8363 buffer.as_ptr() as _,
8364 buffer.len() as _,
8365 )
8366 };
8367 let blob = VipsBlob::from(vips_blob);
8368 let mut out_out = VipsImage::from(null_mut());
8369 let vips_op_response = call(
8370 "jxlload_buffer",
8371 VOption::new()
8372 .set(
8373 "buffer",
8374 &blob,
8375 )
8376 .set(
8377 "out",
8378 &mut out_out,
8379 ),
8380 );
8381 blob.area_unref();
8382 utils::result(
8383 vips_op_response,
8384 out_out,
8385 Error::OperationError("JxlloadBuffer (vips_jxlload_buffer) failed".to_string()),
8386 )
8387 }
8388
8389 /// VipsForeignLoadJxlBuffer (jxlload_buffer), load JPEG-XL image, priority=0, untrusted, is_a_buffer, get_flags, header, load
8390 /// returns `VipsImage` - Output image
8391 ///
8392 /// buffer: `&[u8]` -> Buffer to load from
8393 ///
8394 /// <ins>Optional arguments</ins>
8395 ///
8396 /// page: `i32` -> First page to load
8397 ///
8398 /// n: `i32` -> Number of pages to load, -1 for all
8399 ///
8400 /// flags: [`ForeignFlags`] -> Flags for this file
8401 ///
8402 /// memory: `bool` -> Force open via memory
8403 ///
8404 /// access: [`Access`] -> Required access pattern for this file
8405 ///
8406 /// fail_on: [`FailOn`] -> Error level to fail on
8407 ///
8408 /// revalidate: `bool` -> Don't use a cached result for this operation
8409 pub fn jxlload_buffer_with_opts(buffer: &[u8], option: VOption) -> Result<VipsImage> {
8410 let vips_blob = unsafe {
8411 vips_blob_new(
8412 None,
8413 buffer.as_ptr() as _,
8414 buffer.len() as _,
8415 )
8416 };
8417 let blob = VipsBlob::from(vips_blob);
8418 let mut out_out = VipsImage::from(null_mut());
8419 let vips_op_response = call(
8420 "jxlload_buffer",
8421 option
8422 .set(
8423 "buffer",
8424 &blob,
8425 )
8426 .set(
8427 "out",
8428 &mut out_out,
8429 ),
8430 );
8431 blob.area_unref();
8432 utils::result(
8433 vips_op_response,
8434 out_out,
8435 Error::OperationError("JxlloadBuffer (vips_jxlload_buffer) failed".to_string()),
8436 )
8437 }
8438
8439 /// VipsForeignLoadJxlSource (jxlload_source), load JPEG-XL image, priority=0, untrusted, is_a_source, get_flags, header, load
8440 /// returns `VipsImage` - Output image
8441 ///
8442 /// source: `&VipsSource` -> Source to load from
8443 pub fn jxlload_source(source: &VipsSource) -> Result<VipsImage> {
8444 let mut out_out = VipsImage::from(null_mut());
8445 let vips_op_response = call(
8446 "jxlload_source",
8447 VOption::new()
8448 .set(
8449 "source",
8450 source,
8451 )
8452 .set(
8453 "out",
8454 &mut out_out,
8455 ),
8456 );
8457
8458 utils::result(
8459 vips_op_response,
8460 out_out,
8461 Error::OperationError("JxlloadSource (vips_jxlload_source) failed".to_string()),
8462 )
8463 }
8464
8465 /// VipsForeignLoadJxlSource (jxlload_source), load JPEG-XL image, priority=0, untrusted, is_a_source, get_flags, header, load
8466 /// returns `VipsImage` - Output image
8467 ///
8468 /// source: `&VipsSource` -> Source to load from
8469 ///
8470 /// <ins>Optional arguments</ins>
8471 ///
8472 /// page: `i32` -> First page to load
8473 ///
8474 /// n: `i32` -> Number of pages to load, -1 for all
8475 ///
8476 /// flags: [`ForeignFlags`] -> Flags for this file
8477 ///
8478 /// memory: `bool` -> Force open via memory
8479 ///
8480 /// access: [`Access`] -> Required access pattern for this file
8481 ///
8482 /// fail_on: [`FailOn`] -> Error level to fail on
8483 ///
8484 /// revalidate: `bool` -> Don't use a cached result for this operation
8485 pub fn jxlload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
8486 let mut out_out = VipsImage::from(null_mut());
8487 let vips_op_response = call(
8488 "jxlload_source",
8489 option
8490 .set(
8491 "source",
8492 source,
8493 )
8494 .set(
8495 "out",
8496 &mut out_out,
8497 ),
8498 );
8499
8500 utils::result(
8501 vips_op_response,
8502 out_out,
8503 Error::OperationError("JxlloadSource (vips_jxlload_source) failed".to_string()),
8504 )
8505 }
8506
8507 /// VipsForeignSaveJxlFile (jxlsave), save image in JPEG-XL format (.jxl), priority=0, untrusted,
8508 ///
8509 /// filename: `&str` -> Filename to save to
8510 pub fn jxlsave(&self, filename: &str) -> Result<()> {
8511 let vips_op_response = call(
8512 "jxlsave",
8513 VOption::new()
8514 .set("in", self)
8515 .set(
8516 "filename",
8517 filename,
8518 ),
8519 );
8520
8521 utils::result(
8522 vips_op_response,
8523 (),
8524 Error::OperationError("Jxlsave (vips_jxlsave) failed".to_string()),
8525 )
8526 }
8527
8528 /// VipsForeignSaveJxlFile (jxlsave), save image in JPEG-XL format (.jxl), priority=0, untrusted,
8529 ///
8530 /// filename: `&str` -> Filename to save to
8531 ///
8532 /// <ins>Optional arguments</ins>
8533 ///
8534 /// tier: `i32` -> Decode speed tier
8535 ///
8536 /// distance: `f64` -> Target butteraugli distance
8537 ///
8538 /// effort: `i32` -> Encoding effort
8539 ///
8540 /// lossless: `bool` -> Enable lossless compression
8541 ///
8542 /// Q: `i32` -> Quality factor
8543 ///
8544 /// keep: [`ForeignKeep`] -> Which metadata to retain
8545 ///
8546 /// background: `&[f64]` -> Background value
8547 ///
8548 /// page_height: `i32` -> Set page height for multipage save
8549 ///
8550 /// profile: `&str` -> Filename of ICC profile to embed
8551 pub fn jxlsave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
8552 let vips_op_response = call(
8553 "jxlsave",
8554 option
8555 .set("in", self)
8556 .set(
8557 "filename",
8558 filename,
8559 ),
8560 );
8561
8562 utils::result(
8563 vips_op_response,
8564 (),
8565 Error::OperationError("Jxlsave (vips_jxlsave) failed".to_string()),
8566 )
8567 }
8568
8569 /// VipsForeignSaveJxlBuffer (jxlsave_buffer), save image in JPEG-XL format (.jxl), priority=0, untrusted,
8570 /// returns `Vec<u8>` - Buffer to save to
8571 pub fn jxlsave_buffer(&self) -> Result<Vec<u8>> {
8572 let mut buffer_out = VipsBlob::from(null_mut());
8573 let vips_op_response = call(
8574 "jxlsave_buffer",
8575 VOption::new()
8576 .set("in", self)
8577 .set(
8578 "buffer",
8579 &mut buffer_out,
8580 ),
8581 );
8582
8583 utils::result(
8584 vips_op_response,
8585 buffer_out.into(),
8586 Error::OperationError("JxlsaveBuffer (vips_jxlsave_buffer) failed".to_string()),
8587 )
8588 }
8589
8590 /// VipsForeignSaveJxlBuffer (jxlsave_buffer), save image in JPEG-XL format (.jxl), priority=0, untrusted,
8591 /// returns `Vec<u8>` - Buffer to save to
8592 ///
8593 /// <ins>Optional arguments</ins>
8594 ///
8595 /// tier: `i32` -> Decode speed tier
8596 ///
8597 /// distance: `f64` -> Target butteraugli distance
8598 ///
8599 /// effort: `i32` -> Encoding effort
8600 ///
8601 /// lossless: `bool` -> Enable lossless compression
8602 ///
8603 /// Q: `i32` -> Quality factor
8604 ///
8605 /// keep: [`ForeignKeep`] -> Which metadata to retain
8606 ///
8607 /// background: `&[f64]` -> Background value
8608 ///
8609 /// page_height: `i32` -> Set page height for multipage save
8610 ///
8611 /// profile: `&str` -> Filename of ICC profile to embed
8612 pub fn jxlsave_buffer_with_opts(&self, option: VOption) -> Result<Vec<u8>> {
8613 let mut buffer_out = VipsBlob::from(null_mut());
8614 let vips_op_response = call(
8615 "jxlsave_buffer",
8616 option
8617 .set("in", self)
8618 .set(
8619 "buffer",
8620 &mut buffer_out,
8621 ),
8622 );
8623
8624 utils::result(
8625 vips_op_response,
8626 buffer_out.into(),
8627 Error::OperationError("JxlsaveBuffer (vips_jxlsave_buffer) failed".to_string()),
8628 )
8629 }
8630
8631 /// VipsForeignSaveJxlTarget (jxlsave_target), save image in JPEG-XL format (.jxl), priority=0, untrusted,
8632 ///
8633 /// target: `&VipsTarget` -> Target to save to
8634 pub fn jxlsave_target(&self, target: &VipsTarget) -> Result<()> {
8635 let vips_op_response = call(
8636 "jxlsave_target",
8637 VOption::new()
8638 .set("in", self)
8639 .set(
8640 "target",
8641 target,
8642 ),
8643 );
8644
8645 utils::result(
8646 vips_op_response,
8647 (),
8648 Error::OperationError("JxlsaveTarget (vips_jxlsave_target) failed".to_string()),
8649 )
8650 }
8651
8652 /// VipsForeignSaveJxlTarget (jxlsave_target), save image in JPEG-XL format (.jxl), priority=0, untrusted,
8653 ///
8654 /// target: `&VipsTarget` -> Target to save to
8655 ///
8656 /// <ins>Optional arguments</ins>
8657 ///
8658 /// tier: `i32` -> Decode speed tier
8659 ///
8660 /// distance: `f64` -> Target butteraugli distance
8661 ///
8662 /// effort: `i32` -> Encoding effort
8663 ///
8664 /// lossless: `bool` -> Enable lossless compression
8665 ///
8666 /// Q: `i32` -> Quality factor
8667 ///
8668 /// keep: [`ForeignKeep`] -> Which metadata to retain
8669 ///
8670 /// background: `&[f64]` -> Background value
8671 ///
8672 /// page_height: `i32` -> Set page height for multipage save
8673 ///
8674 /// profile: `&str` -> Filename of ICC profile to embed
8675 pub fn jxlsave_target_with_opts(&self, target: &VipsTarget, option: VOption) -> Result<()> {
8676 let vips_op_response = call(
8677 "jxlsave_target",
8678 option
8679 .set("in", self)
8680 .set(
8681 "target",
8682 target,
8683 ),
8684 );
8685
8686 utils::result(
8687 vips_op_response,
8688 (),
8689 Error::OperationError("JxlsaveTarget (vips_jxlsave_target) failed".to_string()),
8690 )
8691 }
8692
8693 /// VipsLabelregions (labelregions), label regions in an image
8694 /// returns `VipsImage` - Mask of region labels
8695 pub fn labelregions(&self) -> Result<VipsImage> {
8696 let mut mask_out = VipsImage::from(null_mut());
8697 let vips_op_response = call(
8698 "labelregions",
8699 VOption::new()
8700 .set("in", self)
8701 .set(
8702 "mask",
8703 &mut mask_out,
8704 ),
8705 );
8706
8707 utils::result(
8708 vips_op_response,
8709 mask_out,
8710 Error::OperationError("Labelregions (vips_labelregions) failed".to_string()),
8711 )
8712 }
8713
8714 /// VipsLabelregions (labelregions), label regions in an image
8715 /// returns `VipsImage` - Mask of region labels
8716 ///
8717 /// <ins>Optional arguments</ins>
8718 ///
8719 /// segments: `&mut i32` -> Number of discrete contiguous regions
8720 pub fn labelregions_with_opts(&self, option: VOption) -> Result<VipsImage> {
8721 let mut mask_out = VipsImage::from(null_mut());
8722 let vips_op_response = call(
8723 "labelregions",
8724 option
8725 .set("in", self)
8726 .set(
8727 "mask",
8728 &mut mask_out,
8729 ),
8730 );
8731
8732 utils::result(
8733 vips_op_response,
8734 mask_out,
8735 Error::OperationError("Labelregions (vips_labelregions) failed".to_string()),
8736 )
8737 }
8738
8739 /// VipsLinear (linear), calculate (a * in + b)
8740 /// returns `VipsImage` - Output image
8741 ///
8742 /// a: `&[f64]` -> Multiply by this
8743 ///
8744 /// b: `&[f64]` -> Add this
8745 pub fn linear(&self, a: &[f64], b: &[f64]) -> Result<VipsImage> {
8746 let mut out_out = VipsImage::from(null_mut());
8747 let vips_op_response = call(
8748 "linear",
8749 VOption::new()
8750 .set("in", self)
8751 .set(
8752 "out",
8753 &mut out_out,
8754 )
8755 .set("a", a)
8756 .set("b", b),
8757 );
8758
8759 utils::result(
8760 vips_op_response,
8761 out_out,
8762 Error::OperationError("Linear (vips_linear) failed".to_string()),
8763 )
8764 }
8765
8766 /// VipsLinear (linear), calculate (a * in + b)
8767 /// returns `VipsImage` - Output image
8768 ///
8769 /// a: `&[f64]` -> Multiply by this
8770 ///
8771 /// b: `&[f64]` -> Add this
8772 ///
8773 /// <ins>Optional arguments</ins>
8774 ///
8775 /// uchar: `bool` -> Output should be uchar
8776 pub fn linear_with_opts(&self, a: &[f64], b: &[f64], option: VOption) -> Result<VipsImage> {
8777 let mut out_out = VipsImage::from(null_mut());
8778 let vips_op_response = call(
8779 "linear",
8780 option
8781 .set("in", self)
8782 .set(
8783 "out",
8784 &mut out_out,
8785 )
8786 .set("a", a)
8787 .set("b", b),
8788 );
8789
8790 utils::result(
8791 vips_op_response,
8792 out_out,
8793 Error::OperationError("Linear (vips_linear) failed".to_string()),
8794 )
8795 }
8796
8797 /// VipsLineCache (linecache), cache an image as a set of lines
8798 /// returns `VipsImage` - Output image
8799 pub fn linecache(&self) -> Result<VipsImage> {
8800 let mut out_out = VipsImage::from(null_mut());
8801 let vips_op_response = call(
8802 "linecache",
8803 VOption::new()
8804 .set("in", self)
8805 .set(
8806 "out",
8807 &mut out_out,
8808 ),
8809 );
8810
8811 utils::result(
8812 vips_op_response,
8813 out_out,
8814 Error::OperationError("Linecache (vips_linecache) failed".to_string()),
8815 )
8816 }
8817
8818 /// VipsLineCache (linecache), cache an image as a set of lines
8819 /// returns `VipsImage` - Output image
8820 ///
8821 /// <ins>Optional arguments</ins>
8822 ///
8823 /// tile_height: `i32` -> Tile height in pixels
8824 ///
8825 /// access: [`Access`] -> Expected access pattern
8826 ///
8827 /// threaded: `bool` -> Allow threaded access
8828 ///
8829 /// persistent: `bool` -> Keep cache between evaluations
8830 pub fn linecache_with_opts(&self, option: VOption) -> Result<VipsImage> {
8831 let mut out_out = VipsImage::from(null_mut());
8832 let vips_op_response = call(
8833 "linecache",
8834 option
8835 .set("in", self)
8836 .set(
8837 "out",
8838 &mut out_out,
8839 ),
8840 );
8841
8842 utils::result(
8843 vips_op_response,
8844 out_out,
8845 Error::OperationError("Linecache (vips_linecache) failed".to_string()),
8846 )
8847 }
8848
8849 /// VipsLogmat (logmat), make a Laplacian of Gaussian image
8850 /// returns `VipsImage` - Output image
8851 ///
8852 /// sigma: `f64` -> Radius of Gaussian
8853 ///
8854 /// min_ampl: `f64` -> Minimum amplitude of Gaussian
8855 pub fn logmat(sigma: f64, min_ampl: f64) -> Result<VipsImage> {
8856 let mut out_out = VipsImage::from(null_mut());
8857 let vips_op_response = call(
8858 "logmat",
8859 VOption::new()
8860 .set(
8861 "out",
8862 &mut out_out,
8863 )
8864 .set(
8865 "sigma",
8866 sigma,
8867 )
8868 .set(
8869 "min-ampl",
8870 min_ampl,
8871 ),
8872 );
8873
8874 utils::result(
8875 vips_op_response,
8876 out_out,
8877 Error::OperationError("Logmat (vips_logmat) failed".to_string()),
8878 )
8879 }
8880
8881 /// VipsLogmat (logmat), make a Laplacian of Gaussian image
8882 /// returns `VipsImage` - Output image
8883 ///
8884 /// sigma: `f64` -> Radius of Gaussian
8885 ///
8886 /// min_ampl: `f64` -> Minimum amplitude of Gaussian
8887 ///
8888 /// <ins>Optional arguments</ins>
8889 ///
8890 /// separable: `bool` -> Generate separable Gaussian
8891 ///
8892 /// precision: [`Precision`] -> Generate with this precision
8893 pub fn logmat_with_opts(sigma: f64, min_ampl: f64, option: VOption) -> Result<VipsImage> {
8894 let mut out_out = VipsImage::from(null_mut());
8895 let vips_op_response = call(
8896 "logmat",
8897 option
8898 .set(
8899 "out",
8900 &mut out_out,
8901 )
8902 .set(
8903 "sigma",
8904 sigma,
8905 )
8906 .set(
8907 "min-ampl",
8908 min_ampl,
8909 ),
8910 );
8911
8912 utils::result(
8913 vips_op_response,
8914 out_out,
8915 Error::OperationError("Logmat (vips_logmat) failed".to_string()),
8916 )
8917 }
8918
8919 /// VipsForeignLoadMagickFile (magickload), load file with ImageMagick, priority=-100, untrusted, is_a, get_flags, get_flags_filename, header
8920 /// returns `VipsImage` - Output image
8921 ///
8922 /// filename: `&str` -> Filename to load from
8923 pub fn magickload(filename: &str) -> Result<VipsImage> {
8924 let mut out_out = VipsImage::from(null_mut());
8925 let vips_op_response = call(
8926 "magickload",
8927 VOption::new()
8928 .set(
8929 "filename",
8930 filename,
8931 )
8932 .set(
8933 "out",
8934 &mut out_out,
8935 ),
8936 );
8937
8938 utils::result(
8939 vips_op_response,
8940 out_out,
8941 Error::OperationError("Magickload (vips_magickload) failed".to_string()),
8942 )
8943 }
8944
8945 /// VipsForeignLoadMagickFile (magickload), load file with ImageMagick, priority=-100, untrusted, is_a, get_flags, get_flags_filename, header
8946 /// returns `VipsImage` - Output image
8947 ///
8948 /// filename: `&str` -> Filename to load from
8949 ///
8950 /// <ins>Optional arguments</ins>
8951 ///
8952 /// density: `&str` -> Canvas resolution for rendering vector formats like SVG
8953 ///
8954 /// page: `i32` -> First page to load
8955 ///
8956 /// n: `i32` -> Number of pages to load, -1 for all
8957 ///
8958 /// flags: [`ForeignFlags`] -> Flags for this file
8959 ///
8960 /// memory: `bool` -> Force open via memory
8961 ///
8962 /// access: [`Access`] -> Required access pattern for this file
8963 ///
8964 /// fail_on: [`FailOn`] -> Error level to fail on
8965 ///
8966 /// revalidate: `bool` -> Don't use a cached result for this operation
8967 pub fn magickload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
8968 let mut out_out = VipsImage::from(null_mut());
8969 let vips_op_response = call(
8970 "magickload",
8971 option
8972 .set(
8973 "filename",
8974 filename,
8975 )
8976 .set(
8977 "out",
8978 &mut out_out,
8979 ),
8980 );
8981
8982 utils::result(
8983 vips_op_response,
8984 out_out,
8985 Error::OperationError("Magickload (vips_magickload) failed".to_string()),
8986 )
8987 }
8988
8989 /// VipsForeignLoadMagickBuffer (magickload_buffer), load buffer with ImageMagick, priority=-100, untrusted, is_a_buffer, get_flags, get_flags_filename, header
8990 /// returns `VipsImage` - Output image
8991 ///
8992 /// buffer: `&[u8]` -> Buffer to load from
8993 pub fn magickload_buffer(buffer: &[u8]) -> Result<VipsImage> {
8994 let vips_blob = unsafe {
8995 vips_blob_new(
8996 None,
8997 buffer.as_ptr() as _,
8998 buffer.len() as _,
8999 )
9000 };
9001 let blob = VipsBlob::from(vips_blob);
9002 let mut out_out = VipsImage::from(null_mut());
9003 let vips_op_response = call(
9004 "magickload_buffer",
9005 VOption::new()
9006 .set(
9007 "buffer",
9008 &blob,
9009 )
9010 .set(
9011 "out",
9012 &mut out_out,
9013 ),
9014 );
9015 blob.area_unref();
9016 utils::result(
9017 vips_op_response,
9018 out_out,
9019 Error::OperationError("MagickloadBuffer (vips_magickload_buffer) failed".to_string()),
9020 )
9021 }
9022
9023 /// VipsForeignLoadMagickBuffer (magickload_buffer), load buffer with ImageMagick, priority=-100, untrusted, is_a_buffer, get_flags, get_flags_filename, header
9024 /// returns `VipsImage` - Output image
9025 ///
9026 /// buffer: `&[u8]` -> Buffer to load from
9027 ///
9028 /// <ins>Optional arguments</ins>
9029 ///
9030 /// density: `&str` -> Canvas resolution for rendering vector formats like SVG
9031 ///
9032 /// page: `i32` -> First page to load
9033 ///
9034 /// n: `i32` -> Number of pages to load, -1 for all
9035 ///
9036 /// flags: [`ForeignFlags`] -> Flags for this file
9037 ///
9038 /// memory: `bool` -> Force open via memory
9039 ///
9040 /// access: [`Access`] -> Required access pattern for this file
9041 ///
9042 /// fail_on: [`FailOn`] -> Error level to fail on
9043 ///
9044 /// revalidate: `bool` -> Don't use a cached result for this operation
9045 pub fn magickload_buffer_with_opts(buffer: &[u8], option: VOption) -> Result<VipsImage> {
9046 let vips_blob = unsafe {
9047 vips_blob_new(
9048 None,
9049 buffer.as_ptr() as _,
9050 buffer.len() as _,
9051 )
9052 };
9053 let blob = VipsBlob::from(vips_blob);
9054 let mut out_out = VipsImage::from(null_mut());
9055 let vips_op_response = call(
9056 "magickload_buffer",
9057 option
9058 .set(
9059 "buffer",
9060 &blob,
9061 )
9062 .set(
9063 "out",
9064 &mut out_out,
9065 ),
9066 );
9067 blob.area_unref();
9068 utils::result(
9069 vips_op_response,
9070 out_out,
9071 Error::OperationError("MagickloadBuffer (vips_magickload_buffer) failed".to_string()),
9072 )
9073 }
9074
9075 /// VipsForeignSaveMagickFile (magicksave), save file with ImageMagick (), priority=-100, untrusted,
9076 ///
9077 /// filename: `&str` -> Filename to save to
9078 pub fn magicksave(&self, filename: &str) -> Result<()> {
9079 let vips_op_response = call(
9080 "magicksave",
9081 VOption::new()
9082 .set("in", self)
9083 .set(
9084 "filename",
9085 filename,
9086 ),
9087 );
9088
9089 utils::result(
9090 vips_op_response,
9091 (),
9092 Error::OperationError("Magicksave (vips_magicksave) failed".to_string()),
9093 )
9094 }
9095
9096 /// VipsForeignSaveMagickFile (magicksave), save file with ImageMagick (), priority=-100, untrusted,
9097 ///
9098 /// filename: `&str` -> Filename to save to
9099 ///
9100 /// <ins>Optional arguments</ins>
9101 ///
9102 /// format: `&str` -> Format to save in
9103 ///
9104 /// quality: `i32` -> Quality to use
9105 ///
9106 /// optimize_gif_frames: `bool` -> Apply GIF frames optimization
9107 ///
9108 /// optimize_gif_transparency: `bool` -> Apply GIF transparency optimization
9109 ///
9110 /// bitdepth: `i32` -> Number of bits per pixel
9111 ///
9112 /// keep: [`ForeignKeep`] -> Which metadata to retain
9113 ///
9114 /// background: `&[f64]` -> Background value
9115 ///
9116 /// page_height: `i32` -> Set page height for multipage save
9117 ///
9118 /// profile: `&str` -> Filename of ICC profile to embed
9119 pub fn magicksave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
9120 let vips_op_response = call(
9121 "magicksave",
9122 option
9123 .set("in", self)
9124 .set(
9125 "filename",
9126 filename,
9127 ),
9128 );
9129
9130 utils::result(
9131 vips_op_response,
9132 (),
9133 Error::OperationError("Magicksave (vips_magicksave) failed".to_string()),
9134 )
9135 }
9136
9137 /// VipsForeignSaveMagickBuffer (magicksave_buffer), save image to magick buffer (), priority=-100, untrusted,
9138 /// returns `Vec<u8>` - Buffer to save to
9139 pub fn magicksave_buffer(&self) -> Result<Vec<u8>> {
9140 let mut buffer_out = VipsBlob::from(null_mut());
9141 let vips_op_response = call(
9142 "magicksave_buffer",
9143 VOption::new()
9144 .set("in", self)
9145 .set(
9146 "buffer",
9147 &mut buffer_out,
9148 ),
9149 );
9150
9151 utils::result(
9152 vips_op_response,
9153 buffer_out.into(),
9154 Error::OperationError("MagicksaveBuffer (vips_magicksave_buffer) failed".to_string()),
9155 )
9156 }
9157
9158 /// VipsForeignSaveMagickBuffer (magicksave_buffer), save image to magick buffer (), priority=-100, untrusted,
9159 /// returns `Vec<u8>` - Buffer to save to
9160 ///
9161 /// <ins>Optional arguments</ins>
9162 ///
9163 /// format: `&str` -> Format to save in
9164 ///
9165 /// quality: `i32` -> Quality to use
9166 ///
9167 /// optimize_gif_frames: `bool` -> Apply GIF frames optimization
9168 ///
9169 /// optimize_gif_transparency: `bool` -> Apply GIF transparency optimization
9170 ///
9171 /// bitdepth: `i32` -> Number of bits per pixel
9172 ///
9173 /// keep: [`ForeignKeep`] -> Which metadata to retain
9174 ///
9175 /// background: `&[f64]` -> Background value
9176 ///
9177 /// page_height: `i32` -> Set page height for multipage save
9178 ///
9179 /// profile: `&str` -> Filename of ICC profile to embed
9180 pub fn magicksave_buffer_with_opts(&self, option: VOption) -> Result<Vec<u8>> {
9181 let mut buffer_out = VipsBlob::from(null_mut());
9182 let vips_op_response = call(
9183 "magicksave_buffer",
9184 option
9185 .set("in", self)
9186 .set(
9187 "buffer",
9188 &mut buffer_out,
9189 ),
9190 );
9191
9192 utils::result(
9193 vips_op_response,
9194 buffer_out.into(),
9195 Error::OperationError("MagicksaveBuffer (vips_magicksave_buffer) failed".to_string()),
9196 )
9197 }
9198
9199 /// VipsMapim (mapim), resample with a map image
9200 /// returns `VipsImage` - Output image
9201 ///
9202 /// index: `&VipsImage` -> Index pixels with this
9203 pub fn mapim(&self, index: &VipsImage) -> Result<VipsImage> {
9204 let mut out_out = VipsImage::from(null_mut());
9205 let vips_op_response = call(
9206 "mapim",
9207 VOption::new()
9208 .set("in", self)
9209 .set(
9210 "out",
9211 &mut out_out,
9212 )
9213 .set(
9214 "index",
9215 index,
9216 ),
9217 );
9218
9219 utils::result(
9220 vips_op_response,
9221 out_out,
9222 Error::OperationError("Mapim (vips_mapim) failed".to_string()),
9223 )
9224 }
9225
9226 /// VipsMapim (mapim), resample with a map image
9227 /// returns `VipsImage` - Output image
9228 ///
9229 /// index: `&VipsImage` -> Index pixels with this
9230 ///
9231 /// <ins>Optional arguments</ins>
9232 ///
9233 /// interpolate: `&VipsInterpolate` -> Interpolate pixels with this
9234 ///
9235 /// background: `&[f64]` -> Background value
9236 ///
9237 /// premultiplied: `bool` -> Images have premultiplied alpha
9238 ///
9239 /// extend: [`Extend`] -> How to generate the extra pixels
9240 pub fn mapim_with_opts(&self, index: &VipsImage, option: VOption) -> Result<VipsImage> {
9241 let mut out_out = VipsImage::from(null_mut());
9242 let vips_op_response = call(
9243 "mapim",
9244 option
9245 .set("in", self)
9246 .set(
9247 "out",
9248 &mut out_out,
9249 )
9250 .set(
9251 "index",
9252 index,
9253 ),
9254 );
9255
9256 utils::result(
9257 vips_op_response,
9258 out_out,
9259 Error::OperationError("Mapim (vips_mapim) failed".to_string()),
9260 )
9261 }
9262
9263 /// VipsMaplut (maplut), map an image though a lut
9264 /// returns `VipsImage` - Output image
9265 ///
9266 /// lut: `&VipsImage` -> Look-up table image
9267 pub fn maplut(&self, lut: &VipsImage) -> Result<VipsImage> {
9268 let mut out_out = VipsImage::from(null_mut());
9269 let vips_op_response = call(
9270 "maplut",
9271 VOption::new()
9272 .set("in", self)
9273 .set(
9274 "out",
9275 &mut out_out,
9276 )
9277 .set("lut", lut),
9278 );
9279
9280 utils::result(
9281 vips_op_response,
9282 out_out,
9283 Error::OperationError("Maplut (vips_maplut) failed".to_string()),
9284 )
9285 }
9286
9287 /// VipsMaplut (maplut), map an image though a lut
9288 /// returns `VipsImage` - Output image
9289 ///
9290 /// lut: `&VipsImage` -> Look-up table image
9291 ///
9292 /// <ins>Optional arguments</ins>
9293 ///
9294 /// band: `i32` -> Apply one-band lut to this band of in
9295 pub fn maplut_with_opts(&self, lut: &VipsImage, option: VOption) -> Result<VipsImage> {
9296 let mut out_out = VipsImage::from(null_mut());
9297 let vips_op_response = call(
9298 "maplut",
9299 option
9300 .set("in", self)
9301 .set(
9302 "out",
9303 &mut out_out,
9304 )
9305 .set("lut", lut),
9306 );
9307
9308 utils::result(
9309 vips_op_response,
9310 out_out,
9311 Error::OperationError("Maplut (vips_maplut) failed".to_string()),
9312 )
9313 }
9314
9315 /// VipsMaskButterworth (mask_butterworth), make a butterworth filter
9316 /// returns `VipsImage` - Output image
9317 ///
9318 /// width: `i32` -> Image width in pixels
9319 ///
9320 /// height: `i32` -> Image height in pixels
9321 ///
9322 /// order: `f64` -> Filter order
9323 ///
9324 /// frequency_cutoff: `f64` -> Frequency cutoff
9325 ///
9326 /// amplitude_cutoff: `f64` -> Amplitude cutoff
9327 pub fn mask_butterworth(
9328 width: i32,
9329 height: i32,
9330 order: f64,
9331 frequency_cutoff: f64,
9332 amplitude_cutoff: f64,
9333 ) -> Result<VipsImage> {
9334 let mut out_out = VipsImage::from(null_mut());
9335 let vips_op_response = call(
9336 "mask_butterworth",
9337 VOption::new()
9338 .set(
9339 "out",
9340 &mut out_out,
9341 )
9342 .set(
9343 "width",
9344 width,
9345 )
9346 .set(
9347 "height",
9348 height,
9349 )
9350 .set(
9351 "order",
9352 order,
9353 )
9354 .set(
9355 "frequency-cutoff",
9356 frequency_cutoff,
9357 )
9358 .set(
9359 "amplitude-cutoff",
9360 amplitude_cutoff,
9361 ),
9362 );
9363
9364 utils::result(
9365 vips_op_response,
9366 out_out,
9367 Error::OperationError("MaskButterworth (vips_mask_butterworth) failed".to_string()),
9368 )
9369 }
9370
9371 /// VipsMaskButterworth (mask_butterworth), make a butterworth filter
9372 /// returns `VipsImage` - Output image
9373 ///
9374 /// width: `i32` -> Image width in pixels
9375 ///
9376 /// height: `i32` -> Image height in pixels
9377 ///
9378 /// order: `f64` -> Filter order
9379 ///
9380 /// frequency_cutoff: `f64` -> Frequency cutoff
9381 ///
9382 /// amplitude_cutoff: `f64` -> Amplitude cutoff
9383 ///
9384 /// <ins>Optional arguments</ins>
9385 ///
9386 /// uchar: `bool` -> Output an unsigned char image
9387 ///
9388 /// nodc: `bool` -> Remove DC component
9389 ///
9390 /// reject: `bool` -> Invert the sense of the filter
9391 ///
9392 /// optical: `bool` -> Rotate quadrants to optical space
9393 pub fn mask_butterworth_with_opts(
9394 width: i32,
9395 height: i32,
9396 order: f64,
9397 frequency_cutoff: f64,
9398 amplitude_cutoff: f64,
9399 option: VOption,
9400 ) -> Result<VipsImage> {
9401 let mut out_out = VipsImage::from(null_mut());
9402 let vips_op_response = call(
9403 "mask_butterworth",
9404 option
9405 .set(
9406 "out",
9407 &mut out_out,
9408 )
9409 .set(
9410 "width",
9411 width,
9412 )
9413 .set(
9414 "height",
9415 height,
9416 )
9417 .set(
9418 "order",
9419 order,
9420 )
9421 .set(
9422 "frequency-cutoff",
9423 frequency_cutoff,
9424 )
9425 .set(
9426 "amplitude-cutoff",
9427 amplitude_cutoff,
9428 ),
9429 );
9430
9431 utils::result(
9432 vips_op_response,
9433 out_out,
9434 Error::OperationError("MaskButterworth (vips_mask_butterworth) failed".to_string()),
9435 )
9436 }
9437
9438 /// VipsMaskButterworthBand (mask_butterworth_band), make a butterworth_band filter
9439 /// returns `VipsImage` - Output image
9440 ///
9441 /// width: `i32` -> Image width in pixels
9442 ///
9443 /// height: `i32` -> Image height in pixels
9444 ///
9445 /// order: `f64` -> Filter order
9446 ///
9447 /// frequency_cutoff_x: `f64` -> Frequency cutoff x
9448 ///
9449 /// frequency_cutoff_y: `f64` -> Frequency cutoff y
9450 ///
9451 /// radius: `f64` -> Radius of circle
9452 ///
9453 /// amplitude_cutoff: `f64` -> Amplitude cutoff
9454 pub fn mask_butterworth_band(
9455 width: i32,
9456 height: i32,
9457 order: f64,
9458 frequency_cutoff_x: f64,
9459 frequency_cutoff_y: f64,
9460 radius: f64,
9461 amplitude_cutoff: f64,
9462 ) -> Result<VipsImage> {
9463 let mut out_out = VipsImage::from(null_mut());
9464 let vips_op_response = call(
9465 "mask_butterworth_band",
9466 VOption::new()
9467 .set(
9468 "out",
9469 &mut out_out,
9470 )
9471 .set(
9472 "width",
9473 width,
9474 )
9475 .set(
9476 "height",
9477 height,
9478 )
9479 .set(
9480 "order",
9481 order,
9482 )
9483 .set(
9484 "frequency-cutoff-x",
9485 frequency_cutoff_x,
9486 )
9487 .set(
9488 "frequency-cutoff-y",
9489 frequency_cutoff_y,
9490 )
9491 .set(
9492 "radius",
9493 radius,
9494 )
9495 .set(
9496 "amplitude-cutoff",
9497 amplitude_cutoff,
9498 ),
9499 );
9500
9501 utils::result(
9502 vips_op_response,
9503 out_out,
9504 Error::OperationError(
9505 "MaskButterworthBand (vips_mask_butterworth_band) failed".to_string(),
9506 ),
9507 )
9508 }
9509
9510 /// VipsMaskButterworthBand (mask_butterworth_band), make a butterworth_band filter
9511 /// returns `VipsImage` - Output image
9512 ///
9513 /// width: `i32` -> Image width in pixels
9514 ///
9515 /// height: `i32` -> Image height in pixels
9516 ///
9517 /// order: `f64` -> Filter order
9518 ///
9519 /// frequency_cutoff_x: `f64` -> Frequency cutoff x
9520 ///
9521 /// frequency_cutoff_y: `f64` -> Frequency cutoff y
9522 ///
9523 /// radius: `f64` -> Radius of circle
9524 ///
9525 /// amplitude_cutoff: `f64` -> Amplitude cutoff
9526 ///
9527 /// <ins>Optional arguments</ins>
9528 ///
9529 /// uchar: `bool` -> Output an unsigned char image
9530 ///
9531 /// nodc: `bool` -> Remove DC component
9532 ///
9533 /// reject: `bool` -> Invert the sense of the filter
9534 ///
9535 /// optical: `bool` -> Rotate quadrants to optical space
9536 pub fn mask_butterworth_band_with_opts(
9537 width: i32,
9538 height: i32,
9539 order: f64,
9540 frequency_cutoff_x: f64,
9541 frequency_cutoff_y: f64,
9542 radius: f64,
9543 amplitude_cutoff: f64,
9544 option: VOption,
9545 ) -> Result<VipsImage> {
9546 let mut out_out = VipsImage::from(null_mut());
9547 let vips_op_response = call(
9548 "mask_butterworth_band",
9549 option
9550 .set(
9551 "out",
9552 &mut out_out,
9553 )
9554 .set(
9555 "width",
9556 width,
9557 )
9558 .set(
9559 "height",
9560 height,
9561 )
9562 .set(
9563 "order",
9564 order,
9565 )
9566 .set(
9567 "frequency-cutoff-x",
9568 frequency_cutoff_x,
9569 )
9570 .set(
9571 "frequency-cutoff-y",
9572 frequency_cutoff_y,
9573 )
9574 .set(
9575 "radius",
9576 radius,
9577 )
9578 .set(
9579 "amplitude-cutoff",
9580 amplitude_cutoff,
9581 ),
9582 );
9583
9584 utils::result(
9585 vips_op_response,
9586 out_out,
9587 Error::OperationError(
9588 "MaskButterworthBand (vips_mask_butterworth_band) failed".to_string(),
9589 ),
9590 )
9591 }
9592
9593 /// VipsMaskButterworthRing (mask_butterworth_ring), make a butterworth ring filter
9594 /// returns `VipsImage` - Output image
9595 ///
9596 /// width: `i32` -> Image width in pixels
9597 ///
9598 /// height: `i32` -> Image height in pixels
9599 ///
9600 /// order: `f64` -> Filter order
9601 ///
9602 /// frequency_cutoff: `f64` -> Frequency cutoff
9603 ///
9604 /// amplitude_cutoff: `f64` -> Amplitude cutoff
9605 ///
9606 /// ringwidth: `f64` -> Ringwidth
9607 pub fn mask_butterworth_ring(
9608 width: i32,
9609 height: i32,
9610 order: f64,
9611 frequency_cutoff: f64,
9612 amplitude_cutoff: f64,
9613 ringwidth: f64,
9614 ) -> Result<VipsImage> {
9615 let mut out_out = VipsImage::from(null_mut());
9616 let vips_op_response = call(
9617 "mask_butterworth_ring",
9618 VOption::new()
9619 .set(
9620 "out",
9621 &mut out_out,
9622 )
9623 .set(
9624 "width",
9625 width,
9626 )
9627 .set(
9628 "height",
9629 height,
9630 )
9631 .set(
9632 "order",
9633 order,
9634 )
9635 .set(
9636 "frequency-cutoff",
9637 frequency_cutoff,
9638 )
9639 .set(
9640 "amplitude-cutoff",
9641 amplitude_cutoff,
9642 )
9643 .set(
9644 "ringwidth",
9645 ringwidth,
9646 ),
9647 );
9648
9649 utils::result(
9650 vips_op_response,
9651 out_out,
9652 Error::OperationError(
9653 "MaskButterworthRing (vips_mask_butterworth_ring) failed".to_string(),
9654 ),
9655 )
9656 }
9657
9658 /// VipsMaskButterworthRing (mask_butterworth_ring), make a butterworth ring filter
9659 /// returns `VipsImage` - Output image
9660 ///
9661 /// width: `i32` -> Image width in pixels
9662 ///
9663 /// height: `i32` -> Image height in pixels
9664 ///
9665 /// order: `f64` -> Filter order
9666 ///
9667 /// frequency_cutoff: `f64` -> Frequency cutoff
9668 ///
9669 /// amplitude_cutoff: `f64` -> Amplitude cutoff
9670 ///
9671 /// ringwidth: `f64` -> Ringwidth
9672 ///
9673 /// <ins>Optional arguments</ins>
9674 ///
9675 /// uchar: `bool` -> Output an unsigned char image
9676 ///
9677 /// nodc: `bool` -> Remove DC component
9678 ///
9679 /// reject: `bool` -> Invert the sense of the filter
9680 ///
9681 /// optical: `bool` -> Rotate quadrants to optical space
9682 pub fn mask_butterworth_ring_with_opts(
9683 width: i32,
9684 height: i32,
9685 order: f64,
9686 frequency_cutoff: f64,
9687 amplitude_cutoff: f64,
9688 ringwidth: f64,
9689 option: VOption,
9690 ) -> Result<VipsImage> {
9691 let mut out_out = VipsImage::from(null_mut());
9692 let vips_op_response = call(
9693 "mask_butterworth_ring",
9694 option
9695 .set(
9696 "out",
9697 &mut out_out,
9698 )
9699 .set(
9700 "width",
9701 width,
9702 )
9703 .set(
9704 "height",
9705 height,
9706 )
9707 .set(
9708 "order",
9709 order,
9710 )
9711 .set(
9712 "frequency-cutoff",
9713 frequency_cutoff,
9714 )
9715 .set(
9716 "amplitude-cutoff",
9717 amplitude_cutoff,
9718 )
9719 .set(
9720 "ringwidth",
9721 ringwidth,
9722 ),
9723 );
9724
9725 utils::result(
9726 vips_op_response,
9727 out_out,
9728 Error::OperationError(
9729 "MaskButterworthRing (vips_mask_butterworth_ring) failed".to_string(),
9730 ),
9731 )
9732 }
9733
9734 /// VipsMaskFractal (mask_fractal), make fractal filter
9735 /// returns `VipsImage` - Output image
9736 ///
9737 /// width: `i32` -> Image width in pixels
9738 ///
9739 /// height: `i32` -> Image height in pixels
9740 ///
9741 /// fractal_dimension: `f64` -> Fractal dimension
9742 pub fn mask_fractal(width: i32, height: i32, fractal_dimension: f64) -> Result<VipsImage> {
9743 let mut out_out = VipsImage::from(null_mut());
9744 let vips_op_response = call(
9745 "mask_fractal",
9746 VOption::new()
9747 .set(
9748 "out",
9749 &mut out_out,
9750 )
9751 .set(
9752 "width",
9753 width,
9754 )
9755 .set(
9756 "height",
9757 height,
9758 )
9759 .set(
9760 "fractal-dimension",
9761 fractal_dimension,
9762 ),
9763 );
9764
9765 utils::result(
9766 vips_op_response,
9767 out_out,
9768 Error::OperationError("MaskFractal (vips_mask_fractal) failed".to_string()),
9769 )
9770 }
9771
9772 /// VipsMaskFractal (mask_fractal), make fractal filter
9773 /// returns `VipsImage` - Output image
9774 ///
9775 /// width: `i32` -> Image width in pixels
9776 ///
9777 /// height: `i32` -> Image height in pixels
9778 ///
9779 /// fractal_dimension: `f64` -> Fractal dimension
9780 ///
9781 /// <ins>Optional arguments</ins>
9782 ///
9783 /// uchar: `bool` -> Output an unsigned char image
9784 ///
9785 /// nodc: `bool` -> Remove DC component
9786 ///
9787 /// reject: `bool` -> Invert the sense of the filter
9788 ///
9789 /// optical: `bool` -> Rotate quadrants to optical space
9790 pub fn mask_fractal_with_opts(
9791 width: i32,
9792 height: i32,
9793 fractal_dimension: f64,
9794 option: VOption,
9795 ) -> Result<VipsImage> {
9796 let mut out_out = VipsImage::from(null_mut());
9797 let vips_op_response = call(
9798 "mask_fractal",
9799 option
9800 .set(
9801 "out",
9802 &mut out_out,
9803 )
9804 .set(
9805 "width",
9806 width,
9807 )
9808 .set(
9809 "height",
9810 height,
9811 )
9812 .set(
9813 "fractal-dimension",
9814 fractal_dimension,
9815 ),
9816 );
9817
9818 utils::result(
9819 vips_op_response,
9820 out_out,
9821 Error::OperationError("MaskFractal (vips_mask_fractal) failed".to_string()),
9822 )
9823 }
9824
9825 /// VipsMaskGaussian (mask_gaussian), make a gaussian filter
9826 /// returns `VipsImage` - Output image
9827 ///
9828 /// width: `i32` -> Image width in pixels
9829 ///
9830 /// height: `i32` -> Image height in pixels
9831 ///
9832 /// frequency_cutoff: `f64` -> Frequency cutoff
9833 ///
9834 /// amplitude_cutoff: `f64` -> Amplitude cutoff
9835 pub fn mask_gaussian(
9836 width: i32,
9837 height: i32,
9838 frequency_cutoff: f64,
9839 amplitude_cutoff: f64,
9840 ) -> Result<VipsImage> {
9841 let mut out_out = VipsImage::from(null_mut());
9842 let vips_op_response = call(
9843 "mask_gaussian",
9844 VOption::new()
9845 .set(
9846 "out",
9847 &mut out_out,
9848 )
9849 .set(
9850 "width",
9851 width,
9852 )
9853 .set(
9854 "height",
9855 height,
9856 )
9857 .set(
9858 "frequency-cutoff",
9859 frequency_cutoff,
9860 )
9861 .set(
9862 "amplitude-cutoff",
9863 amplitude_cutoff,
9864 ),
9865 );
9866
9867 utils::result(
9868 vips_op_response,
9869 out_out,
9870 Error::OperationError("MaskGaussian (vips_mask_gaussian) failed".to_string()),
9871 )
9872 }
9873
9874 /// VipsMaskGaussian (mask_gaussian), make a gaussian filter
9875 /// returns `VipsImage` - Output image
9876 ///
9877 /// width: `i32` -> Image width in pixels
9878 ///
9879 /// height: `i32` -> Image height in pixels
9880 ///
9881 /// frequency_cutoff: `f64` -> Frequency cutoff
9882 ///
9883 /// amplitude_cutoff: `f64` -> Amplitude cutoff
9884 ///
9885 /// <ins>Optional arguments</ins>
9886 ///
9887 /// uchar: `bool` -> Output an unsigned char image
9888 ///
9889 /// nodc: `bool` -> Remove DC component
9890 ///
9891 /// reject: `bool` -> Invert the sense of the filter
9892 ///
9893 /// optical: `bool` -> Rotate quadrants to optical space
9894 pub fn mask_gaussian_with_opts(
9895 width: i32,
9896 height: i32,
9897 frequency_cutoff: f64,
9898 amplitude_cutoff: f64,
9899 option: VOption,
9900 ) -> Result<VipsImage> {
9901 let mut out_out = VipsImage::from(null_mut());
9902 let vips_op_response = call(
9903 "mask_gaussian",
9904 option
9905 .set(
9906 "out",
9907 &mut out_out,
9908 )
9909 .set(
9910 "width",
9911 width,
9912 )
9913 .set(
9914 "height",
9915 height,
9916 )
9917 .set(
9918 "frequency-cutoff",
9919 frequency_cutoff,
9920 )
9921 .set(
9922 "amplitude-cutoff",
9923 amplitude_cutoff,
9924 ),
9925 );
9926
9927 utils::result(
9928 vips_op_response,
9929 out_out,
9930 Error::OperationError("MaskGaussian (vips_mask_gaussian) failed".to_string()),
9931 )
9932 }
9933
9934 /// VipsMaskGaussianBand (mask_gaussian_band), make a gaussian filter
9935 /// returns `VipsImage` - Output image
9936 ///
9937 /// width: `i32` -> Image width in pixels
9938 ///
9939 /// height: `i32` -> Image height in pixels
9940 ///
9941 /// frequency_cutoff_x: `f64` -> Frequency cutoff x
9942 ///
9943 /// frequency_cutoff_y: `f64` -> Frequency cutoff y
9944 ///
9945 /// radius: `f64` -> Radius of circle
9946 ///
9947 /// amplitude_cutoff: `f64` -> Amplitude cutoff
9948 pub fn mask_gaussian_band(
9949 width: i32,
9950 height: i32,
9951 frequency_cutoff_x: f64,
9952 frequency_cutoff_y: f64,
9953 radius: f64,
9954 amplitude_cutoff: f64,
9955 ) -> Result<VipsImage> {
9956 let mut out_out = VipsImage::from(null_mut());
9957 let vips_op_response = call(
9958 "mask_gaussian_band",
9959 VOption::new()
9960 .set(
9961 "out",
9962 &mut out_out,
9963 )
9964 .set(
9965 "width",
9966 width,
9967 )
9968 .set(
9969 "height",
9970 height,
9971 )
9972 .set(
9973 "frequency-cutoff-x",
9974 frequency_cutoff_x,
9975 )
9976 .set(
9977 "frequency-cutoff-y",
9978 frequency_cutoff_y,
9979 )
9980 .set(
9981 "radius",
9982 radius,
9983 )
9984 .set(
9985 "amplitude-cutoff",
9986 amplitude_cutoff,
9987 ),
9988 );
9989
9990 utils::result(
9991 vips_op_response,
9992 out_out,
9993 Error::OperationError("MaskGaussianBand (vips_mask_gaussian_band) failed".to_string()),
9994 )
9995 }
9996
9997 /// VipsMaskGaussianBand (mask_gaussian_band), make a gaussian filter
9998 /// returns `VipsImage` - Output image
9999 ///
10000 /// width: `i32` -> Image width in pixels
10001 ///
10002 /// height: `i32` -> Image height in pixels
10003 ///
10004 /// frequency_cutoff_x: `f64` -> Frequency cutoff x
10005 ///
10006 /// frequency_cutoff_y: `f64` -> Frequency cutoff y
10007 ///
10008 /// radius: `f64` -> Radius of circle
10009 ///
10010 /// amplitude_cutoff: `f64` -> Amplitude cutoff
10011 ///
10012 /// <ins>Optional arguments</ins>
10013 ///
10014 /// uchar: `bool` -> Output an unsigned char image
10015 ///
10016 /// nodc: `bool` -> Remove DC component
10017 ///
10018 /// reject: `bool` -> Invert the sense of the filter
10019 ///
10020 /// optical: `bool` -> Rotate quadrants to optical space
10021 pub fn mask_gaussian_band_with_opts(
10022 width: i32,
10023 height: i32,
10024 frequency_cutoff_x: f64,
10025 frequency_cutoff_y: f64,
10026 radius: f64,
10027 amplitude_cutoff: f64,
10028 option: VOption,
10029 ) -> Result<VipsImage> {
10030 let mut out_out = VipsImage::from(null_mut());
10031 let vips_op_response = call(
10032 "mask_gaussian_band",
10033 option
10034 .set(
10035 "out",
10036 &mut out_out,
10037 )
10038 .set(
10039 "width",
10040 width,
10041 )
10042 .set(
10043 "height",
10044 height,
10045 )
10046 .set(
10047 "frequency-cutoff-x",
10048 frequency_cutoff_x,
10049 )
10050 .set(
10051 "frequency-cutoff-y",
10052 frequency_cutoff_y,
10053 )
10054 .set(
10055 "radius",
10056 radius,
10057 )
10058 .set(
10059 "amplitude-cutoff",
10060 amplitude_cutoff,
10061 ),
10062 );
10063
10064 utils::result(
10065 vips_op_response,
10066 out_out,
10067 Error::OperationError("MaskGaussianBand (vips_mask_gaussian_band) failed".to_string()),
10068 )
10069 }
10070
10071 /// VipsMaskGaussianRing (mask_gaussian_ring), make a gaussian ring filter
10072 /// returns `VipsImage` - Output image
10073 ///
10074 /// width: `i32` -> Image width in pixels
10075 ///
10076 /// height: `i32` -> Image height in pixels
10077 ///
10078 /// frequency_cutoff: `f64` -> Frequency cutoff
10079 ///
10080 /// amplitude_cutoff: `f64` -> Amplitude cutoff
10081 ///
10082 /// ringwidth: `f64` -> Ringwidth
10083 pub fn mask_gaussian_ring(
10084 width: i32,
10085 height: i32,
10086 frequency_cutoff: f64,
10087 amplitude_cutoff: f64,
10088 ringwidth: f64,
10089 ) -> Result<VipsImage> {
10090 let mut out_out = VipsImage::from(null_mut());
10091 let vips_op_response = call(
10092 "mask_gaussian_ring",
10093 VOption::new()
10094 .set(
10095 "out",
10096 &mut out_out,
10097 )
10098 .set(
10099 "width",
10100 width,
10101 )
10102 .set(
10103 "height",
10104 height,
10105 )
10106 .set(
10107 "frequency-cutoff",
10108 frequency_cutoff,
10109 )
10110 .set(
10111 "amplitude-cutoff",
10112 amplitude_cutoff,
10113 )
10114 .set(
10115 "ringwidth",
10116 ringwidth,
10117 ),
10118 );
10119
10120 utils::result(
10121 vips_op_response,
10122 out_out,
10123 Error::OperationError("MaskGaussianRing (vips_mask_gaussian_ring) failed".to_string()),
10124 )
10125 }
10126
10127 /// VipsMaskGaussianRing (mask_gaussian_ring), make a gaussian ring filter
10128 /// returns `VipsImage` - Output image
10129 ///
10130 /// width: `i32` -> Image width in pixels
10131 ///
10132 /// height: `i32` -> Image height in pixels
10133 ///
10134 /// frequency_cutoff: `f64` -> Frequency cutoff
10135 ///
10136 /// amplitude_cutoff: `f64` -> Amplitude cutoff
10137 ///
10138 /// ringwidth: `f64` -> Ringwidth
10139 ///
10140 /// <ins>Optional arguments</ins>
10141 ///
10142 /// uchar: `bool` -> Output an unsigned char image
10143 ///
10144 /// nodc: `bool` -> Remove DC component
10145 ///
10146 /// reject: `bool` -> Invert the sense of the filter
10147 ///
10148 /// optical: `bool` -> Rotate quadrants to optical space
10149 pub fn mask_gaussian_ring_with_opts(
10150 width: i32,
10151 height: i32,
10152 frequency_cutoff: f64,
10153 amplitude_cutoff: f64,
10154 ringwidth: f64,
10155 option: VOption,
10156 ) -> Result<VipsImage> {
10157 let mut out_out = VipsImage::from(null_mut());
10158 let vips_op_response = call(
10159 "mask_gaussian_ring",
10160 option
10161 .set(
10162 "out",
10163 &mut out_out,
10164 )
10165 .set(
10166 "width",
10167 width,
10168 )
10169 .set(
10170 "height",
10171 height,
10172 )
10173 .set(
10174 "frequency-cutoff",
10175 frequency_cutoff,
10176 )
10177 .set(
10178 "amplitude-cutoff",
10179 amplitude_cutoff,
10180 )
10181 .set(
10182 "ringwidth",
10183 ringwidth,
10184 ),
10185 );
10186
10187 utils::result(
10188 vips_op_response,
10189 out_out,
10190 Error::OperationError("MaskGaussianRing (vips_mask_gaussian_ring) failed".to_string()),
10191 )
10192 }
10193
10194 /// VipsMaskIdeal (mask_ideal), make an ideal filter
10195 /// returns `VipsImage` - Output image
10196 ///
10197 /// width: `i32` -> Image width in pixels
10198 ///
10199 /// height: `i32` -> Image height in pixels
10200 ///
10201 /// frequency_cutoff: `f64` -> Frequency cutoff
10202 pub fn mask_ideal(width: i32, height: i32, frequency_cutoff: f64) -> Result<VipsImage> {
10203 let mut out_out = VipsImage::from(null_mut());
10204 let vips_op_response = call(
10205 "mask_ideal",
10206 VOption::new()
10207 .set(
10208 "out",
10209 &mut out_out,
10210 )
10211 .set(
10212 "width",
10213 width,
10214 )
10215 .set(
10216 "height",
10217 height,
10218 )
10219 .set(
10220 "frequency-cutoff",
10221 frequency_cutoff,
10222 ),
10223 );
10224
10225 utils::result(
10226 vips_op_response,
10227 out_out,
10228 Error::OperationError("MaskIdeal (vips_mask_ideal) failed".to_string()),
10229 )
10230 }
10231
10232 /// VipsMaskIdeal (mask_ideal), make an ideal filter
10233 /// returns `VipsImage` - Output image
10234 ///
10235 /// width: `i32` -> Image width in pixels
10236 ///
10237 /// height: `i32` -> Image height in pixels
10238 ///
10239 /// frequency_cutoff: `f64` -> Frequency cutoff
10240 ///
10241 /// <ins>Optional arguments</ins>
10242 ///
10243 /// uchar: `bool` -> Output an unsigned char image
10244 ///
10245 /// nodc: `bool` -> Remove DC component
10246 ///
10247 /// reject: `bool` -> Invert the sense of the filter
10248 ///
10249 /// optical: `bool` -> Rotate quadrants to optical space
10250 pub fn mask_ideal_with_opts(
10251 width: i32,
10252 height: i32,
10253 frequency_cutoff: f64,
10254 option: VOption,
10255 ) -> Result<VipsImage> {
10256 let mut out_out = VipsImage::from(null_mut());
10257 let vips_op_response = call(
10258 "mask_ideal",
10259 option
10260 .set(
10261 "out",
10262 &mut out_out,
10263 )
10264 .set(
10265 "width",
10266 width,
10267 )
10268 .set(
10269 "height",
10270 height,
10271 )
10272 .set(
10273 "frequency-cutoff",
10274 frequency_cutoff,
10275 ),
10276 );
10277
10278 utils::result(
10279 vips_op_response,
10280 out_out,
10281 Error::OperationError("MaskIdeal (vips_mask_ideal) failed".to_string()),
10282 )
10283 }
10284
10285 /// VipsMaskIdealBand (mask_ideal_band), make an ideal band filter
10286 /// returns `VipsImage` - Output image
10287 ///
10288 /// width: `i32` -> Image width in pixels
10289 ///
10290 /// height: `i32` -> Image height in pixels
10291 ///
10292 /// frequency_cutoff_x: `f64` -> Frequency cutoff x
10293 ///
10294 /// frequency_cutoff_y: `f64` -> Frequency cutoff y
10295 ///
10296 /// radius: `f64` -> Radius of circle
10297 pub fn mask_ideal_band(
10298 width: i32,
10299 height: i32,
10300 frequency_cutoff_x: f64,
10301 frequency_cutoff_y: f64,
10302 radius: f64,
10303 ) -> Result<VipsImage> {
10304 let mut out_out = VipsImage::from(null_mut());
10305 let vips_op_response = call(
10306 "mask_ideal_band",
10307 VOption::new()
10308 .set(
10309 "out",
10310 &mut out_out,
10311 )
10312 .set(
10313 "width",
10314 width,
10315 )
10316 .set(
10317 "height",
10318 height,
10319 )
10320 .set(
10321 "frequency-cutoff-x",
10322 frequency_cutoff_x,
10323 )
10324 .set(
10325 "frequency-cutoff-y",
10326 frequency_cutoff_y,
10327 )
10328 .set(
10329 "radius",
10330 radius,
10331 ),
10332 );
10333
10334 utils::result(
10335 vips_op_response,
10336 out_out,
10337 Error::OperationError("MaskIdealBand (vips_mask_ideal_band) failed".to_string()),
10338 )
10339 }
10340
10341 /// VipsMaskIdealBand (mask_ideal_band), make an ideal band filter
10342 /// returns `VipsImage` - Output image
10343 ///
10344 /// width: `i32` -> Image width in pixels
10345 ///
10346 /// height: `i32` -> Image height in pixels
10347 ///
10348 /// frequency_cutoff_x: `f64` -> Frequency cutoff x
10349 ///
10350 /// frequency_cutoff_y: `f64` -> Frequency cutoff y
10351 ///
10352 /// radius: `f64` -> Radius of circle
10353 ///
10354 /// <ins>Optional arguments</ins>
10355 ///
10356 /// uchar: `bool` -> Output an unsigned char image
10357 ///
10358 /// nodc: `bool` -> Remove DC component
10359 ///
10360 /// reject: `bool` -> Invert the sense of the filter
10361 ///
10362 /// optical: `bool` -> Rotate quadrants to optical space
10363 pub fn mask_ideal_band_with_opts(
10364 width: i32,
10365 height: i32,
10366 frequency_cutoff_x: f64,
10367 frequency_cutoff_y: f64,
10368 radius: f64,
10369 option: VOption,
10370 ) -> Result<VipsImage> {
10371 let mut out_out = VipsImage::from(null_mut());
10372 let vips_op_response = call(
10373 "mask_ideal_band",
10374 option
10375 .set(
10376 "out",
10377 &mut out_out,
10378 )
10379 .set(
10380 "width",
10381 width,
10382 )
10383 .set(
10384 "height",
10385 height,
10386 )
10387 .set(
10388 "frequency-cutoff-x",
10389 frequency_cutoff_x,
10390 )
10391 .set(
10392 "frequency-cutoff-y",
10393 frequency_cutoff_y,
10394 )
10395 .set(
10396 "radius",
10397 radius,
10398 ),
10399 );
10400
10401 utils::result(
10402 vips_op_response,
10403 out_out,
10404 Error::OperationError("MaskIdealBand (vips_mask_ideal_band) failed".to_string()),
10405 )
10406 }
10407
10408 /// VipsMaskIdealRing (mask_ideal_ring), make an ideal ring filter
10409 /// returns `VipsImage` - Output image
10410 ///
10411 /// width: `i32` -> Image width in pixels
10412 ///
10413 /// height: `i32` -> Image height in pixels
10414 ///
10415 /// frequency_cutoff: `f64` -> Frequency cutoff
10416 ///
10417 /// ringwidth: `f64` -> Ringwidth
10418 pub fn mask_ideal_ring(
10419 width: i32,
10420 height: i32,
10421 frequency_cutoff: f64,
10422 ringwidth: f64,
10423 ) -> Result<VipsImage> {
10424 let mut out_out = VipsImage::from(null_mut());
10425 let vips_op_response = call(
10426 "mask_ideal_ring",
10427 VOption::new()
10428 .set(
10429 "out",
10430 &mut out_out,
10431 )
10432 .set(
10433 "width",
10434 width,
10435 )
10436 .set(
10437 "height",
10438 height,
10439 )
10440 .set(
10441 "frequency-cutoff",
10442 frequency_cutoff,
10443 )
10444 .set(
10445 "ringwidth",
10446 ringwidth,
10447 ),
10448 );
10449
10450 utils::result(
10451 vips_op_response,
10452 out_out,
10453 Error::OperationError("MaskIdealRing (vips_mask_ideal_ring) failed".to_string()),
10454 )
10455 }
10456
10457 /// VipsMaskIdealRing (mask_ideal_ring), make an ideal ring filter
10458 /// returns `VipsImage` - Output image
10459 ///
10460 /// width: `i32` -> Image width in pixels
10461 ///
10462 /// height: `i32` -> Image height in pixels
10463 ///
10464 /// frequency_cutoff: `f64` -> Frequency cutoff
10465 ///
10466 /// ringwidth: `f64` -> Ringwidth
10467 ///
10468 /// <ins>Optional arguments</ins>
10469 ///
10470 /// uchar: `bool` -> Output an unsigned char image
10471 ///
10472 /// nodc: `bool` -> Remove DC component
10473 ///
10474 /// reject: `bool` -> Invert the sense of the filter
10475 ///
10476 /// optical: `bool` -> Rotate quadrants to optical space
10477 pub fn mask_ideal_ring_with_opts(
10478 width: i32,
10479 height: i32,
10480 frequency_cutoff: f64,
10481 ringwidth: f64,
10482 option: VOption,
10483 ) -> Result<VipsImage> {
10484 let mut out_out = VipsImage::from(null_mut());
10485 let vips_op_response = call(
10486 "mask_ideal_ring",
10487 option
10488 .set(
10489 "out",
10490 &mut out_out,
10491 )
10492 .set(
10493 "width",
10494 width,
10495 )
10496 .set(
10497 "height",
10498 height,
10499 )
10500 .set(
10501 "frequency-cutoff",
10502 frequency_cutoff,
10503 )
10504 .set(
10505 "ringwidth",
10506 ringwidth,
10507 ),
10508 );
10509
10510 utils::result(
10511 vips_op_response,
10512 out_out,
10513 Error::OperationError("MaskIdealRing (vips_mask_ideal_ring) failed".to_string()),
10514 )
10515 }
10516
10517 /// VipsMatch (match), first-order match of two images
10518 /// returns `VipsImage` - Output image
10519 ///
10520 /// sec: `&VipsImage` -> Secondary image
10521 ///
10522 /// xr1: `i32` -> Position of first reference tie-point
10523 ///
10524 /// yr1: `i32` -> Position of first reference tie-point
10525 ///
10526 /// xs1: `i32` -> Position of first secondary tie-point
10527 ///
10528 /// ys1: `i32` -> Position of first secondary tie-point
10529 ///
10530 /// xr2: `i32` -> Position of second reference tie-point
10531 ///
10532 /// yr2: `i32` -> Position of second reference tie-point
10533 ///
10534 /// xs2: `i32` -> Position of second secondary tie-point
10535 ///
10536 /// ys2: `i32` -> Position of second secondary tie-point
10537 pub fn matches(
10538 &self,
10539 sec: &VipsImage,
10540 xr1: i32,
10541 yr1: i32,
10542 xs1: i32,
10543 ys1: i32,
10544 xr2: i32,
10545 yr2: i32,
10546 xs2: i32,
10547 ys2: i32,
10548 ) -> Result<VipsImage> {
10549 let mut out_out = VipsImage::from(null_mut());
10550 let vips_op_response = call(
10551 "match",
10552 VOption::new()
10553 .set(
10554 "ref", self,
10555 )
10556 .set("sec", sec)
10557 .set(
10558 "out",
10559 &mut out_out,
10560 )
10561 .set("xr1", xr1)
10562 .set("yr1", yr1)
10563 .set("xs1", xs1)
10564 .set("ys1", ys1)
10565 .set("xr2", xr2)
10566 .set("yr2", yr2)
10567 .set("xs2", xs2)
10568 .set("ys2", ys2),
10569 );
10570
10571 utils::result(
10572 vips_op_response,
10573 out_out,
10574 Error::OperationError("Matchs (vips_match) failed".to_string()),
10575 )
10576 }
10577
10578 /// VipsMatch (match), first-order match of two images
10579 /// returns `VipsImage` - Output image
10580 ///
10581 /// sec: `&VipsImage` -> Secondary image
10582 ///
10583 /// xr1: `i32` -> Position of first reference tie-point
10584 ///
10585 /// yr1: `i32` -> Position of first reference tie-point
10586 ///
10587 /// xs1: `i32` -> Position of first secondary tie-point
10588 ///
10589 /// ys1: `i32` -> Position of first secondary tie-point
10590 ///
10591 /// xr2: `i32` -> Position of second reference tie-point
10592 ///
10593 /// yr2: `i32` -> Position of second reference tie-point
10594 ///
10595 /// xs2: `i32` -> Position of second secondary tie-point
10596 ///
10597 /// ys2: `i32` -> Position of second secondary tie-point
10598 ///
10599 /// <ins>Optional arguments</ins>
10600 ///
10601 /// hwindow: `i32` -> Half window size
10602 ///
10603 /// harea: `i32` -> Half area size
10604 ///
10605 /// search: `bool` -> Search to improve tie-points
10606 ///
10607 /// interpolate: `&VipsInterpolate` -> Interpolate pixels with this
10608 pub fn matches_with_opts(
10609 &self,
10610 sec: &VipsImage,
10611 xr1: i32,
10612 yr1: i32,
10613 xs1: i32,
10614 ys1: i32,
10615 xr2: i32,
10616 yr2: i32,
10617 xs2: i32,
10618 ys2: i32,
10619 option: VOption,
10620 ) -> Result<VipsImage> {
10621 let mut out_out = VipsImage::from(null_mut());
10622 let vips_op_response = call(
10623 "match",
10624 option
10625 .set(
10626 "ref", self,
10627 )
10628 .set("sec", sec)
10629 .set(
10630 "out",
10631 &mut out_out,
10632 )
10633 .set("xr1", xr1)
10634 .set("yr1", yr1)
10635 .set("xs1", xs1)
10636 .set("ys1", ys1)
10637 .set("xr2", xr2)
10638 .set("yr2", yr2)
10639 .set("xs2", xs2)
10640 .set("ys2", ys2),
10641 );
10642
10643 utils::result(
10644 vips_op_response,
10645 out_out,
10646 Error::OperationError("Matchs (vips_match) failed".to_string()),
10647 )
10648 }
10649
10650 /// VipsMath2 (math2), binary math operations
10651 /// returns `VipsImage` - Output image
10652 ///
10653 /// right: `&VipsImage` -> Right-hand image argument
10654 ///
10655 /// math2: `OperationMath2` -> Math to perform
10656 pub fn math2(&self, right: &VipsImage, math2: OperationMath2) -> Result<VipsImage> {
10657 let mut out_out = VipsImage::from(null_mut());
10658 let vips_op_response = call(
10659 "math2",
10660 VOption::new()
10661 .set(
10662 "left",
10663 self,
10664 )
10665 .set(
10666 "right",
10667 right,
10668 )
10669 .set(
10670 "out",
10671 &mut out_out,
10672 )
10673 .set(
10674 "math2",
10675 math2 as i32,
10676 ),
10677 );
10678
10679 utils::result(
10680 vips_op_response,
10681 out_out,
10682 Error::OperationError("Math2 (vips_math2) failed".to_string()),
10683 )
10684 }
10685
10686 /// VipsMath2Const (math2_const), binary math operations with a constant
10687 /// returns `VipsImage` - Output image
10688 ///
10689 /// math2: `OperationMath2` -> Math to perform
10690 ///
10691 /// c: `&[f64]` -> Array of constants
10692 pub fn math2_const(&self, math2: OperationMath2, c: &[f64]) -> Result<VipsImage> {
10693 let mut out_out = VipsImage::from(null_mut());
10694 let vips_op_response = call(
10695 "math2_const",
10696 VOption::new()
10697 .set("in", self)
10698 .set(
10699 "out",
10700 &mut out_out,
10701 )
10702 .set(
10703 "math2",
10704 math2 as i32,
10705 )
10706 .set("c", c),
10707 );
10708
10709 utils::result(
10710 vips_op_response,
10711 out_out,
10712 Error::OperationError("Math2Const (vips_math2_const) failed".to_string()),
10713 )
10714 }
10715
10716 /// VipsMath (math), apply a math operation to an image
10717 /// returns `VipsImage` - Output image
10718 ///
10719 /// math: `OperationMath` -> Math to perform
10720 pub fn math(&self, math: OperationMath) -> Result<VipsImage> {
10721 let mut out_out = VipsImage::from(null_mut());
10722 let vips_op_response = call(
10723 "math",
10724 VOption::new()
10725 .set("in", self)
10726 .set(
10727 "out",
10728 &mut out_out,
10729 )
10730 .set(
10731 "math",
10732 math as i32,
10733 ),
10734 );
10735
10736 utils::result(
10737 vips_op_response,
10738 out_out,
10739 Error::OperationError("Math (vips_math) failed".to_string()),
10740 )
10741 }
10742
10743 /// VipsForeignLoadMat (matload), load mat from file (.mat), priority=0, untrusted, is_a, get_flags, get_flags_filename, header, load
10744 /// returns `VipsImage` - Output image
10745 ///
10746 /// filename: `&str` -> Filename to load from
10747 pub fn matload(filename: &str) -> Result<VipsImage> {
10748 let mut out_out = VipsImage::from(null_mut());
10749 let vips_op_response = call(
10750 "matload",
10751 VOption::new()
10752 .set(
10753 "filename",
10754 filename,
10755 )
10756 .set(
10757 "out",
10758 &mut out_out,
10759 ),
10760 );
10761
10762 utils::result(
10763 vips_op_response,
10764 out_out,
10765 Error::OperationError("Matload (vips_matload) failed".to_string()),
10766 )
10767 }
10768
10769 /// VipsForeignLoadMat (matload), load mat from file (.mat), priority=0, untrusted, is_a, get_flags, get_flags_filename, header, load
10770 /// returns `VipsImage` - Output image
10771 ///
10772 /// filename: `&str` -> Filename to load from
10773 ///
10774 /// <ins>Optional arguments</ins>
10775 ///
10776 /// flags: [`ForeignFlags`] -> Flags for this file
10777 ///
10778 /// memory: `bool` -> Force open via memory
10779 ///
10780 /// access: [`Access`] -> Required access pattern for this file
10781 ///
10782 /// fail_on: [`FailOn`] -> Error level to fail on
10783 ///
10784 /// revalidate: `bool` -> Don't use a cached result for this operation
10785 pub fn matload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
10786 let mut out_out = VipsImage::from(null_mut());
10787 let vips_op_response = call(
10788 "matload",
10789 option
10790 .set(
10791 "filename",
10792 filename,
10793 )
10794 .set(
10795 "out",
10796 &mut out_out,
10797 ),
10798 );
10799
10800 utils::result(
10801 vips_op_response,
10802 out_out,
10803 Error::OperationError("Matload (vips_matload) failed".to_string()),
10804 )
10805 }
10806
10807 /// VipsMatrixinvert (matrixinvert), invert a matrix
10808 /// returns `VipsImage` - Output matrix
10809 pub fn matrixinvert(&self) -> Result<VipsImage> {
10810 let mut out_out = VipsImage::from(null_mut());
10811 let vips_op_response = call(
10812 "matrixinvert",
10813 VOption::new()
10814 .set("in", self)
10815 .set(
10816 "out",
10817 &mut out_out,
10818 ),
10819 );
10820
10821 utils::result(
10822 vips_op_response,
10823 out_out,
10824 Error::OperationError("Matrixinvert (vips_matrixinvert) failed".to_string()),
10825 )
10826 }
10827
10828 /// VipsForeignLoadMatrixFile (matrixload), load matrix (.mat), priority=0, is_a, get_flags, get_flags_filename, header, load
10829 /// returns `VipsImage` - Output image
10830 ///
10831 /// filename: `&str` -> Filename to load from
10832 pub fn matrixload(filename: &str) -> Result<VipsImage> {
10833 let mut out_out = VipsImage::from(null_mut());
10834 let vips_op_response = call(
10835 "matrixload",
10836 VOption::new()
10837 .set(
10838 "filename",
10839 filename,
10840 )
10841 .set(
10842 "out",
10843 &mut out_out,
10844 ),
10845 );
10846
10847 utils::result(
10848 vips_op_response,
10849 out_out,
10850 Error::OperationError("Matrixload (vips_matrixload) failed".to_string()),
10851 )
10852 }
10853
10854 /// VipsForeignLoadMatrixFile (matrixload), load matrix (.mat), priority=0, is_a, get_flags, get_flags_filename, header, load
10855 /// returns `VipsImage` - Output image
10856 ///
10857 /// filename: `&str` -> Filename to load from
10858 ///
10859 /// <ins>Optional arguments</ins>
10860 ///
10861 /// flags: [`ForeignFlags`] -> Flags for this file
10862 ///
10863 /// memory: `bool` -> Force open via memory
10864 ///
10865 /// access: [`Access`] -> Required access pattern for this file
10866 ///
10867 /// fail_on: [`FailOn`] -> Error level to fail on
10868 ///
10869 /// revalidate: `bool` -> Don't use a cached result for this operation
10870 pub fn matrixload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
10871 let mut out_out = VipsImage::from(null_mut());
10872 let vips_op_response = call(
10873 "matrixload",
10874 option
10875 .set(
10876 "filename",
10877 filename,
10878 )
10879 .set(
10880 "out",
10881 &mut out_out,
10882 ),
10883 );
10884
10885 utils::result(
10886 vips_op_response,
10887 out_out,
10888 Error::OperationError("Matrixload (vips_matrixload) failed".to_string()),
10889 )
10890 }
10891
10892 /// VipsForeignLoadMatrixSource (matrixload_source), load matrix, priority=0, is_a_source, get_flags, header, load
10893 /// returns `VipsImage` - Output image
10894 ///
10895 /// source: `&VipsSource` -> Source to load from
10896 pub fn matrixload_source(source: &VipsSource) -> Result<VipsImage> {
10897 let mut out_out = VipsImage::from(null_mut());
10898 let vips_op_response = call(
10899 "matrixload_source",
10900 VOption::new()
10901 .set(
10902 "source",
10903 source,
10904 )
10905 .set(
10906 "out",
10907 &mut out_out,
10908 ),
10909 );
10910
10911 utils::result(
10912 vips_op_response,
10913 out_out,
10914 Error::OperationError("MatrixloadSource (vips_matrixload_source) failed".to_string()),
10915 )
10916 }
10917
10918 /// VipsForeignLoadMatrixSource (matrixload_source), load matrix, priority=0, is_a_source, get_flags, header, load
10919 /// returns `VipsImage` - Output image
10920 ///
10921 /// source: `&VipsSource` -> Source to load from
10922 ///
10923 /// <ins>Optional arguments</ins>
10924 ///
10925 /// flags: [`ForeignFlags`] -> Flags for this file
10926 ///
10927 /// memory: `bool` -> Force open via memory
10928 ///
10929 /// access: [`Access`] -> Required access pattern for this file
10930 ///
10931 /// fail_on: [`FailOn`] -> Error level to fail on
10932 ///
10933 /// revalidate: `bool` -> Don't use a cached result for this operation
10934 pub fn matrixload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
10935 let mut out_out = VipsImage::from(null_mut());
10936 let vips_op_response = call(
10937 "matrixload_source",
10938 option
10939 .set(
10940 "source",
10941 source,
10942 )
10943 .set(
10944 "out",
10945 &mut out_out,
10946 ),
10947 );
10948
10949 utils::result(
10950 vips_op_response,
10951 out_out,
10952 Error::OperationError("MatrixloadSource (vips_matrixload_source) failed".to_string()),
10953 )
10954 }
10955
10956 /// VipsMatrixmultiply (matrixmultiply), multiply two matrices
10957 /// returns `VipsImage` - Output matrix
10958 ///
10959 /// right: `&VipsImage` -> Second matrix to multiply
10960 pub fn matrixmultiply(&self, right: &VipsImage) -> Result<VipsImage> {
10961 let mut out_out = VipsImage::from(null_mut());
10962 let vips_op_response = call(
10963 "matrixmultiply",
10964 VOption::new()
10965 .set(
10966 "left",
10967 self,
10968 )
10969 .set(
10970 "right",
10971 right,
10972 )
10973 .set(
10974 "out",
10975 &mut out_out,
10976 ),
10977 );
10978
10979 utils::result(
10980 vips_op_response,
10981 out_out,
10982 Error::OperationError("Matrixmultiply (vips_matrixmultiply) failed".to_string()),
10983 )
10984 }
10985
10986 /// VipsForeignPrintMatrix (matrixprint), print matrix (.mat), priority=0, mono
10987 pub fn matrixprint(&self) -> Result<()> {
10988 let vips_op_response = call(
10989 "matrixprint",
10990 VOption::new().set("in", self),
10991 );
10992
10993 utils::result(
10994 vips_op_response,
10995 (),
10996 Error::OperationError("Matrixprint (vips_matrixprint) failed".to_string()),
10997 )
10998 }
10999
11000 /// VipsForeignPrintMatrix (matrixprint), print matrix (.mat), priority=0, mono
11001 ///
11002 /// <ins>Optional arguments</ins>
11003 ///
11004 /// keep: [`ForeignKeep`] -> Which metadata to retain
11005 ///
11006 /// background: `&[f64]` -> Background value
11007 ///
11008 /// page_height: `i32` -> Set page height for multipage save
11009 ///
11010 /// profile: `&str` -> Filename of ICC profile to embed
11011 pub fn matrixprint_with_opts(&self, option: VOption) -> Result<()> {
11012 let vips_op_response = call(
11013 "matrixprint",
11014 option.set("in", self),
11015 );
11016
11017 utils::result(
11018 vips_op_response,
11019 (),
11020 Error::OperationError("Matrixprint (vips_matrixprint) failed".to_string()),
11021 )
11022 }
11023
11024 /// VipsForeignSaveMatrixFile (matrixsave), save image to matrix (.mat), priority=0, mono
11025 ///
11026 /// filename: `&str` -> Filename to save to
11027 pub fn matrixsave(&self, filename: &str) -> Result<()> {
11028 let vips_op_response = call(
11029 "matrixsave",
11030 VOption::new()
11031 .set("in", self)
11032 .set(
11033 "filename",
11034 filename,
11035 ),
11036 );
11037
11038 utils::result(
11039 vips_op_response,
11040 (),
11041 Error::OperationError("Matrixsave (vips_matrixsave) failed".to_string()),
11042 )
11043 }
11044
11045 /// VipsForeignSaveMatrixFile (matrixsave), save image to matrix (.mat), priority=0, mono
11046 ///
11047 /// filename: `&str` -> Filename to save to
11048 ///
11049 /// <ins>Optional arguments</ins>
11050 ///
11051 /// keep: [`ForeignKeep`] -> Which metadata to retain
11052 ///
11053 /// background: `&[f64]` -> Background value
11054 ///
11055 /// page_height: `i32` -> Set page height for multipage save
11056 ///
11057 /// profile: `&str` -> Filename of ICC profile to embed
11058 pub fn matrixsave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
11059 let vips_op_response = call(
11060 "matrixsave",
11061 option
11062 .set("in", self)
11063 .set(
11064 "filename",
11065 filename,
11066 ),
11067 );
11068
11069 utils::result(
11070 vips_op_response,
11071 (),
11072 Error::OperationError("Matrixsave (vips_matrixsave) failed".to_string()),
11073 )
11074 }
11075
11076 /// VipsForeignSaveMatrixTarget (matrixsave_target), save image to matrix (.mat), priority=0, mono
11077 ///
11078 /// target: `&VipsTarget` -> Target to save to
11079 pub fn matrixsave_target(&self, target: &VipsTarget) -> Result<()> {
11080 let vips_op_response = call(
11081 "matrixsave_target",
11082 VOption::new()
11083 .set("in", self)
11084 .set(
11085 "target",
11086 target,
11087 ),
11088 );
11089
11090 utils::result(
11091 vips_op_response,
11092 (),
11093 Error::OperationError("MatrixsaveTarget (vips_matrixsave_target) failed".to_string()),
11094 )
11095 }
11096
11097 /// VipsForeignSaveMatrixTarget (matrixsave_target), save image to matrix (.mat), priority=0, mono
11098 ///
11099 /// target: `&VipsTarget` -> Target to save to
11100 ///
11101 /// <ins>Optional arguments</ins>
11102 ///
11103 /// keep: [`ForeignKeep`] -> Which metadata to retain
11104 ///
11105 /// background: `&[f64]` -> Background value
11106 ///
11107 /// page_height: `i32` -> Set page height for multipage save
11108 ///
11109 /// profile: `&str` -> Filename of ICC profile to embed
11110 pub fn matrixsave_target_with_opts(&self, target: &VipsTarget, option: VOption) -> Result<()> {
11111 let vips_op_response = call(
11112 "matrixsave_target",
11113 option
11114 .set("in", self)
11115 .set(
11116 "target",
11117 target,
11118 ),
11119 );
11120
11121 utils::result(
11122 vips_op_response,
11123 (),
11124 Error::OperationError("MatrixsaveTarget (vips_matrixsave_target) failed".to_string()),
11125 )
11126 }
11127
11128 /// VipsMax (max), find image maximum
11129 /// returns `f64` - Output value
11130 pub fn max(&self) -> Result<f64> {
11131 let mut out_out: f64 = 0.0;
11132 let vips_op_response = call(
11133 "max",
11134 VOption::new()
11135 .set("in", self)
11136 .set(
11137 "out",
11138 &mut out_out,
11139 ),
11140 );
11141
11142 utils::result(
11143 vips_op_response,
11144 out_out,
11145 Error::OperationError("Max (vips_max) failed".to_string()),
11146 )
11147 }
11148
11149 /// VipsMax (max), find image maximum
11150 /// returns `f64` - Output value
11151 ///
11152 /// <ins>Optional arguments</ins>
11153 ///
11154 /// x: `&mut i32` -> Horizontal position of maximum
11155 ///
11156 /// y: `&mut i32` -> Vertical position of maximum
11157 ///
11158 /// size: `i32` -> Number of maximum values to find
11159 ///
11160 /// out_array: `&mut Vec<f64>` -> Array of output values
11161 ///
11162 /// x_array: `&[i32]` -> Array of horizontal positions
11163 ///
11164 /// y_array: `&[i32]` -> Array of vertical positions
11165 pub fn max_with_opts(&self, option: VOption) -> Result<f64> {
11166 let mut out_out: f64 = 0.0;
11167 let vips_op_response = call(
11168 "max",
11169 option
11170 .set("in", self)
11171 .set(
11172 "out",
11173 &mut out_out,
11174 ),
11175 );
11176
11177 utils::result(
11178 vips_op_response,
11179 out_out,
11180 Error::OperationError("Max (vips_max) failed".to_string()),
11181 )
11182 }
11183
11184 /// VipsMaxpair (maxpair), maximum of a pair of images
11185 /// returns `VipsImage` - Output image
11186 ///
11187 /// right: `&VipsImage` -> Right-hand image argument
11188 pub fn maxpair(&self, right: &VipsImage) -> Result<VipsImage> {
11189 let mut out_out = VipsImage::from(null_mut());
11190 let vips_op_response = call(
11191 "maxpair",
11192 VOption::new()
11193 .set(
11194 "left",
11195 self,
11196 )
11197 .set(
11198 "right",
11199 right,
11200 )
11201 .set(
11202 "out",
11203 &mut out_out,
11204 ),
11205 );
11206
11207 utils::result(
11208 vips_op_response,
11209 out_out,
11210 Error::OperationError("Maxpair (vips_maxpair) failed".to_string()),
11211 )
11212 }
11213
11214 /// VipsMeasure (measure), measure a set of patches on a color chart
11215 /// returns `VipsImage` - Output array of statistics
11216 ///
11217 /// h: `i32` -> Number of patches across chart
11218 ///
11219 /// v: `i32` -> Number of patches down chart
11220 pub fn measure(&self, h: i32, v: i32) -> Result<VipsImage> {
11221 let mut out_out = VipsImage::from(null_mut());
11222 let vips_op_response = call(
11223 "measure",
11224 VOption::new()
11225 .set("in", self)
11226 .set(
11227 "out",
11228 &mut out_out,
11229 )
11230 .set("h", h)
11231 .set("v", v),
11232 );
11233
11234 utils::result(
11235 vips_op_response,
11236 out_out,
11237 Error::OperationError("Measure (vips_measure) failed".to_string()),
11238 )
11239 }
11240
11241 /// VipsMeasure (measure), measure a set of patches on a color chart
11242 /// returns `VipsImage` - Output array of statistics
11243 ///
11244 /// h: `i32` -> Number of patches across chart
11245 ///
11246 /// v: `i32` -> Number of patches down chart
11247 ///
11248 /// <ins>Optional arguments</ins>
11249 ///
11250 /// left: `i32` -> Left edge of extract area
11251 ///
11252 /// top: `i32` -> Top edge of extract area
11253 ///
11254 /// width: `i32` -> Width of extract area
11255 ///
11256 /// height: `i32` -> Height of extract area
11257 pub fn measure_with_opts(&self, h: i32, v: i32, option: VOption) -> Result<VipsImage> {
11258 let mut out_out = VipsImage::from(null_mut());
11259 let vips_op_response = call(
11260 "measure",
11261 option
11262 .set("in", self)
11263 .set(
11264 "out",
11265 &mut out_out,
11266 )
11267 .set("h", h)
11268 .set("v", v),
11269 );
11270
11271 utils::result(
11272 vips_op_response,
11273 out_out,
11274 Error::OperationError("Measure (vips_measure) failed".to_string()),
11275 )
11276 }
11277
11278 /// VipsMerge (merge), merge two images
11279 /// returns `VipsImage` - Output image
11280 ///
11281 /// sec: `&VipsImage` -> Secondary image
11282 ///
11283 /// direction: `Direction` -> Horizontal or vertical merge
11284 ///
11285 /// dx: `i32` -> Horizontal displacement from sec to ref
11286 ///
11287 /// dy: `i32` -> Vertical displacement from sec to ref
11288 pub fn merge(
11289 &self,
11290 sec: &VipsImage,
11291 direction: Direction,
11292 dx: i32,
11293 dy: i32,
11294 ) -> Result<VipsImage> {
11295 let mut out_out = VipsImage::from(null_mut());
11296 let vips_op_response = call(
11297 "merge",
11298 VOption::new()
11299 .set(
11300 "ref", self,
11301 )
11302 .set("sec", sec)
11303 .set(
11304 "out",
11305 &mut out_out,
11306 )
11307 .set(
11308 "direction",
11309 direction as i32,
11310 )
11311 .set("dx", dx)
11312 .set("dy", dy),
11313 );
11314
11315 utils::result(
11316 vips_op_response,
11317 out_out,
11318 Error::OperationError("Merge (vips_merge) failed".to_string()),
11319 )
11320 }
11321
11322 /// VipsMerge (merge), merge two images
11323 /// returns `VipsImage` - Output image
11324 ///
11325 /// sec: `&VipsImage` -> Secondary image
11326 ///
11327 /// direction: `Direction` -> Horizontal or vertical merge
11328 ///
11329 /// dx: `i32` -> Horizontal displacement from sec to ref
11330 ///
11331 /// dy: `i32` -> Vertical displacement from sec to ref
11332 ///
11333 /// <ins>Optional arguments</ins>
11334 ///
11335 /// mblend: `i32` -> Maximum blend size
11336 pub fn merge_with_opts(
11337 &self,
11338 sec: &VipsImage,
11339 direction: Direction,
11340 dx: i32,
11341 dy: i32,
11342 option: VOption,
11343 ) -> Result<VipsImage> {
11344 let mut out_out = VipsImage::from(null_mut());
11345 let vips_op_response = call(
11346 "merge",
11347 option
11348 .set(
11349 "ref", self,
11350 )
11351 .set("sec", sec)
11352 .set(
11353 "out",
11354 &mut out_out,
11355 )
11356 .set(
11357 "direction",
11358 direction as i32,
11359 )
11360 .set("dx", dx)
11361 .set("dy", dy),
11362 );
11363
11364 utils::result(
11365 vips_op_response,
11366 out_out,
11367 Error::OperationError("Merge (vips_merge) failed".to_string()),
11368 )
11369 }
11370
11371 /// VipsMin (min), find image minimum
11372 /// returns `f64` - Output value
11373 pub fn min(&self) -> Result<f64> {
11374 let mut out_out: f64 = 0.0;
11375 let vips_op_response = call(
11376 "min",
11377 VOption::new()
11378 .set("in", self)
11379 .set(
11380 "out",
11381 &mut out_out,
11382 ),
11383 );
11384
11385 utils::result(
11386 vips_op_response,
11387 out_out,
11388 Error::OperationError("Min (vips_min) failed".to_string()),
11389 )
11390 }
11391
11392 /// VipsMin (min), find image minimum
11393 /// returns `f64` - Output value
11394 ///
11395 /// <ins>Optional arguments</ins>
11396 ///
11397 /// x: `&mut i32` -> Horizontal position of minimum
11398 ///
11399 /// y: `&mut i32` -> Vertical position of minimum
11400 ///
11401 /// size: `i32` -> Number of minimum values to find
11402 ///
11403 /// out_array: `&mut Vec<f64>` -> Array of output values
11404 ///
11405 /// x_array: `&[i32]` -> Array of horizontal positions
11406 ///
11407 /// y_array: `&[i32]` -> Array of vertical positions
11408 pub fn min_with_opts(&self, option: VOption) -> Result<f64> {
11409 let mut out_out: f64 = 0.0;
11410 let vips_op_response = call(
11411 "min",
11412 option
11413 .set("in", self)
11414 .set(
11415 "out",
11416 &mut out_out,
11417 ),
11418 );
11419
11420 utils::result(
11421 vips_op_response,
11422 out_out,
11423 Error::OperationError("Min (vips_min) failed".to_string()),
11424 )
11425 }
11426
11427 /// VipsMinpair (minpair), minimum of a pair of images
11428 /// returns `VipsImage` - Output image
11429 ///
11430 /// right: `&VipsImage` -> Right-hand image argument
11431 pub fn minpair(&self, right: &VipsImage) -> Result<VipsImage> {
11432 let mut out_out = VipsImage::from(null_mut());
11433 let vips_op_response = call(
11434 "minpair",
11435 VOption::new()
11436 .set(
11437 "left",
11438 self,
11439 )
11440 .set(
11441 "right",
11442 right,
11443 )
11444 .set(
11445 "out",
11446 &mut out_out,
11447 ),
11448 );
11449
11450 utils::result(
11451 vips_op_response,
11452 out_out,
11453 Error::OperationError("Minpair (vips_minpair) failed".to_string()),
11454 )
11455 }
11456
11457 /// VipsMorph (morph), morphology operation
11458 /// returns `VipsImage` - Output image
11459 ///
11460 /// mask: `&VipsImage` -> Input matrix image
11461 ///
11462 /// morph: `OperationMorphology` -> Morphological operation to perform
11463 pub fn morph(&self, mask: &VipsImage, morph: OperationMorphology) -> Result<VipsImage> {
11464 let mut out_out = VipsImage::from(null_mut());
11465 let vips_op_response = call(
11466 "morph",
11467 VOption::new()
11468 .set("in", self)
11469 .set(
11470 "out",
11471 &mut out_out,
11472 )
11473 .set(
11474 "mask",
11475 mask,
11476 )
11477 .set(
11478 "morph",
11479 morph as i32,
11480 ),
11481 );
11482
11483 utils::result(
11484 vips_op_response,
11485 out_out,
11486 Error::OperationError("Morph (vips_morph) failed".to_string()),
11487 )
11488 }
11489
11490 /// VipsMosaic1 (mosaic1), first-order mosaic of two images
11491 /// returns `VipsImage` - Output image
11492 ///
11493 /// sec: `&VipsImage` -> Secondary image
11494 ///
11495 /// direction: `Direction` -> Horizontal or vertical mosaic
11496 ///
11497 /// xr1: `i32` -> Position of first reference tie-point
11498 ///
11499 /// yr1: `i32` -> Position of first reference tie-point
11500 ///
11501 /// xs1: `i32` -> Position of first secondary tie-point
11502 ///
11503 /// ys1: `i32` -> Position of first secondary tie-point
11504 ///
11505 /// xr2: `i32` -> Position of second reference tie-point
11506 ///
11507 /// yr2: `i32` -> Position of second reference tie-point
11508 ///
11509 /// xs2: `i32` -> Position of second secondary tie-point
11510 ///
11511 /// ys2: `i32` -> Position of second secondary tie-point
11512 pub fn mosaic1(
11513 &self,
11514 sec: &VipsImage,
11515 direction: Direction,
11516 xr1: i32,
11517 yr1: i32,
11518 xs1: i32,
11519 ys1: i32,
11520 xr2: i32,
11521 yr2: i32,
11522 xs2: i32,
11523 ys2: i32,
11524 ) -> Result<VipsImage> {
11525 let mut out_out = VipsImage::from(null_mut());
11526 let vips_op_response = call(
11527 "mosaic1",
11528 VOption::new()
11529 .set(
11530 "ref", self,
11531 )
11532 .set("sec", sec)
11533 .set(
11534 "out",
11535 &mut out_out,
11536 )
11537 .set(
11538 "direction",
11539 direction as i32,
11540 )
11541 .set("xr1", xr1)
11542 .set("yr1", yr1)
11543 .set("xs1", xs1)
11544 .set("ys1", ys1)
11545 .set("xr2", xr2)
11546 .set("yr2", yr2)
11547 .set("xs2", xs2)
11548 .set("ys2", ys2),
11549 );
11550
11551 utils::result(
11552 vips_op_response,
11553 out_out,
11554 Error::OperationError("Mosaic1 (vips_mosaic1) failed".to_string()),
11555 )
11556 }
11557
11558 /// VipsMosaic1 (mosaic1), first-order mosaic of two images
11559 /// returns `VipsImage` - Output image
11560 ///
11561 /// sec: `&VipsImage` -> Secondary image
11562 ///
11563 /// direction: `Direction` -> Horizontal or vertical mosaic
11564 ///
11565 /// xr1: `i32` -> Position of first reference tie-point
11566 ///
11567 /// yr1: `i32` -> Position of first reference tie-point
11568 ///
11569 /// xs1: `i32` -> Position of first secondary tie-point
11570 ///
11571 /// ys1: `i32` -> Position of first secondary tie-point
11572 ///
11573 /// xr2: `i32` -> Position of second reference tie-point
11574 ///
11575 /// yr2: `i32` -> Position of second reference tie-point
11576 ///
11577 /// xs2: `i32` -> Position of second secondary tie-point
11578 ///
11579 /// ys2: `i32` -> Position of second secondary tie-point
11580 ///
11581 /// <ins>Optional arguments</ins>
11582 ///
11583 /// hwindow: `i32` -> Half window size
11584 ///
11585 /// harea: `i32` -> Half area size
11586 ///
11587 /// search: `bool` -> Search to improve tie-points
11588 ///
11589 /// interpolate: `&VipsInterpolate` -> Interpolate pixels with this
11590 ///
11591 /// mblend: `i32` -> Maximum blend size
11592 pub fn mosaic1_with_opts(
11593 &self,
11594 sec: &VipsImage,
11595 direction: Direction,
11596 xr1: i32,
11597 yr1: i32,
11598 xs1: i32,
11599 ys1: i32,
11600 xr2: i32,
11601 yr2: i32,
11602 xs2: i32,
11603 ys2: i32,
11604 option: VOption,
11605 ) -> Result<VipsImage> {
11606 let mut out_out = VipsImage::from(null_mut());
11607 let vips_op_response = call(
11608 "mosaic1",
11609 option
11610 .set(
11611 "ref", self,
11612 )
11613 .set("sec", sec)
11614 .set(
11615 "out",
11616 &mut out_out,
11617 )
11618 .set(
11619 "direction",
11620 direction as i32,
11621 )
11622 .set("xr1", xr1)
11623 .set("yr1", yr1)
11624 .set("xs1", xs1)
11625 .set("ys1", ys1)
11626 .set("xr2", xr2)
11627 .set("yr2", yr2)
11628 .set("xs2", xs2)
11629 .set("ys2", ys2),
11630 );
11631
11632 utils::result(
11633 vips_op_response,
11634 out_out,
11635 Error::OperationError("Mosaic1 (vips_mosaic1) failed".to_string()),
11636 )
11637 }
11638
11639 /// VipsMosaic (mosaic), mosaic two images
11640 /// returns `VipsImage` - Output image
11641 ///
11642 /// sec: `&VipsImage` -> Secondary image
11643 ///
11644 /// direction: `Direction` -> Horizontal or vertical mosaic
11645 ///
11646 /// xref: `i32` -> Position of reference tie-point
11647 ///
11648 /// yref: `i32` -> Position of reference tie-point
11649 ///
11650 /// xsec: `i32` -> Position of secondary tie-point
11651 ///
11652 /// ysec: `i32` -> Position of secondary tie-point
11653 pub fn mosaic(
11654 &self,
11655 sec: &VipsImage,
11656 direction: Direction,
11657 xref: i32,
11658 yref: i32,
11659 xsec: i32,
11660 ysec: i32,
11661 ) -> Result<VipsImage> {
11662 let mut out_out = VipsImage::from(null_mut());
11663 let vips_op_response = call(
11664 "mosaic",
11665 VOption::new()
11666 .set(
11667 "ref", self,
11668 )
11669 .set("sec", sec)
11670 .set(
11671 "out",
11672 &mut out_out,
11673 )
11674 .set(
11675 "direction",
11676 direction as i32,
11677 )
11678 .set(
11679 "xref",
11680 xref,
11681 )
11682 .set(
11683 "yref",
11684 yref,
11685 )
11686 .set(
11687 "xsec",
11688 xsec,
11689 )
11690 .set(
11691 "ysec",
11692 ysec,
11693 ),
11694 );
11695
11696 utils::result(
11697 vips_op_response,
11698 out_out,
11699 Error::OperationError("Mosaic (vips_mosaic) failed".to_string()),
11700 )
11701 }
11702
11703 /// VipsMosaic (mosaic), mosaic two images
11704 /// returns `VipsImage` - Output image
11705 ///
11706 /// sec: `&VipsImage` -> Secondary image
11707 ///
11708 /// direction: `Direction` -> Horizontal or vertical mosaic
11709 ///
11710 /// xref: `i32` -> Position of reference tie-point
11711 ///
11712 /// yref: `i32` -> Position of reference tie-point
11713 ///
11714 /// xsec: `i32` -> Position of secondary tie-point
11715 ///
11716 /// ysec: `i32` -> Position of secondary tie-point
11717 ///
11718 /// <ins>Optional arguments</ins>
11719 ///
11720 /// hwindow: `i32` -> Half window size
11721 ///
11722 /// harea: `i32` -> Half area size
11723 ///
11724 /// mblend: `i32` -> Maximum blend size
11725 ///
11726 /// bandno: `i32` -> Band to search for features on
11727 ///
11728 /// dx0: `&mut i32` -> Detected integer offset
11729 ///
11730 /// dy0: `&mut i32` -> Detected integer offset
11731 ///
11732 /// scale1: `&mut f64` -> Detected scale
11733 ///
11734 /// angle1: `&mut f64` -> Detected rotation
11735 ///
11736 /// dy1: `&mut f64` -> Detected first-order displacement
11737 ///
11738 /// dx1: `&mut f64` -> Detected first-order displacement
11739 pub fn mosaic_with_opts(
11740 &self,
11741 sec: &VipsImage,
11742 direction: Direction,
11743 xref: i32,
11744 yref: i32,
11745 xsec: i32,
11746 ysec: i32,
11747 option: VOption,
11748 ) -> Result<VipsImage> {
11749 let mut out_out = VipsImage::from(null_mut());
11750 let vips_op_response = call(
11751 "mosaic",
11752 option
11753 .set(
11754 "ref", self,
11755 )
11756 .set("sec", sec)
11757 .set(
11758 "out",
11759 &mut out_out,
11760 )
11761 .set(
11762 "direction",
11763 direction as i32,
11764 )
11765 .set(
11766 "xref",
11767 xref,
11768 )
11769 .set(
11770 "yref",
11771 yref,
11772 )
11773 .set(
11774 "xsec",
11775 xsec,
11776 )
11777 .set(
11778 "ysec",
11779 ysec,
11780 ),
11781 );
11782
11783 utils::result(
11784 vips_op_response,
11785 out_out,
11786 Error::OperationError("Mosaic (vips_mosaic) failed".to_string()),
11787 )
11788 }
11789
11790 /// VipsMsb (msb), pick most-significant byte from an image
11791 /// returns `VipsImage` - Output image
11792 pub fn msb(&self) -> Result<VipsImage> {
11793 let mut out_out = VipsImage::from(null_mut());
11794 let vips_op_response = call(
11795 "msb",
11796 VOption::new()
11797 .set("in", self)
11798 .set(
11799 "out",
11800 &mut out_out,
11801 ),
11802 );
11803
11804 utils::result(
11805 vips_op_response,
11806 out_out,
11807 Error::OperationError("Msb (vips_msb) failed".to_string()),
11808 )
11809 }
11810
11811 /// VipsMsb (msb), pick most-significant byte from an image
11812 /// returns `VipsImage` - Output image
11813 ///
11814 /// <ins>Optional arguments</ins>
11815 ///
11816 /// band: `i32` -> Band to msb
11817 pub fn msb_with_opts(&self, option: VOption) -> Result<VipsImage> {
11818 let mut out_out = VipsImage::from(null_mut());
11819 let vips_op_response = call(
11820 "msb",
11821 option
11822 .set("in", self)
11823 .set(
11824 "out",
11825 &mut out_out,
11826 ),
11827 );
11828
11829 utils::result(
11830 vips_op_response,
11831 out_out,
11832 Error::OperationError("Msb (vips_msb) failed".to_string()),
11833 )
11834 }
11835
11836 /// VipsMultiply (multiply), multiply two images
11837 /// returns `VipsImage` - Output image
11838 ///
11839 /// right: `&VipsImage` -> Right-hand image argument
11840 pub fn multiply(&self, right: &VipsImage) -> Result<VipsImage> {
11841 let mut out_out = VipsImage::from(null_mut());
11842 let vips_op_response = call(
11843 "multiply",
11844 VOption::new()
11845 .set(
11846 "left",
11847 self,
11848 )
11849 .set(
11850 "right",
11851 right,
11852 )
11853 .set(
11854 "out",
11855 &mut out_out,
11856 ),
11857 );
11858
11859 utils::result(
11860 vips_op_response,
11861 out_out,
11862 Error::OperationError("Multiply (vips_multiply) failed".to_string()),
11863 )
11864 }
11865
11866 /// VipsForeignLoadOpenexr (openexrload), load an OpenEXR image (.exr), priority=200, untrusted, is_a, get_flags, get_flags_filename, header, load
11867 /// returns `VipsImage` - Output image
11868 ///
11869 /// filename: `&str` -> Filename to load from
11870 pub fn openexrload(filename: &str) -> Result<VipsImage> {
11871 let mut out_out = VipsImage::from(null_mut());
11872 let vips_op_response = call(
11873 "openexrload",
11874 VOption::new()
11875 .set(
11876 "filename",
11877 filename,
11878 )
11879 .set(
11880 "out",
11881 &mut out_out,
11882 ),
11883 );
11884
11885 utils::result(
11886 vips_op_response,
11887 out_out,
11888 Error::OperationError("Openexrload (vips_openexrload) failed".to_string()),
11889 )
11890 }
11891
11892 /// VipsForeignLoadOpenexr (openexrload), load an OpenEXR image (.exr), priority=200, untrusted, is_a, get_flags, get_flags_filename, header, load
11893 /// returns `VipsImage` - Output image
11894 ///
11895 /// filename: `&str` -> Filename to load from
11896 ///
11897 /// <ins>Optional arguments</ins>
11898 ///
11899 /// flags: [`ForeignFlags`] -> Flags for this file
11900 ///
11901 /// memory: `bool` -> Force open via memory
11902 ///
11903 /// access: [`Access`] -> Required access pattern for this file
11904 ///
11905 /// fail_on: [`FailOn`] -> Error level to fail on
11906 ///
11907 /// revalidate: `bool` -> Don't use a cached result for this operation
11908 pub fn openexrload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
11909 let mut out_out = VipsImage::from(null_mut());
11910 let vips_op_response = call(
11911 "openexrload",
11912 option
11913 .set(
11914 "filename",
11915 filename,
11916 )
11917 .set(
11918 "out",
11919 &mut out_out,
11920 ),
11921 );
11922
11923 utils::result(
11924 vips_op_response,
11925 out_out,
11926 Error::OperationError("Openexrload (vips_openexrload) failed".to_string()),
11927 )
11928 }
11929
11930 /// 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
11931 /// returns `VipsImage` - Output image
11932 ///
11933 /// filename: `&str` -> Filename to load from
11934 pub fn openslideload(filename: &str) -> Result<VipsImage> {
11935 let mut out_out = VipsImage::from(null_mut());
11936 let vips_op_response = call(
11937 "openslideload",
11938 VOption::new()
11939 .set(
11940 "filename",
11941 filename,
11942 )
11943 .set(
11944 "out",
11945 &mut out_out,
11946 ),
11947 );
11948
11949 utils::result(
11950 vips_op_response,
11951 out_out,
11952 Error::OperationError("Openslideload (vips_openslideload) failed".to_string()),
11953 )
11954 }
11955
11956 /// 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
11957 /// returns `VipsImage` - Output image
11958 ///
11959 /// filename: `&str` -> Filename to load from
11960 ///
11961 /// <ins>Optional arguments</ins>
11962 ///
11963 /// level: `i32` -> Load this level from the file
11964 ///
11965 /// autocrop: `bool` -> Crop to image bounds
11966 ///
11967 /// associated: `&str` -> Load this associated image
11968 ///
11969 /// attach_associated: `bool` -> Attach all associated images
11970 ///
11971 /// rgb: `bool` -> Output RGB (not RGBA)
11972 ///
11973 /// flags: [`ForeignFlags`] -> Flags for this file
11974 ///
11975 /// memory: `bool` -> Force open via memory
11976 ///
11977 /// access: [`Access`] -> Required access pattern for this file
11978 ///
11979 /// fail_on: [`FailOn`] -> Error level to fail on
11980 ///
11981 /// revalidate: `bool` -> Don't use a cached result for this operation
11982 pub fn openslideload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
11983 let mut out_out = VipsImage::from(null_mut());
11984 let vips_op_response = call(
11985 "openslideload",
11986 option
11987 .set(
11988 "filename",
11989 filename,
11990 )
11991 .set(
11992 "out",
11993 &mut out_out,
11994 ),
11995 );
11996
11997 utils::result(
11998 vips_op_response,
11999 out_out,
12000 Error::OperationError("Openslideload (vips_openslideload) failed".to_string()),
12001 )
12002 }
12003
12004 /// VipsForeignLoadOpenslideSource (openslideload_source), load source with OpenSlide, priority=100, untrusted, is_a_source, get_flags, get_flags_filename, header, load
12005 /// returns `VipsImage` - Output image
12006 ///
12007 /// source: `&VipsSource` -> Source to load from
12008 pub fn openslideload_source(source: &VipsSource) -> Result<VipsImage> {
12009 let mut out_out = VipsImage::from(null_mut());
12010 let vips_op_response = call(
12011 "openslideload_source",
12012 VOption::new()
12013 .set(
12014 "source",
12015 source,
12016 )
12017 .set(
12018 "out",
12019 &mut out_out,
12020 ),
12021 );
12022
12023 utils::result(
12024 vips_op_response,
12025 out_out,
12026 Error::OperationError(
12027 "OpenslideloadSource (vips_openslideload_source) failed".to_string(),
12028 ),
12029 )
12030 }
12031
12032 /// VipsForeignLoadOpenslideSource (openslideload_source), load source with OpenSlide, priority=100, untrusted, is_a_source, get_flags, get_flags_filename, header, load
12033 /// returns `VipsImage` - Output image
12034 ///
12035 /// source: `&VipsSource` -> Source to load from
12036 ///
12037 /// <ins>Optional arguments</ins>
12038 ///
12039 /// level: `i32` -> Load this level from the file
12040 ///
12041 /// autocrop: `bool` -> Crop to image bounds
12042 ///
12043 /// associated: `&str` -> Load this associated image
12044 ///
12045 /// attach_associated: `bool` -> Attach all associated images
12046 ///
12047 /// rgb: `bool` -> Output RGB (not RGBA)
12048 ///
12049 /// flags: [`ForeignFlags`] -> Flags for this file
12050 ///
12051 /// memory: `bool` -> Force open via memory
12052 ///
12053 /// access: [`Access`] -> Required access pattern for this file
12054 ///
12055 /// fail_on: [`FailOn`] -> Error level to fail on
12056 ///
12057 /// revalidate: `bool` -> Don't use a cached result for this operation
12058 pub fn openslideload_source_with_opts(
12059 source: &VipsSource,
12060 option: VOption,
12061 ) -> Result<VipsImage> {
12062 let mut out_out = VipsImage::from(null_mut());
12063 let vips_op_response = call(
12064 "openslideload_source",
12065 option
12066 .set(
12067 "source",
12068 source,
12069 )
12070 .set(
12071 "out",
12072 &mut out_out,
12073 ),
12074 );
12075
12076 utils::result(
12077 vips_op_response,
12078 out_out,
12079 Error::OperationError(
12080 "OpenslideloadSource (vips_openslideload_source) failed".to_string(),
12081 ),
12082 )
12083 }
12084
12085 /// VipsForeignLoadPdfFile (pdfload), load PDF from file (.pdf), priority=0, untrusted, is_a, get_flags, get_flags_filename, header, load
12086 /// returns `VipsImage` - Output image
12087 ///
12088 /// filename: `&str` -> Filename to load from
12089 pub fn pdfload(filename: &str) -> Result<VipsImage> {
12090 let mut out_out = VipsImage::from(null_mut());
12091 let vips_op_response = call(
12092 "pdfload",
12093 VOption::new()
12094 .set(
12095 "filename",
12096 filename,
12097 )
12098 .set(
12099 "out",
12100 &mut out_out,
12101 ),
12102 );
12103
12104 utils::result(
12105 vips_op_response,
12106 out_out,
12107 Error::OperationError("Pdfload (vips_pdfload) failed".to_string()),
12108 )
12109 }
12110
12111 /// VipsForeignLoadPdfFile (pdfload), load PDF from file (.pdf), priority=0, untrusted, is_a, get_flags, get_flags_filename, header, load
12112 /// returns `VipsImage` - Output image
12113 ///
12114 /// filename: `&str` -> Filename to load from
12115 ///
12116 /// <ins>Optional arguments</ins>
12117 ///
12118 /// page: `i32` -> First page to load
12119 ///
12120 /// n: `i32` -> Number of pages to load, -1 for all
12121 ///
12122 /// dpi: `f64` -> DPI to render at
12123 ///
12124 /// scale: `f64` -> Factor to scale by
12125 ///
12126 /// background: `&[f64]` -> Background colour
12127 ///
12128 /// password: `&str` -> Password to decrypt with
12129 ///
12130 /// flags: [`ForeignFlags`] -> Flags for this file
12131 ///
12132 /// memory: `bool` -> Force open via memory
12133 ///
12134 /// access: [`Access`] -> Required access pattern for this file
12135 ///
12136 /// fail_on: [`FailOn`] -> Error level to fail on
12137 ///
12138 /// revalidate: `bool` -> Don't use a cached result for this operation
12139 pub fn pdfload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
12140 let mut out_out = VipsImage::from(null_mut());
12141 let vips_op_response = call(
12142 "pdfload",
12143 option
12144 .set(
12145 "filename",
12146 filename,
12147 )
12148 .set(
12149 "out",
12150 &mut out_out,
12151 ),
12152 );
12153
12154 utils::result(
12155 vips_op_response,
12156 out_out,
12157 Error::OperationError("Pdfload (vips_pdfload) failed".to_string()),
12158 )
12159 }
12160
12161 /// VipsForeignLoadPdfBuffer (pdfload_buffer), load PDF from buffer, priority=0, untrusted, is_a_buffer, get_flags, get_flags_filename, header, load
12162 /// returns `VipsImage` - Output image
12163 ///
12164 /// buffer: `&[u8]` -> Buffer to load from
12165 pub fn pdfload_buffer(buffer: &[u8]) -> Result<VipsImage> {
12166 let vips_blob = unsafe {
12167 vips_blob_new(
12168 None,
12169 buffer.as_ptr() as _,
12170 buffer.len() as _,
12171 )
12172 };
12173 let blob = VipsBlob::from(vips_blob);
12174 let mut out_out = VipsImage::from(null_mut());
12175 let vips_op_response = call(
12176 "pdfload_buffer",
12177 VOption::new()
12178 .set(
12179 "buffer",
12180 &blob,
12181 )
12182 .set(
12183 "out",
12184 &mut out_out,
12185 ),
12186 );
12187 blob.area_unref();
12188 utils::result(
12189 vips_op_response,
12190 out_out,
12191 Error::OperationError("PdfloadBuffer (vips_pdfload_buffer) failed".to_string()),
12192 )
12193 }
12194
12195 /// VipsForeignLoadPdfBuffer (pdfload_buffer), load PDF from buffer, priority=0, untrusted, is_a_buffer, get_flags, get_flags_filename, header, load
12196 /// returns `VipsImage` - Output image
12197 ///
12198 /// buffer: `&[u8]` -> Buffer to load from
12199 ///
12200 /// <ins>Optional arguments</ins>
12201 ///
12202 /// page: `i32` -> First page to load
12203 ///
12204 /// n: `i32` -> Number of pages to load, -1 for all
12205 ///
12206 /// dpi: `f64` -> DPI to render at
12207 ///
12208 /// scale: `f64` -> Factor to scale by
12209 ///
12210 /// background: `&[f64]` -> Background colour
12211 ///
12212 /// password: `&str` -> Password to decrypt with
12213 ///
12214 /// flags: [`ForeignFlags`] -> Flags for this file
12215 ///
12216 /// memory: `bool` -> Force open via memory
12217 ///
12218 /// access: [`Access`] -> Required access pattern for this file
12219 ///
12220 /// fail_on: [`FailOn`] -> Error level to fail on
12221 ///
12222 /// revalidate: `bool` -> Don't use a cached result for this operation
12223 pub fn pdfload_buffer_with_opts(buffer: &[u8], option: VOption) -> Result<VipsImage> {
12224 let vips_blob = unsafe {
12225 vips_blob_new(
12226 None,
12227 buffer.as_ptr() as _,
12228 buffer.len() as _,
12229 )
12230 };
12231 let blob = VipsBlob::from(vips_blob);
12232 let mut out_out = VipsImage::from(null_mut());
12233 let vips_op_response = call(
12234 "pdfload_buffer",
12235 option
12236 .set(
12237 "buffer",
12238 &blob,
12239 )
12240 .set(
12241 "out",
12242 &mut out_out,
12243 ),
12244 );
12245 blob.area_unref();
12246 utils::result(
12247 vips_op_response,
12248 out_out,
12249 Error::OperationError("PdfloadBuffer (vips_pdfload_buffer) failed".to_string()),
12250 )
12251 }
12252
12253 /// VipsForeignLoadPdfSource (pdfload_source), load PDF from source, priority=0, untrusted, is_a_source, get_flags, get_flags_filename, header, load
12254 /// returns `VipsImage` - Output image
12255 ///
12256 /// source: `&VipsSource` -> Source to load from
12257 pub fn pdfload_source(source: &VipsSource) -> Result<VipsImage> {
12258 let mut out_out = VipsImage::from(null_mut());
12259 let vips_op_response = call(
12260 "pdfload_source",
12261 VOption::new()
12262 .set(
12263 "source",
12264 source,
12265 )
12266 .set(
12267 "out",
12268 &mut out_out,
12269 ),
12270 );
12271
12272 utils::result(
12273 vips_op_response,
12274 out_out,
12275 Error::OperationError("PdfloadSource (vips_pdfload_source) failed".to_string()),
12276 )
12277 }
12278
12279 /// VipsForeignLoadPdfSource (pdfload_source), load PDF from source, priority=0, untrusted, is_a_source, get_flags, get_flags_filename, header, load
12280 /// returns `VipsImage` - Output image
12281 ///
12282 /// source: `&VipsSource` -> Source to load from
12283 ///
12284 /// <ins>Optional arguments</ins>
12285 ///
12286 /// page: `i32` -> First page to load
12287 ///
12288 /// n: `i32` -> Number of pages to load, -1 for all
12289 ///
12290 /// dpi: `f64` -> DPI to render at
12291 ///
12292 /// scale: `f64` -> Factor to scale by
12293 ///
12294 /// background: `&[f64]` -> Background colour
12295 ///
12296 /// password: `&str` -> Password to decrypt with
12297 ///
12298 /// flags: [`ForeignFlags`] -> Flags for this file
12299 ///
12300 /// memory: `bool` -> Force open via memory
12301 ///
12302 /// access: [`Access`] -> Required access pattern for this file
12303 ///
12304 /// fail_on: [`FailOn`] -> Error level to fail on
12305 ///
12306 /// revalidate: `bool` -> Don't use a cached result for this operation
12307 pub fn pdfload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
12308 let mut out_out = VipsImage::from(null_mut());
12309 let vips_op_response = call(
12310 "pdfload_source",
12311 option
12312 .set(
12313 "source",
12314 source,
12315 )
12316 .set(
12317 "out",
12318 &mut out_out,
12319 ),
12320 );
12321
12322 utils::result(
12323 vips_op_response,
12324 out_out,
12325 Error::OperationError("PdfloadSource (vips_pdfload_source) failed".to_string()),
12326 )
12327 }
12328
12329 /// VipsPercent (percent), find threshold for percent of pixels
12330 /// returns `i32` - Threshold above which lie percent of pixels
12331 ///
12332 /// percent: `f64` -> Percent of pixels
12333 pub fn percent(&self, percent: f64) -> Result<i32> {
12334 let mut threshold_out: i32 = 0;
12335 let vips_op_response = call(
12336 "percent",
12337 VOption::new()
12338 .set("in", self)
12339 .set(
12340 "percent",
12341 percent,
12342 )
12343 .set(
12344 "threshold",
12345 &mut threshold_out,
12346 ),
12347 );
12348
12349 utils::result(
12350 vips_op_response,
12351 threshold_out,
12352 Error::OperationError("Percent (vips_percent) failed".to_string()),
12353 )
12354 }
12355
12356 /// VipsPerlin (perlin), make a perlin noise image
12357 /// returns `VipsImage` - Output image
12358 ///
12359 /// width: `i32` -> Image width in pixels
12360 ///
12361 /// height: `i32` -> Image height in pixels
12362 pub fn perlin(width: i32, height: i32) -> Result<VipsImage> {
12363 let mut out_out = VipsImage::from(null_mut());
12364 let vips_op_response = call(
12365 "perlin",
12366 VOption::new()
12367 .set(
12368 "out",
12369 &mut out_out,
12370 )
12371 .set(
12372 "width",
12373 width,
12374 )
12375 .set(
12376 "height",
12377 height,
12378 ),
12379 );
12380
12381 utils::result(
12382 vips_op_response,
12383 out_out,
12384 Error::OperationError("Perlin (vips_perlin) failed".to_string()),
12385 )
12386 }
12387
12388 /// VipsPerlin (perlin), make a perlin noise image
12389 /// returns `VipsImage` - Output image
12390 ///
12391 /// width: `i32` -> Image width in pixels
12392 ///
12393 /// height: `i32` -> Image height in pixels
12394 ///
12395 /// <ins>Optional arguments</ins>
12396 ///
12397 /// cell_size: `i32` -> Size of Perlin cells
12398 ///
12399 /// uchar: `bool` -> Output an unsigned char image
12400 ///
12401 /// seed: `i32` -> Random number seed
12402 pub fn perlin_with_opts(width: i32, height: i32, option: VOption) -> Result<VipsImage> {
12403 let mut out_out = VipsImage::from(null_mut());
12404 let vips_op_response = call(
12405 "perlin",
12406 option
12407 .set(
12408 "out",
12409 &mut out_out,
12410 )
12411 .set(
12412 "width",
12413 width,
12414 )
12415 .set(
12416 "height",
12417 height,
12418 ),
12419 );
12420
12421 utils::result(
12422 vips_op_response,
12423 out_out,
12424 Error::OperationError("Perlin (vips_perlin) failed".to_string()),
12425 )
12426 }
12427
12428 /// VipsPhasecor (phasecor), calculate phase correlation
12429 /// returns `VipsImage` - Output image
12430 ///
12431 /// in2: `&VipsImage` -> Second input image
12432 pub fn phasecor(&self, in2: &VipsImage) -> Result<VipsImage> {
12433 let mut out_out = VipsImage::from(null_mut());
12434 let vips_op_response = call(
12435 "phasecor",
12436 VOption::new()
12437 .set("in", self)
12438 .set("in2", in2)
12439 .set(
12440 "out",
12441 &mut out_out,
12442 ),
12443 );
12444
12445 utils::result(
12446 vips_op_response,
12447 out_out,
12448 Error::OperationError("Phasecor (vips_phasecor) failed".to_string()),
12449 )
12450 }
12451
12452 /// VipsForeignLoadPngFile (pngload), load png from file (.png), priority=200, is_a, get_flags, get_flags_filename, header, load
12453 /// returns `VipsImage` - Output image
12454 ///
12455 /// filename: `&str` -> Filename to load from
12456 pub fn pngload(filename: &str) -> Result<VipsImage> {
12457 let mut out_out = VipsImage::from(null_mut());
12458 let vips_op_response = call(
12459 "pngload",
12460 VOption::new()
12461 .set(
12462 "filename",
12463 filename,
12464 )
12465 .set(
12466 "out",
12467 &mut out_out,
12468 ),
12469 );
12470
12471 utils::result(
12472 vips_op_response,
12473 out_out,
12474 Error::OperationError("Pngload (vips_pngload) failed".to_string()),
12475 )
12476 }
12477
12478 /// VipsForeignLoadPngFile (pngload), load png from file (.png), priority=200, is_a, get_flags, get_flags_filename, header, load
12479 /// returns `VipsImage` - Output image
12480 ///
12481 /// filename: `&str` -> Filename to load from
12482 ///
12483 /// <ins>Optional arguments</ins>
12484 ///
12485 /// unlimited: `bool` -> Remove all denial of service limits
12486 ///
12487 /// flags: [`ForeignFlags`] -> Flags for this file
12488 ///
12489 /// memory: `bool` -> Force open via memory
12490 ///
12491 /// access: [`Access`] -> Required access pattern for this file
12492 ///
12493 /// fail_on: [`FailOn`] -> Error level to fail on
12494 ///
12495 /// revalidate: `bool` -> Don't use a cached result for this operation
12496 pub fn pngload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
12497 let mut out_out = VipsImage::from(null_mut());
12498 let vips_op_response = call(
12499 "pngload",
12500 option
12501 .set(
12502 "filename",
12503 filename,
12504 )
12505 .set(
12506 "out",
12507 &mut out_out,
12508 ),
12509 );
12510
12511 utils::result(
12512 vips_op_response,
12513 out_out,
12514 Error::OperationError("Pngload (vips_pngload) failed".to_string()),
12515 )
12516 }
12517
12518 /// VipsForeignLoadPngBuffer (pngload_buffer), load png from buffer, priority=200, is_a_buffer, get_flags, get_flags_filename, header, load
12519 /// returns `VipsImage` - Output image
12520 ///
12521 /// buffer: `&[u8]` -> Buffer to load from
12522 pub fn pngload_buffer(buffer: &[u8]) -> Result<VipsImage> {
12523 let vips_blob = unsafe {
12524 vips_blob_new(
12525 None,
12526 buffer.as_ptr() as _,
12527 buffer.len() as _,
12528 )
12529 };
12530 let blob = VipsBlob::from(vips_blob);
12531 let mut out_out = VipsImage::from(null_mut());
12532 let vips_op_response = call(
12533 "pngload_buffer",
12534 VOption::new()
12535 .set(
12536 "buffer",
12537 &blob,
12538 )
12539 .set(
12540 "out",
12541 &mut out_out,
12542 ),
12543 );
12544 blob.area_unref();
12545 utils::result(
12546 vips_op_response,
12547 out_out,
12548 Error::OperationError("PngloadBuffer (vips_pngload_buffer) failed".to_string()),
12549 )
12550 }
12551
12552 /// VipsForeignLoadPngBuffer (pngload_buffer), load png from buffer, priority=200, is_a_buffer, get_flags, get_flags_filename, header, load
12553 /// returns `VipsImage` - Output image
12554 ///
12555 /// buffer: `&[u8]` -> Buffer to load from
12556 ///
12557 /// <ins>Optional arguments</ins>
12558 ///
12559 /// unlimited: `bool` -> Remove all denial of service limits
12560 ///
12561 /// flags: [`ForeignFlags`] -> Flags for this file
12562 ///
12563 /// memory: `bool` -> Force open via memory
12564 ///
12565 /// access: [`Access`] -> Required access pattern for this file
12566 ///
12567 /// fail_on: [`FailOn`] -> Error level to fail on
12568 ///
12569 /// revalidate: `bool` -> Don't use a cached result for this operation
12570 pub fn pngload_buffer_with_opts(buffer: &[u8], option: VOption) -> Result<VipsImage> {
12571 let vips_blob = unsafe {
12572 vips_blob_new(
12573 None,
12574 buffer.as_ptr() as _,
12575 buffer.len() as _,
12576 )
12577 };
12578 let blob = VipsBlob::from(vips_blob);
12579 let mut out_out = VipsImage::from(null_mut());
12580 let vips_op_response = call(
12581 "pngload_buffer",
12582 option
12583 .set(
12584 "buffer",
12585 &blob,
12586 )
12587 .set(
12588 "out",
12589 &mut out_out,
12590 ),
12591 );
12592 blob.area_unref();
12593 utils::result(
12594 vips_op_response,
12595 out_out,
12596 Error::OperationError("PngloadBuffer (vips_pngload_buffer) failed".to_string()),
12597 )
12598 }
12599
12600 /// VipsForeignLoadPngSource (pngload_source), load png from source, priority=200, is_a_source, get_flags, get_flags_filename, header, load
12601 /// returns `VipsImage` - Output image
12602 ///
12603 /// source: `&VipsSource` -> Source to load from
12604 pub fn pngload_source(source: &VipsSource) -> Result<VipsImage> {
12605 let mut out_out = VipsImage::from(null_mut());
12606 let vips_op_response = call(
12607 "pngload_source",
12608 VOption::new()
12609 .set(
12610 "source",
12611 source,
12612 )
12613 .set(
12614 "out",
12615 &mut out_out,
12616 ),
12617 );
12618
12619 utils::result(
12620 vips_op_response,
12621 out_out,
12622 Error::OperationError("PngloadSource (vips_pngload_source) failed".to_string()),
12623 )
12624 }
12625
12626 /// VipsForeignLoadPngSource (pngload_source), load png from source, priority=200, is_a_source, get_flags, get_flags_filename, header, load
12627 /// returns `VipsImage` - Output image
12628 ///
12629 /// source: `&VipsSource` -> Source to load from
12630 ///
12631 /// <ins>Optional arguments</ins>
12632 ///
12633 /// unlimited: `bool` -> Remove all denial of service limits
12634 ///
12635 /// flags: [`ForeignFlags`] -> Flags for this file
12636 ///
12637 /// memory: `bool` -> Force open via memory
12638 ///
12639 /// access: [`Access`] -> Required access pattern for this file
12640 ///
12641 /// fail_on: [`FailOn`] -> Error level to fail on
12642 ///
12643 /// revalidate: `bool` -> Don't use a cached result for this operation
12644 pub fn pngload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
12645 let mut out_out = VipsImage::from(null_mut());
12646 let vips_op_response = call(
12647 "pngload_source",
12648 option
12649 .set(
12650 "source",
12651 source,
12652 )
12653 .set(
12654 "out",
12655 &mut out_out,
12656 ),
12657 );
12658
12659 utils::result(
12660 vips_op_response,
12661 out_out,
12662 Error::OperationError("PngloadSource (vips_pngload_source) failed".to_string()),
12663 )
12664 }
12665
12666 /// VipsForeignSaveSpngFile (pngsave), save image to file as PNG (.png), priority=0, mono rgb alpha
12667 ///
12668 /// filename: `&str` -> Filename to save to
12669 pub fn pngsave(&self, filename: &str) -> Result<()> {
12670 let vips_op_response = call(
12671 "pngsave",
12672 VOption::new()
12673 .set("in", self)
12674 .set(
12675 "filename",
12676 filename,
12677 ),
12678 );
12679
12680 utils::result(
12681 vips_op_response,
12682 (),
12683 Error::OperationError("Pngsave (vips_pngsave) failed".to_string()),
12684 )
12685 }
12686
12687 /// VipsForeignSaveSpngFile (pngsave), save image to file as PNG (.png), priority=0, mono rgb alpha
12688 ///
12689 /// filename: `&str` -> Filename to save to
12690 ///
12691 /// <ins>Optional arguments</ins>
12692 ///
12693 /// compression: `i32` -> Compression factor
12694 ///
12695 /// interlace: `bool` -> Interlace image
12696 ///
12697 /// filter: [`ForeignPngFilter`] -> libspng row filter flag(s)
12698 ///
12699 /// palette: `bool` -> Quantise to 8bpp palette
12700 ///
12701 /// Q: `i32` -> Quantisation quality
12702 ///
12703 /// dither: `f64` -> Amount of dithering
12704 ///
12705 /// bitdepth: `i32` -> Write as a 1, 2, 4, 8 or 16 bit image
12706 ///
12707 /// effort: `i32` -> Quantisation CPU effort
12708 ///
12709 /// keep: [`ForeignKeep`] -> Which metadata to retain
12710 ///
12711 /// background: `&[f64]` -> Background value
12712 ///
12713 /// page_height: `i32` -> Set page height for multipage save
12714 ///
12715 /// profile: `&str` -> Filename of ICC profile to embed
12716 pub fn pngsave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
12717 let vips_op_response = call(
12718 "pngsave",
12719 option
12720 .set("in", self)
12721 .set(
12722 "filename",
12723 filename,
12724 ),
12725 );
12726
12727 utils::result(
12728 vips_op_response,
12729 (),
12730 Error::OperationError("Pngsave (vips_pngsave) failed".to_string()),
12731 )
12732 }
12733
12734 /// VipsForeignSaveSpngBuffer (pngsave_buffer), save image to buffer as PNG (.png), priority=0, mono rgb alpha
12735 /// returns `Vec<u8>` - Buffer to save to
12736 pub fn pngsave_buffer(&self) -> Result<Vec<u8>> {
12737 let mut buffer_out = VipsBlob::from(null_mut());
12738 let vips_op_response = call(
12739 "pngsave_buffer",
12740 VOption::new()
12741 .set("in", self)
12742 .set(
12743 "buffer",
12744 &mut buffer_out,
12745 ),
12746 );
12747
12748 utils::result(
12749 vips_op_response,
12750 buffer_out.into(),
12751 Error::OperationError("PngsaveBuffer (vips_pngsave_buffer) failed".to_string()),
12752 )
12753 }
12754
12755 /// VipsForeignSaveSpngBuffer (pngsave_buffer), save image to buffer as PNG (.png), priority=0, mono rgb alpha
12756 /// returns `Vec<u8>` - Buffer to save to
12757 ///
12758 /// <ins>Optional arguments</ins>
12759 ///
12760 /// compression: `i32` -> Compression factor
12761 ///
12762 /// interlace: `bool` -> Interlace image
12763 ///
12764 /// filter: [`ForeignPngFilter`] -> libspng row filter flag(s)
12765 ///
12766 /// palette: `bool` -> Quantise to 8bpp palette
12767 ///
12768 /// Q: `i32` -> Quantisation quality
12769 ///
12770 /// dither: `f64` -> Amount of dithering
12771 ///
12772 /// bitdepth: `i32` -> Write as a 1, 2, 4, 8 or 16 bit image
12773 ///
12774 /// effort: `i32` -> Quantisation CPU effort
12775 ///
12776 /// keep: [`ForeignKeep`] -> Which metadata to retain
12777 ///
12778 /// background: `&[f64]` -> Background value
12779 ///
12780 /// page_height: `i32` -> Set page height for multipage save
12781 ///
12782 /// profile: `&str` -> Filename of ICC profile to embed
12783 pub fn pngsave_buffer_with_opts(&self, option: VOption) -> Result<Vec<u8>> {
12784 let mut buffer_out = VipsBlob::from(null_mut());
12785 let vips_op_response = call(
12786 "pngsave_buffer",
12787 option
12788 .set("in", self)
12789 .set(
12790 "buffer",
12791 &mut buffer_out,
12792 ),
12793 );
12794
12795 utils::result(
12796 vips_op_response,
12797 buffer_out.into(),
12798 Error::OperationError("PngsaveBuffer (vips_pngsave_buffer) failed".to_string()),
12799 )
12800 }
12801
12802 /// VipsForeignSaveSpngTarget (pngsave_target), save image to target as PNG (.png), priority=0, mono rgb alpha
12803 ///
12804 /// target: `&VipsTarget` -> Target to save to
12805 pub fn pngsave_target(&self, target: &VipsTarget) -> Result<()> {
12806 let vips_op_response = call(
12807 "pngsave_target",
12808 VOption::new()
12809 .set("in", self)
12810 .set(
12811 "target",
12812 target,
12813 ),
12814 );
12815
12816 utils::result(
12817 vips_op_response,
12818 (),
12819 Error::OperationError("PngsaveTarget (vips_pngsave_target) failed".to_string()),
12820 )
12821 }
12822
12823 /// VipsForeignSaveSpngTarget (pngsave_target), save image to target as PNG (.png), priority=0, mono rgb alpha
12824 ///
12825 /// target: `&VipsTarget` -> Target to save to
12826 ///
12827 /// <ins>Optional arguments</ins>
12828 ///
12829 /// compression: `i32` -> Compression factor
12830 ///
12831 /// interlace: `bool` -> Interlace image
12832 ///
12833 /// filter: [`ForeignPngFilter`] -> libspng row filter flag(s)
12834 ///
12835 /// palette: `bool` -> Quantise to 8bpp palette
12836 ///
12837 /// Q: `i32` -> Quantisation quality
12838 ///
12839 /// dither: `f64` -> Amount of dithering
12840 ///
12841 /// bitdepth: `i32` -> Write as a 1, 2, 4, 8 or 16 bit image
12842 ///
12843 /// effort: `i32` -> Quantisation CPU effort
12844 ///
12845 /// keep: [`ForeignKeep`] -> Which metadata to retain
12846 ///
12847 /// background: `&[f64]` -> Background value
12848 ///
12849 /// page_height: `i32` -> Set page height for multipage save
12850 ///
12851 /// profile: `&str` -> Filename of ICC profile to embed
12852 pub fn pngsave_target_with_opts(&self, target: &VipsTarget, option: VOption) -> Result<()> {
12853 let vips_op_response = call(
12854 "pngsave_target",
12855 option
12856 .set("in", self)
12857 .set(
12858 "target",
12859 target,
12860 ),
12861 );
12862
12863 utils::result(
12864 vips_op_response,
12865 (),
12866 Error::OperationError("PngsaveTarget (vips_pngsave_target) failed".to_string()),
12867 )
12868 }
12869
12870 /// VipsForeignLoadPpmFile (ppmload), load ppm from file (.pbm, .pgm, .ppm, .pfm, .pnm), priority=200, untrusted, is_a, get_flags, header, load
12871 /// returns `VipsImage` - Output image
12872 ///
12873 /// filename: `&str` -> Filename to load from
12874 pub fn ppmload(filename: &str) -> Result<VipsImage> {
12875 let mut out_out = VipsImage::from(null_mut());
12876 let vips_op_response = call(
12877 "ppmload",
12878 VOption::new()
12879 .set(
12880 "filename",
12881 filename,
12882 )
12883 .set(
12884 "out",
12885 &mut out_out,
12886 ),
12887 );
12888
12889 utils::result(
12890 vips_op_response,
12891 out_out,
12892 Error::OperationError("Ppmload (vips_ppmload) failed".to_string()),
12893 )
12894 }
12895
12896 /// VipsForeignLoadPpmFile (ppmload), load ppm from file (.pbm, .pgm, .ppm, .pfm, .pnm), priority=200, untrusted, is_a, get_flags, header, load
12897 /// returns `VipsImage` - Output image
12898 ///
12899 /// filename: `&str` -> Filename to load from
12900 ///
12901 /// <ins>Optional arguments</ins>
12902 ///
12903 /// flags: [`ForeignFlags`] -> Flags for this file
12904 ///
12905 /// memory: `bool` -> Force open via memory
12906 ///
12907 /// access: [`Access`] -> Required access pattern for this file
12908 ///
12909 /// fail_on: [`FailOn`] -> Error level to fail on
12910 ///
12911 /// revalidate: `bool` -> Don't use a cached result for this operation
12912 pub fn ppmload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
12913 let mut out_out = VipsImage::from(null_mut());
12914 let vips_op_response = call(
12915 "ppmload",
12916 option
12917 .set(
12918 "filename",
12919 filename,
12920 )
12921 .set(
12922 "out",
12923 &mut out_out,
12924 ),
12925 );
12926
12927 utils::result(
12928 vips_op_response,
12929 out_out,
12930 Error::OperationError("Ppmload (vips_ppmload) failed".to_string()),
12931 )
12932 }
12933
12934 /// VipsForeignLoadPpmBuffer (ppmload_buffer), load ppm from buffer (.pbm, .pgm, .ppm, .pfm, .pnm), priority=200, untrusted, is_a_buffer, get_flags, header, load
12935 /// returns `VipsImage` - Output image
12936 ///
12937 /// buffer: `&[u8]` -> Buffer to load from
12938 pub fn ppmload_buffer(buffer: &[u8]) -> Result<VipsImage> {
12939 let vips_blob = unsafe {
12940 vips_blob_new(
12941 None,
12942 buffer.as_ptr() as _,
12943 buffer.len() as _,
12944 )
12945 };
12946 let blob = VipsBlob::from(vips_blob);
12947 let mut out_out = VipsImage::from(null_mut());
12948 let vips_op_response = call(
12949 "ppmload_buffer",
12950 VOption::new()
12951 .set(
12952 "buffer",
12953 &blob,
12954 )
12955 .set(
12956 "out",
12957 &mut out_out,
12958 ),
12959 );
12960 blob.area_unref();
12961 utils::result(
12962 vips_op_response,
12963 out_out,
12964 Error::OperationError("PpmloadBuffer (vips_ppmload_buffer) failed".to_string()),
12965 )
12966 }
12967
12968 /// VipsForeignLoadPpmBuffer (ppmload_buffer), load ppm from buffer (.pbm, .pgm, .ppm, .pfm, .pnm), priority=200, untrusted, is_a_buffer, get_flags, header, load
12969 /// returns `VipsImage` - Output image
12970 ///
12971 /// buffer: `&[u8]` -> Buffer to load from
12972 ///
12973 /// <ins>Optional arguments</ins>
12974 ///
12975 /// flags: [`ForeignFlags`] -> Flags for this file
12976 ///
12977 /// memory: `bool` -> Force open via memory
12978 ///
12979 /// access: [`Access`] -> Required access pattern for this file
12980 ///
12981 /// fail_on: [`FailOn`] -> Error level to fail on
12982 ///
12983 /// revalidate: `bool` -> Don't use a cached result for this operation
12984 pub fn ppmload_buffer_with_opts(buffer: &[u8], option: VOption) -> Result<VipsImage> {
12985 let vips_blob = unsafe {
12986 vips_blob_new(
12987 None,
12988 buffer.as_ptr() as _,
12989 buffer.len() as _,
12990 )
12991 };
12992 let blob = VipsBlob::from(vips_blob);
12993 let mut out_out = VipsImage::from(null_mut());
12994 let vips_op_response = call(
12995 "ppmload_buffer",
12996 option
12997 .set(
12998 "buffer",
12999 &blob,
13000 )
13001 .set(
13002 "out",
13003 &mut out_out,
13004 ),
13005 );
13006 blob.area_unref();
13007 utils::result(
13008 vips_op_response,
13009 out_out,
13010 Error::OperationError("PpmloadBuffer (vips_ppmload_buffer) failed".to_string()),
13011 )
13012 }
13013
13014 /// VipsForeignLoadPpmSource (ppmload_source), load ppm from source (.pbm, .pgm, .ppm, .pfm, .pnm), priority=200, untrusted, is_a_source, get_flags, header, load
13015 /// returns `VipsImage` - Output image
13016 ///
13017 /// source: `&VipsSource` -> Source to load from
13018 pub fn ppmload_source(source: &VipsSource) -> Result<VipsImage> {
13019 let mut out_out = VipsImage::from(null_mut());
13020 let vips_op_response = call(
13021 "ppmload_source",
13022 VOption::new()
13023 .set(
13024 "source",
13025 source,
13026 )
13027 .set(
13028 "out",
13029 &mut out_out,
13030 ),
13031 );
13032
13033 utils::result(
13034 vips_op_response,
13035 out_out,
13036 Error::OperationError("PpmloadSource (vips_ppmload_source) failed".to_string()),
13037 )
13038 }
13039
13040 /// VipsForeignLoadPpmSource (ppmload_source), load ppm from source (.pbm, .pgm, .ppm, .pfm, .pnm), priority=200, untrusted, is_a_source, get_flags, header, load
13041 /// returns `VipsImage` - Output image
13042 ///
13043 /// source: `&VipsSource` -> Source to load from
13044 ///
13045 /// <ins>Optional arguments</ins>
13046 ///
13047 /// flags: [`ForeignFlags`] -> Flags for this file
13048 ///
13049 /// memory: `bool` -> Force open via memory
13050 ///
13051 /// access: [`Access`] -> Required access pattern for this file
13052 ///
13053 /// fail_on: [`FailOn`] -> Error level to fail on
13054 ///
13055 /// revalidate: `bool` -> Don't use a cached result for this operation
13056 pub fn ppmload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
13057 let mut out_out = VipsImage::from(null_mut());
13058 let vips_op_response = call(
13059 "ppmload_source",
13060 option
13061 .set(
13062 "source",
13063 source,
13064 )
13065 .set(
13066 "out",
13067 &mut out_out,
13068 ),
13069 );
13070
13071 utils::result(
13072 vips_op_response,
13073 out_out,
13074 Error::OperationError("PpmloadSource (vips_ppmload_source) failed".to_string()),
13075 )
13076 }
13077
13078 /// VipsForeignSavePpmFile (ppmsave), save image to ppm file (.pbm, .pgm, .ppm, .pfm, .pnm), priority=0,
13079 ///
13080 /// filename: `&str` -> Filename to save to
13081 pub fn ppmsave(&self, filename: &str) -> Result<()> {
13082 let vips_op_response = call(
13083 "ppmsave",
13084 VOption::new()
13085 .set("in", self)
13086 .set(
13087 "filename",
13088 filename,
13089 ),
13090 );
13091
13092 utils::result(
13093 vips_op_response,
13094 (),
13095 Error::OperationError("Ppmsave (vips_ppmsave) failed".to_string()),
13096 )
13097 }
13098
13099 /// VipsForeignSavePpmFile (ppmsave), save image to ppm file (.pbm, .pgm, .ppm, .pfm, .pnm), priority=0,
13100 ///
13101 /// filename: `&str` -> Filename to save to
13102 ///
13103 /// <ins>Optional arguments</ins>
13104 ///
13105 /// format: [`ForeignPpmFormat`] -> Format to save in
13106 ///
13107 /// ascii: `bool` -> Save as ascii
13108 ///
13109 /// bitdepth: `i32` -> Set to 1 to write as a 1 bit image
13110 ///
13111 /// keep: [`ForeignKeep`] -> Which metadata to retain
13112 ///
13113 /// background: `&[f64]` -> Background value
13114 ///
13115 /// page_height: `i32` -> Set page height for multipage save
13116 ///
13117 /// profile: `&str` -> Filename of ICC profile to embed
13118 pub fn ppmsave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
13119 let vips_op_response = call(
13120 "ppmsave",
13121 option
13122 .set("in", self)
13123 .set(
13124 "filename",
13125 filename,
13126 ),
13127 );
13128
13129 utils::result(
13130 vips_op_response,
13131 (),
13132 Error::OperationError("Ppmsave (vips_ppmsave) failed".to_string()),
13133 )
13134 }
13135
13136 /// VipsForeignSavePpmTarget (ppmsave_target), save to ppm (.ppm), priority=0,
13137 ///
13138 /// target: `&VipsTarget` -> Target to save to
13139 pub fn ppmsave_target(&self, target: &VipsTarget) -> Result<()> {
13140 let vips_op_response = call(
13141 "ppmsave_target",
13142 VOption::new()
13143 .set("in", self)
13144 .set(
13145 "target",
13146 target,
13147 ),
13148 );
13149
13150 utils::result(
13151 vips_op_response,
13152 (),
13153 Error::OperationError("PpmsaveTarget (vips_ppmsave_target) failed".to_string()),
13154 )
13155 }
13156
13157 /// VipsForeignSavePpmTarget (ppmsave_target), save to ppm (.ppm), priority=0,
13158 ///
13159 /// target: `&VipsTarget` -> Target to save to
13160 ///
13161 /// <ins>Optional arguments</ins>
13162 ///
13163 /// format: [`ForeignPpmFormat`] -> Format to save in
13164 ///
13165 /// ascii: `bool` -> Save as ascii
13166 ///
13167 /// bitdepth: `i32` -> Set to 1 to write as a 1 bit image
13168 ///
13169 /// keep: [`ForeignKeep`] -> Which metadata to retain
13170 ///
13171 /// background: `&[f64]` -> Background value
13172 ///
13173 /// page_height: `i32` -> Set page height for multipage save
13174 ///
13175 /// profile: `&str` -> Filename of ICC profile to embed
13176 pub fn ppmsave_target_with_opts(&self, target: &VipsTarget, option: VOption) -> Result<()> {
13177 let vips_op_response = call(
13178 "ppmsave_target",
13179 option
13180 .set("in", self)
13181 .set(
13182 "target",
13183 target,
13184 ),
13185 );
13186
13187 utils::result(
13188 vips_op_response,
13189 (),
13190 Error::OperationError("PpmsaveTarget (vips_ppmsave_target) failed".to_string()),
13191 )
13192 }
13193
13194 /// VipsPremultiply (premultiply), premultiply image alpha
13195 /// returns `VipsImage` - Output image
13196 pub fn premultiply(&self) -> Result<VipsImage> {
13197 let mut out_out = VipsImage::from(null_mut());
13198 let vips_op_response = call(
13199 "premultiply",
13200 VOption::new()
13201 .set("in", self)
13202 .set(
13203 "out",
13204 &mut out_out,
13205 ),
13206 );
13207
13208 utils::result(
13209 vips_op_response,
13210 out_out,
13211 Error::OperationError("Premultiply (vips_premultiply) failed".to_string()),
13212 )
13213 }
13214
13215 /// VipsPremultiply (premultiply), premultiply image alpha
13216 /// returns `VipsImage` - Output image
13217 ///
13218 /// <ins>Optional arguments</ins>
13219 ///
13220 /// max_alpha: `f64` -> Maximum value of alpha channel
13221 pub fn premultiply_with_opts(&self, option: VOption) -> Result<VipsImage> {
13222 let mut out_out = VipsImage::from(null_mut());
13223 let vips_op_response = call(
13224 "premultiply",
13225 option
13226 .set("in", self)
13227 .set(
13228 "out",
13229 &mut out_out,
13230 ),
13231 );
13232
13233 utils::result(
13234 vips_op_response,
13235 out_out,
13236 Error::OperationError("Premultiply (vips_premultiply) failed".to_string()),
13237 )
13238 }
13239
13240 /// VipsPrewitt (prewitt), Prewitt edge detector
13241 /// returns `VipsImage` - Output image
13242 pub fn prewitt(&self) -> Result<VipsImage> {
13243 let mut out_out = VipsImage::from(null_mut());
13244 let vips_op_response = call(
13245 "prewitt",
13246 VOption::new()
13247 .set("in", self)
13248 .set(
13249 "out",
13250 &mut out_out,
13251 ),
13252 );
13253
13254 utils::result(
13255 vips_op_response,
13256 out_out,
13257 Error::OperationError("Prewitt (vips_prewitt) failed".to_string()),
13258 )
13259 }
13260
13261 /// VipsProfile (profile), find image profiles
13262 /// Tuple (
13263 /// VipsImage - First non-zero pixel in column
13264 /// VipsImage - First non-zero pixel in row
13265 ///)
13266 pub fn profile(
13267 &self,
13268 ) -> Result<(
13269 VipsImage,
13270 VipsImage,
13271 )> {
13272 let mut columns_out = VipsImage::from(null_mut());
13273 let mut rows_out = VipsImage::from(null_mut());
13274 let vips_op_response = call(
13275 "profile",
13276 VOption::new()
13277 .set("in", self)
13278 .set(
13279 "columns",
13280 &mut columns_out,
13281 )
13282 .set(
13283 "rows",
13284 &mut rows_out,
13285 ),
13286 );
13287
13288 utils::result(
13289 vips_op_response,
13290 (
13291 columns_out,
13292 rows_out,
13293 ),
13294 Error::OperationError("Profile (vips_profile) failed".to_string()),
13295 )
13296 }
13297
13298 /// VipsProfileLoad (profile_load), load named ICC profile
13299 /// returns `Vec<u8>` - Loaded profile
13300 ///
13301 /// name: `&str` -> Profile name
13302 pub fn profile_load(name: &str) -> Result<Vec<u8>> {
13303 let mut profile_out = VipsBlob::from(null_mut());
13304 let vips_op_response = call(
13305 "profile_load",
13306 VOption::new()
13307 .set(
13308 "name",
13309 name,
13310 )
13311 .set(
13312 "profile",
13313 &mut profile_out,
13314 ),
13315 );
13316
13317 utils::result(
13318 vips_op_response,
13319 profile_out.into(),
13320 Error::OperationError("ProfileLoad (vips_profile_load) failed".to_string()),
13321 )
13322 }
13323
13324 /// VipsProject (project), find image projections
13325 /// Tuple (
13326 /// VipsImage - Sums of columns
13327 /// VipsImage - Sums of rows
13328 ///)
13329 pub fn project(
13330 &self,
13331 ) -> Result<(
13332 VipsImage,
13333 VipsImage,
13334 )> {
13335 let mut columns_out = VipsImage::from(null_mut());
13336 let mut rows_out = VipsImage::from(null_mut());
13337 let vips_op_response = call(
13338 "project",
13339 VOption::new()
13340 .set("in", self)
13341 .set(
13342 "columns",
13343 &mut columns_out,
13344 )
13345 .set(
13346 "rows",
13347 &mut rows_out,
13348 ),
13349 );
13350
13351 utils::result(
13352 vips_op_response,
13353 (
13354 columns_out,
13355 rows_out,
13356 ),
13357 Error::OperationError("Project (vips_project) failed".to_string()),
13358 )
13359 }
13360
13361 /// VipsQuadratic (quadratic), resample an image with a quadratic transform
13362 /// returns `VipsImage` - Output image
13363 ///
13364 /// coeff: `&VipsImage` -> Coefficient matrix
13365 pub fn quadratic(&self, coeff: &VipsImage) -> Result<VipsImage> {
13366 let mut out_out = VipsImage::from(null_mut());
13367 let vips_op_response = call(
13368 "quadratic",
13369 VOption::new()
13370 .set("in", self)
13371 .set(
13372 "out",
13373 &mut out_out,
13374 )
13375 .set(
13376 "coeff",
13377 coeff,
13378 ),
13379 );
13380
13381 utils::result(
13382 vips_op_response,
13383 out_out,
13384 Error::OperationError("Quadratic (vips_quadratic) failed".to_string()),
13385 )
13386 }
13387
13388 /// VipsQuadratic (quadratic), resample an image with a quadratic transform
13389 /// returns `VipsImage` - Output image
13390 ///
13391 /// coeff: `&VipsImage` -> Coefficient matrix
13392 ///
13393 /// <ins>Optional arguments</ins>
13394 ///
13395 /// interpolate: `&VipsInterpolate` -> Interpolate values with this
13396 pub fn quadratic_with_opts(&self, coeff: &VipsImage, option: VOption) -> Result<VipsImage> {
13397 let mut out_out = VipsImage::from(null_mut());
13398 let vips_op_response = call(
13399 "quadratic",
13400 option
13401 .set("in", self)
13402 .set(
13403 "out",
13404 &mut out_out,
13405 )
13406 .set(
13407 "coeff",
13408 coeff,
13409 ),
13410 );
13411
13412 utils::result(
13413 vips_op_response,
13414 out_out,
13415 Error::OperationError("Quadratic (vips_quadratic) failed".to_string()),
13416 )
13417 }
13418
13419 /// VipsRad2float (rad2float), unpack Radiance coding to float RGB
13420 /// returns `VipsImage` - Output image
13421 pub fn rad2float(&self) -> Result<VipsImage> {
13422 let mut out_out = VipsImage::from(null_mut());
13423 let vips_op_response = call(
13424 "rad2float",
13425 VOption::new()
13426 .set("in", self)
13427 .set(
13428 "out",
13429 &mut out_out,
13430 ),
13431 );
13432
13433 utils::result(
13434 vips_op_response,
13435 out_out,
13436 Error::OperationError("Rad2Float (vips_rad2float) failed".to_string()),
13437 )
13438 }
13439
13440 /// VipsForeignLoadRadFile (radload), load a Radiance image from a file (.hdr), priority=-50, untrusted, is_a, get_flags, get_flags_filename, header, load
13441 /// returns `VipsImage` - Output image
13442 ///
13443 /// filename: `&str` -> Filename to load from
13444 pub fn radload(filename: &str) -> Result<VipsImage> {
13445 let mut out_out = VipsImage::from(null_mut());
13446 let vips_op_response = call(
13447 "radload",
13448 VOption::new()
13449 .set(
13450 "filename",
13451 filename,
13452 )
13453 .set(
13454 "out",
13455 &mut out_out,
13456 ),
13457 );
13458
13459 utils::result(
13460 vips_op_response,
13461 out_out,
13462 Error::OperationError("Radload (vips_radload) failed".to_string()),
13463 )
13464 }
13465
13466 /// VipsForeignLoadRadFile (radload), load a Radiance image from a file (.hdr), priority=-50, untrusted, is_a, get_flags, get_flags_filename, header, load
13467 /// returns `VipsImage` - Output image
13468 ///
13469 /// filename: `&str` -> Filename to load from
13470 ///
13471 /// <ins>Optional arguments</ins>
13472 ///
13473 /// flags: [`ForeignFlags`] -> Flags for this file
13474 ///
13475 /// memory: `bool` -> Force open via memory
13476 ///
13477 /// access: [`Access`] -> Required access pattern for this file
13478 ///
13479 /// fail_on: [`FailOn`] -> Error level to fail on
13480 ///
13481 /// revalidate: `bool` -> Don't use a cached result for this operation
13482 pub fn radload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
13483 let mut out_out = VipsImage::from(null_mut());
13484 let vips_op_response = call(
13485 "radload",
13486 option
13487 .set(
13488 "filename",
13489 filename,
13490 )
13491 .set(
13492 "out",
13493 &mut out_out,
13494 ),
13495 );
13496
13497 utils::result(
13498 vips_op_response,
13499 out_out,
13500 Error::OperationError("Radload (vips_radload) failed".to_string()),
13501 )
13502 }
13503
13504 /// VipsForeignLoadRadBuffer (radload_buffer), load rad from buffer, priority=-50, untrusted, is_a_buffer, get_flags, get_flags_filename, header, load
13505 /// returns `VipsImage` - Output image
13506 ///
13507 /// buffer: `&[u8]` -> Buffer to load from
13508 pub fn radload_buffer(buffer: &[u8]) -> Result<VipsImage> {
13509 let vips_blob = unsafe {
13510 vips_blob_new(
13511 None,
13512 buffer.as_ptr() as _,
13513 buffer.len() as _,
13514 )
13515 };
13516 let blob = VipsBlob::from(vips_blob);
13517 let mut out_out = VipsImage::from(null_mut());
13518 let vips_op_response = call(
13519 "radload_buffer",
13520 VOption::new()
13521 .set(
13522 "buffer",
13523 &blob,
13524 )
13525 .set(
13526 "out",
13527 &mut out_out,
13528 ),
13529 );
13530 blob.area_unref();
13531 utils::result(
13532 vips_op_response,
13533 out_out,
13534 Error::OperationError("RadloadBuffer (vips_radload_buffer) failed".to_string()),
13535 )
13536 }
13537
13538 /// VipsForeignLoadRadBuffer (radload_buffer), load rad from buffer, priority=-50, untrusted, is_a_buffer, get_flags, get_flags_filename, header, load
13539 /// returns `VipsImage` - Output image
13540 ///
13541 /// buffer: `&[u8]` -> Buffer to load from
13542 ///
13543 /// <ins>Optional arguments</ins>
13544 ///
13545 /// flags: [`ForeignFlags`] -> Flags for this file
13546 ///
13547 /// memory: `bool` -> Force open via memory
13548 ///
13549 /// access: [`Access`] -> Required access pattern for this file
13550 ///
13551 /// fail_on: [`FailOn`] -> Error level to fail on
13552 ///
13553 /// revalidate: `bool` -> Don't use a cached result for this operation
13554 pub fn radload_buffer_with_opts(buffer: &[u8], option: VOption) -> Result<VipsImage> {
13555 let vips_blob = unsafe {
13556 vips_blob_new(
13557 None,
13558 buffer.as_ptr() as _,
13559 buffer.len() as _,
13560 )
13561 };
13562 let blob = VipsBlob::from(vips_blob);
13563 let mut out_out = VipsImage::from(null_mut());
13564 let vips_op_response = call(
13565 "radload_buffer",
13566 option
13567 .set(
13568 "buffer",
13569 &blob,
13570 )
13571 .set(
13572 "out",
13573 &mut out_out,
13574 ),
13575 );
13576 blob.area_unref();
13577 utils::result(
13578 vips_op_response,
13579 out_out,
13580 Error::OperationError("RadloadBuffer (vips_radload_buffer) failed".to_string()),
13581 )
13582 }
13583
13584 /// VipsForeignLoadRadSource (radload_source), load rad from source, priority=-50, untrusted, is_a_source, get_flags, get_flags_filename, header, load
13585 /// returns `VipsImage` - Output image
13586 ///
13587 /// source: `&VipsSource` -> Source to load from
13588 pub fn radload_source(source: &VipsSource) -> Result<VipsImage> {
13589 let mut out_out = VipsImage::from(null_mut());
13590 let vips_op_response = call(
13591 "radload_source",
13592 VOption::new()
13593 .set(
13594 "source",
13595 source,
13596 )
13597 .set(
13598 "out",
13599 &mut out_out,
13600 ),
13601 );
13602
13603 utils::result(
13604 vips_op_response,
13605 out_out,
13606 Error::OperationError("RadloadSource (vips_radload_source) failed".to_string()),
13607 )
13608 }
13609
13610 /// VipsForeignLoadRadSource (radload_source), load rad from source, priority=-50, untrusted, is_a_source, get_flags, get_flags_filename, header, load
13611 /// returns `VipsImage` - Output image
13612 ///
13613 /// source: `&VipsSource` -> Source to load from
13614 ///
13615 /// <ins>Optional arguments</ins>
13616 ///
13617 /// flags: [`ForeignFlags`] -> Flags for this file
13618 ///
13619 /// memory: `bool` -> Force open via memory
13620 ///
13621 /// access: [`Access`] -> Required access pattern for this file
13622 ///
13623 /// fail_on: [`FailOn`] -> Error level to fail on
13624 ///
13625 /// revalidate: `bool` -> Don't use a cached result for this operation
13626 pub fn radload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
13627 let mut out_out = VipsImage::from(null_mut());
13628 let vips_op_response = call(
13629 "radload_source",
13630 option
13631 .set(
13632 "source",
13633 source,
13634 )
13635 .set(
13636 "out",
13637 &mut out_out,
13638 ),
13639 );
13640
13641 utils::result(
13642 vips_op_response,
13643 out_out,
13644 Error::OperationError("RadloadSource (vips_radload_source) failed".to_string()),
13645 )
13646 }
13647
13648 /// VipsForeignSaveRadFile (radsave), save image to Radiance file (.hdr), priority=0, mono rgb
13649 ///
13650 /// filename: `&str` -> Filename to save to
13651 pub fn radsave(&self, filename: &str) -> Result<()> {
13652 let vips_op_response = call(
13653 "radsave",
13654 VOption::new()
13655 .set("in", self)
13656 .set(
13657 "filename",
13658 filename,
13659 ),
13660 );
13661
13662 utils::result(
13663 vips_op_response,
13664 (),
13665 Error::OperationError("Radsave (vips_radsave) failed".to_string()),
13666 )
13667 }
13668
13669 /// VipsForeignSaveRadFile (radsave), save image to Radiance file (.hdr), priority=0, mono rgb
13670 ///
13671 /// filename: `&str` -> Filename to save to
13672 ///
13673 /// <ins>Optional arguments</ins>
13674 ///
13675 /// keep: [`ForeignKeep`] -> Which metadata to retain
13676 ///
13677 /// background: `&[f64]` -> Background value
13678 ///
13679 /// page_height: `i32` -> Set page height for multipage save
13680 ///
13681 /// profile: `&str` -> Filename of ICC profile to embed
13682 pub fn radsave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
13683 let vips_op_response = call(
13684 "radsave",
13685 option
13686 .set("in", self)
13687 .set(
13688 "filename",
13689 filename,
13690 ),
13691 );
13692
13693 utils::result(
13694 vips_op_response,
13695 (),
13696 Error::OperationError("Radsave (vips_radsave) failed".to_string()),
13697 )
13698 }
13699
13700 /// VipsForeignSaveRadBuffer (radsave_buffer), save image to Radiance buffer (.hdr), priority=0, mono rgb
13701 /// returns `Vec<u8>` - Buffer to save to
13702 pub fn radsave_buffer(&self) -> Result<Vec<u8>> {
13703 let mut buffer_out = VipsBlob::from(null_mut());
13704 let vips_op_response = call(
13705 "radsave_buffer",
13706 VOption::new()
13707 .set("in", self)
13708 .set(
13709 "buffer",
13710 &mut buffer_out,
13711 ),
13712 );
13713
13714 utils::result(
13715 vips_op_response,
13716 buffer_out.into(),
13717 Error::OperationError("RadsaveBuffer (vips_radsave_buffer) failed".to_string()),
13718 )
13719 }
13720
13721 /// VipsForeignSaveRadBuffer (radsave_buffer), save image to Radiance buffer (.hdr), priority=0, mono rgb
13722 /// returns `Vec<u8>` - Buffer to save to
13723 ///
13724 /// <ins>Optional arguments</ins>
13725 ///
13726 /// keep: [`ForeignKeep`] -> Which metadata to retain
13727 ///
13728 /// background: `&[f64]` -> Background value
13729 ///
13730 /// page_height: `i32` -> Set page height for multipage save
13731 ///
13732 /// profile: `&str` -> Filename of ICC profile to embed
13733 pub fn radsave_buffer_with_opts(&self, option: VOption) -> Result<Vec<u8>> {
13734 let mut buffer_out = VipsBlob::from(null_mut());
13735 let vips_op_response = call(
13736 "radsave_buffer",
13737 option
13738 .set("in", self)
13739 .set(
13740 "buffer",
13741 &mut buffer_out,
13742 ),
13743 );
13744
13745 utils::result(
13746 vips_op_response,
13747 buffer_out.into(),
13748 Error::OperationError("RadsaveBuffer (vips_radsave_buffer) failed".to_string()),
13749 )
13750 }
13751
13752 /// VipsForeignSaveRadTarget (radsave_target), save image to Radiance target (.hdr), priority=0, mono rgb
13753 ///
13754 /// target: `&VipsTarget` -> Target to save to
13755 pub fn radsave_target(&self, target: &VipsTarget) -> Result<()> {
13756 let vips_op_response = call(
13757 "radsave_target",
13758 VOption::new()
13759 .set("in", self)
13760 .set(
13761 "target",
13762 target,
13763 ),
13764 );
13765
13766 utils::result(
13767 vips_op_response,
13768 (),
13769 Error::OperationError("RadsaveTarget (vips_radsave_target) failed".to_string()),
13770 )
13771 }
13772
13773 /// VipsForeignSaveRadTarget (radsave_target), save image to Radiance target (.hdr), priority=0, mono rgb
13774 ///
13775 /// target: `&VipsTarget` -> Target to save to
13776 ///
13777 /// <ins>Optional arguments</ins>
13778 ///
13779 /// keep: [`ForeignKeep`] -> Which metadata to retain
13780 ///
13781 /// background: `&[f64]` -> Background value
13782 ///
13783 /// page_height: `i32` -> Set page height for multipage save
13784 ///
13785 /// profile: `&str` -> Filename of ICC profile to embed
13786 pub fn radsave_target_with_opts(&self, target: &VipsTarget, option: VOption) -> Result<()> {
13787 let vips_op_response = call(
13788 "radsave_target",
13789 option
13790 .set("in", self)
13791 .set(
13792 "target",
13793 target,
13794 ),
13795 );
13796
13797 utils::result(
13798 vips_op_response,
13799 (),
13800 Error::OperationError("RadsaveTarget (vips_radsave_target) failed".to_string()),
13801 )
13802 }
13803
13804 /// VipsRank (rank), rank filter
13805 /// returns `VipsImage` - Output image
13806 ///
13807 /// width: `i32` -> Window width in pixels
13808 ///
13809 /// height: `i32` -> Window height in pixels
13810 ///
13811 /// index: `i32` -> Select pixel at index
13812 pub fn rank(&self, width: i32, height: i32, index: i32) -> Result<VipsImage> {
13813 let mut out_out = VipsImage::from(null_mut());
13814 let vips_op_response = call(
13815 "rank",
13816 VOption::new()
13817 .set("in", self)
13818 .set(
13819 "out",
13820 &mut out_out,
13821 )
13822 .set(
13823 "width",
13824 width,
13825 )
13826 .set(
13827 "height",
13828 height,
13829 )
13830 .set(
13831 "index",
13832 index,
13833 ),
13834 );
13835
13836 utils::result(
13837 vips_op_response,
13838 out_out,
13839 Error::OperationError("Rank (vips_rank) failed".to_string()),
13840 )
13841 }
13842
13843 /// VipsForeignLoadRaw (rawload), load raw data from a file, priority=0, untrusted, get_flags, get_flags_filename, header
13844 /// returns `VipsImage` - Output image
13845 ///
13846 /// filename: `&str` -> Filename to load from
13847 ///
13848 /// width: `i32` -> Image width in pixels
13849 ///
13850 /// height: `i32` -> Image height in pixels
13851 ///
13852 /// bands: `i32` -> Number of bands in image
13853 pub fn rawload(filename: &str, width: i32, height: i32, bands: i32) -> Result<VipsImage> {
13854 let mut out_out = VipsImage::from(null_mut());
13855 let vips_op_response = call(
13856 "rawload",
13857 VOption::new()
13858 .set(
13859 "filename",
13860 filename,
13861 )
13862 .set(
13863 "out",
13864 &mut out_out,
13865 )
13866 .set(
13867 "width",
13868 width,
13869 )
13870 .set(
13871 "height",
13872 height,
13873 )
13874 .set(
13875 "bands",
13876 bands,
13877 ),
13878 );
13879
13880 utils::result(
13881 vips_op_response,
13882 out_out,
13883 Error::OperationError("Rawload (vips_rawload) failed".to_string()),
13884 )
13885 }
13886
13887 /// VipsForeignLoadRaw (rawload), load raw data from a file, priority=0, untrusted, get_flags, get_flags_filename, header
13888 /// returns `VipsImage` - Output image
13889 ///
13890 /// filename: `&str` -> Filename to load from
13891 ///
13892 /// width: `i32` -> Image width in pixels
13893 ///
13894 /// height: `i32` -> Image height in pixels
13895 ///
13896 /// bands: `i32` -> Number of bands in image
13897 ///
13898 /// <ins>Optional arguments</ins>
13899 ///
13900 /// offset: `u64` -> Offset in bytes from start of file
13901 ///
13902 /// format: [`BandFormat`] -> Pixel format in image
13903 ///
13904 /// interpretation: [`Interpretation`] -> Pixel interpretation
13905 ///
13906 /// flags: [`ForeignFlags`] -> Flags for this file
13907 ///
13908 /// memory: `bool` -> Force open via memory
13909 ///
13910 /// access: [`Access`] -> Required access pattern for this file
13911 ///
13912 /// fail_on: [`FailOn`] -> Error level to fail on
13913 ///
13914 /// revalidate: `bool` -> Don't use a cached result for this operation
13915 pub fn rawload_with_opts(
13916 filename: &str,
13917 width: i32,
13918 height: i32,
13919 bands: i32,
13920 option: VOption,
13921 ) -> Result<VipsImage> {
13922 let mut out_out = VipsImage::from(null_mut());
13923 let vips_op_response = call(
13924 "rawload",
13925 option
13926 .set(
13927 "filename",
13928 filename,
13929 )
13930 .set(
13931 "out",
13932 &mut out_out,
13933 )
13934 .set(
13935 "width",
13936 width,
13937 )
13938 .set(
13939 "height",
13940 height,
13941 )
13942 .set(
13943 "bands",
13944 bands,
13945 ),
13946 );
13947
13948 utils::result(
13949 vips_op_response,
13950 out_out,
13951 Error::OperationError("Rawload (vips_rawload) failed".to_string()),
13952 )
13953 }
13954
13955 /// VipsForeignSaveRawFile (rawsave), save image to raw file (.raw), priority=0,
13956 ///
13957 /// filename: `&str` -> Filename to save to
13958 pub fn rawsave(&self, filename: &str) -> Result<()> {
13959 let vips_op_response = call(
13960 "rawsave",
13961 VOption::new()
13962 .set("in", self)
13963 .set(
13964 "filename",
13965 filename,
13966 ),
13967 );
13968
13969 utils::result(
13970 vips_op_response,
13971 (),
13972 Error::OperationError("Rawsave (vips_rawsave) failed".to_string()),
13973 )
13974 }
13975
13976 /// VipsForeignSaveRawFile (rawsave), save image to raw file (.raw), priority=0,
13977 ///
13978 /// filename: `&str` -> Filename to save to
13979 ///
13980 /// <ins>Optional arguments</ins>
13981 ///
13982 /// keep: [`ForeignKeep`] -> Which metadata to retain
13983 ///
13984 /// background: `&[f64]` -> Background value
13985 ///
13986 /// page_height: `i32` -> Set page height for multipage save
13987 ///
13988 /// profile: `&str` -> Filename of ICC profile to embed
13989 pub fn rawsave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
13990 let vips_op_response = call(
13991 "rawsave",
13992 option
13993 .set("in", self)
13994 .set(
13995 "filename",
13996 filename,
13997 ),
13998 );
13999
14000 utils::result(
14001 vips_op_response,
14002 (),
14003 Error::OperationError("Rawsave (vips_rawsave) failed".to_string()),
14004 )
14005 }
14006
14007 /// VipsForeignSaveRawBuffer (rawsave_buffer), write raw image to buffer (.raw), priority=0,
14008 /// returns `Vec<u8>` - Buffer to save to
14009 pub fn rawsave_buffer(&self) -> Result<Vec<u8>> {
14010 let mut buffer_out = VipsBlob::from(null_mut());
14011 let vips_op_response = call(
14012 "rawsave_buffer",
14013 VOption::new()
14014 .set("in", self)
14015 .set(
14016 "buffer",
14017 &mut buffer_out,
14018 ),
14019 );
14020
14021 utils::result(
14022 vips_op_response,
14023 buffer_out.into(),
14024 Error::OperationError("RawsaveBuffer (vips_rawsave_buffer) failed".to_string()),
14025 )
14026 }
14027
14028 /// VipsForeignSaveRawBuffer (rawsave_buffer), write raw image to buffer (.raw), priority=0,
14029 /// returns `Vec<u8>` - Buffer to save to
14030 ///
14031 /// <ins>Optional arguments</ins>
14032 ///
14033 /// keep: [`ForeignKeep`] -> Which metadata to retain
14034 ///
14035 /// background: `&[f64]` -> Background value
14036 ///
14037 /// page_height: `i32` -> Set page height for multipage save
14038 ///
14039 /// profile: `&str` -> Filename of ICC profile to embed
14040 pub fn rawsave_buffer_with_opts(&self, option: VOption) -> Result<Vec<u8>> {
14041 let mut buffer_out = VipsBlob::from(null_mut());
14042 let vips_op_response = call(
14043 "rawsave_buffer",
14044 option
14045 .set("in", self)
14046 .set(
14047 "buffer",
14048 &mut buffer_out,
14049 ),
14050 );
14051
14052 utils::result(
14053 vips_op_response,
14054 buffer_out.into(),
14055 Error::OperationError("RawsaveBuffer (vips_rawsave_buffer) failed".to_string()),
14056 )
14057 }
14058
14059 /// VipsForeignSaveRawTarget (rawsave_target), write raw image to target (.raw), priority=0,
14060 ///
14061 /// target: `&VipsTarget` -> Target to save to
14062 pub fn rawsave_target(&self, target: &VipsTarget) -> Result<()> {
14063 let vips_op_response = call(
14064 "rawsave_target",
14065 VOption::new()
14066 .set("in", self)
14067 .set(
14068 "target",
14069 target,
14070 ),
14071 );
14072
14073 utils::result(
14074 vips_op_response,
14075 (),
14076 Error::OperationError("RawsaveTarget (vips_rawsave_target) failed".to_string()),
14077 )
14078 }
14079
14080 /// VipsForeignSaveRawTarget (rawsave_target), write raw image to target (.raw), priority=0,
14081 ///
14082 /// target: `&VipsTarget` -> Target to save to
14083 ///
14084 /// <ins>Optional arguments</ins>
14085 ///
14086 /// keep: [`ForeignKeep`] -> Which metadata to retain
14087 ///
14088 /// background: `&[f64]` -> Background value
14089 ///
14090 /// page_height: `i32` -> Set page height for multipage save
14091 ///
14092 /// profile: `&str` -> Filename of ICC profile to embed
14093 pub fn rawsave_target_with_opts(&self, target: &VipsTarget, option: VOption) -> Result<()> {
14094 let vips_op_response = call(
14095 "rawsave_target",
14096 option
14097 .set("in", self)
14098 .set(
14099 "target",
14100 target,
14101 ),
14102 );
14103
14104 utils::result(
14105 vips_op_response,
14106 (),
14107 Error::OperationError("RawsaveTarget (vips_rawsave_target) failed".to_string()),
14108 )
14109 }
14110
14111 /// VipsRecomb (recomb), linear recombination with matrix
14112 /// returns `VipsImage` - Output image
14113 ///
14114 /// m: `&VipsImage` -> Matrix of coefficients
14115 pub fn recomb(&self, m: &VipsImage) -> Result<VipsImage> {
14116 let mut out_out = VipsImage::from(null_mut());
14117 let vips_op_response = call(
14118 "recomb",
14119 VOption::new()
14120 .set("in", self)
14121 .set(
14122 "out",
14123 &mut out_out,
14124 )
14125 .set("m", m),
14126 );
14127
14128 utils::result(
14129 vips_op_response,
14130 out_out,
14131 Error::OperationError("Recomb (vips_recomb) failed".to_string()),
14132 )
14133 }
14134
14135 /// VipsReduce (reduce), reduce an image
14136 /// returns `VipsImage` - Output image
14137 ///
14138 /// hshrink: `f64` -> Horizontal shrink factor
14139 ///
14140 /// vshrink: `f64` -> Vertical shrink factor
14141 pub fn reduce(&self, hshrink: f64, vshrink: f64) -> Result<VipsImage> {
14142 let mut out_out = VipsImage::from(null_mut());
14143 let vips_op_response = call(
14144 "reduce",
14145 VOption::new()
14146 .set("in", self)
14147 .set(
14148 "out",
14149 &mut out_out,
14150 )
14151 .set(
14152 "hshrink",
14153 hshrink,
14154 )
14155 .set(
14156 "vshrink",
14157 vshrink,
14158 ),
14159 );
14160
14161 utils::result(
14162 vips_op_response,
14163 out_out,
14164 Error::OperationError("Reduce (vips_reduce) failed".to_string()),
14165 )
14166 }
14167
14168 /// VipsReduce (reduce), reduce an image
14169 /// returns `VipsImage` - Output image
14170 ///
14171 /// hshrink: `f64` -> Horizontal shrink factor
14172 ///
14173 /// vshrink: `f64` -> Vertical shrink factor
14174 ///
14175 /// <ins>Optional arguments</ins>
14176 ///
14177 /// kernel: [`Kernel`] -> Resampling kernel
14178 ///
14179 /// gap: `f64` -> Reducing gap
14180 pub fn reduce_with_opts(
14181 &self,
14182 hshrink: f64,
14183 vshrink: f64,
14184 option: VOption,
14185 ) -> Result<VipsImage> {
14186 let mut out_out = VipsImage::from(null_mut());
14187 let vips_op_response = call(
14188 "reduce",
14189 option
14190 .set("in", self)
14191 .set(
14192 "out",
14193 &mut out_out,
14194 )
14195 .set(
14196 "hshrink",
14197 hshrink,
14198 )
14199 .set(
14200 "vshrink",
14201 vshrink,
14202 ),
14203 );
14204
14205 utils::result(
14206 vips_op_response,
14207 out_out,
14208 Error::OperationError("Reduce (vips_reduce) failed".to_string()),
14209 )
14210 }
14211
14212 /// VipsReduceh (reduceh), shrink an image horizontally
14213 /// returns `VipsImage` - Output image
14214 ///
14215 /// hshrink: `f64` -> Horizontal shrink factor
14216 pub fn reduceh(&self, hshrink: f64) -> Result<VipsImage> {
14217 let mut out_out = VipsImage::from(null_mut());
14218 let vips_op_response = call(
14219 "reduceh",
14220 VOption::new()
14221 .set("in", self)
14222 .set(
14223 "out",
14224 &mut out_out,
14225 )
14226 .set(
14227 "hshrink",
14228 hshrink,
14229 ),
14230 );
14231
14232 utils::result(
14233 vips_op_response,
14234 out_out,
14235 Error::OperationError("Reduceh (vips_reduceh) failed".to_string()),
14236 )
14237 }
14238
14239 /// VipsReduceh (reduceh), shrink an image horizontally
14240 /// returns `VipsImage` - Output image
14241 ///
14242 /// hshrink: `f64` -> Horizontal shrink factor
14243 ///
14244 /// <ins>Optional arguments</ins>
14245 ///
14246 /// kernel: [`Kernel`] -> Resampling kernel
14247 ///
14248 /// gap: `f64` -> Reducing gap
14249 pub fn reduceh_with_opts(&self, hshrink: f64, option: VOption) -> Result<VipsImage> {
14250 let mut out_out = VipsImage::from(null_mut());
14251 let vips_op_response = call(
14252 "reduceh",
14253 option
14254 .set("in", self)
14255 .set(
14256 "out",
14257 &mut out_out,
14258 )
14259 .set(
14260 "hshrink",
14261 hshrink,
14262 ),
14263 );
14264
14265 utils::result(
14266 vips_op_response,
14267 out_out,
14268 Error::OperationError("Reduceh (vips_reduceh) failed".to_string()),
14269 )
14270 }
14271
14272 /// VipsReducev (reducev), shrink an image vertically
14273 /// returns `VipsImage` - Output image
14274 ///
14275 /// vshrink: `f64` -> Vertical shrink factor
14276 pub fn reducev(&self, vshrink: f64) -> Result<VipsImage> {
14277 let mut out_out = VipsImage::from(null_mut());
14278 let vips_op_response = call(
14279 "reducev",
14280 VOption::new()
14281 .set("in", self)
14282 .set(
14283 "out",
14284 &mut out_out,
14285 )
14286 .set(
14287 "vshrink",
14288 vshrink,
14289 ),
14290 );
14291
14292 utils::result(
14293 vips_op_response,
14294 out_out,
14295 Error::OperationError("Reducev (vips_reducev) failed".to_string()),
14296 )
14297 }
14298
14299 /// VipsReducev (reducev), shrink an image vertically
14300 /// returns `VipsImage` - Output image
14301 ///
14302 /// vshrink: `f64` -> Vertical shrink factor
14303 ///
14304 /// <ins>Optional arguments</ins>
14305 ///
14306 /// kernel: [`Kernel`] -> Resampling kernel
14307 ///
14308 /// gap: `f64` -> Reducing gap
14309 pub fn reducev_with_opts(&self, vshrink: f64, option: VOption) -> Result<VipsImage> {
14310 let mut out_out = VipsImage::from(null_mut());
14311 let vips_op_response = call(
14312 "reducev",
14313 option
14314 .set("in", self)
14315 .set(
14316 "out",
14317 &mut out_out,
14318 )
14319 .set(
14320 "vshrink",
14321 vshrink,
14322 ),
14323 );
14324
14325 utils::result(
14326 vips_op_response,
14327 out_out,
14328 Error::OperationError("Reducev (vips_reducev) failed".to_string()),
14329 )
14330 }
14331
14332 /// VipsRelational (relational), relational operation on two images
14333 /// returns `VipsImage` - Output image
14334 ///
14335 /// right: `&VipsImage` -> Right-hand image argument
14336 ///
14337 /// relational: `OperationRelational` -> Relational to perform
14338 pub fn relational(
14339 &self,
14340 right: &VipsImage,
14341 relational: OperationRelational,
14342 ) -> Result<VipsImage> {
14343 let mut out_out = VipsImage::from(null_mut());
14344 let vips_op_response = call(
14345 "relational",
14346 VOption::new()
14347 .set(
14348 "left",
14349 self,
14350 )
14351 .set(
14352 "right",
14353 right,
14354 )
14355 .set(
14356 "out",
14357 &mut out_out,
14358 )
14359 .set(
14360 "relational",
14361 relational as i32,
14362 ),
14363 );
14364
14365 utils::result(
14366 vips_op_response,
14367 out_out,
14368 Error::OperationError("Relational (vips_relational) failed".to_string()),
14369 )
14370 }
14371
14372 /// VipsRelationalConst (relational_const), relational operations against a constant
14373 /// returns `VipsImage` - Output image
14374 ///
14375 /// relational: `OperationRelational` -> Relational to perform
14376 ///
14377 /// c: `&[f64]` -> Array of constants
14378 pub fn relational_const(
14379 &self,
14380 relational: OperationRelational,
14381 c: &[f64],
14382 ) -> Result<VipsImage> {
14383 let mut out_out = VipsImage::from(null_mut());
14384 let vips_op_response = call(
14385 "relational_const",
14386 VOption::new()
14387 .set("in", self)
14388 .set(
14389 "out",
14390 &mut out_out,
14391 )
14392 .set(
14393 "relational",
14394 relational as i32,
14395 )
14396 .set("c", c),
14397 );
14398
14399 utils::result(
14400 vips_op_response,
14401 out_out,
14402 Error::OperationError("RelationalConst (vips_relational_const) failed".to_string()),
14403 )
14404 }
14405
14406 /// VipsRemainder (remainder), remainder after integer division of two images
14407 /// returns `VipsImage` - Output image
14408 ///
14409 /// right: `&VipsImage` -> Right-hand image argument
14410 pub fn remainder(&self, right: &VipsImage) -> Result<VipsImage> {
14411 let mut out_out = VipsImage::from(null_mut());
14412 let vips_op_response = call(
14413 "remainder",
14414 VOption::new()
14415 .set(
14416 "left",
14417 self,
14418 )
14419 .set(
14420 "right",
14421 right,
14422 )
14423 .set(
14424 "out",
14425 &mut out_out,
14426 ),
14427 );
14428
14429 utils::result(
14430 vips_op_response,
14431 out_out,
14432 Error::OperationError("Remainder (vips_remainder) failed".to_string()),
14433 )
14434 }
14435
14436 /// VipsRemainderConst (remainder_const), remainder after integer division of an image and a constant
14437 /// returns `VipsImage` - Output image
14438 ///
14439 /// c: `&[f64]` -> Array of constants
14440 pub fn remainder_const(&self, c: &[f64]) -> Result<VipsImage> {
14441 let mut out_out = VipsImage::from(null_mut());
14442 let vips_op_response = call(
14443 "remainder_const",
14444 VOption::new()
14445 .set("in", self)
14446 .set(
14447 "out",
14448 &mut out_out,
14449 )
14450 .set("c", c),
14451 );
14452
14453 utils::result(
14454 vips_op_response,
14455 out_out,
14456 Error::OperationError("RemainderConst (vips_remainder_const) failed".to_string()),
14457 )
14458 }
14459
14460 /// VipsRemosaic (remosaic), rebuild an mosaiced image
14461 /// returns `VipsImage` - Output image
14462 ///
14463 /// old_str: `&str` -> Search for this string
14464 ///
14465 /// new_str: `&str` -> And swap for this string
14466 pub fn remosaic(&self, old_str: &str, new_str: &str) -> Result<VipsImage> {
14467 let mut out_out = VipsImage::from(null_mut());
14468 let vips_op_response = call(
14469 "remosaic",
14470 VOption::new()
14471 .set("in", self)
14472 .set(
14473 "out",
14474 &mut out_out,
14475 )
14476 .set(
14477 "old-str",
14478 old_str,
14479 )
14480 .set(
14481 "new-str",
14482 new_str,
14483 ),
14484 );
14485
14486 utils::result(
14487 vips_op_response,
14488 out_out,
14489 Error::OperationError("Remosaic (vips_remosaic) failed".to_string()),
14490 )
14491 }
14492
14493 /// VipsReplicate (replicate), replicate an image
14494 /// returns `VipsImage` - Output image
14495 ///
14496 /// across: `i32` -> Repeat this many times horizontally
14497 ///
14498 /// down: `i32` -> Repeat this many times vertically
14499 pub fn replicate(&self, across: i32, down: i32) -> Result<VipsImage> {
14500 let mut out_out = VipsImage::from(null_mut());
14501 let vips_op_response = call(
14502 "replicate",
14503 VOption::new()
14504 .set("in", self)
14505 .set(
14506 "out",
14507 &mut out_out,
14508 )
14509 .set(
14510 "across",
14511 across,
14512 )
14513 .set(
14514 "down",
14515 down,
14516 ),
14517 );
14518
14519 utils::result(
14520 vips_op_response,
14521 out_out,
14522 Error::OperationError("Replicate (vips_replicate) failed".to_string()),
14523 )
14524 }
14525
14526 /// VipsResize (resize), resize an image
14527 /// returns `VipsImage` - Output image
14528 ///
14529 /// scale: `f64` -> Scale image by this factor
14530 pub fn resize(&self, scale: f64) -> Result<VipsImage> {
14531 let mut out_out = VipsImage::from(null_mut());
14532 let vips_op_response = call(
14533 "resize",
14534 VOption::new()
14535 .set("in", self)
14536 .set(
14537 "out",
14538 &mut out_out,
14539 )
14540 .set(
14541 "scale",
14542 scale,
14543 ),
14544 );
14545
14546 utils::result(
14547 vips_op_response,
14548 out_out,
14549 Error::OperationError("Resize (vips_resize) failed".to_string()),
14550 )
14551 }
14552
14553 /// VipsResize (resize), resize an image
14554 /// returns `VipsImage` - Output image
14555 ///
14556 /// scale: `f64` -> Scale image by this factor
14557 ///
14558 /// <ins>Optional arguments</ins>
14559 ///
14560 /// kernel: [`Kernel`] -> Resampling kernel
14561 ///
14562 /// gap: `f64` -> Reducing gap
14563 ///
14564 /// vscale: `f64` -> Vertical scale image by this factor
14565 pub fn resize_with_opts(&self, scale: f64, option: VOption) -> Result<VipsImage> {
14566 let mut out_out = VipsImage::from(null_mut());
14567 let vips_op_response = call(
14568 "resize",
14569 option
14570 .set("in", self)
14571 .set(
14572 "out",
14573 &mut out_out,
14574 )
14575 .set(
14576 "scale",
14577 scale,
14578 ),
14579 );
14580
14581 utils::result(
14582 vips_op_response,
14583 out_out,
14584 Error::OperationError("Resize (vips_resize) failed".to_string()),
14585 )
14586 }
14587
14588 /// VipsRot45 (rot45), rotate an image
14589 /// returns `VipsImage` - Output image
14590 pub fn rot45(&self) -> Result<VipsImage> {
14591 let mut out_out = VipsImage::from(null_mut());
14592 let vips_op_response = call(
14593 "rot45",
14594 VOption::new()
14595 .set("in", self)
14596 .set(
14597 "out",
14598 &mut out_out,
14599 ),
14600 );
14601
14602 utils::result(
14603 vips_op_response,
14604 out_out,
14605 Error::OperationError("Rot45 (vips_rot45) failed".to_string()),
14606 )
14607 }
14608
14609 /// VipsRot45 (rot45), rotate an image
14610 /// returns `VipsImage` - Output image
14611 ///
14612 /// <ins>Optional arguments</ins>
14613 ///
14614 /// angle: [`Angle45`] -> Angle to rotate image
14615 pub fn rot45_with_opts(&self, option: VOption) -> Result<VipsImage> {
14616 let mut out_out = VipsImage::from(null_mut());
14617 let vips_op_response = call(
14618 "rot45",
14619 option
14620 .set("in", self)
14621 .set(
14622 "out",
14623 &mut out_out,
14624 ),
14625 );
14626
14627 utils::result(
14628 vips_op_response,
14629 out_out,
14630 Error::OperationError("Rot45 (vips_rot45) failed".to_string()),
14631 )
14632 }
14633
14634 /// VipsRot (rot), rotate an image
14635 /// returns `VipsImage` - Output image
14636 ///
14637 /// angle: `Angle` -> Angle to rotate image
14638 pub fn rot(&self, angle: Angle) -> Result<VipsImage> {
14639 let mut out_out = VipsImage::from(null_mut());
14640 let vips_op_response = call(
14641 "rot",
14642 VOption::new()
14643 .set("in", self)
14644 .set(
14645 "out",
14646 &mut out_out,
14647 )
14648 .set(
14649 "angle",
14650 angle as i32,
14651 ),
14652 );
14653
14654 utils::result(
14655 vips_op_response,
14656 out_out,
14657 Error::OperationError("Rot (vips_rot) failed".to_string()),
14658 )
14659 }
14660
14661 /// VipsRotate (rotate), rotate an image by a number of degrees
14662 /// returns `VipsImage` - Output image
14663 ///
14664 /// angle: `f64` -> Rotate clockwise by this many degrees
14665 pub fn rotate(&self, angle: f64) -> Result<VipsImage> {
14666 let mut out_out = VipsImage::from(null_mut());
14667 let vips_op_response = call(
14668 "rotate",
14669 VOption::new()
14670 .set("in", self)
14671 .set(
14672 "out",
14673 &mut out_out,
14674 )
14675 .set(
14676 "angle",
14677 angle,
14678 ),
14679 );
14680
14681 utils::result(
14682 vips_op_response,
14683 out_out,
14684 Error::OperationError("Rotate (vips_rotate) failed".to_string()),
14685 )
14686 }
14687
14688 /// VipsRotate (rotate), rotate an image by a number of degrees
14689 /// returns `VipsImage` - Output image
14690 ///
14691 /// angle: `f64` -> Rotate clockwise by this many degrees
14692 ///
14693 /// <ins>Optional arguments</ins>
14694 ///
14695 /// interpolate: `&VipsInterpolate` -> Interpolate pixels with this
14696 ///
14697 /// background: `&[f64]` -> Background value
14698 ///
14699 /// odx: `f64` -> Horizontal output displacement
14700 ///
14701 /// ody: `f64` -> Vertical output displacement
14702 ///
14703 /// idx: `f64` -> Horizontal input displacement
14704 ///
14705 /// idy: `f64` -> Vertical input displacement
14706 pub fn rotate_with_opts(&self, angle: f64, option: VOption) -> Result<VipsImage> {
14707 let mut out_out = VipsImage::from(null_mut());
14708 let vips_op_response = call(
14709 "rotate",
14710 option
14711 .set("in", self)
14712 .set(
14713 "out",
14714 &mut out_out,
14715 )
14716 .set(
14717 "angle",
14718 angle,
14719 ),
14720 );
14721
14722 utils::result(
14723 vips_op_response,
14724 out_out,
14725 Error::OperationError("Rotate (vips_rotate) failed".to_string()),
14726 )
14727 }
14728
14729 /// VipsRound (round), perform a round function on an image
14730 /// returns `VipsImage` - Output image
14731 ///
14732 /// round: `OperationRound` -> Rounding operation to perform
14733 pub fn round(&self, round: OperationRound) -> Result<VipsImage> {
14734 let mut out_out = VipsImage::from(null_mut());
14735 let vips_op_response = call(
14736 "round",
14737 VOption::new()
14738 .set("in", self)
14739 .set(
14740 "out",
14741 &mut out_out,
14742 )
14743 .set(
14744 "round",
14745 round as i32,
14746 ),
14747 );
14748
14749 utils::result(
14750 vips_op_response,
14751 out_out,
14752 Error::OperationError("Round (vips_round) failed".to_string()),
14753 )
14754 }
14755
14756 /// VipssRGB2HSV (sRGB2HSV), transform sRGB to HSV
14757 /// returns `VipsImage` - Output image
14758 pub fn sRGB2HSV(&self) -> Result<VipsImage> {
14759 let mut out_out = VipsImage::from(null_mut());
14760 let vips_op_response = call(
14761 "sRGB2HSV",
14762 VOption::new()
14763 .set("in", self)
14764 .set(
14765 "out",
14766 &mut out_out,
14767 ),
14768 );
14769
14770 utils::result(
14771 vips_op_response,
14772 out_out,
14773 Error::OperationError("SRgb2Hsv (vips_sRGB2HSV) failed".to_string()),
14774 )
14775 }
14776
14777 /// VipssRGB2scRGB (sRGB2scRGB), convert an sRGB image to scRGB
14778 /// returns `VipsImage` - Output image
14779 pub fn sRGB2scRGB(&self) -> Result<VipsImage> {
14780 let mut out_out = VipsImage::from(null_mut());
14781 let vips_op_response = call(
14782 "sRGB2scRGB",
14783 VOption::new()
14784 .set("in", self)
14785 .set(
14786 "out",
14787 &mut out_out,
14788 ),
14789 );
14790
14791 utils::result(
14792 vips_op_response,
14793 out_out,
14794 Error::OperationError("SRgb2ScRgb (vips_sRGB2scRGB) failed".to_string()),
14795 )
14796 }
14797
14798 /// VipsscRGB2BW (scRGB2BW), convert scRGB to BW
14799 /// returns `VipsImage` - Output image
14800 pub fn scRGB2BW(&self) -> Result<VipsImage> {
14801 let mut out_out = VipsImage::from(null_mut());
14802 let vips_op_response = call(
14803 "scRGB2BW",
14804 VOption::new()
14805 .set("in", self)
14806 .set(
14807 "out",
14808 &mut out_out,
14809 ),
14810 );
14811
14812 utils::result(
14813 vips_op_response,
14814 out_out,
14815 Error::OperationError("ScRgb2Bw (vips_scRGB2BW) failed".to_string()),
14816 )
14817 }
14818
14819 /// VipsscRGB2BW (scRGB2BW), convert scRGB to BW
14820 /// returns `VipsImage` - Output image
14821 ///
14822 /// <ins>Optional arguments</ins>
14823 ///
14824 /// depth: `i32` -> Output device space depth in bits
14825 pub fn scRGB2BW_with_opts(&self, option: VOption) -> Result<VipsImage> {
14826 let mut out_out = VipsImage::from(null_mut());
14827 let vips_op_response = call(
14828 "scRGB2BW",
14829 option
14830 .set("in", self)
14831 .set(
14832 "out",
14833 &mut out_out,
14834 ),
14835 );
14836
14837 utils::result(
14838 vips_op_response,
14839 out_out,
14840 Error::OperationError("ScRgb2Bw (vips_scRGB2BW) failed".to_string()),
14841 )
14842 }
14843
14844 /// VipsscRGB2XYZ (scRGB2XYZ), transform scRGB to XYZ
14845 /// returns `VipsImage` - Output image
14846 pub fn scRGB2XYZ(&self) -> Result<VipsImage> {
14847 let mut out_out = VipsImage::from(null_mut());
14848 let vips_op_response = call(
14849 "scRGB2XYZ",
14850 VOption::new()
14851 .set("in", self)
14852 .set(
14853 "out",
14854 &mut out_out,
14855 ),
14856 );
14857
14858 utils::result(
14859 vips_op_response,
14860 out_out,
14861 Error::OperationError("ScRgb2Xyz (vips_scRGB2XYZ) failed".to_string()),
14862 )
14863 }
14864
14865 /// VipsscRGB2sRGB (scRGB2sRGB), convert scRGB to sRGB
14866 /// returns `VipsImage` - Output image
14867 pub fn scRGB2sRGB(&self) -> Result<VipsImage> {
14868 let mut out_out = VipsImage::from(null_mut());
14869 let vips_op_response = call(
14870 "scRGB2sRGB",
14871 VOption::new()
14872 .set("in", self)
14873 .set(
14874 "out",
14875 &mut out_out,
14876 ),
14877 );
14878
14879 utils::result(
14880 vips_op_response,
14881 out_out,
14882 Error::OperationError("ScRgb2SRgb (vips_scRGB2sRGB) failed".to_string()),
14883 )
14884 }
14885
14886 /// VipsscRGB2sRGB (scRGB2sRGB), convert scRGB to sRGB
14887 /// returns `VipsImage` - Output image
14888 ///
14889 /// <ins>Optional arguments</ins>
14890 ///
14891 /// depth: `i32` -> Output device space depth in bits
14892 pub fn scRGB2sRGB_with_opts(&self, option: VOption) -> Result<VipsImage> {
14893 let mut out_out = VipsImage::from(null_mut());
14894 let vips_op_response = call(
14895 "scRGB2sRGB",
14896 option
14897 .set("in", self)
14898 .set(
14899 "out",
14900 &mut out_out,
14901 ),
14902 );
14903
14904 utils::result(
14905 vips_op_response,
14906 out_out,
14907 Error::OperationError("ScRgb2SRgb (vips_scRGB2sRGB) failed".to_string()),
14908 )
14909 }
14910
14911 /// VipsScale (scale), scale an image to uchar
14912 /// returns `VipsImage` - Output image
14913 pub fn scale(&self) -> Result<VipsImage> {
14914 let mut out_out = VipsImage::from(null_mut());
14915 let vips_op_response = call(
14916 "scale",
14917 VOption::new()
14918 .set("in", self)
14919 .set(
14920 "out",
14921 &mut out_out,
14922 ),
14923 );
14924
14925 utils::result(
14926 vips_op_response,
14927 out_out,
14928 Error::OperationError("Scale (vips_scale) failed".to_string()),
14929 )
14930 }
14931
14932 /// VipsScale (scale), scale an image to uchar
14933 /// returns `VipsImage` - Output image
14934 ///
14935 /// <ins>Optional arguments</ins>
14936 ///
14937 /// exp: `f64` -> Exponent for log scale
14938 ///
14939 /// log: `bool` -> Log scale
14940 pub fn scale_with_opts(&self, option: VOption) -> Result<VipsImage> {
14941 let mut out_out = VipsImage::from(null_mut());
14942 let vips_op_response = call(
14943 "scale",
14944 option
14945 .set("in", self)
14946 .set(
14947 "out",
14948 &mut out_out,
14949 ),
14950 );
14951
14952 utils::result(
14953 vips_op_response,
14954 out_out,
14955 Error::OperationError("Scale (vips_scale) failed".to_string()),
14956 )
14957 }
14958
14959 /// VipsScharr (scharr), Scharr edge detector
14960 /// returns `VipsImage` - Output image
14961 pub fn scharr(&self) -> Result<VipsImage> {
14962 let mut out_out = VipsImage::from(null_mut());
14963 let vips_op_response = call(
14964 "scharr",
14965 VOption::new()
14966 .set("in", self)
14967 .set(
14968 "out",
14969 &mut out_out,
14970 ),
14971 );
14972
14973 utils::result(
14974 vips_op_response,
14975 out_out,
14976 Error::OperationError("Scharr (vips_scharr) failed".to_string()),
14977 )
14978 }
14979
14980 /// VipsSdf (sdf), create an SDF image
14981 /// returns `VipsImage` - Output image
14982 ///
14983 /// width: `i32` -> Image width in pixels
14984 ///
14985 /// height: `i32` -> Image height in pixels
14986 ///
14987 /// shape: `SdfShape` -> SDF shape to create
14988 pub fn sdf(width: i32, height: i32, shape: SdfShape) -> Result<VipsImage> {
14989 let mut out_out = VipsImage::from(null_mut());
14990 let vips_op_response = call(
14991 "sdf",
14992 VOption::new()
14993 .set(
14994 "out",
14995 &mut out_out,
14996 )
14997 .set(
14998 "width",
14999 width,
15000 )
15001 .set(
15002 "height",
15003 height,
15004 )
15005 .set(
15006 "shape",
15007 shape as i32,
15008 ),
15009 );
15010
15011 utils::result(
15012 vips_op_response,
15013 out_out,
15014 Error::OperationError("Sdf (vips_sdf) failed".to_string()),
15015 )
15016 }
15017
15018 /// VipsSdf (sdf), create an SDF image
15019 /// returns `VipsImage` - Output image
15020 ///
15021 /// width: `i32` -> Image width in pixels
15022 ///
15023 /// height: `i32` -> Image height in pixels
15024 ///
15025 /// shape: `SdfShape` -> SDF shape to create
15026 ///
15027 /// <ins>Optional arguments</ins>
15028 ///
15029 /// r: `f64` -> Radius
15030 ///
15031 /// a: `&[f64]` -> Point a
15032 ///
15033 /// b: `&[f64]` -> Point b
15034 ///
15035 /// corners: `&[f64]` -> Corner radii
15036 pub fn sdf_with_opts(
15037 width: i32,
15038 height: i32,
15039 shape: SdfShape,
15040 option: VOption,
15041 ) -> Result<VipsImage> {
15042 let mut out_out = VipsImage::from(null_mut());
15043 let vips_op_response = call(
15044 "sdf",
15045 option
15046 .set(
15047 "out",
15048 &mut out_out,
15049 )
15050 .set(
15051 "width",
15052 width,
15053 )
15054 .set(
15055 "height",
15056 height,
15057 )
15058 .set(
15059 "shape",
15060 shape as i32,
15061 ),
15062 );
15063
15064 utils::result(
15065 vips_op_response,
15066 out_out,
15067 Error::OperationError("Sdf (vips_sdf) failed".to_string()),
15068 )
15069 }
15070
15071 /// VipsSequential (sequential), check sequential access
15072 /// returns `VipsImage` - Output image
15073 pub fn sequential(&self) -> Result<VipsImage> {
15074 let mut out_out = VipsImage::from(null_mut());
15075 let vips_op_response = call(
15076 "sequential",
15077 VOption::new()
15078 .set("in", self)
15079 .set(
15080 "out",
15081 &mut out_out,
15082 ),
15083 );
15084
15085 utils::result(
15086 vips_op_response,
15087 out_out,
15088 Error::OperationError("Sequential (vips_sequential) failed".to_string()),
15089 )
15090 }
15091
15092 /// VipsSequential (sequential), check sequential access
15093 /// returns `VipsImage` - Output image
15094 ///
15095 /// <ins>Optional arguments</ins>
15096 ///
15097 /// tile_height: `i32` -> Tile height in pixels
15098 pub fn sequential_with_opts(&self, option: VOption) -> Result<VipsImage> {
15099 let mut out_out = VipsImage::from(null_mut());
15100 let vips_op_response = call(
15101 "sequential",
15102 option
15103 .set("in", self)
15104 .set(
15105 "out",
15106 &mut out_out,
15107 ),
15108 );
15109
15110 utils::result(
15111 vips_op_response,
15112 out_out,
15113 Error::OperationError("Sequential (vips_sequential) failed".to_string()),
15114 )
15115 }
15116
15117 /// VipsSharpen (sharpen), unsharp masking for print
15118 /// returns `VipsImage` - Output image
15119 pub fn sharpen(&self) -> Result<VipsImage> {
15120 let mut out_out = VipsImage::from(null_mut());
15121 let vips_op_response = call(
15122 "sharpen",
15123 VOption::new()
15124 .set("in", self)
15125 .set(
15126 "out",
15127 &mut out_out,
15128 ),
15129 );
15130
15131 utils::result(
15132 vips_op_response,
15133 out_out,
15134 Error::OperationError("Sharpen (vips_sharpen) failed".to_string()),
15135 )
15136 }
15137
15138 /// VipsSharpen (sharpen), unsharp masking for print
15139 /// returns `VipsImage` - Output image
15140 ///
15141 /// <ins>Optional arguments</ins>
15142 ///
15143 /// sigma: `f64` -> Sigma of Gaussian
15144 ///
15145 /// x1: `f64` -> Flat/jaggy threshold
15146 ///
15147 /// y2: `f64` -> Maximum brightening
15148 ///
15149 /// y3: `f64` -> Maximum darkening
15150 ///
15151 /// m1: `f64` -> Slope for flat areas
15152 ///
15153 /// m2: `f64` -> Slope for jaggy areas
15154 pub fn sharpen_with_opts(&self, option: VOption) -> Result<VipsImage> {
15155 let mut out_out = VipsImage::from(null_mut());
15156 let vips_op_response = call(
15157 "sharpen",
15158 option
15159 .set("in", self)
15160 .set(
15161 "out",
15162 &mut out_out,
15163 ),
15164 );
15165
15166 utils::result(
15167 vips_op_response,
15168 out_out,
15169 Error::OperationError("Sharpen (vips_sharpen) failed".to_string()),
15170 )
15171 }
15172
15173 /// VipsShrink (shrink), shrink an image
15174 /// returns `VipsImage` - Output image
15175 ///
15176 /// hshrink: `f64` -> Horizontal shrink factor
15177 ///
15178 /// vshrink: `f64` -> Vertical shrink factor
15179 pub fn shrink(&self, hshrink: f64, vshrink: f64) -> Result<VipsImage> {
15180 let mut out_out = VipsImage::from(null_mut());
15181 let vips_op_response = call(
15182 "shrink",
15183 VOption::new()
15184 .set("in", self)
15185 .set(
15186 "out",
15187 &mut out_out,
15188 )
15189 .set(
15190 "hshrink",
15191 hshrink,
15192 )
15193 .set(
15194 "vshrink",
15195 vshrink,
15196 ),
15197 );
15198
15199 utils::result(
15200 vips_op_response,
15201 out_out,
15202 Error::OperationError("Shrink (vips_shrink) failed".to_string()),
15203 )
15204 }
15205
15206 /// VipsShrink (shrink), shrink an image
15207 /// returns `VipsImage` - Output image
15208 ///
15209 /// hshrink: `f64` -> Horizontal shrink factor
15210 ///
15211 /// vshrink: `f64` -> Vertical shrink factor
15212 ///
15213 /// <ins>Optional arguments</ins>
15214 ///
15215 /// ceil: `bool` -> Round-up output dimensions
15216 pub fn shrink_with_opts(
15217 &self,
15218 hshrink: f64,
15219 vshrink: f64,
15220 option: VOption,
15221 ) -> Result<VipsImage> {
15222 let mut out_out = VipsImage::from(null_mut());
15223 let vips_op_response = call(
15224 "shrink",
15225 option
15226 .set("in", self)
15227 .set(
15228 "out",
15229 &mut out_out,
15230 )
15231 .set(
15232 "hshrink",
15233 hshrink,
15234 )
15235 .set(
15236 "vshrink",
15237 vshrink,
15238 ),
15239 );
15240
15241 utils::result(
15242 vips_op_response,
15243 out_out,
15244 Error::OperationError("Shrink (vips_shrink) failed".to_string()),
15245 )
15246 }
15247
15248 /// VipsShrinkh (shrinkh), shrink an image horizontally
15249 /// returns `VipsImage` - Output image
15250 ///
15251 /// hshrink: `i32` -> Horizontal shrink factor
15252 pub fn shrinkh(&self, hshrink: i32) -> Result<VipsImage> {
15253 let mut out_out = VipsImage::from(null_mut());
15254 let vips_op_response = call(
15255 "shrinkh",
15256 VOption::new()
15257 .set("in", self)
15258 .set(
15259 "out",
15260 &mut out_out,
15261 )
15262 .set(
15263 "hshrink",
15264 hshrink,
15265 ),
15266 );
15267
15268 utils::result(
15269 vips_op_response,
15270 out_out,
15271 Error::OperationError("Shrinkh (vips_shrinkh) failed".to_string()),
15272 )
15273 }
15274
15275 /// VipsShrinkh (shrinkh), shrink an image horizontally
15276 /// returns `VipsImage` - Output image
15277 ///
15278 /// hshrink: `i32` -> Horizontal shrink factor
15279 ///
15280 /// <ins>Optional arguments</ins>
15281 ///
15282 /// ceil: `bool` -> Round-up output dimensions
15283 pub fn shrinkh_with_opts(&self, hshrink: i32, option: VOption) -> Result<VipsImage> {
15284 let mut out_out = VipsImage::from(null_mut());
15285 let vips_op_response = call(
15286 "shrinkh",
15287 option
15288 .set("in", self)
15289 .set(
15290 "out",
15291 &mut out_out,
15292 )
15293 .set(
15294 "hshrink",
15295 hshrink,
15296 ),
15297 );
15298
15299 utils::result(
15300 vips_op_response,
15301 out_out,
15302 Error::OperationError("Shrinkh (vips_shrinkh) failed".to_string()),
15303 )
15304 }
15305
15306 /// VipsShrinkv (shrinkv), shrink an image vertically
15307 /// returns `VipsImage` - Output image
15308 ///
15309 /// vshrink: `i32` -> Vertical shrink factor
15310 pub fn shrinkv(&self, vshrink: i32) -> Result<VipsImage> {
15311 let mut out_out = VipsImage::from(null_mut());
15312 let vips_op_response = call(
15313 "shrinkv",
15314 VOption::new()
15315 .set("in", self)
15316 .set(
15317 "out",
15318 &mut out_out,
15319 )
15320 .set(
15321 "vshrink",
15322 vshrink,
15323 ),
15324 );
15325
15326 utils::result(
15327 vips_op_response,
15328 out_out,
15329 Error::OperationError("Shrinkv (vips_shrinkv) failed".to_string()),
15330 )
15331 }
15332
15333 /// VipsShrinkv (shrinkv), shrink an image vertically
15334 /// returns `VipsImage` - Output image
15335 ///
15336 /// vshrink: `i32` -> Vertical shrink factor
15337 ///
15338 /// <ins>Optional arguments</ins>
15339 ///
15340 /// ceil: `bool` -> Round-up output dimensions
15341 pub fn shrinkv_with_opts(&self, vshrink: i32, option: VOption) -> Result<VipsImage> {
15342 let mut out_out = VipsImage::from(null_mut());
15343 let vips_op_response = call(
15344 "shrinkv",
15345 option
15346 .set("in", self)
15347 .set(
15348 "out",
15349 &mut out_out,
15350 )
15351 .set(
15352 "vshrink",
15353 vshrink,
15354 ),
15355 );
15356
15357 utils::result(
15358 vips_op_response,
15359 out_out,
15360 Error::OperationError("Shrinkv (vips_shrinkv) failed".to_string()),
15361 )
15362 }
15363
15364 /// VipsSign (sign), unit vector of pixel
15365 /// returns `VipsImage` - Output image
15366 pub fn sign(&self) -> Result<VipsImage> {
15367 let mut out_out = VipsImage::from(null_mut());
15368 let vips_op_response = call(
15369 "sign",
15370 VOption::new()
15371 .set("in", self)
15372 .set(
15373 "out",
15374 &mut out_out,
15375 ),
15376 );
15377
15378 utils::result(
15379 vips_op_response,
15380 out_out,
15381 Error::OperationError("Sign (vips_sign) failed".to_string()),
15382 )
15383 }
15384
15385 /// VipsSimilarity (similarity), similarity transform of an image
15386 /// returns `VipsImage` - Output image
15387 pub fn similarity(&self) -> Result<VipsImage> {
15388 let mut out_out = VipsImage::from(null_mut());
15389 let vips_op_response = call(
15390 "similarity",
15391 VOption::new()
15392 .set("in", self)
15393 .set(
15394 "out",
15395 &mut out_out,
15396 ),
15397 );
15398
15399 utils::result(
15400 vips_op_response,
15401 out_out,
15402 Error::OperationError("Similarity (vips_similarity) failed".to_string()),
15403 )
15404 }
15405
15406 /// VipsSimilarity (similarity), similarity transform of an image
15407 /// returns `VipsImage` - Output image
15408 ///
15409 /// <ins>Optional arguments</ins>
15410 ///
15411 /// scale: `f64` -> Scale by this factor
15412 ///
15413 /// angle: `f64` -> Rotate clockwise by this many degrees
15414 ///
15415 /// interpolate: `&VipsInterpolate` -> Interpolate pixels with this
15416 ///
15417 /// background: `&[f64]` -> Background value
15418 ///
15419 /// odx: `f64` -> Horizontal output displacement
15420 ///
15421 /// ody: `f64` -> Vertical output displacement
15422 ///
15423 /// idx: `f64` -> Horizontal input displacement
15424 ///
15425 /// idy: `f64` -> Vertical input displacement
15426 pub fn similarity_with_opts(&self, option: VOption) -> Result<VipsImage> {
15427 let mut out_out = VipsImage::from(null_mut());
15428 let vips_op_response = call(
15429 "similarity",
15430 option
15431 .set("in", self)
15432 .set(
15433 "out",
15434 &mut out_out,
15435 ),
15436 );
15437
15438 utils::result(
15439 vips_op_response,
15440 out_out,
15441 Error::OperationError("Similarity (vips_similarity) failed".to_string()),
15442 )
15443 }
15444
15445 /// VipsSines (sines), make a 2D sine wave
15446 /// returns `VipsImage` - Output image
15447 ///
15448 /// width: `i32` -> Image width in pixels
15449 ///
15450 /// height: `i32` -> Image height in pixels
15451 pub fn sines(width: i32, height: i32) -> Result<VipsImage> {
15452 let mut out_out = VipsImage::from(null_mut());
15453 let vips_op_response = call(
15454 "sines",
15455 VOption::new()
15456 .set(
15457 "out",
15458 &mut out_out,
15459 )
15460 .set(
15461 "width",
15462 width,
15463 )
15464 .set(
15465 "height",
15466 height,
15467 ),
15468 );
15469
15470 utils::result(
15471 vips_op_response,
15472 out_out,
15473 Error::OperationError("Sines (vips_sines) failed".to_string()),
15474 )
15475 }
15476
15477 /// VipsSines (sines), make a 2D sine wave
15478 /// returns `VipsImage` - Output image
15479 ///
15480 /// width: `i32` -> Image width in pixels
15481 ///
15482 /// height: `i32` -> Image height in pixels
15483 ///
15484 /// <ins>Optional arguments</ins>
15485 ///
15486 /// uchar: `bool` -> Output an unsigned char image
15487 ///
15488 /// hfreq: `f64` -> Horizontal spatial frequency
15489 ///
15490 /// vfreq: `f64` -> Vertical spatial frequency
15491 pub fn sines_with_opts(width: i32, height: i32, option: VOption) -> Result<VipsImage> {
15492 let mut out_out = VipsImage::from(null_mut());
15493 let vips_op_response = call(
15494 "sines",
15495 option
15496 .set(
15497 "out",
15498 &mut out_out,
15499 )
15500 .set(
15501 "width",
15502 width,
15503 )
15504 .set(
15505 "height",
15506 height,
15507 ),
15508 );
15509
15510 utils::result(
15511 vips_op_response,
15512 out_out,
15513 Error::OperationError("Sines (vips_sines) failed".to_string()),
15514 )
15515 }
15516
15517 /// VipsSmartcrop (smartcrop), extract an area from an image
15518 /// returns `VipsImage` - Output image
15519 ///
15520 /// width: `i32` -> Width of extract area
15521 ///
15522 /// height: `i32` -> Height of extract area
15523 pub fn smartcrop(&self, width: i32, height: i32) -> Result<VipsImage> {
15524 let mut out_out = VipsImage::from(null_mut());
15525 let vips_op_response = call(
15526 "smartcrop",
15527 VOption::new()
15528 .set(
15529 "input",
15530 self,
15531 )
15532 .set(
15533 "out",
15534 &mut out_out,
15535 )
15536 .set(
15537 "width",
15538 width,
15539 )
15540 .set(
15541 "height",
15542 height,
15543 ),
15544 );
15545
15546 utils::result(
15547 vips_op_response,
15548 out_out,
15549 Error::OperationError("Smartcrop (vips_smartcrop) failed".to_string()),
15550 )
15551 }
15552
15553 /// VipsSmartcrop (smartcrop), extract an area from an image
15554 /// returns `VipsImage` - Output image
15555 ///
15556 /// width: `i32` -> Width of extract area
15557 ///
15558 /// height: `i32` -> Height of extract area
15559 ///
15560 /// <ins>Optional arguments</ins>
15561 ///
15562 /// attention_x: `&mut i32` -> Horizontal position of attention centre
15563 ///
15564 /// attention_y: `&mut i32` -> Vertical position of attention centre
15565 ///
15566 /// interesting: [`Interesting`] -> How to measure interestingness
15567 ///
15568 /// premultiplied: `bool` -> Input image already has premultiplied alpha
15569 pub fn smartcrop_with_opts(
15570 &self,
15571 width: i32,
15572 height: i32,
15573 option: VOption,
15574 ) -> Result<VipsImage> {
15575 let mut out_out = VipsImage::from(null_mut());
15576 let vips_op_response = call(
15577 "smartcrop",
15578 option
15579 .set(
15580 "input",
15581 self,
15582 )
15583 .set(
15584 "out",
15585 &mut out_out,
15586 )
15587 .set(
15588 "width",
15589 width,
15590 )
15591 .set(
15592 "height",
15593 height,
15594 ),
15595 );
15596
15597 utils::result(
15598 vips_op_response,
15599 out_out,
15600 Error::OperationError("Smartcrop (vips_smartcrop) failed".to_string()),
15601 )
15602 }
15603
15604 /// VipsSobel (sobel), Sobel edge detector
15605 /// returns `VipsImage` - Output image
15606 pub fn sobel(&self) -> Result<VipsImage> {
15607 let mut out_out = VipsImage::from(null_mut());
15608 let vips_op_response = call(
15609 "sobel",
15610 VOption::new()
15611 .set("in", self)
15612 .set(
15613 "out",
15614 &mut out_out,
15615 ),
15616 );
15617
15618 utils::result(
15619 vips_op_response,
15620 out_out,
15621 Error::OperationError("Sobel (vips_sobel) failed".to_string()),
15622 )
15623 }
15624
15625 /// VipsSpcor (spcor), spatial correlation
15626 /// returns `VipsImage` - Output image
15627 ///
15628 /// refp: `&VipsImage` -> Input reference image
15629 pub fn spcor(&self, refp: &VipsImage) -> Result<VipsImage> {
15630 let mut out_out = VipsImage::from(null_mut());
15631 let vips_op_response = call(
15632 "spcor",
15633 VOption::new()
15634 .set("in", self)
15635 .set(
15636 "ref", refp,
15637 )
15638 .set(
15639 "out",
15640 &mut out_out,
15641 ),
15642 );
15643
15644 utils::result(
15645 vips_op_response,
15646 out_out,
15647 Error::OperationError("Spcor (vips_spcor) failed".to_string()),
15648 )
15649 }
15650
15651 /// VipsSpectrum (spectrum), make displayable power spectrum
15652 /// returns `VipsImage` - Output image
15653 pub fn spectrum(&self) -> Result<VipsImage> {
15654 let mut out_out = VipsImage::from(null_mut());
15655 let vips_op_response = call(
15656 "spectrum",
15657 VOption::new()
15658 .set("in", self)
15659 .set(
15660 "out",
15661 &mut out_out,
15662 ),
15663 );
15664
15665 utils::result(
15666 vips_op_response,
15667 out_out,
15668 Error::OperationError("Spectrum (vips_spectrum) failed".to_string()),
15669 )
15670 }
15671
15672 /// VipsStats (stats), find many image stats
15673 /// returns `VipsImage` - Output array of statistics
15674 pub fn stats(&self) -> Result<VipsImage> {
15675 let mut out_out = VipsImage::from(null_mut());
15676 let vips_op_response = call(
15677 "stats",
15678 VOption::new()
15679 .set("in", self)
15680 .set(
15681 "out",
15682 &mut out_out,
15683 ),
15684 );
15685
15686 utils::result(
15687 vips_op_response,
15688 out_out,
15689 Error::OperationError("Stats (vips_stats) failed".to_string()),
15690 )
15691 }
15692
15693 /// VipsStdif (stdif), statistical difference
15694 /// returns `VipsImage` - Output image
15695 ///
15696 /// width: `i32` -> Window width in pixels
15697 ///
15698 /// height: `i32` -> Window height in pixels
15699 pub fn stdif(&self, width: i32, height: i32) -> Result<VipsImage> {
15700 let mut out_out = VipsImage::from(null_mut());
15701 let vips_op_response = call(
15702 "stdif",
15703 VOption::new()
15704 .set("in", self)
15705 .set(
15706 "out",
15707 &mut out_out,
15708 )
15709 .set(
15710 "width",
15711 width,
15712 )
15713 .set(
15714 "height",
15715 height,
15716 ),
15717 );
15718
15719 utils::result(
15720 vips_op_response,
15721 out_out,
15722 Error::OperationError("Stdif (vips_stdif) failed".to_string()),
15723 )
15724 }
15725
15726 /// VipsStdif (stdif), statistical difference
15727 /// returns `VipsImage` - Output image
15728 ///
15729 /// width: `i32` -> Window width in pixels
15730 ///
15731 /// height: `i32` -> Window height in pixels
15732 ///
15733 /// <ins>Optional arguments</ins>
15734 ///
15735 /// s0: `f64` -> New deviation
15736 ///
15737 /// b: `f64` -> Weight of new deviation
15738 ///
15739 /// m0: `f64` -> New mean
15740 ///
15741 /// a: `f64` -> Weight of new mean
15742 pub fn stdif_with_opts(&self, width: i32, height: i32, option: VOption) -> Result<VipsImage> {
15743 let mut out_out = VipsImage::from(null_mut());
15744 let vips_op_response = call(
15745 "stdif",
15746 option
15747 .set("in", self)
15748 .set(
15749 "out",
15750 &mut out_out,
15751 )
15752 .set(
15753 "width",
15754 width,
15755 )
15756 .set(
15757 "height",
15758 height,
15759 ),
15760 );
15761
15762 utils::result(
15763 vips_op_response,
15764 out_out,
15765 Error::OperationError("Stdif (vips_stdif) failed".to_string()),
15766 )
15767 }
15768
15769 /// VipsSubsample (subsample), subsample an image
15770 /// returns `VipsImage` - Output image
15771 ///
15772 /// xfac: `i32` -> Horizontal subsample factor
15773 ///
15774 /// yfac: `i32` -> Vertical subsample factor
15775 pub fn subsample(&self, xfac: i32, yfac: i32) -> Result<VipsImage> {
15776 let mut out_out = VipsImage::from(null_mut());
15777 let vips_op_response = call(
15778 "subsample",
15779 VOption::new()
15780 .set(
15781 "input",
15782 self,
15783 )
15784 .set(
15785 "out",
15786 &mut out_out,
15787 )
15788 .set(
15789 "xfac",
15790 xfac,
15791 )
15792 .set(
15793 "yfac",
15794 yfac,
15795 ),
15796 );
15797
15798 utils::result(
15799 vips_op_response,
15800 out_out,
15801 Error::OperationError("Subsample (vips_subsample) failed".to_string()),
15802 )
15803 }
15804
15805 /// VipsSubsample (subsample), subsample an image
15806 /// returns `VipsImage` - Output image
15807 ///
15808 /// xfac: `i32` -> Horizontal subsample factor
15809 ///
15810 /// yfac: `i32` -> Vertical subsample factor
15811 ///
15812 /// <ins>Optional arguments</ins>
15813 ///
15814 /// point: `bool` -> Point sample
15815 pub fn subsample_with_opts(&self, xfac: i32, yfac: i32, option: VOption) -> Result<VipsImage> {
15816 let mut out_out = VipsImage::from(null_mut());
15817 let vips_op_response = call(
15818 "subsample",
15819 option
15820 .set(
15821 "input",
15822 self,
15823 )
15824 .set(
15825 "out",
15826 &mut out_out,
15827 )
15828 .set(
15829 "xfac",
15830 xfac,
15831 )
15832 .set(
15833 "yfac",
15834 yfac,
15835 ),
15836 );
15837
15838 utils::result(
15839 vips_op_response,
15840 out_out,
15841 Error::OperationError("Subsample (vips_subsample) failed".to_string()),
15842 )
15843 }
15844
15845 /// VipsSubtract (subtract), subtract two images
15846 /// returns `VipsImage` - Output image
15847 ///
15848 /// right: `&VipsImage` -> Right-hand image argument
15849 pub fn subtract(&self, right: &VipsImage) -> Result<VipsImage> {
15850 let mut out_out = VipsImage::from(null_mut());
15851 let vips_op_response = call(
15852 "subtract",
15853 VOption::new()
15854 .set(
15855 "left",
15856 self,
15857 )
15858 .set(
15859 "right",
15860 right,
15861 )
15862 .set(
15863 "out",
15864 &mut out_out,
15865 ),
15866 );
15867
15868 utils::result(
15869 vips_op_response,
15870 out_out,
15871 Error::OperationError("Subtract (vips_subtract) failed".to_string()),
15872 )
15873 }
15874
15875 /// VipsSum (sum), sum an array of images
15876 /// returns `VipsImage` - Output image
15877 ///
15878 /// inp: `&[VipsImage]` -> Array of input images
15879 pub fn sum(inp: &[VipsImage]) -> Result<VipsImage> {
15880 let mut out_out = VipsImage::from(null_mut());
15881 let vips_op_response = call(
15882 "sum",
15883 VOption::new()
15884 .set("in", inp)
15885 .set(
15886 "out",
15887 &mut out_out,
15888 ),
15889 );
15890
15891 utils::result(
15892 vips_op_response,
15893 out_out,
15894 Error::OperationError("Sum (vips_sum) failed".to_string()),
15895 )
15896 }
15897
15898 /// VipsForeignLoadSvgFile (svgload), load SVG with rsvg (.svg, .svgz, .svg.gz), priority=-5, untrusted, is_a, get_flags, get_flags_filename, header, load
15899 /// returns `VipsImage` - Output image
15900 ///
15901 /// filename: `&str` -> Filename to load from
15902 pub fn svgload(filename: &str) -> Result<VipsImage> {
15903 let mut out_out = VipsImage::from(null_mut());
15904 let vips_op_response = call(
15905 "svgload",
15906 VOption::new()
15907 .set(
15908 "filename",
15909 filename,
15910 )
15911 .set(
15912 "out",
15913 &mut out_out,
15914 ),
15915 );
15916
15917 utils::result(
15918 vips_op_response,
15919 out_out,
15920 Error::OperationError("Svgload (vips_svgload) failed".to_string()),
15921 )
15922 }
15923
15924 /// VipsForeignLoadSvgFile (svgload), load SVG with rsvg (.svg, .svgz, .svg.gz), priority=-5, untrusted, is_a, get_flags, get_flags_filename, header, load
15925 /// returns `VipsImage` - Output image
15926 ///
15927 /// filename: `&str` -> Filename to load from
15928 ///
15929 /// <ins>Optional arguments</ins>
15930 ///
15931 /// dpi: `f64` -> Render at this DPI
15932 ///
15933 /// scale: `f64` -> Scale output by this factor
15934 ///
15935 /// unlimited: `bool` -> Allow SVG of any size
15936 ///
15937 /// stylesheet: `&str` -> Custom CSS
15938 ///
15939 /// high_bitdepth: `bool` -> Enable scRGB 128-bit output (32-bit per channel)
15940 ///
15941 /// flags: [`ForeignFlags`] -> Flags for this file
15942 ///
15943 /// memory: `bool` -> Force open via memory
15944 ///
15945 /// access: [`Access`] -> Required access pattern for this file
15946 ///
15947 /// fail_on: [`FailOn`] -> Error level to fail on
15948 ///
15949 /// revalidate: `bool` -> Don't use a cached result for this operation
15950 pub fn svgload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
15951 let mut out_out = VipsImage::from(null_mut());
15952 let vips_op_response = call(
15953 "svgload",
15954 option
15955 .set(
15956 "filename",
15957 filename,
15958 )
15959 .set(
15960 "out",
15961 &mut out_out,
15962 ),
15963 );
15964
15965 utils::result(
15966 vips_op_response,
15967 out_out,
15968 Error::OperationError("Svgload (vips_svgload) failed".to_string()),
15969 )
15970 }
15971
15972 /// VipsForeignLoadSvgBuffer (svgload_buffer), load SVG with rsvg, priority=-5, untrusted, is_a_buffer, get_flags, get_flags_filename, header, load
15973 /// returns `VipsImage` - Output image
15974 ///
15975 /// buffer: `&[u8]` -> Buffer to load from
15976 pub fn svgload_buffer(buffer: &[u8]) -> Result<VipsImage> {
15977 let vips_blob = unsafe {
15978 vips_blob_new(
15979 None,
15980 buffer.as_ptr() as _,
15981 buffer.len() as _,
15982 )
15983 };
15984 let blob = VipsBlob::from(vips_blob);
15985 let mut out_out = VipsImage::from(null_mut());
15986 let vips_op_response = call(
15987 "svgload_buffer",
15988 VOption::new()
15989 .set(
15990 "buffer",
15991 &blob,
15992 )
15993 .set(
15994 "out",
15995 &mut out_out,
15996 ),
15997 );
15998 blob.area_unref();
15999 utils::result(
16000 vips_op_response,
16001 out_out,
16002 Error::OperationError("SvgloadBuffer (vips_svgload_buffer) failed".to_string()),
16003 )
16004 }
16005
16006 /// VipsForeignLoadSvgBuffer (svgload_buffer), load SVG with rsvg, priority=-5, untrusted, is_a_buffer, get_flags, get_flags_filename, header, load
16007 /// returns `VipsImage` - Output image
16008 ///
16009 /// buffer: `&[u8]` -> Buffer to load from
16010 ///
16011 /// <ins>Optional arguments</ins>
16012 ///
16013 /// dpi: `f64` -> Render at this DPI
16014 ///
16015 /// scale: `f64` -> Scale output by this factor
16016 ///
16017 /// unlimited: `bool` -> Allow SVG of any size
16018 ///
16019 /// stylesheet: `&str` -> Custom CSS
16020 ///
16021 /// high_bitdepth: `bool` -> Enable scRGB 128-bit output (32-bit per channel)
16022 ///
16023 /// flags: [`ForeignFlags`] -> Flags for this file
16024 ///
16025 /// memory: `bool` -> Force open via memory
16026 ///
16027 /// access: [`Access`] -> Required access pattern for this file
16028 ///
16029 /// fail_on: [`FailOn`] -> Error level to fail on
16030 ///
16031 /// revalidate: `bool` -> Don't use a cached result for this operation
16032 pub fn svgload_buffer_with_opts(buffer: &[u8], option: VOption) -> Result<VipsImage> {
16033 let vips_blob = unsafe {
16034 vips_blob_new(
16035 None,
16036 buffer.as_ptr() as _,
16037 buffer.len() as _,
16038 )
16039 };
16040 let blob = VipsBlob::from(vips_blob);
16041 let mut out_out = VipsImage::from(null_mut());
16042 let vips_op_response = call(
16043 "svgload_buffer",
16044 option
16045 .set(
16046 "buffer",
16047 &blob,
16048 )
16049 .set(
16050 "out",
16051 &mut out_out,
16052 ),
16053 );
16054 blob.area_unref();
16055 utils::result(
16056 vips_op_response,
16057 out_out,
16058 Error::OperationError("SvgloadBuffer (vips_svgload_buffer) failed".to_string()),
16059 )
16060 }
16061
16062 /// VipsForeignLoadSvgSource (svgload_source), load svg from source, priority=-5, untrusted, is_a_source, get_flags, get_flags_filename, header, load
16063 /// returns `VipsImage` - Output image
16064 ///
16065 /// source: `&VipsSource` -> Source to load from
16066 pub fn svgload_source(source: &VipsSource) -> Result<VipsImage> {
16067 let mut out_out = VipsImage::from(null_mut());
16068 let vips_op_response = call(
16069 "svgload_source",
16070 VOption::new()
16071 .set(
16072 "source",
16073 source,
16074 )
16075 .set(
16076 "out",
16077 &mut out_out,
16078 ),
16079 );
16080
16081 utils::result(
16082 vips_op_response,
16083 out_out,
16084 Error::OperationError("SvgloadSource (vips_svgload_source) failed".to_string()),
16085 )
16086 }
16087
16088 /// VipsForeignLoadSvgSource (svgload_source), load svg from source, priority=-5, untrusted, is_a_source, get_flags, get_flags_filename, header, load
16089 /// returns `VipsImage` - Output image
16090 ///
16091 /// source: `&VipsSource` -> Source to load from
16092 ///
16093 /// <ins>Optional arguments</ins>
16094 ///
16095 /// dpi: `f64` -> Render at this DPI
16096 ///
16097 /// scale: `f64` -> Scale output by this factor
16098 ///
16099 /// unlimited: `bool` -> Allow SVG of any size
16100 ///
16101 /// stylesheet: `&str` -> Custom CSS
16102 ///
16103 /// high_bitdepth: `bool` -> Enable scRGB 128-bit output (32-bit per channel)
16104 ///
16105 /// flags: [`ForeignFlags`] -> Flags for this file
16106 ///
16107 /// memory: `bool` -> Force open via memory
16108 ///
16109 /// access: [`Access`] -> Required access pattern for this file
16110 ///
16111 /// fail_on: [`FailOn`] -> Error level to fail on
16112 ///
16113 /// revalidate: `bool` -> Don't use a cached result for this operation
16114 pub fn svgload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
16115 let mut out_out = VipsImage::from(null_mut());
16116 let vips_op_response = call(
16117 "svgload_source",
16118 option
16119 .set(
16120 "source",
16121 source,
16122 )
16123 .set(
16124 "out",
16125 &mut out_out,
16126 ),
16127 );
16128
16129 utils::result(
16130 vips_op_response,
16131 out_out,
16132 Error::OperationError("SvgloadSource (vips_svgload_source) failed".to_string()),
16133 )
16134 }
16135
16136 /// VipsSwitch (switch), find the index of the first non-zero pixel in tests
16137 /// returns `VipsImage` - Output image
16138 ///
16139 /// tests: `&[VipsImage]` -> Table of images to test
16140 pub fn switch(tests: &[VipsImage]) -> Result<VipsImage> {
16141 let mut out_out = VipsImage::from(null_mut());
16142 let vips_op_response = call(
16143 "switch",
16144 VOption::new()
16145 .set(
16146 "tests",
16147 tests,
16148 )
16149 .set(
16150 "out",
16151 &mut out_out,
16152 ),
16153 );
16154
16155 utils::result(
16156 vips_op_response,
16157 out_out,
16158 Error::OperationError("Switch (vips_switch) failed".to_string()),
16159 )
16160 }
16161
16162 /// VipsSystem (system), run an external command
16163 ///
16164 /// cmd_format: `&str` -> Command to run
16165 pub fn system(cmd_format: &str) -> Result<()> {
16166 let vips_op_response = call(
16167 "system",
16168 VOption::new().set(
16169 "cmd-format",
16170 cmd_format,
16171 ),
16172 );
16173
16174 utils::result(
16175 vips_op_response,
16176 (),
16177 Error::OperationError("System (vips_system) failed".to_string()),
16178 )
16179 }
16180
16181 /// VipsSystem (system), run an external command
16182 ///
16183 /// cmd_format: `&str` -> Command to run
16184 ///
16185 /// <ins>Optional arguments</ins>
16186 ///
16187 /// inp: `&[VipsImage]` -> Array of input images
16188 ///
16189 /// out: `&mut VipsImage` -> Output image
16190 ///
16191 /// log: `&str` -> Command log
16192 ///
16193 /// out_format: `&str` -> Format for output filename
16194 ///
16195 /// in_format: `&str` -> Format for input filename
16196 pub fn system_with_opts(cmd_format: &str, option: VOption) -> Result<()> {
16197 let vips_op_response = call(
16198 "system",
16199 option.set(
16200 "cmd-format",
16201 cmd_format,
16202 ),
16203 );
16204
16205 utils::result(
16206 vips_op_response,
16207 (),
16208 Error::OperationError("System (vips_system) failed".to_string()),
16209 )
16210 }
16211
16212 /// VipsText (text), make a text image
16213 /// returns `VipsImage` - Output image
16214 ///
16215 /// text: `&str` -> Text to render
16216 pub fn text(text: &str) -> Result<VipsImage> {
16217 let mut out_out = VipsImage::from(null_mut());
16218 let vips_op_response = call(
16219 "text",
16220 VOption::new()
16221 .set(
16222 "out",
16223 &mut out_out,
16224 )
16225 .set(
16226 "text",
16227 text,
16228 ),
16229 );
16230
16231 utils::result(
16232 vips_op_response,
16233 out_out,
16234 Error::OperationError("Text (vips_text) failed".to_string()),
16235 )
16236 }
16237
16238 /// VipsText (text), make a text image
16239 /// returns `VipsImage` - Output image
16240 ///
16241 /// text: `&str` -> Text to render
16242 ///
16243 /// <ins>Optional arguments</ins>
16244 ///
16245 /// font: `&str` -> Font to render with
16246 ///
16247 /// width: `i32` -> Maximum image width in pixels
16248 ///
16249 /// height: `i32` -> Maximum image height in pixels
16250 ///
16251 /// align: [`Align`] -> Align on the low, centre or high edge
16252 ///
16253 /// justify: `bool` -> Justify lines
16254 ///
16255 /// dpi: `i32` -> DPI to render at
16256 ///
16257 /// autofit_dpi: `&mut i32` -> DPI selected by autofit
16258 ///
16259 /// spacing: `i32` -> Line spacing
16260 ///
16261 /// fontfile: `&str` -> Load this font file
16262 ///
16263 /// rgba: `bool` -> Enable RGBA output
16264 ///
16265 /// wrap: [`TextWrap`] -> Wrap lines on word or character boundaries
16266 pub fn text_with_opts(text: &str, option: VOption) -> Result<VipsImage> {
16267 let mut out_out = VipsImage::from(null_mut());
16268 let vips_op_response = call(
16269 "text",
16270 option
16271 .set(
16272 "out",
16273 &mut out_out,
16274 )
16275 .set(
16276 "text",
16277 text,
16278 ),
16279 );
16280
16281 utils::result(
16282 vips_op_response,
16283 out_out,
16284 Error::OperationError("Text (vips_text) failed".to_string()),
16285 )
16286 }
16287
16288 /// VipsThumbnailFile (thumbnail), generate thumbnail from file
16289 /// returns `VipsImage` - Output image
16290 ///
16291 /// filename: `&str` -> Filename to read from
16292 ///
16293 /// width: `i32` -> Size to this width
16294 pub fn thumbnail(filename: &str, width: i32) -> Result<VipsImage> {
16295 let mut out_out = VipsImage::from(null_mut());
16296 let vips_op_response = call(
16297 "thumbnail",
16298 VOption::new()
16299 .set(
16300 "filename",
16301 filename,
16302 )
16303 .set(
16304 "out",
16305 &mut out_out,
16306 )
16307 .set(
16308 "width",
16309 width,
16310 ),
16311 );
16312
16313 utils::result(
16314 vips_op_response,
16315 out_out,
16316 Error::OperationError("Thumbnail (vips_thumbnail) failed".to_string()),
16317 )
16318 }
16319
16320 /// VipsThumbnailFile (thumbnail), generate thumbnail from file
16321 /// returns `VipsImage` - Output image
16322 ///
16323 /// filename: `&str` -> Filename to read from
16324 ///
16325 /// width: `i32` -> Size to this width
16326 ///
16327 /// <ins>Optional arguments</ins>
16328 ///
16329 /// height: `i32` -> Size to this height
16330 ///
16331 /// size: [`Size`] -> Only upsize, only downsize, or both
16332 ///
16333 /// no_rotate: `bool` -> Don't use orientation tags to rotate image upright
16334 ///
16335 /// crop: [`Interesting`] -> Reduce to fill target rectangle, then crop
16336 ///
16337 /// linear: `bool` -> Reduce in linear light
16338 ///
16339 /// input_profile: `&str` -> Fallback input profile
16340 ///
16341 /// output_profile: `&str` -> Fallback output profile
16342 ///
16343 /// intent: [`Intent`] -> Rendering intent
16344 ///
16345 /// fail_on: [`FailOn`] -> Error level to fail on
16346 pub fn thumbnail_with_opts(filename: &str, width: i32, option: VOption) -> Result<VipsImage> {
16347 let mut out_out = VipsImage::from(null_mut());
16348 let vips_op_response = call(
16349 "thumbnail",
16350 option
16351 .set(
16352 "filename",
16353 filename,
16354 )
16355 .set(
16356 "out",
16357 &mut out_out,
16358 )
16359 .set(
16360 "width",
16361 width,
16362 ),
16363 );
16364
16365 utils::result(
16366 vips_op_response,
16367 out_out,
16368 Error::OperationError("Thumbnail (vips_thumbnail) failed".to_string()),
16369 )
16370 }
16371
16372 /// VipsThumbnailBuffer (thumbnail_buffer), generate thumbnail from buffer
16373 /// returns `VipsImage` - Output image
16374 ///
16375 /// buffer: `&[u8]` -> Buffer to load from
16376 ///
16377 /// width: `i32` -> Size to this width
16378 pub fn thumbnail_buffer(buffer: &[u8], width: i32) -> Result<VipsImage> {
16379 let vips_blob = unsafe {
16380 vips_blob_new(
16381 None,
16382 buffer.as_ptr() as _,
16383 buffer.len() as _,
16384 )
16385 };
16386 let blob = VipsBlob::from(vips_blob);
16387 let mut out_out = VipsImage::from(null_mut());
16388 let vips_op_response = call(
16389 "thumbnail_buffer",
16390 VOption::new()
16391 .set(
16392 "buffer",
16393 &blob,
16394 )
16395 .set(
16396 "out",
16397 &mut out_out,
16398 )
16399 .set(
16400 "width",
16401 width,
16402 ),
16403 );
16404 blob.area_unref();
16405 utils::result(
16406 vips_op_response,
16407 out_out,
16408 Error::OperationError("ThumbnailBuffer (vips_thumbnail_buffer) failed".to_string()),
16409 )
16410 }
16411
16412 /// VipsThumbnailBuffer (thumbnail_buffer), generate thumbnail from buffer
16413 /// returns `VipsImage` - Output image
16414 ///
16415 /// buffer: `&[u8]` -> Buffer to load from
16416 ///
16417 /// width: `i32` -> Size to this width
16418 ///
16419 /// <ins>Optional arguments</ins>
16420 ///
16421 /// option_string: `&str` -> Options that are passed on to the underlying loader
16422 ///
16423 /// height: `i32` -> Size to this height
16424 ///
16425 /// size: [`Size`] -> Only upsize, only downsize, or both
16426 ///
16427 /// no_rotate: `bool` -> Don't use orientation tags to rotate image upright
16428 ///
16429 /// crop: [`Interesting`] -> Reduce to fill target rectangle, then crop
16430 ///
16431 /// linear: `bool` -> Reduce in linear light
16432 ///
16433 /// input_profile: `&str` -> Fallback input profile
16434 ///
16435 /// output_profile: `&str` -> Fallback output profile
16436 ///
16437 /// intent: [`Intent`] -> Rendering intent
16438 ///
16439 /// fail_on: [`FailOn`] -> Error level to fail on
16440 pub fn thumbnail_buffer_with_opts(
16441 buffer: &[u8],
16442 width: i32,
16443 option: VOption,
16444 ) -> Result<VipsImage> {
16445 let vips_blob = unsafe {
16446 vips_blob_new(
16447 None,
16448 buffer.as_ptr() as _,
16449 buffer.len() as _,
16450 )
16451 };
16452 let blob = VipsBlob::from(vips_blob);
16453 let mut out_out = VipsImage::from(null_mut());
16454 let vips_op_response = call(
16455 "thumbnail_buffer",
16456 option
16457 .set(
16458 "buffer",
16459 &blob,
16460 )
16461 .set(
16462 "out",
16463 &mut out_out,
16464 )
16465 .set(
16466 "width",
16467 width,
16468 ),
16469 );
16470 blob.area_unref();
16471 utils::result(
16472 vips_op_response,
16473 out_out,
16474 Error::OperationError("ThumbnailBuffer (vips_thumbnail_buffer) failed".to_string()),
16475 )
16476 }
16477
16478 /// VipsThumbnailImage (thumbnail_image), generate thumbnail from image
16479 /// returns `VipsImage` - Output image
16480 ///
16481 /// width: `i32` -> Size to this width
16482 pub fn thumbnail_image(&self, width: i32) -> Result<VipsImage> {
16483 let mut out_out = VipsImage::from(null_mut());
16484 let vips_op_response = call(
16485 "thumbnail_image",
16486 VOption::new()
16487 .set("in", self)
16488 .set(
16489 "out",
16490 &mut out_out,
16491 )
16492 .set(
16493 "width",
16494 width,
16495 ),
16496 );
16497
16498 utils::result(
16499 vips_op_response,
16500 out_out,
16501 Error::OperationError("ThumbnailImage (vips_thumbnail_image) failed".to_string()),
16502 )
16503 }
16504
16505 /// VipsThumbnailImage (thumbnail_image), generate thumbnail from image
16506 /// returns `VipsImage` - Output image
16507 ///
16508 /// width: `i32` -> Size to this width
16509 ///
16510 /// <ins>Optional arguments</ins>
16511 ///
16512 /// height: `i32` -> Size to this height
16513 ///
16514 /// size: [`Size`] -> Only upsize, only downsize, or both
16515 ///
16516 /// no_rotate: `bool` -> Don't use orientation tags to rotate image upright
16517 ///
16518 /// crop: [`Interesting`] -> Reduce to fill target rectangle, then crop
16519 ///
16520 /// linear: `bool` -> Reduce in linear light
16521 ///
16522 /// input_profile: `&str` -> Fallback input profile
16523 ///
16524 /// output_profile: `&str` -> Fallback output profile
16525 ///
16526 /// intent: [`Intent`] -> Rendering intent
16527 ///
16528 /// fail_on: [`FailOn`] -> Error level to fail on
16529 pub fn thumbnail_image_with_opts(&self, width: i32, option: VOption) -> Result<VipsImage> {
16530 let mut out_out = VipsImage::from(null_mut());
16531 let vips_op_response = call(
16532 "thumbnail_image",
16533 option
16534 .set("in", self)
16535 .set(
16536 "out",
16537 &mut out_out,
16538 )
16539 .set(
16540 "width",
16541 width,
16542 ),
16543 );
16544
16545 utils::result(
16546 vips_op_response,
16547 out_out,
16548 Error::OperationError("ThumbnailImage (vips_thumbnail_image) failed".to_string()),
16549 )
16550 }
16551
16552 /// VipsThumbnailSource (thumbnail_source), generate thumbnail from source
16553 /// returns `VipsImage` - Output image
16554 ///
16555 /// source: `&VipsSource` -> Source to load from
16556 ///
16557 /// width: `i32` -> Size to this width
16558 pub fn thumbnail_source(source: &VipsSource, width: i32) -> Result<VipsImage> {
16559 let mut out_out = VipsImage::from(null_mut());
16560 let vips_op_response = call(
16561 "thumbnail_source",
16562 VOption::new()
16563 .set(
16564 "source",
16565 source,
16566 )
16567 .set(
16568 "out",
16569 &mut out_out,
16570 )
16571 .set(
16572 "width",
16573 width,
16574 ),
16575 );
16576
16577 utils::result(
16578 vips_op_response,
16579 out_out,
16580 Error::OperationError("ThumbnailSource (vips_thumbnail_source) failed".to_string()),
16581 )
16582 }
16583
16584 /// VipsThumbnailSource (thumbnail_source), generate thumbnail from source
16585 /// returns `VipsImage` - Output image
16586 ///
16587 /// source: `&VipsSource` -> Source to load from
16588 ///
16589 /// width: `i32` -> Size to this width
16590 ///
16591 /// <ins>Optional arguments</ins>
16592 ///
16593 /// option_string: `&str` -> Options that are passed on to the underlying loader
16594 ///
16595 /// height: `i32` -> Size to this height
16596 ///
16597 /// size: [`Size`] -> Only upsize, only downsize, or both
16598 ///
16599 /// no_rotate: `bool` -> Don't use orientation tags to rotate image upright
16600 ///
16601 /// crop: [`Interesting`] -> Reduce to fill target rectangle, then crop
16602 ///
16603 /// linear: `bool` -> Reduce in linear light
16604 ///
16605 /// input_profile: `&str` -> Fallback input profile
16606 ///
16607 /// output_profile: `&str` -> Fallback output profile
16608 ///
16609 /// intent: [`Intent`] -> Rendering intent
16610 ///
16611 /// fail_on: [`FailOn`] -> Error level to fail on
16612 pub fn thumbnail_source_with_opts(
16613 source: &VipsSource,
16614 width: i32,
16615 option: VOption,
16616 ) -> Result<VipsImage> {
16617 let mut out_out = VipsImage::from(null_mut());
16618 let vips_op_response = call(
16619 "thumbnail_source",
16620 option
16621 .set(
16622 "source",
16623 source,
16624 )
16625 .set(
16626 "out",
16627 &mut out_out,
16628 )
16629 .set(
16630 "width",
16631 width,
16632 ),
16633 );
16634
16635 utils::result(
16636 vips_op_response,
16637 out_out,
16638 Error::OperationError("ThumbnailSource (vips_thumbnail_source) 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 pub fn tiffload(filename: &str) -> Result<VipsImage> {
16647 let mut out_out = VipsImage::from(null_mut());
16648 let vips_op_response = call(
16649 "tiffload",
16650 VOption::new()
16651 .set(
16652 "filename",
16653 filename,
16654 )
16655 .set(
16656 "out",
16657 &mut out_out,
16658 ),
16659 );
16660
16661 utils::result(
16662 vips_op_response,
16663 out_out,
16664 Error::OperationError("Tiffload (vips_tiffload) failed".to_string()),
16665 )
16666 }
16667
16668 /// VipsForeignLoadTiffFile (tiffload), load tiff from file (.tif, .tiff), priority=50, is_a, get_flags, get_flags_filename, header, load
16669 /// returns `VipsImage` - Output image
16670 ///
16671 /// filename: `&str` -> Filename to load from
16672 ///
16673 /// <ins>Optional arguments</ins>
16674 ///
16675 /// page: `i32` -> First page to load
16676 ///
16677 /// n: `i32` -> Number of pages to load, -1 for all
16678 ///
16679 /// autorotate: `bool` -> Rotate image using orientation tag
16680 ///
16681 /// subifd: `i32` -> Subifd index
16682 ///
16683 /// unlimited: `bool` -> Remove all denial of service limits
16684 ///
16685 /// flags: [`ForeignFlags`] -> Flags for this file
16686 ///
16687 /// memory: `bool` -> Force open via memory
16688 ///
16689 /// access: [`Access`] -> Required access pattern for this file
16690 ///
16691 /// fail_on: [`FailOn`] -> Error level to fail on
16692 ///
16693 /// revalidate: `bool` -> Don't use a cached result for this operation
16694 pub fn tiffload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
16695 let mut out_out = VipsImage::from(null_mut());
16696 let vips_op_response = call(
16697 "tiffload",
16698 option
16699 .set(
16700 "filename",
16701 filename,
16702 )
16703 .set(
16704 "out",
16705 &mut out_out,
16706 ),
16707 );
16708
16709 utils::result(
16710 vips_op_response,
16711 out_out,
16712 Error::OperationError("Tiffload (vips_tiffload) failed".to_string()),
16713 )
16714 }
16715
16716 /// VipsForeignLoadTiffBuffer (tiffload_buffer), load tiff from buffer, priority=50, is_a_buffer, get_flags, get_flags_filename, header, load
16717 /// returns `VipsImage` - Output image
16718 ///
16719 /// buffer: `&[u8]` -> Buffer to load from
16720 pub fn tiffload_buffer(buffer: &[u8]) -> Result<VipsImage> {
16721 let vips_blob = unsafe {
16722 vips_blob_new(
16723 None,
16724 buffer.as_ptr() as _,
16725 buffer.len() as _,
16726 )
16727 };
16728 let blob = VipsBlob::from(vips_blob);
16729 let mut out_out = VipsImage::from(null_mut());
16730 let vips_op_response = call(
16731 "tiffload_buffer",
16732 VOption::new()
16733 .set(
16734 "buffer",
16735 &blob,
16736 )
16737 .set(
16738 "out",
16739 &mut out_out,
16740 ),
16741 );
16742 blob.area_unref();
16743 utils::result(
16744 vips_op_response,
16745 out_out,
16746 Error::OperationError("TiffloadBuffer (vips_tiffload_buffer) failed".to_string()),
16747 )
16748 }
16749
16750 /// VipsForeignLoadTiffBuffer (tiffload_buffer), load tiff from buffer, priority=50, is_a_buffer, get_flags, get_flags_filename, header, load
16751 /// returns `VipsImage` - Output image
16752 ///
16753 /// buffer: `&[u8]` -> Buffer to load from
16754 ///
16755 /// <ins>Optional arguments</ins>
16756 ///
16757 /// page: `i32` -> First page to load
16758 ///
16759 /// n: `i32` -> Number of pages to load, -1 for all
16760 ///
16761 /// autorotate: `bool` -> Rotate image using orientation tag
16762 ///
16763 /// subifd: `i32` -> Subifd index
16764 ///
16765 /// unlimited: `bool` -> Remove all denial of service limits
16766 ///
16767 /// flags: [`ForeignFlags`] -> Flags for this file
16768 ///
16769 /// memory: `bool` -> Force open via memory
16770 ///
16771 /// access: [`Access`] -> Required access pattern for this file
16772 ///
16773 /// fail_on: [`FailOn`] -> Error level to fail on
16774 ///
16775 /// revalidate: `bool` -> Don't use a cached result for this operation
16776 pub fn tiffload_buffer_with_opts(buffer: &[u8], option: VOption) -> Result<VipsImage> {
16777 let vips_blob = unsafe {
16778 vips_blob_new(
16779 None,
16780 buffer.as_ptr() as _,
16781 buffer.len() as _,
16782 )
16783 };
16784 let blob = VipsBlob::from(vips_blob);
16785 let mut out_out = VipsImage::from(null_mut());
16786 let vips_op_response = call(
16787 "tiffload_buffer",
16788 option
16789 .set(
16790 "buffer",
16791 &blob,
16792 )
16793 .set(
16794 "out",
16795 &mut out_out,
16796 ),
16797 );
16798 blob.area_unref();
16799 utils::result(
16800 vips_op_response,
16801 out_out,
16802 Error::OperationError("TiffloadBuffer (vips_tiffload_buffer) failed".to_string()),
16803 )
16804 }
16805
16806 /// VipsForeignLoadTiffSource (tiffload_source), load tiff from source, priority=50, is_a_source, get_flags, get_flags_filename, header, load
16807 /// returns `VipsImage` - Output image
16808 ///
16809 /// source: `&VipsSource` -> Source to load from
16810 pub fn tiffload_source(source: &VipsSource) -> Result<VipsImage> {
16811 let mut out_out = VipsImage::from(null_mut());
16812 let vips_op_response = call(
16813 "tiffload_source",
16814 VOption::new()
16815 .set(
16816 "source",
16817 source,
16818 )
16819 .set(
16820 "out",
16821 &mut out_out,
16822 ),
16823 );
16824
16825 utils::result(
16826 vips_op_response,
16827 out_out,
16828 Error::OperationError("TiffloadSource (vips_tiffload_source) failed".to_string()),
16829 )
16830 }
16831
16832 /// VipsForeignLoadTiffSource (tiffload_source), load tiff from source, priority=50, is_a_source, get_flags, get_flags_filename, header, load
16833 /// returns `VipsImage` - Output image
16834 ///
16835 /// source: `&VipsSource` -> Source to load from
16836 ///
16837 /// <ins>Optional arguments</ins>
16838 ///
16839 /// page: `i32` -> First page to load
16840 ///
16841 /// n: `i32` -> Number of pages to load, -1 for all
16842 ///
16843 /// autorotate: `bool` -> Rotate image using orientation tag
16844 ///
16845 /// subifd: `i32` -> Subifd index
16846 ///
16847 /// unlimited: `bool` -> Remove all denial of service limits
16848 ///
16849 /// flags: [`ForeignFlags`] -> Flags for this file
16850 ///
16851 /// memory: `bool` -> Force open via memory
16852 ///
16853 /// access: [`Access`] -> Required access pattern for this file
16854 ///
16855 /// fail_on: [`FailOn`] -> Error level to fail on
16856 ///
16857 /// revalidate: `bool` -> Don't use a cached result for this operation
16858 pub fn tiffload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
16859 let mut out_out = VipsImage::from(null_mut());
16860 let vips_op_response = call(
16861 "tiffload_source",
16862 option
16863 .set(
16864 "source",
16865 source,
16866 )
16867 .set(
16868 "out",
16869 &mut out_out,
16870 ),
16871 );
16872
16873 utils::result(
16874 vips_op_response,
16875 out_out,
16876 Error::OperationError("TiffloadSource (vips_tiffload_source) failed".to_string()),
16877 )
16878 }
16879
16880 /// VipsForeignSaveTiffFile (tiffsave), save image to tiff file (.tif, .tiff), priority=0,
16881 ///
16882 /// filename: `&str` -> Filename to save to
16883 pub fn tiffsave(&self, filename: &str) -> Result<()> {
16884 let vips_op_response = call(
16885 "tiffsave",
16886 VOption::new()
16887 .set("in", self)
16888 .set(
16889 "filename",
16890 filename,
16891 ),
16892 );
16893
16894 utils::result(
16895 vips_op_response,
16896 (),
16897 Error::OperationError("Tiffsave (vips_tiffsave) failed".to_string()),
16898 )
16899 }
16900
16901 /// VipsForeignSaveTiffFile (tiffsave), save image to tiff file (.tif, .tiff), priority=0,
16902 ///
16903 /// filename: `&str` -> Filename to save to
16904 ///
16905 /// <ins>Optional arguments</ins>
16906 ///
16907 /// compression: [`ForeignTiffCompression`] -> Compression for this file
16908 ///
16909 /// Q: `i32` -> Q factor
16910 ///
16911 /// predictor: [`ForeignTiffPredictor`] -> Compression prediction
16912 ///
16913 /// tile: `bool` -> Write a tiled tiff
16914 ///
16915 /// tile_width: `i32` -> Tile width in pixels
16916 ///
16917 /// tile_height: `i32` -> Tile height in pixels
16918 ///
16919 /// pyramid: `bool` -> Write a pyramidal tiff
16920 ///
16921 /// miniswhite: `bool` -> Use 0 for white in 1-bit images
16922 ///
16923 /// bitdepth: `i32` -> Write as a 1, 2, 4 or 8 bit image
16924 ///
16925 /// resunit: [`ForeignTiffResunit`] -> Resolution unit
16926 ///
16927 /// xres: `f64` -> Horizontal resolution in pixels/mm
16928 ///
16929 /// yres: `f64` -> Vertical resolution in pixels/mm
16930 ///
16931 /// bigtiff: `bool` -> Write a bigtiff image
16932 ///
16933 /// properties: `bool` -> Write a properties document to IMAGEDESCRIPTION
16934 ///
16935 /// region_shrink: [`RegionShrink`] -> Method to shrink regions
16936 ///
16937 /// level: `i32` -> Deflate (1-9, default 6) or ZSTD (1-22, default 9) compression level
16938 ///
16939 /// lossless: `bool` -> Enable WEBP lossless mode
16940 ///
16941 /// depth: [`ForeignDzDepth`] -> Pyramid depth
16942 ///
16943 /// subifd: `bool` -> Save pyr layers as sub-IFDs
16944 ///
16945 /// premultiply: `bool` -> Save with premultiplied alpha
16946 ///
16947 /// keep: [`ForeignKeep`] -> Which metadata to retain
16948 ///
16949 /// background: `&[f64]` -> Background value
16950 ///
16951 /// page_height: `i32` -> Set page height for multipage save
16952 ///
16953 /// profile: `&str` -> Filename of ICC profile to embed
16954 pub fn tiffsave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
16955 let vips_op_response = call(
16956 "tiffsave",
16957 option
16958 .set("in", self)
16959 .set(
16960 "filename",
16961 filename,
16962 ),
16963 );
16964
16965 utils::result(
16966 vips_op_response,
16967 (),
16968 Error::OperationError("Tiffsave (vips_tiffsave) failed".to_string()),
16969 )
16970 }
16971
16972 /// VipsForeignSaveTiffBuffer (tiffsave_buffer), save image to tiff buffer (.tif, .tiff), priority=0,
16973 /// returns `Vec<u8>` - Buffer to save to
16974 pub fn tiffsave_buffer(&self) -> Result<Vec<u8>> {
16975 let mut buffer_out = VipsBlob::from(null_mut());
16976 let vips_op_response = call(
16977 "tiffsave_buffer",
16978 VOption::new()
16979 .set("in", self)
16980 .set(
16981 "buffer",
16982 &mut buffer_out,
16983 ),
16984 );
16985
16986 utils::result(
16987 vips_op_response,
16988 buffer_out.into(),
16989 Error::OperationError("TiffsaveBuffer (vips_tiffsave_buffer) failed".to_string()),
16990 )
16991 }
16992
16993 /// VipsForeignSaveTiffBuffer (tiffsave_buffer), save image to tiff buffer (.tif, .tiff), priority=0,
16994 /// returns `Vec<u8>` - Buffer to save to
16995 ///
16996 /// <ins>Optional arguments</ins>
16997 ///
16998 /// compression: [`ForeignTiffCompression`] -> Compression for this file
16999 ///
17000 /// Q: `i32` -> Q factor
17001 ///
17002 /// predictor: [`ForeignTiffPredictor`] -> Compression prediction
17003 ///
17004 /// tile: `bool` -> Write a tiled tiff
17005 ///
17006 /// tile_width: `i32` -> Tile width in pixels
17007 ///
17008 /// tile_height: `i32` -> Tile height in pixels
17009 ///
17010 /// pyramid: `bool` -> Write a pyramidal tiff
17011 ///
17012 /// miniswhite: `bool` -> Use 0 for white in 1-bit images
17013 ///
17014 /// bitdepth: `i32` -> Write as a 1, 2, 4 or 8 bit image
17015 ///
17016 /// resunit: [`ForeignTiffResunit`] -> Resolution unit
17017 ///
17018 /// xres: `f64` -> Horizontal resolution in pixels/mm
17019 ///
17020 /// yres: `f64` -> Vertical resolution in pixels/mm
17021 ///
17022 /// bigtiff: `bool` -> Write a bigtiff image
17023 ///
17024 /// properties: `bool` -> Write a properties document to IMAGEDESCRIPTION
17025 ///
17026 /// region_shrink: [`RegionShrink`] -> Method to shrink regions
17027 ///
17028 /// level: `i32` -> Deflate (1-9, default 6) or ZSTD (1-22, default 9) compression level
17029 ///
17030 /// lossless: `bool` -> Enable WEBP lossless mode
17031 ///
17032 /// depth: [`ForeignDzDepth`] -> Pyramid depth
17033 ///
17034 /// subifd: `bool` -> Save pyr layers as sub-IFDs
17035 ///
17036 /// premultiply: `bool` -> Save with premultiplied alpha
17037 ///
17038 /// keep: [`ForeignKeep`] -> Which metadata to retain
17039 ///
17040 /// background: `&[f64]` -> Background value
17041 ///
17042 /// page_height: `i32` -> Set page height for multipage save
17043 ///
17044 /// profile: `&str` -> Filename of ICC profile to embed
17045 pub fn tiffsave_buffer_with_opts(&self, option: VOption) -> Result<Vec<u8>> {
17046 let mut buffer_out = VipsBlob::from(null_mut());
17047 let vips_op_response = call(
17048 "tiffsave_buffer",
17049 option
17050 .set("in", self)
17051 .set(
17052 "buffer",
17053 &mut buffer_out,
17054 ),
17055 );
17056
17057 utils::result(
17058 vips_op_response,
17059 buffer_out.into(),
17060 Error::OperationError("TiffsaveBuffer (vips_tiffsave_buffer) failed".to_string()),
17061 )
17062 }
17063
17064 /// VipsForeignSaveTiffTarget (tiffsave_target), save image to tiff target (.tif, .tiff), priority=0,
17065 ///
17066 /// target: `&VipsTarget` -> Target to save to
17067 pub fn tiffsave_target(&self, target: &VipsTarget) -> Result<()> {
17068 let vips_op_response = call(
17069 "tiffsave_target",
17070 VOption::new()
17071 .set("in", self)
17072 .set(
17073 "target",
17074 target,
17075 ),
17076 );
17077
17078 utils::result(
17079 vips_op_response,
17080 (),
17081 Error::OperationError("TiffsaveTarget (vips_tiffsave_target) failed".to_string()),
17082 )
17083 }
17084
17085 /// VipsForeignSaveTiffTarget (tiffsave_target), save image to tiff target (.tif, .tiff), priority=0,
17086 ///
17087 /// target: `&VipsTarget` -> Target to save to
17088 ///
17089 /// <ins>Optional arguments</ins>
17090 ///
17091 /// compression: [`ForeignTiffCompression`] -> Compression for this file
17092 ///
17093 /// Q: `i32` -> Q factor
17094 ///
17095 /// predictor: [`ForeignTiffPredictor`] -> Compression prediction
17096 ///
17097 /// tile: `bool` -> Write a tiled tiff
17098 ///
17099 /// tile_width: `i32` -> Tile width in pixels
17100 ///
17101 /// tile_height: `i32` -> Tile height in pixels
17102 ///
17103 /// pyramid: `bool` -> Write a pyramidal tiff
17104 ///
17105 /// miniswhite: `bool` -> Use 0 for white in 1-bit images
17106 ///
17107 /// bitdepth: `i32` -> Write as a 1, 2, 4 or 8 bit image
17108 ///
17109 /// resunit: [`ForeignTiffResunit`] -> Resolution unit
17110 ///
17111 /// xres: `f64` -> Horizontal resolution in pixels/mm
17112 ///
17113 /// yres: `f64` -> Vertical resolution in pixels/mm
17114 ///
17115 /// bigtiff: `bool` -> Write a bigtiff image
17116 ///
17117 /// properties: `bool` -> Write a properties document to IMAGEDESCRIPTION
17118 ///
17119 /// region_shrink: [`RegionShrink`] -> Method to shrink regions
17120 ///
17121 /// level: `i32` -> Deflate (1-9, default 6) or ZSTD (1-22, default 9) compression level
17122 ///
17123 /// lossless: `bool` -> Enable WEBP lossless mode
17124 ///
17125 /// depth: [`ForeignDzDepth`] -> Pyramid depth
17126 ///
17127 /// subifd: `bool` -> Save pyr layers as sub-IFDs
17128 ///
17129 /// premultiply: `bool` -> Save with premultiplied alpha
17130 ///
17131 /// keep: [`ForeignKeep`] -> Which metadata to retain
17132 ///
17133 /// background: `&[f64]` -> Background value
17134 ///
17135 /// page_height: `i32` -> Set page height for multipage save
17136 ///
17137 /// profile: `&str` -> Filename of ICC profile to embed
17138 pub fn tiffsave_target_with_opts(&self, target: &VipsTarget, option: VOption) -> Result<()> {
17139 let vips_op_response = call(
17140 "tiffsave_target",
17141 option
17142 .set("in", self)
17143 .set(
17144 "target",
17145 target,
17146 ),
17147 );
17148
17149 utils::result(
17150 vips_op_response,
17151 (),
17152 Error::OperationError("TiffsaveTarget (vips_tiffsave_target) failed".to_string()),
17153 )
17154 }
17155
17156 /// VipsTileCache (tilecache), cache an image as a set of tiles
17157 /// returns `VipsImage` - Output image
17158 pub fn tilecache(&self) -> Result<VipsImage> {
17159 let mut out_out = VipsImage::from(null_mut());
17160 let vips_op_response = call(
17161 "tilecache",
17162 VOption::new()
17163 .set("in", self)
17164 .set(
17165 "out",
17166 &mut out_out,
17167 ),
17168 );
17169
17170 utils::result(
17171 vips_op_response,
17172 out_out,
17173 Error::OperationError("Tilecache (vips_tilecache) failed".to_string()),
17174 )
17175 }
17176
17177 /// VipsTileCache (tilecache), cache an image as a set of tiles
17178 /// returns `VipsImage` - Output image
17179 ///
17180 /// <ins>Optional arguments</ins>
17181 ///
17182 /// tile_width: `i32` -> Tile width in pixels
17183 ///
17184 /// tile_height: `i32` -> Tile height in pixels
17185 ///
17186 /// max_tiles: `i32` -> Maximum number of tiles to cache
17187 ///
17188 /// access: [`Access`] -> Expected access pattern
17189 ///
17190 /// threaded: `bool` -> Allow threaded access
17191 ///
17192 /// persistent: `bool` -> Keep cache between evaluations
17193 pub fn tilecache_with_opts(&self, option: VOption) -> Result<VipsImage> {
17194 let mut out_out = VipsImage::from(null_mut());
17195 let vips_op_response = call(
17196 "tilecache",
17197 option
17198 .set("in", self)
17199 .set(
17200 "out",
17201 &mut out_out,
17202 ),
17203 );
17204
17205 utils::result(
17206 vips_op_response,
17207 out_out,
17208 Error::OperationError("Tilecache (vips_tilecache) failed".to_string()),
17209 )
17210 }
17211
17212 /// VipsTonelut (tonelut), build a look-up table
17213 /// returns `VipsImage` - Output image
17214 pub fn tonelut() -> Result<VipsImage> {
17215 let mut out_out = VipsImage::from(null_mut());
17216 let vips_op_response = call(
17217 "tonelut",
17218 VOption::new().set(
17219 "out",
17220 &mut out_out,
17221 ),
17222 );
17223
17224 utils::result(
17225 vips_op_response,
17226 out_out,
17227 Error::OperationError("Tonelut (vips_tonelut) failed".to_string()),
17228 )
17229 }
17230
17231 /// VipsTonelut (tonelut), build a look-up table
17232 /// returns `VipsImage` - Output image
17233 ///
17234 /// <ins>Optional arguments</ins>
17235 ///
17236 /// in_max: `i32` -> Size of LUT to build
17237 ///
17238 /// out_max: `i32` -> Maximum value in output LUT
17239 ///
17240 /// Lb: `f64` -> Lowest value in output
17241 ///
17242 /// Lw: `f64` -> Highest value in output
17243 ///
17244 /// Ps: `f64` -> Position of shadow
17245 ///
17246 /// Pm: `f64` -> Position of mid-tones
17247 ///
17248 /// Ph: `f64` -> Position of highlights
17249 ///
17250 /// S: `f64` -> Adjust shadows by this much
17251 ///
17252 /// M: `f64` -> Adjust mid-tones by this much
17253 ///
17254 /// H: `f64` -> Adjust highlights by this much
17255 pub fn tonelut_with_opts(option: VOption) -> Result<VipsImage> {
17256 let mut out_out = VipsImage::from(null_mut());
17257 let vips_op_response = call(
17258 "tonelut",
17259 option.set(
17260 "out",
17261 &mut out_out,
17262 ),
17263 );
17264
17265 utils::result(
17266 vips_op_response,
17267 out_out,
17268 Error::OperationError("Tonelut (vips_tonelut) failed".to_string()),
17269 )
17270 }
17271
17272 /// VipsTranspose3d (transpose3d), transpose3d an image
17273 /// returns `VipsImage` - Output image
17274 pub fn transpose3d(&self) -> Result<VipsImage> {
17275 let mut out_out = VipsImage::from(null_mut());
17276 let vips_op_response = call(
17277 "transpose3d",
17278 VOption::new()
17279 .set("in", self)
17280 .set(
17281 "out",
17282 &mut out_out,
17283 ),
17284 );
17285
17286 utils::result(
17287 vips_op_response,
17288 out_out,
17289 Error::OperationError("Transpose3D (vips_transpose3d) failed".to_string()),
17290 )
17291 }
17292
17293 /// VipsTranspose3d (transpose3d), transpose3d an image
17294 /// returns `VipsImage` - Output image
17295 ///
17296 /// <ins>Optional arguments</ins>
17297 ///
17298 /// page_height: `i32` -> Height of each input page
17299 pub fn transpose3d_with_opts(&self, option: VOption) -> Result<VipsImage> {
17300 let mut out_out = VipsImage::from(null_mut());
17301 let vips_op_response = call(
17302 "transpose3d",
17303 option
17304 .set("in", self)
17305 .set(
17306 "out",
17307 &mut out_out,
17308 ),
17309 );
17310
17311 utils::result(
17312 vips_op_response,
17313 out_out,
17314 Error::OperationError("Transpose3D (vips_transpose3d) failed".to_string()),
17315 )
17316 }
17317
17318 /// VipsUnpremultiply (unpremultiply), unpremultiply image alpha
17319 /// returns `VipsImage` - Output image
17320 pub fn unpremultiply(&self) -> Result<VipsImage> {
17321 let mut out_out = VipsImage::from(null_mut());
17322 let vips_op_response = call(
17323 "unpremultiply",
17324 VOption::new()
17325 .set("in", self)
17326 .set(
17327 "out",
17328 &mut out_out,
17329 ),
17330 );
17331
17332 utils::result(
17333 vips_op_response,
17334 out_out,
17335 Error::OperationError("Unpremultiply (vips_unpremultiply) failed".to_string()),
17336 )
17337 }
17338
17339 /// VipsUnpremultiply (unpremultiply), unpremultiply image alpha
17340 /// returns `VipsImage` - Output image
17341 ///
17342 /// <ins>Optional arguments</ins>
17343 ///
17344 /// max_alpha: `f64` -> Maximum value of alpha channel
17345 ///
17346 /// alpha_band: `i32` -> Unpremultiply with this alpha
17347 pub fn unpremultiply_with_opts(&self, option: VOption) -> Result<VipsImage> {
17348 let mut out_out = VipsImage::from(null_mut());
17349 let vips_op_response = call(
17350 "unpremultiply",
17351 option
17352 .set("in", self)
17353 .set(
17354 "out",
17355 &mut out_out,
17356 ),
17357 );
17358
17359 utils::result(
17360 vips_op_response,
17361 out_out,
17362 Error::OperationError("Unpremultiply (vips_unpremultiply) failed".to_string()),
17363 )
17364 }
17365
17366 /// VipsForeignLoadVipsFile (vipsload), load vips from file (.v, .vips), priority=200, untrusted, is_a, get_flags, get_flags_filename, header
17367 /// returns `VipsImage` - Output image
17368 ///
17369 /// filename: `&str` -> Filename to load from
17370 pub fn vipsload(filename: &str) -> Result<VipsImage> {
17371 let mut out_out = VipsImage::from(null_mut());
17372 let vips_op_response = call(
17373 "vipsload",
17374 VOption::new()
17375 .set(
17376 "filename",
17377 filename,
17378 )
17379 .set(
17380 "out",
17381 &mut out_out,
17382 ),
17383 );
17384
17385 utils::result(
17386 vips_op_response,
17387 out_out,
17388 Error::OperationError("Vipsload (vips_vipsload) failed".to_string()),
17389 )
17390 }
17391
17392 /// VipsForeignLoadVipsFile (vipsload), load vips from file (.v, .vips), priority=200, untrusted, is_a, get_flags, get_flags_filename, header
17393 /// returns `VipsImage` - Output image
17394 ///
17395 /// filename: `&str` -> Filename to load from
17396 ///
17397 /// <ins>Optional arguments</ins>
17398 ///
17399 /// flags: [`ForeignFlags`] -> Flags for this file
17400 ///
17401 /// memory: `bool` -> Force open via memory
17402 ///
17403 /// access: [`Access`] -> Required access pattern for this file
17404 ///
17405 /// fail_on: [`FailOn`] -> Error level to fail on
17406 ///
17407 /// revalidate: `bool` -> Don't use a cached result for this operation
17408 pub fn vipsload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
17409 let mut out_out = VipsImage::from(null_mut());
17410 let vips_op_response = call(
17411 "vipsload",
17412 option
17413 .set(
17414 "filename",
17415 filename,
17416 )
17417 .set(
17418 "out",
17419 &mut out_out,
17420 ),
17421 );
17422
17423 utils::result(
17424 vips_op_response,
17425 out_out,
17426 Error::OperationError("Vipsload (vips_vipsload) failed".to_string()),
17427 )
17428 }
17429
17430 /// VipsForeignLoadVipsSource (vipsload_source), load vips from source, priority=200, untrusted, is_a_source, get_flags, get_flags_filename, header
17431 /// returns `VipsImage` - Output image
17432 ///
17433 /// source: `&VipsSource` -> Source to load from
17434 pub fn vipsload_source(source: &VipsSource) -> Result<VipsImage> {
17435 let mut out_out = VipsImage::from(null_mut());
17436 let vips_op_response = call(
17437 "vipsload_source",
17438 VOption::new()
17439 .set(
17440 "source",
17441 source,
17442 )
17443 .set(
17444 "out",
17445 &mut out_out,
17446 ),
17447 );
17448
17449 utils::result(
17450 vips_op_response,
17451 out_out,
17452 Error::OperationError("VipsloadSource (vips_vipsload_source) failed".to_string()),
17453 )
17454 }
17455
17456 /// VipsForeignLoadVipsSource (vipsload_source), load vips from source, priority=200, untrusted, is_a_source, get_flags, get_flags_filename, header
17457 /// returns `VipsImage` - Output image
17458 ///
17459 /// source: `&VipsSource` -> Source to load from
17460 ///
17461 /// <ins>Optional arguments</ins>
17462 ///
17463 /// flags: [`ForeignFlags`] -> Flags for this file
17464 ///
17465 /// memory: `bool` -> Force open via memory
17466 ///
17467 /// access: [`Access`] -> Required access pattern for this file
17468 ///
17469 /// fail_on: [`FailOn`] -> Error level to fail on
17470 ///
17471 /// revalidate: `bool` -> Don't use a cached result for this operation
17472 pub fn vipsload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
17473 let mut out_out = VipsImage::from(null_mut());
17474 let vips_op_response = call(
17475 "vipsload_source",
17476 option
17477 .set(
17478 "source",
17479 source,
17480 )
17481 .set(
17482 "out",
17483 &mut out_out,
17484 ),
17485 );
17486
17487 utils::result(
17488 vips_op_response,
17489 out_out,
17490 Error::OperationError("VipsloadSource (vips_vipsload_source) failed".to_string()),
17491 )
17492 }
17493
17494 /// VipsForeignSaveVipsFile (vipssave), save image to file in vips format (.v, .vips), priority=0,
17495 ///
17496 /// filename: `&str` -> Filename to save to
17497 pub fn vipssave(&self, filename: &str) -> Result<()> {
17498 let vips_op_response = call(
17499 "vipssave",
17500 VOption::new()
17501 .set("in", self)
17502 .set(
17503 "filename",
17504 filename,
17505 ),
17506 );
17507
17508 utils::result(
17509 vips_op_response,
17510 (),
17511 Error::OperationError("Vipssave (vips_vipssave) failed".to_string()),
17512 )
17513 }
17514
17515 /// VipsForeignSaveVipsFile (vipssave), save image to file in vips format (.v, .vips), priority=0,
17516 ///
17517 /// filename: `&str` -> Filename to save to
17518 ///
17519 /// <ins>Optional arguments</ins>
17520 ///
17521 /// keep: [`ForeignKeep`] -> Which metadata to retain
17522 ///
17523 /// background: `&[f64]` -> Background value
17524 ///
17525 /// page_height: `i32` -> Set page height for multipage save
17526 ///
17527 /// profile: `&str` -> Filename of ICC profile to embed
17528 pub fn vipssave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
17529 let vips_op_response = call(
17530 "vipssave",
17531 option
17532 .set("in", self)
17533 .set(
17534 "filename",
17535 filename,
17536 ),
17537 );
17538
17539 utils::result(
17540 vips_op_response,
17541 (),
17542 Error::OperationError("Vipssave (vips_vipssave) failed".to_string()),
17543 )
17544 }
17545
17546 /// VipsForeignSaveVipsTarget (vipssave_target), save image to target in vips format (.v, .vips), priority=0,
17547 ///
17548 /// target: `&VipsTarget` -> Target to save to
17549 pub fn vipssave_target(&self, target: &VipsTarget) -> Result<()> {
17550 let vips_op_response = call(
17551 "vipssave_target",
17552 VOption::new()
17553 .set("in", self)
17554 .set(
17555 "target",
17556 target,
17557 ),
17558 );
17559
17560 utils::result(
17561 vips_op_response,
17562 (),
17563 Error::OperationError("VipssaveTarget (vips_vipssave_target) failed".to_string()),
17564 )
17565 }
17566
17567 /// VipsForeignSaveVipsTarget (vipssave_target), save image to target in vips format (.v, .vips), priority=0,
17568 ///
17569 /// target: `&VipsTarget` -> Target to save to
17570 ///
17571 /// <ins>Optional arguments</ins>
17572 ///
17573 /// keep: [`ForeignKeep`] -> Which metadata to retain
17574 ///
17575 /// background: `&[f64]` -> Background value
17576 ///
17577 /// page_height: `i32` -> Set page height for multipage save
17578 ///
17579 /// profile: `&str` -> Filename of ICC profile to embed
17580 pub fn vipssave_target_with_opts(&self, target: &VipsTarget, option: VOption) -> Result<()> {
17581 let vips_op_response = call(
17582 "vipssave_target",
17583 option
17584 .set("in", self)
17585 .set(
17586 "target",
17587 target,
17588 ),
17589 );
17590
17591 utils::result(
17592 vips_op_response,
17593 (),
17594 Error::OperationError("VipssaveTarget (vips_vipssave_target) failed".to_string()),
17595 )
17596 }
17597
17598 /// VipsForeignLoadWebpFile (webpload), load webp from file (.webp), priority=200, is_a, get_flags, get_flags_filename, header, load
17599 /// returns `VipsImage` - Output image
17600 ///
17601 /// filename: `&str` -> Filename to load from
17602 pub fn webpload(filename: &str) -> Result<VipsImage> {
17603 let mut out_out = VipsImage::from(null_mut());
17604 let vips_op_response = call(
17605 "webpload",
17606 VOption::new()
17607 .set(
17608 "filename",
17609 filename,
17610 )
17611 .set(
17612 "out",
17613 &mut out_out,
17614 ),
17615 );
17616
17617 utils::result(
17618 vips_op_response,
17619 out_out,
17620 Error::OperationError("Webpload (vips_webpload) failed".to_string()),
17621 )
17622 }
17623
17624 /// VipsForeignLoadWebpFile (webpload), load webp from file (.webp), priority=200, is_a, get_flags, get_flags_filename, header, load
17625 /// returns `VipsImage` - Output image
17626 ///
17627 /// filename: `&str` -> Filename to load from
17628 ///
17629 /// <ins>Optional arguments</ins>
17630 ///
17631 /// page: `i32` -> First page to load
17632 ///
17633 /// n: `i32` -> Number of pages to load, -1 for all
17634 ///
17635 /// scale: `f64` -> Factor to scale by
17636 ///
17637 /// flags: [`ForeignFlags`] -> Flags for this file
17638 ///
17639 /// memory: `bool` -> Force open via memory
17640 ///
17641 /// access: [`Access`] -> Required access pattern for this file
17642 ///
17643 /// fail_on: [`FailOn`] -> Error level to fail on
17644 ///
17645 /// revalidate: `bool` -> Don't use a cached result for this operation
17646 pub fn webpload_with_opts(filename: &str, option: VOption) -> Result<VipsImage> {
17647 let mut out_out = VipsImage::from(null_mut());
17648 let vips_op_response = call(
17649 "webpload",
17650 option
17651 .set(
17652 "filename",
17653 filename,
17654 )
17655 .set(
17656 "out",
17657 &mut out_out,
17658 ),
17659 );
17660
17661 utils::result(
17662 vips_op_response,
17663 out_out,
17664 Error::OperationError("Webpload (vips_webpload) failed".to_string()),
17665 )
17666 }
17667
17668 /// VipsForeignLoadWebpBuffer (webpload_buffer), load webp from buffer, priority=200, is_a_buffer, get_flags, get_flags_filename, header, load
17669 /// returns `VipsImage` - Output image
17670 ///
17671 /// buffer: `&[u8]` -> Buffer to load from
17672 pub fn webpload_buffer(buffer: &[u8]) -> Result<VipsImage> {
17673 let vips_blob = unsafe {
17674 vips_blob_new(
17675 None,
17676 buffer.as_ptr() as _,
17677 buffer.len() as _,
17678 )
17679 };
17680 let blob = VipsBlob::from(vips_blob);
17681 let mut out_out = VipsImage::from(null_mut());
17682 let vips_op_response = call(
17683 "webpload_buffer",
17684 VOption::new()
17685 .set(
17686 "buffer",
17687 &blob,
17688 )
17689 .set(
17690 "out",
17691 &mut out_out,
17692 ),
17693 );
17694 blob.area_unref();
17695 utils::result(
17696 vips_op_response,
17697 out_out,
17698 Error::OperationError("WebploadBuffer (vips_webpload_buffer) failed".to_string()),
17699 )
17700 }
17701
17702 /// VipsForeignLoadWebpBuffer (webpload_buffer), load webp from buffer, priority=200, is_a_buffer, get_flags, get_flags_filename, header, load
17703 /// returns `VipsImage` - Output image
17704 ///
17705 /// buffer: `&[u8]` -> Buffer to load from
17706 ///
17707 /// <ins>Optional arguments</ins>
17708 ///
17709 /// page: `i32` -> First page to load
17710 ///
17711 /// n: `i32` -> Number of pages to load, -1 for all
17712 ///
17713 /// scale: `f64` -> Factor to scale by
17714 ///
17715 /// flags: [`ForeignFlags`] -> Flags for this file
17716 ///
17717 /// memory: `bool` -> Force open via memory
17718 ///
17719 /// access: [`Access`] -> Required access pattern for this file
17720 ///
17721 /// fail_on: [`FailOn`] -> Error level to fail on
17722 ///
17723 /// revalidate: `bool` -> Don't use a cached result for this operation
17724 pub fn webpload_buffer_with_opts(buffer: &[u8], option: VOption) -> Result<VipsImage> {
17725 let vips_blob = unsafe {
17726 vips_blob_new(
17727 None,
17728 buffer.as_ptr() as _,
17729 buffer.len() as _,
17730 )
17731 };
17732 let blob = VipsBlob::from(vips_blob);
17733 let mut out_out = VipsImage::from(null_mut());
17734 let vips_op_response = call(
17735 "webpload_buffer",
17736 option
17737 .set(
17738 "buffer",
17739 &blob,
17740 )
17741 .set(
17742 "out",
17743 &mut out_out,
17744 ),
17745 );
17746 blob.area_unref();
17747 utils::result(
17748 vips_op_response,
17749 out_out,
17750 Error::OperationError("WebploadBuffer (vips_webpload_buffer) failed".to_string()),
17751 )
17752 }
17753
17754 /// VipsForeignLoadWebpSource (webpload_source), load webp from source, priority=200, is_a_source, get_flags, get_flags_filename, header, load
17755 /// returns `VipsImage` - Output image
17756 ///
17757 /// source: `&VipsSource` -> Source to load from
17758 pub fn webpload_source(source: &VipsSource) -> Result<VipsImage> {
17759 let mut out_out = VipsImage::from(null_mut());
17760 let vips_op_response = call(
17761 "webpload_source",
17762 VOption::new()
17763 .set(
17764 "source",
17765 source,
17766 )
17767 .set(
17768 "out",
17769 &mut out_out,
17770 ),
17771 );
17772
17773 utils::result(
17774 vips_op_response,
17775 out_out,
17776 Error::OperationError("WebploadSource (vips_webpload_source) failed".to_string()),
17777 )
17778 }
17779
17780 /// VipsForeignLoadWebpSource (webpload_source), load webp from source, priority=200, is_a_source, get_flags, get_flags_filename, header, load
17781 /// returns `VipsImage` - Output image
17782 ///
17783 /// source: `&VipsSource` -> Source to load from
17784 ///
17785 /// <ins>Optional arguments</ins>
17786 ///
17787 /// page: `i32` -> First page to load
17788 ///
17789 /// n: `i32` -> Number of pages to load, -1 for all
17790 ///
17791 /// scale: `f64` -> Factor to scale by
17792 ///
17793 /// flags: [`ForeignFlags`] -> Flags for this file
17794 ///
17795 /// memory: `bool` -> Force open via memory
17796 ///
17797 /// access: [`Access`] -> Required access pattern for this file
17798 ///
17799 /// fail_on: [`FailOn`] -> Error level to fail on
17800 ///
17801 /// revalidate: `bool` -> Don't use a cached result for this operation
17802 pub fn webpload_source_with_opts(source: &VipsSource, option: VOption) -> Result<VipsImage> {
17803 let mut out_out = VipsImage::from(null_mut());
17804 let vips_op_response = call(
17805 "webpload_source",
17806 option
17807 .set(
17808 "source",
17809 source,
17810 )
17811 .set(
17812 "out",
17813 &mut out_out,
17814 ),
17815 );
17816
17817 utils::result(
17818 vips_op_response,
17819 out_out,
17820 Error::OperationError("WebploadSource (vips_webpload_source) failed".to_string()),
17821 )
17822 }
17823
17824 /// VipsForeignSaveWebpFile (webpsave), save as WebP (.webp), priority=0, rgb alpha
17825 ///
17826 /// filename: `&str` -> Filename to save to
17827 pub fn webpsave(&self, filename: &str) -> Result<()> {
17828 let vips_op_response = call(
17829 "webpsave",
17830 VOption::new()
17831 .set("in", self)
17832 .set(
17833 "filename",
17834 filename,
17835 ),
17836 );
17837
17838 utils::result(
17839 vips_op_response,
17840 (),
17841 Error::OperationError("Webpsave (vips_webpsave) failed".to_string()),
17842 )
17843 }
17844
17845 /// VipsForeignSaveWebpFile (webpsave), save as WebP (.webp), priority=0, rgb alpha
17846 ///
17847 /// filename: `&str` -> Filename to save to
17848 ///
17849 /// <ins>Optional arguments</ins>
17850 ///
17851 /// Q: `i32` -> Q factor
17852 ///
17853 /// lossless: `bool` -> Enable lossless compression
17854 ///
17855 /// preset: [`ForeignWebpPreset`] -> Preset for lossy compression
17856 ///
17857 /// smart_subsample: `bool` -> Enable high quality chroma subsampling
17858 ///
17859 /// near_lossless: `bool` -> Enable preprocessing in lossless mode (uses Q)
17860 ///
17861 /// alpha_q: `i32` -> Change alpha plane fidelity for lossy compression
17862 ///
17863 /// min_size: `bool` -> Optimise for minimum size
17864 ///
17865 /// kmin: `i32` -> Minimum number of frames between key frames
17866 ///
17867 /// kmax: `i32` -> Maximum number of frames between key frames
17868 ///
17869 /// effort: `i32` -> Level of CPU effort to reduce file size
17870 ///
17871 /// target_size: `i32` -> Desired target size in bytes
17872 ///
17873 /// mixed: `bool` -> Allow mixed encoding (might reduce file size)
17874 ///
17875 /// smart_deblock: `bool` -> Enable auto-adjusting of the deblocking filter
17876 ///
17877 /// passes: `i32` -> Number of entropy-analysis passes (in [1..10])
17878 ///
17879 /// keep: [`ForeignKeep`] -> Which metadata to retain
17880 ///
17881 /// background: `&[f64]` -> Background value
17882 ///
17883 /// page_height: `i32` -> Set page height for multipage save
17884 ///
17885 /// profile: `&str` -> Filename of ICC profile to embed
17886 pub fn webpsave_with_opts(&self, filename: &str, option: VOption) -> Result<()> {
17887 let vips_op_response = call(
17888 "webpsave",
17889 option
17890 .set("in", self)
17891 .set(
17892 "filename",
17893 filename,
17894 ),
17895 );
17896
17897 utils::result(
17898 vips_op_response,
17899 (),
17900 Error::OperationError("Webpsave (vips_webpsave) failed".to_string()),
17901 )
17902 }
17903
17904 /// VipsForeignSaveWebpBuffer (webpsave_buffer), save as WebP (.webp), priority=0, rgb alpha
17905 /// returns `Vec<u8>` - Buffer to save to
17906 pub fn webpsave_buffer(&self) -> Result<Vec<u8>> {
17907 let mut buffer_out = VipsBlob::from(null_mut());
17908 let vips_op_response = call(
17909 "webpsave_buffer",
17910 VOption::new()
17911 .set("in", self)
17912 .set(
17913 "buffer",
17914 &mut buffer_out,
17915 ),
17916 );
17917
17918 utils::result(
17919 vips_op_response,
17920 buffer_out.into(),
17921 Error::OperationError("WebpsaveBuffer (vips_webpsave_buffer) failed".to_string()),
17922 )
17923 }
17924
17925 /// VipsForeignSaveWebpBuffer (webpsave_buffer), save as WebP (.webp), priority=0, rgb alpha
17926 /// returns `Vec<u8>` - Buffer to save to
17927 ///
17928 /// <ins>Optional arguments</ins>
17929 ///
17930 /// Q: `i32` -> Q factor
17931 ///
17932 /// lossless: `bool` -> Enable lossless compression
17933 ///
17934 /// preset: [`ForeignWebpPreset`] -> Preset for lossy compression
17935 ///
17936 /// smart_subsample: `bool` -> Enable high quality chroma subsampling
17937 ///
17938 /// near_lossless: `bool` -> Enable preprocessing in lossless mode (uses Q)
17939 ///
17940 /// alpha_q: `i32` -> Change alpha plane fidelity for lossy compression
17941 ///
17942 /// min_size: `bool` -> Optimise for minimum size
17943 ///
17944 /// kmin: `i32` -> Minimum number of frames between key frames
17945 ///
17946 /// kmax: `i32` -> Maximum number of frames between key frames
17947 ///
17948 /// effort: `i32` -> Level of CPU effort to reduce file size
17949 ///
17950 /// target_size: `i32` -> Desired target size in bytes
17951 ///
17952 /// mixed: `bool` -> Allow mixed encoding (might reduce file size)
17953 ///
17954 /// smart_deblock: `bool` -> Enable auto-adjusting of the deblocking filter
17955 ///
17956 /// passes: `i32` -> Number of entropy-analysis passes (in [1..10])
17957 ///
17958 /// keep: [`ForeignKeep`] -> Which metadata to retain
17959 ///
17960 /// background: `&[f64]` -> Background value
17961 ///
17962 /// page_height: `i32` -> Set page height for multipage save
17963 ///
17964 /// profile: `&str` -> Filename of ICC profile to embed
17965 pub fn webpsave_buffer_with_opts(&self, option: VOption) -> Result<Vec<u8>> {
17966 let mut buffer_out = VipsBlob::from(null_mut());
17967 let vips_op_response = call(
17968 "webpsave_buffer",
17969 option
17970 .set("in", self)
17971 .set(
17972 "buffer",
17973 &mut buffer_out,
17974 ),
17975 );
17976
17977 utils::result(
17978 vips_op_response,
17979 buffer_out.into(),
17980 Error::OperationError("WebpsaveBuffer (vips_webpsave_buffer) failed".to_string()),
17981 )
17982 }
17983
17984 /// VipsForeignSaveWebpMime (webpsave_mime), save image to webp mime (.webp), priority=0, rgb alpha
17985 pub fn webpsave_mime(&self) -> Result<()> {
17986 let vips_op_response = call(
17987 "webpsave_mime",
17988 VOption::new().set("in", self),
17989 );
17990
17991 utils::result(
17992 vips_op_response,
17993 (),
17994 Error::OperationError("WebpsaveMime (vips_webpsave_mime) failed".to_string()),
17995 )
17996 }
17997
17998 /// VipsForeignSaveWebpMime (webpsave_mime), save image to webp mime (.webp), priority=0, rgb alpha
17999 ///
18000 /// <ins>Optional arguments</ins>
18001 ///
18002 /// Q: `i32` -> Q factor
18003 ///
18004 /// lossless: `bool` -> Enable lossless compression
18005 ///
18006 /// preset: [`ForeignWebpPreset`] -> Preset for lossy compression
18007 ///
18008 /// smart_subsample: `bool` -> Enable high quality chroma subsampling
18009 ///
18010 /// near_lossless: `bool` -> Enable preprocessing in lossless mode (uses Q)
18011 ///
18012 /// alpha_q: `i32` -> Change alpha plane fidelity for lossy compression
18013 ///
18014 /// min_size: `bool` -> Optimise for minimum size
18015 ///
18016 /// kmin: `i32` -> Minimum number of frames between key frames
18017 ///
18018 /// kmax: `i32` -> Maximum number of frames between key frames
18019 ///
18020 /// effort: `i32` -> Level of CPU effort to reduce file size
18021 ///
18022 /// target_size: `i32` -> Desired target size in bytes
18023 ///
18024 /// mixed: `bool` -> Allow mixed encoding (might reduce file size)
18025 ///
18026 /// smart_deblock: `bool` -> Enable auto-adjusting of the deblocking filter
18027 ///
18028 /// passes: `i32` -> Number of entropy-analysis passes (in [1..10])
18029 ///
18030 /// keep: [`ForeignKeep`] -> Which metadata to retain
18031 ///
18032 /// background: `&[f64]` -> Background value
18033 ///
18034 /// page_height: `i32` -> Set page height for multipage save
18035 ///
18036 /// profile: `&str` -> Filename of ICC profile to embed
18037 pub fn webpsave_mime_with_opts(&self, option: VOption) -> Result<()> {
18038 let vips_op_response = call(
18039 "webpsave_mime",
18040 option.set("in", self),
18041 );
18042
18043 utils::result(
18044 vips_op_response,
18045 (),
18046 Error::OperationError("WebpsaveMime (vips_webpsave_mime) failed".to_string()),
18047 )
18048 }
18049
18050 /// VipsForeignSaveWebpTarget (webpsave_target), save as WebP (.webp), priority=0, rgb alpha
18051 ///
18052 /// target: `&VipsTarget` -> Target to save to
18053 pub fn webpsave_target(&self, target: &VipsTarget) -> Result<()> {
18054 let vips_op_response = call(
18055 "webpsave_target",
18056 VOption::new()
18057 .set("in", self)
18058 .set(
18059 "target",
18060 target,
18061 ),
18062 );
18063
18064 utils::result(
18065 vips_op_response,
18066 (),
18067 Error::OperationError("WebpsaveTarget (vips_webpsave_target) failed".to_string()),
18068 )
18069 }
18070
18071 /// VipsForeignSaveWebpTarget (webpsave_target), save as WebP (.webp), priority=0, rgb alpha
18072 ///
18073 /// target: `&VipsTarget` -> Target to save to
18074 ///
18075 /// <ins>Optional arguments</ins>
18076 ///
18077 /// Q: `i32` -> Q factor
18078 ///
18079 /// lossless: `bool` -> Enable lossless compression
18080 ///
18081 /// preset: [`ForeignWebpPreset`] -> Preset for lossy compression
18082 ///
18083 /// smart_subsample: `bool` -> Enable high quality chroma subsampling
18084 ///
18085 /// near_lossless: `bool` -> Enable preprocessing in lossless mode (uses Q)
18086 ///
18087 /// alpha_q: `i32` -> Change alpha plane fidelity for lossy compression
18088 ///
18089 /// min_size: `bool` -> Optimise for minimum size
18090 ///
18091 /// kmin: `i32` -> Minimum number of frames between key frames
18092 ///
18093 /// kmax: `i32` -> Maximum number of frames between key frames
18094 ///
18095 /// effort: `i32` -> Level of CPU effort to reduce file size
18096 ///
18097 /// target_size: `i32` -> Desired target size in bytes
18098 ///
18099 /// mixed: `bool` -> Allow mixed encoding (might reduce file size)
18100 ///
18101 /// smart_deblock: `bool` -> Enable auto-adjusting of the deblocking filter
18102 ///
18103 /// passes: `i32` -> Number of entropy-analysis passes (in [1..10])
18104 ///
18105 /// keep: [`ForeignKeep`] -> Which metadata to retain
18106 ///
18107 /// background: `&[f64]` -> Background value
18108 ///
18109 /// page_height: `i32` -> Set page height for multipage save
18110 ///
18111 /// profile: `&str` -> Filename of ICC profile to embed
18112 pub fn webpsave_target_with_opts(&self, target: &VipsTarget, option: VOption) -> Result<()> {
18113 let vips_op_response = call(
18114 "webpsave_target",
18115 option
18116 .set("in", self)
18117 .set(
18118 "target",
18119 target,
18120 ),
18121 );
18122
18123 utils::result(
18124 vips_op_response,
18125 (),
18126 Error::OperationError("WebpsaveTarget (vips_webpsave_target) failed".to_string()),
18127 )
18128 }
18129
18130 /// VipsWorley (worley), make a worley noise image
18131 /// returns `VipsImage` - Output image
18132 ///
18133 /// width: `i32` -> Image width in pixels
18134 ///
18135 /// height: `i32` -> Image height in pixels
18136 pub fn worley(width: i32, height: i32) -> Result<VipsImage> {
18137 let mut out_out = VipsImage::from(null_mut());
18138 let vips_op_response = call(
18139 "worley",
18140 VOption::new()
18141 .set(
18142 "out",
18143 &mut out_out,
18144 )
18145 .set(
18146 "width",
18147 width,
18148 )
18149 .set(
18150 "height",
18151 height,
18152 ),
18153 );
18154
18155 utils::result(
18156 vips_op_response,
18157 out_out,
18158 Error::OperationError("Worley (vips_worley) failed".to_string()),
18159 )
18160 }
18161
18162 /// VipsWorley (worley), make a worley noise image
18163 /// returns `VipsImage` - Output image
18164 ///
18165 /// width: `i32` -> Image width in pixels
18166 ///
18167 /// height: `i32` -> Image height in pixels
18168 ///
18169 /// <ins>Optional arguments</ins>
18170 ///
18171 /// cell_size: `i32` -> Size of Worley cells
18172 ///
18173 /// seed: `i32` -> Random number seed
18174 pub fn worley_with_opts(width: i32, height: i32, option: VOption) -> Result<VipsImage> {
18175 let mut out_out = VipsImage::from(null_mut());
18176 let vips_op_response = call(
18177 "worley",
18178 option
18179 .set(
18180 "out",
18181 &mut out_out,
18182 )
18183 .set(
18184 "width",
18185 width,
18186 )
18187 .set(
18188 "height",
18189 height,
18190 ),
18191 );
18192
18193 utils::result(
18194 vips_op_response,
18195 out_out,
18196 Error::OperationError("Worley (vips_worley) failed".to_string()),
18197 )
18198 }
18199
18200 /// VipsWrap (wrap), wrap image origin
18201 /// returns `VipsImage` - Output image
18202 pub fn wrap(&self) -> Result<VipsImage> {
18203 let mut out_out = VipsImage::from(null_mut());
18204 let vips_op_response = call(
18205 "wrap",
18206 VOption::new()
18207 .set("in", self)
18208 .set(
18209 "out",
18210 &mut out_out,
18211 ),
18212 );
18213
18214 utils::result(
18215 vips_op_response,
18216 out_out,
18217 Error::OperationError("Wrap (vips_wrap) failed".to_string()),
18218 )
18219 }
18220
18221 /// VipsWrap (wrap), wrap image origin
18222 /// returns `VipsImage` - Output image
18223 ///
18224 /// <ins>Optional arguments</ins>
18225 ///
18226 /// x: `i32` -> Left edge of input in output
18227 ///
18228 /// y: `i32` -> Top edge of input in output
18229 pub fn wrap_with_opts(&self, option: VOption) -> Result<VipsImage> {
18230 let mut out_out = VipsImage::from(null_mut());
18231 let vips_op_response = call(
18232 "wrap",
18233 option
18234 .set("in", self)
18235 .set(
18236 "out",
18237 &mut out_out,
18238 ),
18239 );
18240
18241 utils::result(
18242 vips_op_response,
18243 out_out,
18244 Error::OperationError("Wrap (vips_wrap) failed".to_string()),
18245 )
18246 }
18247
18248 /// VipsXyz (xyz), make an image where pixel values are coordinates
18249 /// returns `VipsImage` - Output image
18250 ///
18251 /// width: `i32` -> Image width in pixels
18252 ///
18253 /// height: `i32` -> Image height in pixels
18254 pub fn xyz(width: i32, height: i32) -> Result<VipsImage> {
18255 let mut out_out = VipsImage::from(null_mut());
18256 let vips_op_response = call(
18257 "xyz",
18258 VOption::new()
18259 .set(
18260 "out",
18261 &mut out_out,
18262 )
18263 .set(
18264 "width",
18265 width,
18266 )
18267 .set(
18268 "height",
18269 height,
18270 ),
18271 );
18272
18273 utils::result(
18274 vips_op_response,
18275 out_out,
18276 Error::OperationError("Xyz (vips_xyz) failed".to_string()),
18277 )
18278 }
18279
18280 /// VipsXyz (xyz), make an image where pixel values are coordinates
18281 /// returns `VipsImage` - Output image
18282 ///
18283 /// width: `i32` -> Image width in pixels
18284 ///
18285 /// height: `i32` -> Image height in pixels
18286 ///
18287 /// <ins>Optional arguments</ins>
18288 ///
18289 /// csize: `i32` -> Size of third dimension
18290 ///
18291 /// dsize: `i32` -> Size of fourth dimension
18292 ///
18293 /// esize: `i32` -> Size of fifth dimension
18294 pub fn xyz_with_opts(width: i32, height: i32, option: VOption) -> Result<VipsImage> {
18295 let mut out_out = VipsImage::from(null_mut());
18296 let vips_op_response = call(
18297 "xyz",
18298 option
18299 .set(
18300 "out",
18301 &mut out_out,
18302 )
18303 .set(
18304 "width",
18305 width,
18306 )
18307 .set(
18308 "height",
18309 height,
18310 ),
18311 );
18312
18313 utils::result(
18314 vips_op_response,
18315 out_out,
18316 Error::OperationError("Xyz (vips_xyz) failed".to_string()),
18317 )
18318 }
18319
18320 /// VipsZone (zone), make a zone plate
18321 /// returns `VipsImage` - Output image
18322 ///
18323 /// width: `i32` -> Image width in pixels
18324 ///
18325 /// height: `i32` -> Image height in pixels
18326 pub fn zone(width: i32, height: i32) -> Result<VipsImage> {
18327 let mut out_out = VipsImage::from(null_mut());
18328 let vips_op_response = call(
18329 "zone",
18330 VOption::new()
18331 .set(
18332 "out",
18333 &mut out_out,
18334 )
18335 .set(
18336 "width",
18337 width,
18338 )
18339 .set(
18340 "height",
18341 height,
18342 ),
18343 );
18344
18345 utils::result(
18346 vips_op_response,
18347 out_out,
18348 Error::OperationError("Zone (vips_zone) failed".to_string()),
18349 )
18350 }
18351
18352 /// VipsZone (zone), make a zone plate
18353 /// returns `VipsImage` - Output image
18354 ///
18355 /// width: `i32` -> Image width in pixels
18356 ///
18357 /// height: `i32` -> Image height in pixels
18358 ///
18359 /// <ins>Optional arguments</ins>
18360 ///
18361 /// uchar: `bool` -> Output an unsigned char image
18362 pub fn zone_with_opts(width: i32, height: i32, option: VOption) -> Result<VipsImage> {
18363 let mut out_out = VipsImage::from(null_mut());
18364 let vips_op_response = call(
18365 "zone",
18366 option
18367 .set(
18368 "out",
18369 &mut out_out,
18370 )
18371 .set(
18372 "width",
18373 width,
18374 )
18375 .set(
18376 "height",
18377 height,
18378 ),
18379 );
18380
18381 utils::result(
18382 vips_op_response,
18383 out_out,
18384 Error::OperationError("Zone (vips_zone) failed".to_string()),
18385 )
18386 }
18387
18388 /// VipsZoom (zoom), zoom an image
18389 /// returns `VipsImage` - Output image
18390 ///
18391 /// xfac: `i32` -> Horizontal zoom factor
18392 ///
18393 /// yfac: `i32` -> Vertical zoom factor
18394 pub fn zoom(&self, xfac: i32, yfac: i32) -> Result<VipsImage> {
18395 let mut out_out = VipsImage::from(null_mut());
18396 let vips_op_response = call(
18397 "zoom",
18398 VOption::new()
18399 .set(
18400 "input",
18401 self,
18402 )
18403 .set(
18404 "out",
18405 &mut out_out,
18406 )
18407 .set(
18408 "xfac",
18409 xfac,
18410 )
18411 .set(
18412 "yfac",
18413 yfac,
18414 ),
18415 );
18416
18417 utils::result(
18418 vips_op_response,
18419 out_out,
18420 Error::OperationError("Zoom (vips_zoom) failed".to_string()),
18421 )
18422 }
18423
18424 // Alias for operator overload
18425 pub(crate) fn add_image(&self, right: &VipsImage) -> Result<VipsImage> {
18426 self.add(right)
18427 }
18428
18429 /// VipsBandjoin (bandjoin), bandwise join two images
18430 /// returns `VipsImage` - Output image
18431 ///
18432 /// other: `VipsImage` -> Input images
18433 pub fn bandjoin_with(self, other: VipsImage) -> Result<VipsImage> {
18434 Self::bandjoin(&[self, other])
18435 }
18436
18437 /// VipsMedian (median), median filter of the specified size.
18438 pub fn median(&self, size: i32) -> Result<VipsImage> {
18439 self.rank(
18440 size,
18441 size,
18442 (size * size) / 2,
18443 )
18444 }
18445}