126 #define PROJ_BUCKET_BRUSH_DIV 4
128 #define PROJ_BUCKET_RECT_MIN 4
129 #define PROJ_BUCKET_RECT_MAX 256
131 #define PROJ_BOUNDBOX_DIV 8
132 #define PROJ_BOUNDBOX_SQUARED (PROJ_BOUNDBOX_DIV * PROJ_BOUNDBOX_DIV)
137 #define PROJ_DEBUG_WINCLIP 1
139 #ifndef PROJ_DEBUG_NOSEAMBLEED
145 # define PROJ_FACE_SEAM0 (1 << 0)
146 # define PROJ_FACE_SEAM1 (1 << 1)
147 # define PROJ_FACE_SEAM2 (1 << 2)
149 # define PROJ_FACE_NOSEAM0 (1 << 4)
150 # define PROJ_FACE_NOSEAM1 (1 << 5)
151 # define PROJ_FACE_NOSEAM2 (1 << 6)
154 # define PROJ_FACE_SEAM_INIT0 (1 << 8)
155 # define PROJ_FACE_SEAM_INIT1 (1 << 9)
156 # define PROJ_FACE_SEAM_INIT2 (1 << 10)
158 # define PROJ_FACE_DEGENERATE (1 << 12)
161 # define PROJ_FACE_WINDING_INIT 1
162 # define PROJ_FACE_WINDING_CW 2
167 # define PROJ_FACE_SCALE_SEAM 0.99f
170 #define PROJ_SRC_VIEW 1
171 #define PROJ_SRC_IMAGE_CAM 2
172 #define PROJ_SRC_IMAGE_VIEW 3
173 #define PROJ_SRC_VIEW_FILL 4
175 #define PROJ_VIEW_DATA_ID "view_data"
177 #define PROJ_VIEW_DATA_SIZE (4 * 4 + 4 * 4 + 3)
179 #define PROJ_BUCKET_NULL 0
180 #define PROJ_BUCKET_INIT (1 << 0)
184 #define PROJ_GEOM_TOLERANCE 0.00075f
185 #define PROJ_PIXEL_TOLERANCE 0.01f
188 #define PROJ_VERT_CULL 1
191 #define TILE_PENDING POINTER_FROM_INT(-1)
342 #ifndef PROJ_DEBUG_NOSEAMBLEED
382 #define PROJ_PAINT_STATE_SHARED_MEMCPY(ps_dst, ps_src) \
383 MEMCPY_STRUCT_AFTER(ps_dst, ps_src, is_shared_user)
385 #define PROJ_PAINT_STATE_SHARED_CLEAR(ps) MEMSET_STRUCT_AFTER(ps, 0, is_shared_user)
393 #ifndef PROJ_DEBUG_NOSEAMBLEED
514 #define PS_LOOPTRI_AS_VERT_INDEX_3(ps, lt) \
515 ps->mloop_eval[lt->tri[0]].v, ps->mloop_eval[lt->tri[1]].v, ps->mloop_eval[lt->tri[2]].v,
517 #define PS_LOOPTRI_AS_UV_3(uvlayer, lt) \
518 uvlayer[lt->poly][lt->tri[0]].uv, uvlayer[lt->poly][lt->tri[1]].uv, \
519 uvlayer[lt->poly][lt->tri[2]].uv,
521 #define PS_LOOPTRI_ASSIGN_UV_3(uv_tri, uvlayer, lt) \
523 (uv_tri)[0] = uvlayer[lt->poly][lt->tri[0]].uv; \
524 (uv_tri)[1] = uvlayer[lt->poly][lt->tri[1]].uv; \
525 (uv_tri)[2] = uvlayer[lt->poly][lt->tri[2]].uv; \
542 return 1001 + 10 * ty + tx;
608 const float pt[2],
const float v1[3],
const float v2[3],
const float v3[3],
float w[3])
611 return (
v1[2] *
w[0]) + (
v2[2] *
w[1]) + (v3[2] *
w[2]);
615 const float pt[2],
const float v1[4],
const float v2[4],
const float v3[4],
float w[3])
617 float wtot_inv, wtot;
627 w_tmp[0] =
w[0] *
v1[3];
628 w_tmp[1] =
w[1] *
v2[3];
629 w_tmp[2] =
w[2] * v3[3];
631 wtot = w_tmp[0] + w_tmp[1] + w_tmp[2];
634 wtot_inv = 1.0f / wtot;
636 w_tmp[0] = w_tmp[0] * wtot_inv;
637 w_tmp[1] = w_tmp[1] * wtot_inv;
638 w_tmp[2] = w_tmp[2] * wtot_inv;
641 w_tmp[0] = w_tmp[1] = w_tmp[2] = 1.0f / 3.0f;
645 return (
v1[2] * w_tmp[0]) + (
v2[2] * w_tmp[1]) + (v3[2] * w_tmp[2]);
654 int best_tri_index = -1;
655 float z_depth_best = FLT_MAX, z_depth;
658 if (bucket_index == -1) {
668 const float *vtri_ss[3] = {
682 if (z_depth < z_depth_best) {
683 best_tri_index = tri_index;
684 z_depth_best = z_depth;
691 return best_tri_index;
708 *
x = *
x * ibuf_x - 0.5f;
709 *
y = *
y * ibuf_y - 0.5f;
718 const float *lt_tri_uv[3];
727 if (tri_index == -1) {
742 iuser.
tile = tile_number;
780 xi =
mod_i((
int)(
uv[0] * ibuf->
x), ibuf->
x);
781 yi =
mod_i((
int)(
uv[1] * ibuf->
y), ibuf->
y);
785 const float *rgba_tmp_fp = ibuf->
rect_float + (xi + yi * ibuf->
x * 4);
789 *((
uint *)rgba) = *(
uint *)(((
char *)ibuf->
rect) + ((xi + yi * ibuf->
x) * 4));
823 if (
v1[2] > pt[2] &&
v2[2] > pt[2] && v3[2] > pt[2]) {
834 if (
v1[2] < pt[2] &&
v2[2] < pt[2] && v3[2] < pt[2]) {
857 const float v1_3d[3],
858 const float v2_3d[3],
859 const float v3_3d[3],
897 const float pixelScreenCo[4])
905 for (; bucketFace; bucketFace = bucketFace->
next) {
908 if (orig_face != tri_index) {
910 const float *vtri_ss[3] = {
918 const float *vtri_co[3] = {
930 if (isect_ret >= 1) {
943 #define ISECT_TRUE_P1 2
944 #define ISECT_TRUE_P2 3
945 static int line_isect_y(
const float p1[2],
const float p2[2],
const float y_level,
float *x_isect)
950 if (y_level == p1[1]) {
955 if (y_level == p2[1]) {
961 y_diff =
fabsf(p1[1] - p2[1]);
963 if (y_diff < 0.000001f) {
964 *x_isect = (p1[0] + p2[0]) * 0.5f;
968 if (p1[1] > y_level && p2[1] < y_level) {
970 *x_isect = (p2[0] * (p1[1] - y_level) + p1[0] * (y_level - p2[1])) / y_diff;
973 if (p1[1] < y_level && p2[1] > y_level) {
975 *x_isect = (p2[0] * (y_level - p1[1]) + p1[0] * (p2[1] - y_level)) / y_diff;
981 static int line_isect_x(
const float p1[2],
const float p2[2],
const float x_level,
float *y_isect)
985 if (x_level == p1[0]) {
989 if (x_level == p2[0]) {
995 x_diff =
fabsf(p1[0] - p2[0]);
998 if (x_diff < 0.000001f) {
999 *y_isect = (p1[0] + p2[0]) * 0.5f;
1003 if (p1[0] > x_level && p2[0] < x_level) {
1005 *y_isect = (p2[1] * (p1[0] - x_level) + p1[1] * (x_level - p2[0])) / x_diff;
1008 if (p1[0] < x_level && p2[0] > x_level) {
1010 *y_isect = (p2[1] * (x_level - p1[0]) + p1[1] * (p2[0] - x_level)) / x_diff;
1020 #ifndef PROJ_DEBUG_NOSEAMBLEED
1021 static bool cmp_uv(
const float vec2a[2],
const float vec2b[2])
1024 float xa =
fmodf(vec2a[0], 1.0f);
1025 float ya =
fmodf(vec2a[1], 1.0f);
1027 float xb =
fmodf(vec2b[0], 1.0f);
1028 float yb =
fmodf(vec2b[1], 1.0f);
1052 #ifndef PROJ_DEBUG_NOSEAMBLEED
1059 float min_uv[2], max_uv[2];
1068 bounds_px->
xmin = (int)(ibuf_x * min_uv[0]);
1069 bounds_px->
ymin = (int)(ibuf_y * min_uv[1]);
1071 bounds_px->
xmax = (int)(ibuf_x * max_uv[0]) + 1;
1072 bounds_px->
ymax = (int)(ibuf_y * max_uv[1]) + 1;
1077 return (bounds_px->
xmin == bounds_px->
xmax || bounds_px->
ymin == bounds_px->
ymax) ? false :
true;
1082 float (*
uv)[2],
rcti *bounds_px,
const int ibuf_x,
const int ibuf_y,
int tot)
1085 float min_uv[2], max_uv[2];
1098 bounds_px->
xmin = (int)(ibuf_x * min_uv[0]);
1099 bounds_px->
ymin = (int)(ibuf_y * min_uv[1]);
1101 bounds_px->
xmax = (int)(ibuf_x * max_uv[0]) + 1;
1102 bounds_px->
ymax = (int)(ibuf_y * max_uv[1]) + 1;
1107 return (bounds_px->
xmin == bounds_px->
xmax || bounds_px->
ymin == bounds_px->
ymax) ? false :
true;
1110 #ifndef PROJ_DEBUG_NOSEAMBLEED
1117 float winding =
cross_tri_v2(lt_tri_uv[0], lt_tri_uv[1], lt_tri_uv[2]);
1129 const int orig_face,
1130 const int orig_i1_fidx,
1131 const int orig_i2_fidx,
1142 int i1_fidx = -1, i2_fidx = -1;
1147 if (tri_index != orig_face) {
1160 if (i2_fidx != -1) {
1172 *other_face = tri_index;
1175 *orig_fidx = (i1_fidx < i2_fidx && (i2_fidx - i1_fidx == 1)) ? i1_fidx : i2_fidx;
1183 if ((orig_tpage == tpage) && (orig_tile == tile) &&
1184 cmp_uv(orig_lt_tri_uv[orig_i1_fidx], lt_tri_uv[i1_fidx]) &&
1185 cmp_uv(orig_lt_tri_uv[orig_i2_fidx], lt_tri_uv[i2_fidx])) {
1215 while (seam->
loop != loop_index) {
1251 const float PI_2 =
M_PI * 2.0f;
1253 float angle_rel, angle_no;
1266 if (angle_rel < 0.0f) {
1272 angle_no = angle_rel +
angle[0];
1274 if (angle_no >
M_PI) {
1278 r_no[0] =
cosf(angle_no);
1279 r_no[1] =
sinf(angle_no);
1288 float (*orig_uv)[2],
1301 ibuf_inv[0] = 1.0f / (
float)ibuf_x;
1302 ibuf_inv[1] = 1.0f / (
float)ibuf_y;
1304 for (fidx[0] = 0; fidx[0] < 3; fidx[0]++) {
1306 float(*seam_uvs)[2];
1313 loop_index = ltri->
tri[fidx[0]];
1318 if (seam_uvs[0][0] != FLT_MAX) {
1322 fidx[1] = (fidx[0] == 2) ? 0 : fidx[0] + 1;
1327 for (
uint i = 0; i < 2; i++) {
1335 tri_ang = ang[i] -
M_PI_2;
1337 if (tri_ang > 0.0f) {
1345 len_fact =
cosf(tri_ang);
1346 len_fact =
UNLIKELY(len_fact < FLT_EPSILON) ? FLT_MAX : (1.0f / len_fact);
1349 len_fact =
MIN2(len_fact, 10.0f);
1359 if ((ang[0] + ang[1]) <
M_PI) {
1364 orig_uv[fidx[0]], seam_uvs[0], orig_uv[fidx[1]], seam_uvs[1], isect_co);
1375 const int tri_index,
1382 const int fidx[2] = {fidx1, ((fidx1 + 1) % 3)};
1390 vseam->
tri = tri_index;
1391 vseam->
loop = lt->
tri[fidx[0]];
1393 sub_v2_v2v2(vec, lt_tri_uv[fidx[1]], lt_tri_uv[fidx[0]]);
1404 vseam[1] = vseam[0];
1409 for (
uint i = 0; i < 2; i++) {
1414 while (item && item->
angle < vseam[i].
angle) {
1430 const int tri_index,
1431 const uint vert_index,
1437 int other_face, other_fidx;
1439 int fidx[2] = {2, 0};
1449 if (init_all || (ps->
mloop_eval[lt->
tri[fidx[0]]].
v == vert_index) ||
1453 if (
check_seam(ps, tri_index, fidx[0], fidx[1], &other_face, &other_fidx)) {
1457 if (other_face != -1) {
1470 if (other_face != -1) {
1480 }
while (fidx[0]--);
1483 char checked_verts = 0;
1490 for (
uint i = 0; i < 2; i++) {
1493 if ((checked_verts & (1 << fidx[i])) != 0) {
1505 checked_verts |= 1 << fidx[i];
1512 }
while (fidx[0]--);
1522 const float v1co[3],
1523 const float v2co[3],
1524 const float v3co[3],
1525 const float uv1co[2],
1526 const float uv2co[2],
1527 const float uv3co[2],
1528 float pixelScreenCo[4],
1538 const float v1co[4],
1539 const float v2co[4],
1540 const float v3co[4],
1541 const float uv1co[2],
1542 const float uv2co[2],
1543 const float uv3co[2],
1544 float pixelScreenCo[4],
1548 float wtot_inv, wtot;
1552 w_int[0] =
w[0] * v1co[3];
1553 w_int[1] =
w[1] * v2co[3];
1554 w_int[2] =
w[2] * v3co[3];
1556 wtot = w_int[0] + w_int[1] + w_int[2];
1559 wtot_inv = 1.0f / wtot;
1560 w_int[0] *= wtot_inv;
1561 w_int[1] *= wtot_inv;
1562 w_int[2] *= wtot_inv;
1566 w[0] =
w[1] =
w[2] = w_int[0] = w_int[1] = w_int[2] = 1.0f / 3.0f;
1584 const float projmat_inv[4][4],
1585 const float view_pos[3],
1586 const float co_px[2],
1589 r_dir[0] = 2.0f * (co_px[0] / winx) - 1.0f;
1590 r_dir[1] = 2.0f * (co_px[1] / winy) - 1.0f;
1609 const float zero[3] = {0};
1610 float v1_proj[3], v2_proj[3];
1630 float uv_other[2],
x,
y;
1647 const int tri_index,
1671 mask = ((rgba_f[0] + rgba_f[1] + rgba_f[2]) * (1.0f / 3.0f)) * rgba_f[3];
1674 mask = ((rgba_ub[0] + rgba_ub[1] + rgba_ub[2]) * (1.0f / (255.0f * 3.0f))) *
1675 (rgba_ub[3] * (1.0f / 255.0f));
1700 float ca1, ca2, ca3, ca_mask;
1705 ca_mask =
w[0] * ca1 +
w[1] * ca2 +
w[2] * ca3;
1707 CLAMP(ca_mask, 0.0f, 1.0f);
1716 float no[3], angle_cos;
1719 const short *no1, *no2, *no3;
1724 no[0] =
w[0] * no1[0] +
w[1] * no2[0] +
w[2] * no3[0];
1725 no[1] =
w[0] * no1[1] +
w[1] * no2[1] +
w[2] * no3[1];
1726 no[2] =
w[0] * no1[2] +
w[1] * no2[2] +
w[2] * no3[2];
1753 float viewDirPersp[3];
1754 const float *co1, *co2, *co3;
1760 viewDirPersp[0] = (ps->
viewPos[0] - (
w[0] * co1[0] +
w[1] * co2[0] +
w[2] * co3[0]));
1761 viewDirPersp[1] = (ps->
viewPos[1] - (
w[0] * co1[1] +
w[1] * co2[1] +
w[2] * co3[1]));
1762 viewDirPersp[2] = (ps->
viewPos[2] - (
w[0] * co1[2] +
w[1] * co2[2] +
w[2] * co3[2]));
1768 angle_cos =
dot_v3v3(viewDirPersp, no);
1773 angle_cos =
fabsf(angle_cos);
1776 if (angle_cos <= ps->normal_angle__cos) {
1780 if (angle_cos < ps->normal_angle_inner__cos) {
1804 bool generate_tile =
false;
1813 generate_tile =
true;
1820 if (generate_tile) {
1822 volatile void *undorect;
1832 &pjIma->
valid[tile_index],
1845 &pjIma->
valid[tile_index],
1855 pjIma->
undoRect[tile_index] = undorect;
1872 const int tri_index,
1873 const float pixelScreenCo[4],
1874 const float world_spaceCo[3],
1879 int x_round, y_round;
1882 volatile int tile_index;
1888 x_px =
mod_i(x_px, ibuf->
x);
1889 y_px =
mod_i(y_px, ibuf->
y);
1915 projPixel->
valid = projima->
valid[tile_index];
1935 projPixel->
x_px = x_px;
1936 projPixel->
y_px = y_px;
1959 const float *lt_other_tri_uv[3] = {
2033 #ifdef PROJ_DEBUG_PAINT
2058 if (l1[1] < rect->
ymin || l1[1] > rect->
ymax) {
2062 if ((l1[0] < rect->
xmin && l2[0] < rect->
xmin) || (l1[0] > rect->
xmax && l2[0] > rect->
xmax)) {
2084 if (l1[0] < rect->
xmin || l1[0] > rect->
xmax) {
2089 if ((l1[1] < rect->
ymin && l2[1] < rect->
ymin) || (l1[1] > rect->
ymax && l2[1] > rect->
ymax)) {
2134 (isect <= cliprect->xmax)) {
2135 if (l1[1] < l2[1]) {
2137 l1_clip[1] = rect->
ymin;
2142 l2_clip[1] = rect->
ymin;
2152 (isect <= cliprect->xmax)) {
2153 if (l1[1] > l2[1]) {
2155 l1_clip[1] = rect->
ymax;
2160 l2_clip[1] = rect->
ymax;
2171 (isect <= cliprect->ymax)) {
2172 if (l1[0] < l2[0]) {
2173 l1_clip[0] = rect->
xmin;
2178 l2_clip[0] = rect->
xmin;
2189 (isect <= cliprect->ymax)) {
2190 if (l1[0] > l2[0]) {
2191 l1_clip[0] = rect->
xmax;
2196 l2_clip[0] = rect->
xmax;
2213 #ifndef PROJ_DEBUG_NOSEAMBLEED
2215 static void scale_tri(
float insetCos[3][3],
const float *origCos[3],
const float inset)
2218 cent[0] = (origCos[0][0] + origCos[1][0] + origCos[2][0]) * (1.0f / 3.0f);
2219 cent[1] = (origCos[0][1] + origCos[1][1] + origCos[2][1]) * (1.0f / 3.0f);
2220 cent[2] = (origCos[0][2] + origCos[1][2] + origCos[2][2]) * (1.0f / 3.0f);
2242 return x *
x +
y *
y;
2252 const float radius_squared,
2253 const rctf *bucket_bounds)
2267 if ((bucket_bounds->
xmin <= cent[0] && bucket_bounds->
xmax >= cent[0]) ||
2268 (bucket_bounds->
ymin <= cent[1] && bucket_bounds->
ymax >= cent[1])) {
2273 if (cent[0] < bucket_bounds->
xmin) {
2275 if (cent[1] < bucket_bounds->
ymin) {
2282 if (cent[1] > bucket_bounds->
ymax) {
2289 else if (cent[0] > bucket_bounds->
xmax) {
2291 if (cent[1] < bucket_bounds->
ymin) {
2298 if (cent[1] > bucket_bounds->
ymax) {
2319 const float *v1coSS,
2320 const float *v2coSS,
2321 const float *v3coSS,
2325 float bucket_bounds_uv[4][2],
2332 uv[0] = bucket_bounds->
xmax;
2333 uv[1] = bucket_bounds->
ymin;
2338 uv[1] = bucket_bounds->
ymax;
2342 uv[0] = bucket_bounds->
xmin;
2348 uv[1] = bucket_bounds->
ymin;
2355 const float *v1coSS,
2356 const float *v2coSS,
2357 const float *v3coSS,
2361 float bucket_bounds_uv[4][2],
2368 uv[0] = bucket_bounds->
xmax;
2369 uv[1] = bucket_bounds->
ymin;
2374 uv[1] = bucket_bounds->
ymax;
2378 uv[0] = bucket_bounds->
xmin;
2384 uv[1] = bucket_bounds->
ymin;
2392 static float angle_2d_clockwise(
const float p1[2],
const float p2[2],
const float p3[2])
2396 v1[0] = p1[0] - p2[0];
2397 v1[1] = p1[1] - p2[1];
2398 v2[0] = p3[0] - p2[0];
2399 v2[1] = p3[1] - p2[1];
2406 #define ISECT_2 (1 << 1)
2407 #define ISECT_3 (1 << 2)
2408 #define ISECT_4 (1 << 3)
2409 #define ISECT_ALL3 ((1 << 3) - 1)
2410 #define ISECT_ALL4 ((1 << 4) - 1)
2414 const float pt[2],
const float v1[2],
const float v2[2],
const float v3[2],
const float limit)
2426 return (((
float *)p1)[2] < ((
float *)p2)[2] ? 1 : -1);
2431 return (((
float *)p1)[2] < ((
float *)p2)[2] ? -1 : 1);
2443 float min = FLT_MAX, tmp;
2444 float xlen = l2[0] - l1[0];
2445 float ylen = l2[1] - l1[1];
2449 if ((l1[0] - rect->
xmin) * (l2[0] - rect->
xmin) <= 0) {
2453 else if ((l1[0] - rect->
xmax) * (l2[0] - rect->
xmax) < 0) {
2460 if ((l1[1] - rect->
ymin) * (l2[1] - rect->
ymin) <= 0) {
2464 else if ((l1[1] - rect->
ymax) * (l2[1] - rect->
ymax) < 0) {
2470 if (
min == FLT_MAX) {
2474 tmp = (is_ortho) ? 1.0f : (l1[3] +
min * (l2[3] - l1[3]));
2476 uv[0] = (uv1[0] +
min / tmp * (uv2[0] - uv1[0]));
2477 uv[1] = (uv1[1] +
min / tmp * (uv2[1] - uv1[1]));
2483 const bool is_flip_object,
2484 const rctf *cliprect,
2485 const rctf *bucket_bounds,
2486 const float *v1coSS,
2487 const float *v2coSS,
2488 const float *v3coSS,
2492 float bucket_bounds_uv[8][2],
2496 int inside_bucket_flag = 0;
2497 int inside_face_flag = 0;
2499 bool collinear =
false;
2501 float bucket_bounds_ss[4][2];
2549 if (inside_bucket_flag &
ISECT_1) {
2557 bucket_bounds, v1coSS, v2coSS, uv1co, uv2co, bucket_bounds_uv[*tot], is_ortho)) {
2562 if (inside_bucket_flag &
ISECT_2) {
2570 bucket_bounds, v2coSS, v3coSS, uv2co, uv3co, bucket_bounds_uv[*tot], is_ortho)) {
2575 if (inside_bucket_flag &
ISECT_3) {
2583 bucket_bounds, v3coSS, v1coSS, uv3co, uv1co, bucket_bounds_uv[*tot], is_ortho)) {
2608 bucket_bounds_ss[0][0] = bucket_bounds->
xmax;
2609 bucket_bounds_ss[0][1] = bucket_bounds->
ymin;
2615 bucket_bounds_ss[1][0] = bucket_bounds->
xmax;
2616 bucket_bounds_ss[1][1] = bucket_bounds->
ymax;
2622 bucket_bounds_ss[2][0] = bucket_bounds->
xmin;
2623 bucket_bounds_ss[2][1] = bucket_bounds->
ymax;
2629 bucket_bounds_ss[3][0] = bucket_bounds->
xmin;
2630 bucket_bounds_ss[3][1] = bucket_bounds->
ymin;
2644 bucket_bounds, v1coSS, v2coSS, v3coSS, uv1co, uv2co, uv3co, bucket_bounds_uv, flip);
2648 bucket_bounds, v1coSS, v2coSS, v3coSS, uv1co, uv2co, uv3co, bucket_bounds_uv, flip);
2675 float isectVCosSS[8][3];
2676 float v1_clipSS[2], v2_clipSS[2];
2680 float cent[2] = {0.0f, 0.0f};
2686 if (inside_face_flag &
ISECT_1) {
2687 copy_v2_v2(isectVCosSS[*tot], bucket_bounds_ss[0]);
2690 if (inside_face_flag &
ISECT_2) {
2691 copy_v2_v2(isectVCosSS[*tot], bucket_bounds_ss[1]);
2694 if (inside_face_flag &
ISECT_3) {
2695 copy_v2_v2(isectVCosSS[*tot], bucket_bounds_ss[2]);
2698 if (inside_face_flag &
ISECT_4) {
2699 copy_v2_v2(isectVCosSS[*tot], bucket_bounds_ss[3]);
2703 if (inside_bucket_flag &
ISECT_1) {
2707 if (inside_bucket_flag &
ISECT_2) {
2711 if (inside_bucket_flag &
ISECT_3) {
2717 if (
line_clip_rect2f(cliprect, bucket_bounds, v1coSS, v2coSS, v1_clipSS, v2_clipSS)) {
2718 if ((inside_bucket_flag &
ISECT_1) == 0) {
2722 if ((inside_bucket_flag &
ISECT_2) == 0) {
2730 if (
line_clip_rect2f(cliprect, bucket_bounds, v2coSS, v3coSS, v1_clipSS, v2_clipSS)) {
2731 if ((inside_bucket_flag &
ISECT_2) == 0) {
2735 if ((inside_bucket_flag &
ISECT_3) == 0) {
2743 if (
line_clip_rect2f(cliprect, bucket_bounds, v3coSS, v1coSS, v1_clipSS, v2_clipSS)) {
2744 if ((inside_bucket_flag &
ISECT_3) == 0) {
2748 if ((inside_bucket_flag &
ISECT_1) == 0) {
2762 for (
int i = 0; i < (*tot); i++) {
2763 cent[0] += isectVCosSS[i][0];
2764 cent[1] += isectVCosSS[i][1];
2766 cent[0] = cent[0] / (
float)(*tot);
2767 cent[1] = cent[1] / (
float)(*tot);
2772 for (
int i = 0; i < (*tot); i++) {
2773 isectVCosSS[i][2] = angle_2d_clockwise(up, cent, isectVCosSS[i]);
2778 v1_clipSS[0] = cent[0];
2779 v1_clipSS[1] = cent[1] + 1.0f;
2781 for (
int i = 0; i < (*tot); i++) {
2782 v2_clipSS[0] = isectVCosSS[i][0] - cent[0];
2783 v2_clipSS[1] = isectVCosSS[i][1] - cent[1];
2784 isectVCosSS[i][2] =
atan2f(v1_clipSS[0] * v2_clipSS[1] - v1_clipSS[1] * v2_clipSS[0],
2785 v1_clipSS[0] * v2_clipSS[0] + v1_clipSS[1] * v2_clipSS[1]);
2792 qsort(isectVCosSS, *tot,
sizeof(
float[3]),
float_z_sort);
2796 while (doubles ==
true) {
2799 for (
int i = 0; i < (*tot); i++) {
2802 for (
int j = i; j < (*tot) - 1; j++) {
2803 isectVCosSS[j][0] = isectVCosSS[j + 1][0];
2804 isectVCosSS[j][1] = isectVCosSS[j + 1][1];
2821 for (
int i = 0; i < (*tot); i++) {
2827 for (
int i = 0; i < (*tot); i++) {
2834 #ifdef PROJ_DEBUG_PRINT_CLIP
2839 float test_uv[4][2];
2843 bucket_bounds, v1coSS, v2coSS, v3coSS, uv1co, uv2co, uv3co, test_uv, flip);
2847 bucket_bounds, v1coSS, v2coSS, v3coSS, uv1co, uv2co, uv3co, test_uv, flip);
2849 printf(
"( [(%f,%f), (%f,%f), (%f,%f), (%f,%f)], ",
2859 printf(
" [(%f,%f), (%f,%f), (%f,%f)], ",
2868 for (
int i = 0; i < (*tot); i++) {
2869 printf(
"(%f, %f),", bucket_bounds_uv[i][0], bucket_bounds_uv[i][1]);
2938 for (i = 1; i < tot; i++) {
2950 for (
int i = 1; i < tot; i++) {
2965 const int thread_index,
2966 const int bucket_index,
2967 const int tri_index,
2968 const int image_index,
2969 const rctf *clip_rect,
2970 const rctf *bucket_bounds,
3000 const float *v1coSS, *v2coSS, *v3coSS;
3003 const float *vCo[3];
3008 float *uv1co, *uv2co, *uv3co;
3009 float pixelScreenCo[4];
3017 float lt_uv_pxoffset[3][2];
3018 float xhalfpx, yhalfpx;
3019 const float ibuf_xf = (
float)ibuf->
x, ibuf_yf = (
float)ibuf->
y;
3022 int has_x_isect = 0, has_isect = 0;
3024 float uv_clip[8][2];
3026 const bool is_ortho = ps->
is_ortho;
3050 lt_uv_pxoffset[0][0] = lt_tri_uv[0][0] - xhalfpx;
3051 lt_uv_pxoffset[0][1] = lt_tri_uv[0][1] - yhalfpx;
3053 lt_uv_pxoffset[1][0] = lt_tri_uv[1][0] - xhalfpx;
3054 lt_uv_pxoffset[1][1] = lt_tri_uv[1][1] - yhalfpx;
3056 lt_uv_pxoffset[2][0] = lt_tri_uv[2][0] - xhalfpx;
3057 lt_uv_pxoffset[2][1] = lt_tri_uv[2][1] - yhalfpx;
3060 uv1co = lt_uv_pxoffset[0];
3061 uv2co = lt_uv_pxoffset[1];
3062 uv3co = lt_uv_pxoffset[2];
3086 if (uv_clip_tot > 6) {
3087 printf(
"this should never happen! %d\n", uv_clip_tot);
3093 project_paint_undo_tiles_init(
3099 for (
y = bounds_px.
ymin;
y < bounds_px.
ymax;
y++) {
3105 for (
x = bounds_px.
xmin;
x < bounds_px.
xmax;
x++) {
3112 if ((do_backfacecull ==
true &&
IsectPoly2Df(
uv, uv_clip, uv_clip_tot)) ||
3115 has_x_isect = has_isect = 1;
3119 uv, v1coSS, v2coSS, v3coSS, uv1co, uv2co, uv3co, pixelScreenCo,
w);
3123 uv, v1coSS, v2coSS, v3coSS, uv1co, uv2co, uv3co, pixelScreenCo,
w);
3127 if (do_clip || do_3d_mapping) {
3150 ps, arena, &tinf,
x,
y,
mask, tri_index, pixelScreenCo, wco,
w),
3156 else if (has_x_isect) {
3166 if (has_x_isect == 0 && has_isect) {
3174 #ifndef PROJ_DEBUG_NOSEAMBLEED
3192 printf(
"seams - %d %d %d %d\n",
3210 float insetCos[3][3];
3213 const float *vCoSS[3];
3217 float bucket_clip_edges[2][2];
3218 float edge_verts_inset_clip[2][3];
3223 float seam_subsection[4][2];
3229 lt_puv[0][0] = lt_uv_pxoffset[0][0] * ibuf->
x;
3230 lt_puv[0][1] = lt_uv_pxoffset[0][1] * ibuf->
y;
3232 lt_puv[1][0] = lt_uv_pxoffset[1][0] * ibuf->
x;
3233 lt_puv[1][1] = lt_uv_pxoffset[1][1] * ibuf->
y;
3235 lt_puv[2][0] = lt_uv_pxoffset[2][0] * ibuf->
x;
3236 lt_puv[2][1] = lt_uv_pxoffset[2][1] * ibuf->
y;
3262 for (fidx1 = 0; fidx1 < 3; fidx1++) {
3264 fidx2 = (fidx1 == 2) ? 0 : fidx1 + 1;
3266 if ((face_seam_flag & (1 << fidx1)) &&
3271 bucket_clip_edges[0],
3272 bucket_clip_edges[1])) {
3285 ps, bucket_clip_edges[0], vCo[fidx1], vCo[fidx2]);
3287 ps, bucket_clip_edges[1], vCo[fidx1], vCo[fidx2]);
3290 interp_v2_v2v2(seam_subsection[0], lt_uv_pxoffset[fidx1], lt_uv_pxoffset[fidx2], fac1);
3291 interp_v2_v2v2(seam_subsection[1], lt_uv_pxoffset[fidx1], lt_uv_pxoffset[fidx2], fac2);
3293 interp_v2_v2v2(seam_subsection[2], seam_uvs[0], seam_uvs[1], fac2);
3294 interp_v2_v2v2(seam_subsection[3], seam_uvs[0], seam_uvs[1], fac1);
3298 interp_v3_v3v3(edge_verts_inset_clip[0], insetCos[fidx1], insetCos[fidx2], fac1);
3299 interp_v3_v3v3(edge_verts_inset_clip[1], insetCos[fidx1], insetCos[fidx2], fac2);
3305 for (
y = bounds_px.
ymin;
y < bounds_px.
ymax;
y++) {
3311 for (
x = bounds_px.
xmin;
x < bounds_px.
xmax;
x++) {
3312 const float puv[2] = {(
float)
x, (
float)
y};
3342 float pixel_on_edge[4];
3347 uv, v1coSS, v2coSS, v3coSS, uv1co, uv2co, uv3co, pixelScreenCo,
w);
3351 uv, v1coSS, v2coSS, v3coSS, uv1co, uv2co, uv3co, pixelScreenCo,
w);
3357 pixel_on_edge, edge_verts_inset_clip[0], edge_verts_inset_clip[1], fac);
3360 pixel_on_edge[3] = 1.0f;
3363 pixel_on_edge[0] = (
float)(ps->
winx * 0.5f) +
3364 (ps->
winx * 0.5f) * pixel_on_edge[0] / pixel_on_edge[3];
3365 pixel_on_edge[1] = (
float)(ps->
winy * 0.5f) +
3366 (ps->
winy * 0.5f) * pixel_on_edge[1] / pixel_on_edge[3];
3368 pixel_on_edge[2] = pixel_on_edge[2] / pixel_on_edge[3];
3373 ps, bucketFaceNodes, tri_index, pixel_on_edge)) {
3376 if (do_clip || do_3d_mapping) {
3392 ps, arena, &tinf,
x,
y,
mask, tri_index, pixelScreenCo, wco,
w),
3397 else if (has_x_isect) {
3407 if (has_x_isect == 0 && has_isect) {
3463 rctf *bucket_bounds)
3481 const int thread_index,
3482 const int bucket_index,
3483 const rctf *clip_rect,
3484 const rctf *bucket_bounds)
3487 int tri_index, image_index = 0;
3521 if (tpage_last != tpage || tile_last != tile) {
3526 for (image_index = 0; image_index < ps->
image_tot; image_index++) {
3528 if ((projIma->
ima == tpage) && (projIma->
iuser.
tile == tile)) {
3529 ibuf = projIma->
ibuf;
3571 float p1[2], p2[2], p3[2], p4[2];
3572 const float *
v, *
v1, *
v2, *v3;
3591 p1[0] = bucket_bounds.
xmin;
3592 p1[1] = bucket_bounds.
ymin;
3593 p2[0] = bucket_bounds.
xmin;
3594 p2[1] = bucket_bounds.
ymax;
3595 p3[0] = bucket_bounds.
xmax;
3596 p3[1] = bucket_bounds.
ymax;
3597 p4[0] = bucket_bounds.
xmax;
3598 p4[1] = bucket_bounds.
ymin;
3618 const int tri_index)
3621 float min[2],
max[2], *vCoSS;
3623 int bucketMin[2], bucketMax[2];
3624 int fidx, bucket_x, bucket_y;
3626 int has_x_isect = -1, has_isect = 0;
3640 for (bucket_y = bucketMin[1]; bucket_y < bucketMax[1]; bucket_y++) {
3642 for (bucket_x = bucketMin[0]; bucket_x < bucketMax[0]; bucket_x++) {
3644 int bucket_index = bucket_x + (bucket_y * ps->
buckets_x);
3650 has_x_isect = has_isect = 1;
3652 else if (has_x_isect) {
3660 if (has_x_isect == 0 && has_isect) {
3665 #ifndef PROJ_DEBUG_NOSEAMBLEED
3678 float viewmat[4][4];
3679 float viewinv[4][4];
3687 if (symmetry_flag) {
3689 for (i = 0; i < 3; i++) {
3690 if ((symmetry_flag >> i) & 1) {
3728 memcpy(winmat,
array,
sizeof(winmat));
3729 array +=
sizeof(winmat) /
sizeof(
float);
3730 memcpy(viewmat,
array,
sizeof(viewmat));
3731 array +=
sizeof(viewmat) /
sizeof(
float);
3790 float *projScreenCo;
3800 for (
a = 0,
mv = ps->
mvert_eval; a < ps->totvert_eval;
a++,
mv++, projScreenCo += 4) {
3804 projScreenCo[0] = (
float)(ps->
winx * 0.5f) + (ps->
winx * 0.5f) * projScreenCo[0];
3805 projScreenCo[1] = (
float)(ps->
winy * 0.5f) + (ps->
winy * 0.5f) * projScreenCo[1];
3810 for (
a = 0,
mv = ps->
mvert_eval; a < ps->totvert_eval;
a++,
mv++, projScreenCo += 4) {
3812 projScreenCo[3] = 1.0f;
3818 projScreenCo[0] = (
float)(ps->
winx * 0.5f) +
3819 (ps->
winx * 0.5f) * projScreenCo[0] / projScreenCo[3];
3820 projScreenCo[1] = (
float)(ps->
winy * 0.5f) +
3821 (ps->
winy * 0.5f) * projScreenCo[1] / projScreenCo[3];
3823 projScreenCo[2] = projScreenCo[2] / projScreenCo[3];
3831 projScreenCo[0] = FLT_MAX;
3847 #ifdef PROJ_DEBUG_WINCLIP
3879 for (
a = 0, me = ps->
medge_eval; a < ps->totedge_eval;
a++, me++) {
3889 if (counter[
a] > 0) {
3906 #ifndef PROJ_DEBUG_NOSEAMBLEED
3913 "paint-faceWindindFlags");
3932 if (reset_threads) {
3953 float viewDirPersp[3];
3990 #ifndef PROJ_DEBUG_NOSEAMBLEED
3994 const int tri_index)
4029 if (scene_eval ==
NULL || ob_eval ==
NULL) {
4050 const int totmat = ob->
totcol + 1;
4055 for (
int i = 0; i < totmat - 1; i++) {
4095 "proj_paint_mtfaces");
4097 if (layer_num != -1) {
4101 if (mloopuv_clone_base ==
NULL) {
4107 memset(layer_clone, 0,
sizeof(*layer_clone));
4115 const int tri_index)
4154 memset(face_lookup, 0,
sizeof(*face_lookup));
4203 if (coSS->
v1[0] == FLT_MAX || coSS->
v2[0] == FLT_MAX || coSS->
v3[0] == FLT_MAX) {
4210 #ifdef PROJ_DEBUG_WINCLIP
4247 for (entry = used_images->
first, i = 0; entry; entry = entry->
next, i++, projIma++) {
4250 projIma->
ima = entry->
ima;
4277 const bool is_multi_view)
4285 int tile_last = -1, tile;
4287 int image_index = -1, tri_index;
4292 for (tri_index = 0, lt = ps->
mlooptri_eval; tri_index < ps->totlooptri_eval; tri_index++, lt++) {
4294 bool skip_tri =
false;
4306 if (slot != slot_last) {
4336 #ifndef PROJ_DEBUG_NOSEAMBLEED
4346 if (is_face_sel && tpage) {
4350 if (is_multi_view ==
false) {
4355 #ifdef PROJ_DEBUG_WINCLIP
4365 if (prev_poly != lt->
poly) {
4369 int poly_loops = poly->
totloop;
4370 prev_poly = lt->
poly;
4371 for (iloop = 0; iloop < poly_loops; iloop++) {
4381 int poly_tri = poly_loops - 3;
4382 tri_index += poly_tri;
4396 if (tpage_last != tpage || tile_last != tile) {
4399 if (
e->ima == tpage &&
e->iuser.tile == tile) {
4426 if (image_index != -1) {
4446 const bool is_multi_view,
4447 const char symmetry_flag)
4458 bool reset_threads =
false;
4483 if (layer_num != -1) {
4519 reset_threads =
true;
4528 "paint-bucketRect");
4530 "paint-bucketFaces");
4533 #ifndef PROJ_DEBUG_NOSEAMBLEED
4545 ps, arena, &face_lookup, &layer_clone, mloopuv_base, is_multi_view);
4559 ((
float)(ps->
winx * 0.5f) + (ps->
winx * 0.5f) * projCo[0] / projCo[3]);
4561 ((
float)(ps->
winy * 0.5f) + (ps->
winy * 0.5f) * projCo[1] / projCo[3]);
4572 for (
a = 0, projIma = ps->
projImages; a < ps->image_tot;
a++, projIma++) {
4612 #ifndef PROJ_DEBUG_NOSEAMBLEED
4693 bool redraw =
false;
4695 for (
a = 0, projIma = ps->
projImages; a < ps->image_tot;
a++, projIma++) {
4696 if (projIma->
touch) {
4721 float min_brush[2], max_brush[2];
4727 if (radius < 1.0f) {
4732 min_brush[0] = mval_f[0] - radius;
4733 min_brush[1] = mval_f[1] - radius;
4735 max_brush[0] = mval_f[0] + radius;
4736 max_brush[1] = mval_f[1] + radius;
4760 rctf *bucket_bounds,
4761 const float mval[2])
4769 const int bucket_y = bidx / ps->
buckets_x;
4770 const int bucket_x = bidx - (bucket_y * ps->
buckets_x);
4773 if (bucket_x >= ps->
bucketMin[0] && bucket_x < ps->bucketMax[0]) {
4779 *bucket_index = bidx;
4813 uchar clone_rgba[4];
4815 clone_rgba[0] = clone_pt[0];
4816 clone_rgba[1] = clone_pt[1];
4817 clone_rgba[2] = clone_pt[2];
4818 clone_rgba[3] = (
uchar)(clone_pt[3] *
mask);
4832 const float *clone_pt = ((
ProjPixelClone *)projPixel)->clonepx.f;
4835 float clone_rgba[4];
4896 float accum_tot = 0.0f;
4904 for (yk = 0; yk < kernel->
side; yk++) {
4905 for (xk = 0; xk < kernel->
side; xk++) {
4907 float co_ofs[2] = {2.0f * xk - 1.0f, 2.0f * yk - 1.0f};
4912 float weight = kernel->
wdata[xk + yk * kernel->
side];
4915 accum_tot += weight;
4920 if (
LIKELY(accum_tot != 0)) {
4921 mul_v4_fl(rgba, 1.0f / (
float)accum_tot);
4956 float accum_tot = 0;
4965 for (yk = 0; yk < kernel->
side; yk++) {
4966 for (xk = 0; xk < kernel->
side; xk++) {
4968 float co_ofs[2] = {2.0f * xk - 1.0f, 2.0f * yk - 1.0f};
4973 float weight = kernel->
wdata[xk + yk * kernel->
side];
4976 accum_tot += weight;
4981 if (
LIKELY(accum_tot != 0)) {
4984 mul_v4_fl(rgba, 1.0f / (
float)accum_tot);
4987 float rgba_pixel[4];
4997 float alpha = rgba_pixel[3];
4998 rgba[3] = rgba_pixel[3] =
mask;
5020 const float texrgb[3],
5043 if (dither > 0.0f) {
5061 const float texrgb[3],
5086 rgba_ub[0] = rgba_ub[1] = rgba_ub[2] = ps->
stencil_value * 255.0f;
5127 float rgb_straight[4];
5145 const int thread_index = ((
ProjectHandle *)ph_v)->thread_index;
5153 int last_index = -1;
5157 float dist_sq, dist;
5161 bool is_floatbuf =
false;
5162 const short tool = ps->
tool;
5166 float pos_ofs[2] = {0};
5172 const float brush_radius_sq = brush_radius * brush_radius;
5189 pos_ofs[0] =
pos[0] - lastpos[0];
5190 pos_ofs[1] =
pos[1] - lastpos[1];
5205 rctf clip_rect = bucket_bounds;
5224 last_projIma = projImages + last_index;
5226 last_projIma->
touch = 1;
5236 float line_len_sq_inv, line_len;
5239 const float p[2] = {
5240 projPixel->
projCoSS[0] - lastpos[0],
5241 projPixel->
projCoSS[1] - lastpos[1],
5246 line_len_sq_inv = 1.0f / line_len;
5247 line_len =
sqrtf(line_len);
5251 f =
dot_v2v2(p, tangent) * line_len_sq_inv;
5256 f =
len_v2(p) / line_len;
5261 color_f[3] *= ((
float)projPixel->
mask) * (1.0f / 65535.0f) * brush_alpha;
5288 float newColor_f[4];
5289 newColor_f[3] = ((
float)projPixel->
mask) * (1.0f / 65535.0f) * brush_alpha;
5361 if (dist_sq <= brush_radius_sq) {
5362 dist =
sqrtf(dist_sq);
5366 if (falloff > 0.0f) {
5371 float custom_mask = ((
float)projPixel->
mask) * (1.0f / 65535.0f);
5377 CLAMP(texmask, 0.0f, 1.0f);
5378 custom_mask *= texmask;
5394 samplecos[2] = 0.0f;
5402 custom_mask *= texrgba[3];
5416 float max_mask = brush_alpha * custom_mask * falloff * 65535.0f;
5419 mask = mask_accum + max_mask;
5422 mask = mask_accum + (max_mask - mask_accum * falloff);
5430 mask = mask_short * (1.0f / 65535.0f);
5438 mask = brush_alpha * custom_mask * falloff;
5446 last_projIma = projImages + last_index;
5448 last_projIma->
touch = 1;
5454 *projPixel->
valid =
true;
5521 projPixel =
node->link;
5529 projPixel =
node->link;
5541 projPixel =
node->link;
5549 projPixel =
node->link;
5564 bool touch_any =
false;
5585 bool float_dest =
false;
5586 bool uchar_dest =
false;
5630 memcpy(
handles[
a].projImages[i].partRedrawRect,
5657 handles[
a].projImages[i].partRedrawRect,
5674 if (tri_index != -1) {
5698 const float prev_pos[2],
5751 const float prev_pos[2],
5768 const int mval_i[2] = {(int)
pos[0], (
int)
pos[1]};
5867 #ifndef PROJ_DEBUG_NOSEAMBLEED
5939 BLI_assert(index <= ps_handle->ps_views_tot);
6052 int orig_brush_size;
6071 if (image ==
NULL) {
6091 if (view_data !=
NULL &&
6135 const float pos[2] = {0.0, 0.0};
6136 const float lastpos[2] = {0.0, 0.0};
6163 ot->
name =
"Project Image";
6164 ot->
idname =
"PAINT_OT_project_image";
6165 ot->
description =
"Project an edited render from the active camera back onto the object";
6206 char err_out[256] =
"unknown";
6294 array[2] = is_ortho ? 1.0f : 0.0f;
6305 ot->
name =
"Image from View";
6306 ot->
idname =
"PAINT_OT_image_from_view";
6307 ot->
description =
"Make an image from biggest 3D view for reprojection";
6327 "Missing%s%s%s%s detected!",
6328 !uvs ?
" UVs," :
"",
6329 !mat ?
" Materials," :
"",
6330 !
tex ?
" Textures," :
"",
6331 !stencil ?
" Stencil," :
"");
6345 bool hasstencil =
true;
6363 for (
int i = 1; i < ob->
totcol + 1; i++) {
6391 if (layernum == 0) {
6427 *stencil = hasstencil;
6430 return hasuvs && hasmat && hastex && hasstencil;
6458 float color[4] = {0.0f, 0.0f, 0.0f, 1.0f};
6459 char imagename[
MAX_ID_NAME - 2] =
"Material Diffuse Color";
6462 bool use_float =
false;
6497 if (in_node ==
NULL) {
6507 switch (in_sock->
type) {
6573 imanode->
id = &ima->
id;
6579 bNode *out_node = imanode;
6581 if (in_node !=
NULL) {
6598 out_node = nor_node;
6610 out_node = bump_node;
6616 if (in_node !=
NULL) {
6626 if (in_sock !=
NULL && link ==
NULL) {
6694 const char *base_name = ma ? &ma->
id.
name[2] : &ob->
id.
name[2];
6716 #define IMA_DEF_NAME N_("Untitled")
6721 static float default_color[4] = {0.0f, 0.0f, 0.0f, 1.0f};
6724 ot->
name =
"Add Texture Paint Slot";
6726 ot->
idname =
"PAINT_OT_add_texture_paint_slot";
6740 prop =
RNA_def_int(
ot->
srna,
"width", 1024, 1, INT_MAX,
"Width",
"Image width", 1, 16384);
6742 prop =
RNA_def_int(
ot->
srna,
"height", 1024, 1, INT_MAX,
"Height",
"Image height", 1, 16384);
6745 ot->
srna,
"color", 4,
NULL, 0.0f, FLT_MAX,
"Color",
"Default fill color", 0.0f, 1.0f);
6754 "Fill the image with a grid for UV map testing");
6756 ot->
srna,
"float", 0,
"32-bit Float",
"Create image with 32-bit floating-point bit depth");
6789 ot->
name =
"Add Simple UVs";
6791 ot->
idname =
"PAINT_OT_add_simple_uvs";
typedef float(TangentPoint)[2]
void BKE_brush_size_set(struct Scene *scene, struct Brush *brush, int size)
float BKE_brush_alpha_get(const struct Scene *scene, const struct Brush *brush)
float BKE_brush_sample_masktex(const struct Scene *scene, struct Brush *br, const float point[2], const int thread, struct ImagePool *pool)
int BKE_brush_size_get(const struct Scene *scene, const struct Brush *brush)
float BKE_brush_sample_tex_3d(const struct Scene *scene, const struct Brush *br, const float point[3], float rgba[4], const int thread, struct ImagePool *pool)
float BKE_brush_curve_strength_clamped(struct Brush *br, float p, const float len)
Camera data-block and utility functions.
void BKE_camera_params_init(CameraParams *params)
void BKE_camera_params_from_object(CameraParams *params, const struct Object *cam_ob)
void BKE_camera_params_compute_viewplane(CameraParams *params, int winx, int winy, float aspx, float aspy)
void BKE_camera_params_compute_matrix(CameraParams *params)
bool BKE_colorband_evaluate(const struct ColorBand *coba, float in, float out[4])
struct ScrArea * CTX_wm_area(const bContext *C)
struct Scene * CTX_data_scene(const bContext *C)
struct ViewLayer * CTX_data_view_layer(const bContext *C)
struct Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C)
struct Object * CTX_data_active_object(const bContext *C)
struct View3D * CTX_wm_view3d(const bContext *C)
struct bScreen * CTX_wm_screen(const bContext *C)
struct ARegion * CTX_wm_region(const bContext *C)
void CTX_wm_operator_poll_msg_set(struct bContext *C, const char *msg)
struct Main * CTX_data_main(const bContext *C)
struct RegionView3D * CTX_wm_region_view3d(const bContext *C)
CustomData interface, see also DNA_customdata_types.h.
int CustomData_number_of_layers(const struct CustomData *data, int type)
int CustomData_get_clone_layer(const struct CustomData *data, int type)
bool CustomData_has_layer(const struct CustomData *data, int type)
void * CustomData_get_layer_named(const struct CustomData *data, int type, const char *name)
int CustomData_get_stencil_layer(const struct CustomData *data, int type)
void * CustomData_get_layer_n(const struct CustomData *data, int type, int n)
void * CustomData_get_layer(const struct CustomData *data, int type)
struct IDProperty * IDP_GetPropertyTypeFromGroup(const struct IDProperty *prop, const char *name, const char type) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
struct IDProperty * IDP_GetProperties(struct ID *id, const bool create_if_needed) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
bool IDP_AddToGroup(struct IDProperty *group, struct IDProperty *prop) ATTR_NONNULL()
struct IDProperty * IDP_GetPropertyFromGroup(const struct IDProperty *prop, const char *name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
struct IDProperty * IDP_New(const char type, const IDPropertyTemplate *val, const char *name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void BKE_image_release_ibuf(struct Image *ima, struct ImBuf *ibuf, void *lock)
bool BKE_image_has_ibuf(struct Image *ima, struct ImageUser *iuser)
struct ImBuf * BKE_image_acquire_ibuf(struct Image *ima, struct ImageUser *iuser, void **r_lock)
struct ImagePool * BKE_image_pool_new(void)
struct Image * BKE_image_add_generated(struct Main *bmain, unsigned int width, unsigned int height, const char *name, int depth, int floatbuf, short gen_type, const float color[4], const bool stereo3d, const bool is_data, const bool tiled)
void BKE_image_free_gputextures(struct Image *ima)
void BKE_image_mark_dirty(struct Image *image, struct ImBuf *ibuf)
#define IMA_SIGNAL_USER_NEW_IMAGE
void BKE_image_signal(struct Main *bmain, struct Image *ima, struct ImageUser *iuser, int signal)
struct Image * BKE_image_add_from_imbuf(struct Main *bmain, struct ImBuf *ibuf, const char *name)
void BKE_imageuser_default(struct ImageUser *iuser)
void BKE_image_pool_free(struct ImagePool *pool)
General operations, lookup, etc. for materials.
struct Material * BKE_object_material_get(struct Object *ob, short act)
@ BKE_MAT_ASSIGN_USERPREF
void BKE_texpaint_slot_refresh_cache(struct Scene *scene, struct Material *ma)
void BKE_object_material_assign(struct Main *bmain, struct Object *ob, struct Material *ma, short act, int assign_type)
struct Material * BKE_material_add(struct Main *bmain, const char *name)
struct Mesh * BKE_mesh_from_object(struct Object *ob)
#define BKE_MESH_TESSTRI_VINDEX_ORDER(_tri, _v)
struct Mesh * mesh_get_eval_final(struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob, const struct CustomData_MeshMasks *dataMask)
const struct MLoopTri * BKE_mesh_runtime_looptri_ensure(struct Mesh *mesh)
struct bNode * ntreeFindType(const struct bNodeTree *ntree, int type)
#define SH_NODE_BSDF_PRINCIPLED
#define SH_NODE_NORMAL_MAP
void nodePositionPropagate(struct bNode *node)
void ntreeUpdateTree(struct Main *main, struct bNodeTree *ntree)
void nodePositionRelative(struct bNode *from_node, struct bNode *to_node, struct bNodeSocket *from_sock, struct bNodeSocket *to_sock)
struct bNodeLink * nodeAddLink(struct bNodeTree *ntree, struct bNode *fromnode, struct bNodeSocket *fromsock, struct bNode *tonode, struct bNodeSocket *tosock)
struct bNodeSocket * nodeFindSocket(const struct bNode *node, eNodeSocketInOut in_out, const char *identifier)
struct bNode * nodeAddStaticNode(const struct bContext *C, struct bNodeTree *ntree, int type)
void nodeSetActive(struct bNodeTree *ntree, struct bNode *node)
struct Brush * BKE_paint_brush(struct Paint *paint)
void BKE_report(ReportList *reports, ReportType type, const char *message)
void BKE_reportf(ReportList *reports, ReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
int BKE_scene_num_threads(const struct Scene *scene)
bool BKE_scene_check_color_management_enabled(const struct Scene *scene)
struct ARegion * BKE_area_find_region_active_win(struct ScrArea *area)
struct ScrArea struct ScrArea * BKE_screen_find_big_area(struct bScreen *screen, const int spacetype, const short min)
void BLI_linklist_prepend_arena(LinkNode **listp, void *ptr, struct MemArena *ma) ATTR_NONNULL(1
#define LISTBASE_CIRCULAR_FORWARD_BEGIN(lb, lb_iter, lb_init)
#define LISTBASE_CIRCULAR_FORWARD_END(lb, lb_iter, lb_init)
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
#define LISTBASE_CIRCULAR_BACKWARD_BEGIN(lb, lb_iter, lb_init)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_insertlinkbefore(struct ListBase *listbase, void *vnextlink, void *vnewlink) ATTR_NONNULL(1)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define LISTBASE_CIRCULAR_BACKWARD_END(lb, lb_iter, lb_init)
MINLINE float saacos(float fac)
int pow_i(int base, int exp)
MINLINE int min_ii(int a, int b)
MINLINE float min_ff(float a, float b)
MINLINE int max_ii(int a, int b)
MINLINE int mod_i(int i, int n)
MINLINE float square_f(float a)
MINLINE float min_fff(float a, float b, float c)
MINLINE int square_s(short a)
MINLINE int count_bits_i(unsigned int n)
MINLINE void straight_to_premul_v4_v4(float premul[4], const float straight[4])
MINLINE void srgb_to_linearrgb_v3_v3(float linear[3], const float srgb[3])
MINLINE void straight_uchar_to_premul_float(float result[4], const unsigned char color[4])
MINLINE void premul_to_straight_v4(float color[4])
MINLINE void rgba_float_args_set(float col[4], const float r, const float g, const float b, const float a)
MINLINE void srgb_to_linearrgb_uchar4(float linear[4], const unsigned char srgb[4])
void rgba_uchar_to_float(float r_col[4], const unsigned char col_ub[4])
MINLINE void float_to_byte_dither_v3(unsigned char b[3], const float f[3], float dither, float s, float t)
MINLINE void premul_to_straight_v4_v4(float straight[4], const float premul[4])
MINLINE void linearrgb_to_srgb_v3_v3(float srgb[3], const float linear[3])
MINLINE void linearrgb_to_srgb_uchar3(unsigned char srgb[3], const float linear[3])
void rgb_float_to_uchar(unsigned char r_col[3], const float col_f[3])
MINLINE void premul_float_to_straight_uchar(unsigned char *result, const float color[4])
MINLINE void blend_color_add_float(float dst[4], const float src1[4], const float src2[4])
MINLINE void blend_color_interpolate_byte(unsigned char dst[4], const unsigned char src1[4], const unsigned char src2[4], float t)
MINLINE void blend_color_mix_float(float dst[4], const float src1[4], const float src2[4])
MINLINE void blend_color_mix_byte(unsigned char dst[4], const unsigned char src1[4], const unsigned char src2[4])
MINLINE void blend_color_interpolate_float(float dst[4], const float src1[4], const float src2[4], float t)
int isect_seg_seg_v2(const float v1[2], const float v2[2], const float v3[2], const float v4[2])
int isect_point_quad_v2(const float p[2], const float v1[2], const float v2[2], const float v3[2], const float v4[2])
MINLINE float area_tri_v2(const float v1[2], const float v2[2], const float v3[2])
void barycentric_weights_v2(const float v1[2], const float v2[2], const float v3[2], const float co[2], float w[3])
MINLINE float cross_tri_v2(const float v1[2], const float v2[2], const float v3[2])
bool isect_seg_seg_v2_simple(const float v1[2], const float v2[2], const float v3[2], const float v4[2])
float line_point_factor_v2(const float p[2], const float l1[2], const float l2[2])
float resolve_quad_u_v2(const float st[2], const float st0[2], const float st1[2], const float st2[2], const float st3[2])
int isect_seg_seg_v2_point(const float v0[2], const float v1[2], const float v2[2], const float v3[2], float vi[2])
void barycentric_weights_v2_persp(const float v1[4], const float v2[4], const float v3[4], const float co[2], float w[3])
float dist_squared_to_line_v2(const float p[2], const float l1[2], const float l2[2])
int isect_point_tri_v2(const float pt[2], const float v1[2], const float v2[2], const float v3[2])
float normal_tri_v3(float n[3], const float v1[3], const float v2[3], const float v3[3])
void mul_project_m4_v3(const float M[4][4], float vec[3])
void mul_m3_v3(const float M[3][3], float r[3])
void mul_m4_m4m4(float R[4][4], const float A[4][4], const float B[4][4])
void mul_m4_v4(const float M[4][4], float r[4])
void copy_m3_m4(float m1[3][3], const float m2[4][4])
bool invert_m4_m4(float R[4][4], const float A[4][4])
void mul_m4_v3(const float M[4][4], float r[3])
void copy_m4_m4(float m1[4][4], const float m2[4][4])
void mul_v3_m4v3(float r[3], const float M[4][4], const float v[3])
void normalize_m4(float R[4][4]) ATTR_NONNULL()
MINLINE void mul_v4_v4fl(float r[3], const float a[4], float f)
MINLINE void mul_v4_fl(float r[4], float f)
MINLINE void add_v4_v4(float r[4], const float a[4])
MINLINE void copy_v4_v4(float r[4], const float a[4])
void interp_v2_v2v2(float r[2], const float a[2], const float b[2], const float t)
void interp_v3_v3v3(float r[3], const float a[3], const float b[3], const float t)
MINLINE float len_squared_v2(const float v[2]) ATTR_WARN_UNUSED_RESULT
MINLINE float len_squared_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void mul_v2_v2v2(float r[2], const float a[2], const float b[2])
MINLINE void mul_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE float normalize_v3(float r[3])
MINLINE void mul_v3_v3(float r[3], const float a[3])
MINLINE void sub_v3_v3(float r[3], const float a[3])
void interp_v3_v3v3v3(float p[3], const float v1[3], const float v2[3], const float v3[3], const float w[3])
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void normal_short_to_float_v3(float r[3], const short n[3])
MINLINE void mul_v2_fl(float r[2], float f)
MINLINE void copy_v2_v2(float r[2], const float a[2])
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void copy_v3_v3(float r[3], const float a[3])
void interp_v2_v2v2v2(float r[2], const float a[2], const float b[2], const float c[2], const float t[3])
void minmax_v2v2_v2(float min[2], float max[2], const float vec[2])
MINLINE void add_v2_v2(float r[2], const float a[2])
void project_plane_v3_v3v3(float out[3], const float p[3], const float v_plane[3])
MINLINE float dot_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE bool equals_v2v2(const float v1[2], const float v2[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void negate_v3(float r[3])
MINLINE void zero_v4(float r[4])
MINLINE void add_v2_v2v2(float r[2], const float a[2], const float b[2])
MINLINE void sub_v2_v2v2(float r[2], const float a[2], const float b[2])
MINLINE float line_point_side_v2(const float l1[2], const float l2[2], const float pt[2]) ATTR_WARN_UNUSED_RESULT
MINLINE float dot_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void copy_v3_fl(float r[3], float f)
MINLINE float len_v2(const float a[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void zero_v3(float r[3])
MINLINE void add_v3_v3(float r[3], const float a[3])
void BLI_memarena_free(struct MemArena *ma) ATTR_NONNULL(1)
void * BLI_memarena_alloc(struct MemArena *ma, size_t size) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC ATTR_ALLOC_SIZE(2)
struct MemArena * BLI_memarena_new(const size_t bufsize, const char *name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(2) ATTR_MALLOC
bool BLI_rctf_isect_pt_v(const struct rctf *rect, const float xy[2])
size_t BLI_snprintf(char *__restrict dst, size_t maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
void BLI_task_pool_work_and_wait(TaskPool *pool)
TaskPool * BLI_task_pool_create_suspended(void *userdata, TaskPriority priority)
void BLI_task_pool_free(TaskPool *pool)
void BLI_task_pool_push(TaskPool *pool, TaskRunFunction run, void *taskdata, bool free_taskdata, TaskFreeFunction freedata)
pthread_spinlock_t SpinLock
void BLI_thread_unlock(int type)
void BLI_thread_lock(int type)
#define BLENDER_MAX_THREADS
void BLI_spin_init(SpinLock *spin)
void BLI_spin_unlock(SpinLock *spin)
void BLI_spin_lock(SpinLock *spin)
void BLI_spin_end(SpinLock *spin)
#define INIT_MINMAX2(min, max)
#define POINTER_FROM_INT(i)
#define POINTER_AS_INT(i)
Compatibility-like things for windows.
struct Depsgraph Depsgraph
void DEG_id_tag_update(struct ID *id, int flag)
struct Object * DEG_get_evaluated_object(const struct Depsgraph *depsgraph, struct Object *object)
struct Scene * DEG_get_evaluated_scene(const struct Depsgraph *graph)
@ ID_RECALC_COPY_ON_WRITE
#define ID_IS_LINKED(_id)
#define CD_MASK_ORIGINDEX
Object is a sort of wrapper for general info.
#define IMAGEPAINT_PROJECT_FLAT
#define IMAGEPAINT_PROJECT_LAYER_STENCIL
#define IMAGEPAINT_PROJECT_XRAY
#define IMAGEPAINT_PROJECT_LAYER_CLONE
@ IMAGEPAINT_MODE_MATERIAL
#define OBACT(_view_layer)
#define IMAGEPAINT_PROJECT_LAYER_STENCIL_INV
#define IMAGEPAINT_DRAWING
#define IMAGEPAINT_MISSING_STENCIL
#define IMAGEPAINT_PROJECT_BACKFACE
#define IMAGEPAINT_MISSING_MATERIAL
#define IMAGEPAINT_MISSING_UVS
#define IMAGEPAINT_MISSING_TEX
#define V3D_HIDE_HELPLINES
#define RV3D_CLIPPING_ENABLED(v3d, rv3d)
@ V3D_OVERLAY_HIDE_OBJECT_ORIGINS
@ V3D_OVERLAY_HIDE_MOTION_PATHS
@ V3D_OVERLAY_HIDE_OBJECT_XTRAS
@ V3D_OVERLAY_HIDE_CURSOR
void ED_node_shader_default(const struct bContext *C, struct ID *id)
struct Object * ED_object_active_context(const struct bContext *C)
#define ED_IMAGE_UNDO_TILE_NUMBER(size)
void ED_image_undo_push_begin(const char *name, int paint_mode)
void ED_image_paint_tile_lock_end(void)
void ED_image_paint_tile_lock_init(void)
#define ED_IMAGE_UNDO_TILE_SIZE
void ED_image_undo_push_end(void)
struct ListBase * ED_image_paint_tile_list_get(void)
void * ED_image_paint_tile_push(struct ListBase *paint_tiles, struct Image *image, struct ImBuf *ibuf, struct ImBuf **tmpibuf, struct ImageUser *iuser, int x_tile, int y_tile, unsigned short **r_mask, bool **r_valid, bool use_thread_lock, bool find_prev)
#define ED_IMAGE_UNDO_TILE_BITS
void ED_area_tag_redraw(ScrArea *area)
bool ED_operator_object_active_editable_mesh(struct bContext *C)
void ED_region_tag_redraw(struct ARegion *region)
void ED_uvedit_add_simple_uvs(struct Main *bmain, const struct Scene *scene, struct Object *ob)
void ED_view3d_ob_project_mat_get_from_obmat(const struct RegionView3D *rv3d, const float obmat[4][4], float r_pmat[4][4])
bool ED_view3d_autodist(struct Depsgraph *depsgraph, struct ARegion *region, struct View3D *v3d, const int mval[2], float mouse_worldloc[3], const bool alphaoverride, const float fallback_depth_pt[3])
bool ED_view3d_clip_range_get(struct Depsgraph *depsgraph, const struct View3D *v3d, const struct RegionView3D *rv3d, float *r_clipsta, float *r_clipend, const bool use_ortho_factor)
void ED_view3d_clipping_local(struct RegionView3D *rv3d, const float mat[4][4])
void view3d_operator_needs_opengl(const struct bContext *C)
bool ED_view3d_clipping_test(const struct RegionView3D *rv3d, const float co[3], const bool is_local)
struct ImBuf * ED_view3d_draw_offscreen_imbuf(struct Depsgraph *depsgraph, struct Scene *scene, eDrawType drawtype, struct View3D *v3d, struct ARegion *region, int sizex, int sizey, eImBufFlags imbuf_flag, int alpha_mode, const char *viewname, const bool restore_rv3d_mats, struct GPUOffScreen *ofs, char err_out[256])
int GPU_max_texture_size(void)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble z
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei width
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint i1
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble v1
BLI_INLINE float IMB_colormanagement_get_luminance(const float rgb[3])
void IMB_float_from_rect(struct ImBuf *ibuf)
void imb_freerectfloatImBuf(struct ImBuf *ibuf)
void bicubic_interpolation_color(struct ImBuf *in, unsigned char outI[4], float outF[4], float u, float v)
void IMB_rect_from_float(struct ImBuf *ibuf)
void IMB_freeImBuf(struct ImBuf *ibuf)
void imb_freerectImBuf(struct ImBuf *ibuf)
void bilinear_interpolation_color_wrap(struct ImBuf *in, unsigned char outI[4], float outF[4], float u, float v)
void IMB_blend_color_byte(unsigned char dst[4], const unsigned char src1[4], const unsigned char src2[4], IMB_BlendMode mode)
void IMB_blend_color_float(float dst[4], const float src1[4], const float src2[4], IMB_BlendMode mode)
Contains defines and structs used throughout the imbuf module.
Read Guarded memory(de)allocation.
#define MEM_SIZE_OPTIMAL(size)
Group RGB to Bright Vector Camera CLAMP
Group RGB to Bright Vector Camera Vector Combine Material Light Line Style Layer Add Ambient Diffuse Glossy Refraction Transparent Toon Principled Hair Volume Principled Light Particle Volume SH_NODE_BUMP
Group RGB to Bright Vector Camera Vector Combine Material Light Line Style Layer Add Ambient Diffuse Glossy Refraction Transparent Toon Principled Hair Volume Principled Light Particle Volume SH_NODE_TEX_IMAGE
Group RGB to Bright Vector Camera Vector Combine SH_NODE_OUTPUT_MATERIAL
const EnumPropertyItem * RNA_image_itemf(struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA *prop, bool *r_free)
Provides wrapper around system-specific atomic primitives, and some extensions (faked-atomic operatio...
ATOMIC_INLINE int32_t atomic_fetch_and_add_int32(int32_t *p, int32_t x)
ATTR_WARN_UNUSED_RESULT const BMVert * v2
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
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.
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
const Depsgraph * depsgraph
static CCL_NAMESPACE_BEGIN const double alpha
void *(* MEM_malloc_arrayN)(size_t len, size_t size, const char *str)
void(* MEM_freeN)(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
void *(* MEM_mallocN)(size_t len, const char *str)
MINLINE unsigned char unit_float_to_uchar_clamp(float val)
#define unit_float_to_uchar_clamp_v3(v1, v2)
static void area(int d1, int d2, int e1, int e2, float weights[2])
void paint_delete_blur_kernel(BlurKernel *kernel)
BlurKernel * paint_new_blur_kernel(Brush *br, bool proj)
void imapaint_image_update(SpaceImage *sima, Image *image, ImBuf *ibuf, ImageUser *iuser, short texpaint)
void paint_brush_init_tex(Brush *brush)
void set_imapaintpartial(struct ImagePaintPartialRedraw *ippr)
bool paint_use_opacity_masking(Brush *brush)
void paint_brush_color_get(struct Scene *scene, struct Brush *br, bool color_correction, bool invert, float distance, float pressure, float color[3], struct ColorManagedDisplay *display)
void paint_brush_exit_tex(Brush *brush)
static void do_projectpaint_soften(ProjPaintState *ps, ProjPixel *projPixel, float mask, MemArena *softenArena, LinkNode **softenPixels)
void * paint_proj_new_stroke(bContext *C, Object *ob, const float mouse[2], int mode)
static bool project_paint_clone_face_skip(ProjPaintState *ps, ProjPaintLayerClone *lc, const TexPaintSlot *slot, const int tri_index)
static bool project_bucket_point_occluded(const ProjPaintState *ps, LinkNode *bucketFace, const int orig_face, const float pixelScreenCo[4])
static void screen_px_from_ortho(const float uv[2], const float v1co[3], const float v2co[3], const float v3co[3], const float uv1co[2], const float uv2co[2], const float uv3co[2], float pixelScreenCo[4], float w[3])
static int project_paint_face_paint_tile(Image *ima, const float *uv)
static int project_paint_PickFace(const ProjPaintState *ps, const float pt[2], float w[3])
static bool project_bucket_face_isect(ProjPaintState *ps, int bucket_x, int bucket_y, const MLoopTri *lt)
static int project_bucket_offset(const ProjPaintState *ps, const float projCoSS[2])
static bool project_paint_PickColor(const ProjPaintState *ps, const float pt[2], float *rgba_fp, uchar *rgba, const bool interp)
static void image_paint_partial_redraw_expand(ImagePaintPartialRedraw *cell, const ProjPixel *projPixel)
static void project_paint_begin(const bContext *C, ProjPaintState *ps, const bool is_multi_view, const char symmetry_flag)
#define PROJ_SRC_VIEW_FILL
static int project_bucket_offset_safe(const ProjPaintState *ps, const float projCoSS[2])
static bool project_paint_winclip(const ProjPaintState *ps, const ProjPaintFaceCoSS *coSS)
static bool proj_paint_state_mesh_eval_init(const bContext *C, ProjPaintState *ps)
static void paint_proj_stroke_ps(const bContext *UNUSED(C), void *ps_handle_p, const float prev_pos[2], const float pos[2], const bool eraser, float pressure, float distance, float size, ProjPaintState *ps)
static Image * project_paint_face_clone_image(const ProjPaintState *ps, int tri_index)
static void proj_paint_state_screen_coords_init(ProjPaintState *ps, const int diameter)
static int texture_paint_add_texture_paint_slot_exec(bContext *C, wmOperator *op)
static Image * proj_paint_image_create(wmOperator *op, Main *bmain, bool is_data)
struct ProjectHandle ProjectHandle
struct ProjPixelClone ProjPixelClone
static void rect_to_uvspace_ortho(const rctf *bucket_bounds, const float *v1coSS, const float *v2coSS, const float *v3coSS, const float *uv1co, const float *uv2co, const float *uv3co, float bucket_bounds_uv[4][2], const int flip)
static bool add_simple_uvs_poll(bContext *C)
#define PROJ_VIEW_DATA_SIZE
static void project_paint_bleed_add_face_user(const ProjPaintState *ps, MemArena *arena, const MLoopTri *lt, const int tri_index)
static Material * get_or_create_current_material(bContext *C, Object *ob)
static bool IsectPT2Df_limit(const float pt[2], const float v1[2], const float v2[2], const float v3[2], const float limit)
static int add_simple_uvs_exec(bContext *C, wmOperator *UNUSED(op))
static int get_texture_layer_type(wmOperator *op, const char *prop_name)
void PAINT_OT_add_texture_paint_slot(wmOperatorType *ot)
static bool texture_paint_image_from_view_poll(bContext *C)
#define PROJ_BOUNDBOX_DIV
struct PrepareImageEntry PrepareImageEntry
static void do_projectpaint_mask(ProjPaintState *ps, ProjPixel *projPixel, float mask)
static void uvco_to_wrapped_pxco(const float uv[2], int ibuf_x, int ibuf_y, float *x, float *y)
static void project_face_pixel(const float *lt_tri_uv[3], ImBuf *ibuf_other, const float w[3], uchar rgba_ub[4], float rgba_f[4])
static void screen_px_from_persp(const float uv[2], const float v1co[4], const float v2co[4], const float v3co[4], const float uv1co[2], const float uv2co[2], const float uv3co[2], float pixelScreenCo[4], float w[3])
static int project_paint_undo_subtiles(const TileInfo *tinf, int tx, int ty)
static void project_paint_prepare_all_faces(ProjPaintState *ps, MemArena *arena, const ProjPaintFaceLookup *face_lookup, ProjPaintLayerClone *layer_clone, const MLoopUV *mloopuv_base, const bool is_multi_view)
static void project_bucket_init(const ProjPaintState *ps, const int thread_index, const int bucket_index, const rctf *clip_rect, const rctf *bucket_bounds)
static bool line_rect_clip(const rctf *rect, const float l1[4], const float l2[4], const float uv1[2], const float uv2[2], float uv[2], bool is_ortho)
static void proj_paint_face_lookup_init(const ProjPaintState *ps, ProjPaintFaceLookup *face_lookup)
static bool cmp_uv(const float vec2a[2], const float vec2b[2])
#define PS_LOOPTRI_AS_UV_3(uvlayer, lt)
#define PROJ_GEOM_TOLERANCE
static void partial_redraw_array_init(ImagePaintPartialRedraw *pr)
static void do_projectpaint_draw_f(ProjPaintState *ps, ProjPixel *projPixel, const float texrgb[3], float mask)
static void project_paint_build_proj_ima(ProjPaintState *ps, MemArena *arena, ListBase *used_images)
BLI_INLINE const MPoly * ps_tri_index_to_mpoly(const ProjPaintState *ps, int tri_index)
void ED_paint_data_warning(struct ReportList *reports, bool uvs, bool mat, bool tex, bool stencil)
#define PROJ_SRC_IMAGE_CAM
static void proj_paint_layer_clone_init(ProjPaintState *ps, ProjPaintLayerClone *layer_clone)
#define PROJ_FACE_NOSEAM0
static int line_isect_x(const float p1[2], const float p2[2], const float x_level, float *y_isect)
#define PROJ_BUCKET_BRUSH_DIV
#define PROJ_FACE_SEAM_INIT2
#define PROJ_BUCKET_RECT_MAX
BLI_INLINE uchar f_to_char(const float val)
struct ProjPaintState ProjPaintState
static int float_z_sort_flip(const void *p1, const void *p2)
#define PROJ_SRC_IMAGE_VIEW
static bool project_bucket_isect_circle(const float cent[2], const float radius_squared, const rctf *bucket_bounds)
static ProjPixel * project_paint_uvpixel_init(const ProjPaintState *ps, MemArena *arena, const TileInfo *tinf, int x_px, int y_px, const float mask, const int tri_index, const float pixelScreenCo[4], const float world_spaceCo[3], const float w[3])
static void do_projectpaint_smear(ProjPaintState *ps, ProjPixel *projPixel, float mask, MemArena *smearArena, LinkNode **smearPixels, const float co[2])
#define PROJ_FACE_WINDING_INIT
void PAINT_OT_add_simple_uvs(wmOperatorType *ot)
static bool project_bucket_iter_next(ProjPaintState *ps, int *bucket_index, rctf *bucket_bounds, const float mval[2])
#define PROJ_BUCKET_RECT_MIN
static bool project_paint_check_face_sel(const ProjPaintState *ps, const ProjPaintFaceLookup *face_lookup, const MLoopTri *lt)
static bool project_image_refresh_tagged(ProjPaintState *ps)
#define PROJ_FACE_WINDING_CW
static bool check_seam(const ProjPaintState *ps, const int orig_face, const int orig_i1_fidx, const int orig_i2_fidx, int *other_face, int *orig_fidx)
static int float_z_sort(const void *p1, const void *p2)
static void scale_tri(float insetCos[3][3], const float *origCos[3], const float inset)
static void proj_paint_state_cavity_init(ProjPaintState *ps)
static bool partial_redraw_array_merge(ImagePaintPartialRedraw *pr, ImagePaintPartialRedraw *pr_other, int tot)
static void project_paint_delayed_face_init(ProjPaintState *ps, const MLoopTri *lt, const int tri_index)
void paint_proj_stroke(const bContext *C, void *ps_handle_p, const float prev_pos[2], const float pos[2], const bool eraser, float pressure, float distance, float size)
static int project_paint_occlude_ptv(const float pt[3], const float v1[4], const float v2[4], const float v3[4], float w[3], const bool is_ortho)
bool ED_paint_proj_mesh_data_check(Scene *scene, Object *ob, bool *uvs, bool *mat, bool *tex, bool *stencil)
static void project_paint_end(ProjPaintState *ps)
static void get_default_texture_layer_name_for_object(Object *ob, int texture_type, char *dst, int dst_length)
void paint_proj_redraw(const bContext *C, void *ps_handle_p, bool final)
static void proj_paint_default_color(wmOperator *op, int type, Material *ma)
static int texture_paint_camera_project_exec(bContext *C, wmOperator *op)
static void project_face_winding_init(const ProjPaintState *ps, const int tri_index)
static int line_isect_y(const float p1[2], const float p2[2], const float y_level, float *x_isect)
struct ProjStrokeHandle ProjStrokeHandle
static bool pixel_bounds_array(float(*uv)[2], rcti *bounds_px, const int ibuf_x, const int ibuf_y, int tot)
static void partial_redraw_single_init(ImagePaintPartialRedraw *pr)
static void insert_seam_vert_array(const ProjPaintState *ps, MemArena *arena, const int tri_index, const int fidx1, const int ibuf_x, const int ibuf_y)
static float project_paint_uvpixel_mask(const ProjPaintState *ps, const int tri_index, const float w[3])
static void do_projectpaint_soften_f(ProjPaintState *ps, ProjPixel *projPixel, float mask, MemArena *softenArena, LinkNode **softenPixels)
static void project_paint_bucket_bounds(const ProjPaintState *ps, const float min[2], const float max[2], int bucketMin[2], int bucketMax[2])
static const EnumPropertyItem layer_type_items[]
#define PROJ_PIXEL_TOLERANCE
static int texture_paint_add_texture_paint_slot_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
static int texture_paint_image_from_view_exec(bContext *C, wmOperator *op)
static Image * project_paint_face_paint_image(const ProjPaintState *ps, int tri_index)
static void do_projectpaint_mask_f(ProjPaintState *ps, ProjPixel *projPixel, float mask)
union pixelStore PixelStore
static void do_projectpaint_thread(TaskPool *__restrict UNUSED(pool), void *ph_v)
static void paint_proj_begin_clone(ProjPaintState *ps, const float mouse[2])
static void proj_paint_state_seam_bleed_init(ProjPaintState *ps)
static VertSeam * find_adjacent_seam(const ProjPaintState *ps, uint loop_index, uint vert_index, VertSeam **r_seam)
struct ProjPaintImage ProjPaintImage
static void do_projectpaint_clone(ProjPaintState *ps, ProjPixel *projPixel, float mask)
#define PROJ_VIEW_DATA_ID
static void project_bucket_bounds(const ProjPaintState *ps, const int bucket_x, const int bucket_y, rctf *bucket_bounds)
static float len_squared_v2v2_alt(const float v1[2], const float v2_1, const float v2_2)
static int project_paint_pixel_sizeof(const short tool)
#define PROJ_PAINT_STATE_SHARED_CLEAR(ps)
#define PROJ_PAINT_STATE_SHARED_MEMCPY(ps_dst, ps_src)
static bool pixel_bounds_uv(const float uv_quad[4][2], rcti *bounds_px, const int ibuf_x, const int ibuf_y)
void PAINT_OT_project_image(wmOperatorType *ot)
static bool project_paint_op(void *state, const float lastpos[2], const float pos[2])
static float screen_px_line_point_factor_v2_persp(const ProjPaintState *ps, const float p[2], const float v1[3], const float v2[3])
union pixelPointer PixelPointer
static bool project_bucket_iter_init(ProjPaintState *ps, const float mval_f[2])
static bool proj_paint_add_slot(bContext *C, wmOperator *op)
static void do_projectpaint_draw(ProjPaintState *ps, ProjPixel *projPixel, const float texrgb[3], float mask, float dither, float u, float v)
static void copy_original_alpha_channel(ProjPixel *pixel, bool is_floatbuf)
static float VecZDepthOrtho(const float pt[2], const float v1[3], const float v2[3], const float v3[3], float w[3])
#define PROJ_BOUNDBOX_SQUARED
void paint_proj_stroke_done(void *ps_handle_p)
struct ProjPixel ProjPixel
static bool IsectPoly2Df(const float pt[2], const float uv[][2], const int tot)
static void project_face_seams_init(const ProjPaintState *ps, MemArena *arena, const int tri_index, const uint vert_index, bool init_all, const int ibuf_x, const int ibuf_y)
static TexPaintSlot * project_paint_face_paint_slot(const ProjPaintState *ps, int tri_index)
#define PROJ_FACE_SEAM_INIT0
static bool line_clip_rect2f(const rctf *cliprect, const rctf *rect, const float l1[2], const float l2[2], float l1_clip[2], float l2_clip[2])
static float VecZDepthPersp(const float pt[2], const float v1[4], const float v2[4], const float v3[4], float w[3])
static void proj_paint_state_vert_flags_init(ProjPaintState *ps)
#define PS_LOOPTRI_AS_VERT_INDEX_3(ps, lt)
static TexPaintSlot * project_paint_face_clone_slot(const ProjPaintState *ps, int tri_index)
#define PROJ_FACE_DEGENERATE
static int project_paint_occlude_ptv_clip(const float pt[3], const float v1[4], const float v2[4], const float v3[4], const float v1_3d[3], const float v2_3d[3], const float v3_3d[3], float w[3], const bool is_ortho, RegionView3D *rv3d)
static void proj_paint_face_coSS_init(const ProjPaintState *ps, const MLoopTri *lt, ProjPaintFaceCoSS *coSS)
static float compute_seam_normal(VertSeam *seam, VertSeam *adj, float r_no[2])
static bool IsectPoly2Df_twoside(const float pt[2], const float uv[][2], const int tot)
static void proj_paint_state_thread_init(ProjPaintState *ps, const bool reset_threads)
#define PS_LOOPTRI_ASSIGN_UV_3(uv_tri, uvlayer, lt)
static void screen_px_to_vector_persp(int winx, int winy, const float projmat_inv[4][4], const float view_pos[3], const float co_px[2], float r_dir[3])
static void project_bucket_clip_face(const bool is_ortho, const bool is_flip_object, const rctf *cliprect, const rctf *bucket_bounds, const float *v1coSS, const float *v2coSS, const float *v3coSS, const float *uv1co, const float *uv2co, const float *uv3co, float bucket_bounds_uv[8][2], int *tot, bool cull)
static void proj_paint_state_viewport_init(ProjPaintState *ps, const char symmetry_flag)
static void project_paint_face_init(const ProjPaintState *ps, const int thread_index, const int bucket_index, const int tri_index, const int image_index, const rctf *clip_rect, const rctf *bucket_bounds, ImBuf *ibuf, ImBuf **tmpibuf)
static bool project_paint_flt_max_cull(const ProjPaintState *ps, const ProjPaintFaceCoSS *coSS)
#define PROJ_FACE_SCALE_SEAM
void PAINT_OT_image_from_view(wmOperatorType *ot)
static void uv_image_outset(const ProjPaintState *ps, float(*orig_uv)[2], float(*puv)[2], uint tri_index, const int ibuf_x, const int ibuf_y)
static void project_state_init(bContext *C, Object *ob, ProjPaintState *ps, int mode)
struct LoopSeamData LoopSeamData
static void do_projectpaint_clone_f(ProjPaintState *ps, ProjPixel *projPixel, float mask)
#define PROJ_FACE_SEAM_INIT1
static void do_projectpaint_smear_f(ProjPaintState *ps, ProjPixel *projPixel, float mask, MemArena *smearArena, LinkNode **smearPixels_f, const float co[2])
static void rect_to_uvspace_persp(const rctf *bucket_bounds, const float *v1coSS, const float *v2coSS, const float *v3coSS, const float *uv1co, const float *uv2co, const float *uv3co, float bucket_bounds_uv[4][2], const int flip)
void RNA_string_set(PointerRNA *ptr, const char *name, const char *value)
void RNA_float_get_array(PointerRNA *ptr, const char *name, float *values)
void RNA_string_get(PointerRNA *ptr, const char *name, char *value)
int RNA_int_get(PointerRNA *ptr, const char *name)
int RNA_enum_from_value(const EnumPropertyItem *item, const int value)
bool RNA_struct_property_is_set(PointerRNA *ptr, const char *identifier)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
void RNA_float_set_array(PointerRNA *ptr, const char *name, const float *values)
int RNA_enum_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_string_file_name(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, int maxlen, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, int maxlen, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_float_color(StructOrFunctionRNA *cont_, const char *identifier, int len, const float *default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, int default_value, int hardmin, int hardmax, const char *ui_name, const char *ui_description, int softmin, int softmax)
void RNA_def_enum_funcs(PropertyRNA *prop, EnumPropertyItemFunc itemfunc)
void RNA_def_property_subtype(PropertyRNA *prop, PropertySubType subtype)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_float_array_default(PropertyRNA *prop, const float *array)
const EnumPropertyItem rna_enum_image_generated_type_items[]
const EnumPropertyItem DummyRNA_NULL_items[]
struct ColorBand * gradient
short screen_grab_size[2]
struct bNodeTree * nodetree
struct TexPaintSlot * texpaintslot
struct MLoopTri_Store looptris
struct CustomData pdata ldata
struct CurveMapping * cavity_curve
struct PrepareImageEntry * next
struct PrepareImageEntry * prev
const int * index_mp_to_orig
ImagePaintPartialRedraw * partRedrawRect
volatile void ** undoRect
const TexPaintSlot * slot_last_clone
const TexPaintSlot * slot_clone
const MLoopUV * mloopuv_clone_base
LoopSeamData * loopSeamData
const MLoopUV ** poly_to_loop_uv_clone
const MLoopUV ** poly_to_loop_uv
float paint_color_linear[3]
bool reproject_ibuf_free_float
struct CurveMapping * cavity_curve
float projectMatInv[4][4]
const MLoopUV * mloopuv_stencil_eval
ProjPaintImage * projImages
MemArena * arena_mt[BLENDER_MAX_THREADS]
const MLoopTri * mlooptri_eval
bool do_layer_stencil_inv
bool reproject_ibuf_free_uchar
float normal_angle_inner__cos
bool is_clone_cursor_pick
struct ProjPaintState * ps_views[8]
ProjPaintImage * projImages
struct CustomData_MeshMasks customdata_mask
struct ToolSettings * toolsettings
float average_stroke_accum[3]
int average_stroke_counter
float texture_paint_mode_opacity
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
struct ReportList * reports
struct wmOperatorType * type
struct IDPropertyTemplate::@28 array
ccl_device_inline float distance(const float2 &a, const float2 &b)
ccl_device_inline float2 interp(const float2 &a, const float2 &b, float t)
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
int WM_operator_props_dialog_popup(bContext *C, wmOperator *op, int width)
int WM_enum_search_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))