#include "structures_app.h"

/* This is the place for global application function prototypes if any,
   see engine/declarations.h. Do not remove include line above. */



/* calc.c */
void maths_bv_to_rgba(struct pixel_rgba_8 *, double, double);
double maths_kelvin_to_celsius(double);
double maths_kelvin_to_fahrenheit(double);
double maths_bv_to_temperature(double);
double maths_hp_to_vmag(double, double);
double maths_vt_to_vmag(double, double);
double maths_btvt_to_bv(double);
double maths_vmag_to_alpha(double);
double maths_amag_by_vmag_distance(double, double);
double maths_luminance_by_radius_temperature(double, double);
double maths_parsec_by_parallax(double);
double maths_radius_by_amag_temperature(double, double);

/* catalog.c */
int catalog_read(char *);
int catalog_create(char *);
int catalog_close(void);
int catalog_entry_open(void);
int catalog_entry_item_save(void *, size_t);
int catalog_header(void);

/* galaxy.c */
int galaxy_create(struct universe *, unsigned long);
void galaxy_free(struct galaxy *);
void galaxy_live(unsigned long, double, double, double, unsigned int);
void galaxy_live_free(struct galaxy *);
unsigned long galaxy_live_closest(unsigned long, double, double);
int galaxy_print_catalog(struct galaxy *);

char *galaxy_get_name(unsigned long);
char *galaxy_get_nick(unsigned long);

void galaxy_print(unsigned long);
void galaxy_print_human(struct galaxy *) __UNUSED__;

/* planet.c */
int planet_create(struct star *, unsigned long);
int planet_satellite_create(struct star *, unsigned long, unsigned long);
void planet_free(struct planet *);
void planet_satellite_free(struct planet *);
void planet_image(struct star *, unsigned long, char *, int);
void planet_preview(struct star *, unsigned long, unsigned int, int, int);
void planet_preview_free(struct planet *);
void planet_live(unsigned long, unsigned long, unsigned long, double, double, double, unsigned int);
void planet_live_free(struct planet *);
unsigned long planet_live_closest(unsigned long, unsigned long, unsigned long, double, double);
int planet_print_catalog(struct star *, unsigned long);
int planet_satellite_print_catalog(struct planet *, unsigned long);

char *planet_get_name(unsigned long, unsigned long, unsigned long);
char *planet_get_nick(unsigned long, unsigned long, unsigned long);

char *planet_satellite_get_name(unsigned long, unsigned long, unsigned long, unsigned long);
char *planet_satellite_get_nick(unsigned long, unsigned long, unsigned long, unsigned long);

void planet_render(unsigned int, unsigned long, unsigned long, unsigned long);
void planet_store(unsigned long, unsigned long, unsigned long, char *);
void planet_print(unsigned long, unsigned long, unsigned long);
void planet_print_human(struct star *, unsigned long) __UNUSED__;
void planet_satellite_print_human(struct planet *, unsigned long) __UNUSED__;

/* sphere.c */
void draw_sphere(struct pixel_rgba_8 *, struct pixel_rgba_8 *, struct pixel_rgb_8 *, struct position *, double, double, unsigned int);
void draw_sphere_blur(struct pixel_rgba_8 *, struct pixel_rgba_8 *, struct pixel_rgb_8 *, struct position *, double, double, unsigned int);
void draw_sphere_alpha(struct pixel_rgba_8 *, struct pixel_rgba_8 *, struct pixel_rgb_8 *, struct position *, double, double, unsigned int);
void draw_sphere_alpha_blur(struct pixel_rgba_8 *, struct pixel_rgba_8 *, struct pixel_rgb_8 *, struct position *, double, double, unsigned int);
unsigned int draw_sphere_solid_cache(int, int, double, double, double, double);
unsigned int draw_sphere_alpha_noise_2d_cache(int, int, double, double, double, unsigned int);
unsigned int draw_sphere_matte_noise_2d_cache(int, int, double, double, double, unsigned int, double);
unsigned int draw_sphere_alpha_noise_3d_cache(int, int, double, double, double, unsigned int, unsigned int);
unsigned int draw_sphere_alpha_turbulence_3d_cache(int, int, double, double, double, unsigned int, double, int);
unsigned int draw_sphere_matte_noise_3d_cache(int, int, double, double, double, unsigned int, unsigned int, double);
unsigned int draw_sphere_matte_turbulence_3d_cache(int, int, double, double, double, unsigned int, double, int, double);
void draw_sphere_cache_delete(unsigned int);
void draw_sphere_cache_delete_all(void);

/* star.c */
int star_create(struct galaxy *, unsigned long);
int star_create_neutron(struct galaxy *, unsigned long);
int star_create_blackhole(struct galaxy *, unsigned long);
int star_create_solar(struct galaxy *, unsigned long);
void star_create_spot(struct galaxy *, unsigned long);
void star_create_spot_blackhole(struct galaxy *, unsigned long);
void star_free(struct star *);
void star_image(struct star *, char *, int);
void star_preview(struct star *, unsigned int, int, int);
void star_preview_free(struct star *);
void star_live(unsigned long, unsigned long, double, double, double, unsigned int);
void star_live_free(struct star *);
unsigned long star_live_closest(unsigned long, unsigned long, double, double);
int star_print_catalog(struct star *);

char *star_get_name(unsigned long, unsigned long);
char *star_get_nick(unsigned long, unsigned long);

void star_render(unsigned int, unsigned long, unsigned long);
void star_store(unsigned long, unsigned long, char *);
void star_print(unsigned long, unsigned long);
void star_print_human(struct star *) __UNUSED__;

/* universe.c */
int universe_init(void);
void universe_free(void);
void universe_run(void);
void universe_set_message(char *);
unsigned int universe_chk_message(void);
char *universe_get_message(void);
char *universe_get_date(void);
struct galaxy *universe_get_galaxy_by_id(unsigned long);
struct star *universe_get_star_by_id(unsigned long, unsigned long);
struct planet *universe_get_planet_by_id(unsigned long, unsigned long, unsigned long);
struct planet *universe_get_satellite_by_id(unsigned long, unsigned long, unsigned long, unsigned long);
