69int draw_roundbox_corner_get()
76 const float inner1[4],
77 const float inner2[4],
79 const float outline[4],
90 widget_params.
rect = *rect;
91 widget_params.
radi = rad;
92 widget_params.
rad = rad;
97 widget_params.
color_inner1[0] = inner1 ? inner1[0] : 0.0f;
98 widget_params.
color_inner1[1] = inner1 ? inner1[1] : 0.0f;
99 widget_params.
color_inner1[2] = inner1 ? inner1[2] : 0.0f;
100 widget_params.
color_inner1[3] = inner1 ? inner1[3] : 0.0f;
101 widget_params.
color_inner2[0] = inner2 ? inner2[0] : inner1 ? inner1[0] : 0.0f;
102 widget_params.
color_inner2[1] = inner2 ? inner2[1] : inner1 ? inner1[1] : 0.0f;
103 widget_params.
color_inner2[2] = inner2 ? inner2[2] : inner1 ? inner1[2] : 0.0f;
104 widget_params.
color_inner2[3] = inner2 ? inner2[3] : inner1 ? inner1[3] : 0.0f;
105 widget_params.
color_outline[0] = outline ? outline[0] : inner1 ? inner1[0] : 0.0f;
106 widget_params.
color_outline[1] = outline ? outline[1] : inner1 ? inner1[1] : 0.0f;
107 widget_params.
color_outline[2] = outline ? outline[2] : inner1 ? inner1[2] : 0.0f;
108 widget_params.
color_outline[3] = outline ? outline[3] : inner1 ? inner1[3] : 0.0f;
122 const rctf *rect,
bool filled,
float rad,
const uchar col[3],
uchar alpha)
124 const float colv[4] = {
125 float(col[0]) / 255.0f,
126 float(col[1]) / 255.0f,
127 float(col[2]) / 255.0f,
128 float(alpha) / 255.0f,
134 const rctf *rect,
bool filled,
float rad,
const float col[3],
float alpha)
136 const float colv[4] = {col[0], col[1], col[2], alpha};
169 for (
int a = 0; a < 4; a++) {
180 for (
int a = 0; a < 4; a++) {
191 for (
int a = 0; a < 4; a++) {
202 for (
int a = 0; a < 4; a++) {
213 for (
int a = 0; a < 4; a++) {
225 const int ofs_y = 4 *
U.pixelsize;
233 immRectf(pos, pos_x, pos_y - ofs_y, pos_x +
len, pos_y - ofs_y + (height *
U.pixelsize));
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++) {
272 immVertex2f(pos, minx + vec[a][1], maxy - rad + vec[a][0]);
283 for (a = 0; a < 4; a++) {
284 immVertex2f(pos, maxx - rad + vec[a][0], maxy - vec[a][1]);
297 for (a = 0; a < 4; a++) {
298 immVertex2f(pos, maxx - vec[a][1], miny + rad - vec[a][0]);
309 for (a = 0; a < 4; a++) {
310 immVertex2f(pos, minx + rad - vec[a][0], miny + vec[a][1]);
338 if (!ibuf || ibuf->
x <= 0 || ibuf->
y <= 0) {
358 const bool use_filter = (
w != ibuf->
x || h != ibuf->
y);
360 float col[4] = {1.0f, 1.0f, 1.0f, 1.0f};
361 if (but->
col[3] != 0) {
371 gpu::TextureFormat::UNORM_8_8_8_8,
382 GPU_scissor(scissor[0], scissor[1], scissor[2], scissor[3]);
390 const float title_aspect[2],
391 const float action_aspect[2])
393 const float size_x_half = (rect->
xmax - rect->
xmin) * 0.5f;
394 const float size_y_half = (rect->
ymax - rect->
ymin) * 0.5f;
396 const float *safe_areas[] = {title_aspect, action_aspect};
399 for (
int i = 0; i < safe_len; i++) {
400 if (safe_areas[i][0] || safe_areas[i][1]) {
401 const float margin_x = safe_areas[i][0] * size_x_half;
402 const float margin_y = safe_areas[i][1] * size_y_half;
404 const float minx = rect->
xmin + margin_x;
405 const float miny = rect->
ymin + margin_y;
406 const float maxx = rect->
xmax - margin_x;
407 const float maxy = rect->
ymax - margin_y;
420 const float color[4] = {0.0f, 0.0f, 0.0f, 0.5f};
442 const float color[4] = {r, g,
b, alpha};
459 for (
int i = 0; i < res; i++) {
460 const float x2 =
x + i * (
w /
float(res));
472 for (
int i = 1; i < res; i++) {
473 const float x2 =
x + i * (
w /
float(res));
484 for (
int i = 0; i < res; i++) {
485 const float x2 =
x + i * (
w /
float(res));
494#define HISTOGRAM_TOT_GRID_LINES 4
516 const float color[4] = {0.0f, 0.0f, 0.0f, 1.0f};
534 const rcti scissor_region = {0, region->
winx, 0, region->
winy};
570 1.0, 1.0, 1.0, 0.75, rect.
xmin, rect.
ymin,
w, h, hist->
data_luma, res, is_line, pos);
574 1.0, 1.0, 1.0, 0.75, rect.
xmin, rect.
ymin,
w, h, hist->
data_a, res, is_line, pos);
579 1.0, 0.0, 0.0, 0.75, rect.
xmin, rect.
ymin,
w, h, hist->
data_r, res, is_line, pos);
583 0.0, 1.0, 0.0, 0.75, rect.
xmin, rect.
ymin,
w, h, hist->
data_g, res, is_line, pos);
587 0.0, 0.0, 1.0, 0.75, rect.
xmin, rect.
ymin,
w, h, hist->
data_b, res, is_line, pos);
601#undef HISTOGRAM_TOT_GRID_LINES
607 "It is not allowed to draw a batch when immediate mode has a shader bound. It will "
608 "use the incorrect shader and is hard to discover.");
612 gpu::VertBuf *vbo = GPU_vertbuf_create_with_format(format);
642 gpu::VertBuf *vbo = GPU_vertbuf_create_with_format(format);
646 for (
int i = 0; i < waveform_num; i++) {
647 memcpy(
reinterpret_cast<void *
>(&
data->pos), waveform,
sizeof(
data->pos));
648 memcpy(
reinterpret_cast<void *
>(&
data->color), col,
sizeof(
float) * 3);
649 data->color.w = alpha;
669 &format,
"color", gpu::VertAttrType::SFLOAT_32_32_32_32);
671 gpu::VertBuf *vbo = GPU_vertbuf_create_with_format(format);
693 const float colorsycc[3][3] = {{1, 0, 1}, {1, 1, 0}, {0, 1, 1}};
695 float colors_alpha[3][3], colorsycc_alpha[3][3];
698 if (scopes ==
nullptr) {
714 const float w3 =
w / 3.0f;
721 for (
int c = 0; c < 3; c++) {
722 for (
int i = 0; i < 3; i++) {
723 colors_alpha[c][i] = colors[c][i] * alpha;
724 colorsycc_alpha[c][i] = colorsycc[c][i] * alpha;
733 const float color[4] = {0.0f, 0.0f, 0.0f, 1.0f};
749 const rcti scissor_region = {0, region->
winx, 0, region->
winy};
766 for (
int i = 1; i < scope_info.
graticules.size(); i++) {
767 min_gap = std::min(min_gap,
770 font_size = std::min(font_size, min_gap * h * 0.8f);
774 struct GraticuleLine {
780 const float y = yofs + graticule.
value * h;
781 const size_t label_len = strlen(graticule.
label);
783 float text_width, text_height;
785 const float gap = text_width + text_height;
787 BLF_position(font_id, rect.
xmin + (gap - text_width) * 0.5f,
y - text_height * 0.5f, 0);
808 for (
const GraticuleLine &line : grid_lines) {
853 const float col[3] = {alpha, alpha, alpha};
919 for (
int c = 0; c < 3; c++) {
921 immUniformColor3f(colors[c][0] * 0.75f, colors[c][1] * 0.75f, colors[c][2] * 0.75f);
925 colorsycc[c][0] * 0.75f, colorsycc[c][1] * 0.75f, colorsycc[c][2] * 0.75f);
954 return center + diam * ampli *
cosf(
angle);
959 return center + diam * ampli *
sinf(
angle);
970 float tangle = 0.0f, tampli;
971 float dangle, dampli;
972 const char labelstr[2] = {label,
'\0'};
974 const float3 yuv = yuv_matrix *
float3(colf[0], colf[1], colf[2]);
975 const float u = yuv.y;
976 const float v = yuv.z;
978 if (u > 0 &&
v >= 0) {
981 else if (u > 0 &&
v < 0) {
987 else if (u == 0 &&
v > 0.0f) {
990 else if (u == 0 &&
v < 0.0f) {
998 dampli = 2.5f / 200.0f;
1001 polar_to_x(centerx, diam, tampli + dampli, tangle + dangle),
1002 polar_to_y(centery, diam, tampli + dampli, tangle + dangle));
1004 polar_to_x(centerx, diam, tampli - dampli, tangle + dangle),
1005 polar_to_y(centery, diam, tampli - dampli, tangle + dangle));
1007 polar_to_x(centerx, diam, tampli - dampli, tangle - dangle),
1008 polar_to_y(centery, diam, tampli - dampli, tangle - dangle));
1010 polar_to_x(centerx, diam, tampli + dampli, tangle - dangle),
1011 polar_to_y(centery, diam, tampli + dampli, tangle - dangle));
1030 const float skin_rad =
DEG2RADF(123.0f);
1039 const float colors[6][3] = {
1048 const char color_names[] = {
'R',
'Y',
'G',
'C',
'B',
'M'};
1058 const float centerx = rect.
xmin +
w * 0.5f;
1059 const float centery = rect.
ymin + h * 0.5f;
1060 const float diam = ((
w < h) ?
w : h) * 0.9f;
1067 const float color[4] = {0.0f, 0.0f, 0.0f, 1.0f};
1084 const rcti scissor_region = {0, region->
winx, 0, region->
winy};
1096 const int increment = 6;
1097 const int tot_points = int(360 / increment);
1098 const float r = 0.5f;
1099 float step = 360.0f / (tot_points - 1);
1101 float circle_fill_points[(tot_points * 2) + 2];
1102 float circle_fill_vertex_colors[(tot_points * 4) + 4];
1107 circle_fill_points[0] = centerx;
1108 circle_fill_points[1] = centery;
1109 circle_fill_vertex_colors[0] = 0.2f;
1110 circle_fill_vertex_colors[1] = 0.2f;
1111 circle_fill_vertex_colors[2] = 0.2f;
1112 circle_fill_vertex_colors[3] = 0.8f;
1114 for (
int i = 0; i < tot_points; i++) {
1121 circle_fill_points[(i + 1) * 2] =
x;
1122 circle_fill_points[(i + 1) * 2 + 1] =
y;
1124 const float cb = (
x - centerx) / diam;
1125 const float cr = (
y - centery) / diam;
1126 const float3 rgb = inv_yuv_to_rec709 *
float3(0.5f, cb, cr);
1128 circle_fill_vertex_colors[(i + 1) * 4] = rgb.x * 0.2f;
1129 circle_fill_vertex_colors[(i + 1) * 4 + 1] = rgb.y * 0.2f;
1130 circle_fill_vertex_colors[(i + 1) * 4 + 2] = rgb.z * 0.2f;
1131 circle_fill_vertex_colors[(i + 1) * 4 + 3] = 0.8f;
1136 circle_fill_points, tot_points + 1, circle_fill_vertex_colors,
GPU_PRIM_TRI_FAN);
1145 for (
int i = 0; i <= 360; i += increment) {
1146 const float a =
DEG2RADF(
float(i));
1153 float circle_points[(tot_points * 2) + 3] = {};
1154 float circle_vertex_colors[(tot_points * 4) + 5] = {};
1156 for (
int i = 0; i < tot_points; i++) {
1160 const float x =
polar_to_x(centerx, diam, 0.5f, a);
1161 const float y =
polar_to_y(centery, diam, 0.5f, a);
1162 circle_points[i * 2] =
x;
1163 circle_points[i * 2 + 1] =
y;
1165 const float cb = (
x - centerx) / diam;
1166 const float cr = (
y - centery) / diam;
1167 const float3 ring_rgb = inv_yuv_to_rec709 *
float3(0.5f, cb, cr);
1169 circle_vertex_colors[i * 4] = ring_rgb.x;
1170 circle_vertex_colors[i * 4 + 1] = ring_rgb.y;
1171 circle_vertex_colors[i * 4 + 2] = ring_rgb.z;
1172 circle_vertex_colors[i * 4 + 3] = 0.8f;
1182 for (
int j = 0; j < 4; j++) {
1183 float inner_circle_points[(tot_points * 2) + 3] = {};
1184 float inner_circle_colors[(tot_points * 4) + 5] = {};
1185 const float r = (j + 1) * 0.1f;
1187 for (
int i = 0; i < tot_points; i++) {
1191 inner_circle_points[i * 2] =
polar_to_x(centerx, diam, r, a);
1192 inner_circle_points[i * 2 + 1] =
polar_to_y(centery, diam, r, a);
1194 inner_circle_colors[i * 4] = 0.1f;
1195 inner_circle_colors[i * 4 + 1] = 0.1f;
1196 inner_circle_colors[i * 4 + 2] = 0.1f;
1197 inner_circle_colors[i * 4 + 3] = 0.8f;
1207 immVertex2f(pos, centerx - (diam * 0.5f) - 5, centery);
1208 immVertex2f(pos, centerx + (diam * 0.5f) + 5, centery);
1210 immVertex2f(pos, centerx, centery - (diam * 0.5f) - 5);
1211 immVertex2f(pos, centerx, centery + (diam * 0.5f) + 5);
1227 for (
int i = 0; i < 6; i++) {
1231 if (scopes->
ok && scopes->
vecscope !=
nullptr) {
1239 const float col[3] = {alpha, alpha, alpha};
1293 float colf[3] = {
UNPACK3(rgb)};
1295 const float half_width = sizey / 3.5f;
1296 const float height = half_width * 1.4f;
1298 float y1 = rect->
ymin;
1299 const float y2 = rect->
ymax;
1307 float line_width = std::max(std::min(
U.pixelsize / 5.0f *
fabs(half_width - 4.0f),
U.pixelsize),
1311 uchar alpha = std::min(
int(
fabs(half_width - 2.0f) * 50.0f), 255);
1315 float viewport_size[4];
1320 immUniform4f(
"color", 1.0f, 1.0f, 1.0f, alpha / 255.0f);
1321 immUniform4f(
"color2", 0.0f, 0.0f, 0.0f, alpha / 255.0f);
1324 immUniform4f(
"color", 0.7f, 0.7f, 0.7f, alpha / 255.0f);
1325 immUniform4f(
"color2", 0.4f, 0.4f, 0.4f, alpha / 255.0f);
1340 y1 -= half_width / 2.0f;
1346 x - half_width - line_width,
1348 x + half_width + line_width,
1362 x - (half_width - line_width),
1364 x + (half_width - line_width),
1365 y1 + height - line_width);
1391 uint pos_id, col_id;
1397 if (coba ==
nullptr) {
1401 const float x1 = rect->
xmin +
U.pixelsize;
1402 const float sizex = rect->
xmax - x1 -
U.pixelsize;
1403 const float y1 = rect->
ymin +
U.pixelsize;
1404 const float sizey = rect->
ymax - y1 -
U.pixelsize;
1405 const float sizey_solid = sizey * 0.25f;
1431 immUniform4f(
"color1", checker_dark, checker_dark, checker_dark, 1.0f);
1432 immUniform4f(
"color2", checker_light, checker_light, checker_light, 1.0f);
1434 immRectf(pos_id, x1, y1, x1 + sizex, y1 + sizey);
1446 float colf[4] = {0, 0, 0, 0};
1448 v1[1] = y1 + sizey_solid;
1452 for (
int a = 0; a <= sizex; a++) {
1453 const float pos =
float(a) / sizex;
1459 v1[0] =
v2[0] = x1 + a;
1469 v2[1] = y1 + sizey_solid;
1472 for (
int a = 0; a <= sizex; a++) {
1473 const float pos =
float(a) / sizex;
1479 v1[0] =
v2[0] = x1 + a;
1481 immAttr4f(col_id, colf[0], colf[1], colf[2], 1.0f);
1494 for (
int a = 0; a < coba->
tot; a++, cbd++) {
1495 if (a != coba->
cur) {
1496 const float pos = x1 + cbd->
pos * (sizex - 1) + 1;
1502 if (coba->
tot != 0) {
1504 const float pos = x1 + cbd->
pos * (sizex - 1) + 1;
1515 const float diffuse[3] = {1.0f, 1.0f, 1.0f};
1536 const bool use_project_matrix = (size >= -GPU_MATRIX_ORTHO_CLIP_NEAR_DEFAULT);
1537 if (use_project_matrix) {
1573 if (use_project_matrix) {
1587 const float offset_x,
1588 const float offset_y,
1591 const float start_x = (
ceilf(offset_x /
step) *
step - offset_x) * zoom_x + rect->
xmin;
1592 const float start_y = (
ceilf(offset_y /
step) *
step - offset_y) * zoom_y + rect->
ymin;
1594 const int line_count_x =
ceilf((rect->
xmax - start_x) / (
step * zoom_x));
1595 const int line_count_y =
ceilf((rect->
ymax - start_y) / (
step * zoom_y));
1597 if (line_count_x + line_count_y == 0) {
1602 for (
int i = 0; i < line_count_x; i++) {
1603 const float x = start_x + i *
step * zoom_x;
1607 for (
int i = 0; i < line_count_y; i++) {
1608 const float y = start_y + i *
step * zoom_y;
1623 const float fade_factor_float = inactive ? 0.33f : 1.0f;
1624 const uchar fade_factor_uchar = inactive ? 3 : 1;
1630 if (clip_size_x == 0.0f || clip_size_y == 0.0f) {
1637 const float offsx = cumap->
curr.
xmin - (1.0f / zoomx);
1638 const float offsy = cumap->
curr.
ymin - (1.0f / zoomy);
1641 if (zoomx <= 0.0f) {
1666 const rcti scissor_region = {0, region->
winx, 0, region->
winy};
1677 const float col[3] = {0.0f, 0.0f, 0.0f};
1680 grid.
xmin = rect->
xmin + zoomx * (-offsx);
1682 grid.
ymin = rect->
ymin + zoomy * (-offsy);
1696 float color_backdrop[4] = {0, 0, 0, 1};
1732 uchar col_axis_x[3], col_axis_y[3];
1775 else if (cumap->
cur == 3) {
1783 if (cumap->
cur == 0) {
1786 else if (cumap->
cur == 1) {
1800 if (cuma->
table ==
nullptr) {
1810 line_range.
ymin = rect->
ymin + zoomy * (cmp[0].
y - offsy);
1813 line_range.
xmin = rect->
xmin + zoomx * (cmp[0].
x - offsx + cuma->
ext_in[0]);
1814 line_range.
ymin = rect->
ymin + zoomy * (cmp[0].
y - offsy + cuma->
ext_in[1]);
1834 for (
int a = 0; a <=
CM_TABLE; a++) {
1835 const float fx = rect->
xmin + zoomx * (cmp[a].
x - offsx);
1836 const float fy = rect->
ymin + zoomy * (cmp[a].
y - offsy);
1850 for (
int a = 0; a <=
CM_TABLE; a++) {
1851 const float fx = rect->
xmin + zoomx * (cmp[a].
x - offsx);
1852 const float fy = rect->
ymin + zoomy * (cmp[a].
y - offsy);
1870 float color_point[4], color_point_select[4], color_point_active[4], color_point_outline[4];
1875 color_point[3] = fade_factor_float;
1876 color_point_select[3] = fade_factor_float;
1877 color_point_active[3] = fade_factor_float;
1878 color_point_outline[3] *= fade_factor_float;
1887 for (
int i = 0; i < cuma->
totpoint; i++) {
1898 rcti scissor_for_points;
1899 scissor_for_points.
xmin = std::max(
1901 scissor_for_points.
ymin = std::max(
1903 scissor_for_points.
xmax = std::max(
1905 scissor_for_points.
ymax = std::max(
1909 scissor_for_points.
ymin,
1916 if ((cuma->
totpoint - selected) > 0) {
1921 for (
int a = 0; a < cuma->
totpoint; a++) {
1925 const float fx = rect->
xmin + zoomx * (cmp[a].
x - offsx);
1926 const float fy = rect->
ymin + zoomy * (cmp[a].
y - offsy);
1935 for (
int a = 0; a < cuma->
totpoint; a++) {
1939 const float fx = rect->
xmin + zoomx * (cmp[a].
x - offsx);
1940 const float fy = rect->
ymin + zoomy * (cmp[a].
y - offsy);
1947 if ((cuma->
totpoint - selected) > 0) {
1952 for (
int a = 0; a < cuma->
totpoint; a++) {
1956 const float fx = rect->
xmin + zoomx * (cmp[a].
x - offsx);
1957 const float fy = rect->
ymin + zoomy * (cmp[a].
y - offsy);
1968 for (
int a = 0; a < cuma->
totpoint; a++) {
1972 const float fx = rect->
xmin + zoomx * (cmp[a].
x - offsx);
1973 const float fy = rect->
ymin + zoomy * (cmp[a].
y - offsy);
1984 const float fx = rect->
xmin + zoomx * (cmp[active].
x - offsx);
1985 const float fy = rect->
ymin + zoomy * (cmp[active].
y - offsy);
2000 GPU_scissor(scissor[0], scissor[1], scissor[2], scissor[3]);
2028 const float offsx = profile->
view_rect.
xmin - (1.0f / zoomx);
2029 const float offsy = profile->
view_rect.
ymin - (1.0f / zoomy);
2032 if (zoomx <= 0.0f) {
2054 const rcti scissor_region = {0, region->
winx, 0, region->
winy};
2092 if (profile->
table ==
nullptr) {
2100 const uint tot_triangles = tot_points - 2;
2106 table_coords[i][0] = pts[i].
x;
2107 table_coords[i][1] = pts[i].
y;
2112 if (add_left_tri && add_bottom_tri) {
2114 table_coords[tot_points - 3][0] = profile->
view_rect.
xmin - 1.0f;
2115 table_coords[tot_points - 3][1] = 1.0f;
2116 table_coords[tot_points - 2][0] = profile->
view_rect.
xmin - 1.0f;
2117 table_coords[tot_points - 2][1] = profile->
view_rect.
ymin - 1.0f;
2118 table_coords[tot_points - 1][0] = 1.0f;
2119 table_coords[tot_points - 1][1] = profile->
view_rect.
ymin - 1.0f;
2121 else if (add_left_tri) {
2123 table_coords[tot_points - 2][0] = profile->
view_rect.
xmin - 1.0f;
2124 table_coords[tot_points - 2][1] = 1.0f;
2125 table_coords[tot_points - 1][0] = profile->
view_rect.
xmin - 1.0f;
2126 table_coords[tot_points - 1][1] = -1.0f;
2128 else if (add_bottom_tri) {
2130 table_coords[tot_points - 2][0] = -1.0f;
2131 table_coords[tot_points - 2][1] = profile->
view_rect.
ymin - 1.0f;
2132 table_coords[tot_points - 1][0] = 1.0f;
2133 table_coords[tot_points - 1][1] = profile->
view_rect.
ymin - 1.0f;
2137 table_coords[tot_points - 1][0] = -1.0f;
2138 table_coords[tot_points - 1][1] = -1.0f;
2142 if (tot_triangles > 0) {
2151 for (
uint i = 0; i < tot_triangles; i++) {
2152 const uint *tri = tri_indices[i];
2153 for (
uint j = 0; j < 3; j++) {
2154 fx = rect->
xmin + zoomx * (table_coords[tri[j]][0] - offsx);
2155 fy = rect->
ymin + zoomy * (table_coords[tri[j]][1] - offsy);
2160 MEM_delete(tri_indices);
2164 tot_points -= (add_left_tri + add_left_tri);
2165 const int edges_len = tot_points - 1;
2166 if (edges_len > 0) {
2171 for (
int i = 0; i < tot_points; i++) {
2172 fx = rect->
xmin + zoomx * (table_coords[i][0] - offsx);
2173 fy = rect->
ymin + zoomy * (table_coords[i][1] - offsy);
2179 MEM_SAFE_DELETE(table_coords);
2182 pts = profile->
path;
2183 const int path_len = tot_points =
uint(profile->
path_len);
2184 int selected_free_points = 0;
2185 for (
int i = 0; i < path_len; i++) {
2187 selected_free_points++;
2191 if (selected_free_points > 0) {
2197 for (
int i = 0; i < path_len; i++) {
2199 ptx = rect->
xmin + zoomx * (pts[i].
x - offsx);
2200 pty = rect->
ymin + zoomy * (pts[i].
y - offsy);
2202 fx = rect->
xmin + zoomx * (pts[i].
h1_loc[0] - offsx);
2203 fy = rect->
ymin + zoomy * (pts[i].
h1_loc[1] - offsy);
2207 fx = rect->
xmin + zoomx * (pts[i].
h2_loc[0] - offsx);
2208 fy = rect->
ymin + zoomy * (pts[i].
h2_loc[1] - offsy);
2224 float color_point[4], color_point_select[4], color_point_active[4], color_sample[4];
2228 color_point[3] = 1.0f;
2229 color_point_select[3] = 1.0f;
2230 color_point_active[3] = 1.0f;
2231 color_sample[0] =
float(wcol->
item[0]) / 255.0f;
2232 color_sample[1] =
float(wcol->
item[1]) / 255.0f;
2233 color_sample[2] =
float(wcol->
item[2]) / 255.0f;
2234 color_sample[3] =
float(wcol->
item[3]) / 255.0f;
2238 for (
int i = 0; i < path_len; i++) {
2252 rcti scissor_for_points;
2253 scissor_for_points.
xmin = std::max(
2257 scissor_for_points.
ymin = std::max(
2261 scissor_for_points.
xmax = std::max(
2265 scissor_for_points.
ymax = std::max(
2271 scissor_for_points.
ymin,
2278 if ((path_len - selected) > 0) {
2283 for (
int i = 0; i < path_len; i++) {
2287 fx = rect->
xmin + zoomx * (pts[i].
x - offsx);
2288 fy = rect->
ymin + zoomy * (pts[i].
y - offsy);
2298 for (
int i = 0; i < path_len; i++) {
2302 fx = rect->
xmin + zoomx * (pts[i].
x - offsx);
2303 fy = rect->
ymin + zoomy * (pts[i].
y - offsy);
2311 for (
int i = 0; i < path_len; i++) {
2322 if (((selected_free_points * 2) - selected) > 0) {
2327 for (
int i = 0; i < path_len; i++) {
2330 fx = rect->
xmin + zoomx * (pts[i].
h1_loc[0] - offsx);
2331 fy = rect->
ymin + zoomy * (pts[i].
h1_loc[1] - offsy);
2335 fx = rect->
xmin + zoomx * (pts[i].
h2_loc[0] - offsx);
2336 fy = rect->
ymin + zoomy * (pts[i].
h2_loc[1] - offsy);
2349 for (
int i = 0; i < path_len; i++) {
2352 fx = rect->
xmin + zoomx * (pts[i].
h1_loc[0] - offsx);
2353 fy = rect->
ymin + zoomy * (pts[i].
h1_loc[1] - offsy);
2357 fx = rect->
xmin + zoomx * (pts[i].
h2_loc[0] - offsx);
2358 fy = rect->
ymin + zoomy * (pts[i].
h2_loc[1] - offsy);
2373 fx = rect->
xmin + zoomx * (pts[active].
h1_loc[0] - offsx);
2374 fy = rect->
ymin + zoomy * (pts[active].
h1_loc[1] - offsy);
2377 fx = rect->
xmin + zoomx * (pts[active].
h2_loc[0] - offsx);
2378 fy = rect->
ymin + zoomy * (pts[active].
h2_loc[1] - offsy);
2381 fx = rect->
xmin + zoomx * (pts[active].
x - offsx);
2382 fy = rect->
ymin + zoomy * (pts[active].
y - offsy);
2391 if (segments_len > 0 && pts) {
2395 for (
int i = 0; i < segments_len; i++) {
2396 fx = rect->
xmin + zoomx * (pts[i].
x - offsx);
2397 fy = rect->
ymin + zoomy * (pts[i].
y - offsy);
2411 GPU_scissor(scissor[0], scissor[1], scissor[2], scissor[3]);
2443 const rcti scissor_region = {0, region->
winx, 0, region->
winy};
2452 const float color[4] = {0.7f, 0.3f, 0.3f, 0.3f};
2454 rctf disabled_rect{};
2455 disabled_rect.
xmin = rect.
xmin - 1;
2456 disabled_rect.
xmax = rect.
xmax + 1;
2458 disabled_rect.
ymax = rect.
ymax + 1;
2501 if (width > 0 && height > 0) {
2503 float col_sel[4], col_outline[4];
2506 const float color[4] = {0.0f, 0.0f, 0.0f, 0.3f};
2521 gpu::TextureFormat::UNORM_8_8_8_8,
2535 format,
"color", gpu::VertAttrType::SFLOAT_32_32_32_32);
2543 const float pos_sel[8] = {-10.0f, -7.0f, -4.0f, -1.0f, 2.0f, 5.0f, 8.0f, 11.0f};
2544 for (
int axe = 0; axe < 2; axe++) {
2545 for (
int i = 0; i < 7; i++) {
2546 const float x1 = pos_sel[i] * (1 - axe);
2547 const float y1 = pos_sel[i] * axe;
2548 const float x2 = pos_sel[i + 1] * (1 - axe);
2549 const float y2 = pos_sel[i + 1] * axe;
2573 const float color[4] = {0.0f, 0.0f, 0.0f, 0.3f};
2595 const rctf *rct,
const float radius,
const float width,
const float aspect,
const float alpha)
2597 if (width == 0.0f) {
2602 const float clamped_aspect =
smoothminf(aspect, 1.0f, 0.5f);
2603 const float shadow_width = width * clamped_aspect;
2606 const float inner_radius =
max_ff(radius -
U.pixelsize, 0.0);
2607 const float shadow_radius = radius + shadow_width -
U.pixelsize;
2619 widget_params.
rect.
ymax = rct->
ymax + shadow_width - shadow_offset;
2620 widget_params.
radi = inner_radius;
2621 widget_params.
rad = shadow_radius;
#define GPU_batch_uniform_1f(batch, name, x)
#define GPU_batch_uniformbuf_bind(batch, name, ubo)
#define GPU_batch_uniform_4fv_array(batch, name, len, val)
#define GPU_batch_uniform_4f(batch, name, x, y, z, w)
Read Blender memory allocation and freeing.
#define UI_ALPHA_CHECKER_LIGHT
#define UI_ALPHA_CHECKER_DARK
#define ARRAY_SET_ITEMS(...)
#define BLI_assert_msg(a, msg)
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
void draw(float x, float y, int img_w, int img_h, gpu::TextureFormat gpu_format, bool use_filter, const void *rect, float scale_x, float scale_y, const float color[4])
void append(const T &value)
VecBase< float, D > step(VecOp< float, D >, VecOp< float, D >) RET
#define HISTOGRAM_TOT_GRID_LINES
ccl_device_inline dual1 len(const ccl_private dual< T > &a)
ccl_device_inline dual3 fabs(const ccl_private dual3 &a)
CartesianBasis invert(const CartesianBasis &basis)
void get_color_4fv(int colorid, float col[4])
void get_color_3ubv(int colorid, unsigned char col[3])
static float polar_to_y(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)
gpu::Batch * batch_roundbox_widget_get()
void draw_but_VECTORSCOPE(const bContext *C, ARegion *region, Button *but, const uiWidgetColors *, const rcti *recti)
static float polar_to_x(float center, float diam, float ampli, float angle)
const ColorManagedDisplay * block_cm_display_get(Block *block)
void draw_but_WAVEFORM(const bContext *C, ARegion *region, Button *but, const uiWidgetColors *, const rcti *recti)
static void draw_colorband_handle_tri(uint pos, float x1, float y1, float halfwidth)
void draw_safe_areas(uint pos, const rctf *rect, const float title_aspect[2], const float action_aspect[2])
void draw_but_CURVEPROFILE(ARegion *region, Button *but, const uiWidgetColors *wcol, const rcti *rect)
void draw_dropshadow(const rctf *rct, float radius, float width, float aspect, float alpha)
void draw_but_TAB_outline(const rcti *rect, float rad, uchar highlight[3], uchar highlight_fade[3])
static void draw_colorband_handle_box(uint pos, float x1, float y1, float x2, float y2)
void draw_but_IMAGE(ARegion *, Button *but, const uiWidgetColors *, const rcti *rect)
static void 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)
static void draw_colorband_handle(uint shdr_pos, const rcti *rect, float x, const float rgb[3], const ColorManagedDisplay *display, bool active)
static void circle_draw_rgb(float *points, int tot_points, const float *col, GPUPrimType prim)
void draw_but_COLORBAND(Button *but, const uiWidgetColors *wcol, const rcti *rect)
void button_v3_get(Button *but, float vec[3])
void draw_roundbox_corner_set(int type)
void draw_but_UNITVEC(Button *but, const uiWidgetColors *wcol, const rcti *rect, const float radius)
static void waveform_draw_rgb(const float *waveform, int waveform_num, const float *col, float alpha)
void draw_but_TRACKPREVIEW(ARegion *region, Button *but, const uiWidgetColors *, const rcti *recti)
void draw_rounded_corners_inverted(const rcti &rect, const float rad, const float4 color)
void draw_roundbox_aa(const rctf *rect, bool filled, float rad, const float color[4])
void 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)
void draw_roundbox_3fv_alpha(const rctf *rect, bool filled, float rad, const float col[3], float alpha)
void draw_roundbox_3ub_alpha(const rctf *rect, bool filled, float rad, const unsigned char col[3], unsigned char alpha)
static bool point_draw_handles(CurveProfilePoint *point)
void draw_text_underline(int pos_x, int pos_y, int len, int height, const float color[4])
gpu::Batch * batch_roundbox_shadow_get()
static void draw_scope_end(const rctf *rect)
void draw_but_HISTOGRAM(ARegion *region, Button *but, const uiWidgetColors *, const rcti *recti)
static void waveform_draw_one(const float *waveform, int waveform_num, const float col[3])
static void vectorscope_draw_target(uint pos, float centerx, float centery, float diam, const float colf[3], char label, const float3x3 &yuv_matrix)
void draw_roundbox_4fv(const rctf *rect, bool filled, float rad, const float col[4])
void draw_gradient(const rcti *rect, const float hsv[3], eButGradientType type, float alpha, const ColorManagedDisplay *display)
void draw_but_CURVE(ARegion *region, Button *but, const uiWidgetColors *wcol, const rcti *rect)
MINLINE float min_ff(float a, float b)
void GPU_vertbuf_tag_dirty(gpu::VertBuf *verts)
void GPU_scissor_test(bool enable)
MINLINE void rgba_uchar_to_float(float r_col[4], const unsigned char col_ub[4])
void immAttr4f(uint attr_id, float x, float y, float z, float w)
gpu::Batch * GPU_batch_create_ex(GPUPrimType primitive_type, gpu::VertBuf *vertex_buf, gpu::IndexBuf *index_buf, GPUBatchFlag owns_flag)
void linearrgb_to_srgb_v3_v3(float srgb[3], const float linear[3])
void BLF_position(int fontid, float x, float y, float z)
void GPU_matrix_scale_1f(float factor)
void immUniformColor3f(float r, float g, float b)
void BLF_batch_draw_flush()
MINLINE void copy_v3_v3(float r[3], const float a[3])
void GPU_polygon_smooth(bool enable)
void * MEM_new_array_uninitialized(size_t len, size_t size, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1
void GPU_uniformbuf_free(gpu::UniformBuf *ubo)
void immUniformColor4ub(unsigned char r, unsigned char g, unsigned char b, unsigned char a)
bool BLI_rcti_isect(const struct rcti *src1, const struct rcti *src2, struct rcti *dest)
MINLINE void mul_v2_fl(float r[2], float f)
void immUniform2f(const char *name, float x, float y)
void immBeginAtMost(GPUPrimType, uint max_vertex_len)
GPUVertFormat * immVertexFormat()
void BLI_polyfill_calc(const float(*coords)[2], unsigned int coords_num, int coords_sign, unsigned int(*r_tris)[3])
void GPU_point_size(float size)
void GPU_matrix_ortho_set_z(float near, float far)
void rgb_to_hsv_v(const float rgb[3], float r_hsv[3])
void immBegin(GPUPrimType, uint vertex_len)
void GPU_line_smooth(bool enable)
@ SCOPES_WAVEFRM_RGB_PARADE
@ SCOPES_WAVEFRM_YCC_JPEG
void GPU_batch_discard(gpu::Batch *batch)
void GPU_vertbuf_use(gpu::VertBuf *)
bool BKE_colorband_evaluate(const ColorBand *coba, float in, float out[4])
MINLINE void copy_v4_fl4(float v[4], float x, float y, float z, float w)
ATTR_WARN_UNUSED_RESULT const BMVert * v
void immUniformColor4fv(const float rgba[4])
void BLF_color4f(int fontid, float r, float g, float b, float a)
void immUniformColor3ubv(const unsigned char rgb[3])
void GPU_line_width(float width)
void GPU_matrix_scale_2f(float x, float y)
@ GPU_BLEND_ALPHA_PREMULT
VecBase< float, 4 > float4
void immBindBuiltinProgram(GPUBuiltinShader shader_id)
void imm_draw_circle_wire_2d(uint shdr_pos, float x, float y, float radius, int nsegments)
void BLF_size(int fontid, float size)
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
void IMB_freeImBuf(ImBuf *ibuf)
VecBase< float, 2 > float2
void immUniform1f(const char *name, float x)
void immVertex2f(uint attr_id, float x, float y)
ocio::ScopeInfo IMB_colormanagement_get_scope_info(const ColorManagedDisplaySettings *display_settings, const ColorManagedViewSettings *view_settings)
void GPU_viewport_size_get_f(float coords[4])
void immAttr4fv(uint attr_id, const float data[4])
BMesh const char void * data
@ GPU_SHADER_2D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_AA
@ GPU_SHADER_SIMPLE_LIGHTING
@ GPU_SHADER_3D_SMOOTH_COLOR
@ GPU_SHADER_3D_IMAGE_COLOR
@ GPU_SHADER_3D_UNIFORM_COLOR
@ GPU_SHADER_3D_LINE_DASHED_UNIFORM_COLOR
@ GPU_SHADER_3D_FLAT_COLOR
@ GPU_SHADER_3D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_AA
@ GPU_SHADER_2D_WIDGET_BASE
@ GPU_SHADER_2D_WIDGET_SHADOW
@ GPU_SHADER_3D_POINT_FLAT_COLOR
void GPU_scissor_get(int coords[4])
void immUniform4fv(const char *name, const float data[4])
BLI_INLINE float BLI_rctf_size_y(const struct rctf *rct)
void BKE_curvemapping_changed(CurveMapping *cumap, bool rem_doubles)
void immUniformColor4f(float r, float g, float b, float a)
constexpr size_t ARRAY_SIZE(const T(&arg)[N]) noexcept
void GPU_batch_draw(gpu::Batch *batch)
void immUniformColor3ub(unsigned char r, unsigned char g, unsigned char b)
void GPU_program_point_size(bool enable)
void GPU_matrix_translate_2f(float x, float y)
MatBase< float, 3, 3 > float3x3
void BLF_draw(int fontid, const char *str, size_t str_len, ResultBLF *r_info=nullptr) ATTR_NONNULL(2)
gpu::UniformBuf * GPU_uniformbuf_create_ex(size_t size, const void *data, const char *name)
uint GPU_vertformat_attr_add(GPUVertFormat *format, StringRef name, gpu::VertAttrType type)
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
void GPU_batch_program_set_builtin(gpu::Batch *batch, GPUBuiltinShader shader_id)
void immAttr4ub(uint attr_id, unsigned char r, unsigned char g, unsigned char b, unsigned char a)
int BKE_curveprofile_table_size(const struct CurveProfile *profile)
MINLINE float smoothminf(float a, float b, float c)
void BLF_draw_default(float x, float y, float z, const char *str, size_t str_len) ATTR_NONNULL()
BLI_INLINE float IMB_colormanagement_get_luminance(const float rgb[3])
void GPU_scissor(int x, int y, int width, int height)
void IMB_colormanagement_scene_linear_to_display_v3(float pixel[3], const ColorManagedDisplay *display, ColorManagedDisplaySpace display_space=DISPLAY_SPACE_DRAW)
void immUniform4f(const char *name, float x, float y, float z, float w)
void unit_m3(float m[3][3])
ATTR_WARN_UNUSED_RESULT const BMVert * v2
void IMB_byte_from_float(ImBuf *ibuf)
void GPU_matrix_pop_projection()
void imm_draw_box_wire_2d(uint pos, float x1, float y1, float x2, float y2)
BLI_INLINE float BLI_rctf_size_x(const struct rctf *rct)
void GPU_vertbuf_attr_fill(gpu::VertBuf *, uint a_idx, const void *data)
MINLINE float max_ff(float a, float b)
void GPU_vertbuf_data_alloc(gpu::VertBuf &verts, uint v_len)
void GPU_face_culling(GPUFaceCullTest culling)
Scene * CTX_data_scene(const bContext *C)
gpu::Batch * GPU_batch_preset_sphere(int lod) ATTR_WARN_UNUSED_RESULT
void GPU_blend(GPUBlend blend)
void immUniform1i(const char *name, int x)
VecBase< float, 3 > float3
ImBuf * BKE_tracking_sample_pattern(int frame_width, int frame_height, const ImBuf *search_ib, const MovieTrackingTrack *track, const MovieTrackingMarker *marker, bool from_anchor, bool use_mask, int num_samples_x, int num_samples_y, float pos[2])
void BLF_width_and_height(int fontid, const char *str, size_t str_len, float *r_width, float *r_height) ATTR_NONNULL()
void immUniformColor4ubv(const unsigned char rgba[4])
void immVertex2fv(uint attr_id, const float data[2])
void immUniformColor3ubvAlpha(const unsigned char rgb[3], unsigned char a)
void immUniformColor3fvAlpha(const float rgb[3], float a)
void GPU_matrix_push_projection()
void BKE_curveprofile_update(struct CurveProfile *profile, int update_flags)
void immRectf(uint pos, float x1, float y1, float x2, float y2)
ocio::Display ColorManagedDisplay
@ CUMA_EXTEND_EXTRAPOLATE
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
eCurveProfilePoint_Flag flag
CurveProfilePoint * table
CurveProfilePoint * segments
const uint8_t * byte_data() const
const float * float_data() const
struct ImBuf * track_preview
struct MovieTrackingTrack * track
struct MovieTrackingMarker undist_marker
struct ImBuf * track_search
ColorManagedViewSettings view_settings
ColorManagedDisplaySettings display_settings
eScopes_WaveformMode wavefrm_mode
eScopes_VecscopeMode vecscope_mode
blender::float3x3 yuv_matrix
blender::float3x3 scope_gamut_to_rec709
Vector< ScopeGraticule > graticules