Slide slice layer.
More...
◆ SlideSliceLayer()
Bio.SlideSliceLayer.SlideSliceLayer |
( |
ISlideSource |
slideSource | ) |
|
|
inline |
27 : base()
28 {
29 _slideSource = slideSource;
30 Name = "SliceLayer";
31 Extent = slideSource.Schema.Extent.ToMRect();
32 }
◆ GetFeatures()
override IEnumerable< IFeature > Bio.SlideSliceLayer.GetFeatures |
( |
MRect |
box, |
|
|
double |
resolution |
|
) |
| |
|
inline |
35 {
36 if (box is null) return Enumerable.Empty<IFeature>();
37
38 if (_lastExtent.ToMRect().Centroid.Distance(box.Centroid) > 2 * resolution || _lastResolution != resolution || _lastExtent.Width != box.Width || _lastExtent.Height != box.Height)
39 {
40 _lastExtent = box.ToExtent();
41 _lastResolution = resolution;
42 MRect box2 = box.Grow(SymbolStyle.DefaultWidth * 2.0 * resolution, SymbolStyle.DefaultHeight * 2.0 * resolution);
43 var sliceInfo = new SliceInfo() { Extent = box2.ToExtent(), Resolution = resolution };
44 var bytes = _slideSource.
GetSlice(sliceInfo);
45 if (bytes != null && _lastFeatures.FirstOrDefault() is IFeature feature)
46 {
47 feature = new RasterFeature(new MRaster(bytes.Result, box2));
48 }
49 }
50 return _lastFeatures;
51 }
Task< byte[]> GetSlice(SliceInfo sliceInfo)
Get slice.
The documentation for this class was generated from the following file: