It didn't even work in the latest committags/v1.8.0
@@ -244,45 +244,6 @@ int calibrate(float **prow, int nrow, int offset, int width) { | |||||
} | } | ||||
void distrib(options_t *opts, image_t *img, char chid) { | |||||
int max = 0; | |||||
// Options | |||||
options_t options; | |||||
options.path = opts->path; | |||||
options.effects = ""; | |||||
options.map = ""; | |||||
// Image options | |||||
image_t distrib; | |||||
strcpy(distrib.name, img->name); | |||||
distrib.nrow = 256; | |||||
// Assign memory | |||||
for(int i = 0; i < 256; i++) | |||||
distrib.prow[i] = (float *) malloc(sizeof(float) * 256); | |||||
for(int n = 0; n < img->nrow; n++) { | |||||
float *pixelv = img->prow[n]; | |||||
for(int i = 0; i < CH_WIDTH; i++) { | |||||
int y = CLIP((int)pixelv[i + CHA_OFFSET], 0, 255); | |||||
int x = CLIP((int)pixelv[i + CHB_OFFSET], 0, 255); | |||||
distrib.prow[y][x]++; | |||||
if(distrib.prow[y][x] > max) | |||||
max = distrib.prow[y][x]; | |||||
} | |||||
} | |||||
// Scale to 0-255 | |||||
for(int x = 0; x < 256; x++) | |||||
for(int y = 0; y < 256; y++) | |||||
distrib.prow[y][x] = distrib.prow[y][x] / max * 255.0; | |||||
extern int ImageOut(options_t *opts, image_t *img, int offset, int width, char *desc, char chid, char *palette); | |||||
ImageOut(&options, &distrib, 0, 256, "Distribution", chid, NULL); | |||||
} | |||||
extern float quick_select(float arr[], int n); | extern float quick_select(float arr[], int n); | ||||
// Biased median denoise, pretyt ugly | // Biased median denoise, pretyt ugly | ||||
@@ -47,7 +47,6 @@ extern void histogramEqualise(float **prow, int nrow, int offset, int width); | |||||
extern void linearEnhance(float **prow, int nrow, int offset, int width); | extern void linearEnhance(float **prow, int nrow, int offset, int width); | ||||
extern void temperature(options_t *opts, image_t *img, int offset, int width); | extern void temperature(options_t *opts, image_t *img, int offset, int width); | ||||
extern void denoise(float **prow, int nrow, int offset, int width); | extern void denoise(float **prow, int nrow, int offset, int width); | ||||
extern void distrib(options_t *opts, image_t *img, char chid); | |||||
extern void flipImage(image_t *img, int width, int offset); | extern void flipImage(image_t *img, int width, int offset); | ||||
extern void cropNoise(image_t *img); | extern void cropNoise(image_t *img); | ||||
@@ -280,10 +279,6 @@ static int processAudio(char *filename, options_t *opts){ | |||||
ImageOut(opts, &img, CHB_OFFSET, CH_WIDTH, desc, Channel_B, NULL); | ImageOut(opts, &img, CHB_OFFSET, CH_WIDTH, desc, Channel_B, NULL); | ||||
} | } | ||||
// Value distribution image | |||||
if (CONTAINS(opts->type, Distribution)) | |||||
distrib(opts, &img, Distribution); | |||||
return 1; | return 1; | ||||
} | } | ||||