X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fgfxutil.h;h=cf644873a66fa7248401557b8dbb6f898a5990ab;hb=13f4229ee540e22a5f3ede4d345ae1269cd708d3;hp=07883ef84f1af59466ff66c337365967e3d72e3e;hpb=07ce18b114e1e01b2a85a04079128f3eb754de1d;p=dosdemo diff --git a/src/gfxutil.h b/src/gfxutil.h index 07883ef..cf64487 100644 --- a/src/gfxutil.h +++ b/src/gfxutil.h @@ -1,12 +1,16 @@ #ifndef GFXUTIL_H_ #define GFXUTIL_H_ +#include "inttypes.h" + #define PACK_RGB16(r, g, b) \ - (((((r) >> 3) & 0x1f) << 11) | ((((g) >> 2) & 0x3f) << 5) | (((b) >> 3) & 0x1f)) + (((((uint16_t)(r) >> 3) & 0x1f) << 11) | \ + ((((uint16_t)(g) >> 2) & 0x3f) << 5) | \ + (((uint16_t)(b) >> 3) & 0x1f)) -#define UNPACK_R16(c) (((c) >> 8) & 0x7c) +#define UNPACK_R16(c) (((c) >> 8) & 0xf8) #define UNPACK_G16(c) (((c) >> 3) & 0xfc) -#define UNPACK_B16(c) (((c) << 3) & 0x7c) +#define UNPACK_B16(c) (((c) << 3) & 0xf8) #define PACK_RGB32(r, g, b) \ ((((r) & 0xff) << 16) | (((g) & 0xff) << 8) | ((b) & 0xff)) @@ -14,4 +18,7 @@ int clip_line(int *x0, int *y0, int *x1, int *y1, int xmin, int ymin, int xmax, int ymax); void draw_line(int x0, int y0, int x1, int y1, unsigned short color); +void blur_grey_horiz(uint16_t *dest, uint16_t *src, int xsz, int ysz, int radius); +void blur_grey_vert(uint16_t *dest, uint16_t *src, int xsz, int ysz, int radius); + #endif /* GFXUTIL_H_ */