pub struct RenderEngine { /* private fields */ }Expand description
Shared renderer and viewport state for the four-canvas layout.
Implementations§
Source§impl RenderEngine
impl RenderEngine
Sourcepub fn new(device: &Device, queue: &Queue, output_format: TextureFormat) -> Self
pub fn new(device: &Device, queue: &Queue, output_format: TextureFormat) -> Self
Creates a renderer that targets 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 renderer from shared Arc device and queue 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 geometry(&self) -> Option<VolumeGeometry>
pub fn geometry(&self) -> Option<VolumeGeometry>
Returns the active volume geometry, if any.
Sourcepub fn scalar_range(&self) -> Option<(f64, f64)>
pub fn scalar_range(&self) -> Option<(f64, f64)>
Returns the currently known scalar range.
Sourcepub fn volume_state_mut(&mut self) -> &mut VolumeViewState
pub fn volume_state_mut(&mut self) -> &mut VolumeViewState
Returns mutable access to the volume viewport state.
Sourcepub fn slice_state_mut(
&mut self,
mode: SlicePreviewMode,
) -> &mut SlicePreviewState
pub fn slice_state_mut( &mut self, mode: SlicePreviewMode, ) -> &mut SlicePreviewState
Returns mutable access to one slice viewport state.
Sourcepub fn slice_state(&self, mode: SlicePreviewMode) -> &SlicePreviewState
pub fn slice_state(&self, mode: SlicePreviewMode) -> &SlicePreviewState
Returns immutable access to one slice viewport state.
Sourcepub fn set_volume_preset(&mut self, preset_id: VolumePresetId)
pub fn set_volume_preset(&mut self, preset_id: VolumePresetId)
Sets the active volume-rendering preset.
Sourcepub fn set_crosshair(&mut self, world: DVec3) -> Result<(), RenderEngineError>
pub fn set_crosshair(&mut self, world: DVec3) -> Result<(), RenderEngineError>
Moves the shared MPR crosshair and centers all slice views on that point.
Sourcepub fn set_crosshair_from_viewport(
&mut self,
mode: SlicePreviewMode,
uv: DVec2,
viewport: Viewport,
) -> Result<(), RenderEngineError>
pub fn set_crosshair_from_viewport( &mut self, mode: SlicePreviewMode, uv: DVec2, viewport: Viewport, ) -> Result<(), RenderEngineError>
Moves the shared MPR crosshair from one viewport-relative point.
Sourcepub fn scroll_slice(
&mut self,
mode: SlicePreviewMode,
delta: f64,
) -> Result<(), RenderEngineError>
pub fn scroll_slice( &mut self, mode: SlicePreviewMode, delta: f64, ) -> Result<(), RenderEngineError>
Scrolls one slice viewport 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 one transfer window to all viewports.
Sourcepub fn set_thick_slab(
&mut self,
mode: SlicePreviewMode,
thickness: f64,
projection_mode: SliceProjectionMode,
)
pub fn set_thick_slab( &mut self, mode: SlicePreviewMode, thickness: f64, projection_mode: SliceProjectionMode, )
Configures the thick-slab mode for one slice viewport.
Sourcepub fn render_frame(
&mut self,
encoder: &mut CommandEncoder,
targets: FrameTargets<'_>,
show_crosshairs: bool,
) -> Result<(), RenderEngineError>
pub fn render_frame( &mut self, encoder: &mut CommandEncoder, targets: FrameTargets<'_>, show_crosshairs: bool, ) -> Result<(), RenderEngineError>
Renders the four-view layout into the provided targets.
Auto Trait Implementations§
impl Freeze for RenderEngine
impl !RefUnwindSafe for RenderEngine
impl Send for RenderEngine
impl Sync for RenderEngine
impl Unpin for RenderEngine
impl UnsafeUnpin for RenderEngine
impl !UnwindSafe for RenderEngine
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