aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Schadt <kingdread@gmx.de>2023-03-11 20:02:17 +0100
committerDaniel Schadt <kingdread@gmx.de>2023-03-11 20:02:17 +0100
commit3bec9ff1bcb7fb8b93693c0c93b8d42797f95e1c (patch)
treea77fa76ff7a9d5c363561eb74759bd1ae33435ce
parentfd4f3318db8df3e9f0542535fb7df6d621d07768 (diff)
downloadhittekaart-3bec9ff1bcb7fb8b93693c0c93b8d42797f95e1c.tar.gz
hittekaart-3bec9ff1bcb7fb8b93693c0c93b8d42797f95e1c.tar.bz2
hittekaart-3bec9ff1bcb7fb8b93693c0c93b8d42797f95e1c.zip
add reference to small PNG crafting
-rw-r--r--src/renderer/tilehunt.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/renderer/tilehunt.rs b/src/renderer/tilehunt.rs
index f44644b..55b30af 100644
--- a/src/renderer/tilehunt.rs
+++ b/src/renderer/tilehunt.rs
@@ -1,4 +1,9 @@
//! Actual rendering functions for tile hunts.
+//!
+//! This renders a tile as "transparent green" if any track passes through it.
+//!
+//! Note that is version of "tile hunt" is a bit silly, as the tile size changes with the zoom
+//! level. For a better version, the "tile hunt size" should be fixed to a given zoom.
use color_eyre::eyre::Result;
use crossbeam_channel::Sender;
use fnv::FnvHashSet;
@@ -35,6 +40,9 @@ impl super::Renderer for Renderer {
}
fn colorize(layer: Self::Prepared, tx: Sender<RenderedTile>) -> Result<()> {
+ // The tile is hand-crafted to be very small. See
+ // <https://www.mjt.me.uk/posts/smallest-png/> for a reference, and of course the actual
+ // PNG specification <http://www.libpng.org/pub/png/spec/1.2/PNG-Contents.html>.
static IMAGE_DATA: &[u8] = include_bytes!("tile-marked.png");
for (tile_x, tile_y) in layer {
tx.send(RenderedTile {