pySSTV/pysstv/examples/codeman.c

22 lines
414 B
C
Raw Normal View History

2016-02-22 15:02:00 +01:00
#include <stdio.h>
#define STB_IMAGE_IMPLEMENTATION
#include "stb_image.h"
2016-02-22 15:02:00 +01:00
#include "codegen.c"
int main(int argc, char **argv) {
int x, y, n;
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];
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
}