Blender  V3.3
voronoi_2d.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2012 Blender Foundation. All rights reserved. */
3 
11 #include "MEM_guardedalloc.h"
12 
13 #include "BLI_listbase.h"
14 #include "BLI_math.h"
15 #include "BLI_utildefines.h"
16 #include "BLI_voronoi_2d.h"
17 
18 #define VORONOI_EPS 1e-2f
19 
20 enum {
23 };
24 
25 typedef struct VoronoiEvent {
26  struct VoronoiEvent *next, *prev;
27 
28  int type; /* type of event (site or circle) */
29  float site[2]; /* site for which event was generated */
30 
31  struct VoronoiParabola *parabola; /* parabola for which event was generated */
33 
34 typedef struct VoronoiParabola {
38  float site[2];
39  bool is_leaf;
41 
42 typedef struct VoronoiProcess {
45  int width, height;
46  float current_y;
48 
49 /* event */
50 
52 {
53  VoronoiEvent *current_event = process->queue.first;
54 
55  while (current_event) {
56  if (current_event->site[1] < event->site[1]) {
57  break;
58  }
59  if (current_event->site[1] == event->site[1]) {
60  event->site[1] -= VORONOI_EPS;
61  }
62 
63  current_event = current_event->next;
64  }
65 
66  BLI_insertlinkbefore(&process->queue, current_event, event);
67 }
68 
69 /* edge */
70 static VoronoiEdge *voronoiEdge_new(const float start[2],
71  const float left[2],
72  const float right[2])
73 {
74  VoronoiEdge *edge = MEM_callocN(sizeof(VoronoiEdge), "voronoi edge");
75 
76  copy_v2_v2(edge->start, start);
77  copy_v2_v2(edge->left, left);
78  copy_v2_v2(edge->right, right);
79 
80  edge->neighbor = NULL;
81  edge->end[0] = 0;
82  edge->end[1] = 0;
83 
84  edge->f = (right[0] - left[0]) / (left[1] - right[1]);
85  edge->g = start[1] - edge->f * start[0];
86 
87  edge->direction[0] = right[1] - left[1];
88  edge->direction[1] = -(right[0] - left[0]);
89 
90  return edge;
91 }
92 
93 /* parabola */
94 
96 {
97  VoronoiParabola *parabola = MEM_callocN(sizeof(VoronoiParabola), "voronoi parabola");
98 
99  parabola->is_leaf = false;
100  parabola->event = NULL;
101  parabola->edge = NULL;
102  parabola->parent = NULL;
103 
104  return parabola;
105 }
106 
107 static VoronoiParabola *voronoiParabola_newSite(const float site[2])
108 {
109  VoronoiParabola *parabola = MEM_callocN(sizeof(VoronoiParabola), "voronoi parabola site");
110 
111  copy_v2_v2(parabola->site, site);
112  parabola->is_leaf = true;
113  parabola->event = NULL;
114  parabola->edge = NULL;
115  parabola->parent = NULL;
116 
117  return parabola;
118 }
119 
120 /* returns the closest leave which is on the left of current node */
122 {
123  VoronoiParabola *current_parabola;
124 
125  if (!parabola) {
126  return NULL;
127  }
128 
129  current_parabola = parabola->left;
130  while (!current_parabola->is_leaf) {
131  current_parabola = current_parabola->right;
132  }
133 
134  return current_parabola;
135 }
136 
137 /* returns the closest leave which is on the right of current node */
139 {
140  VoronoiParabola *current_parabola;
141 
142  if (!parabola) {
143  return NULL;
144  }
145 
146  current_parabola = parabola->right;
147  while (!current_parabola->is_leaf) {
148  current_parabola = current_parabola->left;
149  }
150 
151  return current_parabola;
152 }
153 
154 /* returns the closest parent which is on the left */
156 {
157  VoronoiParabola *current_par = parabola->parent;
158  VoronoiParabola *last_parabola = parabola;
159 
160  while (current_par->left == last_parabola) {
161  if (!current_par->parent) {
162  return NULL;
163  }
164 
165  last_parabola = current_par;
166  current_par = current_par->parent;
167  }
168 
169  return current_par;
170 }
171 
172 /* returns the closest parent which is on the right */
174 {
175  VoronoiParabola *current_parabola = parabola->parent;
176  VoronoiParabola *last_parabola = parabola;
177 
178  while (current_parabola->right == last_parabola) {
179  if (!current_parabola->parent) {
180  return NULL;
181  }
182 
183  last_parabola = current_parabola;
184  current_parabola = current_parabola->parent;
185  }
186 
187  return current_parabola;
188 }
189 
191 {
192  parabola->left = left;
193  left->parent = parabola;
194 }
195 
197 {
198  parabola->right = right;
199  right->parent = parabola;
200 }
201 
202 static float voronoi_getY(VoronoiProcess *process, const float p[2], float x)
203 {
204  float ly = process->current_y;
205 
206  float dp = 2 * (p[1] - ly);
207  float a1 = 1 / dp;
208  float b1 = -2 * p[0] / dp;
209  float c1 = ly + dp / 4 + p[0] * p[0] / dp;
210 
211  return a1 * x * x + b1 * x + c1;
212 }
213 
215 {
218  float p[2], r[2];
219  float dp, a1, b1, c1, a2, b2, c2, a, b, c, disc, ry, x1, x2;
220  float ly = process->current_y;
221 
222  copy_v2_v2(p, left->site);
223  copy_v2_v2(r, right->site);
224 
225  dp = 2.0f * (p[1] - y);
226  a1 = 1.0f / dp;
227  b1 = -2.0f * p[0] / dp;
228  c1 = y + dp / 4 + p[0] * p[0] / dp;
229 
230  dp = 2.0f * (r[1] - y);
231  a2 = 1.0f / dp;
232  b2 = -2.0f * r[0] / dp;
233  c2 = ly + dp / 4 + r[0] * r[0] / dp;
234 
235  a = a1 - a2;
236  b = b1 - b2;
237  c = c1 - c2;
238 
239  disc = b * b - 4 * a * c;
240  x1 = (-b + sqrtf(disc)) / (2 * a);
241  x2 = (-b - sqrtf(disc)) / (2 * a);
242 
243  if (p[1] < r[1]) {
244  ry = max_ff(x1, x2);
245  }
246  else {
247  ry = min_ff(x1, x2);
248  }
249 
250  return ry;
251 }
252 
254 {
255  VoronoiParabola *par = process->root;
256  float x = 0.0f;
257  float ly = process->current_y;
258 
259  while (!par->is_leaf) {
260  x = voronoi_getXOfEdge(process, par, ly);
261 
262  if (x > xx) {
263  par = par->left;
264  }
265  else {
266  par = par->right;
267  }
268  }
269 
270  return par;
271 }
272 
274 {
275  float x = (b->g - a->g) / (a->f - b->f);
276  float y = a->f * x + a->g;
277 
278  if ((x - a->start[0]) / a->direction[0] < 0) {
279  return 0;
280  }
281 
282  if ((y - a->start[1]) / a->direction[1] < 0) {
283  return 0;
284  }
285 
286  if ((x - b->start[0]) / b->direction[0] < 0) {
287  return 0;
288  }
289 
290  if ((y - b->start[1]) / b->direction[1] < 0) {
291  return 0;
292  }
293 
294  p[0] = x;
295  p[1] = y;
296 
297  return 1;
298 }
299 
301 {
304 
307 
308  VoronoiEvent *event;
309 
310  float ly = process->current_y;
311  float s[2], dx, dy, d;
312 
313  if (!a || !c || len_squared_v2v2(a->site, c->site) < VORONOI_EPS) {
314  return;
315  }
316 
317  if (!voronoi_getEdgeIntersection(lp->edge, rp->edge, s)) {
318  return;
319  }
320 
321  dx = a->site[0] - s[0];
322  dy = a->site[1] - s[1];
323 
324  d = sqrtf((dx * dx) + (dy * dy));
325 
326  if (s[1] - d >= ly) {
327  return;
328  }
329 
330  event = MEM_callocN(sizeof(VoronoiEvent), "voronoi circle event");
331 
332  event->type = voronoiEventType_Circle;
333 
334  event->site[0] = s[0];
335  event->site[1] = s[1] - d;
336 
337  b->event = event;
338  event->parabola = b;
339 
341 }
342 
343 static void voronoi_addParabola(VoronoiProcess *process, float site[2])
344 {
345  VoronoiParabola *root = process->root;
346  VoronoiParabola *par, *p0, *p1, *p2;
347  VoronoiEdge *el, *er;
348  float start[2];
349 
350  if (!process->root) {
351  process->root = voronoiParabola_newSite(site);
352 
353  return;
354  }
355 
356  if (root->is_leaf && root->site[1] - site[1] < 0) {
357  float *fp = root->site;
358  float s[2];
359 
360  root->is_leaf = false;
363 
364  s[0] = (site[0] + fp[0]) / 2.0f;
365  s[1] = process->height;
366 
367  if (site[0] > fp[0]) {
368  root->edge = voronoiEdge_new(s, fp, site);
369  }
370  else {
371  root->edge = voronoiEdge_new(s, site, fp);
372  }
373 
374  BLI_addtail(&process->edges, root->edge);
375 
376  return;
377  }
378 
379  par = voronoi_getParabolaByX(process, site[0]);
380 
381  if (par->event) {
382  BLI_freelinkN(&process->queue, par->event);
383 
384  par->event = NULL;
385  }
386 
387  start[0] = site[0];
388  start[1] = voronoi_getY(process, par->site, site[0]);
389 
390  el = voronoiEdge_new(start, par->site, site);
391  er = voronoiEdge_new(start, site, par->site);
392 
393  el->neighbor = er;
394  BLI_addtail(&process->edges, el);
395 
396  par->edge = er;
397  par->is_leaf = false;
398 
399  p0 = voronoiParabola_newSite(par->site);
400  p1 = voronoiParabola_newSite(site);
401  p2 = voronoiParabola_newSite(par->site);
402 
403  voronoiParabola_setRight(par, p2);
405  par->left->edge = el;
406 
407  voronoiParabola_setLeft(par->left, p0);
408  voronoiParabola_setRight(par->left, p1);
409 
412 }
413 
415 {
416  VoronoiParabola *p1 = event->parabola;
417 
420 
423 
424  VoronoiParabola *higher = NULL, *par, *gparent;
425 
426  float p[2];
427 
428  if (p0->event) {
429  BLI_freelinkN(&process->queue, p0->event);
430  p0->event = NULL;
431  }
432 
433  if (p2->event) {
434  BLI_freelinkN(&process->queue, p2->event);
435  p2->event = NULL;
436  }
437 
438  p[0] = event->site[0];
439  p[1] = voronoi_getY(process, p1->site, event->site[0]);
440 
441  copy_v2_v2(xl->edge->end, p);
442  copy_v2_v2(xr->edge->end, p);
443 
444  par = p1;
445  while (par != process->root) {
446  par = par->parent;
447 
448  if (par == xl) {
449  higher = xl;
450  }
451  if (par == xr) {
452  higher = xr;
453  }
454  }
455 
456  higher->edge = voronoiEdge_new(p, p0->site, p2->site);
457  BLI_addtail(&process->edges, higher->edge);
458 
459  gparent = p1->parent->parent;
460  if (p1->parent->left == p1) {
461  if (gparent->left == p1->parent) {
462  voronoiParabola_setLeft(gparent, p1->parent->right);
463  }
464  if (gparent->right == p1->parent) {
465  voronoiParabola_setRight(gparent, p1->parent->right);
466  }
467  }
468  else {
469  if (gparent->left == p1->parent) {
470  voronoiParabola_setLeft(gparent, p1->parent->left);
471  }
472  if (gparent->right == p1->parent) {
473  voronoiParabola_setRight(gparent, p1->parent->left);
474  }
475  }
476 
477  MEM_freeN(p1->parent);
478  MEM_freeN(p1);
479 
482 }
483 
485 {
486  float mx;
487 
488  if (parabola->is_leaf) {
489  MEM_freeN(parabola);
490  return;
491  }
492 
493  if (parabola->edge->direction[0] > 0.0f) {
494  mx = max_ff(process->width, parabola->edge->start[0] + 10);
495  }
496  else {
497  mx = min_ff(0.0f, parabola->edge->start[0] - 10.0f);
498  }
499 
500  parabola->edge->end[0] = mx;
501  parabola->edge->end[1] = mx * parabola->edge->f + parabola->edge->g;
502 
503  voronoi_finishEdge(process, parabola->left);
504  voronoi_finishEdge(process, parabola->right);
505 
506  MEM_freeN(parabola);
507 }
508 
509 static void voronoi_clampEdgeVertex(int width, int height, float *coord, float *other_coord)
510 {
511  const float corners[4][2] = {
512  {0.0f, 0.0f}, {width - 1, 0.0f}, {width - 1, height - 1}, {0.0f, height - 1}};
513  int i;
514 
515  if (IN_RANGE_INCL(coord[0], 0, width - 1) && IN_RANGE_INCL(coord[1], 0, height - 1)) {
516  return;
517  }
518 
519  for (i = 0; i < 4; i++) {
520  float v1[2], v2[2];
521  float p[2];
522 
523  copy_v2_v2(v1, corners[i]);
524 
525  if (i == 3) {
526  copy_v2_v2(v2, corners[0]);
527  }
528  else {
529  copy_v2_v2(v2, corners[i + 1]);
530  }
531 
532  if (isect_seg_seg_v2_point(v1, v2, coord, other_coord, p) == 1) {
533  if (i == 0 && coord[1] > p[1]) {
534  continue;
535  }
536  if (i == 1 && coord[0] < p[0]) {
537  continue;
538  }
539  if (i == 2 && coord[1] < p[1]) {
540  continue;
541  }
542  if (i == 3 && coord[0] > p[0]) {
543  continue;
544  }
545 
546  copy_v2_v2(coord, p);
547  }
548  }
549 }
550 
551 static void voronoi_clampEdges(ListBase *edges, int width, int height, ListBase *clamped_edges)
552 {
553  VoronoiEdge *edge;
554 
555  edge = edges->first;
556  while (edge) {
557  VoronoiEdge *new_edge = MEM_callocN(sizeof(VoronoiEdge), "clamped edge");
558 
559  *new_edge = *edge;
560  BLI_addtail(clamped_edges, new_edge);
561 
564 
565  edge = edge->next;
566  }
567 }
568 
570  ListBase *edges, const float coord[2], int dim, int dir, float next_coord[2])
571 {
572  VoronoiEdge *edge = edges->first;
573  float distance = FLT_MAX;
574  int other_dim = dim ? 0 : 1;
575 
576  while (edge) {
577  bool ok = false;
578  float co[2], cur_distance;
579 
580  if (fabsf(edge->start[other_dim] - coord[other_dim]) < VORONOI_EPS &&
581  len_squared_v2v2(coord, edge->start) > VORONOI_EPS) {
582  copy_v2_v2(co, edge->start);
583  ok = true;
584  }
585 
586  if (fabsf(edge->end[other_dim] - coord[other_dim]) < VORONOI_EPS &&
587  len_squared_v2v2(coord, edge->end) > VORONOI_EPS) {
588  copy_v2_v2(co, edge->end);
589  ok = true;
590  }
591 
592  if (ok) {
593  if (dir > 0 && coord[dim] > co[dim]) {
594  ok = false;
595  }
596  else if (dir < 0 && coord[dim] < co[dim]) {
597  ok = false;
598  }
599  }
600 
601  if (ok) {
602  cur_distance = len_squared_v2v2(coord, co);
603  if (cur_distance < distance) {
604  copy_v2_v2(next_coord, co);
605  distance = cur_distance;
606  }
607  }
608 
609  edge = edge->next;
610  }
611 
612  return distance < FLT_MAX;
613 }
614 
615 static void voronoi_createBoundaryEdges(ListBase *edges, int width, int height)
616 {
617  const float corners[4][2] = {
618  {width - 1, 0.0f}, {width - 1, height - 1}, {0.0f, height - 1}, {0.0f, 0.0f}};
619  int i, dim = 0, dir = 1;
620 
621  float coord[2] = {0.0f, 0.0f};
622  float next_coord[2] = {0.0f, 0.0f};
623 
624  for (i = 0; i < 4; i++) {
625  while (voronoi_getNextSideCoord(edges, coord, dim, dir, next_coord)) {
626  VoronoiEdge *edge = MEM_callocN(sizeof(VoronoiEdge), "boundary edge");
627 
628  copy_v2_v2(edge->start, coord);
629  copy_v2_v2(edge->end, next_coord);
630  BLI_addtail(edges, edge);
631 
632  copy_v2_v2(coord, next_coord);
633  }
634 
635  if (len_squared_v2v2(coord, corners[i]) > VORONOI_EPS) {
636  VoronoiEdge *edge = MEM_callocN(sizeof(VoronoiEdge), "boundary edge");
637 
638  copy_v2_v2(edge->start, coord);
639  copy_v2_v2(edge->end, corners[i]);
640  BLI_addtail(edges, edge);
641  copy_v2_v2(coord, corners[i]);
642  }
643 
644  dim = dim ? 0 : 1;
645  if (i == 1) {
646  dir = -1;
647  }
648  }
649 }
650 
652  const VoronoiSite *sites, int sites_total, int width, int height, ListBase *edges)
653 {
655  VoronoiEdge *edge;
656  int i;
657 
658  memset(&process, 0, sizeof(VoronoiProcess));
659 
660  process.width = width;
661  process.height = height;
662 
663  for (i = 0; i < sites_total; i++) {
664  VoronoiEvent *event = MEM_callocN(sizeof(VoronoiEvent), "voronoi site event");
665 
666  event->type = voronoiEventType_Site;
667  copy_v2_v2(event->site, sites[i].co);
668 
669  voronoi_insertEvent(&process, event);
670  }
671 
672  while (process.queue.first) {
673  VoronoiEvent *event = process.queue.first;
674 
675  process.current_y = event->site[1];
676 
677  if (event->type == voronoiEventType_Site) {
678  voronoi_addParabola(&process, event->site);
679  }
680  else {
682  }
683 
684  BLI_freelinkN(&process.queue, event);
685  }
686 
688 
689  edge = process.edges.first;
690  while (edge) {
691  if (edge->neighbor) {
692  copy_v2_v2(edge->start, edge->neighbor->end);
693  MEM_freeN(edge->neighbor);
694  }
695 
696  edge = edge->next;
697  }
698 
700 }
701 
702 static bool testVoronoiEdge(const float site[2], const float point[2], const VoronoiEdge *edge)
703 {
704  float p[2];
705 
706  if (isect_seg_seg_v2_point(site, point, edge->start, edge->end, p) == 1) {
707  if (len_squared_v2v2(p, edge->start) > VORONOI_EPS &&
708  len_squared_v2v2(p, edge->end) > VORONOI_EPS) {
709  return false;
710  }
711  }
712 
713  return true;
714 }
715 
716 static int voronoi_addTriangulationPoint(const float coord[2],
717  const float color[3],
718  VoronoiTriangulationPoint **triangulated_points,
719  int *triangulated_points_total)
720 {
721  VoronoiTriangulationPoint *triangulation_point;
722  int i;
723 
724  for (i = 0; i < *triangulated_points_total; i++) {
725  if (equals_v2v2(coord, (*triangulated_points)[i].co)) {
726  triangulation_point = &(*triangulated_points)[i];
727 
728  add_v3_v3(triangulation_point->color, color);
729  triangulation_point->power++;
730 
731  return i;
732  }
733  }
734 
735  if (*triangulated_points) {
736  *triangulated_points = MEM_reallocN(*triangulated_points,
737  sizeof(VoronoiTriangulationPoint) *
738  (*triangulated_points_total + 1));
739  }
740  else {
741  *triangulated_points = MEM_callocN(sizeof(VoronoiTriangulationPoint), "triangulation points");
742  }
743 
744  triangulation_point = &(*triangulated_points)[(*triangulated_points_total)];
745  copy_v2_v2(triangulation_point->co, coord);
746  copy_v3_v3(triangulation_point->color, color);
747 
748  triangulation_point->power = 1;
749 
750  (*triangulated_points_total)++;
751 
752  return (*triangulated_points_total) - 1;
753 }
754 
756  int v1, int v2, int v3, int (**r_triangles)[3], int *r_triangles_total)
757 {
758  int *triangle;
759 
760  if (*r_triangles) {
761  *r_triangles = MEM_reallocN(*r_triangles, sizeof(int[3]) * (*r_triangles_total + 1));
762  }
763  else {
764  *r_triangles = MEM_callocN(sizeof(int[3]), "triangulation triangles");
765  }
766 
767  triangle = (int *)&(*r_triangles)[(*r_triangles_total)];
768 
769  triangle[0] = v1;
770  triangle[1] = v2;
771  triangle[2] = v3;
772 
773  (*r_triangles_total)++;
774 }
775 
777  int sites_total,
778  ListBase *edges,
779  int width,
780  int height,
781  VoronoiTriangulationPoint **r_triangulated_points,
782  int *r_triangulated_points_total,
783  int (**r_triangles)[3],
784  int *r_triangles_total)
785 {
786  VoronoiTriangulationPoint *triangulated_points = NULL;
787  int(*triangles)[3] = NULL;
788  int triangulated_points_total = 0, triangles_total = 0;
789  int i;
790  ListBase boundary_edges = {NULL, NULL};
791 
792  voronoi_clampEdges(edges, width, height, &boundary_edges);
793  voronoi_createBoundaryEdges(&boundary_edges, width, height);
794 
795  for (i = 0; i < sites_total; i++) {
796  VoronoiEdge *edge;
797  int v1;
798 
800  sites[i].co, sites[i].color, &triangulated_points, &triangulated_points_total);
801 
802  edge = boundary_edges.first;
803  while (edge) {
804  VoronoiEdge *test_edge = boundary_edges.first;
805  bool ok_start = true, ok_end = true;
806 
807  while (test_edge) {
808  if (ok_start && !testVoronoiEdge(sites[i].co, edge->start, test_edge)) {
809  ok_start = false;
810  break;
811  }
812 
813  if (ok_end && !testVoronoiEdge(sites[i].co, edge->end, test_edge)) {
814  ok_end = false;
815  break;
816  }
817 
818  test_edge = test_edge->next;
819  }
820 
821  if (ok_start && ok_end) {
822  int v2, v3;
823 
825  edge->start, sites[i].color, &triangulated_points, &triangulated_points_total);
827  edge->end, sites[i].color, &triangulated_points, &triangulated_points_total);
828 
829  voronoi_addTriangle(v1, v2, v3, &triangles, &triangles_total);
830  }
831 
832  edge = edge->next;
833  }
834  }
835 
836  for (i = 0; i < triangulated_points_total; i++) {
837  VoronoiTriangulationPoint *triangulation_point = &triangulated_points[i];
838 
839  mul_v3_fl(triangulation_point->color, 1.0f / triangulation_point->power);
840  }
841 
842  *r_triangulated_points = triangulated_points;
843  *r_triangulated_points_total = triangulated_points_total;
844 
845  *r_triangles = triangles;
846  *r_triangles_total = triangles_total;
847 
848  BLI_freelistN(&boundary_edges);
849 }
void BLI_freelinkN(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:239
void void void BLI_movelisttolist(struct ListBase *dst, struct ListBase *src) ATTR_NONNULL(1
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
Definition: listbase.c:466
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:80
void BLI_insertlinkbefore(struct ListBase *listbase, void *vnextlink, void *vnewlink) ATTR_NONNULL(1)
Definition: listbase.c:340
MINLINE float max_ff(float a, float b)
MINLINE float min_ff(float a, float b)
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])
Definition: math_geom.c:1296
MINLINE float len_squared_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
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])
MINLINE bool equals_v2v2(const float v1[2], const float v2[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void add_v3_v3(float r[3], const float a[3])
#define IN_RANGE_INCL(a, b, c)
_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 GLdouble r _GL_VOID_RET _GL_VOID GLfloat GLfloat r _GL_VOID_RET _GL_VOID GLint GLint r _GL_VOID_RET _GL_VOID GLshort GLshort r _GL_VOID_RET _GL_VOID GLdouble GLdouble r
_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 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 x2
_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 right
_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 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
Read Guarded memory(de)allocation.
#define MEM_reallocN(vmemh, len)
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
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert a color
ATTR_WARN_UNUSED_RESULT const BMVert * v2
void process(btMatrix3x3 &B, btMatrix3x3 &U, btVector3 &sigma, btMatrix3x3 &V)
Helper function of 3X3 SVD for processing 2X2 SVD.
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:27
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:31
static int left
#define fabsf(x)
Definition: metal/compat.h:219
#define sqrtf(x)
Definition: metal/compat.h:243
static unsigned c
Definition: RandGen.cpp:83
static unsigned a[3]
Definition: RandGen.cpp:78
T distance(const T &a, const T &b)
static MEdge new_edge(const int v1, const int v2)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
void * first
Definition: DNA_listBase.h:31
float direction[2]
struct VoronoiEdge * next
float start[2]
struct VoronoiEdge * neighbor
float end[2]
struct VoronoiEvent * next
Definition: voronoi_2d.c:26
struct VoronoiEvent * prev
Definition: voronoi_2d.c:26
float site[2]
Definition: voronoi_2d.c:29
struct VoronoiParabola * parabola
Definition: voronoi_2d.c:31
float site[2]
Definition: voronoi_2d.c:38
struct VoronoiParabola * left
Definition: voronoi_2d.c:35
VoronoiEvent * event
Definition: voronoi_2d.c:36
VoronoiEdge * edge
Definition: voronoi_2d.c:37
struct VoronoiParabola * right
Definition: voronoi_2d.c:35
struct VoronoiParabola * parent
Definition: voronoi_2d.c:35
VoronoiParabola * root
Definition: voronoi_2d.c:44
ListBase edges
Definition: voronoi_2d.c:43
float current_y
Definition: voronoi_2d.c:46
ListBase queue
Definition: voronoi_2d.c:43
float co[2]
float color[3]
EDGELIST ** edges
static VoronoiParabola * voronoiParabola_getLeftChild(VoronoiParabola *parabola)
Definition: voronoi_2d.c:121
static void voronoi_removeParabola(VoronoiProcess *process, VoronoiEvent *event)
Definition: voronoi_2d.c:414
static VoronoiParabola * voronoiParabola_getRightParent(VoronoiParabola *parabola)
Definition: voronoi_2d.c:173
struct VoronoiEvent VoronoiEvent
static bool testVoronoiEdge(const float site[2], const float point[2], const VoronoiEdge *edge)
Definition: voronoi_2d.c:702
static VoronoiParabola * voronoiParabola_new(void)
Definition: voronoi_2d.c:95
static void voronoi_addParabola(VoronoiProcess *process, float site[2])
Definition: voronoi_2d.c:343
struct VoronoiProcess VoronoiProcess
static void voronoi_checkCircle(VoronoiProcess *process, VoronoiParabola *b)
Definition: voronoi_2d.c:300
static void voronoi_createBoundaryEdges(ListBase *edges, int width, int height)
Definition: voronoi_2d.c:615
static void voronoi_finishEdge(VoronoiProcess *process, VoronoiParabola *parabola)
Definition: voronoi_2d.c:484
@ voronoiEventType_Site
Definition: voronoi_2d.c:21
@ voronoiEventType_Circle
Definition: voronoi_2d.c:22
static VoronoiParabola * voronoiParabola_getRightChild(VoronoiParabola *parabola)
Definition: voronoi_2d.c:138
#define VORONOI_EPS
Definition: voronoi_2d.c:18
static VoronoiParabola * voronoiParabola_getLeftParent(VoronoiParabola *parabola)
Definition: voronoi_2d.c:155
static void voronoi_insertEvent(VoronoiProcess *process, VoronoiEvent *event)
Definition: voronoi_2d.c:51
static void voronoiParabola_setRight(VoronoiParabola *parabola, VoronoiParabola *right)
Definition: voronoi_2d.c:196
static VoronoiEdge * voronoiEdge_new(const float start[2], const float left[2], const float right[2])
Definition: voronoi_2d.c:70
static int voronoi_getEdgeIntersection(VoronoiEdge *a, VoronoiEdge *b, float p[2])
Definition: voronoi_2d.c:273
static int voronoi_getNextSideCoord(ListBase *edges, const float coord[2], int dim, int dir, float next_coord[2])
Definition: voronoi_2d.c:569
struct VoronoiParabola VoronoiParabola
void BLI_voronoi_triangulate(const VoronoiSite *sites, int sites_total, ListBase *edges, int width, int height, VoronoiTriangulationPoint **r_triangulated_points, int *r_triangulated_points_total, int(**r_triangles)[3], int *r_triangles_total)
Definition: voronoi_2d.c:776
static void voronoi_addTriangle(int v1, int v2, int v3, int(**r_triangles)[3], int *r_triangles_total)
Definition: voronoi_2d.c:755
static float voronoi_getY(VoronoiProcess *process, const float p[2], float x)
Definition: voronoi_2d.c:202
static void voronoi_clampEdges(ListBase *edges, int width, int height, ListBase *clamped_edges)
Definition: voronoi_2d.c:551
static void voronoiParabola_setLeft(VoronoiParabola *parabola, VoronoiParabola *left)
Definition: voronoi_2d.c:190
static float voronoi_getXOfEdge(VoronoiProcess *process, VoronoiParabola *par, float y)
Definition: voronoi_2d.c:214
void BLI_voronoi_compute(const VoronoiSite *sites, int sites_total, int width, int height, ListBase *edges)
Definition: voronoi_2d.c:651
static void voronoi_clampEdgeVertex(int width, int height, float *coord, float *other_coord)
Definition: voronoi_2d.c:509
static VoronoiParabola * voronoiParabola_newSite(const float site[2])
Definition: voronoi_2d.c:107
static int voronoi_addTriangulationPoint(const float coord[2], const float color[3], VoronoiTriangulationPoint **triangulated_points, int *triangulated_points_total)
Definition: voronoi_2d.c:716
static VoronoiParabola * voronoi_getParabolaByX(VoronoiProcess *process, float xx)
Definition: voronoi_2d.c:253