rs_vips/
operator.rs

1//! Operator overloads for VipsImage
2//!
3//! `+`, `-`, `*`, `/`
4//!
5//! `lt`(<), `le`(<=), `gt`(>), `ge`(>=), and `at`([])
6//!
7//! Every overload returns VipsImage as the result of Vips operation.
8use crate::{
9    ops::{OperationBoolean, OperationRelational},
10    VipsImage,
11};
12use std::ops::{Add, BitAnd, BitOr, BitXor, Div, Mul, Rem, Shl, Shr, Sub};
13
14pub trait Index<Idx> {
15    type Output: ?Sized;
16    fn at(&self, index: Idx) -> Self::Output;
17}
18
19fn invert(vector: &[f64]) -> Vec<f64> {
20    let mut new_vector = Vec::with_capacity(vector.len());
21
22    for value in vector {
23        new_vector.push(1.0 / value);
24    }
25
26    new_vector
27}
28
29fn negate(vector: &[f64]) -> Vec<f64> {
30    let mut new_vector = Vec::with_capacity(vector.len());
31
32    for value in vector {
33        new_vector.push(value * -1.0);
34    }
35
36    new_vector
37}
38
39// index
40impl Index<i32> for VipsImage {
41    type Output = VipsImage;
42    fn at(&self, index: i32) -> Self::Output {
43        self.extract_band(index)
44            .unwrap()
45    }
46}
47
48// add
49impl Add for VipsImage {
50    type Output = VipsImage;
51    fn add(self, b: VipsImage) -> VipsImage {
52        self.add_image(&b)
53            .unwrap()
54    }
55}
56
57impl Add<VipsImage> for f64 {
58    type Output = VipsImage;
59    fn add(self, b: VipsImage) -> VipsImage {
60        b.linear(
61            &[1.0],
62            &[self],
63        )
64        .unwrap()
65    }
66}
67
68impl Add<f64> for VipsImage {
69    type Output = VipsImage;
70    fn add(self, b: f64) -> VipsImage {
71        self.linear(
72            &[1.0],
73            &[b],
74        )
75        .unwrap()
76    }
77}
78
79impl Add<VipsImage> for &[f64] {
80    type Output = VipsImage;
81    fn add(self, b: VipsImage) -> VipsImage {
82        b.linear(
83            &[1.0],
84            self,
85        )
86        .unwrap()
87    }
88}
89
90impl Add<&[f64]> for VipsImage {
91    type Output = VipsImage;
92    fn add(self, b: &[f64]) -> VipsImage {
93        self.linear(&[1.0], b)
94            .unwrap()
95    }
96}
97
98impl<const N: usize> Add<VipsImage> for &[f64; N] {
99    type Output = VipsImage;
100    fn add(self, b: VipsImage) -> VipsImage {
101        b.linear(
102            &[1.0],
103            self,
104        )
105        .unwrap()
106    }
107}
108
109impl<const N: usize> Add<&[f64; N]> for VipsImage {
110    type Output = VipsImage;
111    fn add(self, b: &[f64; N]) -> VipsImage {
112        self.linear(&[1.0], b)
113            .unwrap()
114    }
115}
116
117// add ref
118impl Add for &VipsImage {
119    type Output = VipsImage;
120    fn add(self, b: &VipsImage) -> VipsImage {
121        self.add_image(b)
122            .unwrap()
123    }
124}
125
126impl Add<&VipsImage> for f64 {
127    type Output = VipsImage;
128    fn add(self, b: &VipsImage) -> VipsImage {
129        b.linear(
130            &[1.0],
131            &[self],
132        )
133        .unwrap()
134    }
135}
136
137impl Add<f64> for &VipsImage {
138    type Output = VipsImage;
139    fn add(self, b: f64) -> VipsImage {
140        self.linear(
141            &[1.0],
142            &[b],
143        )
144        .unwrap()
145    }
146}
147
148impl Add<&VipsImage> for &[f64] {
149    type Output = VipsImage;
150    fn add(self, b: &VipsImage) -> VipsImage {
151        b.linear(
152            &[1.0],
153            self,
154        )
155        .unwrap()
156    }
157}
158
159impl Add<&[f64]> for &VipsImage {
160    type Output = VipsImage;
161    fn add(self, b: &[f64]) -> VipsImage {
162        self.linear(&[1.0], b)
163            .unwrap()
164    }
165}
166
167impl<const N: usize> Add<&VipsImage> for &[f64; N] {
168    type Output = VipsImage;
169    fn add(self, b: &VipsImage) -> VipsImage {
170        b.linear(
171            &[1.0],
172            self,
173        )
174        .unwrap()
175    }
176}
177
178impl<const N: usize> Add<&[f64; N]> for &VipsImage {
179    type Output = VipsImage;
180    fn add(self, b: &[f64; N]) -> VipsImage {
181        self.linear(&[1.0], b)
182            .unwrap()
183    }
184}
185
186// sub
187impl Sub for VipsImage {
188    type Output = VipsImage;
189    fn sub(self, b: VipsImage) -> Self::Output {
190        self.subtract(&b)
191            .unwrap()
192    }
193}
194
195impl Sub<VipsImage> for f64 {
196    type Output = VipsImage;
197    fn sub(self, b: VipsImage) -> Self::Output {
198        b.linear(
199            &[-1.0],
200            &[self],
201        )
202        .unwrap()
203    }
204}
205
206impl Sub<f64> for VipsImage {
207    type Output = VipsImage;
208    fn sub(self, b: f64) -> Self::Output {
209        self.linear(
210            &[1.0],
211            &[b],
212        )
213        .unwrap()
214    }
215}
216
217impl Sub<VipsImage> for &[f64] {
218    type Output = VipsImage;
219    fn sub(self, b: VipsImage) -> VipsImage {
220        b.linear(
221            &[-1.0],
222            self,
223        )
224        .unwrap()
225    }
226}
227
228impl Sub<&[f64]> for VipsImage {
229    type Output = VipsImage;
230    fn sub(self, b: &[f64]) -> VipsImage {
231        self.linear(
232            &[1.0],
233            &negate(b),
234        )
235        .unwrap()
236    }
237}
238
239impl<const N: usize> Sub<VipsImage> for &[f64; N] {
240    type Output = VipsImage;
241    fn sub(self, b: VipsImage) -> VipsImage {
242        b.linear(
243            &[-1.0],
244            self,
245        )
246        .unwrap()
247    }
248}
249
250impl<const N: usize> Sub<&[f64; N]> for VipsImage {
251    type Output = VipsImage;
252    fn sub(self, b: &[f64; N]) -> VipsImage {
253        self.linear(
254            &[1.0],
255            &negate(b),
256        )
257        .unwrap()
258    }
259}
260
261// sub ref
262impl Sub for &VipsImage {
263    type Output = VipsImage;
264    fn sub(self, b: &VipsImage) -> Self::Output {
265        self.subtract(b)
266            .unwrap()
267    }
268}
269
270impl Sub<&VipsImage> for f64 {
271    type Output = VipsImage;
272    fn sub(self, b: &VipsImage) -> Self::Output {
273        b.linear(
274            &[-1.0],
275            &[self],
276        )
277        .unwrap()
278    }
279}
280
281impl Sub<f64> for &VipsImage {
282    type Output = VipsImage;
283    fn sub(self, b: f64) -> Self::Output {
284        self.linear(
285            &[1.0],
286            &[b],
287        )
288        .unwrap()
289    }
290}
291
292impl Sub<&VipsImage> for &[f64] {
293    type Output = VipsImage;
294    fn sub(self, b: &VipsImage) -> VipsImage {
295        b.linear(
296            &[-1.0],
297            self,
298        )
299        .unwrap()
300    }
301}
302
303impl Sub<&[f64]> for &VipsImage {
304    type Output = VipsImage;
305    fn sub(self, b: &[f64]) -> VipsImage {
306        self.linear(
307            &[1.0],
308            &negate(b),
309        )
310        .unwrap()
311    }
312}
313
314impl<const N: usize> Sub<&VipsImage> for &[f64; N] {
315    type Output = VipsImage;
316    fn sub(self, b: &VipsImage) -> VipsImage {
317        b.linear(
318            &[-1.0],
319            self,
320        )
321        .unwrap()
322    }
323}
324
325impl<const N: usize> Sub<&[f64; N]> for &VipsImage {
326    type Output = VipsImage;
327    fn sub(self, b: &[f64; N]) -> VipsImage {
328        self.linear(
329            &[1.0],
330            &negate(b),
331        )
332        .unwrap()
333    }
334}
335
336// multiply
337impl Mul for VipsImage {
338    type Output = VipsImage;
339    fn mul(self, b: VipsImage) -> VipsImage {
340        self.multiply(&b)
341            .unwrap()
342    }
343}
344
345impl Mul<VipsImage> for f64 {
346    type Output = VipsImage;
347    fn mul(self, b: VipsImage) -> VipsImage {
348        b.linear(
349            &[self],
350            &[0.0],
351        )
352        .unwrap()
353    }
354}
355
356impl Mul<f64> for VipsImage {
357    type Output = VipsImage;
358    fn mul(self, b: f64) -> VipsImage {
359        self.linear(
360            &[b],
361            &[0.0],
362        )
363        .unwrap()
364    }
365}
366
367impl Mul<VipsImage> for &[f64] {
368    type Output = VipsImage;
369    fn mul(self, b: VipsImage) -> VipsImage {
370        b.linear(
371            self,
372            &[0.0],
373        )
374        .unwrap()
375    }
376}
377
378impl Mul<&[f64]> for VipsImage {
379    type Output = VipsImage;
380    fn mul(self, b: &[f64]) -> VipsImage {
381        self.linear(b, &[0.0])
382            .unwrap()
383    }
384}
385
386impl<const N: usize> Mul<VipsImage> for &[f64; N] {
387    type Output = VipsImage;
388    fn mul(self, b: VipsImage) -> VipsImage {
389        b.linear(
390            self,
391            &[0.0],
392        )
393        .unwrap()
394    }
395}
396
397impl<const N: usize> Mul<&[f64; N]> for VipsImage {
398    type Output = VipsImage;
399    fn mul(self, b: &[f64; N]) -> VipsImage {
400        self.linear(b, &[0.0])
401            .unwrap()
402    }
403}
404
405// multiply ref
406impl Mul for &VipsImage {
407    type Output = VipsImage;
408    fn mul(self, b: &VipsImage) -> VipsImage {
409        self.multiply(b)
410            .unwrap()
411    }
412}
413
414impl Mul<&VipsImage> for f64 {
415    type Output = VipsImage;
416    fn mul(self, b: &VipsImage) -> VipsImage {
417        b.linear(
418            &[self],
419            &[0.0],
420        )
421        .unwrap()
422    }
423}
424
425impl Mul<f64> for &VipsImage {
426    type Output = VipsImage;
427    fn mul(self, b: f64) -> VipsImage {
428        self.linear(
429            &[b],
430            &[0.0],
431        )
432        .unwrap()
433    }
434}
435
436impl Mul<&VipsImage> for &[f64] {
437    type Output = VipsImage;
438    fn mul(self, b: &VipsImage) -> VipsImage {
439        b.linear(
440            self,
441            &[0.0],
442        )
443        .unwrap()
444    }
445}
446
447impl Mul<&[f64]> for &VipsImage {
448    type Output = VipsImage;
449    fn mul(self, b: &[f64]) -> VipsImage {
450        self.linear(b, &[0.0])
451            .unwrap()
452    }
453}
454
455impl<const N: usize> Mul<&VipsImage> for &[f64; N] {
456    type Output = VipsImage;
457    fn mul(self, b: &VipsImage) -> VipsImage {
458        b.linear(
459            self,
460            &[0.0],
461        )
462        .unwrap()
463    }
464}
465
466impl<const N: usize> Mul<&[f64; N]> for &VipsImage {
467    type Output = VipsImage;
468    fn mul(self, b: &[f64; N]) -> VipsImage {
469        self.linear(b, &[0.0])
470            .unwrap()
471    }
472}
473
474// div
475impl Div for VipsImage {
476    type Output = VipsImage;
477    fn div(self, b: VipsImage) -> VipsImage {
478        self.divide(&b)
479            .unwrap()
480    }
481}
482
483impl Div<VipsImage> for f64 {
484    type Output = VipsImage;
485    fn div(self, b: VipsImage) -> VipsImage {
486        b.boolean_const(
487            OperationBoolean::Eor,
488            &[-1.0],
489        )
490        .unwrap()
491        .linear(
492            &[self],
493            &[0.0],
494        )
495        .unwrap()
496    }
497}
498
499impl Div<f64> for VipsImage {
500    type Output = VipsImage;
501    fn div(self, b: f64) -> VipsImage {
502        self.linear(
503            &[1.0 / b],
504            &[0.0],
505        )
506        .unwrap()
507    }
508}
509
510impl Div<VipsImage> for &[f64] {
511    type Output = VipsImage;
512    fn div(self, b: VipsImage) -> VipsImage {
513        b.boolean_const(
514            OperationBoolean::Eor,
515            &[-1.0],
516        )
517        .unwrap()
518        .linear(
519            self,
520            &[0.0],
521        )
522        .unwrap()
523    }
524}
525
526impl Div<&[f64]> for VipsImage {
527    type Output = VipsImage;
528    fn div(self, b: &[f64]) -> VipsImage {
529        self.linear(
530            &invert(b),
531            &[0.0],
532        )
533        .unwrap()
534    }
535}
536
537impl<const N: usize> Div<VipsImage> for &[f64; N] {
538    type Output = VipsImage;
539    fn div(self, b: VipsImage) -> VipsImage {
540        b.boolean_const(
541            OperationBoolean::Eor,
542            &[-1.0],
543        )
544        .unwrap()
545        .linear(
546            self,
547            &[0.0],
548        )
549        .unwrap()
550    }
551}
552
553impl<const N: usize> Div<&[f64; N]> for VipsImage {
554    type Output = VipsImage;
555    fn div(self, b: &[f64; N]) -> VipsImage {
556        self.linear(
557            &invert(b),
558            &[0.0],
559        )
560        .unwrap()
561    }
562}
563
564// div ref
565impl Div for &VipsImage {
566    type Output = VipsImage;
567    fn div(self, b: &VipsImage) -> VipsImage {
568        self.divide(b)
569            .unwrap()
570    }
571}
572
573impl Div<&VipsImage> for f64 {
574    type Output = VipsImage;
575    fn div(self, b: &VipsImage) -> VipsImage {
576        b.boolean_const(
577            OperationBoolean::Eor,
578            &[-1.0],
579        )
580        .unwrap()
581        .linear(
582            &[self],
583            &[0.0],
584        )
585        .unwrap()
586    }
587}
588
589impl Div<f64> for &VipsImage {
590    type Output = VipsImage;
591    fn div(self, b: f64) -> VipsImage {
592        self.linear(
593            &[1.0 / b],
594            &[0.0],
595        )
596        .unwrap()
597    }
598}
599
600impl Div<&VipsImage> for &[f64] {
601    type Output = VipsImage;
602    fn div(self, b: &VipsImage) -> VipsImage {
603        b.boolean_const(
604            OperationBoolean::Eor,
605            &[-1.0],
606        )
607        .unwrap()
608        .linear(
609            self,
610            &[0.0],
611        )
612        .unwrap()
613    }
614}
615
616impl Div<&[f64]> for &VipsImage {
617    type Output = VipsImage;
618    fn div(self, b: &[f64]) -> VipsImage {
619        self.linear(
620            &invert(b),
621            &[0.0],
622        )
623        .unwrap()
624    }
625}
626
627impl<const N: usize> Div<&VipsImage> for &[f64; N] {
628    type Output = VipsImage;
629    fn div(self, b: &VipsImage) -> VipsImage {
630        b.boolean_const(
631            OperationBoolean::Eor,
632            &[-1.0],
633        )
634        .unwrap()
635        .linear(
636            self,
637            &[0.0],
638        )
639        .unwrap()
640    }
641}
642
643impl<const N: usize> Div<&[f64; N]> for &VipsImage {
644    type Output = VipsImage;
645    fn div(self, b: &[f64; N]) -> VipsImage {
646        self.linear(
647            &invert(b),
648            &[0.0],
649        )
650        .unwrap()
651    }
652}
653
654// rem
655impl Rem for VipsImage {
656    type Output = VipsImage;
657    fn rem(self, b: VipsImage) -> VipsImage {
658        self.remainder(&b)
659            .unwrap()
660    }
661}
662
663impl Rem<f64> for VipsImage {
664    type Output = VipsImage;
665    fn rem(self, b: f64) -> VipsImage {
666        self.remainder_const(&[b])
667            .unwrap()
668    }
669}
670
671impl Rem<&[f64]> for VipsImage {
672    type Output = VipsImage;
673    fn rem(self, b: &[f64]) -> VipsImage {
674        self.remainder_const(b)
675            .unwrap()
676    }
677}
678
679impl<const N: usize> Rem<&[f64; N]> for VipsImage {
680    type Output = VipsImage;
681    fn rem(self, b: &[f64; N]) -> VipsImage {
682        self.remainder_const(b)
683            .unwrap()
684    }
685}
686
687// BitAnd
688impl BitAnd for VipsImage {
689    type Output = VipsImage;
690    fn bitand(self, b: VipsImage) -> VipsImage {
691        self.boolean(
692            &b,
693            OperationBoolean::And,
694        )
695        .unwrap()
696    }
697}
698
699impl BitAnd<VipsImage> for f64 {
700    type Output = VipsImage;
701    fn bitand(self, b: VipsImage) -> VipsImage {
702        b.boolean_const(
703            OperationBoolean::And,
704            &[self],
705        )
706        .unwrap()
707    }
708}
709
710impl BitAnd<f64> for VipsImage {
711    type Output = VipsImage;
712    fn bitand(self, b: f64) -> VipsImage {
713        self.boolean_const(
714            OperationBoolean::And,
715            &[b],
716        )
717        .unwrap()
718    }
719}
720
721impl BitAnd<VipsImage> for &[f64] {
722    type Output = VipsImage;
723    fn bitand(self, b: VipsImage) -> VipsImage {
724        b.boolean_const(
725            OperationBoolean::And,
726            self,
727        )
728        .unwrap()
729    }
730}
731
732impl BitAnd<&[f64]> for VipsImage {
733    type Output = VipsImage;
734    fn bitand(self, b: &[f64]) -> VipsImage {
735        self.boolean_const(
736            OperationBoolean::And,
737            b,
738        )
739        .unwrap()
740    }
741}
742
743impl<const N: usize> BitAnd<VipsImage> for &[f64; N] {
744    type Output = VipsImage;
745    fn bitand(self, b: VipsImage) -> VipsImage {
746        b.boolean_const(
747            OperationBoolean::And,
748            self,
749        )
750        .unwrap()
751    }
752}
753
754impl<const N: usize> BitAnd<&[f64; N]> for VipsImage {
755    type Output = VipsImage;
756    fn bitand(self, b: &[f64; N]) -> VipsImage {
757        self.boolean_const(
758            OperationBoolean::And,
759            b,
760        )
761        .unwrap()
762    }
763}
764
765// BitAnd ref
766impl BitAnd for &VipsImage {
767    type Output = VipsImage;
768    fn bitand(self, b: &VipsImage) -> VipsImage {
769        self.boolean(
770            b,
771            OperationBoolean::And,
772        )
773        .unwrap()
774    }
775}
776
777impl BitAnd<&VipsImage> for f64 {
778    type Output = VipsImage;
779    fn bitand(self, b: &VipsImage) -> VipsImage {
780        b.boolean_const(
781            OperationBoolean::And,
782            &[self],
783        )
784        .unwrap()
785    }
786}
787
788impl BitAnd<f64> for &VipsImage {
789    type Output = VipsImage;
790    fn bitand(self, b: f64) -> VipsImage {
791        self.boolean_const(
792            OperationBoolean::And,
793            &[b],
794        )
795        .unwrap()
796    }
797}
798
799impl BitAnd<&VipsImage> for &[f64] {
800    type Output = VipsImage;
801    fn bitand(self, b: &VipsImage) -> VipsImage {
802        b.boolean_const(
803            OperationBoolean::And,
804            self,
805        )
806        .unwrap()
807    }
808}
809
810impl BitAnd<&[f64]> for &VipsImage {
811    type Output = VipsImage;
812    fn bitand(self, b: &[f64]) -> VipsImage {
813        self.boolean_const(
814            OperationBoolean::And,
815            b,
816        )
817        .unwrap()
818    }
819}
820
821impl<const N: usize> BitAnd<&VipsImage> for &[f64; N] {
822    type Output = VipsImage;
823    fn bitand(self, b: &VipsImage) -> VipsImage {
824        b.boolean_const(
825            OperationBoolean::And,
826            self,
827        )
828        .unwrap()
829    }
830}
831
832impl<const N: usize> BitAnd<&[f64; N]> for &VipsImage {
833    type Output = VipsImage;
834    fn bitand(self, b: &[f64; N]) -> VipsImage {
835        self.boolean_const(
836            OperationBoolean::And,
837            b,
838        )
839        .unwrap()
840    }
841}
842
843// BitOr
844impl BitOr for VipsImage {
845    type Output = VipsImage;
846    fn bitor(self, b: VipsImage) -> VipsImage {
847        self.boolean(
848            &b,
849            OperationBoolean::Or,
850        )
851        .unwrap()
852    }
853}
854
855impl BitOr<VipsImage> for f64 {
856    type Output = VipsImage;
857    fn bitor(self, b: VipsImage) -> VipsImage {
858        b.boolean_const(
859            OperationBoolean::Or,
860            &[self],
861        )
862        .unwrap()
863    }
864}
865
866impl BitOr<f64> for VipsImage {
867    type Output = VipsImage;
868    fn bitor(self, b: f64) -> VipsImage {
869        self.boolean_const(
870            OperationBoolean::Or,
871            &[b],
872        )
873        .unwrap()
874    }
875}
876
877impl BitOr<VipsImage> for &[f64] {
878    type Output = VipsImage;
879    fn bitor(self, b: VipsImage) -> VipsImage {
880        b.boolean_const(
881            OperationBoolean::Or,
882            self,
883        )
884        .unwrap()
885    }
886}
887
888impl BitOr<&[f64]> for VipsImage {
889    type Output = VipsImage;
890    fn bitor(self, b: &[f64]) -> VipsImage {
891        self.boolean_const(
892            OperationBoolean::Or,
893            b,
894        )
895        .unwrap()
896    }
897}
898
899impl<const N: usize> BitOr<VipsImage> for &[f64; N] {
900    type Output = VipsImage;
901    fn bitor(self, b: VipsImage) -> VipsImage {
902        b.boolean_const(
903            OperationBoolean::Or,
904            self,
905        )
906        .unwrap()
907    }
908}
909
910impl<const N: usize> BitOr<&[f64; N]> for VipsImage {
911    type Output = VipsImage;
912    fn bitor(self, b: &[f64; N]) -> VipsImage {
913        self.boolean_const(
914            OperationBoolean::Or,
915            b,
916        )
917        .unwrap()
918    }
919}
920
921// BitOr ref
922impl BitOr for &VipsImage {
923    type Output = VipsImage;
924    fn bitor(self, b: &VipsImage) -> VipsImage {
925        self.boolean(
926            b,
927            OperationBoolean::Or,
928        )
929        .unwrap()
930    }
931}
932
933impl BitOr<&VipsImage> for f64 {
934    type Output = VipsImage;
935    fn bitor(self, b: &VipsImage) -> VipsImage {
936        b.boolean_const(
937            OperationBoolean::Or,
938            &[self],
939        )
940        .unwrap()
941    }
942}
943
944impl BitOr<f64> for &VipsImage {
945    type Output = VipsImage;
946    fn bitor(self, b: f64) -> VipsImage {
947        self.boolean_const(
948            OperationBoolean::Or,
949            &[b],
950        )
951        .unwrap()
952    }
953}
954
955impl BitOr<&VipsImage> for &[f64] {
956    type Output = VipsImage;
957    fn bitor(self, b: &VipsImage) -> VipsImage {
958        b.boolean_const(
959            OperationBoolean::Or,
960            self,
961        )
962        .unwrap()
963    }
964}
965
966impl BitOr<&[f64]> for &VipsImage {
967    type Output = VipsImage;
968    fn bitor(self, b: &[f64]) -> VipsImage {
969        self.boolean_const(
970            OperationBoolean::Or,
971            b,
972        )
973        .unwrap()
974    }
975}
976
977impl<const N: usize> BitOr<&VipsImage> for &[f64; N] {
978    type Output = VipsImage;
979    fn bitor(self, b: &VipsImage) -> VipsImage {
980        b.boolean_const(
981            OperationBoolean::Or,
982            self,
983        )
984        .unwrap()
985    }
986}
987
988impl<const N: usize> BitOr<&[f64; N]> for &VipsImage {
989    type Output = VipsImage;
990    fn bitor(self, b: &[f64; N]) -> VipsImage {
991        self.boolean_const(
992            OperationBoolean::Or,
993            b,
994        )
995        .unwrap()
996    }
997}
998
999// BitXor
1000impl BitXor for VipsImage {
1001    type Output = VipsImage;
1002    fn bitxor(self, b: VipsImage) -> VipsImage {
1003        self.boolean(
1004            &b,
1005            OperationBoolean::Eor,
1006        )
1007        .unwrap()
1008    }
1009}
1010
1011impl BitXor<VipsImage> for f64 {
1012    type Output = VipsImage;
1013    fn bitxor(self, b: VipsImage) -> VipsImage {
1014        b.boolean_const(
1015            OperationBoolean::Eor,
1016            &[self],
1017        )
1018        .unwrap()
1019    }
1020}
1021
1022impl BitXor<f64> for VipsImage {
1023    type Output = VipsImage;
1024    fn bitxor(self, b: f64) -> VipsImage {
1025        self.boolean_const(
1026            OperationBoolean::Eor,
1027            &[b],
1028        )
1029        .unwrap()
1030    }
1031}
1032
1033impl BitXor<VipsImage> for &[f64] {
1034    type Output = VipsImage;
1035    fn bitxor(self, b: VipsImage) -> VipsImage {
1036        b.boolean_const(
1037            OperationBoolean::Eor,
1038            self,
1039        )
1040        .unwrap()
1041    }
1042}
1043
1044impl BitXor<&[f64]> for VipsImage {
1045    type Output = VipsImage;
1046    fn bitxor(self, b: &[f64]) -> VipsImage {
1047        self.boolean_const(
1048            OperationBoolean::Eor,
1049            b,
1050        )
1051        .unwrap()
1052    }
1053}
1054
1055impl<const N: usize> BitXor<VipsImage> for &[f64; N] {
1056    type Output = VipsImage;
1057    fn bitxor(self, b: VipsImage) -> VipsImage {
1058        b.boolean_const(
1059            OperationBoolean::Eor,
1060            self,
1061        )
1062        .unwrap()
1063    }
1064}
1065
1066impl<const N: usize> BitXor<&[f64; N]> for VipsImage {
1067    type Output = VipsImage;
1068    fn bitxor(self, b: &[f64; N]) -> VipsImage {
1069        self.boolean_const(
1070            OperationBoolean::Eor,
1071            b,
1072        )
1073        .unwrap()
1074    }
1075}
1076
1077// BitXor ref
1078impl BitXor for &VipsImage {
1079    type Output = VipsImage;
1080    fn bitxor(self, b: &VipsImage) -> VipsImage {
1081        self.boolean(
1082            b,
1083            OperationBoolean::Eor,
1084        )
1085        .unwrap()
1086    }
1087}
1088
1089impl BitXor<&VipsImage> for f64 {
1090    type Output = VipsImage;
1091    fn bitxor(self, b: &VipsImage) -> VipsImage {
1092        b.boolean_const(
1093            OperationBoolean::Eor,
1094            &[self],
1095        )
1096        .unwrap()
1097    }
1098}
1099
1100impl BitXor<f64> for &VipsImage {
1101    type Output = VipsImage;
1102    fn bitxor(self, b: f64) -> VipsImage {
1103        self.boolean_const(
1104            OperationBoolean::Eor,
1105            &[b],
1106        )
1107        .unwrap()
1108    }
1109}
1110
1111impl BitXor<&VipsImage> for &[f64] {
1112    type Output = VipsImage;
1113    fn bitxor(self, b: &VipsImage) -> VipsImage {
1114        b.boolean_const(
1115            OperationBoolean::Eor,
1116            self,
1117        )
1118        .unwrap()
1119    }
1120}
1121
1122impl BitXor<&[f64]> for &VipsImage {
1123    type Output = VipsImage;
1124    fn bitxor(self, b: &[f64]) -> VipsImage {
1125        self.boolean_const(
1126            OperationBoolean::Eor,
1127            b,
1128        )
1129        .unwrap()
1130    }
1131}
1132
1133impl<const N: usize> BitXor<&VipsImage> for &[f64; N] {
1134    type Output = VipsImage;
1135    fn bitxor(self, b: &VipsImage) -> VipsImage {
1136        b.boolean_const(
1137            OperationBoolean::Eor,
1138            self,
1139        )
1140        .unwrap()
1141    }
1142}
1143
1144impl<const N: usize> BitXor<&[f64; N]> for &VipsImage {
1145    type Output = VipsImage;
1146    fn bitxor(self, b: &[f64; N]) -> VipsImage {
1147        self.boolean_const(
1148            OperationBoolean::Eor,
1149            b,
1150        )
1151        .unwrap()
1152    }
1153}
1154
1155// Shl
1156impl Shl for VipsImage {
1157    type Output = VipsImage;
1158    fn shl(self, b: VipsImage) -> VipsImage {
1159        self.boolean(
1160            &b,
1161            OperationBoolean::Lshift,
1162        )
1163        .unwrap()
1164    }
1165}
1166
1167impl Shl<f64> for VipsImage {
1168    type Output = VipsImage;
1169    fn shl(self, b: f64) -> VipsImage {
1170        self.boolean_const(
1171            OperationBoolean::Lshift,
1172            &[b],
1173        )
1174        .unwrap()
1175    }
1176}
1177
1178impl Shl<&[f64]> for VipsImage {
1179    type Output = VipsImage;
1180    fn shl(self, b: &[f64]) -> VipsImage {
1181        self.boolean_const(
1182            OperationBoolean::Lshift,
1183            b,
1184        )
1185        .unwrap()
1186    }
1187}
1188
1189impl<const N: usize> Shl<&[f64; N]> for VipsImage {
1190    type Output = VipsImage;
1191    fn shl(self, b: &[f64; N]) -> VipsImage {
1192        self.boolean_const(
1193            OperationBoolean::Lshift,
1194            b,
1195        )
1196        .unwrap()
1197    }
1198}
1199
1200// Shl ref
1201impl Shl for &VipsImage {
1202    type Output = VipsImage;
1203    fn shl(self, b: &VipsImage) -> VipsImage {
1204        self.boolean(
1205            b,
1206            OperationBoolean::Lshift,
1207        )
1208        .unwrap()
1209    }
1210}
1211
1212impl Shl<f64> for &VipsImage {
1213    type Output = VipsImage;
1214    fn shl(self, b: f64) -> VipsImage {
1215        self.boolean_const(
1216            OperationBoolean::Lshift,
1217            &[b],
1218        )
1219        .unwrap()
1220    }
1221}
1222
1223impl Shl<&[f64]> for &VipsImage {
1224    type Output = VipsImage;
1225    fn shl(self, b: &[f64]) -> VipsImage {
1226        self.boolean_const(
1227            OperationBoolean::Lshift,
1228            b,
1229        )
1230        .unwrap()
1231    }
1232}
1233
1234impl<const N: usize> Shl<&[f64; N]> for &VipsImage {
1235    type Output = VipsImage;
1236    fn shl(self, b: &[f64; N]) -> VipsImage {
1237        self.boolean_const(
1238            OperationBoolean::Lshift,
1239            b,
1240        )
1241        .unwrap()
1242    }
1243}
1244
1245// Shr
1246impl Shr for VipsImage {
1247    type Output = VipsImage;
1248    fn shr(self, b: VipsImage) -> VipsImage {
1249        self.boolean(
1250            &b,
1251            OperationBoolean::Rshift,
1252        )
1253        .unwrap()
1254    }
1255}
1256
1257impl Shr<f64> for VipsImage {
1258    type Output = VipsImage;
1259    fn shr(self, b: f64) -> VipsImage {
1260        self.boolean_const(
1261            OperationBoolean::Rshift,
1262            &[b],
1263        )
1264        .unwrap()
1265    }
1266}
1267
1268impl Shr<&[f64]> for VipsImage {
1269    type Output = VipsImage;
1270    fn shr(self, b: &[f64]) -> VipsImage {
1271        self.boolean_const(
1272            OperationBoolean::Rshift,
1273            b,
1274        )
1275        .unwrap()
1276    }
1277}
1278
1279impl<const N: usize> Shr<&[f64; N]> for VipsImage {
1280    type Output = VipsImage;
1281    fn shr(self, b: &[f64; N]) -> VipsImage {
1282        self.boolean_const(
1283            OperationBoolean::Rshift,
1284            b,
1285        )
1286        .unwrap()
1287    }
1288}
1289
1290// Shr ref
1291impl Shr for &VipsImage {
1292    type Output = VipsImage;
1293    fn shr(self, b: &VipsImage) -> VipsImage {
1294        self.boolean(
1295            b,
1296            OperationBoolean::Rshift,
1297        )
1298        .unwrap()
1299    }
1300}
1301
1302impl Shr<f64> for &VipsImage {
1303    type Output = VipsImage;
1304    fn shr(self, b: f64) -> VipsImage {
1305        self.boolean_const(
1306            OperationBoolean::Rshift,
1307            &[b],
1308        )
1309        .unwrap()
1310    }
1311}
1312
1313impl Shr<&[f64]> for &VipsImage {
1314    type Output = VipsImage;
1315    fn shr(self, b: &[f64]) -> VipsImage {
1316        self.boolean_const(
1317            OperationBoolean::Rshift,
1318            b,
1319        )
1320        .unwrap()
1321    }
1322}
1323
1324impl<const N: usize> Shr<&[f64; N]> for &VipsImage {
1325    type Output = VipsImage;
1326    fn shr(self, b: &[f64; N]) -> VipsImage {
1327        self.boolean_const(
1328            OperationBoolean::Rshift,
1329            b,
1330        )
1331        .unwrap()
1332    }
1333}
1334
1335// Not in ops
1336pub trait Eq<T> {
1337    type Output: ?Sized;
1338    fn eq(self, b: T) -> Self::Output;
1339}
1340
1341pub trait Lt<T> {
1342    type Output: ?Sized;
1343    fn lt(self, b: T) -> Self::Output;
1344}
1345
1346pub trait Le<T> {
1347    type Output: ?Sized;
1348    fn le(self, b: T) -> Self::Output;
1349}
1350
1351pub trait Gt<T> {
1352    type Output: ?Sized;
1353    fn gt(self, b: T) -> Self::Output;
1354}
1355
1356pub trait Ge<T> {
1357    type Output: ?Sized;
1358    fn ge(self, b: T) -> Self::Output;
1359}
1360
1361// eq
1362impl Eq<VipsImage> for VipsImage {
1363    type Output = VipsImage;
1364    fn eq(self, b: VipsImage) -> Self::Output {
1365        self.relational(
1366            &b,
1367            OperationRelational::Equal,
1368        )
1369        .unwrap()
1370    }
1371}
1372
1373impl Eq<VipsImage> for f64 {
1374    type Output = VipsImage;
1375    fn eq(self, b: VipsImage) -> Self::Output {
1376        b.relational_const(
1377            OperationRelational::Equal,
1378            &[self],
1379        )
1380        .unwrap()
1381    }
1382}
1383
1384impl Eq<f64> for VipsImage {
1385    type Output = VipsImage;
1386    fn eq(self, b: f64) -> Self::Output {
1387        self.relational_const(
1388            OperationRelational::Equal,
1389            &[b],
1390        )
1391        .unwrap()
1392    }
1393}
1394
1395impl Eq<VipsImage> for &[f64] {
1396    type Output = VipsImage;
1397    fn eq(self, b: VipsImage) -> Self::Output {
1398        b.relational_const(
1399            OperationRelational::Equal,
1400            self,
1401        )
1402        .unwrap()
1403    }
1404}
1405
1406impl Eq<&[f64]> for VipsImage {
1407    type Output = VipsImage;
1408    fn eq(self, b: &[f64]) -> Self::Output {
1409        self.relational_const(
1410            OperationRelational::Equal,
1411            b,
1412        )
1413        .unwrap()
1414    }
1415}
1416
1417impl<const N: usize> Eq<VipsImage> for &[f64; N] {
1418    type Output = VipsImage;
1419    fn eq(self, b: VipsImage) -> Self::Output {
1420        b.relational_const(
1421            OperationRelational::Equal,
1422            self,
1423        )
1424        .unwrap()
1425    }
1426}
1427
1428impl<const N: usize> Eq<&[f64; N]> for VipsImage {
1429    type Output = VipsImage;
1430    fn eq(self, b: &[f64; N]) -> Self::Output {
1431        self.relational_const(
1432            OperationRelational::Equal,
1433            b,
1434        )
1435        .unwrap()
1436    }
1437}
1438
1439// lt
1440impl Lt<VipsImage> for VipsImage {
1441    type Output = VipsImage;
1442    fn lt(self, b: VipsImage) -> Self::Output {
1443        self.relational(
1444            &b,
1445            OperationRelational::Less,
1446        )
1447        .unwrap()
1448    }
1449}
1450
1451impl Lt<VipsImage> for f64 {
1452    type Output = VipsImage;
1453    fn lt(self, b: VipsImage) -> Self::Output {
1454        b.relational_const(
1455            OperationRelational::More,
1456            &[self],
1457        )
1458        .unwrap()
1459    }
1460}
1461
1462impl Lt<f64> for VipsImage {
1463    type Output = VipsImage;
1464    fn lt(self, b: f64) -> Self::Output {
1465        self.relational_const(
1466            OperationRelational::Less,
1467            &[b],
1468        )
1469        .unwrap()
1470    }
1471}
1472
1473impl Lt<VipsImage> for &[f64] {
1474    type Output = VipsImage;
1475    fn lt(self, b: VipsImage) -> Self::Output {
1476        b.relational_const(
1477            OperationRelational::More,
1478            self,
1479        )
1480        .unwrap()
1481    }
1482}
1483
1484impl Lt<&[f64]> for VipsImage {
1485    type Output = VipsImage;
1486    fn lt(self, b: &[f64]) -> Self::Output {
1487        self.relational_const(
1488            OperationRelational::Less,
1489            b,
1490        )
1491        .unwrap()
1492    }
1493}
1494
1495impl<const N: usize> Lt<VipsImage> for &[f64; N] {
1496    type Output = VipsImage;
1497    fn lt(self, b: VipsImage) -> Self::Output {
1498        b.relational_const(
1499            OperationRelational::More,
1500            self,
1501        )
1502        .unwrap()
1503    }
1504}
1505
1506impl<const N: usize> Lt<&[f64; N]> for VipsImage {
1507    type Output = VipsImage;
1508    fn lt(self, b: &[f64; N]) -> Self::Output {
1509        self.relational_const(
1510            OperationRelational::Less,
1511            b,
1512        )
1513        .unwrap()
1514    }
1515}
1516
1517// lt ref
1518impl Lt<&VipsImage> for &VipsImage {
1519    type Output = VipsImage;
1520    fn lt(self, b: &VipsImage) -> Self::Output {
1521        self.relational(
1522            b,
1523            OperationRelational::Less,
1524        )
1525        .unwrap()
1526    }
1527}
1528
1529impl Lt<&VipsImage> for f64 {
1530    type Output = VipsImage;
1531    fn lt(self, b: &VipsImage) -> Self::Output {
1532        b.relational_const(
1533            OperationRelational::More,
1534            &[self],
1535        )
1536        .unwrap()
1537    }
1538}
1539
1540impl Lt<f64> for &VipsImage {
1541    type Output = VipsImage;
1542    fn lt(self, b: f64) -> Self::Output {
1543        self.relational_const(
1544            OperationRelational::Less,
1545            &[b],
1546        )
1547        .unwrap()
1548    }
1549}
1550
1551impl Lt<&VipsImage> for &[f64] {
1552    type Output = VipsImage;
1553    fn lt(self, b: &VipsImage) -> Self::Output {
1554        b.relational_const(
1555            OperationRelational::More,
1556            self,
1557        )
1558        .unwrap()
1559    }
1560}
1561
1562impl Lt<&[f64]> for &VipsImage {
1563    type Output = VipsImage;
1564    fn lt(self, b: &[f64]) -> Self::Output {
1565        self.relational_const(
1566            OperationRelational::Less,
1567            b,
1568        )
1569        .unwrap()
1570    }
1571}
1572
1573impl<const N: usize> Lt<&VipsImage> for &[f64; N] {
1574    type Output = VipsImage;
1575    fn lt(self, b: &VipsImage) -> Self::Output {
1576        b.relational_const(
1577            OperationRelational::More,
1578            self,
1579        )
1580        .unwrap()
1581    }
1582}
1583
1584impl<const N: usize> Lt<&[f64; N]> for &VipsImage {
1585    type Output = VipsImage;
1586    fn lt(self, b: &[f64; N]) -> Self::Output {
1587        self.relational_const(
1588            OperationRelational::Less,
1589            b,
1590        )
1591        .unwrap()
1592    }
1593}
1594
1595// le
1596impl Le<VipsImage> for VipsImage {
1597    type Output = VipsImage;
1598    fn le(self, b: VipsImage) -> Self::Output {
1599        self.relational(
1600            &b,
1601            OperationRelational::Lesseq,
1602        )
1603        .unwrap()
1604    }
1605}
1606
1607impl Le<VipsImage> for f64 {
1608    type Output = VipsImage;
1609    fn le(self, b: VipsImage) -> Self::Output {
1610        b.relational_const(
1611            OperationRelational::Moreeq,
1612            &[self],
1613        )
1614        .unwrap()
1615    }
1616}
1617
1618impl Le<f64> for VipsImage {
1619    type Output = VipsImage;
1620    fn le(self, b: f64) -> Self::Output {
1621        self.relational_const(
1622            OperationRelational::Lesseq,
1623            &[b],
1624        )
1625        .unwrap()
1626    }
1627}
1628
1629impl Le<VipsImage> for &[f64] {
1630    type Output = VipsImage;
1631    fn le(self, b: VipsImage) -> Self::Output {
1632        b.relational_const(
1633            OperationRelational::Moreeq,
1634            self,
1635        )
1636        .unwrap()
1637    }
1638}
1639
1640impl Le<&[f64]> for VipsImage {
1641    type Output = VipsImage;
1642    fn le(self, b: &[f64]) -> Self::Output {
1643        self.relational_const(
1644            OperationRelational::Lesseq,
1645            b,
1646        )
1647        .unwrap()
1648    }
1649}
1650
1651impl<const N: usize> Le<VipsImage> for &[f64; N] {
1652    type Output = VipsImage;
1653    fn le(self, b: VipsImage) -> Self::Output {
1654        b.relational_const(
1655            OperationRelational::Moreeq,
1656            self,
1657        )
1658        .unwrap()
1659    }
1660}
1661
1662impl<const N: usize> Le<&[f64; N]> for VipsImage {
1663    type Output = VipsImage;
1664    fn le(self, b: &[f64; N]) -> Self::Output {
1665        self.relational_const(
1666            OperationRelational::Lesseq,
1667            b,
1668        )
1669        .unwrap()
1670    }
1671}
1672
1673// le ref
1674impl Le<&VipsImage> for &VipsImage {
1675    type Output = VipsImage;
1676    fn le(self, b: &VipsImage) -> Self::Output {
1677        self.relational(
1678            b,
1679            OperationRelational::Lesseq,
1680        )
1681        .unwrap()
1682    }
1683}
1684
1685impl Le<&VipsImage> for f64 {
1686    type Output = VipsImage;
1687    fn le(self, b: &VipsImage) -> Self::Output {
1688        b.relational_const(
1689            OperationRelational::Moreeq,
1690            &[self],
1691        )
1692        .unwrap()
1693    }
1694}
1695
1696impl Le<f64> for &VipsImage {
1697    type Output = VipsImage;
1698    fn le(self, b: f64) -> Self::Output {
1699        self.relational_const(
1700            OperationRelational::Lesseq,
1701            &[b],
1702        )
1703        .unwrap()
1704    }
1705}
1706
1707impl Le<&VipsImage> for &[f64] {
1708    type Output = VipsImage;
1709    fn le(self, b: &VipsImage) -> Self::Output {
1710        b.relational_const(
1711            OperationRelational::Moreeq,
1712            self,
1713        )
1714        .unwrap()
1715    }
1716}
1717
1718impl Le<&[f64]> for &VipsImage {
1719    type Output = VipsImage;
1720    fn le(self, b: &[f64]) -> Self::Output {
1721        self.relational_const(
1722            OperationRelational::Lesseq,
1723            b,
1724        )
1725        .unwrap()
1726    }
1727}
1728
1729impl<const N: usize> Le<&VipsImage> for &[f64; N] {
1730    type Output = VipsImage;
1731    fn le(self, b: &VipsImage) -> Self::Output {
1732        b.relational_const(
1733            OperationRelational::Moreeq,
1734            self,
1735        )
1736        .unwrap()
1737    }
1738}
1739
1740impl<const N: usize> Le<&[f64; N]> for &VipsImage {
1741    type Output = VipsImage;
1742    fn le(self, b: &[f64; N]) -> Self::Output {
1743        self.relational_const(
1744            OperationRelational::Lesseq,
1745            b,
1746        )
1747        .unwrap()
1748    }
1749}
1750
1751// gt
1752impl Gt<VipsImage> for VipsImage {
1753    type Output = VipsImage;
1754    fn gt(self, b: VipsImage) -> Self::Output {
1755        self.relational(
1756            &b,
1757            OperationRelational::More,
1758        )
1759        .unwrap()
1760    }
1761}
1762
1763impl Gt<VipsImage> for f64 {
1764    type Output = VipsImage;
1765    fn gt(self, b: VipsImage) -> Self::Output {
1766        b.relational_const(
1767            OperationRelational::Less,
1768            &[self],
1769        )
1770        .unwrap()
1771    }
1772}
1773
1774impl Gt<f64> for VipsImage {
1775    type Output = VipsImage;
1776    fn gt(self, b: f64) -> Self::Output {
1777        self.relational_const(
1778            OperationRelational::More,
1779            &[b],
1780        )
1781        .unwrap()
1782    }
1783}
1784
1785impl Gt<VipsImage> for &[f64] {
1786    type Output = VipsImage;
1787    fn gt(self, b: VipsImage) -> Self::Output {
1788        b.relational_const(
1789            OperationRelational::Less,
1790            self,
1791        )
1792        .unwrap()
1793    }
1794}
1795
1796impl Gt<&[f64]> for VipsImage {
1797    type Output = VipsImage;
1798    fn gt(self, b: &[f64]) -> Self::Output {
1799        self.relational_const(
1800            OperationRelational::More,
1801            b,
1802        )
1803        .unwrap()
1804    }
1805}
1806
1807impl<const N: usize> Gt<VipsImage> for &[f64; N] {
1808    type Output = VipsImage;
1809    fn gt(self, b: VipsImage) -> Self::Output {
1810        b.relational_const(
1811            OperationRelational::Less,
1812            self,
1813        )
1814        .unwrap()
1815    }
1816}
1817
1818impl<const N: usize> Gt<&[f64; N]> for VipsImage {
1819    type Output = VipsImage;
1820    fn gt(self, b: &[f64; N]) -> Self::Output {
1821        self.relational_const(
1822            OperationRelational::More,
1823            b,
1824        )
1825        .unwrap()
1826    }
1827}
1828
1829// gt ref
1830impl Gt<&VipsImage> for &VipsImage {
1831    type Output = VipsImage;
1832    fn gt(self, b: &VipsImage) -> Self::Output {
1833        self.relational(
1834            b,
1835            OperationRelational::More,
1836        )
1837        .unwrap()
1838    }
1839}
1840
1841impl Gt<&VipsImage> for f64 {
1842    type Output = VipsImage;
1843    fn gt(self, b: &VipsImage) -> Self::Output {
1844        b.relational_const(
1845            OperationRelational::Less,
1846            &[self],
1847        )
1848        .unwrap()
1849    }
1850}
1851
1852impl Gt<f64> for &VipsImage {
1853    type Output = VipsImage;
1854    fn gt(self, b: f64) -> Self::Output {
1855        self.relational_const(
1856            OperationRelational::More,
1857            &[b],
1858        )
1859        .unwrap()
1860    }
1861}
1862
1863impl Gt<&VipsImage> for &[f64] {
1864    type Output = VipsImage;
1865    fn gt(self, b: &VipsImage) -> Self::Output {
1866        b.relational_const(
1867            OperationRelational::Less,
1868            self,
1869        )
1870        .unwrap()
1871    }
1872}
1873
1874impl Gt<&[f64]> for &VipsImage {
1875    type Output = VipsImage;
1876    fn gt(self, b: &[f64]) -> Self::Output {
1877        self.relational_const(
1878            OperationRelational::More,
1879            b,
1880        )
1881        .unwrap()
1882    }
1883}
1884
1885impl<const N: usize> Gt<&VipsImage> for &[f64; N] {
1886    type Output = VipsImage;
1887    fn gt(self, b: &VipsImage) -> Self::Output {
1888        b.relational_const(
1889            OperationRelational::Less,
1890            self,
1891        )
1892        .unwrap()
1893    }
1894}
1895
1896impl<const N: usize> Gt<&[f64; N]> for &VipsImage {
1897    type Output = VipsImage;
1898    fn gt(self, b: &[f64; N]) -> Self::Output {
1899        self.relational_const(
1900            OperationRelational::More,
1901            b,
1902        )
1903        .unwrap()
1904    }
1905}
1906
1907// ge
1908impl Ge<VipsImage> for VipsImage {
1909    type Output = VipsImage;
1910    fn ge(self, b: VipsImage) -> Self::Output {
1911        self.relational(
1912            &b,
1913            OperationRelational::Moreeq,
1914        )
1915        .unwrap()
1916    }
1917}
1918
1919impl Ge<VipsImage> for f64 {
1920    type Output = VipsImage;
1921    fn ge(self, b: VipsImage) -> Self::Output {
1922        b.relational_const(
1923            OperationRelational::Lesseq,
1924            &[self],
1925        )
1926        .unwrap()
1927    }
1928}
1929
1930impl Ge<f64> for VipsImage {
1931    type Output = VipsImage;
1932    fn ge(self, b: f64) -> Self::Output {
1933        self.relational_const(
1934            OperationRelational::Moreeq,
1935            &[b],
1936        )
1937        .unwrap()
1938    }
1939}
1940
1941impl Ge<VipsImage> for &[f64] {
1942    type Output = VipsImage;
1943    fn ge(self, b: VipsImage) -> Self::Output {
1944        b.relational_const(
1945            OperationRelational::Lesseq,
1946            self,
1947        )
1948        .unwrap()
1949    }
1950}
1951
1952impl Ge<&[f64]> for VipsImage {
1953    type Output = VipsImage;
1954    fn ge(self, b: &[f64]) -> Self::Output {
1955        self.relational_const(
1956            OperationRelational::Moreeq,
1957            b,
1958        )
1959        .unwrap()
1960    }
1961}
1962
1963impl<const N: usize> Ge<VipsImage> for &[f64; N] {
1964    type Output = VipsImage;
1965    fn ge(self, b: VipsImage) -> Self::Output {
1966        b.relational_const(
1967            OperationRelational::Lesseq,
1968            self,
1969        )
1970        .unwrap()
1971    }
1972}
1973
1974impl<const N: usize> Ge<&[f64; N]> for VipsImage {
1975    type Output = VipsImage;
1976    fn ge(self, b: &[f64; N]) -> Self::Output {
1977        self.relational_const(
1978            OperationRelational::Moreeq,
1979            b,
1980        )
1981        .unwrap()
1982    }
1983}
1984
1985// ge ref
1986impl Ge<&VipsImage> for &VipsImage {
1987    type Output = VipsImage;
1988    fn ge(self, b: &VipsImage) -> Self::Output {
1989        self.relational(
1990            b,
1991            OperationRelational::Moreeq,
1992        )
1993        .unwrap()
1994    }
1995}
1996
1997impl Ge<&VipsImage> for f64 {
1998    type Output = VipsImage;
1999    fn ge(self, b: &VipsImage) -> Self::Output {
2000        b.relational_const(
2001            OperationRelational::Lesseq,
2002            &[self],
2003        )
2004        .unwrap()
2005    }
2006}
2007
2008impl Ge<f64> for &VipsImage {
2009    type Output = VipsImage;
2010    fn ge(self, b: f64) -> Self::Output {
2011        self.relational_const(
2012            OperationRelational::Moreeq,
2013            &[b],
2014        )
2015        .unwrap()
2016    }
2017}
2018
2019impl Ge<&VipsImage> for &[f64] {
2020    type Output = VipsImage;
2021    fn ge(self, b: &VipsImage) -> Self::Output {
2022        b.relational_const(
2023            OperationRelational::Lesseq,
2024            self,
2025        )
2026        .unwrap()
2027    }
2028}
2029
2030impl Ge<&[f64]> for &VipsImage {
2031    type Output = VipsImage;
2032    fn ge(self, b: &[f64]) -> Self::Output {
2033        self.relational_const(
2034            OperationRelational::Moreeq,
2035            b,
2036        )
2037        .unwrap()
2038    }
2039}
2040
2041impl<const N: usize> Ge<&VipsImage> for &[f64; N] {
2042    type Output = VipsImage;
2043    fn ge(self, b: &VipsImage) -> Self::Output {
2044        b.relational_const(
2045            OperationRelational::Lesseq,
2046            self,
2047        )
2048        .unwrap()
2049    }
2050}
2051
2052impl<const N: usize> Ge<&[f64; N]> for &VipsImage {
2053    type Output = VipsImage;
2054    fn ge(self, b: &[f64; N]) -> Self::Output {
2055        self.relational_const(
2056            OperationRelational::Moreeq,
2057            b,
2058        )
2059        .unwrap()
2060    }
2061}