tauri_plugin_android_fs/models/
image.rs

1use serde::{Deserialize, Serialize};
2
3
4#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, Deserialize, Serialize)]
5pub struct Size {
6    pub width: u32,
7    pub height: u32
8}
9
10#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
11#[non_exhaustive]
12pub enum ImageFormat {
13
14    /// - Loss less
15    /// - Support transparency
16    Png,
17
18    /// - Lossy
19    /// - Unsupport transparency
20    Jpeg,
21
22    /// - Lossy (**Not loss less**)
23    /// - Support transparency
24    Webp,
25
26    /// - Lossy
27    /// - Unsupport transparency
28    JpegWith {
29
30        /// Range is `0.0 ~ 1.0`  
31        /// 0.0 means compress for the smallest size.  
32        /// 1.0 means compress for max visual quality.  
33        quality: f32
34    },
35
36    /// - Lossy
37    /// - Support transparency
38    WebpWith {
39        
40        /// Range is `0.0 ~ 1.0`  
41        /// 0.0 means compress for the smallest size.  
42        /// 1.0 means compress for max visual quality.  
43        quality: f32
44    }
45}