1 /* 2 * Copyright 2021, Haiku, Inc. 3 * Distributed under the terms of the MIT License. 4 */ 5 6 7 #ifndef _GRAPHICS_H_ 8 #define _GRAPHICS_H_ 9 10 11 #include <SupportDefs.h> 12 13 14 template <typename Color> 15 struct RasBuf { 16 Color* colors; 17 int32 stride, width, height; 18 19 RasBuf<Color> Clip(int x, int y, int w, int h) const; 20 }; 21 22 typedef RasBuf<uint8> RasBuf8; 23 typedef RasBuf<uint32> RasBuf32; 24 25 26 struct Font { 27 uint8 charWidth; 28 uint8 charHeight; 29 uint8 firstChar, charCnt; 30 uint8 data[0]; 31 32 RasBuf8 ThisGlyph(uint32 ch); 33 }; 34 35 36 extern RasBuf32 gFramebuf; 37 extern Font gFixedFont; 38 39 40 void Clear(RasBuf32 vb, uint32_t c); 41 42 void BlitMaskRgb(RasBuf32 dst, RasBuf8 src, int32 x, int32 y, uint32_t c); 43 44 45 #endif // _GRAPHICS_H_ 46