X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fdraw%2Fao_draw.h;h=fbbc61c419cc909653c149ad7aaf92c2b707154a;hb=2f68d82238ff869b76b554fd8de61e3b6d06e8f9;hp=92150fc1aa9a0f8a772d3d6daed2b8e4434dc8a7;hpb=1301d576d9bface4cc625e4a4187401f93f54444;p=fw%2Faltos diff --git a/src/draw/ao_draw.h b/src/draw/ao_draw.h index 92150fc1..fbbc61c4 100644 --- a/src/draw/ao_draw.h +++ b/src/draw/ao_draw.h @@ -15,6 +15,10 @@ #ifndef _AO_DRAW_H_ #define _AO_DRAW_H_ +#include +#include +#include "ao_font.h" + struct ao_bitmap { uint32_t *base; int16_t stride; /* in units */ @@ -22,10 +26,31 @@ struct ao_bitmap { int16_t height; /* in pixels */ }; +struct ao_coord { + float x, y; +}; + struct ao_pattern { uint8_t pattern[8]; }; +struct ao_glyph_metrics { + int8_t width; + int8_t height; + int8_t x_off; + int8_t y_off; + int8_t advance; +}; + +struct ao_font { + const uint8_t *bytes; + const uint16_t *pos; + const struct ao_glyph_metrics *metrics; + int max_width; + int max_height; + int ascent; +}; + void ao_copy(const struct ao_bitmap *dst, int16_t dst_x, @@ -66,22 +91,29 @@ ao_line(const struct ao_bitmap *dst, uint32_t fill, uint8_t rop); +void +ao_poly(const struct ao_bitmap *dst, + const struct ao_coord *coords, + uint16_t ncoords, + uint32_t fill, + uint8_t rop); + void ao_text(const struct ao_bitmap *dst, + const struct ao_font *font, int16_t x, int16_t y, char *string, uint32_t fill, uint8_t rop); -struct ao_font { - int width; - int height; - int ascent; - int descent; -}; +void +ao_logo(const struct ao_bitmap *dst, + const struct ao_font *font, + uint32_t fill, + uint8_t rop); -extern const struct ao_font ao_font; +extern const struct ao_font FrutigerLT_Roman_50_font; #define AO_SHIFT 5 #define AO_UNIT (1 << AO_SHIFT)