-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvips.c
More file actions
673 lines (538 loc) · 17.7 KB
/
vips.c
File metadata and controls
673 lines (538 loc) · 17.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
#include "vips.h"
#include <stdio.h>
/* vips */
void
vipsimage_free(VipsImage *in) {
if (G_IS_OBJECT(in)) g_clear_object(&in);
}
/* VipsImage */
VipsImage *
vipsimage_image_new_from_file (const char *name) {
return vips_image_new_from_file(name, NULL);
}
VipsImage *
vipsimage_image_new_from_buffer (const void *buf, size_t len, const char *option_string) {
return vips_image_new_from_buffer(buf, len, option_string, NULL);
}
/* conversion */
int
vipsimage_replicate (VipsImage *in, VipsImage **out, int across, int down) {
return vips_replicate(in, out, across, down, NULL);
}
int
vipsimage_gravity (VipsImage *in, VipsImage **out, VipsCompassDirection direction, int width, int height) {
return vips_gravity(in, out, direction, width, height, NULL);
}
int
vipsimage_composite2 (VipsImage *base, VipsImage *overlay, VipsImage **out, VipsBlendMode mode, int x, int y) {
return vips_composite2(base, overlay, out, mode, "x", x, "y", y, NULL);
}
int
vipsimage_autorot (VipsImage *in, VipsImage **out) {
return vips_autorot(in, out, NULL);
}
int
vipsimage_embed (VipsImage *in, VipsImage **out, int x, int y, int width, int height) {
return vips_embed(in, out, x, y, width, height, NULL);
}
int
vipsimage_extract_area (VipsImage *in, VipsImage **out, int left, int top, int width, int height) {
return vips_extract_area(in, out, left, top, width, height, NULL);
}
int
vipsimage_crop (VipsImage *in, VipsImage **out, int left, int top, int width, int height) {
return vips_extract_area(in, out, left, top, width, height, NULL);
}
int
vipsimage_smartcrop (VipsImage *in, VipsImage **out, int width, int height) {
return vips_smartcrop(in, out, width, height, NULL);
}
int
vipsimage_flip (VipsImage *in, VipsImage **out, VipsDirection direction) {
return vips_flip(in, out, direction, NULL);
}
int
vipsimage_grid (VipsImage *in, VipsImage **out, int tile_height, int across, int down) {
return vips_grid(in, out, tile_height, across, down, NULL);
}
int
vipsimage_scale (VipsImage *in, VipsImage **out) {
return vips_scale(in, out, NULL);
}
int
vipsimage_subsample (VipsImage *in, VipsImage **out, int xfac, int yfac) {
return vips_subsample(in, out, xfac, yfac, NULL);
}
int
vipsimage_zoom (VipsImage *in, VipsImage **out, int xfac, int yfac) {
return vips_zoom(in, out, xfac, yfac, NULL);
}
int
vipsimage_wrap (VipsImage *in, VipsImage **out) {
return vips_wrap(in, out, NULL);
}
int
vipsimage_extract_band (VipsImage *in, VipsImage **out, int band) {
return vips_extract_band(in, out, band, NULL);
}
/* VipsForeignSave */
int
vipsimage_vipsload (const char *filename, VipsImage **out) {
return vips_vipsload(filename, out, NULL);
}
int
vipsimage_vipssave (VipsImage *in, const char *filename) {
return vips_vipssave(in, filename, NULL);
}
int
vipsimage_openslideload (const char *filename, VipsImage **out) {
return vips_openslideload(filename, out, NULL);
}
int
vipsimage_jpegload (const char *filename, VipsImage **out) {
return vips_jpegload(filename, out, NULL);
}
int
vipsimage_jpegload_buffer (void *buf, size_t len, VipsImage **out) {
return vips_jpegload_buffer(buf, len, out, NULL);
}
int
vipsimage_jpegsave (VipsImage *in, const char *filename) {
return vips_jpegsave(in, filename, NULL);
}
int
vipsimage_jpegsave_buffer (VipsImage *in, void **buf, size_t *len) {
return vips_jpegsave_buffer(in, buf, len, NULL);
}
int
vipsimage_jpegsave_mime (VipsImage *in) {
return vips_jpegsave_mime(in, NULL);
}
int
vipsimage_webpload (const char *filename, VipsImage **out) {
return vips_webpload(filename, out, NULL);
}
int
vipsimage_webpload_buffer (void *buf, size_t len, VipsImage **out) {
return vips_webpload_buffer(buf, len, out, NULL);
}
int
vipsimage_webpsave (VipsImage *in, const char *filename) {
return vips_webpsave(in, filename, NULL);
}
int
vipsimage_webpsave_buffer (VipsImage *in, void **buf, size_t *len) {
return vips_webpsave_buffer(in, buf, len, NULL);
}
int
vipsimage_webpsave_mime (VipsImage *in) {
return vips_webpsave_mime(in, NULL);
}
int
vipsimage_tiffload (const char *filename, VipsImage **out) {
return vips_tiffload(filename, out, NULL);
}
int
vipsimage_tiffload_buffer (void *buf, size_t len, VipsImage **out) {
return vips_tiffload_buffer(buf, len, out, NULL);
}
int
vipsimage_tiffsave (VipsImage *in, const char *filename) {
return vips_tiffsave(in, filename, NULL);
}
int
vipsimage_tiffsave_buffer (VipsImage *in, void **buf, size_t *len) {
return vips_tiffsave_buffer(in, buf, len, NULL);
}
int
vipsimage_openexrload (const char *filename, VipsImage **out) {
return vips_openexrload(filename, out, NULL);
}
int
vipsimage_fitsload (const char *filename, VipsImage **out) {
return vips_fitsload(filename, out, NULL);
}
int
vipsimage_fitssave (VipsImage *in, const char *filename) {
return vips_fitssave(in, filename, NULL);
}
int
vipsimage_analyzeload (const char *filename, VipsImage **out) {
return vips_analyzeload(filename, out, NULL);
}
int
vipsimage_rawload (const char *filename, VipsImage **out, int width, int height, int bands) {
return vips_rawload(filename, out, width, height, bands, NULL);
}
int
vipsimage_rawsave (VipsImage *in, const char *filename) {
return vips_rawsave(in, filename, NULL);
}
int
vipsimage_csvload (const char *filename, VipsImage **out) {
return vips_csvload(filename, out, NULL);
}
int
vipsimage_csvsave (VipsImage *in, const char *filename) {
return vips_csvsave(in, filename, NULL);
}
int
vipsimage_matrixload (const char *filename, VipsImage **out) {
return vips_matrixload(filename, out, NULL);
}
int
vipsimage_matrixsave (VipsImage *in, const char *filename) {
return vips_matrixsave(in, filename, NULL);
}
int
vipsimage_matrixprint (VipsImage *in) {
return vips_matrixprint(in, NULL);
}
int
vipsimage_magickload (const char *filename, VipsImage **out) {
return vips_magickload(filename, out, NULL);
}
int
vipsimage_magickload_buffer (void *buf, size_t len, VipsImage **out) {
return vips_magickload_buffer(buf, len, out, NULL);
}
int
vipsimage_magicksave (VipsImage *in, const char *filename) {
return vips_magicksave(in, filename, NULL);
}
int
vipsimage_magicksave_buffer (VipsImage *in, void **buf, size_t *len) {
return vips_magicksave_buffer(in, buf, len, NULL);
}
int
vipsimage_pngload (const char *filename, VipsImage **out) {
return vips_pngload(filename, out, NULL);
}
int
vipsimage_pngload_buffer (void *buf, size_t len, VipsImage **out) {
return vips_pngload_buffer(buf, len, out, NULL);
}
int
vipsimage_pngsave (VipsImage *in, const char *filename) {
return vips_pngsave(in, filename, NULL);
}
int
vipsimage_pngsave_buffer (VipsImage *in, void **buf, size_t *len) {
return vips_pngsave_buffer(in, buf, len, NULL);
}
int
vipsimage_ppmload (const char *filename, VipsImage **out) {
return vips_ppmload(filename, out, NULL);
}
int
vipsimage_ppmsave (VipsImage *in, const char *filename) {
return vips_ppmsave(in, filename, NULL);
}
int
vipsimage_matload (const char *filename, VipsImage **out) {
return vips_matload(filename, out, NULL);
}
int
vipsimage_radload (const char *filename, VipsImage **out) {
return vips_radload(filename, out, NULL);
}
int
vipsimage_radsave (VipsImage *in, const char *filename) {
return vips_radsave(in, filename, NULL);
}
int
vipsimage_radsave_buffer (VipsImage *in, void **buf, size_t *len) {
return vips_radsave_buffer(in, buf, len, NULL);
}
int
vipsimage_pdfload (const char *filename, VipsImage **out) {
return vips_pdfload(filename, out, NULL);
}
int
vipsimage_pdfload_buffer (void *buf, size_t len, VipsImage **out) {
return vips_pdfload_buffer(buf, len, out, NULL);
}
int
vipsimage_svgload (const char *filename, VipsImage **out) {
return vips_svgload(filename, out, NULL);
}
int
vipsimage_svgload_buffer (void *buf, size_t len, VipsImage **out) {
return vips_svgload_buffer(buf, len, out, NULL);
}
int
vipsimage_gifload (const char *filename, VipsImage **out) {
return vips_gifload(filename, out, NULL);
}
int
vipsimage_gifload_buffer (void *buf, size_t len, VipsImage **out) {
return vips_gifload_buffer(buf, len, out, NULL);
}
int
vipsimage_heifload (const char *filename, VipsImage **out) {
return vips_heifload(filename, out, NULL);
}
int
vipsimage_heifload_buffer (void *buf, size_t len, VipsImage **out) {
return vips_heifload_buffer(buf, len, out, NULL);
}
int
vipsimage_heifsave (VipsImage *in, const char *filename) {
return vips_heifsave(in, filename, NULL);
}
int
vipsimage_heifsave_buffer (VipsImage *in, void **buf, size_t *len) {
return vips_heifsave_buffer(in, buf, len, NULL);
}
int
vipsimage_niftiload (const char *filename, VipsImage **out) {
return vips_niftiload(filename, out, NULL);
}
int
vipsimage_niftisave (VipsImage *in, const char *filename) {
return vips_niftisave(in, filename, NULL);
}
int
vipsimage_dzsave (VipsImage *in, const char *name) {
return vips_dzsave(in, name, NULL);
}
/* resample */
int
vipsimage_resize (VipsImage *in, VipsImage **out, double scale) {
return vips_resize(in, out, scale, NULL);
}
int
vipsimage_rotate (VipsImage *in, VipsImage **out, double angle) {
return vips_rotate(in, out, angle, NULL);
}
int
vipsimage_thumbnail_image (VipsImage *in, VipsImage **out, int width) {
return vips_thumbnail_image(in, out, width, NULL);
}
int
vipsimage_thumbnail (const char *filename, VipsImage **out, int width) {
return vips_thumbnail(filename, out, width, NULL);
}
int
vipsimage_thumbnail_buffer (void *buf, size_t len, VipsImage **out, int width) {
return vips_thumbnail_buffer(buf, len, out, width, NULL);
}
/* freqfilt */
int
vipsimage_fwfft (VipsImage *in, VipsImage **out) {
return vips_fwfft(in, out, NULL);
}
int
vipsimage_invfft (VipsImage *in, VipsImage **out) {
return vips_invfft(in, out, NULL);
}
int
vipsimage_freqmult (VipsImage *in, VipsImage *mask, VipsImage **out) {
return vips_freqmult(in, mask, out, NULL);
}
int
vipsimage_spectrum (VipsImage *in, VipsImage **out) {
return vips_spectrum(in, out, NULL);
}
int
vipsimage_phasecor (VipsImage *in1, VipsImage *in2, VipsImage **out) {
return vips_phasecor(in1, in2, out, NULL);
}
/* create */
int
vipsimage_black (VipsImage **out, int width, int height) {
return vips_black(out, width, height, NULL);
}
int
vipsimage_xyz (VipsImage **out, int width, int height) {
return vips_xyz(out, width, height, NULL);
}
int
vipsimage_grey (VipsImage **out, int width, int height) {
return vips_grey(out, width, height, NULL);
}
int
vipsimage_gaussmat (VipsImage **out, double sigma, double min_ampl) {
return vips_gaussmat(out, sigma, min_ampl, NULL);
}
int
vipsimage_logmat (VipsImage **out, double sigma, double min_ampl) {
return vips_logmat(out, sigma, min_ampl, NULL);
}
int
vipsimage_text (VipsImage **out, const char *text) {
return vips_text(out, text, NULL);
}
int
vipsimage_gaussnoise (VipsImage **out, int width, int height) {
return vips_gaussnoise(out, width, height, NULL);
}
int
vipsimage_eye (VipsImage **out, int width, int height) {
return vips_eye(out, width, height, NULL);
}
int
vipsimage_sines (VipsImage **out, int width, int height) {
return vips_sines(out, width, height, NULL);
}
int
vipsimage_zone (VipsImage **out, int width, int height) {
return vips_zone(out, width, height, NULL);
}
int
vipsimage_identity (VipsImage **out) {
return vips_identity(out, NULL);
}
int
vipsimage_buildlut (VipsImage *in, VipsImage **out) {
return vips_buildlut(in, out, NULL);
}
int
vipsimage_invertlut (VipsImage *in, VipsImage **out) {
return vips_invertlut(in, out, NULL);
}
int
vipsimage_tonelut (VipsImage **out) {
return vips_tonelut(out, NULL);
}
int
vipsimage_mask_ideal (VipsImage **out, int width, int height, double frequency_cutoff) {
return vips_mask_ideal(out, width, height, frequency_cutoff, NULL);
}
int
vipsimage_mask_ideal_ring (VipsImage **out, int width, int height, double frequency_cutoff, double ringwidth) {
return vips_mask_ideal_ring(out, width, height, frequency_cutoff, ringwidth, NULL);
}
int
vipsimage_mask_ideal_band (VipsImage **out, int width, int height, double frequency_cutoff_x, double frequency_cutoff_y, double radius) {
return vips_mask_ideal_band(out, width, height, frequency_cutoff_x, frequency_cutoff_y, radius, NULL);
}
int
vipsimage_mask_butterworth (VipsImage **out, int width, int height, double order, double frequency_cutoff, double amplitude_cutoff) {
return vips_mask_butterworth(out, width, height, order, frequency_cutoff, amplitude_cutoff, NULL);
}
int
vipsimage_mask_butterworth_ring (VipsImage **out, int width, int height, double order, double frequency_cutoff, double amplitude_cutoff, double ringwidth) {
return vips_mask_butterworth_ring(out, width, height, order, frequency_cutoff, amplitude_cutoff, ringwidth, NULL);
}
int
vipsimage_mask_butterworth_band (VipsImage **out,
int width, int height,
double order,
double frequency_cutoff_x, double frequency_cutoff_y,
double radius, double amplitude_cutoff) {
return vips_mask_butterworth_band(out, width, height, order, frequency_cutoff_x, frequency_cutoff_y, radius, amplitude_cutoff, NULL);
}
int
vipsimage_mask_gaussian (VipsImage **out, int width, int height, double frequency_cutoff, double amplitude_cutoff) {
return vips_mask_gaussian(out, width, height, frequency_cutoff, amplitude_cutoff, NULL);
}
int
vipsimage_mask_gaussian_ring (VipsImage **out, int width, int height, double frequency_cutoff, double amplitude_cutoff, double ringwidth) {
return vips_mask_gaussian_ring(out, width, height, frequency_cutoff, amplitude_cutoff, ringwidth, NULL);
}
int
vipsimage_mask_gaussian_band (VipsImage **out, int width, int height, double frequency_cutoff_x, double frequency_cutoff_y, double radius, double amplitude_cutoff) {
return vips_mask_gaussian_band(out, width, height, frequency_cutoff_x, frequency_cutoff_y, radius, amplitude_cutoff, NULL);
}
int
vipsimage_mask_fractal (VipsImage **out, int width, int height, double fractal_dimension) {
return vips_mask_fractal(out, width, height, fractal_dimension, NULL);
}
int
vipsimage_fractsurf (VipsImage **out, int width, int height, double fractal_dimension) {
return vips_fractsurf(out, width, height, fractal_dimension, NULL);
}
int
vipsimage_worley (VipsImage **out, int width, int height) {
return vips_worley(out, width, height, NULL);
}
int
vipsimage_perlin (VipsImage **out, int width, int height) {
return vips_perlin(out, width, height, NULL);
}
/* draw */
int
vipsimage_draw_rect (VipsImage *image, double *ink, int n, int left, int top, int width, int height) {
return vips_draw_rect(image, ink, n, left, top, width, height, NULL);
}
int
vipsimage_draw_rect1 (VipsImage *image, double ink, int left, int top, int width, int height) {
return vips_draw_rect1(image, ink, left, top, width, height, NULL);
}
int
vipsimage_draw_point (VipsImage *image, double *ink, int n, int x, int y) {
return vips_draw_point(image, ink, n, x, y, NULL);
}
int
vipsimage_draw_point1 (VipsImage *image, double ink, int x, int y) {
return vips_draw_point1(image, ink, x, y, NULL);
}
int
vipsimage_draw_image (VipsImage *image, VipsImage *sub, int x, int y) {
return vips_draw_image(image, sub, x, y, NULL);
}
int
vipsimage_draw_mask (VipsImage *image, double *ink, int n, VipsImage *mask, int x, int y) {
return vips_draw_mask(image, ink, n, mask, x, y, NULL);
}
int
vipsimage_draw_mask1 (VipsImage *image, double ink, VipsImage *mask, int x, int y) {
return vips_draw_mask1(image, ink, mask, x, y, NULL);
}
int
vipsimage_draw_line (VipsImage *image, double *ink, int n, int x1, int y1, int x2, int y2) {
return vips_draw_line(image, ink, n, x1, y1, x2, y2, NULL);
}
int
vipsimage_draw_line1 (VipsImage *image, double ink, int x1, int y1, int x2, int y2) {
return vips_draw_line1(image, ink, x1, y1, x2, y2, NULL);
}
int
vipsimage_draw_circle (VipsImage *image, double *ink, int n, int cx, int cy, int radius) {
return vips_draw_circle(image, ink, n, cx, cy, radius, NULL);
}
int
vipsimage_draw_circle1 (VipsImage *image, double ink, int cx, int cy, int radius) {
return vips_draw_circle1(image, ink, cx, cy, radius, NULL);
}
int
vipsimage_draw_flood (VipsImage *image, double *ink, int n, int x, int y) {
return vips_draw_flood(image, ink, n, x, y, NULL);
}
int
vipsimage_draw_flood1 (VipsImage *image, double ink, int x, int y) {
return vips_draw_flood1(image, ink, x, y, NULL);
}
int
vipsimage_draw_smudge (VipsImage *image, int left, int top, int width, int height) {
return vips_draw_smudge(image, left, top, width, height, NULL);
}
/* mosaicing */
int
vipsimage_merge (VipsImage *ref, VipsImage *sec, VipsImage **out, VipsDirection direction, int dx, int dy) {
return vips_merge(ref, sec, out, direction, dx, dy, NULL);
}
int
vipsimage_mosaic (VipsImage *ref, VipsImage *sec, VipsImage **out, VipsDirection direction, int xref, int yref, int xsec, int ysec) {
return vips_mosaic(ref, sec, out, direction, xref, yref, xsec, ysec, NULL);
}
int
vipsimage_mosaic1 (VipsImage *ref, VipsImage *sec, VipsImage **out, VipsDirection direction, int xr1, int yr1, int xs1, int ys1, int xr2, int yr2, int xs2, int ys2) {
return vips_mosaic1(ref, sec, out, direction, xr1, yr1, xs1, ys1, xr2, yr2, xs2, ys2, NULL);
}
int
vipsimage_match (VipsImage *ref, VipsImage *sec, VipsImage **out, int xr1, int yr1, int xs1, int ys1, int xr2, int yr2, int xs2, int ys2) {
return vips_match(ref, sec, out, xr1, yr1, xs1, ys1, xr2, yr2, xs2, ys2, NULL);
}
int vipsimage_globalbalance (VipsImage *in, VipsImage **out) {
return vips_globalbalance(in, out, NULL);
}
int
vipsimage_remosaic (VipsImage *in, VipsImage **out, const char *old_str, const char *new_str) {
return vips_remosaic(in, out, old_str, new_str, NULL);
}
int
vipsimage_copy (VipsImage *in, VipsImage **out) {
return vips_copy(in, out, NULL);
}