61int UI_draw_roundbox_corner_get()
68 const float inner1[4],
69 const float inner2[4],
71 const float outline[4],
82 widget_params.
rect = *rect;
83 widget_params.
radi = rad;
84 widget_params.
rad = rad;
89 widget_params.
color_inner1[0] = inner1 ? inner1[0] : 0.0f;
90 widget_params.
color_inner1[1] = inner1 ? inner1[1] : 0.0f;
91 widget_params.
color_inner1[2] = inner1 ? inner1[2] : 0.0f;
92 widget_params.
color_inner1[3] = inner1 ? inner1[3] : 0.0f;
93 widget_params.
color_inner2[0] = inner2 ? inner2[0] : inner1 ? inner1[0] : 0.0f;
94 widget_params.
color_inner2[1] = inner2 ? inner2[1] : inner1 ? inner1[1] : 0.0f;
95 widget_params.
color_inner2[2] = inner2 ? inner2[2] : inner1 ? inner1[2] : 0.0f;
96 widget_params.
color_inner2[3] = inner2 ? inner2[3] : inner1 ? inner1[3] : 0.0f;
97 widget_params.
color_outline[0] = outline ? outline[0] : inner1 ? inner1[0] : 0.0f;
98 widget_params.
color_outline[1] = outline ? outline[1] : inner1 ? inner1[1] : 0.0f;
99 widget_params.
color_outline[2] = outline ? outline[2] : inner1 ? inner1[2] : 0.0f;
100 widget_params.
color_outline[3] = outline ? outline[3] : inner1 ? inner1[3] : 0.0f;
115 const float colv[4] = {
119 float(alpha) / 255.0f,
125 const rctf *rect,
bool filled,
float rad,
const float col[3],
float alpha)
127 const float colv[4] = {
col[0],
col[1],
col[2], alpha};
135 float colv[4] = {color[0], color[1], color[2], color[3]};
155 format,
"pos", blender::gpu::VertAttrType::SFLOAT_32_32);
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;
223 format,
"pos", blender::gpu::VertAttrType::SFLOAT_32_32);
228 immRectf(
pos, pos_x, pos_y - ofs_y, pos_x +
len, pos_y - ofs_y + (height *
U.pixelsize));
237 uchar highlight_fade[3])
244 format,
"pos", blender::gpu::VertAttrType::SFLOAT_32_32);
246 format,
"color", blender::gpu::VertAttrType::UNORM_8_8_8_8);
248 const int minx = rect->
xmin +
U.pixelsize, maxx = rect->
xmax -
U.pixelsize;
249 const int miny = rect->
ymin +
U.pixelsize, maxy = rect->
ymax -
U.pixelsize;
259 for (a = 0; a < 4; a++) {
271 for (a = 0; a < 4; a++) {
283 for (a = 0; a < 4; a++) {
297 for (a = 0; a < 4; a++) {
309 for (a = 0; a < 4; a++) {
356 if (
w != ibuf->
x || h != ibuf->
y) {
361 float col[4] = {1.0f, 1.0f, 1.0f, 1.0f};
362 if (but->
col[3] != 0) {
373 blender::gpu::TextureFormat::UNORM_8_8_8_8,
384 GPU_scissor(scissor[0], scissor[1], scissor[2], scissor[3]);
392 const float title_aspect[2],
393 const float action_aspect[2])
395 const float size_x_half = (rect->
xmax - rect->
xmin) * 0.5f;
396 const float size_y_half = (rect->
ymax - rect->
ymin) * 0.5f;
398 const float *safe_areas[] = {title_aspect, action_aspect};
401 for (
int i = 0;
i < safe_len;
i++) {
402 if (safe_areas[
i][0] || safe_areas[
i][1]) {
403 const float margin_x = safe_areas[
i][0] * size_x_half;
404 const float margin_y = safe_areas[
i][1] * size_y_half;
406 const float minx = rect->
xmin + margin_x;
407 const float miny = rect->
ymin + margin_y;
408 const float maxx = rect->
xmax - margin_x;
409 const float maxy = rect->
ymax - margin_y;
422 const float color[4] = {0.0f, 0.0f, 0.0f, 0.5f};
444 const float color[4] = {r, g,
b, alpha};
461 for (
int i = 0;
i < res;
i++) {
462 const float x2 =
x +
i * (
w /
float(res));
474 for (
int i = 1;
i < res;
i++) {
475 const float x2 =
x +
i * (
w /
float(res));
486 for (
int i = 0;
i < res;
i++) {
487 const float x2 =
x +
i * (
w /
float(res));
496#define HISTOGRAM_TOT_GRID_LINES 4
537 const rcti scissor_region = {0, region->
winx, 0, region->
winy};
546 format,
"pos", blender::gpu::VertAttrType::SFLOAT_32_32);
573 1.0, 1.0, 1.0, 0.75, rect.
xmin, rect.
ymin,
w, h, hist->
data_luma, res, is_line,
pos);
577 1.0, 1.0, 1.0, 0.75, rect.
xmin, rect.
ymin,
w, h, hist->
data_a, res, is_line,
pos);
582 1.0, 0.0, 0.0, 0.75, rect.
xmin, rect.
ymin,
w, h, hist->
data_r, res, is_line,
pos);
586 0.0, 1.0, 0.0, 0.75, rect.
xmin, rect.
ymin,
w, h, hist->
data_g, res, is_line,
pos);
590 0.0, 0.0, 1.0, 0.75, rect.
xmin, rect.
ymin,
w, h, hist->
data_b, res, is_line,
pos);
603#undef HISTOGRAM_TOT_GRID_LINES
609 "It is not allowed to draw a batch when immediate mode has a shader bound. It will "
610 "use the incorrect shader and is hard to discover.");
613 &
format,
"pos", blender::gpu::VertAttrType::SFLOAT_32_32);
650 for (
int i = 0;
i < waveform_num;
i++) {
651 memcpy(&
data->pos, waveform,
sizeof(
data->pos));
652 memcpy(&
data->color,
col,
sizeof(
float) * 3);
653 data->color.w = alpha;
673 &
format,
"pos", blender::gpu::VertAttrType::SFLOAT_32_32);
675 &
format,
"color", blender::gpu::VertAttrType::SFLOAT_32_32_32_32);
698 const float colorsycc[3][3] = {{1, 0, 1}, {1, 1, 0}, {0, 1, 1}};
700 float colors_alpha[3][3], colorsycc_alpha[3][3];
703 if (scopes ==
nullptr) {
719 const float w3 =
w / 3.0f;
726 for (
int c = 0; c < 3; c++) {
727 for (
int i = 0;
i < 3;
i++) {
728 colors_alpha[c][
i] = colors[c][
i] * alpha;
729 colorsycc_alpha[c][
i] = colorsycc[c][
i] * alpha;
755 const rcti scissor_region = {0, region->
winx, 0, region->
winy};
763 for (
int i = 0;
i < 6;
i++) {
776 format,
"pos", blender::gpu::VertAttrType::SFLOAT_32_32);
785 for (
int i = 0;
i < 6;
i++) {
796 for (
int i = 1;
i < 3;
i++) {
843 const float col[3] = {alpha, alpha, alpha};
909 for (
int c = 0; c < 3; c++) {
911 immUniformColor3f(colors[c][0] * 0.75f, colors[c][1] * 0.75f, colors[c][2] * 0.75f);
915 colorsycc[c][0] * 0.75f, colorsycc[c][1] * 0.75f, colorsycc[c][2] * 0.75f);
943 return center + diam * ampli *
cosf(
angle);
948 return center + diam * ampli *
sinf(
angle);
952 uint pos,
float centerx,
float centery,
float diam,
const float colf[3],
char label)
955 float tangle = 0.0f, tampli;
956 float dangle, dampli;
957 const char labelstr[2] = {label,
'\0'};
963 if (u > 0 &&
v >= 0) {
966 else if (u > 0 &&
v < 0) {
972 else if (u == 0 &&
v > 0.0f) {
975 else if (u == 0 &&
v < 0.0f) {
983 dampli = 2.5f / 200.0f;
986 polar_to_x(centerx, diam, tampli + dampli, tangle + dangle),
987 polar_to_y(centery, diam, tampli + dampli, tangle + dangle));
989 polar_to_x(centerx, diam, tampli - dampli, tangle + dangle),
990 polar_to_y(centery, diam, tampli - dampli, tangle + dangle));
992 polar_to_x(centerx, diam, tampli - dampli, tangle - dangle),
993 polar_to_y(centery, diam, tampli - dampli, tangle - dangle));
995 polar_to_x(centerx, diam, tampli + dampli, tangle - dangle),
996 polar_to_y(centery, diam, tampli + dampli, tangle - dangle));
1014 const float skin_rad =
DEG2RADF(123.0f);
1017 const float colors[6][3] = {
1026 const char color_names[] = {
'R',
'Y',
'G',
'C',
'B',
'M'};
1036 const float centerx = rect.
xmin +
w * 0.5f;
1037 const float centery = rect.
ymin + h * 0.5f;
1038 const float diam = ((
w < h) ?
w : h) * 0.9f;
1063 const rcti scissor_region = {0, region->
winx, 0, region->
winy};
1072 format,
"pos", blender::gpu::VertAttrType::SFLOAT_32_32);
1075 const int increment = 6;
1076 const int tot_points = int(360 / increment);
1077 const float r = 0.5f;
1078 float step = 360.0f / (tot_points - 1);
1080 float circle_fill_points[(tot_points * 2) + 2];
1081 float circle_fill_vertex_colors[(tot_points * 4) + 4];
1086 circle_fill_points[0] = centerx;
1087 circle_fill_points[1] = centery;
1088 circle_fill_vertex_colors[0] = 0.2f;
1089 circle_fill_vertex_colors[1] = 0.2f;
1090 circle_fill_vertex_colors[2] = 0.2f;
1091 circle_fill_vertex_colors[3] = 0.8f;
1093 for (
int i = 0;
i < tot_points;
i++) {
1103 circle_fill_points[(
i + 1) * 2] =
x;
1104 circle_fill_points[(
i + 1) * 2 + 1] =
y;
1109 circle_fill_vertex_colors[(
i + 1) * 4] = r * 0.2f;
1110 circle_fill_vertex_colors[(
i + 1) * 4 + 1] = g * 0.2f;
1111 circle_fill_vertex_colors[(
i + 1) * 4 + 2] =
b * 0.2f;
1112 circle_fill_vertex_colors[(
i + 1) * 4 + 3] = 0.8f;
1117 circle_fill_points, tot_points + 1, circle_fill_vertex_colors,
GPU_PRIM_TRI_FAN);
1126 for (
int i = 0;
i <= 360;
i += increment) {
1134 float circle_points[(tot_points * 2) + 3] = {};
1135 float circle_vertex_colors[(tot_points * 4) + 5] = {};
1137 for (
int i = 0;
i < tot_points;
i++) {
1141 const float x =
polar_to_x(centerx, diam, 0.5f, a);
1142 const float y =
polar_to_y(centery, diam, 0.5f, a);
1143 circle_points[
i * 2] =
x;
1144 circle_points[
i * 2 + 1] =
y;
1151 circle_vertex_colors[
i * 4] = r;
1152 circle_vertex_colors[
i * 4 + 1] = g;
1153 circle_vertex_colors[
i * 4 + 2] =
b;
1154 circle_vertex_colors[
i * 4 + 3] = 0.8f;
1164 for (
int j = 0; j < 4; j++) {
1165 float inner_circle_points[(tot_points * 2) + 3] = {};
1166 float inner_circle_colors[(tot_points * 4) + 5] = {};
1167 const float r = (j + 1) * 0.1f;
1169 for (
int i = 0;
i < tot_points;
i++) {
1173 inner_circle_points[
i * 2] =
polar_to_x(centerx, diam, r, a);
1174 inner_circle_points[
i * 2 + 1] =
polar_to_y(centery, diam, r, a);
1176 inner_circle_colors[
i * 4] = 0.1f;
1177 inner_circle_colors[
i * 4 + 1] = 0.1f;
1178 inner_circle_colors[
i * 4 + 2] = 0.1f;
1179 inner_circle_colors[
i * 4 + 3] = 0.8f;
1209 for (
int i = 0;
i < 6;
i++) {
1213 if (scopes->
ok && scopes->
vecscope !=
nullptr) {
1221 const float col[3] = {alpha, alpha, alpha};
1274 float colf[3] = {
UNPACK3(rgb)};
1276 const float half_width = sizey / 3.5f;
1277 const float height = half_width * 1.4f;
1279 float y1 = rect->
ymin;
1280 const float y2 = rect->
ymax;
1288 float line_width = std::max(std::min(
U.pixelsize / 5.0f *
fabs(half_width - 4.0f),
U.pixelsize),
1292 uchar alpha = std::min(
int(
fabs(half_width - 2.0f) * 50.0f), 255);
1296 float viewport_size[4];
1301 immUniform4f(
"color", 1.0f, 1.0f, 1.0f, alpha / 255.0f);
1302 immUniform4f(
"color2", 0.0f, 0.0f, 0.0f, alpha / 255.0f);
1305 immUniform4f(
"color", 0.7f, 0.7f, 0.7f, alpha / 255.0f);
1306 immUniform4f(
"color2", 0.4f, 0.4f, 0.4f, alpha / 255.0f);
1321 y1 -= half_width / 2.0f;
1327 x - half_width - line_width,
1329 x + half_width + line_width,
1343 x - (half_width - line_width),
1345 x + (half_width - line_width),
1346 y1 + height - line_width);
1372 uint pos_id, col_id;
1378 if (coba ==
nullptr) {
1382 const float x1 = rect->
xmin +
U.pixelsize;
1383 const float sizex = rect->
xmax - x1 -
U.pixelsize;
1384 const float y1 = rect->
ymin +
U.pixelsize;
1385 const float sizey = rect->
ymax - y1 -
U.pixelsize;
1386 const float sizey_solid = sizey * 0.25f;
1412 immUniform4f(
"color1", checker_dark, checker_dark, checker_dark, 1.0f);
1413 immUniform4f(
"color2", checker_light, checker_light, checker_light, 1.0f);
1415 immRectf(pos_id, x1, y1, x1 + sizex, y1 + sizey);
1422 format,
"color", blender::gpu::VertAttrType::SFLOAT_32_32_32_32);
1428 float colf[4] = {0, 0, 0, 0};
1430 v1[1] = y1 + sizey_solid;
1434 for (
int a = 0; a <= sizex; a++) {
1435 const float pos =
float(a) / sizex;
1441 v1[0] =
v2[0] = x1 + a;
1451 v2[1] = y1 + sizey_solid;
1454 for (
int a = 0; a <= sizex; a++) {
1455 const float pos =
float(a) / sizex;
1461 v1[0] =
v2[0] = x1 + a;
1463 immAttr4f(col_id, colf[0], colf[1], colf[2], 1.0f);
1476 for (
int a = 0; a < coba->
tot; a++, cbd++) {
1477 if (a != coba->
cur) {
1478 const float pos = x1 + cbd->
pos * (sizex - 1) + 1;
1484 if (coba->
tot != 0) {
1486 const float pos = x1 + cbd->
pos * (sizex - 1) + 1;
1497 const float diffuse[3] = {1.0f, 1.0f, 1.0f};
1519 if (use_project_matrix) {
1546 format,
"pos", blender::gpu::VertAttrType::SFLOAT_32_32);
1556 if (use_project_matrix) {
1570 const float offset_x,
1571 const float offset_y,
1574 const float start_x = (
ceilf(offset_x /
step) *
step - offset_x) * zoom_x + rect->
xmin;
1575 const float start_y = (
ceilf(offset_y /
step) *
step - offset_y) * zoom_y + rect->
ymin;
1577 const int line_count_x =
ceilf((rect->
xmax - start_x) / (
step * zoom_x));
1578 const int line_count_y =
ceilf((rect->
ymax - start_y) / (
step * zoom_y));
1580 if (line_count_x + line_count_y == 0) {
1585 for (
int i = 0;
i < line_count_x;
i++) {
1586 const float x = start_x +
i *
step * zoom_x;
1590 for (
int i = 0;
i < line_count_y;
i++) {
1591 const float y = start_y +
i *
step * zoom_y;
1605 const float fade_factor_float = inactive ? 0.33f : 1.0f;
1606 const uchar fade_factor_uchar = inactive ? 3 : 1;
1612 if (clip_size_x == 0.0f || clip_size_y == 0.0f) {
1619 const float offsx = cumap->
curr.
xmin - (1.0f / zoomx);
1620 const float offsy = cumap->
curr.
ymin - (1.0f / zoomy);
1623 if (zoomx <= 0.0f) {
1637 const rcti scissor_region = {0, region->
winx, 0, region->
winy};
1647 const float col[3] = {0.0f, 0.0f, 0.0f};
1650 grid.
xmin = rect->
xmin + zoomx * (-offsx);
1652 grid.
ymin = rect->
ymin + zoomy * (-offsy);
1666 float color_backdrop[4] = {0, 0, 0, 1};
1702 uchar col_axis_x[3], col_axis_y[3];
1745 else if (cumap->
cur == 3) {
1753 if (cumap->
cur == 0) {
1756 else if (cumap->
cur == 1) {
1770 if (cuma->
table ==
nullptr) {
1780 line_range.
ymin = rect->
ymin + zoomy * (cmp[0].
y - offsy);
1783 line_range.
xmin = rect->
xmin + zoomx * (cmp[0].
x - offsx + cuma->
ext_in[0]);
1784 line_range.
ymin = rect->
ymin + zoomy * (cmp[0].
y - offsy + cuma->
ext_in[1]);
1804 for (
int a = 0; a <=
CM_TABLE; a++) {
1805 const float fx = rect->
xmin + zoomx * (cmp[a].
x - offsx);
1806 const float fy = rect->
ymin + zoomy * (cmp[a].
y - offsy);
1820 for (
int a = 0; a <=
CM_TABLE; a++) {
1821 const float fx = rect->
xmin + zoomx * (cmp[a].
x - offsx);
1822 const float fy = rect->
ymin + zoomy * (cmp[a].
y - offsy);
1840 float color_point[4], color_point_select[4], color_point_outline[4];
1844 color_point[3] = fade_factor_float;
1845 color_point_select[3] = fade_factor_float;
1846 color_point_outline[3] *= fade_factor_float;
1849 const float point_size =
max_ff(
U.pixelsize * 2.0f,
1863 if ((cuma->
totpoint - selected) > 0) {
1868 for (
int a = 0; a < cuma->
totpoint; a++) {
1872 const float fx = rect->
xmin + zoomx * (cmp[a].
x - offsx);
1873 const float fy = rect->
ymin + zoomy * (cmp[a].
y - offsy);
1882 for (
int a = 0; a < cuma->
totpoint; a++) {
1886 const float fx = rect->
xmin + zoomx * (cmp[a].
x - offsx);
1887 const float fy = rect->
ymin + zoomy * (cmp[a].
y - offsy);
1894 if ((cuma->
totpoint - selected) > 0) {
1899 for (
int a = 0; a < cuma->
totpoint; a++) {
1903 const float fx = rect->
xmin + zoomx * (cmp[a].
x - offsx);
1904 const float fy = rect->
ymin + zoomy * (cmp[a].
y - offsy);
1915 for (
int a = 0; a < cuma->
totpoint; a++) {
1919 const float fx = rect->
xmin + zoomx * (cmp[a].
x - offsx);
1920 const float fy = rect->
ymin + zoomy * (cmp[a].
y - offsy);
1930 GPU_scissor(scissor[0], scissor[1], scissor[2], scissor[3]);
1967 const float offsx = profile->
view_rect.
xmin - (1.0f / zoomx);
1968 const float offsy = profile->
view_rect.
ymin - (1.0f / zoomy);
1971 if (zoomx <= 0.0f) {
1984 const rcti scissor_region = {0, region->
winx, 0, region->
winy};
2021 if (profile->
table ==
nullptr) {
2029 const uint tot_triangles = tot_points - 2;
2032 float (*table_coords)[2] =
static_cast<float (*)[2]
>(
2033 MEM_mallocN(
sizeof(*table_coords) * tot_points, __func__));
2036 table_coords[
i][0] = pts[
i].
x;
2037 table_coords[
i][1] = pts[
i].
y;
2042 if (add_left_tri && add_bottom_tri) {
2044 table_coords[tot_points - 3][0] = profile->
view_rect.
xmin - 1.0f;
2045 table_coords[tot_points - 3][1] = 1.0f;
2046 table_coords[tot_points - 2][0] = profile->
view_rect.
xmin - 1.0f;
2047 table_coords[tot_points - 2][1] = profile->
view_rect.
ymin - 1.0f;
2048 table_coords[tot_points - 1][0] = 1.0f;
2049 table_coords[tot_points - 1][1] = profile->
view_rect.
ymin - 1.0f;
2051 else if (add_left_tri) {
2053 table_coords[tot_points - 2][0] = profile->
view_rect.
xmin - 1.0f;
2054 table_coords[tot_points - 2][1] = 1.0f;
2055 table_coords[tot_points - 1][0] = profile->
view_rect.
xmin - 1.0f;
2056 table_coords[tot_points - 1][1] = -1.0f;
2058 else if (add_bottom_tri) {
2060 table_coords[tot_points - 2][0] = -1.0f;
2061 table_coords[tot_points - 2][1] = profile->
view_rect.
ymin - 1.0f;
2062 table_coords[tot_points - 1][0] = 1.0f;
2063 table_coords[tot_points - 1][1] = profile->
view_rect.
ymin - 1.0f;
2067 table_coords[tot_points - 1][0] = -1.0f;
2068 table_coords[tot_points - 1][1] = -1.0f;
2072 if (tot_triangles > 0) {
2073 uint(*tri_indices)[3] =
static_cast<uint(*)[3]
>(
2074 MEM_mallocN(
sizeof(*tri_indices) * tot_triangles, __func__));
2082 for (
uint i = 0;
i < tot_triangles;
i++) {
2083 const uint *tri = tri_indices[
i];
2084 for (
uint j = 0; j < 3; j++) {
2085 fx = rect->
xmin + zoomx * (table_coords[tri[j]][0] - offsx);
2086 fy = rect->
ymin + zoomy * (table_coords[tri[j]][1] - offsy);
2095 tot_points -= (add_left_tri + add_left_tri);
2096 const int edges_len = tot_points - 1;
2097 if (edges_len > 0) {
2102 for (
int i = 0;
i < tot_points;
i++) {
2103 fx = rect->
xmin + zoomx * (table_coords[
i][0] - offsx);
2104 fy = rect->
ymin + zoomy * (table_coords[
i][1] - offsy);
2113 pts = profile->
path;
2114 const int path_len = tot_points =
uint(profile->
path_len);
2115 int selected_free_points = 0;
2116 for (
int i = 0;
i < path_len;
i++) {
2118 selected_free_points++;
2122 if (selected_free_points > 0) {
2128 for (
int i = 0;
i < path_len;
i++) {
2130 ptx = rect->
xmin + zoomx * (pts[
i].
x - offsx);
2131 pty = rect->
ymin + zoomy * (pts[
i].
y - offsy);
2133 fx = rect->
xmin + zoomx * (pts[
i].
h1_loc[0] - offsx);
2134 fy = rect->
ymin + zoomy * (pts[
i].
h1_loc[1] - offsy);
2138 fx = rect->
xmin + zoomx * (pts[
i].
h2_loc[0] - offsx);
2139 fy = rect->
ymin + zoomy * (pts[
i].
h2_loc[1] - offsy);
2155 float color_point[4], color_point_select[4], color_sample[4];
2157 color_point[3] = 1.0f;
2159 color_point_select[3] = 1.0f;
2160 color_sample[0] =
float(wcol->
item[0]) / 255.0f;
2161 color_sample[1] =
float(wcol->
item[1]) / 255.0f;
2162 color_sample[2] =
float(wcol->
item[2]) / 255.0f;
2163 color_sample[3] =
float(wcol->
item[3]) / 255.0f;
2166 for (
int i = 0;
i < path_len;
i++) {
2175 const float point_size =
max_ff(
U.pixelsize * 2.0f,
2178 if ((path_len - selected) > 0) {
2183 for (
int i = 0;
i < path_len;
i++) {
2187 fx = rect->
xmin + zoomx * (pts[
i].
x - offsx);
2188 fy = rect->
ymin + zoomy * (pts[
i].
y - offsy);
2198 for (
int i = 0;
i < path_len;
i++) {
2202 fx = rect->
xmin + zoomx * (pts[
i].
x - offsx);
2203 fy = rect->
ymin + zoomy * (pts[
i].
y - offsy);
2211 for (
int i = 0;
i < path_len;
i++) {
2222 if (((selected_free_points * 2) - selected) > 0) {
2227 for (
int i = 0;
i < path_len;
i++) {
2230 fx = rect->
xmin + zoomx * (pts[
i].
h1_loc[0] - offsx);
2231 fy = rect->
ymin + zoomy * (pts[
i].
h1_loc[1] - offsy);
2235 fx = rect->
xmin + zoomx * (pts[
i].
h2_loc[0] - offsx);
2236 fy = rect->
ymin + zoomy * (pts[
i].
h2_loc[1] - offsy);
2249 for (
int i = 0;
i < path_len;
i++) {
2252 fx = rect->
xmin + zoomx * (pts[
i].
h1_loc[0] - offsx);
2253 fy = rect->
ymin + zoomy * (pts[
i].
h1_loc[1] - offsy);
2257 fx = rect->
xmin + zoomx * (pts[
i].
h2_loc[0] - offsx);
2258 fy = rect->
ymin + zoomy * (pts[
i].
h2_loc[1] - offsy);
2269 if (segments_len > 0 && pts) {
2273 for (
int i = 0;
i < segments_len;
i++) {
2274 fx = rect->
xmin + zoomx * (pts[
i].
x - offsx);
2275 fy = rect->
ymin + zoomy * (pts[
i].
y - offsy);
2283 GPU_scissor(scissor[0], scissor[1], scissor[2], scissor[3]);
2323 const rcti scissor_region = {0, region->
winx, 0, region->
winy};
2331 const float color[4] = {0.7f, 0.3f, 0.3f, 0.3f};
2333 rctf disabled_rect{};
2334 disabled_rect.
xmin = rect.
xmin - 1;
2335 disabled_rect.
xmax = rect.
xmax + 1;
2337 disabled_rect.
ymax = rect.
ymax + 1;
2380 if (width > 0 && height > 0) {
2382 float col_sel[4], col_outline[4];
2385 const float color[4] = {0.0f, 0.0f, 0.0f, 0.3f};
2401 blender::gpu::TextureFormat::UNORM_8_8_8_8,
2414 format,
"pos", blender::gpu::VertAttrType::SFLOAT_32_32);
2416 format,
"color", blender::gpu::VertAttrType::SFLOAT_32_32_32_32);
2424 const float pos_sel[8] = {-10.0f, -7.0f, -4.0f, -1.0f, 2.0f, 5.0f, 8.0f, 11.0f};
2425 for (
int axe = 0; axe < 2; axe++) {
2426 for (
int i = 0;
i < 7;
i++) {
2427 const float x1 = pos_sel[
i] * (1 - axe);
2428 const float y1 = pos_sel[
i] * axe;
2429 const float x2 = pos_sel[
i + 1] * (1 - axe);
2430 const float y2 = pos_sel[
i + 1] * axe;
2454 const float color[4] = {0.0f, 0.0f, 0.0f, 0.3f};
2475 const rctf *rct,
const float radius,
const float width,
const float aspect,
const float alpha)
2477 if (width == 0.0f) {
2482 const float clamped_aspect =
smoothminf(aspect, 1.0f, 0.5f);
2483 const float shadow_width = width * clamped_aspect;
2486 const float inner_radius =
max_ff(radius -
U.pixelsize, 0.0);
2487 const float shadow_radius = radius + shadow_width -
U.pixelsize;
2499 widget_params.
rect.
ymax = rct->
ymax + shadow_width - shadow_offset;
2500 widget_params.
radi = inner_radius;
2501 widget_params.
rad = shadow_radius;
void immDrawPixelsTexTiled(IMMDrawPixelsTexState *state, float x, float y, int img_w, int img_h, blender::gpu::TextureFormat 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()
#define BLI_assert_msg(a, msg)
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])
MINLINE void rgba_uchar_to_float(float r_col[4], const unsigned char col_ub[4])
void rgb_to_yuv(float r, float g, float b, float *r_y, float *r_u, float *r_v, int colorspace)
void yuv_to_rgb(float y, float u, float v, float *r_r, float *r_g, float *r_b, int colorspace)
void unit_m3(float m[3][3])
MINLINE void copy_v4_fl4(float v[4], float x, float y, float z, float w)
MINLINE void mul_v2_fl(float r[2], float f)
MINLINE void copy_v3_v3(float r[3], const float a[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_UTF8(dst, format,...)
#define ARRAY_SET_ITEMS(...)
@ CUMA_EXTEND_EXTRAPOLATE
@ SCOPES_WAVEFRM_YCC_JPEG
@ SCOPES_WAVEFRM_RGB_PARADE
#define SCOPES_VEC_U_SCALE
#define SCOPES_VEC_V_SCALE
#define GPU_batch_uniform_1f(batch, name, x)
void GPU_batch_discard(blender::gpu::Batch *batch)
#define GPU_batch_uniformbuf_bind(batch, name, ubo)
void GPU_batch_program_set_builtin(blender::gpu::Batch *batch, GPUBuiltinShader shader_id)
#define GPU_batch_uniform_4fv_array(batch, name, len, val)
blender::gpu::Batch * GPU_batch_create_ex(GPUPrimType primitive_type, blender::gpu::VertBuf *vertex_buf, blender::gpu::IndexBuf *index_buf, GPUBatchFlag owns_flag)
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()
static constexpr int 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_2D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_AA
@ GPU_SHADER_3D_POINT_FLAT_COLOR
@ GPU_SHADER_3D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_AA
@ 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_line_width(float width)
void GPU_line_smooth(bool enable)
@ GPU_BLEND_ALPHA_PREMULT
void GPU_face_culling(GPUFaceCullTest culling)
void GPU_blend(GPUBlend blend)
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)
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)
static blender::gpu::VertBuf * GPU_vertbuf_create_with_format(const GPUVertFormat &format)
void GPU_vertbuf_data_alloc(blender::gpu::VertBuf &verts, uint v_len)
static double angle(const Eigen::Vector3d &v1, const Eigen::Vector3d &v2)
BLI_INLINE float IMB_colormanagement_get_luminance(const float rgb[3])
void IMB_colormanagement_scene_linear_to_display_v3(float pixel[3], const ColorManagedDisplay *display, const ColorManagedDisplaySpace display_space=DISPLAY_SPACE_DRAW)
void IMB_byte_from_float(ImBuf *ibuf)
void IMB_freeImBuf(ImBuf *ibuf)
bool IMB_scale(ImBuf *ibuf, unsigned int newx, unsigned int newy, IMBScaleFilter filter, bool threaded=true)
Read Guarded memory(de)allocation.
#define UI_ALPHA_CHECKER_LIGHT
#define UI_ALPHA_CHECKER_DARK
blender::ocio::Display ColorManagedDisplay
void UI_GetThemeColor3ubv(int colorid, unsigned char col[3])
void UI_GetThemeColor4fv(int colorid, float col[4])
BMesh const char void * data
ATTR_WARN_UNUSED_RESULT const BMVert * v2
ATTR_WARN_UNUSED_RESULT const BMVert * v
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
struct @021025263243242147216143265077100330027142264337::@225245033123204053237120173316075113304004012000 batch
VecBase< float, D > step(VecOp< float, D >, VecOp< float, D >) RET
const ColorManagedDisplay * ui_block_cm_display_get(uiBlock *block)
void ui_but_v3_get(uiBut *but, float vec[3])
#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 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)
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 ui_draw_colorband_handle_tri(uint pos, float x1, float y1, float halfwidth)
static void draw_scope_end(const rctf *rect)
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)
void ui_draw_but_WAVEFORM(ARegion *region, uiBut *but, const uiWidgetColors *, const rcti *recti)
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)
void ui_draw_but_HISTOGRAM(ARegion *region, uiBut *but, const uiWidgetColors *, const rcti *recti)
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_colorband_handle(uint shdr_pos, const rcti *rect, float x, const float rgb[3], const ColorManagedDisplay *display, bool active)
void ui_draw_but_TRACKPREVIEW(ARegion *region, uiBut *but, const uiWidgetColors *, const rcti *recti)
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_VECTORSCOPE(ARegion *region, uiBut *but, const uiWidgetColors *, const rcti *recti)
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, const ColorManagedDisplay *display)
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)
VecBase< float, 4 > float4
VecBase< float, 2 > float2
CurveProfilePoint * table
CurveProfilePoint * segments
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