From 61c248b9113daeb015c939d500fbf63abd221916 Mon Sep 17 00:00:00 2001 From: Jon Beniston Date: Thu, 13 Jan 2022 11:45:15 +0000 Subject: [PATCH] Add apt_temperature to API --- src/image.c | 10 +++------- src/image.h | 2 -- src/main.c | 4 ++-- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/image.c b/src/image.c index 11a2ef9..66b1525 100644 --- a/src/image.c +++ b/src/image.c @@ -395,18 +395,14 @@ static double tempcal(float Ce, int satnum, tempparam_t * rgpr) { } // Temperature calibration wrapper -void temperature(options_t *opts, apt_image_t *img, int offset, int width){ +void apt_temperature(int satnum, apt_image_t *img, int offset, int width){ tempparam_t temp; - printf("Temperature... "); - fflush(stdout); - - tempcomp(tele, img->chB, opts->satnum - 15, &temp); + tempcomp(tele, img->chB, satnum - 15, &temp); for (int y = 0; y < img->nrow; y++) { for (int x = 0; x < width; x++) { - img->prow[y][x + offset] = (float)tempcal(img->prow[y][x + offset], opts->satnum - 15, &temp); + img->prow[y][x + offset] = (float)tempcal(img->prow[y][x + offset], satnum - 15, &temp); } } - printf("Done\n"); } diff --git a/src/image.h b/src/image.h index ff6309f..94d52eb 100644 --- a/src/image.h +++ b/src/image.h @@ -1,4 +1,2 @@ #include "apt.h" #include "common.h" - -void APT_API temperature(options_t *opts, apt_image_t *img, int offset, int width); diff --git a/src/main.c b/src/main.c index 56c487b..b6387bc 100644 --- a/src/main.c +++ b/src/main.c @@ -221,7 +221,7 @@ static int processAudio(char *filename, options_t *opts){ } // Perform temperature calibration - temperature(opts, &tmpimg, APT_CHB_OFFSET, APT_CH_WIDTH); + apt_temperature(opts->satnum, &tmpimg, APT_CHB_OFFSET, APT_CH_WIDTH); ImageOut(opts, &tmpimg, APT_CHB_OFFSET, APT_CH_WIDTH, "Temperature", Temperature, (char *)apt_TempPalette); } @@ -251,7 +251,7 @@ static int processAudio(char *filename, options_t *opts){ if (CONTAINS(opts->type, Palleted)) { img.palette = opts->palette; strcpy(desc, "Palette composite"); - ImageOut(opts, &img, APT_CHA_OFFSET, 909, desc, Palleted, NULL); + ImageOut(opts, &img, APT_CHA_OFFSET, APT_CH_WIDTH, desc, Palleted, NULL); } // Channel A