pub struct SingleSliceEngine { /* private fields */ }Expand description
Lightweight single-canvas renderer for stack (2D) viewing.
Unlike RenderEngine which manages 4 viewports, this engine renders
a single slice viewport into one canvas. It uses the same underlying
VolumeRenderer and IncrementalVolume for data storage and
GPU-accelerated reslicing.
Implementations§
Source§impl SingleSliceEngine
impl SingleSliceEngine
Sourcepub fn new(device: &Device, queue: &Queue, output_format: TextureFormat) -> Self
pub fn new(device: &Device, queue: &Queue, output_format: TextureFormat) -> Self
Creates a single-slice renderer targeting the provided output format.
Sourcepub fn from_arc(
device: Arc<Device>,
queue: Arc<Queue>,
output_format: TextureFormat,
) -> Self
pub fn from_arc( device: Arc<Device>, queue: Arc<Queue>, output_format: TextureFormat, ) -> Self
Creates a single-slice renderer from shared Arc handles.
Sourcepub fn prepare_volume(
&mut self,
geometry: VolumeGeometry,
) -> Result<(), RenderEngineError>
pub fn prepare_volume( &mut self, geometry: VolumeGeometry, ) -> Result<(), RenderEngineError>
Prepares an empty progressive volume and allocates its GPU texture.
Sourcepub fn insert_slice(
&mut self,
z_index: u32,
pixels: &[i16],
) -> Result<(), RenderEngineError>
pub fn insert_slice( &mut self, z_index: u32, pixels: &[i16], ) -> Result<(), RenderEngineError>
Inserts one slice into the progressive volume and uploads it to the GPU.
Sourcepub fn prepared_volume(&self) -> Option<&IncrementalVolume>
pub fn prepared_volume(&self) -> Option<&IncrementalVolume>
Returns the prepared progressive volume, if any.
Sourcepub fn slice_state_mut(&mut self) -> &mut SlicePreviewState
pub fn slice_state_mut(&mut self) -> &mut SlicePreviewState
Returns mutable access to the slice viewport state.
Sourcepub fn scalar_range(&self) -> Option<(f64, f64)>
pub fn scalar_range(&self) -> Option<(f64, f64)>
Returns the currently known scalar range.
Sourcepub fn set_slice_mode(&mut self, mode: SlicePreviewMode)
pub fn set_slice_mode(&mut self, mode: SlicePreviewMode)
Switches which orthogonal plane is displayed.
Sourcepub fn scroll_slice(&mut self, delta: f64) -> Result<(), RenderEngineError>
pub fn scroll_slice(&mut self, delta: f64) -> Result<(), RenderEngineError>
Scrolls the slice along its normal.
Sourcepub fn set_window_level(
&mut self,
center: f64,
width: f64,
) -> Result<(), RenderEngineError>
pub fn set_window_level( &mut self, center: f64, width: f64, ) -> Result<(), RenderEngineError>
Applies a transfer window to the slice viewport.
Sourcepub fn render_slice(
&mut self,
encoder: &mut CommandEncoder,
target: &RenderTarget<'_>,
) -> Result<(), RenderEngineError>
pub fn render_slice( &mut self, encoder: &mut CommandEncoder, target: &RenderTarget<'_>, ) -> Result<(), RenderEngineError>
Renders the single slice into the provided target.
Auto Trait Implementations§
impl Freeze for SingleSliceEngine
impl !RefUnwindSafe for SingleSliceEngine
impl Send for SingleSliceEngine
impl Sync for SingleSliceEngine
impl Unpin for SingleSliceEngine
impl UnsafeUnpin for SingleSliceEngine
impl !UnwindSafe for SingleSliceEngine
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more