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>

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<'a, VIE: VoxelImageEncoding> VoxelImageEncoding for &'a VIE

§

type Output = <VIE as VoxelImageEncoding>::Output

§

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>

§

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

§

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>

§

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

§

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>)