Interface ISKImagePyramidSource
Describes an image pyramid source — provides tile pyramid math for computing tile URLs and dimensions. Implement this to support new image formats (DZI, IIIF, Zoomify).
public interface ISKImagePyramidSource
Properties
- AspectRatio
Image aspect ratio (width / height).
- CacheExpiry
The recommended maximum age for cached tiles from this source. null means tiles are considered immutable (cache indefinitely). The controller passes this to the cache as a hint when loading a new source.
- ImageHeight
Full image height in pixels at maximum resolution.
- ImageWidth
Full image width in pixels at maximum resolution.
- MaxLevel
Maximum pyramid level index. Level 0 is lowest resolution.
- SourceId
A stable, short identifier for this source derived from its content and base URI. Used as a directory name in disk-based tile caches to namespace tiles per image source.
Methods
- GetFullTileUrl(int, int, int)
Gets the full URL for a specific tile. Returns null if the source cannot resolve the URL (e.g., not yet loaded).
- GetLevelHeight(int)
Gets the image height at a given pyramid level.
- GetLevelWidth(int)
Gets the image width at a given pyramid level.
- GetOptimalLevel(double, double)
Gets the optimal pyramid level for the given viewport and control dimensions.
- GetTileBounds(int, int, int)
Gets the pixel bounds of a tile within its pyramid level. Returns a Rect<T> of int in level-pixel coordinates (XYWH). For formats without tile overlap (e.g., IIIF), the bounds are the exact tile dimensions. For DZI, the bounds include the configured overlap pixels.
- GetTileCountX(int)
Gets the number of tile columns at a given level.
- GetTileCountY(int)
Gets the number of tile rows at a given level.