BioGTK  5.1.1
A .NET library & program for annotating, editing various microscopy imaging formats using Bioformats supported images.
Loading...
Searching...
No Matches
Bio.TileCache Class Reference

Public Member Functions

 TileCache (SlideSourceBase source, int capacity=1000)
 
async Task< byte[]> GetTile (TileInformation info)
 
void Dispose ()
 

Constructor & Destructor Documentation

◆ TileCache()

Bio.TileCache.TileCache ( SlideSourceBase  source,
int  capacity = 1000 
)
inline
81 {
82 this.source = source;
83 this.capacity = capacity;
84 this.cache = new LruCache<TileInformation, byte[]>(capacity);
85 }

Member Function Documentation

◆ Dispose()

void Bio.TileCache.Dispose ( )
inline
123 {
124 cache.Dispose();
125 }

◆ GetTile()

async Task< byte[]> Bio.TileCache.GetTile ( TileInformation  info)
inline
88 {
89 LruCache<TileInformation, byte[]>.Info inf = new LruCache<TileInformation, byte[]>.Info();
90 inf.Coordinate = info.Coordinate;
91 inf.Index = info.Index;
92 byte[] data = cache.Get(inf);
93 if (data != null)
94 {
95 return data;
96 }
97 byte[] tile = await LoadTile(info);
98 if(tile!=null)
99 AddTile(info, tile);
100 return tile;
101 }

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