Skip to main content

VoxelImageEncoding

Trait VoxelImageEncoding 

Source
pub trait VoxelImageEncoding {
    type Workspace;
    type Output;

    // Required methods
    fn create(width: u32, height: u32) -> Self::Workspace;
    fn put_solid(
        &self,
        ws: &mut Self::Workspace,
        x: u32,
        y: u32,
        kind: BlockKind,
        rgb: Rgb<u8>,
    );
    fn put_sprite(
        &self,
        ws: &mut Self::Workspace,
        x: u32,
        y: u32,
        kind: BlockKind,
        sprite_data: [u8; 3],
    );
    fn finish(ws: &Self::Workspace) -> Option<Self::Output>;
}

Required Associated Types§

Required Methods§

Source

fn create(width: u32, height: u32) -> Self::Workspace

Source

fn put_solid( &self, ws: &mut Self::Workspace, x: u32, y: u32, kind: BlockKind, rgb: Rgb<u8>, )

Source

fn put_sprite( &self, ws: &mut Self::Workspace, x: u32, y: u32, kind: BlockKind, sprite_data: [u8; 3], )

Source

fn finish(ws: &Self::Workspace) -> Option<Self::Output>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<VIE: VoxelImageEncoding> VoxelImageEncoding for &VIE

Source§

type Output = <VIE as VoxelImageEncoding>::Output

Source§

type Workspace = <VIE as VoxelImageEncoding>::Workspace

Source§

fn create(width: u32, height: u32) -> Self::Workspace

Source§

fn put_solid( &self, ws: &mut Self::Workspace, x: u32, y: u32, kind: BlockKind, rgb: Rgb<u8>, )

Source§

fn put_sprite( &self, ws: &mut Self::Workspace, x: u32, y: u32, kind: BlockKind, sprite_data: [u8; 3], )

Source§

fn finish(ws: &Self::Workspace) -> Option<Self::Output>

Implementors§

Source§

impl<const AVERAGE_PALETTE: bool> VoxelImageEncoding for TriPngEncoding<AVERAGE_PALETTE>

Source§

type Output = CompressedData<(Vec<u8>, Vec<Rgb<u8>>, [usize; 3], Vec<[u8; 3]>)>

Source§

type Workspace = (ImageBuffer<Luma<u8>, Vec<u8>>, ImageBuffer<Luma<u8>, Vec<u8>>, ImageBuffer<Luma<u8>, Vec<u8>>, HashMap<BlockKind, HashMap<Rgb<u8>, usize>>, Vec<[u8; 3]>, HashMap<[u8; 3], u16>)

Source§

impl<const N: u32> VoxelImageEncoding for QuadPngEncoding<N>

Source§

type Output = CompressedData<(Vec<u8>, [usize; 3], Vec<[u8; 3]>)>

Source§

type Workspace = (ImageBuffer<Luma<u8>, Vec<u8>>, ImageBuffer<Luma<u8>, Vec<u8>>, ImageBuffer<Luma<u8>, Vec<u8>>, ImageBuffer<Rgb<u8>, Vec<u8>>, Vec<[u8; 3]>, HashMap<[u8; 3], u16>)