pbsplash/include/pbsplash.h
Caleb Connolly 01af13950c
WIP: vendor tfblib + clang-format
We only need a subset of it, to iterate faster and integrate features
like in-line rotation let's vendor it for now.

Signed-off-by: Caleb Connolly <caleb@connolly.tech>
2023-07-28 20:15:06 +01:00

34 lines
690 B
C

#ifndef __pbsplash_h__
#define __pbsplash_h__
#define MM_TO_PX(dpi, mm) (dpi / 25.4) * (mm)
#define ARRAY_SIZE(a) ((int)(sizeof(a) / sizeof(a[0])))
#define INT_ABS(x) ((x) > 0 ? (x) : (-(x)))
#define MIN(x, y) \
({ \
__typeof__(x) _x = (x); \
__typeof__(y) _y = (y); \
_x <= _y ? _x : _y; \
})
#define MAX(x, y) \
({ \
__typeof__(x) _x = (x); \
__typeof__(y) _y = (y); \
_x > _y ? _x : _y; \
})
struct col {
union {
unsigned int rgba;
struct {
unsigned char r, g, b, a;
};
};
};
void animate_frame(int frame, int w, int y_off, long dpi);
#endif