pub struct Slide { /* private fields */ }Expand description
Top-level handle. Owns the SlideReader + shared cache.
Implementations§
Source§impl Slide
impl Slide
Sourcepub fn from_source_with_cache_bytes(
source: Box<dyn SlideReader>,
cache_bytes: u64,
) -> Self
pub fn from_source_with_cache_bytes( source: Box<dyn SlideReader>, cache_bytes: u64, ) -> Self
Construct from an already-opened source with an internal cache budget.
Sourcepub fn open(path: impl AsRef<Path>) -> Result<Self, WsiError>
pub fn open(path: impl AsRef<Path>) -> Result<Self, WsiError>
Zero-config entry point: builtin registry + source-aware default cache.
pub fn open_with_options( path: impl AsRef<Path>, options: SlideOpenOptions, ) -> Result<Self, WsiError>
Sourcepub fn open_with_cache_bytes(
path: impl AsRef<Path>,
registry: &FormatRegistry,
cache_bytes: u64,
) -> Result<Self, WsiError>
pub fn open_with_cache_bytes( path: impl AsRef<Path>, registry: &FormatRegistry, cache_bytes: u64, ) -> Result<Self, WsiError>
Open with the given registry and an internal cache budget.
pub fn dataset(&self) -> &Dataset
pub fn level_source_kind( &self, scene: usize, series: usize, level: u32, ) -> Result<LevelSourceKind, WsiError>
pub fn cached_tile_present(&self, req: &TileRequest) -> bool
pub fn source(&self) -> &dyn SlideReader
pub fn read_tile( &self, req: &TileRequest, output: TileOutputPreference, ) -> Result<TilePixels, WsiError>
pub fn read_tiles( &self, reqs: &[TileRequest], output: TileOutputPreference, ) -> Result<Vec<TilePixels>, WsiError>
pub fn read_raw_compressed_tile( &self, req: &TileRequest, ) -> Result<RawCompressedTile, WsiError>
Sourcepub fn read_region(&self, req: &RegionRequest) -> Result<CpuTile, WsiError>
pub fn read_region(&self, req: &RegionRequest) -> Result<CpuTile, WsiError>
Read a pixel region, compositing from cached or freshly-decoded tiles.
Validates all indices (scene, series, level, plane axes) before reading. Output buffer metadata (color_space, channels, sample_type, layout) is inherited from the first decoded tile – no hardcoded assumptions.
Only CpuTileLayout::Interleaved is supported for compositing. Planar
tiles return WsiError::DisplayConversion.
pub fn read_display_tile( &self, req: &TileViewRequest, ) -> Result<CpuTile, WsiError>
pub fn read_display_tile_with_output( &self, req: &TileViewRequest, output: TileOutputPreference, ) -> Result<CpuTile, WsiError>
Sourcepub fn read_region_rgba(
&self,
req: &RegionRequest,
) -> Result<RgbaImage, WsiError>
pub fn read_region_rgba( &self, req: &RegionRequest, ) -> Result<RgbaImage, WsiError>
Convenience: read a region and convert to RgbaImage. Only works for Uint8 data (brightfield). For Uint16/Float32, use read_region() + to_rgba_windowed() with an explicit DisplayWindow.
Sourcepub fn read_region_rgba_windowed(
&self,
req: &RegionRequest,
window: &DisplayWindow,
) -> Result<RgbaImage, WsiError>
pub fn read_region_rgba_windowed( &self, req: &RegionRequest, window: &DisplayWindow, ) -> Result<RgbaImage, WsiError>
Read a region and convert to RgbaImage with explicit windowing. For Uint16/Float32 data (fluorescence, computed images).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Slide
impl !RefUnwindSafe for Slide
impl Send for Slide
impl Sync for Slide
impl Unpin for Slide
impl UnsafeUnpin for Slide
impl !UnwindSafe for Slide
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