pySSTV/pysstv/examples/codeman.c

23 lines
421 B
C
Raw Normal View History

2016-02-22 15:02:00 +01:00
#include <stdio.h>
#define STB_IMAGE_IMPLEMENTATION
#define STBI_ONLY_PNG
#include "stb_image.h"
2016-02-22 15:02:00 +01:00
#include "codegen.c"
2016-02-22 17:35:09 +01:00
int main() {
int x, y, n;
unsigned char *img = stbi_load("320x256rgb.png", &x, &y, &n, 0);
2016-02-22 15:02:00 +01:00
float freqs[FREQ_COUNT], msecs[FREQ_COUNT];
convert(img, freqs, msecs);
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
}