Browse Source

Merge pull request #17 from srcejon/libaptdec

Add apt_temperature to API
tags/v1.8.0
Liam 2 years ago
committed by GitHub
parent
commit
4a00dac06b
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 11 deletions
  1. +1
    -0
      src/apt.h
  2. +3
    -7
      src/image.c
  3. +0
    -2
      src/image.h
  4. +2
    -2
      src/main.c

+ 1
- 0
src/apt.h View File

@@ -100,6 +100,7 @@ apt_channel_t APT_API apt_calibrate(float **prow, int nrow, int offset, int widt
void APT_API apt_denoise(float **prow, int nrow, int offset, int width); void APT_API apt_denoise(float **prow, int nrow, int offset, int width);
void APT_API apt_flipImage(apt_image_t *img, int width, int offset); void APT_API apt_flipImage(apt_image_t *img, int width, int offset);
int APT_API apt_cropNoise(apt_image_t *img); int APT_API apt_cropNoise(apt_image_t *img);
void APT_API apt_temperature(int satnum, apt_image_t *img, int offset, int width);


apt_rgb_t APT_API apt_applyPalette(char *palette, int val); apt_rgb_t APT_API apt_applyPalette(char *palette, int val);
apt_rgb_t APT_API apt_RGBcomposite(apt_rgb_t top, float top_a, apt_rgb_t bottom, float bottom_a); apt_rgb_t APT_API apt_RGBcomposite(apt_rgb_t top, float top_a, apt_rgb_t bottom, float bottom_a);


+ 3
- 7
src/image.c View File

@@ -395,18 +395,14 @@ static double tempcal(float Ce, int satnum, tempparam_t * rgpr) {
} }


// Temperature calibration wrapper // 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; 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 y = 0; y < img->nrow; y++) {
for (int x = 0; x < width; x++) { 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");
} }

+ 0
- 2
src/image.h View File

@@ -1,4 +1,2 @@
#include "apt.h" #include "apt.h"
#include "common.h" #include "common.h"

void APT_API temperature(options_t *opts, apt_image_t *img, int offset, int width);

+ 2
- 2
src/main.c View File

@@ -221,7 +221,7 @@ static int processAudio(char *filename, options_t *opts){
} }


// Perform temperature calibration // 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); 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)) { if (CONTAINS(opts->type, Palleted)) {
img.palette = opts->palette; img.palette = opts->palette;
strcpy(desc, "Palette composite"); 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 // Channel A


Loading…
Cancel
Save