mirror of
https://github.com/dnet/pySSTV.git
synced 2026-04-06 06:43:42 +00:00
codegen: replaced BMP with RGB array and STBI
This commit is contained in:
parent
ec6ff85d06
commit
dee321d59e
3 changed files with 13 additions and 17 deletions
|
|
@ -1,21 +1,13 @@
|
|||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#define STB_IMAGE_IMPLEMENTATION
|
||||
#define STBI_ONLY_PNG
|
||||
#include "stb_image.h"
|
||||
#include "codegen.c"
|
||||
|
||||
int main() {
|
||||
uint32_t offset, size;
|
||||
FILE *f = fopen("320x256rgb.bmp", "r");
|
||||
fseek(f, 0x02, SEEK_SET);
|
||||
fread(&size, 4, 1, f);
|
||||
fseek(f, 0x0A, SEEK_SET);
|
||||
fread(&offset, 4, 1, f);
|
||||
fseek(f, offset, SEEK_SET);
|
||||
|
||||
unsigned char img[size];
|
||||
|
||||
fread(img, size - offset, 1, f);
|
||||
fclose(f);
|
||||
int x, y, n;
|
||||
unsigned char *img = stbi_load("320x256rgb.png", &x, &y, &n, 0);
|
||||
|
||||
float freqs[FREQ_COUNT], msecs[FREQ_COUNT];
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue