2016-02-22 15:02:00 +01:00
|
|
|
#include <stdio.h>
|
|
|
|
|
|
2016-04-19 11:13:57 +02:00
|
|
|
#define STB_IMAGE_IMPLEMENTATION
|
|
|
|
|
#include "stb_image.h"
|
2016-02-22 15:02:00 +01:00
|
|
|
#include "codegen.c"
|
|
|
|
|
|
2016-04-20 14:04:57 +02:00
|
|
|
int main(int argc, char **argv) {
|
2016-04-19 11:13:57 +02:00
|
|
|
int x, y, n;
|
2016-04-20 14:04:57 +02:00
|
|
|
unsigned char *img = stbi_load(argv[1], &x, &y, &n, 0);
|
2016-02-22 15:02:00 +01:00
|
|
|
|
|
|
|
|
float freqs[FREQ_COUNT], msecs[FREQ_COUNT];
|
|
|
|
|
|
2016-04-19 11:20:14 +02:00
|
|
|
convert(img, freqs, msecs, x);
|
2016-02-22 15:02:00 +01:00
|
|
|
|
|
|
|
|
for (int i = 0; i < FREQ_COUNT; i++) {
|
|
|
|
|
fwrite(&(freqs[i]), 4, 1, stdout);
|
|
|
|
|
fwrite(&(msecs[i]), 4, 1, stdout);
|
|
|
|
|
}
|
2016-02-22 17:35:09 +01:00
|
|
|
|
|
|
|
|
return 0;
|
2016-02-22 15:02:00 +01:00
|
|
|
}
|