rs_vips/
operator.rs

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