|
rcbench
Servo and ESC test bench: panel, IOmcu and shared C
|
Damage: the part of one frame buffer the rasteriser wrote, as 16-row bands. See include/gfx_damage.h. More...
Functions | |
| void | gfx_damage_init (gfx_damage_t *d, const gfx_canvas_t *root) |
Bind d to the buffer under root, empty. | |
| void | gfx_damage_reset (gfx_damage_t *d) |
Forget what d holds: nothing written. | |
| void | gfx_damage_all (gfx_damage_t *d) |
| Count the whole buffer as written. | |
| static bool | place (gfx_damage_t *d, const gfx_canvas_t *c, int *x, int *y) |
Where c's top-left pixel lies in d's buffer. | |
| void | gfx_damage_mark (gfx_damage_t *d, const gfx_canvas_t *c, int x, int y, int w, int h) |
Count a rectangle written through c as written. | |
| bool | gfx_damage_empty (const gfx_damage_t *d) |
Whether d holds no write. | |
| static long | area (gfx_rect_t r) |
| A rectangle's area, pixels. | |
| static gfx_rect_t | bound (gfx_rect_t a, gfx_rect_t b) |
The smallest rectangle round a and b. | |
| int | gfx_damage_rects (const gfx_damage_t *d, gfx_rect_t *out, int max) |
The written area as at most max rectangles, top to bottom. | |
| gfx_rect_t | gfx_damage_turn (gfx_rect_t r, int width, int height) |
Where r lies in a width x height buffer turned by 180°. | |
| void | gfx_damage_attach (gfx_damage_t *d) |
Report the primitives' writes to d, or to nothing. | |
Variables | |
| gfx_damage_t * | gfx_damage_sink |
| The record the primitives report to, or NULL; gfx_damage.c. | |
Damage: the part of one frame buffer the rasteriser wrote, as 16-row bands. See include/gfx_damage.h.
SPDX-License-Identifier: MIT
| void gfx_damage_all | ( | gfx_damage_t * | d | ) |
Count the whole buffer as written.
| d | the record |
| void gfx_damage_attach | ( | gfx_damage_t * | d | ) |
Report the primitives' writes to d, or to nothing.
| d | the record, or NULL to stop counting |
| bool gfx_damage_empty | ( | const gfx_damage_t * | d | ) |
Whether d holds no write.
| d | the record |
| void gfx_damage_init | ( | gfx_damage_t * | d, |
| const gfx_canvas_t * | root ) |
Bind d to the buffer under root, empty.
| d | the record |
| root | a canvas whose pixels are the buffer's first pixel and whose width, height and stride are the buffer's |
| void gfx_damage_mark | ( | gfx_damage_t * | d, |
| const gfx_canvas_t * | c, | ||
| int | x, | ||
| int | y, | ||
| int | w, | ||
| int | h ) |
Count a rectangle written through c as written.
Nothing when c's pixels lie outside d's buffer. A canvas inside it with another stride counts the whole buffer.
| d | the record |
| c | the canvas written through |
| x | the rectangle's left edge, in c's coordinates |
| y | its top edge |
| w | its width, already clipped to c |
| h | its height, already clipped |
| int gfx_damage_rects | ( | const gfx_damage_t * | d, |
| gfx_rect_t * | out, | ||
| int | max ) |
The written area as at most max rectangles, top to bottom.
Each band's span is one rectangle; neighbouring bands then merge, the pair that adds the fewest unwritten pixels first, while a merge adds none or more than max are left. Every written pixel lies in one of the rectangles; a rectangle may hold unwritten pixels.
| d | the record |
| out | the rectangles, in buffer coordinates |
| max | room in out, 1 or more |
out, 0 when nothing was written | void gfx_damage_reset | ( | gfx_damage_t * | d | ) |
Forget what d holds: nothing written.
| d | the record |
| gfx_rect_t gfx_damage_turn | ( | gfx_rect_t | r, |
| int | width, | ||
| int | height ) |
Where r lies in a width x height buffer turned by 180°.
| r | a rectangle inside the buffer |
| width | the buffer's width, pixels |
| height | its height, rows |
|
static |
Where c's top-left pixel lies in d's buffer.
| d | the record |
| c | the canvas |
| x | its left edge in the buffer, set when it lies inside |
| y | its top edge, set when it lies inside |
c's pixels lie inside the buffer with its stride