Browse Source

Fix map handling & improve alignment, fix #5

tags/v1.8.0
Xerbo 4 years ago
parent
commit
da6b4ab056
2 changed files with 10 additions and 5 deletions
  1. +3
    -2
      dsp.c
  2. +7
    -3
      pngio.c

+ 3
- 2
dsp.c View File

@@ -215,7 +215,7 @@ int getpixelrow(float *pixelv, int nrow, int *zenith, int reset) {
static int npv;
static int synced = 0;
static double max = 0.0;
static double minDoppler = 100;
static double minDoppler = 100, previous = 0;

if(reset) synced = 0;

@@ -241,10 +241,11 @@ int getpixelrow(float *pixelv, int nrow, int *zenith, int reset) {
FreqLine = 1.0+((ecorr-lcorr) / corr / PixelLine / 4.0);

// Find the point in which ecorr and lcorr intercept
if(fabs(lcorr - ecorr) < minDoppler && fabs(lcorr - ecorr) > 2){
if(fabs(lcorr - ecorr) < minDoppler && fabs(fabs(lcorr - ecorr) - previous) < 10){
minDoppler = fabs(lcorr - ecorr);
*zenith = nrow;
}
previous = fabs(lcorr - ecorr);

// The point in which the pixel offset is recalculated
if (corr < 0.75 * max) {


+ 7
- 3
pngio.c View File

@@ -259,7 +259,7 @@ void prow2crow(float **prow, int nrow, char *palette, rgb_t **crow){
crow[y] = (rgb_t *) malloc(sizeof(rgb_t) * IMG_WIDTH);

for(int x = 0; x < IMG_WIDTH; x++){
if(*palette == NULL)
if(palette == NULL)
crow[y][x].r = crow[y][x].g = crow[y][x].b = prow[y][x];
else
crow[y][x] = applyPalette(palette, prow[y][x]);
@@ -337,6 +337,10 @@ int ImageOut(options_t *opts, image_t *img, int offset, int width, char *desc, c
break;
}
}
if(opts->map != NULL && opts->map[0] != '\0'){
greyscale = 0;
}

FILE *pngfile;

@@ -380,8 +384,8 @@ int ImageOut(options_t *opts, image_t *img, int offset, int width, char *desc, c

// Move prow into crow, crow ~ color rows, if required
rgb_t *crow[img->nrow];
if(!greyscale)
prow2crow(img->prow, img->nrow, palette, crow);
if(!greyscale)
prow2crow(img->prow, img->nrow, palette, crow);

// Apply a user provided color palette
if(CONTAINS(opts->type, Palleted))


Loading…
Cancel
Save