41 static const int directions[8][2];
42 static const int distances[8];
66 const float uv_offset[2],
84 pixel_data_.
resize(w_ * h_, 0xFFFFFFFF);
100 pixel_data_[
y * w_ +
x] = value;
105 if (
x < 0 || y < 0 || x >= w_ ||
y >= h_) {
109 return pixel_data_[
y * w_ +
x];
116 value_to_store_ = value;
123 void *
map,
int x,
int y, [[maybe_unused]]
float u, [[maybe_unused]]
float v)
129 m->mask_[
y * m->w_ +
x] = 1;
138 #define PackDijkstraPixel(dist, dir) (0x80000000 + ((dist) << 4) + (dir))
139 #define DijkstraPixelGetDistance(dp) (((dp) ^ 0x80000000) >> 4)
140 #define DijkstraPixelGetDirection(dp) ((dp)&0xF)
141 #define IsDijkstraPixel(dp) ((dp)&0x80000000)
142 #define DijkstraPixelIsUnset(dp) ((dp) == 0xFFFFFFFF)
150 class DijkstraActivePixel {
152 DijkstraActivePixel(
int dist,
int _x,
int _y) :
distance(dist),
x(_x),
y(_y)
158 auto cmp_dijkstrapixel_fun = [](DijkstraActivePixel
const &a1, DijkstraActivePixel
const &a2) {
159 return a1.distance > a2.distance;
163 for (
int y = 0;
y < h_;
y++) {
164 for (
int x = 0;
x < w_;
x++) {
166 for (
int i = 0; i < 8; i++) {
167 int xx =
x - directions[i][0];
168 int yy =
y - directions[i][1];
172 active_pixels.
append(DijkstraActivePixel(distances[i],
x,
y));
182 std::make_heap(active_pixels.
begin(), active_pixels.
end(), cmp_dijkstrapixel_fun);
185 while (active_pixels.
size()) {
186 std::pop_heap(active_pixels.
begin(), active_pixels.
end(), cmp_dijkstrapixel_fun);
187 DijkstraActivePixel p = active_pixels.
pop_last();
189 int dist = p.distance;
191 if (dist < 2 * (margin + 1)) {
192 for (
int i = 0; i < 8; i++) {
193 int x = p.x + directions[i][0];
194 int y = p.y + directions[i][1];
195 if (
x >= 0 && x < w_ && y >= 0 &&
y < h_) {
200 active_pixels.
append(DijkstraActivePixel(dist + distances[i],
x,
y));
201 std::push_heap(active_pixels.
begin(), active_pixels.
end(), cmp_dijkstrapixel_fun);
216 for (
int y = 0;
y < h_;
y++) {
217 for (
int x = 0;
x < w_;
x++) {
228 xx -= directions[direction][0];
229 yy -= directions[direction][1];
231 dist -= distances[direction];
243 bool found_pixel_in_polygon =
false;
244 if (lookup_pixel_polygon_neighbourhood(
x,
y, &poly, &destX, &destY, &other_poly)) {
246 for (
int i = 0; i < maxPolygonSteps; i++) {
248 int nx = (int)round(destX);
249 int ny = (int)round(destY);
251 if (other_poly == polygon_from_map) {
252 found_pixel_in_polygon =
true;
258 if (!lookup_pixel(nx,
ny, other_poly, &destX, &destY, &other_poly, &dist_to_edge)) {
259 found_pixel_in_polygon =
false;
264 if (found_pixel_in_polygon) {
285 ret.x = (((mloopuv.
uv[0] - uv_offset_[0]) * w_) - (0.5f + 0.001f));
286 ret.y = (((mloopuv.
uv[1] - uv_offset_[1]) * h_) - (0.5f + 0.001f));
292 loop_to_poly_map_.
resize(totloop_);
293 for (
int i = 0; i < totpoly_; i++) {
294 for (
int j = 0; j < mpoly_[i].
totloop; j++) {
296 loop_to_poly_map_[
l] = i;
300 loop_adjacency_map_.
resize(totloop_, -1);
303 tmpmap.resize(totedge_, -1);
305 for (
size_t i = 0; i < totloop_; i++) {
306 int edge = mloop_[i].
e;
307 if (tmpmap[edge] == -1) {
308 loop_adjacency_map_[i] = -1;
313 loop_adjacency_map_[i] = tmpmap[
edge];
314 loop_adjacency_map_[tmpmap[
edge]] = i;
325 bool lookup_pixel_polygon_neighbourhood(
326 float x,
float y,
uint32_t *r_start_poly,
float *r_destx,
float *r_desty,
int *r_other_poly)
329 if (lookup_pixel(
x,
y, *r_start_poly, r_destx, r_desty, r_other_poly, &found_dist)) {
333 int loopstart = mpoly_[*r_start_poly].
loopstart;
334 int totloop = mpoly_[*r_start_poly].
totloop;
339 float mindist = -1.0f;
344 for (
int i = 0; i < totloop; i++) {
345 int otherloop = loop_adjacency_map_[i + loopstart];
351 uint32_t poly = loop_to_poly_map_[otherloop];
353 if (lookup_pixel(
x,
y, poly, &destx, &desty, &foundpoly, &found_dist)) {
354 if (mindist < 0.f || found_dist < mindist) {
355 mindist = found_dist;
356 *r_other_poly = foundpoly;
359 *r_start_poly = poly;
364 return mindist >= 0.0f;
373 bool lookup_pixel(
float x,
379 float *r_dist_to_edge)
383 *r_destx = *r_desty = 0;
386 float found_dist = -1;
391 for (
size_t i = 0; i < mpoly_[src_poly].
totloop; i++) {
394 if (l2 >= mpoly_[src_poly].loopstart + mpoly_[src_poly].totloop) {
398 float2 edgepoint1 = uv_to_xy(mloopuv_[l1]);
399 float2 edgepoint2 = uv_to_xy(mloopuv_[l2]);
402 float2 ab = edgepoint2 - edgepoint1;
410 float t = dotv / ablensq;
412 if (
t >= 0.0 &&
t <= 1.0) {
415 float2 reflect_point = edgepoint1 + (
t * ab);
419 float reflectLen =
sqrt(reflect_vec[0] * reflect_vec[0] + reflect_vec[1] * reflect_vec[1]);
420 float cross = ab[0] * reflect_vec[1] - ab[1] * reflect_vec[0];
424 bool valid = (
cross > 0.0);
426 if (valid && (found_dist < 0 || reflectLen < found_dist)) {
428 found_dist = reflectLen;
430 found_edge = i + mpoly_[src_poly].
loopstart;
435 if (found_edge < 0) {
439 *r_dist_to_edge = found_dist;
442 int other_edge = loop_adjacency_map_[found_edge];
444 if (other_edge < 0) {
448 int dst_poly = loop_to_poly_map_[other_edge];
451 *r_other_poly = dst_poly;
454 int other_edge2 = other_edge + 1;
455 if (other_edge2 >= mpoly_[dst_poly].loopstart + mpoly_[dst_poly].totloop) {
456 other_edge2 = mpoly_[dst_poly].
loopstart;
459 float2 other_edgepoint1 = uv_to_xy(mloopuv_[other_edge]);
460 float2 other_edgepoint2 = uv_to_xy(mloopuv_[other_edge2]);
463 float2 other_ab = other_edgepoint1 - other_edgepoint2;
464 float2 other_reflect_point = other_edgepoint2 + (found_t * other_ab);
465 float2 perpendicular_other_ab;
466 perpendicular_other_ab.
x = other_ab.
y;
467 perpendicular_other_ab.y = -other_ab.
x;
471 float2 new_point = other_reflect_point + (found_dist /
math::length(perpendicular_other_ab)) *
472 perpendicular_other_ab;
474 *r_destx = new_point.
x;
475 *r_desty = new_point.
y;
481 const int TextureMarginMap::directions[8][2] = {
482 {-1, 0}, {-1, -1}, {0, -1}, {1, -1}, {1, 0}, {1, 1}, {0, 1}, {-1, 1}};
483 const int TextureMarginMap::distances[8] = {2, 3, 2, 3, 2, 3, 2, 3};
490 char const *uv_layer,
491 const float uv_offset[2])
497 int totpoly, totloop, totedge;
511 if ((uv_layer ==
nullptr) || (uv_layer[0] ==
'\0')) {
516 mloopuv =
static_cast<const MLoopUV *
>(
524 looptri = looptri_mem;
541 ibuf->
x, ibuf->
y, uv_offset, mpoly, mloop, mloopuv, totpoly, totloop, totedge);
543 bool draw_new_mask =
false;
551 draw_new_mask =
true;
554 for (
int i = 0; i < tottri; i++) {
558 for (
int a = 0;
a < 3;
a++) {
559 const float *uv = mloopuv[lt->
tri[
a]].
uv;
565 vec[
a][0] = (uv[0] - uv_offset[0]) * (
float)ibuf->
x - (0.5f + 0.001f);
566 vec[
a][1] = (uv[1] - uv_offset[1]) * (
float)ibuf->
y - (0.5f + 0.002f);
572 map.rasterize_tri(vec[0], vec[1], vec[2], lt->
poly, draw_new_mask ?
mask :
nullptr);
581 map.grow_dijkstra(margin);
585 map.lookup_pixels(ibuf,
mask, 3);
606 char const *uv_layer,
607 const float uv_offset[2])
610 ibuf,
mask, margin, me,
nullptr, uv_layer, uv_offset);
617 ibuf,
mask, margin,
nullptr, dm,
nullptr, uv_offset);
CustomData interface, see also DNA_customdata_types.h.
void * CustomData_get_layer_n(const struct CustomData *data, int type, int n)
void * CustomData_get_layer(const struct CustomData *data, int type)
int CustomData_get_named_layer(const struct CustomData *data, int type, const char *name)
void BKE_mesh_recalc_looptri(const struct MLoop *mloop, const struct MPoly *mpoly, const struct MVert *mvert, int totloop, int totpoly, struct MLoopTri *mlooptri)
MINLINE int poly_to_tri_count(int poly_count, int corner_count)
MINLINE void copy_v2_v2(float r[2], const float a[2])
_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 ny
_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 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 GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble t
_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
void IMB_filter_extend(struct ImBuf *ibuf, char *mask, int filter)
Contains defines and structs used throughout the imbuf module.
Read Guarded memory(de)allocation.
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Sky Generate a procedural sky texture Noise Generate fractal Perlin noise Wave Generate procedural bands or rings with noise Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a point
ATTR_WARN_UNUSED_RESULT const BMVert * v2
ATTR_WARN_UNUSED_RESULT const BMLoop * l
ATTR_WARN_UNUSED_RESULT const BMVert * v
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
void append(const T &value)
void resize(const int64_t new_size)
void set_pixel(int x, int y, uint32_t value)
static void zscan_store_pixel(void *map, int x, int y, [[maybe_unused]] float u, [[maybe_unused]] float v)
void grow_dijkstra(int margin)
void lookup_pixels(ImBuf *ibuf, char *mask, int maxPolygonSteps)
void rasterize_tri(float *v1, float *v2, float *v3, uint32_t value, char *mask)
uint32_t get_pixel(int x, int y) const
TextureMarginMap(size_t w, size_t h, const float uv_offset[2], MPoly const *mpoly, MLoop const *mloop, MLoopUV const *mloopuv, int totpoly, int totloop, int totedge)
void(* MEM_freeN)(void *vmemh)
void *(* MEM_dupallocN)(const void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
void *(* MEM_mallocN)(size_t len, const char *str)
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)
BLI_INLINE void bilinear_interpolation(const unsigned char *byte_buffer, const float *float_buffer, unsigned char *byte_output, float *float_output, int width, int height, int components, float u, float v, bool wrap_x, bool wrap_y)
void zbuf_alloc_span(ZSpan *zspan, int rectx, int recty, float clipcrop)
void zbuf_free_span(ZSpan *zspan)
T dot(const vec_base< T, Size > &a, const vec_base< T, Size > &b)
vec_base< T, 3 > cross(const vec_base< T, 3 > &a, const vec_base< T, 3 > &b)
T length(const vec_base< T, Size > &a)
T distance(const T &a, const T &b)
T length_squared(const vec_base< T, Size > &a)
static void generate_margin(ImBuf *ibuf, char *mask, const int margin, const Mesh *me, DerivedMesh *dm, char const *uv_layer, const float uv_offset[2])
SocketIndexByIdentifierMap * map
struct MLoop *(* getLoopArray)(DerivedMesh *dm)
const struct MLoopTri *(* getLoopTriArray)(DerivedMesh *dm)
int(* getNumLoopTri)(DerivedMesh *dm)
int(* getNumPolys)(DerivedMesh *dm)
int(* getNumEdges)(DerivedMesh *dm)
void *(* getLoopDataArray)(DerivedMesh *dm, int type)
struct MPoly *(* getPolyArray)(DerivedMesh *dm)
int(* getNumLoops)(DerivedMesh *dm)
#define PackDijkstraPixel(dist, dir)
void RE_generate_texturemargin_adjacentfaces_dm(ImBuf *ibuf, char *mask, const int margin, DerivedMesh *dm, const float uv_offset[2])
#define DijkstraPixelIsUnset(dp)
#define DijkstraPixelGetDistance(dp)
void RE_generate_texturemargin_adjacentfaces(ImBuf *ibuf, char *mask, const int margin, const Mesh *me, char const *uv_layer, const float uv_offset[2])
#define DijkstraPixelGetDirection(dp)
#define IsDijkstraPixel(dp)
void zspan_scanconvert(ZSpan *zspan, void *handle, float *v1, float *v2, float *v3, void(*func)(void *, int, int, float, float))