Impossible SDK

Reference

ui/draw.h

Drawing into a buffer of opaque pixels. Portable.

im_rect

A rectangle in pixels, 16.16 fixed point.

ui/draw.h, line 9
typedef struct im_rect {
    im_fixed left, top, right, bottom; /* pixels */
} im_rect;

im_radii

The four corner radii of a shape.

ui/draw.h, line 14
typedef struct im_radii {
    im_fixed top_left, top_right, bottom_right, bottom_left;
} im_radii;

im_surface

Where drawing goes, with the colours and scale to use.

ui/draw.h, line 19
typedef struct im_surface {
    uint32_t *pixels; /* 0x00RRGGBB, top row first */
    int width, height, stride;
    im_palette palette;
    im_fixed scale; /* 1.0 at 96 DPI */
} im_surface;

im_fill

Edges are smoothed. A radius larger than half the shape is reduced to fit.

ui/draw.h, line 27
void im_fill(im_surface *surface, im_rect shape, im_radii radii, enum im_brush_id brush);

im_stroke

The ring between a shape and the same shape inset by the thickness. The radii are those of the line's middle, as WinUI's CornerRadius is: half a thickness more outside, half less inside. A gradient runs over the outer shape.

ui/draw.h, line 32
void im_stroke(im_surface *surface, im_rect shape, im_radii radii, im_fixed thickness, enum im_brush_id brush);

im_inset

The shape with every edge moved in by a distance.

ui/draw.h, line 35
im_rect im_inset(im_rect shape, im_fixed by);

im_grow

A corner radius moved out (or in, when negative) by a distance; square corners stay square.

ui/draw.h, line 38
im_radii im_grow(im_radii radii, im_fixed by);
GeneratedMade from ui/draw.hPublished from b1dc570