123456789101112131415161718192021222324252627282930 |
- #![allow(dead_code)]
- use binrw::{BinRead, BinWrite};
- use crate::{array_of::ArrayOf, field_of::FieldOf};
- /// Wrapper for basic types determined by initial u32 size
- #[derive(BinRead, BinWrite, PartialEq, Debug)]
- pub enum BasicField {
- U16(FieldOf<u16>),
- U32(FieldOf<u32>),
- Double(FieldOf<f64>),
- }
- /// Generic field with structure of length + data
- pub type Field = ArrayOf<u8>;
- #[derive(BinRead, BinWrite, PartialEq, Debug)]
- pub struct Rgba {
- red: u8,
- green: u8,
- blue: u8,
- alpha: u8,
- }
- #[derive(BinRead, BinWrite, PartialEq, Debug)]
- pub struct Point {
- x: f64,
- y: f64,
- }
|