mod pixel_format;
pub use self::pixel_format::{PixelFormat, PixelFormatFlags, FourCC};
mod d3d;
pub use self::d3d::D3DFormat;
mod dxgi;
pub use self::dxgi::DxgiFormat;
pub trait DataFormat {
fn get_pitch(&self, width: u32) -> Option<u32>;
fn get_pitch_height(&self) -> u32 {
if self.get_block_size().is_some() {
4
} else {
1
}
}
fn get_bits_per_pixel(&self) -> Option<u8>;
fn get_block_size(&self) -> Option<u32>;
fn get_fourcc(&self) -> Option<FourCC>;
fn requires_extension(&self) -> bool;
fn get_minimum_mipmap_size_in_bytes(&self) -> Option<u32> {
if let Some(bpp) = self.get_bits_per_pixel() {
Some((bpp as u32 + 7) / 8)
} else if let Some(bs) = self.get_block_size() {
Some(bs)
} else {
return None; }
}
}