sixtyfps_compilerlib/
embedded_resources.rs1#[cfg(not(target_arch = "wasm32"))]
5pub use tiny_skia::IntRect as Rect;
6
7#[derive(Debug, Clone, Copy, Default)]
8pub struct Size {
9 pub width: u32,
10 pub height: u32,
11}
12
13#[derive(Clone, Copy, Debug)]
14pub enum PixelFormat {
15 Rgb,
17 Rgba,
19 AlphaMap([u8; 3]),
21}
22
23#[cfg(not(target_arch = "wasm32"))]
24#[derive(Debug, Clone)]
25pub struct Texture {
26 pub total_size: Size,
27 pub rect: Rect,
28 pub data: Vec<u8>,
29 pub format: PixelFormat,
30}
31
32#[cfg(not(target_arch = "wasm32"))]
33impl Texture {
34 pub fn new_empty() -> Self {
35 Self {
36 total_size: Size::default(),
37 rect: Rect::from_xywh(0, 0, 1, 1).unwrap(),
38 data: vec![0, 0, 0, 0],
39 format: PixelFormat::Rgba,
40 }
41 }
42}
43
44#[derive(Debug, Clone)]
45pub enum EmbeddedResourcesKind {
46 RawData,
48 TextureData(#[cfg(not(target_arch = "wasm32"))] Texture),
50}
51
52#[derive(Debug, Clone)]
53pub struct EmbeddedResources {
54 pub id: usize,
56
57 pub kind: EmbeddedResourcesKind,
58}