Mark the aerodromes in the window, and draw the lot on a vector display

The aerodromes were never on the window at all: only the animation drew
them, and the window's map had whatever airport glyphs the tiles happened to
carry.  They are drawn there now, in the same colour and the same square.

The first attempt at that had a bug worth naming, because it would have
looked like the feature simply not working.  They were fetched inside the
same pass of the fetching loop as a piece of map, so they queued behind a
hundred and twenty tiles coming off a network -- and once the map was in
hand there were no more passes, so they were never fetched again.  They are
their own question now, asked on the same thread but not behind the tiles,
and they arrive whether the tiles do or not.  An area that has been asked
about and has none in it is remembered as none, rather than asked about
again five times a second for the rest of the night.  And the thread now
starts if either the map or the aerodromes are wanted, so --no-basemap no
longer quietly takes the airports with it.

Then the themes, which change the window and the animated pictures together
because both read their colours out of the same palette.  night is what this
program has always drawn and is untouched.  digital, phosphor, amber and red
are the screens the phrase "air defence display" actually calls to mind: a
black tube, one phosphor, and thin bright vector lines with a halo round
them.

Three things follow from having one colour to spend, and they are
constraints rather than decoration.  Height becomes brightness, since hue is
no longer free -- low is dim and high burns, which is the trade those
displays made.  The map underneath drops to about a quarter of the
brightness asked for, because a tinted photograph of a county behind the
vectors is the one thing that stops a vector display looking like one.  And
a country is named in two letters rather than drawn as a flag, a flag being
half a dozen colours.

The glow is done twice, differently, because the two are different kinds of
picture.  The window lays each line down two or three times, wider and
fainter each pass, with the core last: trails, symbols, leader lines, box
borders and the aerodrome squares.  The animation cannot blend at all, a GIF
being indexed colour, so it dilates what it has drawn and fills the halo
with the dimmed copy of the colour underneath -- and the aircraft colours
already had dimmed copies, since those are the trail shades, so an aeroplane
glows into the colour its own trail is drawn in, which is the colour a
phosphor would have spread into.  The fixed colours get two rings each in
the palette for the purpose.  The halo goes over the map, the grid and the
background and over nothing else that was drawn, since a halo is what light
does to the dark around a line; where two rings meet the nearer wins.  It
costs about 55 ms a frame at 1400 by 1258 and the default theme skips the
pass entirely.

The palette is written over in place rather than replaced, because both
drawings and every one of their helpers hold a reference to that array and a
new one would leave half the program painting in the colours of the theme
before.  There is a test that every theme keeps the aerodrome colour more
than forty units of CIELAB from every altitude colour, stated as the
distance rather than as the colour, so that a new theme cannot quietly walk
an aircraft back into the airports.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016PsWPTweCT6pwxKngvVxcg
This commit is contained in:
The Dust Council 2026-09-05 00:39:20 -07:00
parent f9b21f7e35
commit 2e20c48971
11 changed files with 1342 additions and 50 deletions

View file

@ -1042,6 +1042,13 @@ brightness or the map itself has. Doing it every frame put a ceiling of a
dozen frames a second on the window at 1920×1080 and spent a whole core
holding it there; keeping it takes the same window from 87 ms a frame to 14.
**The aerodromes are marked here too**, in the same colour and with the same
square as the animation draws them. They are asked for once per area, on the
thread that fetches the tiles but not behind them — they used to be fetched
only in the same pass as a piece of map, which meant they queued behind a
hundred and twenty tiles coming off a network, and once the map was in hand
there were no more passes and they were never fetched at all.
`d` cycles the detail — full box, just height and speed, or symbols alone —
for when the sky is busy. `t` toggles trails, `g` the map underneath, `[`/`]`
its brightness, `+`/`-` the range, `q` closes it.
@ -1490,6 +1497,64 @@ thing on the picture and light enough that a coastline can be made out at all,
and which way to err depends on the screen you are looking at. In the window,
`[` and `]` change it while it runs.
## Themes
`--theme NAME`, on `bandsaunter adsb` and `bandsaunter flights` alike, and in
the ADS-B options menu. It changes the window and the animated pictures
together, because both read their colours out of the same palette.
| theme | |
| --- | --- |
| `night` | the default: a night-blue ground, height as colour |
| `digital` | blue phosphor, cyan vectors on black, amber aerodromes |
| `phosphor` | green P1 phosphor, height as brightness |
| `amber` | amber phosphor, warm vectors on black |
| `red` | red phosphor, for a room that wants its night vision |
The four vector themes are the screens the phrase "air defence display"
actually calls to mind: a black tube, one phosphor, and thin bright lines
with a halo around them. Three things follow from that, and they are
constraints rather than decoration.
**Height becomes brightness.** The default map spends the whole spectrum on
altitude — low warm, high cold — which is why nothing else on it can be amber
or green. A phosphor screen has one colour, so on those themes low is dim and
high burns. That is the same trade the real displays made.
**The ground goes well back.** A tinted photograph of a county behind the
vectors is the one thing that stops a vector display looking like one, so the
map underneath is drawn at about two-fifths of the brightness asked for and
the lines carry the picture. `--map-brightness` still moves it.
**Countries are named, not flown.** A flag is half a dozen colours and a
phosphor has one, so those themes write the two letters instead — which is
what a display of the period would have done anyway.
### The glow
A vector display draws by holding a beam on the phosphor, and the phosphor
spreads the light a little and keeps glowing after the beam has gone. So a
line on one of those screens is not one pixel wide with a hard edge; it is a
bright core inside a halo. Both drawings do that, by different means, because
they are different kinds of picture:
- **the window** lays the same line down two or three times, wider and fainter
each pass, and then the core on top — trails, aircraft, leader lines, box
borders and the aerodrome squares;
- **the animation** cannot blend at all, because a GIF is indexed colour. So
it dilates what it has drawn and fills the halo with the *dimmed copy* of
the colour underneath it. The aircraft colours already have dimmed copies —
those are the trail shades — so an aeroplane glows into the colour its own
trail is drawn in, which is the colour a phosphor would have spread into.
The fixed colours have two rings each added to the palette for the purpose.
The halo goes over the map, the grid and the empty background and nothing
else: a halo is what light does to the dark around a line, and painting it
over another line would be light doing something light does not do. Where two
rings meet the nearer wins, which is what happens on the tube as well. It
costs about 55 ms a frame at 1400×1258, and the default theme skips the pass
entirely.
## Meters and weather sensors
Two things on the ISM bands are worth naming rather than reporting as hex.