62int UI_draw_roundbox_corner_get()
69 const float inner1[4],
70 const float inner2[4],
72 const float outline[4],
80 widget_params.recti.ymin = rect->
ymin + outline_width;
81 widget_params.recti.xmax = rect->
xmax - outline_width;
82 widget_params.recti.ymax = rect->
ymax - outline_width;
83 widget_params.rect = *rect;
84 widget_params.radi = rad;
85 widget_params.rad = rad;
90 widget_params.color_inner1[0] = inner1 ? inner1[0] : 0.0f;
91 widget_params.color_inner1[1] = inner1 ? inner1[1] : 0.0f;
92 widget_params.color_inner1[2] = inner1 ? inner1[2] : 0.0f;
93 widget_params.color_inner1[3] = inner1 ? inner1[3] : 0.0f;
94 widget_params.color_inner2[0] = inner2 ? inner2[0] : inner1 ? inner1[0] : 0.0f;
95 widget_params.color_inner2[1] = inner2 ? inner2[1] : inner1 ? inner1[1] : 0.0f;
96 widget_params.color_inner2[2] = inner2 ? inner2[2] : inner1 ? inner1[2] : 0.0f;
97 widget_params.color_inner2[3] = inner2 ? inner2[3] : inner1 ? inner1[3] : 0.0f;
98 widget_params.color_outline[0] = outline ? outline[0] : inner1 ? inner1[0] : 0.0f;
99 widget_params.color_outline[1] = outline ? outline[1] : inner1 ? inner1[1] : 0.0f;
100 widget_params.color_outline[2] = outline ? outline[2] : inner1 ? inner1[2] : 0.0f;
101 widget_params.color_outline[3] = outline ? outline[3] : inner1 ? inner1[3] : 0.0f;
102 widget_params.shade_dir = shade_dir;
103 widget_params.alpha_discard = 1.0f;
116 const float colv[4] = {
120 float(alpha) / 255.0f,
126 const rctf *rect,
bool filled,
float rad,
const float col[3],
float alpha)
128 const float colv[4] = {
col[0],
col[1],
col[2], alpha};
136 float colv[4] = {color[0], color[1], color[2], color[3]};
163 for (
int a = 0; a < 4; a++) {
174 for (
int a = 0; a < 4; a++) {
185 for (
int a = 0; a < 4; a++) {
196 for (
int a = 0; a < 4; a++) {
207 for (
int a = 0; a < 4; a++) {
219 const int ofs_y = 4 *
U.pixelsize;
227 immRecti(
pos, pos_x, pos_y - ofs_y, pos_x +
len, pos_y - ofs_y + (height *
U.pixelsize));
236 uchar highlight_fade[3])
243 const int minx = rect->
xmin +
U.pixelsize, maxx = rect->
xmax -
U.pixelsize;
244 const int miny = rect->
ymin +
U.pixelsize, maxy = rect->
ymax -
U.pixelsize;
254 for (a = 0; a < 4; a++) {
266 for (a = 0; a < 4; a++) {
278 for (a = 0; a < 4; a++) {
292 for (a = 0; a < 4; a++) {
304 for (a = 0; a < 4; a++) {
351 if (
w != ibuf->
x || h != ibuf->
y) {
356 float col[4] = {1.0f, 1.0f, 1.0f, 1.0f};
357 if (but->
col[3] != 0) {
379 GPU_scissor(scissor[0], scissor[1], scissor[2], scissor[3]);
387 const float title_aspect[2],
388 const float action_aspect[2])
390 const float size_x_half = (rect->
xmax - rect->
xmin) * 0.5f;
391 const float size_y_half = (rect->
ymax - rect->
ymin) * 0.5f;
393 const float *safe_areas[] = {title_aspect, action_aspect};
396 for (
int i = 0; i < safe_len; i++) {
397 if (safe_areas[i][0] || safe_areas[i][1]) {
398 const float margin_x = safe_areas[i][0] * size_x_half;
399 const float margin_y = safe_areas[i][1] * size_y_half;
401 const float minx = rect->
xmin + margin_x;
402 const float miny = rect->
ymin + margin_y;
403 const float maxx = rect->
xmax - margin_x;
404 const float maxy = rect->
ymax - margin_y;
417 const float color[4] = {0.0f, 0.0f, 0.0f, 0.5f};
420 box_rect.xmax = rect->
xmax + 1;
421 box_rect.ymin = rect->
ymin;
422 box_rect.ymax = rect->
ymax + 1;
439 const float color[4] = {r, g,
b, alpha};
456 for (
int i = 0; i < res; i++) {
457 const float x2 = x + i * (
w /
float(res));
469 for (
int i = 1; i < res; i++) {
470 const float x2 = x + i * (
w /
float(res));
481 for (
int i = 0; i < res; i++) {
482 const float x2 = x + i * (
w /
float(res));
491#define HISTOGRAM_TOT_GRID_LINES 4
517 back_rect.
xmin = rect.xmin - 1;
518 back_rect.xmax = rect.xmax + 1;
519 back_rect.ymin = rect.ymin - 1;
520 back_rect.ymax = rect.ymax + 1;
529 (rect.xmax + 1) - (rect.xmin - 1),
530 (rect.ymax + 1) - (rect.ymin - 1));
560 1.0, 1.0, 1.0, 0.75, rect.xmin, rect.ymin,
w, h, hist->
data_luma, res, is_line,
pos);
564 1.0, 1.0, 1.0, 0.75, rect.xmin, rect.ymin,
w, h, hist->
data_a, res, is_line,
pos);
569 1.0, 0.0, 0.0, 0.75, rect.xmin, rect.ymin,
w, h, hist->
data_r, res, is_line,
pos);
573 0.0, 1.0, 0.0, 0.75, rect.xmin, rect.ymin,
w, h, hist->
data_g, res, is_line,
pos);
577 0.0, 0.0, 1.0, 0.75, rect.xmin, rect.ymin,
w, h, hist->
data_b, res, is_line,
pos);
590#undef HISTOGRAM_TOT_GRID_LINES
631 for (
int i = 0; i < waveform_num; i++) {
632 memcpy(&data->pos, waveform,
sizeof(data->pos));
633 memcpy(&data->color,
col,
sizeof(
float) * 3);
634 data->color.w = alpha;
677 const float colorsycc[3][3] = {{1, 0, 1}, {1, 1, 0}, {0, 1, 1}};
679 float colors_alpha[3][3], colorsycc_alpha[3][3];
682 if (scopes ==
nullptr) {
698 const float w3 =
w / 3.0f;
705 for (
int c = 0; c < 3; c++) {
706 for (
int i = 0; i < 3; i++) {
707 colors_alpha[c][i] = colors[c][i] * alpha;
708 colorsycc_alpha[c][i] = colorsycc[c][i] * alpha;
721 back_rect.
xmin = rect.xmin - 1.0f;
722 back_rect.xmax = rect.xmax + 1.0f;
723 back_rect.ymin = rect.ymin - 1.0f;
724 back_rect.ymax = rect.ymax + 1.0f;
731 (rect.xmax + 1) - (rect.xmin - 1),
732 (rect.ymax + 1) - (rect.ymin - 1));
735 for (
int i = 0; i < 6; i++) {
756 for (
int i = 0; i < 6; i++) {
767 for (
int i = 1; i < 3; i++) {
814 const float col[3] = {alpha, alpha, alpha};
827 max = yofs + scopes->
minmax[0][1] * h;
829 CLAMP(max, rect.ymin, rect.ymax);
877 for (
int c = 0; c < 3; c++) {
879 immUniformColor3f(colors[c][0] * 0.75f, colors[c][1] * 0.75f, colors[c][2] * 0.75f);
883 colorsycc[c][0] * 0.75f, colorsycc[c][1] * 0.75f, colorsycc[c][2] * 0.75f);
886 max = yofs + scopes->
minmax[c][1] * h;
888 CLAMP(max, rect.ymin, rect.ymax);
909static float polar_to_x(
float center,
float diam,
float ampli,
float angle)
911 return center + diam * ampli *
cosf(angle);
914static float polar_to_y(
float center,
float diam,
float ampli,
float angle)
916 return center + diam * ampli *
sinf(angle);
920 uint pos,
float centerx,
float centery,
float diam,
const float colf[3],
char label)
923 float tangle = 0.0f, tampli;
924 float dangle, dampli;
925 const char labelstr[2] = {
label,
'\0'};
929 if (u > 0 &&
v >= 0) {
932 else if (u > 0 &&
v < 0) {
938 else if (u == 0 &&
v > 0.0f) {
941 else if (u == 0 &&
v < 0.0f) {
949 dampli = 2.5f / 200.0f;
952 polar_to_x(centerx, diam, tampli + dampli, tangle + dangle),
953 polar_to_y(centery, diam, tampli + dampli, tangle + dangle));
955 polar_to_x(centerx, diam, tampli - dampli, tangle + dangle),
956 polar_to_y(centery, diam, tampli - dampli, tangle + dangle));
958 polar_to_x(centerx, diam, tampli - dampli, tangle - dangle),
959 polar_to_y(centery, diam, tampli - dampli, tangle - dangle));
961 polar_to_x(centerx, diam, tampli + dampli, tangle - dangle),
962 polar_to_y(centery, diam, tampli + dampli, tangle - dangle));
980 const float skin_rad =
DEG2RADF(123.0f);
983 const float colors[6][3] = {
992 const char color_names[] = {
'R',
'Y',
'G',
'C',
'B',
'M'};
1002 const float centerx = rect.xmin +
w * 0.5f;
1003 const float centery = rect.ymin + h * 0.5f;
1004 const float diam = (
w < h) ?
w : h;
1015 back_rect.
xmin = rect.xmin - 1;
1016 back_rect.xmax = rect.xmax + 1;
1017 back_rect.ymin = rect.ymin - 1;
1018 back_rect.ymax = rect.ymax + 1;
1026 (rect.xmax + 1) - (rect.xmin - 1),
1027 (rect.ymax + 1) - (rect.ymin - 1));
1033 const int increment = 6;
1034 const int tot_points =
int(360 / increment);
1035 const float r = 0.5f;
1036 float step = 360.0f / (tot_points - 1);
1038 float circle_fill_points[(tot_points * 2) + 2];
1039 float circle_fill_vertex_colors[(tot_points * 4) + 4];
1044 circle_fill_points[0] = centerx;
1045 circle_fill_points[1] = centery;
1046 circle_fill_vertex_colors[0] = 0.2f;
1047 circle_fill_vertex_colors[1] = 0.2f;
1048 circle_fill_vertex_colors[2] = 0.2f;
1049 circle_fill_vertex_colors[3] = 0.8f;
1051 for (
int i = 0; i < tot_points; i++) {
1052 float angle = step * i;
1055 const float x =
polar_to_x(centerx, diam, r, a);
1056 const float y =
polar_to_y(centery, diam, r, a);
1058 const float u =
polar_to_x(0.0f, 1.0, 1.0f, a);
1061 circle_fill_points[(i + 1) * 2] = x;
1062 circle_fill_points[(i + 1) * 2 + 1] = y;
1067 circle_fill_vertex_colors[(i + 1) * 4] = r * 0.2f;
1068 circle_fill_vertex_colors[(i + 1) * 4 + 1] = g * 0.2f;
1069 circle_fill_vertex_colors[(i + 1) * 4 + 2] =
b * 0.2f;
1070 circle_fill_vertex_colors[(i + 1) * 4 + 3] = 0.8f;
1075 circle_fill_points, tot_points + 1, circle_fill_vertex_colors,
GPU_PRIM_TRI_FAN);
1084 for (
int i = 0; i <= 360; i += increment) {
1085 const float a =
DEG2RADF(
float(i));
1092 float circle_points[(tot_points * 2) + 3] = {};
1093 float circle_vertex_colors[(tot_points * 4) + 5] = {};
1095 for (
int i = 0; i < tot_points; i++) {
1096 float angle = step * i;
1099 const float x =
polar_to_x(centerx, diam, 0.5f, a);
1100 const float y =
polar_to_y(centery, diam, 0.5f, a);
1101 circle_points[i * 2] =
x;
1102 circle_points[i * 2 + 1] =
y;
1104 const float u =
polar_to_x(0.0f, 1.0, 1.0f, a);
1109 circle_vertex_colors[i * 4] = r;
1110 circle_vertex_colors[i * 4 + 1] = g;
1111 circle_vertex_colors[i * 4 + 2] =
b;
1112 circle_vertex_colors[i * 4 + 3] = 0.8f;
1122 for (
int j = 0; j < 4; j++) {
1123 float inner_circle_points[(tot_points * 2) + 3] = {};
1124 float inner_circle_colors[(tot_points * 4) + 5] = {};
1125 const float r = (j + 1) * 0.1f;
1127 for (
int i = 0; i < tot_points; i++) {
1128 float angle = step * i;
1131 inner_circle_points[i * 2] =
polar_to_x(centerx, diam, r, a);
1132 inner_circle_points[i * 2 + 1] =
polar_to_y(centery, diam, r, a);
1134 inner_circle_colors[i * 4] = 0.1f;
1135 inner_circle_colors[i * 4 + 1] = 0.1f;
1136 inner_circle_colors[i * 4 + 2] = 0.1f;
1137 inner_circle_colors[i * 4 + 3] = 0.8f;
1167 for (
int i = 0; i < 6; i++) {
1171 if (scopes->
ok && scopes->
vecscope !=
nullptr) {
1179 const float col[3] = {alpha, alpha, alpha};
1230 float colf[3] = {
UNPACK3(rgb)};
1232 const float half_width = sizey / 3.5f;
1233 const float height = half_width * 1.4f;
1235 float y1 = rect->
ymin;
1236 const float y2 = rect->
ymax;
1244 float line_width = std::max(std::min(
U.pixelsize / 5.0f *
fabs(half_width - 4.0f),
U.pixelsize),
1248 uchar alpha = std::min(
int(
fabs(half_width - 2.0f) * 50.0f), 255);
1252 float viewport_size[4];
1257 immUniform4f(
"color", 1.0f, 1.0f, 1.0f, alpha / 255.0f);
1258 immUniform4f(
"color2", 0.0f, 0.0f, 0.0f, alpha / 255.0f);
1261 immUniform4f(
"color", 0.7f, 0.7f, 0.7f, alpha / 255.0f);
1262 immUniform4f(
"color2", 0.4f, 0.4f, 0.4f, alpha / 255.0f);
1277 y1 -= half_width / 2.0f;
1283 x - half_width - line_width,
1285 x + half_width + line_width,
1299 x - (half_width - line_width),
1301 x + (half_width - line_width),
1302 y1 + height - line_width);
1328 uint pos_id, col_id;
1334 if (coba ==
nullptr) {
1338 const float x1 = rect->
xmin +
U.pixelsize;
1339 const float sizex = rect->
xmax - x1 -
U.pixelsize;
1340 const float y1 = rect->
ymin +
U.pixelsize;
1341 const float sizey = rect->
ymax - y1 -
U.pixelsize;
1342 const float sizey_solid = sizey * 0.25f;
1368 immUniform4f(
"color1", checker_dark, checker_dark, checker_dark, 1.0f);
1369 immUniform4f(
"color2", checker_light, checker_light, checker_light, 1.0f);
1371 immRectf(pos_id, x1, y1, x1 + sizex, y1 + sizey);
1383 float colf[4] = {0, 0, 0, 0};
1385 v1[1] = y1 + sizey_solid;
1389 for (
int a = 0; a <= sizex; a++) {
1390 const float pos =
float(a) / sizex;
1396 v1[0] =
v2[0] = x1 + a;
1406 v2[1] = y1 + sizey_solid;
1409 for (
int a = 0; a <= sizex; a++) {
1410 const float pos =
float(a) / sizex;
1416 v1[0] =
v2[0] = x1 + a;
1418 immAttr4f(col_id, colf[0], colf[1], colf[2], 1.0f);
1431 for (
int a = 0; a < coba->
tot; a++, cbd++) {
1432 if (a != coba->
cur) {
1433 const float pos = x1 + cbd->
pos * (sizex - 1) + 1;
1439 if (coba->
tot != 0) {
1441 const float pos = x1 + cbd->
pos * (sizex - 1) + 1;
1452 const float diffuse[3] = {1.0f, 1.0f, 1.0f};
1460 box_rect.xmax = rect->
xmax;
1461 box_rect.ymin = rect->
ymin;
1462 box_rect.ymax = rect->
ymax;
1474 if (use_project_matrix) {
1510 if (use_project_matrix) {
1524 const float offset_x,
1525 const float offset_y,
1528 const float start_x = (
ceilf(offset_x / step) * step - offset_x) * zoom_x + rect->
xmin;
1529 const float start_y = (
ceilf(offset_y / step) * step - offset_y) * zoom_y + rect->
ymin;
1531 const int line_count_x =
ceilf((rect->
xmax - start_x) / (step * zoom_x));
1532 const int line_count_y =
ceilf((rect->
ymax - start_y) / (step * zoom_y));
1534 if (line_count_x + line_count_y == 0) {
1539 for (
int i = 0; i < line_count_x; i++) {
1540 const float x = start_x + i * step * zoom_x;
1544 for (
int i = 0; i < line_count_y; i++) {
1545 const float y = start_y + i * step * zoom_y;
1554 r_color[0] = color[0] - shade > 0 ? color[0] - shade : 0;
1555 r_color[1] = color[1] - shade > 0 ? color[1] - shade : 0;
1556 r_color[2] = color[2] - shade > 0 ? color[2] - shade : 0;
1561 uchar color_shaded[3];
1568 uchar color_shaded[3];
1583 if (clip_size_x == 0.0f || clip_size_y == 0.0f) {
1590 const float offsx = cumap->
curr.
xmin - (1.0f / zoomx);
1591 const float offsy = cumap->
curr.
ymin - (1.0f / zoomy);
1594 if (zoomx == 0.0f) {
1605 scissor_new.ymin = rect->
ymin;
1606 scissor_new.xmax = rect->
xmax;
1607 scissor_new.ymax = rect->
ymax;
1608 const rcti scissor_region = {0, region->winx, 0, region->winy};
1618 const float col[3] = {0.0f, 0.0f, 0.0f};
1621 grid.
xmin = rect->
xmin + zoomx * (-offsx);
1622 grid.xmax = grid.xmin + zoomx;
1623 grid.ymin = rect->
ymin + zoomy * (-offsy);
1624 grid.ymax = grid.ymin + zoomy;
1635 float color_backdrop[4] = {0, 0, 0, 1};
1704 else if (cumap->
cur == 3) {
1712 if (cumap->
cur == 0) {
1715 else if (cumap->
cur == 1) {
1729 if (cuma->
table ==
nullptr) {
1739 line_range.
ymin = rect->
ymin + zoomy * (cmp[0].
y - offsy);
1742 line_range.
xmin = rect->
xmin + zoomx * (cmp[0].
x - offsx + cuma->
ext_in[0]);
1743 line_range.
ymin = rect->
ymin + zoomy * (cmp[0].
y - offsy + cuma->
ext_in[1]);
1763 for (
int a = 0; a <=
CM_TABLE; a++) {
1764 const float fx = rect->
xmin + zoomx * (cmp[a].
x - offsx);
1765 const float fy = rect->
ymin + zoomy * (cmp[a].
y - offsy);
1779 for (
int a = 0; a <=
CM_TABLE; a++) {
1780 const float fx = rect->
xmin + zoomx * (cmp[a].
x - offsx);
1781 const float fy = rect->
ymin + zoomy * (cmp[a].
y - offsy);
1802 float color_vert[4], color_vert_select[4];
1806 interp_v3_v3v3(color_vert, color_vert_select, color_backdrop, 0.75f);
1814 const float point_size =
max_ff(
U.pixelsize * 3.0f,
1817 for (
int a = 0; a < cuma->
totpoint; a++) {
1818 const float fx = rect->
xmin + zoomx * (cmp[a].
x - offsx);
1819 const float fy = rect->
ymin + zoomy * (cmp[a].
y - offsy);
1828 GPU_scissor(scissor[0], scissor[1], scissor[2], scissor[3]);
1865 const float offsx = profile->
view_rect.
xmin - (1.0f / zoomx);
1866 const float offsy = profile->view_rect.ymin - (1.0f / zoomy);
1869 if (zoomx == 0.0f) {
1878 scissor_new.ymin = rect->
ymin;
1879 scissor_new.xmax = rect->
xmax;
1880 scissor_new.ymax = rect->
ymax;
1882 const rcti scissor_region = {0, region->winx, 0, region->winy};
1896 float color_backdrop[4] = {0, 0, 0, 1};
1903 rect->
xmin + zoomx * (profile->clip_rect.xmin - offsx),
1904 rect->
ymin + zoomy * (profile->clip_rect.ymin - offsy),
1905 rect->
xmin + zoomx * (profile->clip_rect.xmax - offsx),
1906 rect->
ymin + zoomy * (profile->clip_rect.ymax - offsy));
1922 if (profile->table ==
nullptr) {
1927 const bool add_left_tri = profile->view_rect.xmin < 0.0f;
1928 const bool add_bottom_tri = profile->view_rect.ymin < 0.0f;
1930 const uint tot_triangles = tot_points - 2;
1933 float(*table_coords)[2] =
static_cast<float(*)[2]
>(
1934 MEM_mallocN(
sizeof(*table_coords) * tot_points, __func__));
1937 table_coords[i][0] = pts[i].
x;
1938 table_coords[i][1] = pts[i].
y;
1943 if (add_left_tri && add_bottom_tri) {
1945 table_coords[tot_points - 3][0] = profile->view_rect.xmin - 1.0f;
1946 table_coords[tot_points - 3][1] = 1.0f;
1947 table_coords[tot_points - 2][0] = profile->view_rect.xmin - 1.0f;
1948 table_coords[tot_points - 2][1] = profile->view_rect.ymin - 1.0f;
1949 table_coords[tot_points - 1][0] = 1.0f;
1950 table_coords[tot_points - 1][1] = profile->view_rect.ymin - 1.0f;
1952 else if (add_left_tri) {
1954 table_coords[tot_points - 2][0] = profile->view_rect.xmin - 1.0f;
1955 table_coords[tot_points - 2][1] = 1.0f;
1956 table_coords[tot_points - 1][0] = profile->view_rect.xmin - 1.0f;
1957 table_coords[tot_points - 1][1] = -1.0f;
1959 else if (add_bottom_tri) {
1961 table_coords[tot_points - 2][0] = -1.0f;
1962 table_coords[tot_points - 2][1] = profile->view_rect.ymin - 1.0f;
1963 table_coords[tot_points - 1][0] = 1.0f;
1964 table_coords[tot_points - 1][1] = profile->view_rect.ymin - 1.0f;
1968 table_coords[tot_points - 1][0] = -1.0f;
1969 table_coords[tot_points - 1][1] = -1.0f;
1973 if (tot_triangles > 0) {
1974 uint(*tri_indices)[3] =
static_cast<uint(*)[3]
>(
1975 MEM_mallocN(
sizeof(*tri_indices) * tot_triangles, __func__));
1983 for (
uint i = 0; i < tot_triangles; i++) {
1984 const uint *tri = tri_indices[i];
1985 for (
uint j = 0; j < 3; j++) {
1986 fx = rect->
xmin + zoomx * (table_coords[tri[j]][0] - offsx);
1987 fy = rect->
ymin + zoomy * (table_coords[tri[j]][1] - offsy);
1996 tot_points -= (add_left_tri + add_left_tri);
1997 const int edges_len = tot_points - 1;
1998 if (edges_len > 0) {
2003 for (
int i = 0; i < tot_points; i++) {
2004 fx = rect->
xmin + zoomx * (table_coords[i][0] - offsx);
2005 fy = rect->
ymin + zoomy * (table_coords[i][1] - offsy);
2014 pts = profile->path;
2015 const int path_len = tot_points =
uint(profile->path_len);
2016 int selected_free_points = 0;
2017 for (
int i = 0; i < path_len; i++) {
2019 selected_free_points++;
2023 if (selected_free_points > 0) {
2029 for (
int i = 0; i < path_len; i++) {
2031 ptx = rect->
xmin + zoomx * (pts[i].
x - offsx);
2032 pty = rect->
ymin + zoomy * (pts[i].
y - offsy);
2034 fx = rect->
xmin + zoomx * (pts[i].
h1_loc[0] - offsx);
2035 fy = rect->
ymin + zoomy * (pts[i].
h1_loc[1] - offsy);
2039 fx = rect->
xmin + zoomx * (pts[i].
h2_loc[0] - offsx);
2040 fy = rect->
ymin + zoomy * (pts[i].
h2_loc[1] - offsy);
2056 float color_vert[4], color_vert_select[4], color_sample[4];
2059 color_sample[0] =
float(wcol->
item[0]) / 255.0f;
2060 color_sample[1] =
float(wcol->
item[1]) / 255.0f;
2061 color_sample[2] =
float(wcol->
item[2]) / 255.0f;
2062 color_sample[3] =
float(wcol->
item[3]) / 255.0f;
2064 interp_v3_v3v3(color_vert, color_vert_select, color_backdrop, 0.75f);
2077 for (
int i = 0; i < path_len; i++) {
2078 fx = rect->
xmin + zoomx * (pts[i].
x - offsx);
2079 fy = rect->
ymin + zoomy * (pts[i].
y - offsy);
2087 if (selected_free_points > 0) {
2092 for (
int i = 0; i < path_len; i++) {
2094 fx = rect->
xmin + zoomx * (pts[i].
h1_loc[0] - offsx);
2095 fy = rect->
ymin + zoomy * (pts[i].
h1_loc[1] - offsy);
2099 fx = rect->
xmin + zoomx * (pts[i].
h2_loc[0] - offsx);
2100 fy = rect->
ymin + zoomy * (pts[i].
h2_loc[1] - offsy);
2109 pts = profile->segments;
2110 const int segments_len =
uint(profile->segments_len);
2111 if (segments_len > 0 && pts) {
2114 for (
int i = 0; i < segments_len; i++) {
2115 fx = rect->
xmin + zoomx * (pts[i].
x - offsx);
2116 fy = rect->
ymin + zoomy * (pts[i].
y - offsy);
2125 GPU_scissor(scissor[0], scissor[1], scissor[2], scissor[3]);
2161 (rect.xmax + 1) - (rect.xmin - 1),
2162 (rect.ymax + 1) - (rect.ymin - 1));
2165 const float color[4] = {0.7f, 0.3f, 0.3f, 0.3f};
2167 rctf disabled_rect{};
2168 disabled_rect.
xmin = rect.xmin - 1;
2169 disabled_rect.xmax = rect.xmax + 1;
2170 disabled_rect.ymin = rect.ymin;
2171 disabled_rect.ymax = rect.ymax + 1;
2212 GPU_scissor(rect.xmin, rect.ymin, scissor[2], scissor[3]);
2214 if (width > 0 && height > 0) {
2216 float col_sel[4], col_outline[4];
2219 const float color[4] = {0.0f, 0.0f, 0.0f, 0.3f};
2222 mask_rect.
xmin = rect.xmin - 1;
2223 mask_rect.xmax = rect.xmax + 1;
2224 mask_rect.ymin = rect.ymin;
2225 mask_rect.ymax = rect.ymax + 1;
2256 const float pos_sel[8] = {-10.0f, -7.0f, -4.0f, -1.0f, 2.0f, 5.0f, 8.0f, 11.0f};
2257 for (
int axe = 0; axe < 2; axe++) {
2258 for (
int i = 0; i < 7; i++) {
2259 const float x1 = pos_sel[i] * (1 - axe);
2260 const float y1 = pos_sel[i] * axe;
2261 const float x2 = pos_sel[i + 1] * (1 - axe);
2262 const float y2 = pos_sel[i + 1] * axe;
2286 const float color[4] = {0.0f, 0.0f, 0.0f, 0.3f};
2289 box_rect.
xmin = rect.xmin - 1;
2290 box_rect.xmax = rect.xmax + 1;
2291 box_rect.ymin = rect.ymin;
2292 box_rect.ymax = rect.ymax + 1;
2307 const rctf *rct,
const float radius,
const float width,
const float aspect,
const float alpha)
2309 if (width == 0.0f) {
2314 const float clamped_aspect =
smoothminf(aspect, 1.0f, 0.5f);
2315 const float shadow_width = width * clamped_aspect;
2318 const float inner_radius =
max_ff(radius -
U.pixelsize, 0.0);
2319 const float shadow_radius = radius + shadow_width -
U.pixelsize;
2325 widget_params.recti.ymin = rct->
ymin;
2326 widget_params.recti.xmax = rct->
xmax;
2327 widget_params.recti.ymax = rct->
ymax;
2328 widget_params.rect.xmin = rct->
xmin - shadow_width;
2329 widget_params.rect.ymin = rct->
ymin - shadow_width;
2330 widget_params.rect.xmax = rct->
xmax + shadow_width;
2331 widget_params.rect.ymax = rct->
ymax + shadow_width - shadow_offset;
2332 widget_params.radi = inner_radius;
2333 widget_params.rad = shadow_radius;
2338 widget_params.alpha_discard = 1.0f;
void immDrawPixelsTexTiled(IMMDrawPixelsTexState *state, float x, float y, int img_w, int img_h, eGPUTextureFormat gpu_format, bool use_filter, const void *rect, float xzoom, float yzoom, const float color[4])
IMMDrawPixelsTexState immDrawPixelsTexSetup(int builtin)
bool BKE_colorband_evaluate(const ColorBand *coba, float in, float out[4])
void BKE_curveprofile_update(struct CurveProfile *profile, int update_flags)
int BKE_curveprofile_table_size(const struct CurveProfile *profile)
struct ImBuf * BKE_tracking_sample_pattern(int frame_width, int frame_height, const struct ImBuf *search_ib, const struct MovieTrackingTrack *track, const struct MovieTrackingMarker *marker, bool from_anchor, bool use_mask, int num_samples_x, int num_samples_y, float pos[2])
void BLF_batch_draw_flush()
void BLF_color4f(int fontid, float r, float g, float b, float a)
void BLF_draw_default(float x, float y, float z, const char *str, size_t str_len) ATTR_NONNULL()
MINLINE float max_ff(float a, float b)
MINLINE float min_ff(float a, float b)
void rgb_to_hsv_v(const float rgb[3], float r_hsv[3])
#define BLI_YUV_ITU_BT709
void linearrgb_to_srgb_v3_v3(float srgb[3], const float linear[3])
void rgb_to_yuv(float r, float g, float b, float *r_y, float *r_u, float *r_v, int colorspace)
void rgba_uchar_to_float(float r_col[4], const unsigned char col_ub[4])
void yuv_to_rgb(float y, float u, float v, float *r_r, float *r_g, float *r_b, int colorspace)
void rgb_uchar_to_float(float r_col[3], const unsigned char col_ub[3])
void unit_m3(float m[3][3])
MINLINE float len_squared_v3(const float v[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void copy_v4_fl4(float v[4], float x, float y, float z, float w)
MINLINE float len_squared_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void mul_v2_fl(float r[2], float f)
MINLINE void copy_v3_v3(float r[3], const float a[3])
void interp_v3_v3v3(float r[3], const float a[3], const float b[3], float t)
MINLINE void swap_v3_v3(float a[3], float b[3])
void BLI_polyfill_calc(const float(*coords)[2], unsigned int coords_num, int coords_sign, unsigned int(*r_tris)[3])
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
bool BLI_rcti_isect(const struct rcti *src1, const struct rcti *src2, struct rcti *dest)
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
BLI_INLINE float BLI_rctf_size_x(const struct rctf *rct)
BLI_INLINE float BLI_rctf_size_y(const struct rctf *rct)
#define SNPRINTF(dst, format,...)
#define ARRAY_SET_ITEMS(...)
@ CUMA_EXTEND_EXTRAPOLATE
@ SCOPES_WAVEFRM_YCC_JPEG
@ SCOPES_WAVEFRM_RGB_PARADE
blender::gpu::Batch * GPU_batch_create_ex(GPUPrimType primitive_type, blender::gpu::VertBuf *vertex_buf, blender::gpu::IndexBuf *index_buf, eGPUBatchFlag owns_flag)
#define GPU_batch_uniform_1f(batch, name, x)
void GPU_batch_discard(blender::gpu::Batch *batch)
#define GPU_batch_uniformbuf_bind(batch, name, ubo)
#define GPU_batch_uniform_4fv_array(batch, name, len, val)
void GPU_batch_program_set_builtin(blender::gpu::Batch *batch, eGPUBuiltinShader shader_id)
void GPU_batch_draw(blender::gpu::Batch *batch)
#define GPU_batch_uniform_4f(batch, name, x, y, z, w)
blender::gpu::Batch * GPU_batch_preset_sphere(int lod) ATTR_WARN_UNUSED_RESULT
void GPU_matrix_scale_2f(float x, float y)
void GPU_matrix_ortho_set_z(float near, float far)
void GPU_matrix_push_projection()
void GPU_matrix_scale_1f(float factor)
void GPU_matrix_pop_projection()
#define GPU_MATRIX_ORTHO_CLIP_NEAR_DEFAULT
void GPU_matrix_translate_2f(float x, float y)
@ GPU_SHADER_3D_SMOOTH_COLOR
@ GPU_SHADER_3D_LINE_DASHED_UNIFORM_COLOR
@ GPU_SHADER_3D_POINT_VARYING_SIZE_VARYING_COLOR
@ GPU_SHADER_3D_UNIFORM_COLOR
@ GPU_SHADER_3D_FLAT_COLOR
@ GPU_SHADER_SIMPLE_LIGHTING
@ GPU_SHADER_2D_WIDGET_SHADOW
@ GPU_SHADER_2D_WIDGET_BASE
@ GPU_SHADER_3D_IMAGE_COLOR
void GPU_program_point_size(bool enable)
void GPU_face_culling(eGPUFaceCullTest culling)
@ GPU_BLEND_ALPHA_PREMULT
void GPU_blend(eGPUBlend blend)
void GPU_line_width(float width)
void GPU_line_smooth(bool enable)
void GPU_scissor(int x, int y, int width, int height)
void GPU_point_size(float size)
void GPU_viewport_size_get_f(float coords[4])
void GPU_scissor_get(int coords[4])
void GPU_polygon_smooth(bool enable)
#define GPU_vertbuf_create_with_format(format)
void GPU_vertbuf_use(blender::gpu::VertBuf *)
void GPU_vertbuf_attr_fill(blender::gpu::VertBuf *, uint a_idx, const void *data)
void GPU_vertbuf_tag_dirty(blender::gpu::VertBuf *verts)
void GPU_vertbuf_data_alloc(blender::gpu::VertBuf &verts, uint v_len)
BLI_INLINE float IMB_colormanagement_get_luminance(const float rgb[3])
void IMB_colormanagement_scene_linear_to_display_v3(float pixel[3], ColorManagedDisplay *display)
void IMB_rect_from_float(ImBuf *ibuf)
bool IMB_scale(ImBuf *ibuf, unsigned int newx, unsigned int newy, IMBScaleFilter filter, bool threaded=true)
Contains defines and structs used throughout the imbuf module.
Read Guarded memory(de)allocation.
#define UI_ALPHA_CHECKER_LIGHT
#define UI_ALPHA_CHECKER_DARK
void UI_GetThemeColor4fv(int colorid, float col[4])
ATTR_WARN_UNUSED_RESULT const BMVert * v2
ATTR_WARN_UNUSED_RESULT const BMVert * v
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
local_group_size(16, 16) .push_constant(Type b
draw_view in_light_buf[] float
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
RAYTRACE_GROUP_SIZE additional_info("eevee_shared", "eevee_gbuffer_data", "eevee_global_ubo", "eevee_sampling_data", "eevee_utility_texture", "eevee_hiz_data", "draw_view") .specialization_constant(Type RAYTRACE_GROUP_SIZE in_sh_0_tx in_sh_2_tx screen_normal_tx GPU_RGBA8
void IMB_freeImBuf(ImBuf *)
void ui_but_v3_get(uiBut *but, float vec[3])
ColorManagedDisplay * ui_block_cm_display_get(uiBlock *block)
void ui_draw_but_HISTOGRAM(ARegion *, uiBut *but, const uiWidgetColors *, const rcti *recti)
void ui_draw_but_TRACKPREVIEW(ARegion *, uiBut *but, const uiWidgetColors *, const rcti *recti)
#define HISTOGRAM_TOT_GRID_LINES
void UI_draw_roundbox_4fv(const rctf *rect, bool filled, float rad, const float col[4])
void ui_draw_but_IMAGE(ARegion *, uiBut *but, const uiWidgetColors *, const rcti *rect)
void ui_draw_dropshadow(const rctf *rct, const float radius, const float width, const float aspect, const float alpha)
void UI_draw_safe_areas(uint pos, const rctf *rect, const float title_aspect[2], const float action_aspect[2])
static void gl_shaded_color_get_fl(const uchar *color, int shade, float r_color[3])
static float polar_to_x(float center, float diam, float ampli, float angle)
static void histogram_draw_one(float r, float g, float b, float alpha, float x, float y, float w, float h, const float *data, int res, const bool is_line, uint pos_attr)
static void ui_draw_colorband_handle(uint shdr_pos, const rcti *rect, float x, const float rgb[3], ColorManagedDisplay *display, bool active)
void UI_draw_text_underline(int pos_x, int pos_y, int len, int height, const float color[4])
void UI_draw_roundbox_4fv_ex(const rctf *rect, const float inner1[4], const float inner2[4], float shade_dir, const float outline[4], float outline_width, float rad)
static void gl_shaded_color_get(const uchar color[3], int shade, uchar r_color[3])
void ui_draw_but_WAVEFORM(ARegion *, uiBut *but, const uiWidgetColors *, const rcti *recti)
static void ui_draw_colorband_handle_tri(uint pos, float x1, float y1, float halfwidth)
static void draw_scope_end(const rctf *rect)
static void gl_shaded_color(const uchar *color, int shade)
void ui_draw_but_VECTORSCOPE(ARegion *, uiBut *but, const uiWidgetColors *, const rcti *recti)
static float polar_to_y(float center, float diam, float ampli, float angle)
static void ui_draw_colorband_handle_box(uint pos, float x1, float y1, float x2, float y2)
void UI_draw_roundbox_corner_set(int type)
void ui_draw_rounded_corners_inverted(const rcti &rect, const float rad, const blender::float4 color)
static void vectorscope_draw_target(uint pos, float centerx, float centery, float diam, const float colf[3], char label)
void UI_draw_roundbox_3fv_alpha(const rctf *rect, bool filled, float rad, const float col[3], float alpha)
void ui_draw_but_CURVE(ARegion *region, uiBut *but, const uiWidgetColors *wcol, const rcti *rect)
static bool point_draw_handles(CurveProfilePoint *point)
static void circle_draw_rgb(float *points, int tot_points, const float *col, GPUPrimType prim)
static void ui_draw_but_curve_grid(const uint pos, const rcti *rect, const float zoom_x, const float zoom_y, const float offset_x, const float offset_y, const float step)
void ui_draw_but_UNITVEC(uiBut *but, const uiWidgetColors *wcol, const rcti *rect, const float radius)
void ui_draw_but_CURVEPROFILE(ARegion *region, uiBut *but, const uiWidgetColors *wcol, const rcti *rect)
void UI_draw_roundbox_3ub_alpha(const rctf *rect, bool filled, float rad, const uchar col[3], uchar alpha)
static void waveform_draw_rgb(const float *waveform, int waveform_num, const float *col, float alpha)
void UI_draw_roundbox_aa(const rctf *rect, bool filled, float rad, const float color[4])
static void waveform_draw_one(const float *waveform, int waveform_num, const float col[3])
void ui_draw_but_TAB_outline(const rcti *rect, float rad, uchar highlight[3], uchar highlight_fade[3])
void ui_draw_but_COLORBAND(uiBut *but, const uiWidgetColors *wcol, const rcti *rect)
void ui_draw_gradient(const rcti *rect, const float hsv[3], eButGradientType type, float alpha)
blender::gpu::Batch * ui_batch_roundbox_shadow_get()
blender::gpu::Batch * ui_batch_roundbox_widget_get()
void *(* MEM_mallocN)(size_t len, const char *str)
void MEM_freeN(void *vmemh)
MINLINE float smoothminf(float a, float b, float c)
ccl_device_inline float2 fabs(const float2 a)
ImBufFloatBuffer float_buffer
ImBufByteBuffer byte_buffer
struct ImBuf * track_preview
struct ImBuf * track_search
struct MovieTrackingMarker undist_marker
struct MovieTrackingTrack * track
CurveMapping * edit_cumap
eButGradientType gradient_type
CurveProfile * edit_profile