Blender V4.3
BLI_bitmap_draw_2d.h File Reference
#include "BLI_math_vector_types.hh"
#include "BLI_span.hh"

Go to the source code of this file.

Functions

void BLI_bitmap_draw_2d_line_v2v2i (const int p1[2], const int p2[2], bool(*callback)(int, int, void *), void *user_data)
 
void BLI_bitmap_draw_2d_tri_v2i (const int p1[2], const int p2[2], const int p3[2], void(*callback)(int x, int x_end, int y, void *), void *user_data)
 
void BLI_bitmap_draw_2d_poly_v2i_n (int xmin, int ymin, int xmax, int ymax, blender::Span< blender::int2 > verts, void(*callback)(int x, int x_end, int y, void *), void *user_data)
 

Function Documentation

◆ BLI_bitmap_draw_2d_line_v2v2i()

void BLI_bitmap_draw_2d_line_v2v2i ( const int p1[2],
const int p2[2],
bool(* callback )(int, int, void *),
void * user_data )

Plot a line from p1 to p2 (inclusive).

Note
For clipped line drawing, see: http://stackoverflow.com/a/40902741/432509

Definition at line 30 of file bitmap_draw_2d.cc.

References callback, and error().

Referenced by ED_view3d_depth_read_cached_seg(), and blender::ui::eyedropper_colorband_sample_segment().

◆ BLI_bitmap_draw_2d_poly_v2i_n()

void BLI_bitmap_draw_2d_poly_v2i_n ( int xmin,
int ymin,
int xmax,
int ymax,
blender::Span< blender::int2 > verts,
void(* callback )(int x, int x_end, int y, void *),
void * user_data )

Draws a filled polygon with support for self intersections.

Parameters
callbackTakes the x, y coords and x-span (x_end is not inclusive), note that x_end will always be greater than x, so we can use:
do {
func(x, y);
} while (++x != x_end);

Referenced by draw_filled_lasso(), DRW_select_buffer_bitmap_from_poly(), blender::ed::sculpt_paint::gesture::init_from_lasso(), and track_mask_gpencil_layer_rasterize().

◆ BLI_bitmap_draw_2d_tri_v2i()

void BLI_bitmap_draw_2d_tri_v2i ( const int p1[2],
const int p2[2],
const int p3[2],
void(* callback )(int x, int x_end, int y, void *),
void * user_data )
Note
Unclipped (clipped version can be added if needed).

Definition at line 207 of file bitmap_draw_2d.cc.

References BLI_assert, callback, draw_tri_flat_max(), draw_tri_flat_min(), inv_slope(), ORDER_VARS2, and ORDER_VARS3_BY.

Referenced by BKE_icon_geom_rasterize().