SlideIO 2.9.0
Open-source library for reading of medical images
Loading...
Searching...
No Matches
Public Member Functions | List of all members
slideio::LevelInfo Class Reference

Description of a single level of the internal image pyramid of a scene. More...

#include <levelinfo.hpp>

Public Member Functions

void updateTileCount () const
 recomputes the cached tile count from the current level and tile size.
 
int getLevel () const
 returns the index of the level. Level 0 is the level of the highest resolution.
 
Size getSize () const
 returns the size of the level in the pixels of the level.
 
double getScale () const
 returns the scale of the level relative to level 0. More...
 
double getMagnification () const
 returns the objective magnification of the level. 0 if the format does not report it.
 
Size getTileSize () const
 returns the size of a tile of the level. (0,0) if the level is not tiled.
 
int getTileCount () const
 returns the number of tiles of the level. More...
 
std::string toString () const
 returns a human readable description of the level.
 
Rect getTileRect (int tileIndex) const
 returns the rectangle of a tile in the coordinate system of the level. More...
 

Detailed Description

Description of a single level of the internal image pyramid of a scene.

A scene keeps one object per zoom level and returns it from Scene::getLevelInfo. The object describes the geometry of the level: its size in the pixels of the level, the scale relative to level 0, the objective magnification and the size of the tiles the level is stored in. It also exposes the tile grid of the level through getTileCount and getTileRect, which return rectangles in the coordinate system of the level and can be passed straight to Scene::readResampledLevelBlockChannels.

Member Function Documentation

◆ getScale()

double slideio::LevelInfo::getScale ( ) const
inline

returns the scale of the level relative to level 0.

The scale of level 0 is 1; a level of half the size of level 0 has a scale of 0.5.

◆ getTileCount()

int slideio::LevelInfo::getTileCount ( ) const
inline

returns the number of tiles of the level.

A level that is not tiled consists of a single tile that covers the whole level.

◆ getTileRect()

Rect slideio::LevelInfo::getTileRect ( int  tileIndex) const
inline

returns the rectangle of a tile in the coordinate system of the level.

Tiles are numbered row by row, from the top left corner of the level.

Parameters
tileIndex: tile index, in the range [0, getTileCount()).
Returns
rectangle of the tile. On a level of more than one tile every rectangle has the size returned by getTileSize, so the tiles of the right and the bottom edge overhang the level; reading such a rectangle with Scene::readResampledLevelBlockChannels fills the part outside the level with the background value. On a level of a single tile the rectangle is the level itself.

The documentation for this class was generated from the following files: