Sfoglia il codice sorgente

Remove distribution image generation

It didn't even work in the latest commit
tags/v1.8.0
Xerbo 4 anni fa
parent
commit
ec8a1eb168
2 ha cambiato i file con 0 aggiunte e 44 eliminazioni
  1. +0
    -39
      src/image.c
  2. +0
    -5
      src/main.c

+ 0
- 39
src/image.c Vedi File

@@ -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);

// Biased median denoise, pretyt ugly


+ 0
- 5
src/main.c Vedi File

@@ -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 temperature(options_t *opts, image_t *img, 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 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);
}

// Value distribution image
if (CONTAINS(opts->type, Distribution))
distrib(opts, &img, Distribution);

return 1;
}



Caricamento…
Annulla
Salva