X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fdraw%2Fao_draw.h;fp=src%2Fdraw%2Fao_draw.h;h=96e334981bcf91825b564deb77e48ebca5dad558;hb=1311eba0bbe32bc1759a3b11b00c78774843383c;hp=29afef9cb043fa3189c6c410ef4bac4e1ed6c325;hpb=7b2588ee723827b9be2a2d5f287afb1b5d351b23;p=fw%2Faltos diff --git a/src/draw/ao_draw.h b/src/draw/ao_draw.h index 29afef9c..96e33498 100644 --- a/src/draw/ao_draw.h +++ b/src/draw/ao_draw.h @@ -28,6 +28,8 @@ struct ao_bitmap { struct ao_box damage; }; +#define AO_BITMAP_STRIDE(width) (((width) + 31) >> 5) + struct ao_coord { float x, y; }; @@ -101,6 +103,14 @@ struct ao_glyph_metrics { int8_t advance; }; +struct ao_text_metrics { + int16_t width; + int16_t height; + int16_t x_off; + int16_t y_off; + int16_t advance; +}; + struct ao_font { const uint8_t *bytes; const uint16_t *pos; @@ -158,15 +168,25 @@ ao_poly(struct ao_bitmap *dst, uint32_t fill, uint8_t rop); -void +int16_t ao_text(struct ao_bitmap *dst, const struct ao_font *font, int16_t x, int16_t y, - char *string, + const char *string, uint32_t fill, uint8_t rop); +int16_t +ao_text_width(const struct ao_font *font, + const char *string); + +void +ao_logo_poly(struct ao_bitmap *dst, + const struct ao_transform *transform, + uint32_t fill, + uint8_t rop); + void ao_logo(struct ao_bitmap *dst, const struct ao_transform *transform, @@ -209,4 +229,7 @@ extern const struct ao_transform ao_identity; #define AO_NAND 0xe /* NOT src OR NOT dst */ #define AO_SET 0xf /* 1 */ +#define AO_WHITE 0xffffffff +#define AO_BLACK 0x00000000 + #endif /* _AO_DRAW_H_ */