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
use bytes::Bytes;
use std::future::Future;
use crate::ui::ImageByteFormat;
pub struct DartImage {
// The number of image pixels along the image's vertical axis.
pub height: i32,
// The number of image pixels along the image's horizontal axis.
pub width: i32,
}
impl DartImage {
// Creates a disposable handle to this image.
pub fn clone() -> DartImage {
todo!()
}
// Release this handle's claim on the underlying Image. This handle is no longer usable after this method is called.
pub fn dispose() {}
// Returns true if other is a clone of this and thus shares the same underlying image memory, even if this or other is disposed.
pub fn is_clone_of(other: DartImage) -> bool {
todo!()
}
// Converts the Image object into a byte array.
// pub fn to_byte_data(
// format: Option<ImageByteFormat>, /*= ImageByteFormat.rawRgba*/
// ) -> impl Future<Output = Option<Bytes>> {
pub fn to_byte_data(
format: Option<ImageByteFormat>, /*= ImageByteFormat.rawRgba*/
) -> Box<dyn Future<Output = Option<Bytes>>> {
todo!()
}
}
pub struct FrameInfo {
// The duration this frame should be shown.
// duration: Duration,
// The Image object for this frame.
// image: Image, // dart Image
}
pub struct Codec {
// Number of frames in this image.
pub frame_count: i32,
// Number of times to repeat the animation.
pub repetition_count: i32,
}
impl Codec {
// Release the resources used by this object. The object is no longer usable after this method is called.
pub fn dispose() {}
// Fetches the next animation frame.
// pub fn getNextFrame() -> impl Future<Output = FrameInfo> {
pub fn get_next_frame() -> Box<dyn Future<Output = FrameInfo>> {
todo!()
}
}
// impl<T: Default> Default for ImageProvider<T> {
// fn default() -> Self {
// Self(Default::default())
// }
// }