Browse Source

Improve MCIR, improve map alignment and remove useless palettes

tags/v1.8.0
Xerbo 3 years ago
parent
commit
4b1acdfa5f
5 changed files with 10 additions and 5 deletions
  1. +2
    -2
      dsp.c
  2. BIN
      palettes/WXtoImg-N15-HVCT.png
  3. BIN
      palettes/WXtoImg-N18-HVCT.png
  4. BIN
      palettes/WXtoImg-N19-HVCT.png
  5. +8
    -3
      pngio.c

+ 2
- 2
dsp.c View File

@@ -214,7 +214,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, previous = 0;
static double minDoppler = 1000000000, previous = 0;

if(reset) synced = 0;

@@ -282,7 +282,7 @@ int getpixelrow(float *pixelv, int nrow, int *zenith, int reset) {
mshift = 0;
}
lastmshift = mshiftOrig;
// If we are already as aligned as we can get, just continue
if (mshift == 0) {
synced++;


BIN
palettes/WXtoImg-N15-HVCT.png View File

Before After
Width: 256  |  Height: 256  |  Size: 15 KiB

BIN
palettes/WXtoImg-N18-HVCT.png View File

Before After
Width: 256  |  Height: 256  |  Size: 15 KiB

BIN
palettes/WXtoImg-N19-HVCT.png View File

Before After
Width: 256  |  Height: 256  |  Size: 15 KiB

+ 8
- 3
pngio.c View File

@@ -107,9 +107,10 @@ int mapOverlay(char *filename, rgb_t **crow, int nrow, int zenith, int MCIR) {
if(MCIR){
if(map.b < 128 && map.g > 128){
// Land
float darken = ((255-crow[y][chb].r)-100)/50;
float green = CLIP(map.g/300, 0, 1);
float blue = 0.15 - CLIP(map.b/960.0, 0, 1);
crow[y][cha] = (rgb_t){blue*1000, green*98, blue*500.0};
crow[y][cha] = (rgb_t){blue*1000*darken, green*98*darken, blue*500.0*darken};
}else{
// Sea
crow[y][cha] = (rgb_t){9, 17, 74};
@@ -123,6 +124,10 @@ int mapOverlay(char *filename, rgb_t **crow, int nrow, int zenith, int MCIR) {
map.r *= factor/257.0; map.g *= factor/257.0; map.b *= factor/257.0;
// Color -> alpha: convert black to alpha
float alpha = CLIP(composite / 65535.0, 0, 1);
// Clip
map.r = CLIP(map.r, 0, 255.0);
map.g = CLIP(map.g, 0, 255.0);
map.b = CLIP(map.b, 0, 255.0);

// Map overlay on channel A
crow[y][cha] = RGBcomposite(map, alpha, crow[y][cha], 1);
@@ -132,8 +137,8 @@ int mapOverlay(char *filename, rgb_t **crow, int nrow, int zenith, int MCIR) {

// Cloud overlay on channel A
if(MCIR){
float cloud = CLIP((crow[y][chb].r - 105) / 150, 0, 1);
crow[y][cha] = RGBcomposite((rgb_t){240, 250, 255}, cloud, crow[y][cha], 1);
float cloud = CLIP((crow[y][chb].r - 113) / 90.0, 0, 1);
crow[y][cha] = RGBcomposite((rgb_t){255, 250, 245}, cloud, crow[y][cha], 1);
}
}
}


Loading…
Cancel
Save