Interface SliceBufferIndex<T>

Type Parameters:
T - buffer-type
All Known Implementing Classes:
FromByte, FromFloat, FromInt, FromShort

public interface SliceBufferIndex<T>
A container with voxel-buffers for each z-slice.
Author:
Owen Feehan
  • Method Details

    • slice

      VoxelBuffer<T> slice(int z)
      A VoxelBuffer corresponding to a particular z-slice.
      Parameters:
      z - the index (beginning at 0) of all z-slices.
      Returns:
      the corresponding buffer for z.
    • sliceBuffer

      default T sliceBuffer(int z)
      The underlying buffer corresponding to a particular z-slice.
      Parameters:
      z - the index (beginning at 0) of all z-slices.
      Returns:
      the corresponding buffer for z.
    • replaceSlice

      void replaceSlice(int z, VoxelBuffer<T> sliceToAssign)
      Replaces the voxels for a particular z-slice.
      Parameters:
      z - the index of z-slice to replace.
      sliceToAssign - the voxels for the new slice to assign.
    • extent

      Extent extent()
      The size of each buffer.
      Returns:
      the size.
    • iterateOverSlices

      default void iterateOverSlices(Consumer<VoxelBuffer<T>> sliceConsumer)
      Calls sliceConsumer once for each slice with the respective buffer.

      This occurs sequentially from 0 (inclusive) to z() (exclusive).

      Parameters:
      sliceConsumer - called for each index (z-value).
    • iterateOverSlicesAndOffsets

      default void iterateOverSlicesAndOffsets(ProcessVoxelBufferUnary<T> process)
      Calls process for each offset in each slice.

      This occurs sequentially from 0 (inclusive) to extent.z() (exclusive) and from 0 (inclusive) to extent.x() * extent.y() (exclusive) for the offsets.

      Parameters:
      process - called for each offset on each slice.