Passes are flipped when northbound, not southboundtags/v1.8.0
@@ -71,6 +71,7 @@ Apply a falsecolor palette | |||||
-p <path> Path to palette | -p <path> Path to palette | ||||
-r Realtime decode | -r Realtime decode | ||||
-g Gamma adjustment (1.0 = off) | -g Gamma adjustment (1.0 = off) | ||||
-k Map offset (in px, default: 0) | |||||
``` | ``` | ||||
### Image types | ### Image types | ||||
@@ -89,7 +90,7 @@ Apply a falsecolor palette | |||||
- `l`: Linear equalise | - `l`: Linear equalise | ||||
- `d`: Denoise | - `d`: Denoise | ||||
- `p`: Precipitation overlay | - `p`: Precipitation overlay | ||||
- `f`: Flip image (for southbound passes) | |||||
- `f`: Flip image (for northbound passes) | |||||
- `c`: Crop noise from ends of image | - `c`: Crop noise from ends of image | ||||
## Realtime decoding | ## Realtime decoding | ||||
@@ -47,6 +47,7 @@ typedef struct { | |||||
char *filename; // Output filename | char *filename; // Output filename | ||||
char *palette; // Filename of palette | char *palette; // Filename of palette | ||||
float gamma; // Gamma | float gamma; // Gamma | ||||
int mapOffset; | |||||
} options_t; | } options_t; | ||||
enum imagetypes { | enum imagetypes { | ||||
@@ -306,7 +306,7 @@ void denoise(float **prow, int nrow, int offset, int width){ | |||||
} | } | ||||
#undef TRIG_LEVEL | #undef TRIG_LEVEL | ||||
// Flips a channe, for southbound passes | |||||
// Flips a channel, for northbound passes | |||||
void flipImage(image_t *img, int width, int offset){ | void flipImage(image_t *img, int width, int offset){ | ||||
for(int y = 1; y < img->nrow; y++){ | for(int y = 1; y < img->nrow; y++){ | ||||
for(int x = 1; x < ceil(width / 2.0); x++){ | for(int x = 1; x < ceil(width / 2.0); x++){ | ||||
@@ -75,11 +75,11 @@ int main(int argc, char **argv) { | |||||
usage(); | usage(); | ||||
} | } | ||||
options_t opts = { "r", "", 19, "", ".", 0, "", "", 1.0 }; | |||||
options_t opts = { "r", "", 19, "", ".", 0, "", "", 1.0, 0 }; | |||||
// Parse arguments | // Parse arguments | ||||
int opt; | int opt; | ||||
while ((opt = getopt(argc, argv, "o:m:d:i:s:e:p:g:r")) != EOF) { | |||||
while ((opt = getopt(argc, argv, "o:m:d:i:s:e:p:g:k:r")) != EOF) { | |||||
switch (opt) { | switch (opt) { | ||||
case 'd': | case 'd': | ||||
opts.path = optarg; | opts.path = optarg; | ||||
@@ -112,6 +112,9 @@ int main(int argc, char **argv) { | |||||
case 'g': | case 'g': | ||||
opts.gamma = atof(optarg); | opts.gamma = atof(optarg); | ||||
break; | break; | ||||
case 'k': | |||||
opts.mapOffset = atoi(optarg); | |||||
break; | |||||
default: | default: | ||||
usage(); | usage(); | ||||
} | } | ||||
@@ -216,7 +219,7 @@ static int processAudio(char *filename, options_t *opts){ | |||||
denoise(img.prow, img.nrow, CHB_OFFSET, CH_WIDTH); | denoise(img.prow, img.nrow, CHB_OFFSET, CH_WIDTH); | ||||
} | } | ||||
// Flip, for southbound passes | |||||
// Flip, for northbound passes | |||||
if(CONTAINS(opts->effects, Flip_Image)){ | if(CONTAINS(opts->effects, Flip_Image)){ | ||||
flipImage(&img, CH_WIDTH, CHA_OFFSET); | flipImage(&img, CH_WIDTH, CHA_OFFSET); | ||||
flipImage(&img, CH_WIDTH, CHB_OFFSET); | flipImage(&img, CH_WIDTH, CHB_OFFSET); | ||||
@@ -345,6 +348,7 @@ static void usage(void) { | |||||
" -p <path> Path to palette\n" | " -p <path> Path to palette\n" | ||||
" -r Realtime decode\n" | " -r Realtime decode\n" | ||||
" -g Gamma adjustment (1.0 = off)\n" | " -g Gamma adjustment (1.0 = off)\n" | ||||
" -k Map offset (in px, default: 0)" | |||||
"\nRefer to the README for more infomation\n"); | "\nRefer to the README for more infomation\n"); | ||||
exit(EINVAL); | exit(EINVAL); | ||||
@@ -429,7 +429,7 @@ int ImageOut(options_t *opts, image_t *img, int offset, int width, char *desc, c | |||||
// Map stuff | // Map stuff | ||||
if(opts->map != NULL && opts->map[0] != '\0'){ | if(opts->map != NULL && opts->map[0] != '\0'){ | ||||
if(!mapOverlay(opts->map, crow, img->nrow, img->zenith, CONTAINS(opts->type, MCIR))){ | |||||
if(!mapOverlay(opts->map, crow, img->nrow, img->zenith+opts->mapOffset, CONTAINS(opts->type, MCIR))){ | |||||
fprintf(stderr, "Skipping MCIR generation.\n"); | fprintf(stderr, "Skipping MCIR generation.\n"); | ||||
return 0; | return 0; | ||||
} | } | ||||