+struct ao_transform {
+ float x_scale, x_off;
+ float y_scale, y_off;
+};
+
+static inline float ao_t_x(float x, float y, const struct ao_transform *t)
+{
+ (void) y;
+ return x * t->x_scale + t->x_off;
+}
+
+static inline int16_t ao_t_xi(float x, float y, const struct ao_transform *t)
+{
+ return (int16_t) (ao_t_x(x, y, t) + 0.5f);
+}
+
+static inline float ao_t_y(float x, float y, const struct ao_transform *t)
+{
+ (void) x;
+ return y * t->y_scale + t->y_off;
+}
+
+static inline int16_t ao_t_yi(float x, float y, const struct ao_transform *t)
+{
+ return (int16_t) (ao_t_y(x, y, t) + 0.5f);
+}
+
+static inline float ao_t_x_c(const struct ao_coord *c,
+ const struct ao_transform *t)
+{
+ return ao_t_x(c->x, c->y, t);
+}
+
+static inline float ao_t_y_c(const struct ao_coord *c,
+ const struct ao_transform *t)
+{
+ return ao_t_y(c->x, c->y, t);
+}
+
+static inline int16_t
+ao_stride(int16_t width)
+{
+ return (int16_t) ((width + 31) >> 5);
+}
+
+static inline int16_t
+ao_stride_bytes(int16_t width)
+{
+ return (int16_t) ((width + 7) >> 3);
+}
+
+static inline void
+ao_damage_set_empty(struct ao_bitmap *dst)
+{
+ ao_box_set_empty(&dst->damage);
+}
+