97#define BJ_LINE_STEPPED BJ_LINE_MODE_STEPPED
99#define BJ_LINE_WATERTIGHT BJ_LINE_MODE_WATERTIGHT
General-purpose definitions for Banjo API.
Header file for Bitmap type.
Recoverable error handling.
uint32_t bj_bool
Boolean type used throughout the Banjo API.
struct bj_bitmap bj_bitmap
void bj_draw_rectangle(struct bj_bitmap *bitmap, const struct bj_rect *area, uint32_t pixel)
Draws a rectangle in the given bitmap.
void bj_grid_ray_cells(bj_real x0, bj_real y0, bj_real x1, bj_real y1, bj_cell_fn callback, void *user_data)
void bj_enumerate_line_pixels(int x0, int y0, int x1, int y1, bj_pixel_fn callback, void *user_data)
Reports every pixel a line touches, without drawing anything.
void bj_draw_polyline_mode(struct bj_bitmap *bitmap, size_t count, const int *x, const int *y, bj_polyline_end end, bj_line_mode mode, uint32_t color)
Draw a polyline, choosing which pixels its segments claim.
void bj_draw_polyline(struct bj_bitmap *bitmap, size_t count, const int *x, const int *y, bj_polyline_end end, uint32_t color)
Draw a polyline from C-style coordinate arrays.
void bj_draw_triangle(struct bj_bitmap *bitmap, int x0, int y0, int x1, int y1, int x2, int y2, uint32_t color)
Draws the edges of a triangle given its 3 corners.
void bj_draw_line_mode(struct bj_bitmap *bitmap, int x0, int y0, int x1, int y1, bj_line_mode mode, uint32_t pixel)
Draws a line of pixels, choosing which ones it claims.
bj_polyline_end
Whether a polyline's last vertex connects back to its first.
bj_bool(* bj_cell_fn)(void *user_data, int x, int y, bj_real t)
Callback invoked once per grid cell entered by a ray.
void bj_line_pixels(int x0, int y0, int x1, int y1, bj_pixel_fn callback, void *user_data)
void bj_draw_filled_rectangle(struct bj_bitmap *bitmap, const struct bj_rect *area, uint32_t pixel)
Draws a filled rectangle in the given bitmap.
void bj_draw_filled_circle(struct bj_bitmap *bitmap, int cx, int cy, int radius, uint32_t color)
Draw a filled circle onto a bitmap.
void bj_draw_line(struct bj_bitmap *bitmap, int x0, int y0, int x1, int y1, uint32_t pixel)
Draws a line of pixels in the given bitmap.
void bj_draw_filled_triangle(struct bj_bitmap *bitmap, int x0, int y0, int x1, int y1, int x2, int y2, uint32_t color)
Draws a filled triangle given its 3 corners.
void bj_enumerate_grid_ray_cells(bj_real x0, bj_real y0, bj_real x1, bj_real y1, bj_cell_fn callback, void *user_data)
Reports every grid cell a ray passes through.
bj_line_mode
How a line decides which pixels it touches.
void bj_circle_pixels(int cx, int cy, int radius, bj_pixel_fn callback, void *user_data)
void bj_enumerate_circle_pixels(int cx, int cy, int radius, bj_pixel_fn callback, void *user_data)
Reports every pixel a circle outline touches, without drawing anything.
void bj_draw_circle(struct bj_bitmap *bitmap, int cx, int cy, int radius, uint32_t color)
Draw the outline of a circle onto a bitmap.
bj_bool(* bj_pixel_fn)(void *user_data, int x, int y)
Callback invoked once per visited pixel.
@ BJ_POLYLINE_END_CLOSED
An extra segment closes the polyline into a loop.
@ BJ_POLYLINE_END_OPEN
The polyline is left open.
@ BJ_LINE_MODE_WATERTIGHT
No diagonal steps: consecutive pixels differ along one axis only, so the line has no gap at any corne...
@ BJ_LINE_MODE_STEPPED
Diagonal steps allowed, one pixel per step along the major axis.
float bj_real
Selected real type for float configuration.
Axis-aligned rectangle: a top-left corner plus a width and height.
C99 math shim with bj_real precision type and scalar utilities.
Header file for general pixel manipulation facilities.
Axis-aligned rectangle in pixel coordinates.