Makefile: build all backends with optional HDR output

This commit is contained in:
wyj committed 2026-08-30 02:29:41 -04:00
1 parent 09923b9b18
commit 19f3a91b7f
5 files changed
+63 -32

No files matched your search

+5 -5
View File
@@ -31,7 +31,7 @@ typedef struct {
const char *catalog_path;
const char *all_sky_catalog_path;
const char *output_path;
#ifdef ENABLE_HDR_DEBUG
#ifdef ENABLE_HDR_OUTPUT
const char *hdr_output_path;
#endif
const char *observer_track_path;
@@ -189,7 +189,7 @@ static int parse_args(int argc, char **argv, Settings *s,
s->all_sky_catalog_path = argv[++i];
else if (!strcmp(argv[i], "--output") && i + 1 < argc)
s->output_path = argv[++i];
#ifdef ENABLE_HDR_DEBUG
#ifdef ENABLE_HDR_OUTPUT
else if (!strcmp(argv[i], "--hdr-output") && i + 1 < argc)
s->hdr_output_path = argv[++i];
#endif
@@ -449,7 +449,7 @@ static int render_observer_frame(const Settings *s, StarCatalog *catalog,
&progress});
if (s->draw_mesh)
frame_draw_mesh(&mesh, hdr, s->width, s->height, 0.5, 0.5);
#ifdef ENABLE_HDR_DEBUG
#ifdef ENABLE_HDR_OUTPUT
if (s->hdr_output_path != NULL &&
write_hdr_fits(s->hdr_output_path, hdr, s->width, s->height,
s->horizontal_fov_deg)) {
@@ -666,7 +666,7 @@ int main(int argc, char **argv) {
"[--psf-fwhm-pixels N] [--psf-moffat-beta N] "
"[--max-magnification M] [--max-cache-psf-flux F] "
"[--psf-direct] [--verbose] "
#ifdef ENABLE_HDR_DEBUG
#ifdef ENABLE_HDR_OUTPUT
"[--hdr-output PATH] "
#endif
"[--coarse-cell-pixels N] [--refine-max-level N "
@@ -692,7 +692,7 @@ int main(int argc, char **argv) {
return write_minkowski_accel_track(&settings) == 0
? 0
: (perror(settings.write_minkowski_accel_track_path), 1);
#ifdef ENABLE_HDR_DEBUG
#ifdef ENABLE_HDR_OUTPUT
if (settings.frames_dir != NULL && settings.hdr_output_path != NULL) {
fputs("--hdr-output is available only for a single-frame render.\n", stderr);
return 2;
+2 -2
View File
@@ -8,7 +8,7 @@
#include <stdlib.h>
#include <string.h>
#ifdef ENABLE_HDR_DEBUG
#ifdef ENABLE_HDR_OUTPUT
#include <fitsio.h>
#endif
@@ -457,7 +457,7 @@ int write_tonemapped_image(const char *path, const double *hdr, int width, int h
#endif
}
#ifdef ENABLE_HDR_DEBUG
#ifdef ENABLE_HDR_OUTPUT
int write_hdr_fits(const char *path, const double *hdr, int width, int height,
double horizontal_fov_deg)
{
+2 -2
View File
@@ -58,8 +58,8 @@ int splat_moffat_cached(double *hdr, int width, int height, double x, double y,
/* Writes PNG when built with libpng; non-libpng builds use PPM fallback. */
int write_tonemapped_image(const char *path, const double *hdr, int width,
int height);
#ifdef ENABLE_HDR_DEBUG
/* Test-build-only: writes the pre-tone-mapping framebuffer as 32-bit RGB FITS. */
#ifdef ENABLE_HDR_OUTPUT
/* Writes the pre-tone-mapping framebuffer as a 32-bit RGB FITS image. */
int write_hdr_fits(const char *path, const double *hdr, int width, int height,
double horizontal_fov_deg);
#endif