Create a copy of the image before modifying it for temperature calibrationtags/v1.8.0
@@ -62,7 +62,7 @@ Apply a falsecolor palette | |||||
### Arguments | ### Arguments | ||||
``` | ``` | ||||
-i [r|a|b|t|m|p] Output type (stackable*) | |||||
-i [r|a|b|t|m|p] Output type (stackable) | |||||
-e [t|h|l|d|p|f] Effects (stackable) | -e [t|h|l|d|p|f] Effects (stackable) | ||||
-o <path> Output filename | -o <path> Output filename | ||||
-d <path> Destination directory | -d <path> Destination directory | ||||
@@ -73,7 +73,6 @@ Apply a falsecolor palette | |||||
-g Gamma adjustment (1.0 = off) | -g Gamma adjustment (1.0 = off) | ||||
-k Map offset (in px, default: 0) | -k Map offset (in px, default: 0) | ||||
``` | ``` | ||||
\* Should work with all combinations, but temperature needs to be done last as it calibrates the buffer | |||||
### Image output types | ### Image output types | ||||
@@ -227,8 +227,16 @@ static int processAudio(char *filename, options_t *opts){ | |||||
// Temperature | // Temperature | ||||
if (CONTAINS(opts->type, Temperature) && img.chB >= 4) { | if (CONTAINS(opts->type, Temperature) && img.chB >= 4) { | ||||
temperature(opts, &img, CHB_OFFSET, CH_WIDTH); | |||||
ImageOut(opts, &img, CHB_OFFSET, CH_WIDTH, "Temperature", Temperature, (char *)TempPalette); | |||||
// Create another buffer as to not modify the orignal | |||||
image_t tmpimg = img; | |||||
for(int i = 0; i < img.nrow; i++){ | |||||
tmpimg.prow[i] = (float *) malloc(sizeof(float) * 2150); | |||||
memcpy(tmpimg.prow[i], img.prow[i], sizeof(float) * 2150); | |||||
} | |||||
// Perform temperature calibration | |||||
temperature(opts, &tmpimg, CHB_OFFSET, CH_WIDTH); | |||||
ImageOut(opts, &tmpimg, CHB_OFFSET, CH_WIDTH, "Temperature", Temperature, (char *)TempPalette); | |||||
} | } | ||||
// MCIR | // MCIR | ||||