interplane.Get Omega
Read in your language

aienux

Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.

Brought by drakestapleton

branch main Branches Tags History

aienux / native / kernel / ui / sky_data.h

62 lines · 2724 bytes Raw Blame History
1/* sky_data.h -- the real sky as tables: what native/kernel/tools/ck_sky_gen.c
2 * writes into sky_data.c (regenerate with scripts/ck_sky_gen.sh; the inputs,
3 * their addresses and sha256 are listed there and in NOTICE).
4 *
5 * Directions are unit vectors in the J2000 equatorial frame (x towards
6 * RA 0 Dec 0, z towards the north celestial pole), Q15. Integer only.
7 *
8 * The Milky Way is stored as a full-sphere equirectangular grid (cols x rows):
9 * col 0..cols-1 covers RA 0..360 degrees (wraps);
10 * row 0 = Dec +90, row rows-1 = Dec -90;
11 * luma at full resolution, chroma at half (cols/2 x rows/2).
12 * The generator queries Gaia DR3 (ESA/Gaia/DPAC, CC BY-NC 3.0 IGO) and
13 * reddening from gaiadr3.astrophysical_parameters to fill the grid. */
14#ifndef AIENOS_SKY_DATA_H
15#define AIENOS_SKY_DATA_H
16#include <stdint.h>
17
18typedef struct {
19 int32_t ra_mdeg, dec_mdeg, fov_mdeg, roll_mdeg; /* the settings, thousandths of a degree */
20 int32_t tan_half_q30; /* tan(fov / 2): half the width, in tangent-plane units */
21 int32_t rot_q30[3][3]; /* rows: screen right, screen up, the view centre */
22} ck_sky_view;
23
24typedef struct {
25 int16_t x, y, z; /* the direction, Q15 */
26 uint8_t mag; /* (V + 2) x 20 */
27 uint8_t bv; /* palette index: B-V = -0.40 + 0.02 bv */
28} ck_sky_star;
29
30typedef struct {
31 uint16_t cols, rows; /* equirectangular grid: cols RA cols, rows Dec rows */
32 uint16_t per_width; /* = cols (kept for renderer: samples per 360 deg RA) */
33 int32_t row0_q16; /* unused (0); kept so the struct is unchanged */
34} ck_sky_map;
35
36typedef struct {
37 int16_t dir[3]; /* the centre, Q15 */
38 int32_t a_q16, b_q16; /* half the long and short axes on screen, screen widths, Q16 */
39 uint16_t angle; /* the long axis on screen, turns / 65536 from right towards down */
40 uint32_t tint; /* its colour (from its B-V), sRGB */
41} ck_sky_galaxy;
42
43typedef struct {
44 uint16_t star; /* index into ck_sky_stars */
45 int32_t x16, y16; /* where the generator puts it on 3840 x 2160, 16ths of a pixel */
46} ck_sky_check;
47
48extern const ck_sky_view ck_sky_the_view;
49extern const ck_sky_star ck_sky_stars[];
50extern const unsigned ck_sky_nstars;
51extern const uint32_t ck_sky_flux[256];
52extern const uint16_t ck_sky_palette[128][3];
53extern const uint16_t ck_sky_lin[256];
54extern const uint16_t ck_sky_srgb16[4096];
55extern const ck_sky_map ck_sky_milkyway;
56extern const uint8_t ck_sky_luma[];
57extern const int8_t ck_sky_chroma[][2];
58extern const ck_sky_galaxy ck_sky_galaxies[];
59extern const unsigned ck_sky_ngalaxies;
60extern const ck_sky_check ck_sky_checks[];
61extern const unsigned ck_sky_nchecks;
62#endif