[−][src]Struct crnlib::Header
Fields
magic: [u8; 2]
header_size: u16
header_crc16: u16
file_size: u32
data_crc16: u16
width: u16
height: u16
level_count: u8
face_count: u8
format: Format
flags: u16
reserved: u32
userdata: [u32; 2]
color_endpoints: Palette
color_selectors: Palette
alpha_endpoints: Palette
alpha_selectors: Palette
table_size: u16
table_offset: u32
level_offset: Vec<u32>
Implementations
impl Header
[src]
pub fn parse(input: &[u8]) -> Result<Self, Error>
[src]
pub fn fixed_size() -> usize
[src]
pub fn crc16(init: u16, input: &[u8]) -> u16
[src]
pub fn crc16_poly(init: u16, poly: u16, input: &[u8]) -> u16
[src]
pub fn check_crc(&self, input: &[u8]) -> bool
[src]
pub fn block_size(&self) -> usize
[src]
pub fn get_level_data<'a>(
&self,
input: &'a [u8],
idx: usize
) -> Option<&'a [u8]>
[src]
&self,
input: &'a [u8],
idx: usize
) -> Option<&'a [u8]>
pub fn get_table(&self, input: &[u8]) -> Result<Tables, Error>
[src]
pub fn get_color_endpoints(
&self,
input: &[u8]
) -> Result<Vec<(u16, u16)>, Error>
[src]
&self,
input: &[u8]
) -> Result<Vec<(u16, u16)>, Error>
pub fn get_alpha_endpoints(&self, input: &[u8]) -> Result<Vec<(u8, u8)>, Error>
[src]
pub fn get_color_selectors(&self, input: &[u8]) -> Result<Vec<[u8; 4]>, Error>
[src]
pub fn get_alpha_selectors(&self, input: &[u8]) -> Result<Vec<[u8; 6]>, Error>
[src]
pub fn get_level_info(&self, idx: usize) -> Option<(u16, u16)>
[src]
pub fn unpack_level(
&self,
tables: &Tables,
input: &[u8],
idx: usize
) -> Result<Vec<u8>, Error>
[src]
&self,
tables: &Tables,
input: &[u8],
idx: usize
) -> Result<Vec<u8>, Error>
Trait Implementations
impl Debug for Header
[src]
impl Default for Header
[src]
impl<'de> Deserialize<'de> for Header
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Serialize for Header
[src]
Auto Trait Implementations
impl RefUnwindSafe for Header
impl Send for Header
impl Sync for Header
impl Unpin for Header
impl UnwindSafe for Header
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,