mirror of
https://git.sr.ht/~calebccff/pbsplash
synced 2026-01-13 04:58:39 -09:00
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>
34 lines
690 B
C
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
|