mirror of
https://github.com/donlucasx/xscapes.git
synced 2026-10-20 08:43:32 +02:00
His ruling of 2026-09-16 on the s28 leftover: widen the range. Swept at floors 0.70..0.30 over three seeds, three geometries and four hours, reading the constellation off the rendered frame (notes/s35-magsweep). The count never moves: starInk lifts any star that fails the contrast bar, so the bar could not be the criterion. What a lower floor spends is the faintest star's margin over the brightest ambient speck, and 0.60 is the widest floor that keeps a full cube step at both night hours; 0.50 loses it at 22h. Tones at midnight 4..5 -> 5..8, luma spread 40 -> 64. TestStarMagnitudeIsWideAndStillCounts fails at 0.70 (too few tones) and at 0.40 (dust outshines a star). The s28 ambient golden is re-captured: every cell where it was, only the inks moved with the floor. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
53 lines
2.3 KiB
Go
53 lines
2.3 KiB
Go
package scape
|
|
|
|
import (
|
|
"github.com/donlucasx/xscapes/internal/canvas"
|
|
"github.com/donlucasx/xscapes/internal/term"
|
|
)
|
|
|
|
// StarInk is what the constellation's ink search actually did, rather than
|
|
// only what it returned.
|
|
//
|
|
// It exists for one reason. starInk stops at the FIRST rung that clears
|
|
// todoStarContrast, so a reported contrast of 56 is the search's exit
|
|
// condition and not a margin: it cannot tell a cell that cleared at rung 0
|
|
// with seven rungs of headroom from one that cleared at rung 8 and full alpha
|
|
// with none. That difference is the whole question the moment a mark is asked
|
|
// to sit somewhere OUTSIDE the band starBand certifies -- which is exactly
|
|
// what an arriving star's flight path does.
|
|
type StarInk struct {
|
|
Ink term.RGB
|
|
Alpha float64
|
|
// Rung is which step of the lift toward white won, 0..starInkSteps.
|
|
Rung int
|
|
// FullAlpha says the search had to give up the star's own magnitude and
|
|
// go fully opaque to clear the bar.
|
|
FullAlpha bool
|
|
// Exhausted says nothing cleared the bar at all and this is best-effort
|
|
// ink: the sky there is brighter than white can beat.
|
|
Exhausted bool
|
|
// Contrast is the rendered luma over the rendered ground, by the same
|
|
// band-aware measure starInk judges with.
|
|
Contrast float64
|
|
}
|
|
|
|
// StarInkAt is starInk with its working shown. The scene itself never needs
|
|
// this; a study that has to justify a glyph's legibility does.
|
|
func (s *Shore) StarInkAt(c *canvas.Canvas, x, y int, mag float64) StarInk {
|
|
return s.starInkReport(c, x, y, mag)
|
|
}
|
|
|
|
// StarMagnitudeAt is the magnitude of the i-th constellation slot.
|
|
//
|
|
// Exported so a study can ask the product what a star's weight is instead of
|
|
// replicating the formula. notes/s28-starfun/sky.go replicated the star's
|
|
// alpha as a constant 0.85 -- a floor shore.go had already deleted -- and its
|
|
// render differs from the product's for 25 of 32 stars at midnight.
|
|
func StarMagnitudeAt(i int, seed int64) float64 { return starMagnitude(i, seed) }
|
|
|
|
// SetStarDimmest moves the constellation's alpha floor and returns the old
|
|
// value, for a sweep that has to render the product at several floors and
|
|
// read the tones off the frame. notes/s35-magsweep is the caller; the scene
|
|
// never moves it.
|
|
func SetStarDimmest(v float64) (was float64) { was, starDimmest = starDimmest, v; return was }
|