1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
//! ## Params
//!
//! * `size` path to a function that returns the size.
//!
//! ## Optional params
//!
//! * `border` path to a function that returns the border color.
//! * `tint` path to a function tht returns a color to tint the image with.
//! * `uv0` path to a function that returns the first uv coordinate. The default
//! value is `[0.0, 0.0]`.
//! * `uv0` path to a function that returns the second uv coordinate. The
//! default value is `[1.0, 1.0]`.
//! * `map` Applies a mapping function to `&mut Self`.
//!
//! ## Limitations
//!
//! * Parameters cannot be set at runtime (including `uv`s). This may be a deal
//! breaker for most applications that deal with texture atlases.
//!
//! ## Example
//!
//! ```
//! #[derive(imgui_ext::Gui)]
//! struct Image {
//! #[imgui(image(size = "size", uv0 = "uv0", uv1 = "uv1"))]
//! texture: usize,
//! #[imgui(image(size = "size", tint = "tint", border = "border"))]
//! texture_tint: usize,
//! }
//!
//! fn size() -> [f32; 2] {
//! [512.0, 64.0]
//! }
//!
//! fn tint() -> [f32; 4] {
//! [1.0, 0.0, 1.0, 1.0]
//! }
//!
//! fn border() -> [f32; 4] {
//! [1.0, 1.0, 1.0, 1.0]
//! }
//!
//! fn uv0() -> [f32; 2] {
//! [0.0, 0.0]
//! }
//!
//! fn uv1() -> [f32; 2] {
//! [1.0, 1.0]
//! }
//! ```
//!
//! ### Result
//!
//! ![][result]
//!
//! [result]: https://i.imgur.com/RoJdyGR.png
//!
use ;