1#[derive(Copy, Clone, Debug, PartialEq)]
3pub enum PolyMode {
4 Points,
5 WireFrame,
6 Filled,
7}
8
9#[derive(Copy, Clone, Debug, PartialEq)]
11pub enum Cull {
12 Clock,
13 AntiClock,
14}
15
16#[derive(Copy, Clone, Debug, Default, PartialEq)]
18pub enum DrawMode {
19 Points,
20 Lines,
21 #[default]
22 Triangles,
23 Strip,
24}
25
26#[derive(Copy, Clone, Debug, PartialEq)]
30pub enum ImgFormat {
31 R(u8),
32 RG(u8),
33 RGB(u8),
34 RGBA(u8),
35}
36
37impl ImgFormat {
38 pub fn channels(&self) -> u8 {
40 match self {
41 ImgFormat::R(_) => 1,
42 ImgFormat::RG(_) => 2,
43 ImgFormat::RGB(_) => 3,
44 ImgFormat::RGBA(_) => 4,
45 }
46 }
47 pub fn bit_depth(&self) -> u8 {
49 *match self {
50 ImgFormat::R(bd) => bd,
51 ImgFormat::RG(bd) => bd,
52 ImgFormat::RGB(bd) => bd,
53 ImgFormat::RGBA(bd) => bd,
54 }
55 }
56 pub fn pixel_size(&self) -> u8 {
58 self.channels() * self.bit_depth() / 8
59 }
60 pub fn from(channels: u8, bit_depth: u8) -> ImgFormat {
64 match channels {
65 1 => ImgFormat::R(bit_depth),
66 2 => ImgFormat::RG(bit_depth),
67 3 => ImgFormat::RGB(bit_depth),
68 _ => ImgFormat::RGBA(bit_depth),
69 }
70 }
71}
72
73#[derive(Debug, Clone, Copy, PartialEq)]
75pub enum ImgFilter {
76 Closest,
77 Linear,
78}
79
80#[derive(Debug, Clone, Copy, PartialEq)]
82pub enum ImgWrap {
83 Repeat,
84 Extend,
85 Clip,
86}
87
88#[derive(Clone, Debug, PartialEq)]
90pub enum ATTRType {
91 U8,
92 I8,
93 U16,
94 I16,
95 U32,
96 I32,
97 F32,
98 F64,
99}