Struct building_blocks_storage::chunk::map::ChunkMap[][src]

pub struct ChunkMap<N, T, Bldr, Store> {
    pub indexer: ChunkIndexer<N>,
    // some fields omitted
}
Expand description

A lattice map made up of same-shaped Array chunks. For each level of detail, it takes a value at every possible PointN, because accesses made outside of the stored chunks will return some ambient value specified on creation.

ChunkMap is generic over the type used to actually store the Chunks. You can use any storage that implements ChunkReadStorage or ChunkWriteStorage. Being a lattice map, ChunkMapLodView will implement various access traits, depending on the capabilities of the chunk storage.

If the chunk storage implements ChunkReadStorage, then ChunkMapLodView will implement:

  • Get
  • ForEach
  • ReadExtent

If the chunk storage implements ChunkWriteStorage, then ChunkMapLodView will implement:

  • GetMut
  • ForEachMut
  • WriteExtent

Fields

indexer: ChunkIndexer<N>

Translates from lattice coordinates to chunk key space.

Implementations

Downsamples the chunk at src_chunk_key into the specified destination level dst_lod.

Downsamples all of src_chunk into the overlapping chunk at level dst_lod.

Fill the destination samples with the ambient value.

Downsamples all chunks that both:

  1. overlap extent
  2. are present in index

Destination chunks up to num_lods will be considered.

Same as downsample_chunks_with_index, but allows passing in a closure that fetches LOD0 chunks. This is mostly a workaround so we can downsample multichannel chunks from LOD0.

Consumes self and returns the backing chunk storage.

Borrows the internal chunk storage.

Borrows the internal chunk storage.

Get an immutable view of a single level of detail lod in order to use the access traits.

Get a mutable view of a single level of detail lod in order to use the access traits.

Borrow the chunk at key.

In debug mode only, asserts that key is valid.

Get the values at point p in level of detail lod.

Get a reference to the values at point p in level of detail lod.

Call visitor on all chunks that overlap extent. Vacant chunks will be represented by an AmbientExtent.

Call visitor on all occupied chunks that overlap extent.

Overwrite the Chunk at key with chunk. Drops the previous value.

In debug mode only, asserts that key is valid and chunk’s shape is valid.

Replace the Chunk at key with chunk, returning the old value.

In debug mode only, asserts that key is valid and chunk’s shape is valid.

Mutably borrow the chunk at key.

In debug mode only, asserts that key is valid.

Mutably borrow the chunk at key. If the chunk doesn’t exist, create_chunk is called to insert one.

In debug mode only, asserts that key is valid.

Mutably borrow the chunk at key. If the chunk doesn’t exist, a new chunk is created with the ambient value.

In debug mode only, asserts that key is valid.

Get a mutable reference to the values at point p in level of detail lod.

Call visitor on all chunks that overlap extent. Vacant chunks will be created first with ambient value.

Call visitor on all occupied chunks that overlap extent.

Fill all of extent with the same value.

The smallest extent that bounds all chunks in level of detail lod.

Construct a reader for this map.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.