aboutsummaryrefslogtreecommitdiff
path: root/src/renderer/heatmap.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/renderer/heatmap.rs')
-rw-r--r--src/renderer/heatmap.rs11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/renderer/heatmap.rs b/src/renderer/heatmap.rs
index c4af7a6..0c4f93f 100644
--- a/src/renderer/heatmap.rs
+++ b/src/renderer/heatmap.rs
@@ -150,7 +150,12 @@ impl super::Renderer for Renderer {
/// The given callback will be called when a track has been rendered and merged into the
/// accumulator, to allow for UI feedback. The passed parameter is the number of tracks that have
/// been rendered since the last call.
- fn prepare(zoom: u32, tracks: &[Vec<Coordinates>], tick: Sender<()>) -> Result<HeatCounter> {
+ fn prepare(
+ &self,
+ zoom: u32,
+ tracks: &[Vec<Coordinates>],
+ tick: Sender<()>,
+ ) -> Result<HeatCounter> {
let mut heatcounter = TileLayer::from_pixel([0].into());
for track in tracks {
@@ -183,7 +188,7 @@ impl super::Renderer for Renderer {
///
/// Note that this function internally uses `rayon` for parallization. If you want to limit the
/// number of threads used, set up the global [`rayon::ThreadPool`] first.
- fn colorize(layer: HeatCounter, tx: Sender<RenderedTile>) -> Result<()> {
+ fn colorize(&self, layer: HeatCounter, tx: Sender<RenderedTile>) -> Result<()> {
let max = layer.pixels().map(|l| l.0[0]).max().unwrap_or_default();
if max == 0 {
return Ok(());
@@ -203,7 +208,7 @@ impl super::Renderer for Renderer {
})
}
- fn tile_count(layer: &HeatCounter) -> Result<u64> {
+ fn tile_count(&self, layer: &HeatCounter) -> Result<u64> {
Ok(layer.tile_count().try_into().unwrap())
}
}