Mesh Img (gfx_mesh_img)
Types
gfx_mesh_img_point_t
Mesh control point in integer pixel coordinates.
typedef struct {
gfx_coord_t x;
gfx_coord_t y;
} gfx_mesh_img_point_t;
gfx_mesh_img_point_q8_t
Mesh control point in Q8 fixed-point coordinates.
typedef struct {
int32_t x_q8;
int32_t y_q8;
} gfx_mesh_img_point_q8_t;
Functions
gfx_mesh_img_create()
gfx_obj_t * gfx_mesh_img_create(gfx_disp_t *disp);
gfx_mesh_img_set_src_desc()
Set a typed image source descriptor for the mesh.
esp_err_t gfx_mesh_img_set_src_desc(gfx_obj_t *obj, const gfx_img_src_t *src);
Parameters:
obj- Mesh-image objectsrc- Typed image source descriptor
Returns:
ESP_OK on success, ESP_ERR_* otherwise
gfx_mesh_img_set_src()
Set the image source for the mesh.
esp_err_t gfx_mesh_img_set_src(gfx_obj_t *obj, void *src);
Parameters:
obj- Mesh-image objectsrc- In-memory image source payload
Returns:
ESP_OK on success, ESP_ERR_* otherwise
gfx_mesh_img_set_grid()
Configure mesh grid density.
esp_err_t gfx_mesh_img_set_grid(gfx_obj_t *obj, uint8_t cols, uint8_t rows);
Parameters:
obj- Mesh-image objectcols- Horizontal cell countrows- Vertical cell count
Returns:
ESP_OK on success, ESP_ERR_* otherwise
gfx_mesh_img_get_point_count()
Get the current mesh point count.
size_t gfx_mesh_img_get_point_count(gfx_obj_t *obj);
Parameters:
obj- Mesh-image object
Returns:
Number of points in the current mesh
gfx_mesh_img_get_point()
Get one mesh point in object-local pixel coordinates.
esp_err_t gfx_mesh_img_get_point(gfx_obj_t *obj, size_t point_idx, gfx_mesh_img_point_t *point);
Parameters:
obj- Mesh-image objectpoint_idx- Point index in the current gridpoint- Output point
Returns:
ESP_OK on success, ESP_ERR_* otherwise
gfx_mesh_img_get_point_screen()
Get one mesh point in screen coordinates.
esp_err_t gfx_mesh_img_get_point_screen(gfx_obj_t *obj, size_t point_idx, gfx_coord_t *x, gfx_coord_t *y);
Parameters:
obj- Mesh-image objectpoint_idx- Point index in the current gridx- Output screen xy- Output screen y
Returns:
ESP_OK on success, ESP_ERR_* otherwise
gfx_mesh_img_get_point_q8()
Get one mesh point in object-local Q8 coordinates.
esp_err_t gfx_mesh_img_get_point_q8(gfx_obj_t *obj, size_t point_idx, gfx_mesh_img_point_q8_t *point);
Parameters:
obj- Mesh-image objectpoint_idx- Point index in the current gridpoint- Output Q8 point
Returns:
ESP_OK on success, ESP_ERR_* otherwise
gfx_mesh_img_get_point_screen_q8()
Get one mesh point in screen-space Q8 coordinates.
esp_err_t gfx_mesh_img_get_point_screen_q8(gfx_obj_t *obj, size_t point_idx, int32_t *x_q8, int32_t *y_q8);
Parameters:
obj- Mesh-image objectpoint_idx- Point index in the current gridx_q8- Output screen x in Q8y_q8- Output screen y in Q8
Returns:
ESP_OK on success, ESP_ERR_* otherwise
gfx_mesh_img_set_point()
Set one mesh point in object-local pixel coordinates.
esp_err_t gfx_mesh_img_set_point(gfx_obj_t *obj, size_t point_idx, gfx_coord_t x, gfx_coord_t y);
Parameters:
obj- Mesh-image objectpoint_idx- Point index in the current gridx- Local xy- Local y
Returns:
ESP_OK on success, ESP_ERR_* otherwise
gfx_mesh_img_set_points()
Set all mesh points in object-local pixel coordinates.
esp_err_t gfx_mesh_img_set_points(gfx_obj_t *obj, const gfx_mesh_img_point_t *points, size_t point_count);
Parameters:
obj- Mesh-image objectpoints- Point arraypoint_count- Number of entries in points
Returns:
ESP_OK on success, ESP_ERR_* otherwise
gfx_mesh_img_set_point_q8()
Set one mesh point in object-local Q8 coordinates.
esp_err_t gfx_mesh_img_set_point_q8(gfx_obj_t *obj, size_t point_idx, int32_t x_q8, int32_t y_q8);
Parameters:
obj- Mesh-image objectpoint_idx- Point index in the current gridx_q8- Local x in Q8y_q8- Local y in Q8
Returns:
ESP_OK on success, ESP_ERR_* otherwise
gfx_mesh_img_set_points_q8()
Set all mesh points in object-local Q8 coordinates.
esp_err_t gfx_mesh_img_set_points_q8(gfx_obj_t *obj, const gfx_mesh_img_point_q8_t *points, size_t point_count);
Parameters:
obj- Mesh-image objectpoints- Q8 point arraypoint_count- Number of entries in points
Returns:
ESP_OK on success, ESP_ERR_* otherwise
gfx_mesh_img_set_rest_points()
Set the rest pose points in object-local pixel coordinates.
esp_err_t gfx_mesh_img_set_rest_points(gfx_obj_t *obj, const gfx_mesh_img_point_t *points, size_t point_count);
Parameters:
obj- Mesh-image objectpoints- Point arraypoint_count- Number of entries in points
Returns:
ESP_OK on success, ESP_ERR_* otherwise
gfx_mesh_img_set_rest_points_q8()
Set the rest pose points in object-local Q8 coordinates.
esp_err_t gfx_mesh_img_set_rest_points_q8(gfx_obj_t *obj, const gfx_mesh_img_point_q8_t *points, size_t point_count);
Parameters:
obj- Mesh-image objectpoints- Q8 point arraypoint_count- Number of entries in points
Returns:
ESP_OK on success, ESP_ERR_* otherwise
gfx_mesh_img_reset_points()
Reset current points back to the stored rest pose.
esp_err_t gfx_mesh_img_reset_points(gfx_obj_t *obj);
Parameters:
obj- Mesh-image object
Returns:
ESP_OK on success, ESP_ERR_* otherwise
gfx_mesh_img_set_ctrl_points_visible()
Show or hide mesh control points for debugging.
esp_err_t gfx_mesh_img_set_ctrl_points_visible(gfx_obj_t *obj, bool visible);
Parameters:
obj- Mesh-image objectvisible- Whether control points should be drawn
Returns:
ESP_OK on success, ESP_ERR_* otherwise
gfx_mesh_img_set_opa()
Set uniform mesh opacity.
esp_err_t gfx_mesh_img_set_opa(gfx_obj_t *obj, gfx_opa_t opa);
Parameters:
obj- Mesh image objectopa- Uniform opacity (0-255)
Returns:
ESP_OK on success, ESP_ERR_* otherwise
gfx_mesh_img_set_aa_inward()
Enable inward-only edge anti-aliasing.
esp_err_t gfx_mesh_img_set_aa_inward(gfx_obj_t *obj, bool inward);
Parameters:
obj- Mesh image object.inward- true = inward AA (no outward bleed); false = default outward AA.
Returns:
ESP_OK on success, ESP_ERR_* otherwise
gfx_mesh_img_set_wrap_cols()
Treat first and last grid columns as adjacent (closed strip).
esp_err_t gfx_mesh_img_set_wrap_cols(gfx_obj_t *obj, bool wrap);
Returns:
ESP_OK on success, ESP_ERR_* otherwise
gfx_mesh_img_set_scanline_fill()
Use scanline polygon fill instead of triangle rasterization.
esp_err_t gfx_mesh_img_set_scanline_fill(gfx_obj_t *obj, bool enable, gfx_color_t fill_color);
Parameters:
obj- Mesh image objectenable- Whether scanline fill mode should be enabledfill_color- Solid fill color (typically white for strokes).
Returns:
ESP_OK on success, ESP_ERR_* otherwise