|
Blender V5.0
|
#include <algorithm>#include <climits>#include "MEM_guardedalloc.h"#include "BLI_bitmap_draw_2d.h"#include "BLI_math_base.h"#include "BLI_sort.h"#include "BLI_utildefines.h"#include "BLI_strict_flags.h"Go to the source code of this file.
Typedefs | |
| using | int2 |
Functions | |
Draw Line | |
| void | BLI_bitmap_draw_2d_line_v2v2i (const int p1[2], const int p2[2], bool(*callback)(int, int, void *), void *user_data) |
Draw Filled Polygon | |
| static int | draw_poly_v2i_n__span_y_sort (const void *a_p, const void *b_p, void *verts_p) |
| void | BLI_bitmap_draw_2d_poly_v2i_n (const int xmin, const int ymin, const int xmax, const int ymax, const Span< int2 > verts, void(*callback)(int x, int x_end, int y, void *), void *user_data) |
Draw Filled Triangle | |
| #define | ORDERED_SWAP(ty, a, b) |
| #define | ORDERED_SWAP_BY(ty, a, b, by) |
| #define | ORDER_VARS2(ty, a, b) |
| #define | ORDER_VARS3_BY(ty, a, b, c, by) |
| static float | inv_slope (const int a[2], const int b[2]) |
| static void | draw_tri_flat_max (const int p[2], const int max_y, const float inv_slope1, const float inv_slope2, void(*callback)(int x, int x_end, int y, void *), void *user_data) |
| static void | draw_tri_flat_min (const int p[2], const int min_y, const float inv_slope1, const float inv_slope2, void(*callback)(int x, int x_end, int y, 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) |
Utility functions for primitive drawing operations.
Definition in file bitmap_draw_2d.cc.
| #define ORDER_VARS2 | ( | ty, | |
| a, | |||
| b ) |
Definition at line 137 of file bitmap_draw_2d.cc.
Referenced by BLI_bitmap_draw_2d_tri_v2i().
| #define ORDER_VARS3_BY | ( | ty, | |
| a, | |||
| b, | |||
| c, | |||
| by ) |
Definition at line 143 of file bitmap_draw_2d.cc.
Referenced by BLI_bitmap_draw_2d_tri_v2i().
| #define ORDERED_SWAP | ( | ty, | |
| a, | |||
| b ) |
Fill a triangle
Standard algorithm, See: http://www.sunshine2k.de/coding/java/TriangleRasterization/TriangleRasterization.html
Changes to the basic implementation:
This is not clipped, a clipped version can be added if needed.
Definition at line 125 of file bitmap_draw_2d.cc.
| #define ORDERED_SWAP_BY | ( | ty, | |
| a, | |||
| b, | |||
| by ) |
Definition at line 131 of file bitmap_draw_2d.cc.
| using blender::int2 |
Definition at line 601 of file BLI_math_vector_types.hh.
| 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).
Definition at line 31 of file bitmap_draw_2d.cc.
References error().
Referenced by ED_view3d_depth_read_cached_seg(), and blender::ui::eyedropper_colorband_sample_segment().
| void BLI_bitmap_draw_2d_poly_v2i_n | ( | const int | xmin, |
| const int | ymin, | ||
| const int | xmax, | ||
| const int | ymax, | ||
| const Span< int2 > | verts, | ||
| void(* | callback )(int x, int x_end, int y, void *), | ||
| void * | user_data ) |
Definition at line 320 of file bitmap_draw_2d.cc.
References BLI_assert, BLI_qsort_r(), draw_poly_v2i_n__span_y_sort(), i, max_ii(), MEM_freeN(), MEM_malloc_arrayN(), min_ii(), SWAP, verts, x, and y.
| 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 ) |
Definition at line 208 of file bitmap_draw_2d.cc.
References BLI_assert, draw_tri_flat_max(), draw_tri_flat_min(), inv_slope(), ORDER_VARS2, ORDER_VARS3_BY, x, and y.
Referenced by BKE_icon_geom_rasterize().
|
static |
Definition at line 286 of file bitmap_draw_2d.cc.
Referenced by BLI_bitmap_draw_2d_poly_v2i_n().
|
static |
*---* \ / *
Definition at line 163 of file bitmap_draw_2d.cc.
Referenced by BLI_bitmap_draw_2d_tri_v2i().
|
static |
* / \ *---*
Definition at line 189 of file bitmap_draw_2d.cc.
Referenced by BLI_bitmap_draw_2d_tri_v2i().
|
static |
Definition at line 151 of file bitmap_draw_2d.cc.
Referenced by BLI_bitmap_draw_2d_tri_v2i().