radar

package
v0.12.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 29, 2025 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const NumWxLevels = 6

Variables

This section is empty.

Functions

func DrawWaypoints

func DrawWaypoints(ctx *panes.Context, waypoints []av.Waypoint, drawnWaypoints map[string]interface{},
	transforms ScopeTransformations, td *renderer.TextDrawBuilder, style renderer.TextStyle,
	ld *renderer.ColoredLinesDrawBuilder, pd *renderer.ColoredTrianglesDrawBuilder, ldr *renderer.ColoredLinesDrawBuilder, color renderer.RGB)

Types

type Brightness

type Brightness int

func (Brightness) RGB

func (b Brightness) RGB() renderer.RGB

func (Brightness) ScaleRGB

func (b Brightness) ScaleRGB(r renderer.RGB) renderer.RGB

type ScopeTransformations

type ScopeTransformations struct {
	// contains filtered or unexported fields
}

func GetScopeTransformations

func GetScopeTransformations(paneExtent math.Extent2D, magneticVariation float32, nmPerLongitude float32,
	center math.Point2LL, rangenm float32, rotationAngle float32) ScopeTransformations

GetScopeTransformations returns a ScopeTransformations object corresponding to the specified radar scope center, range, and rotation angle.

func (*ScopeTransformations) LatLongFromWindowP

func (st *ScopeTransformations) LatLongFromWindowP(p [2]float32) math.Point2LL

LatLongFromWindowP transforms a point p in window coordinates to latitude-longitude.

func (*ScopeTransformations) LatLongFromWindowV

func (st *ScopeTransformations) LatLongFromWindowV(v [2]float32) math.Point2LL

LatLongFromWindowV transforms a vector in window coordinates to a vector in latitude-longitude coordinates.

func (*ScopeTransformations) LoadLatLongViewingMatrices

func (st *ScopeTransformations) LoadLatLongViewingMatrices(cb *renderer.CommandBuffer)

LoadLatLongViewingMatrices adds commands to the provided command buffer to load viewing matrices so that latitude-longiture positions can be provided for subsequent vertices.

func (*ScopeTransformations) LoadWindowViewingMatrices

func (st *ScopeTransformations) LoadWindowViewingMatrices(cb *renderer.CommandBuffer)

LoadWindowViewingMatrices adds commands to the provided command buffer to load viewing matrices so that window-coordinate positions can be provided for subsequent vertices.

func (*ScopeTransformations) NormalizedFromWindowP

func (st *ScopeTransformations) NormalizedFromWindowP(p [2]float32) [2]float32

NormalizedFromWindowP transforms a point p in window coordinates to normalized [0,1]^2 coordinates.

func (*ScopeTransformations) PixelDistanceNM

func (st *ScopeTransformations) PixelDistanceNM(nmPerLongitude float32) float32

PixelDistanceNM returns the space between adjacent pixels expressed in nautical miles.

func (*ScopeTransformations) WindowFromLatLongP

func (st *ScopeTransformations) WindowFromLatLongP(p math.Point2LL) [2]float32

WindowFromLatLongP transforms a point given in latitude-longitude coordinates to window coordinates, snapped to a pixel center.

type WeatherRadar

type WeatherRadar struct {
	// contains filtered or unexported fields
}

WeatherRadar provides functionality for fetching radar images to display in radar scopes. Only locations in the USA are currently supported, as the only current data source is the US NOAA...

func (*WeatherRadar) Activate

func (w *WeatherRadar) Activate(r renderer.Renderer, lg *log.Logger)

Activate must be called to initialize the WeatherRadar before weather radar images can be fetched.

func (*WeatherRadar) Draw

func (w *WeatherRadar) Draw(ctx *panes.Context, hist int, intensity float32, contrast float32,
	active [NumWxLevels]bool, transforms ScopeTransformations, cb *renderer.CommandBuffer)

Draw draws the current weather radar image, if available. (If none is yet available, it returns rather than stalling waiting for it).

func (*WeatherRadar) HaveWeather

func (w *WeatherRadar) HaveWeather() [NumWxLevels]bool

func (*WeatherRadar) UpdateCenter

func (w *WeatherRadar) UpdateCenter(center math.Point2LL)

UpdateCenter provides a new center point for the radar image, causing a new image to be fetched.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL