mirror of
https://github.com/dnet/pySSTV.git
synced 2025-12-06 07:12:00 +01:00
23 lines
424 B
C
23 lines
424 B
C
#include <stdio.h>
|
|
|
|
#define STB_IMAGE_IMPLEMENTATION
|
|
#define STBI_ONLY_PNG
|
|
#include "stb_image.h"
|
|
#include "codegen.c"
|
|
|
|
int main() {
|
|
int x, y, n;
|
|
unsigned char *img = stbi_load("320x256rgb.png", &x, &y, &n, 0);
|
|
|
|
float freqs[FREQ_COUNT], msecs[FREQ_COUNT];
|
|
|
|
convert(img, freqs, msecs, x);
|
|
|
|
for (int i = 0; i < FREQ_COUNT; i++) {
|
|
fwrite(&(freqs[i]), 4, 1, stdout);
|
|
fwrite(&(msecs[i]), 4, 1, stdout);
|
|
}
|
|
|
|
return 0;
|
|
}
|