Struct openslide::OpenSlide

source ·
pub struct OpenSlide {
    pub properties: Properties,
    /* private fields */
}
Expand description

A convenient OpenSlide object with the ordinary OpenSlide functions as methods

This wraps the bindings found in the bindings module, but has a more (in my opinion) convenient API for rust. It also contains some other convenience methods.

Fields§

§properties: Properties

Implementations§

This method tries to open the slide at the given filename location.

This function can be expensive; avoid calling it unnecessarily. For example, a tile server should not create a new object on every tile request. Instead, it should maintain a cache of OpenSlide objects and reuse them when possible.

Get the number of levels in the whole slide image.

Get the dimensions of level 0 (the largest level).

This method returns the (width, height) number of pixels of the level 0 whole slide image.

This is the same as calling get_level_dimensions(level) with level=0.

Get the dimensions of level 0 (the largest level).

This method returns the (width, height) number of pixels of the whole slide image at the specified level. Returns an error if the level is invalid

Get the downsampling factor of a given level.

Get the best level to use for displaying the given downsample factor.

Copy pre-multiplied ARGB data from a whole slide image.

This function reads and decompresses a region of a whole slide image into an RGBA image

Args: top_left_lvl0_row: Row coordinate (increasing downwards) of top left pixel position top_left_lvl0_col: Column coordinate (increasing to the right) of top left pixel position level: At which level to grab the region from height: Height in pixels of the outputted region width: Width in pixels of the outputted region

Get a dictionary of properties associated with the current slide

There are some standard properties to every slide, but also a lot of vendor-specific properties. This method returns a HashMap with all key-value pairs of the properties associated with the slide.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more

This method is called when the object in dropped, and tries to close the slide.

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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
Sets value as a parameter of self.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. 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.