#include <stdint.h>
#include <stdbool.h>
#include "ao_font.h"
+#include "ao_box.h"
struct ao_bitmap {
uint32_t *base;
int16_t stride; /* in units */
int16_t width; /* in pixels */
int16_t height; /* in pixels */
+ struct ao_box damage;
};
+#define AO_BITMAP_STRIDE(width) (((width) + 31) >> 5)
+
struct ao_coord {
float x, y;
};
return (int16_t) ((width + 7) >> 3);
}
+static inline void
+ao_damage_set_empty(struct ao_bitmap *dst)
+{
+ ao_box_set_empty(&dst->damage);
+}
+
struct ao_pattern {
uint8_t pattern[8];
};
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;
};
void
-ao_copy(const struct ao_bitmap *dst,
+ao_copy(struct ao_bitmap *dst,
int16_t dst_x,
int16_t dst_y,
int16_t width,
uint8_t rop);
void
-ao_rect(const struct ao_bitmap *dst,
+ao_rect(struct ao_bitmap *dst,
int16_t x,
int16_t y,
int16_t width,
uint8_t rop);
void
-ao_pattern(const struct ao_bitmap *dst,
+ao_pattern(struct ao_bitmap *dst,
int16_t x,
int16_t y,
int16_t width,
uint8_t rop);
void
-ao_line(const struct ao_bitmap *dst,
+ao_line(struct ao_bitmap *dst,
int16_t x1,
int16_t y1,
int16_t x2,
uint8_t rop);
void
-ao_poly(const struct ao_bitmap *dst,
+ao_poly(struct ao_bitmap *dst,
const struct ao_coord *coords,
uint16_t ncoords,
const struct ao_transform *transform,
uint32_t fill,
uint8_t rop);
-void
-ao_text(const struct ao_bitmap *dst,
+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(const struct ao_bitmap *dst,
+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,
const struct ao_font *font,
uint32_t fill,
#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_ */