Mercurial > repos > blastem
diff pixel.h @ 2685:da2e06c42d16
Add a compile-time flag to use RGB565 instead of ABGR/ARGB
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Sun, 30 Mar 2025 00:06:53 -0700 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pixel.h Sun Mar 30 00:06:53 2025 -0700 @@ -0,0 +1,14 @@ +#ifndef PIXEL_H_ +#define PIXEL_H_ + +#include <stdint.h> +#ifdef USE_RGB565 +typedef uint16_t pixel_t; +#else +typedef uint32_t pixel_t; +#endif + +#define PITCH_BYTES(width) (sizeof(uint32_t) * ((width * sizeof(pixel_t) + sizeof(uint32_t) - 1) / sizeof(uint32_t))) +#define PITCH_PIXEL_T(width) ((width * sizeof(pixel_t) + sizeof(uint32_t) - 1) / sizeof(uint32_t)) * (sizeof(uint32_t) / sizeof(pixel_t)) + +#endif //PIXEL_H_