@@ -11,12 +11,56 @@ mod ffi {
11
11
unsafe extern "C++" {
12
12
include ! ( "cxx-qt-lib/qimage.h" ) ;
13
13
type QImage = super :: QImage ;
14
+ include ! ( "cxx-qt-lib/qsize.h" ) ;
15
+ type QSize = crate :: QSize ;
16
+ include ! ( "cxx-qt-lib/qrect.h" ) ;
17
+ type QRect = crate :: QRect ;
18
+ include ! ( "cxx-qt-lib/qcolor.h" ) ;
19
+ type QColor = crate :: QColor ;
20
+
14
21
15
22
/// Whether the QImage is null.
16
23
///
17
24
/// This means that the QImage has all parameters set to zero and no allocated data.
18
25
#[ rust_name = "is_null" ]
19
26
fn isNull ( self : & QImage ) -> bool ;
27
+
28
+ /// Returns true if all the colors in the image are shades of gray
29
+ #[ rust_name = "all_gray" ]
30
+ fn allGray ( self : & QImage ) -> bool ;
31
+
32
+ /// For 32-bit images, this function is equivalent to allGray().
33
+ /// For color indexed images, this function returns true if color(i) is QRgb(i, i, i)
34
+ /// for all indexes of the color table; otherwise returns false.
35
+ #[ rust_name = "is_gray_scale" ]
36
+ fn isGrayscale ( self : & QImage ) -> bool ;
37
+
38
+ /// Returns true if the image has a format that respects the alpha channel, otherwise returns false.
39
+ #[ rust_name = "has_alpha_channel" ]
40
+ fn hasAlphaChannel ( self : & QImage ) -> bool ;
41
+
42
+ /// Returns the size of the color table for the image.
43
+ #[ rust_name = "color_count" ]
44
+ fn colorCount ( self : & QImage ) -> i32 ;
45
+
46
+ /// Returns the depth of the image.
47
+ fn depth ( self : & QImage ) -> i32 ;
48
+
49
+ /// Returns the height of the image.
50
+ fn height ( self : & QImage ) -> i32 ;
51
+
52
+ /// Returns the width of the image.
53
+ fn width ( self : & QImage ) -> i32 ;
54
+
55
+ /// Returns the size of the image.
56
+ fn size ( self : & QImage ) -> QSize ;
57
+
58
+ /// Returns the enclosing rectangle (0, 0, width(), height()) of the image.
59
+ fn rect ( self : & QImage ) -> QRect ;
60
+
61
+ /// Returns the color of the pixel at coordinates (x, y) as a QColor.
62
+ #[ rust_name = "pixel_color" ]
63
+ fn pixelColor ( self : & QImage , x : i32 , y : i32 ) -> QColor ;
20
64
}
21
65
22
66
#[ namespace = "rust::cxxqtlib1" ]
0 commit comments