-
Notifications
You must be signed in to change notification settings - Fork 60
/
Copy pathmethods.rb
3156 lines (2843 loc) · 147 KB
/
methods.rb
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
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
module Vips
class Image
# @!method self.system(cmd_format, **opts)
# Run an external command.
# @param cmd_format [String] Command to run
# @param opts [Hash] Set of options
# @option opts [Array<Image>] :im Array of input images
# @option opts [String] :out_format Format for output filename
# @option opts [String] :in_format Format for input filename
# @option opts [Vips::Image] :out Output Output image
# @option opts [String] :log Output Command log
# @return [nil, Hash<Symbol => Object>] Hash of optional output items
# @!method add(right, **opts)
# Add two images.
# @param right [Vips::Image] Right-hand image argument
# @param opts [Hash] Set of options
# @return [Vips::Image] Output image
# @!method minpair(right, **opts)
# Minimum of a pair of images.
# @param right [Vips::Image] Right-hand image argument
# @param opts [Hash] Set of options
# @return [Vips::Image] Output image
# @!method maxpair(right, **opts)
# Maximum of a pair of images.
# @param right [Vips::Image] Right-hand image argument
# @param opts [Hash] Set of options
# @return [Vips::Image] Output image
# @!method subtract(right, **opts)
# Subtract two images.
# @param right [Vips::Image] Right-hand image argument
# @param opts [Hash] Set of options
# @return [Vips::Image] Output image
# @!method multiply(right, **opts)
# Multiply two images.
# @param right [Vips::Image] Right-hand image argument
# @param opts [Hash] Set of options
# @return [Vips::Image] Output image
# @!method divide(right, **opts)
# Divide two images.
# @param right [Vips::Image] Right-hand image argument
# @param opts [Hash] Set of options
# @return [Vips::Image] Output image
# @!method relational(right, relational, **opts)
# Relational operation on two images.
# @param right [Vips::Image] Right-hand image argument
# @param relational [Vips::OperationRelational] Relational to perform
# @param opts [Hash] Set of options
# @return [Vips::Image] Output image
# @!method remainder(right, **opts)
# Remainder after integer division of two images.
# @param right [Vips::Image] Right-hand image argument
# @param opts [Hash] Set of options
# @return [Vips::Image] Output image
# @!method boolean(right, boolean, **opts)
# Boolean operation on two images.
# @param right [Vips::Image] Right-hand image argument
# @param boolean [Vips::OperationBoolean] Boolean to perform
# @param opts [Hash] Set of options
# @return [Vips::Image] Output image
# @!method math2(right, math2, **opts)
# Binary math operations.
# @param right [Vips::Image] Right-hand image argument
# @param math2 [Vips::OperationMath2] Math to perform
# @param opts [Hash] Set of options
# @return [Vips::Image] Output image
# @!method complex2(right, cmplx, **opts)
# Complex binary operations on two images.
# @param right [Vips::Image] Right-hand image argument
# @param cmplx [Vips::OperationComplex2] Binary complex operation to perform
# @param opts [Hash] Set of options
# @return [Vips::Image] Output image
# @!method complexform(right, **opts)
# Form a complex image from two real images.
# @param right [Vips::Image] Right-hand image argument
# @param opts [Hash] Set of options
# @return [Vips::Image] Output image
# @!method clamp(**opts)
# Clamp values of an image.
# @param opts [Hash] Set of options
# @option opts [Float] :min Minimum value
# @option opts [Float] :max Maximum value
# @return [Vips::Image] Output image
# @!method invert(**opts)
# Invert an image.
# @param opts [Hash] Set of options
# @return [Vips::Image] Output image
# @!method linear(a, b, **opts)
# Calculate (a * in + b).
# @param a [Array<Double>] Multiply by this
# @param b [Array<Double>] Add this
# @param opts [Hash] Set of options
# @option opts [Boolean] :uchar Output should be uchar
# @return [Vips::Image] Output image
# @!method math(math, **opts)
# Apply a math operation to an image.
# @param math [Vips::OperationMath] Math to perform
# @param opts [Hash] Set of options
# @return [Vips::Image] Output image
# @!method abs(**opts)
# Absolute value of an image.
# @param opts [Hash] Set of options
# @return [Vips::Image] Output image
# @!method sign(**opts)
# Unit vector of pixel.
# @param opts [Hash] Set of options
# @return [Vips::Image] Output image
# @!method round(round, **opts)
# Perform a round function on an image.
# @param round [Vips::OperationRound] Rounding operation to perform
# @param opts [Hash] Set of options
# @return [Vips::Image] Output image
# @!method relational_const(relational, c, **opts)
# Relational operations against a constant.
# @param relational [Vips::OperationRelational] Relational to perform
# @param c [Array<Double>] Array of constants
# @param opts [Hash] Set of options
# @return [Vips::Image] Output image
# @!method remainder_const(c, **opts)
# Remainder after integer division of an image and a constant.
# @param c [Array<Double>] Array of constants
# @param opts [Hash] Set of options
# @return [Vips::Image] Output image
# @!method boolean_const(boolean, c, **opts)
# Boolean operations against a constant.
# @param boolean [Vips::OperationBoolean] Boolean to perform
# @param c [Array<Double>] Array of constants
# @param opts [Hash] Set of options
# @return [Vips::Image] Output image
# @!method math2_const(math2, c, **opts)
# Binary math operations with a constant.
# @param math2 [Vips::OperationMath2] Math to perform
# @param c [Array<Double>] Array of constants
# @param opts [Hash] Set of options
# @return [Vips::Image] Output image
# @!method complex(cmplx, **opts)
# Perform a complex operation on an image.
# @param cmplx [Vips::OperationComplex] Complex to perform
# @param opts [Hash] Set of options
# @return [Vips::Image] Output image
# @!method complexget(get, **opts)
# Get a component from a complex image.
# @param get [Vips::OperationComplexget] Complex to perform
# @param opts [Hash] Set of options
# @return [Vips::Image] Output image
# @!method self.sum(im, **opts)
# Sum an array of images.
# @param im [Array<Image>] Array of input images
# @param opts [Hash] Set of options
# @return [Vips::Image] Output image
# @!method avg(**opts)
# Find image average.
# @param opts [Hash] Set of options
# @return [Float] Output value
# @!method min(**opts)
# Find image minimum.
# @param opts [Hash] Set of options
# @option opts [Integer] :size Number of minimum values to find
# @option opts [Integer] :x Output Horizontal position of minimum
# @option opts [Integer] :y Output Vertical position of minimum
# @option opts [Array<Double>] :out_array Output Array of output values
# @option opts [Array<Integer>] :x_array Output Array of horizontal positions
# @option opts [Array<Integer>] :y_array Output Array of vertical positions
# @return [Float, Hash<Symbol => Object>] Output value, Hash of optional output items
# @!method max(**opts)
# Find image maximum.
# @param opts [Hash] Set of options
# @option opts [Integer] :size Number of maximum values to find
# @option opts [Integer] :x Output Horizontal position of maximum
# @option opts [Integer] :y Output Vertical position of maximum
# @option opts [Array<Double>] :out_array Output Array of output values
# @option opts [Array<Integer>] :x_array Output Array of horizontal positions
# @option opts [Array<Integer>] :y_array Output Array of vertical positions
# @return [Float, Hash<Symbol => Object>] Output value, Hash of optional output items
# @!method deviate(**opts)
# Find image standard deviation.
# @param opts [Hash] Set of options
# @return [Float] Output value
# @!method stats(**opts)
# Find many image stats.
# @param opts [Hash] Set of options
# @return [Vips::Image] Output array of statistics
# @!method hist_find(**opts)
# Find image histogram.
# @param opts [Hash] Set of options
# @option opts [Integer] :band Find histogram of band
# @return [Vips::Image] Output histogram
# @!method hist_find_ndim(**opts)
# Find n-dimensional image histogram.
# @param opts [Hash] Set of options
# @option opts [Integer] :bins Number of bins in each dimension
# @return [Vips::Image] Output histogram
# @!method hist_find_indexed(index, **opts)
# Find indexed image histogram.
# @param index [Vips::Image] Index image
# @param opts [Hash] Set of options
# @option opts [Vips::Combine] :combine Combine bins like this
# @return [Vips::Image] Output histogram
# @!method hough_line(**opts)
# Find hough line transform.
# @param opts [Hash] Set of options
# @option opts [Integer] :width Horizontal size of parameter space
# @option opts [Integer] :height Vertical size of parameter space
# @return [Vips::Image] Output image
# @!method hough_circle(**opts)
# Find hough circle transform.
# @param opts [Hash] Set of options
# @option opts [Integer] :scale Scale down dimensions by this factor
# @option opts [Integer] :min_radius Smallest radius to search for
# @option opts [Integer] :max_radius Largest radius to search for
# @return [Vips::Image] Output image
# @!method project(**opts)
# Find image projections.
# @param opts [Hash] Set of options
# @return [Array<Vips::Image, Vips::Image>] Sums of columns, Sums of rows
# @!method profile(**opts)
# Find image profiles.
# @param opts [Hash] Set of options
# @return [Array<Vips::Image, Vips::Image>] First non-zero pixel in column, First non-zero pixel in row
# @!method measure(h, v, **opts)
# Measure a set of patches on a color chart.
# @param h [Integer] Number of patches across chart
# @param v [Integer] Number of patches down chart
# @param opts [Hash] Set of options
# @option opts [Integer] :left Left edge of extract area
# @option opts [Integer] :top Top edge of extract area
# @option opts [Integer] :width Width of extract area
# @option opts [Integer] :height Height of extract area
# @return [Vips::Image] Output array of statistics
# @!method getpoint(x, y, **opts)
# Read a point from an image.
# @param x [Integer] Point to read
# @param y [Integer] Point to read
# @param opts [Hash] Set of options
# @option opts [Boolean] :unpack_complex Complex pixels should be unpacked
# @return [Array<Double>] Array of output values
# @!method find_trim(**opts)
# Search an image for non-edge areas.
# @param opts [Hash] Set of options
# @option opts [Float] :threshold Object threshold
# @option opts [Array<Double>] :background Color for background pixels
# @option opts [Boolean] :line_art Enable line art mode
# @return [Array<Integer, Integer, Integer, Integer>] Left edge of image, Top edge of extract area, Width of extract area, Height of extract area
# @!method copy(**opts)
# Copy an image.
# @param opts [Hash] Set of options
# @option opts [Integer] :width Image width in pixels
# @option opts [Integer] :height Image height in pixels
# @option opts [Integer] :bands Number of bands in image
# @option opts [Vips::BandFormat] :format Pixel format in image
# @option opts [Vips::Coding] :coding Pixel coding
# @option opts [Vips::Interpretation] :interpretation Pixel interpretation
# @option opts [Float] :xres Horizontal resolution in pixels/mm
# @option opts [Float] :yres Vertical resolution in pixels/mm
# @option opts [Integer] :xoffset Horizontal offset of origin
# @option opts [Integer] :yoffset Vertical offset of origin
# @return [Vips::Image] Output image
# @!method tilecache(**opts)
# Cache an image as a set of tiles.
# @param opts [Hash] Set of options
# @option opts [Integer] :tile_width Tile width in pixels
# @option opts [Integer] :tile_height Tile height in pixels
# @option opts [Integer] :max_tiles Maximum number of tiles to cache
# @option opts [Vips::Access] :access Expected access pattern
# @option opts [Boolean] :threaded Allow threaded access
# @option opts [Boolean] :persistent Keep cache between evaluations
# @return [Vips::Image] Output image
# @!method linecache(**opts)
# Cache an image as a set of lines.
# @param opts [Hash] Set of options
# @option opts [Integer] :tile_height Tile height in pixels
# @option opts [Vips::Access] :access Expected access pattern
# @option opts [Boolean] :threaded Allow threaded access
# @option opts [Boolean] :persistent Keep cache between evaluations
# @return [Vips::Image] Output image
# @!method sequential(**opts)
# Check sequential access.
# @param opts [Hash] Set of options
# @option opts [Integer] :tile_height Tile height in pixels
# @return [Vips::Image] Output image
# @!method embed(x, y, width, height, **opts)
# Embed an image in a larger image.
# @param x [Integer] Left edge of input in output
# @param y [Integer] Top edge of input in output
# @param width [Integer] Image width in pixels
# @param height [Integer] Image height in pixels
# @param opts [Hash] Set of options
# @option opts [Vips::Extend] :extend How to generate the extra pixels
# @option opts [Array<Double>] :background Color for background pixels
# @return [Vips::Image] Output image
# @!method gravity(direction, width, height, **opts)
# Place an image within a larger image with a certain gravity.
# @param direction [Vips::CompassDirection] Direction to place image within width/height
# @param width [Integer] Image width in pixels
# @param height [Integer] Image height in pixels
# @param opts [Hash] Set of options
# @option opts [Vips::Extend] :extend How to generate the extra pixels
# @option opts [Array<Double>] :background Color for background pixels
# @return [Vips::Image] Output image
# @!method flip(direction, **opts)
# Flip an image.
# @param direction [Vips::Direction] Direction to flip image
# @param opts [Hash] Set of options
# @return [Vips::Image] Output image
# @!method insert(sub, x, y, **opts)
# Insert image @sub into @main at @x, @y.
# @param sub [Vips::Image] Sub-image to insert into main image
# @param x [Integer] Left edge of sub in main
# @param y [Integer] Top edge of sub in main
# @param opts [Hash] Set of options
# @option opts [Boolean] :expand Expand output to hold all of both inputs
# @option opts [Array<Double>] :background Color for new pixels
# @return [Vips::Image] Output image
# @!method join(in2, direction, **opts)
# Join a pair of images.
# @param in2 [Vips::Image] Second input image
# @param direction [Vips::Direction] Join left-right or up-down
# @param opts [Hash] Set of options
# @option opts [Boolean] :expand Expand output to hold all of both inputs
# @option opts [Integer] :shim Pixels between images
# @option opts [Array<Double>] :background Colour for new pixels
# @option opts [Vips::Align] :align Align on the low, centre or high coordinate edge
# @return [Vips::Image] Output image
# @!method self.arrayjoin(im, **opts)
# Join an array of images.
# @param im [Array<Image>] Array of input images
# @param opts [Hash] Set of options
# @option opts [Integer] :across Number of images across grid
# @option opts [Integer] :shim Pixels between images
# @option opts [Array<Double>] :background Colour for new pixels
# @option opts [Vips::Align] :halign Align on the left, centre or right
# @option opts [Vips::Align] :valign Align on the top, centre or bottom
# @option opts [Integer] :hspacing Horizontal spacing between images
# @option opts [Integer] :vspacing Vertical spacing between images
# @return [Vips::Image] Output image
# @!method extract_area(left, top, width, height, **opts)
# Extract an area from an image.
# @param left [Integer] Left edge of extract area
# @param top [Integer] Top edge of extract area
# @param width [Integer] Width of extract area
# @param height [Integer] Height of extract area
# @param opts [Hash] Set of options
# @return [Vips::Image] Output image
# @!method crop(left, top, width, height, **opts)
# Extract an area from an image.
# @param left [Integer] Left edge of extract area
# @param top [Integer] Top edge of extract area
# @param width [Integer] Width of extract area
# @param height [Integer] Height of extract area
# @param opts [Hash] Set of options
# @return [Vips::Image] Output image
# @!method smartcrop(width, height, **opts)
# Extract an area from an image.
# @param width [Integer] Width of extract area
# @param height [Integer] Height of extract area
# @param opts [Hash] Set of options
# @option opts [Vips::Interesting] :interesting How to measure interestingness
# @option opts [Boolean] :premultiplied Input image already has premultiplied alpha
# @option opts [Integer] :attention_x Output Horizontal position of attention centre
# @option opts [Integer] :attention_y Output Vertical position of attention centre
# @return [Vips::Image, Hash<Symbol => Object>] Output image, Hash of optional output items
# @!method extract_band(band, **opts)
# Extract band from an image.
# @param band [Integer] Band to extract
# @param opts [Hash] Set of options
# @option opts [Integer] :n Number of bands to extract
# @return [Vips::Image] Output image
# @!method bandjoin_const(c, **opts)
# Append a constant band to an image.
# @param c [Array<Double>] Array of constants to add
# @param opts [Hash] Set of options
# @return [Vips::Image] Output image
# @!method self.bandrank(im, **opts)
# Band-wise rank of a set of images.
# @param im [Array<Image>] Array of input images
# @param opts [Hash] Set of options
# @option opts [Integer] :index Select this band element from sorted list
# @return [Vips::Image] Output image
# @!method bandmean(**opts)
# Band-wise average.
# @param opts [Hash] Set of options
# @return [Vips::Image] Output image
# @!method bandbool(boolean, **opts)
# Boolean operation across image bands.
# @param boolean [Vips::OperationBoolean] Boolean to perform
# @param opts [Hash] Set of options
# @return [Vips::Image] Output image
# @!method replicate(across, down, **opts)
# Replicate an image.
# @param across [Integer] Repeat this many times horizontally
# @param down [Integer] Repeat this many times vertically
# @param opts [Hash] Set of options
# @return [Vips::Image] Output image
# @!method cast(format, **opts)
# Cast an image.
# @param format [Vips::BandFormat] Format to cast to
# @param opts [Hash] Set of options
# @option opts [Boolean] :shift Shift integer values up and down
# @return [Vips::Image] Output image
# @!method rot(angle, **opts)
# Rotate an image.
# @param angle [Vips::Angle] Angle to rotate image
# @param opts [Hash] Set of options
# @return [Vips::Image] Output image
# @!method rot45(**opts)
# Rotate an image.
# @param opts [Hash] Set of options
# @option opts [Vips::Angle45] :angle Angle to rotate image
# @return [Vips::Image] Output image
# @!method autorot(**opts)
# Autorotate image by exif tag.
# @param opts [Hash] Set of options
# @option opts [Vips::Angle] :angle Output Angle image was rotated by
# @option opts [Boolean] :flip Output Whether the image was flipped or not
# @return [Vips::Image, Hash<Symbol => Object>] Output image, Hash of optional output items
# @!method recomb(m, **opts)
# Linear recombination with matrix.
# @param m [Vips::Image] Matrix of coefficients
# @param opts [Hash] Set of options
# @return [Vips::Image] Output image
# @!method bandfold(**opts)
# Fold up x axis into bands.
# @param opts [Hash] Set of options
# @option opts [Integer] :factor Fold by this factor
# @return [Vips::Image] Output image
# @!method bandunfold(**opts)
# Unfold image bands into x axis.
# @param opts [Hash] Set of options
# @option opts [Integer] :factor Unfold by this factor
# @return [Vips::Image] Output image
# @!method flatten(**opts)
# Flatten alpha out of an image.
# @param opts [Hash] Set of options
# @option opts [Array<Double>] :background Background value
# @option opts [Float] :max_alpha Maximum value of alpha channel
# @return [Vips::Image] Output image
# @!method premultiply(**opts)
# Premultiply image alpha.
# @param opts [Hash] Set of options
# @option opts [Float] :max_alpha Maximum value of alpha channel
# @return [Vips::Image] Output image
# @!method unpremultiply(**opts)
# Unpremultiply image alpha.
# @param opts [Hash] Set of options
# @option opts [Float] :max_alpha Maximum value of alpha channel
# @option opts [Integer] :alpha_band Unpremultiply with this alpha
# @return [Vips::Image] Output image
# @!method grid(tile_height, across, down, **opts)
# Grid an image.
# @param tile_height [Integer] Chop into tiles this high
# @param across [Integer] Number of tiles across
# @param down [Integer] Number of tiles down
# @param opts [Hash] Set of options
# @return [Vips::Image] Output image
# @!method transpose3d(**opts)
# Transpose3d an image.
# @param opts [Hash] Set of options
# @option opts [Integer] :page_height Height of each input page
# @return [Vips::Image] Output image
# @!method wrap(**opts)
# Wrap image origin.
# @param opts [Hash] Set of options
# @option opts [Integer] :x Left edge of input in output
# @option opts [Integer] :y Top edge of input in output
# @return [Vips::Image] Output image
# @!method zoom(xfac, yfac, **opts)
# Zoom an image.
# @param xfac [Integer] Horizontal zoom factor
# @param yfac [Integer] Vertical zoom factor
# @param opts [Hash] Set of options
# @return [Vips::Image] Output image
# @!method subsample(xfac, yfac, **opts)
# Subsample an image.
# @param xfac [Integer] Horizontal subsample factor
# @param yfac [Integer] Vertical subsample factor
# @param opts [Hash] Set of options
# @option opts [Boolean] :point Point sample
# @return [Vips::Image] Output image
# @!method msb(**opts)
# Pick most-significant byte from an image.
# @param opts [Hash] Set of options
# @option opts [Integer] :band Band to msb
# @return [Vips::Image] Output image
# @!method byteswap(**opts)
# Byteswap an image.
# @param opts [Hash] Set of options
# @return [Vips::Image] Output image
# @!method falsecolour(**opts)
# False-color an image.
# @param opts [Hash] Set of options
# @return [Vips::Image] Output image
# @!method gamma(**opts)
# Gamma an image.
# @param opts [Hash] Set of options
# @option opts [Float] :exponent Gamma factor
# @return [Vips::Image] Output image
# @!method composite2(overlay, mode, **opts)
# Blend a pair of images with a blend mode.
# @param overlay [Vips::Image] Overlay image
# @param mode [Vips::BlendMode] VipsBlendMode to join with
# @param opts [Hash] Set of options
# @option opts [Integer] :x x position of overlay
# @option opts [Integer] :y y position of overlay
# @option opts [Vips::Interpretation] :compositing_space Composite images in this colour space
# @option opts [Boolean] :premultiplied Images have premultiplied alpha
# @return [Vips::Image] Output image
# @!method addalpha(**opts)
# Append an alpha channel.
# @param opts [Hash] Set of options
# @return [Vips::Image] Output image
# @!method self.black(width, height, **opts)
# Make a black image.
# @param width [Integer] Image width in pixels
# @param height [Integer] Image height in pixels
# @param opts [Hash] Set of options
# @option opts [Integer] :bands Number of bands in image
# @return [Vips::Image] Output image
# @!method self.gaussnoise(width, height, **opts)
# Make a gaussnoise image.
# @param width [Integer] Image width in pixels
# @param height [Integer] Image height in pixels
# @param opts [Hash] Set of options
# @option opts [Float] :sigma Standard deviation of pixels in generated image
# @option opts [Float] :mean Mean of pixels in generated image
# @option opts [Integer] :seed Random number seed
# @return [Vips::Image] Output image
# @!method self.xyz(width, height, **opts)
# Make an image where pixel values are coordinates.
# @param width [Integer] Image width in pixels
# @param height [Integer] Image height in pixels
# @param opts [Hash] Set of options
# @option opts [Integer] :csize Size of third dimension
# @option opts [Integer] :dsize Size of fourth dimension
# @option opts [Integer] :esize Size of fifth dimension
# @return [Vips::Image] Output image
# @!method self.gaussmat(sigma, min_ampl, **opts)
# Make a gaussian image.
# @param sigma [Float] Sigma of Gaussian
# @param min_ampl [Float] Minimum amplitude of Gaussian
# @param opts [Hash] Set of options
# @option opts [Boolean] :separable Generate separable Gaussian
# @option opts [Vips::Precision] :precision Generate with this precision
# @return [Vips::Image] Output image
# @!method self.logmat(sigma, min_ampl, **opts)
# Make a laplacian of gaussian image.
# @param sigma [Float] Radius of Gaussian
# @param min_ampl [Float] Minimum amplitude of Gaussian
# @param opts [Hash] Set of options
# @option opts [Boolean] :separable Generate separable Gaussian
# @option opts [Vips::Precision] :precision Generate with this precision
# @return [Vips::Image] Output image
# @!method self.text(text, **opts)
# Make a text image.
# @param text [String] Text to render
# @param opts [Hash] Set of options
# @option opts [String] :font Font to render with
# @option opts [Integer] :width Maximum image width in pixels
# @option opts [Integer] :height Maximum image height in pixels
# @option opts [Vips::Align] :align Align on the low, centre or high edge
# @option opts [Boolean] :justify Justify lines
# @option opts [Integer] :dpi DPI to render at
# @option opts [Integer] :spacing Line spacing
# @option opts [String] :fontfile Load this font file
# @option opts [Boolean] :rgba Enable RGBA output
# @option opts [Vips::TextWrap] :wrap Wrap lines on word or character boundaries
# @option opts [Integer] :autofit_dpi Output DPI selected by autofit
# @return [Vips::Image, Hash<Symbol => Object>] Output image, Hash of optional output items
# @!method self.sdf(width, height, shape, **opts)
# Create an sdf image.
# @param width [Integer] Image width in pixels
# @param height [Integer] Image height in pixels
# @param shape [Vips::SdfShape] SDF shape to create
# @param opts [Hash] Set of options
# @option opts [Float] :r Radius
# @option opts [Array<Double>] :a Point a
# @option opts [Array<Double>] :b Point b
# @option opts [Array<Double>] :corners Corner radii
# @return [Vips::Image] Output image
# @!method self.eye(width, height, **opts)
# Make an image showing the eye's spatial response.
# @param width [Integer] Image width in pixels
# @param height [Integer] Image height in pixels
# @param opts [Hash] Set of options
# @option opts [Boolean] :uchar Output an unsigned char image
# @option opts [Float] :factor Maximum spatial frequency
# @return [Vips::Image] Output image
# @!method self.grey(width, height, **opts)
# Make a grey ramp image.
# @param width [Integer] Image width in pixels
# @param height [Integer] Image height in pixels
# @param opts [Hash] Set of options
# @option opts [Boolean] :uchar Output an unsigned char image
# @return [Vips::Image] Output image
# @!method self.zone(width, height, **opts)
# Make a zone plate.
# @param width [Integer] Image width in pixels
# @param height [Integer] Image height in pixels
# @param opts [Hash] Set of options
# @option opts [Boolean] :uchar Output an unsigned char image
# @return [Vips::Image] Output image
# @!method self.sines(width, height, **opts)
# Make a 2d sine wave.
# @param width [Integer] Image width in pixels
# @param height [Integer] Image height in pixels
# @param opts [Hash] Set of options
# @option opts [Boolean] :uchar Output an unsigned char image
# @option opts [Float] :hfreq Horizontal spatial frequency
# @option opts [Float] :vfreq Vertical spatial frequency
# @return [Vips::Image] Output image
# @!method self.mask_ideal(width, height, frequency_cutoff, **opts)
# Make an ideal filter.
# @param width [Integer] Image width in pixels
# @param height [Integer] Image height in pixels
# @param frequency_cutoff [Float] Frequency cutoff
# @param opts [Hash] Set of options
# @option opts [Boolean] :uchar Output an unsigned char image
# @option opts [Boolean] :nodc Remove DC component
# @option opts [Boolean] :reject Invert the sense of the filter
# @option opts [Boolean] :optical Rotate quadrants to optical space
# @return [Vips::Image] Output image
# @!method self.mask_ideal_ring(width, height, frequency_cutoff, ringwidth, **opts)
# Make an ideal ring filter.
# @param width [Integer] Image width in pixels
# @param height [Integer] Image height in pixels
# @param frequency_cutoff [Float] Frequency cutoff
# @param ringwidth [Float] Ringwidth
# @param opts [Hash] Set of options
# @option opts [Boolean] :uchar Output an unsigned char image
# @option opts [Boolean] :nodc Remove DC component
# @option opts [Boolean] :reject Invert the sense of the filter
# @option opts [Boolean] :optical Rotate quadrants to optical space
# @return [Vips::Image] Output image
# @!method self.mask_ideal_band(width, height, frequency_cutoff_x, frequency_cutoff_y, radius, **opts)
# Make an ideal band filter.
# @param width [Integer] Image width in pixels
# @param height [Integer] Image height in pixels
# @param frequency_cutoff_x [Float] Frequency cutoff x
# @param frequency_cutoff_y [Float] Frequency cutoff y
# @param radius [Float] Radius of circle
# @param opts [Hash] Set of options
# @option opts [Boolean] :uchar Output an unsigned char image
# @option opts [Boolean] :nodc Remove DC component
# @option opts [Boolean] :reject Invert the sense of the filter
# @option opts [Boolean] :optical Rotate quadrants to optical space
# @return [Vips::Image] Output image
# @!method self.mask_butterworth(width, height, order, frequency_cutoff, amplitude_cutoff, **opts)
# Make a butterworth filter.
# @param width [Integer] Image width in pixels
# @param height [Integer] Image height in pixels
# @param order [Float] Filter order
# @param frequency_cutoff [Float] Frequency cutoff
# @param amplitude_cutoff [Float] Amplitude cutoff
# @param opts [Hash] Set of options
# @option opts [Boolean] :uchar Output an unsigned char image
# @option opts [Boolean] :nodc Remove DC component
# @option opts [Boolean] :reject Invert the sense of the filter
# @option opts [Boolean] :optical Rotate quadrants to optical space
# @return [Vips::Image] Output image
# @!method self.mask_butterworth_ring(width, height, order, frequency_cutoff, amplitude_cutoff, ringwidth, **opts)
# Make a butterworth ring filter.
# @param width [Integer] Image width in pixels
# @param height [Integer] Image height in pixels
# @param order [Float] Filter order
# @param frequency_cutoff [Float] Frequency cutoff
# @param amplitude_cutoff [Float] Amplitude cutoff
# @param ringwidth [Float] Ringwidth
# @param opts [Hash] Set of options
# @option opts [Boolean] :uchar Output an unsigned char image
# @option opts [Boolean] :nodc Remove DC component
# @option opts [Boolean] :reject Invert the sense of the filter
# @option opts [Boolean] :optical Rotate quadrants to optical space
# @return [Vips::Image] Output image
# @!method self.mask_butterworth_band(width, height, order, frequency_cutoff_x, frequency_cutoff_y, radius, amplitude_cutoff, **opts)
# Make a butterworth_band filter.
# @param width [Integer] Image width in pixels
# @param height [Integer] Image height in pixels
# @param order [Float] Filter order
# @param frequency_cutoff_x [Float] Frequency cutoff x
# @param frequency_cutoff_y [Float] Frequency cutoff y
# @param radius [Float] Radius of circle
# @param amplitude_cutoff [Float] Amplitude cutoff
# @param opts [Hash] Set of options
# @option opts [Boolean] :uchar Output an unsigned char image
# @option opts [Boolean] :nodc Remove DC component
# @option opts [Boolean] :reject Invert the sense of the filter
# @option opts [Boolean] :optical Rotate quadrants to optical space
# @return [Vips::Image] Output image
# @!method self.mask_gaussian(width, height, frequency_cutoff, amplitude_cutoff, **opts)
# Make a gaussian filter.
# @param width [Integer] Image width in pixels
# @param height [Integer] Image height in pixels
# @param frequency_cutoff [Float] Frequency cutoff
# @param amplitude_cutoff [Float] Amplitude cutoff
# @param opts [Hash] Set of options
# @option opts [Boolean] :uchar Output an unsigned char image
# @option opts [Boolean] :nodc Remove DC component
# @option opts [Boolean] :reject Invert the sense of the filter
# @option opts [Boolean] :optical Rotate quadrants to optical space
# @return [Vips::Image] Output image
# @!method self.mask_gaussian_ring(width, height, frequency_cutoff, amplitude_cutoff, ringwidth, **opts)
# Make a gaussian ring filter.
# @param width [Integer] Image width in pixels
# @param height [Integer] Image height in pixels
# @param frequency_cutoff [Float] Frequency cutoff
# @param amplitude_cutoff [Float] Amplitude cutoff
# @param ringwidth [Float] Ringwidth
# @param opts [Hash] Set of options
# @option opts [Boolean] :uchar Output an unsigned char image
# @option opts [Boolean] :nodc Remove DC component
# @option opts [Boolean] :reject Invert the sense of the filter
# @option opts [Boolean] :optical Rotate quadrants to optical space
# @return [Vips::Image] Output image
# @!method self.mask_gaussian_band(width, height, frequency_cutoff_x, frequency_cutoff_y, radius, amplitude_cutoff, **opts)
# Make a gaussian filter.
# @param width [Integer] Image width in pixels
# @param height [Integer] Image height in pixels
# @param frequency_cutoff_x [Float] Frequency cutoff x
# @param frequency_cutoff_y [Float] Frequency cutoff y
# @param radius [Float] Radius of circle
# @param amplitude_cutoff [Float] Amplitude cutoff
# @param opts [Hash] Set of options
# @option opts [Boolean] :uchar Output an unsigned char image
# @option opts [Boolean] :nodc Remove DC component
# @option opts [Boolean] :reject Invert the sense of the filter
# @option opts [Boolean] :optical Rotate quadrants to optical space
# @return [Vips::Image] Output image
# @!method self.mask_fractal(width, height, fractal_dimension, **opts)
# Make fractal filter.
# @param width [Integer] Image width in pixels
# @param height [Integer] Image height in pixels
# @param fractal_dimension [Float] Fractal dimension
# @param opts [Hash] Set of options
# @option opts [Boolean] :uchar Output an unsigned char image
# @option opts [Boolean] :nodc Remove DC component
# @option opts [Boolean] :reject Invert the sense of the filter
# @option opts [Boolean] :optical Rotate quadrants to optical space
# @return [Vips::Image] Output image
# @!method buildlut(**opts)
# Build a look-up table.
# @param opts [Hash] Set of options
# @return [Vips::Image] Output image
# @!method invertlut(**opts)
# Build an inverted look-up table.
# @param opts [Hash] Set of options
# @option opts [Integer] :size LUT size to generate
# @return [Vips::Image] Output image
# @!method self.tonelut(**opts)
# Build a look-up table.
# @param opts [Hash] Set of options
# @option opts [Integer] :in_max Size of LUT to build
# @option opts [Integer] :out_max Maximum value in output LUT
# @option opts [Float] :Lb Lowest value in output
# @option opts [Float] :Lw Highest value in output
# @option opts [Float] :Ps Position of shadow
# @option opts [Float] :Pm Position of mid-tones
# @option opts [Float] :Ph Position of highlights
# @option opts [Float] :S Adjust shadows by this much
# @option opts [Float] :M Adjust mid-tones by this much
# @option opts [Float] :H Adjust highlights by this much
# @return [Vips::Image] Output image
# @!method self.identity(**opts)
# Make a 1d image where pixel values are indexes.
# @param opts [Hash] Set of options
# @option opts [Integer] :bands Number of bands in LUT
# @option opts [Boolean] :ushort Create a 16-bit LUT
# @option opts [Integer] :size Size of 16-bit LUT
# @return [Vips::Image] Output image
# @!method self.fractsurf(width, height, fractal_dimension, **opts)
# Make a fractal surface.
# @param width [Integer] Image width in pixels
# @param height [Integer] Image height in pixels
# @param fractal_dimension [Float] Fractal dimension
# @param opts [Hash] Set of options
# @return [Vips::Image] Output image
# @!method self.worley(width, height, **opts)
# Make a worley noise image.
# @param width [Integer] Image width in pixels
# @param height [Integer] Image height in pixels
# @param opts [Hash] Set of options
# @option opts [Integer] :cell_size Size of Worley cells
# @option opts [Integer] :seed Random number seed
# @return [Vips::Image] Output image
# @!method self.perlin(width, height, **opts)
# Make a perlin noise image.
# @param width [Integer] Image width in pixels
# @param height [Integer] Image height in pixels
# @param opts [Hash] Set of options
# @option opts [Integer] :cell_size Size of Perlin cells
# @option opts [Boolean] :uchar Output an unsigned char image
# @option opts [Integer] :seed Random number seed
# @return [Vips::Image] Output image
# @!method self.switch(tests, **opts)
# Find the index of the first non-zero pixel in tests.
# @param tests [Array<Image>] Table of images to test
# @param opts [Hash] Set of options
# @return [Vips::Image] Output image
# @!method self.csvload(filename, **opts)
# Load csv.
# @param filename [String] Filename to load from
# @param opts [Hash] Set of options
# @option opts [Integer] :skip Skip this many lines at the start of the file
# @option opts [Integer] :lines Read this many lines from the file
# @option opts [String] :whitespace Set of whitespace characters
# @option opts [String] :separator Set of separator characters
# @option opts [Boolean] :memory Force open via memory
# @option opts [Vips::Access] :access Required access pattern for this file
# @option opts [Vips::FailOn] :fail_on Error level to fail on
# @option opts [Boolean] :revalidate Don't use a cached result for this operation
# @option opts [Vips::ForeignFlags] :flags Output Flags for this file
# @return [Vips::Image, Hash<Symbol => Object>] Output image, Hash of optional output items
# @!method self.csvload_source(source, **opts)
# Load csv.
# @param source [Vips::Source] Source to load from
# @param opts [Hash] Set of options
# @option opts [Integer] :skip Skip this many lines at the start of the file
# @option opts [Integer] :lines Read this many lines from the file
# @option opts [String] :whitespace Set of whitespace characters
# @option opts [String] :separator Set of separator characters
# @option opts [Boolean] :memory Force open via memory
# @option opts [Vips::Access] :access Required access pattern for this file
# @option opts [Vips::FailOn] :fail_on Error level to fail on
# @option opts [Boolean] :revalidate Don't use a cached result for this operation
# @option opts [Vips::ForeignFlags] :flags Output Flags for this file
# @return [Vips::Image, Hash<Symbol => Object>] Output image, Hash of optional output items
# @!method self.matrixload(filename, **opts)
# Load matrix.
# @param filename [String] Filename to load from
# @param opts [Hash] Set of options
# @option opts [Boolean] :memory Force open via memory
# @option opts [Vips::Access] :access Required access pattern for this file
# @option opts [Vips::FailOn] :fail_on Error level to fail on
# @option opts [Boolean] :revalidate Don't use a cached result for this operation
# @option opts [Vips::ForeignFlags] :flags Output Flags for this file
# @return [Vips::Image, Hash<Symbol => Object>] Output image, Hash of optional output items
# @!method self.matrixload_source(source, **opts)
# Load matrix.
# @param source [Vips::Source] Source to load from
# @param opts [Hash] Set of options
# @option opts [Boolean] :memory Force open via memory
# @option opts [Vips::Access] :access Required access pattern for this file
# @option opts [Vips::FailOn] :fail_on Error level to fail on
# @option opts [Boolean] :revalidate Don't use a cached result for this operation
# @option opts [Vips::ForeignFlags] :flags Output Flags for this file
# @return [Vips::Image, Hash<Symbol => Object>] Output image, Hash of optional output items
# @!method self.rawload(filename, width, height, bands, **opts)
# Load raw data from a file.
# @param filename [String] Filename to load from
# @param width [Integer] Image width in pixels
# @param height [Integer] Image height in pixels
# @param bands [Integer] Number of bands in image
# @param opts [Hash] Set of options
# @option opts [guint64] :offset Offset in bytes from start of file
# @option opts [Vips::BandFormat] :format Pixel format in image
# @option opts [Vips::Interpretation] :interpretation Pixel interpretation
# @option opts [Boolean] :memory Force open via memory
# @option opts [Vips::Access] :access Required access pattern for this file
# @option opts [Vips::FailOn] :fail_on Error level to fail on
# @option opts [Boolean] :revalidate Don't use a cached result for this operation
# @option opts [Vips::ForeignFlags] :flags Output Flags for this file
# @return [Vips::Image, Hash<Symbol => Object>] Output image, Hash of optional output items
# @!method self.vipsload(filename, **opts)
# Load vips from file.
# @param filename [String] Filename to load from
# @param opts [Hash] Set of options
# @option opts [Boolean] :memory Force open via memory
# @option opts [Vips::Access] :access Required access pattern for this file
# @option opts [Vips::FailOn] :fail_on Error level to fail on
# @option opts [Boolean] :revalidate Don't use a cached result for this operation
# @option opts [Vips::ForeignFlags] :flags Output Flags for this file
# @return [Vips::Image, Hash<Symbol => Object>] Output image, Hash of optional output items
# @!method self.vipsload_source(source, **opts)
# Load vips from source.
# @param source [Vips::Source] Source to load from
# @param opts [Hash] Set of options
# @option opts [Boolean] :memory Force open via memory
# @option opts [Vips::Access] :access Required access pattern for this file
# @option opts [Vips::FailOn] :fail_on Error level to fail on
# @option opts [Boolean] :revalidate Don't use a cached result for this operation
# @option opts [Vips::ForeignFlags] :flags Output Flags for this file
# @return [Vips::Image, Hash<Symbol => Object>] Output image, Hash of optional output items
# @!method self.analyzeload(filename, **opts)
# Load an analyze6 image.