Blender V5.3
texture_margin.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#include "BLI_assert.hh"
10#include "BLI_math_geom_c.hh"
11#include "BLI_math_vector.hh"
13#include "BLI_vector.hh"
14
15#include "BKE_attribute.hh"
16#include "BKE_customdata.hh"
17#include "BKE_mesh.hh"
18#include "BKE_mesh_mapping.hh"
19
20#include "IMB_imbuf.hh"
21#include "IMB_interp.hh"
22
23#include "MEM_guardedalloc.h"
24
25#include "zbuf.h" /* For rasterizer (#ZSpan and associated functions). */
26
27#include "RE_texture_margin.h"
28
29#include <algorithm>
30#include <cmath>
31
32namespace blender {
33
35
41 static const int directions[8][2];
42 static const int distances[8];
43
45 Vector<int> loop_adjacency_map_;
47 Array<int> loop_to_face_map_;
48
49 int w_, h_;
50 float uv_offset_[2];
51 Vector<uint32_t> pixel_data_;
52 ZSpan zspan_;
53 uint32_t value_to_store_;
54 bool write_mask_;
55 char *mask_;
56
57 OffsetIndices<int> faces_;
58 Span<int> corner_edges_;
59 Span<float2> uv_map_;
60 int totedge_;
61
62 public:
64 size_t h,
65 const float uv_offset[2],
66 const int totedge,
67 const OffsetIndices<int> faces,
68 const Span<int> corner_edges,
69 const Span<float2> uv_map)
70 : w_(w),
71 h_(h),
72 faces_(faces),
73 corner_edges_(corner_edges),
74 uv_map_(uv_map),
75 totedge_(totedge)
76 {
77 copy_v2_v2(uv_offset_, uv_offset);
78
79 pixel_data_.resize(w_ * h_, 0xFFFFFFFF);
80
81 zbuf_alloc_span(&zspan_, w_, h_);
82
83 build_tables();
84 }
85
87 {
88 zbuf_free_span(&zspan_);
89 }
90
91 void set_pixel(int x, int y, uint32_t value)
92 {
93 BLI_assert(x < w_);
94 BLI_assert(x >= 0);
95 pixel_data_[y * w_ + x] = value;
96 }
97
98 uint32_t get_pixel(int x, int y) const
99 {
100 if (x < 0 || y < 0 || x >= w_ || y >= h_) {
101 return 0xFFFFFFFF;
102 }
103
104 return pixel_data_[y * w_ + x];
105 }
106
108 float *v1, float *v2, float *v3, uint32_t value, char *mask, bool writemask, bool fill)
109 {
110 /* NOTE: This is not thread safe, because the value to be written by the rasterizer is
111 * a class member. If this is ever made multi-threaded each thread needs to get its own. */
112 value_to_store_ = value;
113 mask_ = mask;
114 write_mask_ = writemask;
115
116 if (fill) {
118 &zspan_, this, &(v1[0]), &(v2[0]), &(v3[0]), TextureMarginMap::zscan_store_pixel);
119 }
120 else {
122 &zspan_, this, &(v1[0]), &(v2[0]), &(v3[0]), TextureMarginMap::zscan_store_pixel);
123 }
124 }
125
126 static void zscan_store_pixel(
127 void *map, int x, int y, [[maybe_unused]] float u, [[maybe_unused]] float v)
128 {
129 /* NOTE: Not thread safe, see comment above. */
130 TextureMarginMap *m = static_cast<TextureMarginMap *>(map);
131 if (m->mask_) {
132 if (m->write_mask_) {
133 /* if there is a mask and write_mask_ is true, write to the mask */
134 m->mask_[y * m->w_ + x] = 1;
135 m->set_pixel(x, y, m->value_to_store_);
136 }
137 else {
138 /* if there is a mask and write_mask_ is false, read the mask
139 * to decide if the map needs to be written
140 */
141 if (m->mask_[y * m->w_ + x] != 0) {
142 m->set_pixel(x, y, m->value_to_store_);
143 }
144 }
145 }
146 else {
147 m->set_pixel(x, y, m->value_to_store_);
148 }
149 }
150
151/* The map contains 2 kinds of pixels: DijkstraPixels and face indices. The top bit determines
152 * what kind it is. With the top bit set, it is a 'dijkstra' pixel. The bottom 4 bits encode the
153 * direction of the shortest path and the remaining 27 bits are used to store the distance. If
154 * the top bit is not set, the rest of the bits is used to store the face index.
155 */
156#define PackDijkstraPixel(dist, dir) (0x80000000 + ((dist) << 4) + (dir))
157#define DijkstraPixelGetDistance(dp) (((dp) ^ 0x80000000) >> 4)
158#define DijkstraPixelGetDirection(dp) ((dp) & 0xF)
159#define IsDijkstraPixel(dp) ((dp) & 0x80000000)
160#define DijkstraPixelIsUnset(dp) ((dp) == 0xFFFFFFFF)
161
166 void grow_dijkstra(int margin)
167 {
168 class DijkstraActivePixel {
169 public:
170 DijkstraActivePixel(int dist, int _x, int _y) : distance(dist), x(_x), y(_y) {}
171 int distance;
172 int x, y;
173 };
174 auto cmp_dijkstrapixel_fun = [](DijkstraActivePixel const &a1, DijkstraActivePixel const &a2) {
175 return a1.distance > a2.distance;
176 };
177
178 Vector<DijkstraActivePixel> active_pixels;
179 for (int y = 0; y < h_; y++) {
180 for (int x = 0; x < w_; x++) {
182 for (int i = 0; i < 8; i++) {
183 int xx = x - directions[i][0];
184 int yy = y - directions[i][1];
185
186 if (xx >= 0 && xx < w_ && yy >= 0 && yy < w_ && !IsDijkstraPixel(get_pixel(xx, yy))) {
187 set_pixel(x, y, PackDijkstraPixel(distances[i], i));
188 active_pixels.append(DijkstraActivePixel(distances[i], x, y));
189 break;
190 }
191 }
192 }
193 }
194 }
195
196 /* Not strictly needed because at this point it already is a heap. */
197#if 0
198 std::make_heap(active_pixels.begin(), active_pixels.end(), cmp_dijkstrapixel_fun);
199#endif
200
201 while (active_pixels.size()) {
202 std::pop_heap(active_pixels.begin(), active_pixels.end(), cmp_dijkstrapixel_fun);
203 DijkstraActivePixel p = active_pixels.pop_last();
204
205 int dist = p.distance;
206
207 if (dist < 2 * (margin + 1)) {
208 for (int i = 0; i < 8; i++) {
209 int x = p.x + directions[i][0];
210 int y = p.y + directions[i][1];
211 if (x >= 0 && x < w_ && y >= 0 && y < h_) {
212 uint32_t dp = get_pixel(x, y);
213 if (IsDijkstraPixel(dp) && (DijkstraPixelGetDistance(dp) > dist + distances[i])) {
215 set_pixel(x, y, PackDijkstraPixel(dist + distances[i], i));
216 active_pixels.append(DijkstraActivePixel(dist + distances[i], x, y));
217 std::push_heap(active_pixels.begin(), active_pixels.end(), cmp_dijkstrapixel_fun);
218 }
219 }
220 }
221 }
222 }
223 }
224
230 void lookup_pixels(ImBuf *ibuf, char *mask, int maxPolygonSteps)
231 {
232 float4 *ibuf_ptr_fl = reinterpret_cast<float4 *>(ibuf->float_data_for_write());
233 uchar4 *ibuf_ptr_ch = reinterpret_cast<uchar4 *>(ibuf->byte_data_for_write());
234 size_t pixel_index = 0;
235 for (int y = 0; y < h_; y++) {
236 for (int x = 0; x < w_; x++) {
237 uint32_t dp = pixel_data_[pixel_index];
238 if (IsDijkstraPixel(dp) && !DijkstraPixelIsUnset(dp)) {
239 int dist = DijkstraPixelGetDistance(dp);
240 int direction = DijkstraPixelGetDirection(dp);
241
242 int xx = x;
243 int yy = y;
244
245 /* Follow the dijkstra directions to find the face this margin pixels belongs to. */
246 while (dist > 0) {
247 xx -= directions[direction][0];
248 yy -= directions[direction][1];
249 dp = get_pixel(xx, yy);
250 dist -= distances[direction];
251 BLI_assert(!dist || (dist == DijkstraPixelGetDistance(dp)));
252 direction = DijkstraPixelGetDirection(dp);
253 }
254
255 uint32_t face = get_pixel(xx, yy);
256
258
259 float destX, destY;
260
261 int other_poly;
262 bool found_pixel_in_polygon = false;
263 if (lookup_pixel_polygon_neighborhood(x, y, &face, &destX, &destY, &other_poly)) {
264
265 for (int i = 0; i < maxPolygonSteps; i++) {
266 /* Force to pixel grid. */
267 int nx = int(round(destX));
268 int ny = int(round(destY));
269 uint32_t polygon_from_map = get_pixel(nx, ny);
270 if (other_poly == polygon_from_map) {
271 found_pixel_in_polygon = true;
272 break;
273 }
274
275 float dist_to_edge;
276 /* Look up again, but starting from the face we were expected to land in. */
277 if (!lookup_pixel(nx, ny, other_poly, &destX, &destY, &other_poly, &dist_to_edge)) {
278 found_pixel_in_polygon = false;
279 break;
280 }
281 }
282
283 if (found_pixel_in_polygon) {
284 if (ibuf_ptr_fl) {
285 ibuf_ptr_fl[pixel_index] = imbuf::interpolate_bilinear_border_fl(
286 ibuf, destX, destY);
287 }
288 if (ibuf_ptr_ch) {
289 ibuf_ptr_ch[pixel_index] = imbuf::interpolate_bilinear_border_byte(
290 ibuf, destX, destY);
291 }
292 /* Add our new pixels to the assigned pixel map. */
293 mask[pixel_index] = 1;
294 }
295 }
296 }
297 else if (DijkstraPixelIsUnset(dp) || !IsDijkstraPixel(dp)) {
298 /* These are not margin pixels, make sure the extend filter which is run after this step
299 * leaves them alone.
300 */
301 mask[pixel_index] = 1;
302 }
303 pixel_index++;
304 }
305 }
306 }
307
308 private:
309 float2 uv_to_xy(const float2 &uv_map) const
310 {
311 float2 ret;
312 ret.x = (((uv_map[0] - uv_offset_[0]) * w_) - (0.5f + 0.001f));
313 ret.y = (((uv_map[1] - uv_offset_[1]) * h_) - (0.5f + 0.001f));
314 return ret;
315 }
316
317 void build_tables()
318 {
319 loop_to_face_map_ = bke::mesh::build_corner_to_face_map(faces_);
320
321 loop_adjacency_map_.resize(corner_edges_.size(), -1);
322
323 Vector<int> tmpmap;
324 tmpmap.resize(totedge_, -1);
325
326 for (const int64_t i : corner_edges_.index_range()) {
327 int edge = corner_edges_[i];
328 if (tmpmap[edge] == -1) {
329 loop_adjacency_map_[i] = -1;
330 tmpmap[edge] = i;
331 }
332 else {
333 BLI_assert(tmpmap[edge] >= 0);
334 loop_adjacency_map_[i] = tmpmap[edge];
335 loop_adjacency_map_[tmpmap[edge]] = i;
336 }
337 }
338 }
339
346 bool lookup_pixel_polygon_neighborhood(
347 float x, float y, uint32_t *r_start_poly, float *r_destx, float *r_desty, int *r_other_poly)
348 {
349 float found_dist;
350 if (lookup_pixel(x, y, *r_start_poly, r_destx, r_desty, r_other_poly, &found_dist)) {
351 return true;
352 }
353
354 int loopstart = faces_[*r_start_poly].start();
355 int totloop = faces_[*r_start_poly].size();
356
357 float destx, desty;
358 int foundpoly;
359
360 float mindist = -1.0f;
361
362 /* Loop over all adjacent polygons and determine which edge is closest.
363 * This could be optimized by only inspecting neighbors which are on the edge of an island.
364 * But it seems fast enough for now and that would add a lot of complexity. */
365 for (int i = 0; i < totloop; i++) {
366 int otherloop = loop_adjacency_map_[i + loopstart];
367
368 if (otherloop < 0) {
369 continue;
370 }
371
372 uint32_t face = loop_to_face_map_[otherloop];
373
374 if (lookup_pixel(x, y, face, &destx, &desty, &foundpoly, &found_dist)) {
375 if (mindist < 0.0f || found_dist < mindist) {
376 mindist = found_dist;
377 *r_other_poly = foundpoly;
378 *r_destx = destx;
379 *r_desty = desty;
380 *r_start_poly = face;
381 }
382 }
383 }
384
385 return mindist >= 0.0f;
386 }
387
394 bool lookup_pixel(float x,
395 float y,
396 int src_poly,
397 float *r_destx,
398 float *r_desty,
399 int *r_other_poly,
400 float *r_dist_to_edge)
401 {
402 float2 point(x, y);
403
404 *r_destx = *r_desty = 0;
405
406 int found_edge = -1;
407 float found_dist = -1;
408 float found_t = 0;
409
410 /* Find the closest edge on which the point x,y can be projected.
411 */
412 for (size_t i = 0; i < faces_[src_poly].size(); i++) {
413 int l1 = faces_[src_poly].start() + i;
414 int l2 = l1 + 1;
415 if (l2 >= faces_[src_poly].start() + faces_[src_poly].size()) {
416 l2 = faces_[src_poly].start();
417 }
418 /* edge points */
419 float2 edgepoint1 = uv_to_xy(uv_map_[l1]);
420 float2 edgepoint2 = uv_to_xy(uv_map_[l2]);
421 /* Vector AB is the vector from the first edge point to the second edge point.
422 * Vector AP is the vector from the first edge point to our point under investigation. */
423 float2 ab = edgepoint2 - edgepoint1;
424 float2 ap = point - edgepoint1;
425
426 /* Project ap onto ab. */
427 float dotv = math::dot(ab, ap);
428
429 float ablensq = math::length_squared(ab);
430
431 float t = dotv / ablensq;
432
433 if (t >= 0.0 && t <= 1.0) {
434
435 /* Find the point on the edge closest to P */
436 float2 reflect_point = edgepoint1 + (t * ab);
437 /* This is the vector to P, so 90 degrees out from the edge. */
438 float2 reflect_vec = reflect_point - point;
439
440 float reflectLen = sqrt(reflect_vec[0] * reflect_vec[0] + reflect_vec[1] * reflect_vec[1]);
441 float cross = ab[0] * reflect_vec[1] - ab[1] * reflect_vec[0];
442 /* Only if P is on the outside of the edge, which means the cross product is positive,
443 * we consider this edge.
444 */
445 bool valid = (cross > 0.0);
446
447 if (valid && (found_dist < 0 || reflectLen < found_dist)) {
448 /* Store the info of the closest edge so far. */
449 found_dist = reflectLen;
450 found_t = t;
451 found_edge = i + faces_[src_poly].start();
452 }
453 }
454 }
455
456 if (found_edge < 0) {
457 return false;
458 }
459
460 *r_dist_to_edge = found_dist;
461
462 /* Get the 'other' edge. I.E. the UV edge from the neighbor face. */
463 int other_edge = loop_adjacency_map_[found_edge];
464
465 if (other_edge < 0) {
466 return false;
467 }
468
469 int dst_poly = loop_to_face_map_[other_edge];
470
471 if (r_other_poly) {
472 *r_other_poly = dst_poly;
473 }
474
475 int other_edge2 = other_edge + 1;
476 if (other_edge2 >= faces_[dst_poly].start() + faces_[dst_poly].size()) {
477 other_edge2 = faces_[dst_poly].start();
478 }
479
480 float2 other_edgepoint1 = uv_to_xy(uv_map_[other_edge]);
481 float2 other_edgepoint2 = uv_to_xy(uv_map_[other_edge2]);
482
483 /* Calculate the vector from the order edges last point to its first point. */
484 float2 other_ab = other_edgepoint1 - other_edgepoint2;
485 float2 other_reflect_point = other_edgepoint2 + (found_t * other_ab);
486 float2 perpendicular_other_ab;
487 perpendicular_other_ab.x = other_ab.y;
488 perpendicular_other_ab.y = -other_ab.x;
489
490 /* The new point is found_dist distance from other_reflect_point at a 90 degree angle to
491 * other_ab */
492 float2 new_point = other_reflect_point + (found_dist / math::length(perpendicular_other_ab)) *
493 perpendicular_other_ab;
494
495 *r_destx = new_point.x;
496 *r_desty = new_point.y;
497
498 return true;
499 }
500}; // class TextureMarginMap
501
502const int TextureMarginMap::directions[8][2] = {
503 {-1, 0}, {-1, -1}, {0, -1}, {1, -1}, {1, 0}, {1, 1}, {0, 1}, {-1, 1}};
504const int TextureMarginMap::distances[8] = {2, 3, 2, 3, 2, 3, 2, 3};
505
506static void generate_margin(ImBuf *ibuf,
507 char *mask,
508 const int margin,
509 const Span<float3> vert_positions,
510 const int edges_num,
511 const OffsetIndices<int> faces,
512 const Span<int> corner_edges,
513 const Span<int> corner_verts,
514 const Span<float2> uv_map,
515 const float uv_offset[2],
516 const bool conservative)
517{
518 Array<int3> corner_tris(poly_to_tri_count(faces.size(), corner_edges.size()));
519 bke::mesh::corner_tris_calc(vert_positions, faces, corner_verts, corner_tris);
520
521 Array<int> tri_faces(corner_tris.size());
523
524 TextureMarginMap map(ibuf->x, ibuf->y, uv_offset, edges_num, faces, corner_edges, uv_map);
525
526 bool draw_new_mask = false;
527 /* Now the map contains 3 sorts of values: 0xFFFFFFFF for empty pixels, `0x80000000 + polyindex`
528 * for margin pixels, just `polyindex` for face pixels. */
529 if (mask) {
530 mask = MEM_dupalloc(mask);
531 }
532 else {
533 mask = MEM_new_array_zeroed<char>(size_t(ibuf->x) * size_t(ibuf->y), __func__);
534 draw_new_mask = true;
535 }
536
537 for (int fill = conservative ? 0 : 1; fill < 2; fill++) {
538 for (const int i : corner_tris.index_range()) {
539 const int3 tri = corner_tris[i];
540 float vec[3][2];
541
542 for (int a = 0; a < 3; a++) {
543 const float *uv = uv_map[tri[a]];
544
545 vec[a][0] = (uv[0] - uv_offset[0]) * float(ibuf->x);
546 vec[a][1] = (uv[1] - uv_offset[1]) * float(ibuf->y);
547 }
548
549 /* NOTE: we need the top bit for the dijkstra distance map. */
550 BLI_assert(tri_faces[i] < 0x80000000);
551
552 map.rasterize_tri(vec[0], vec[1], vec[2], tri_faces[i], mask, draw_new_mask, fill);
553 }
554 }
555
556 char *tmpmask = MEM_dupalloc(mask);
557 /* Extend (with averaging) by 2 pixels. Those will be overwritten, but it
558 * helps linear interpolations on the edges of polygons. */
559 IMB_filter_extend(ibuf, tmpmask, 2);
560 MEM_delete(tmpmask);
561
562 map.grow_dijkstra(margin);
563
564 /* Looking further than 3 polygons away leads to so much cumulative rounding
565 * that it isn't worth it. So hard-code it to 3. */
566 map.lookup_pixels(ibuf, mask, 3);
567
568 /* Use the extend filter to fill in the missing pixels at the corners, not strictly correct, but
569 * the visual difference seems very minimal. This also catches pixels we missed because of very
570 * narrow polygons.
571 */
572 IMB_filter_extend(ibuf, mask, margin);
573
574 MEM_delete(mask);
575}
576
577} // namespace render::texturemargin
578
580 char *mask,
581 const int margin,
582 const Mesh *mesh,
583 StringRef uv_layer,
584 const float uv_offset[2],
585 const bool conservative)
586{
587 const StringRef name = uv_layer.is_empty() ? mesh->active_uv_map_name() : uv_layer;
588 const bke::AttributeAccessor attributes = mesh->attributes();
589 const VArraySpan<float2> uv_map = *attributes.lookup<float2>(name, bke::AttrDomain::Corner);
590
592 mask,
593 margin,
594 mesh->vert_positions(),
595 mesh->edges_num,
596 mesh->faces(),
597 mesh->corner_edges(),
598 mesh->corner_verts(),
599 uv_map,
600 uv_offset,
601 conservative);
602}
603
604} // namespace blender
CustomData interface, see also DNA_customdata_types.h.
Read Blender memory allocation and freeing.
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
Definition btQuadWord.h:119
int64_t size() const
Definition BLI_array.hh:267
IndexRange index_range() const
Definition BLI_array.hh:371
constexpr int64_t size() const
Definition BLI_span.hh:256
constexpr IndexRange index_range() const
Definition BLI_span.hh:405
int64_t size() const
void append(const T &value)
void resize(const int64_t new_size)
GAttributeReader lookup(const StringRef name) const
constexpr bool is_empty() const
void set_pixel(int x, int y, uint32_t value)
TextureMarginMap(size_t w, size_t h, const float uv_offset[2], const int totedge, const OffsetIndices< int > faces, const Span< int > corner_edges, const Span< float2 > uv_map)
void rasterize_tri(float *v1, float *v2, float *v3, uint32_t value, char *mask, bool writemask, bool fill)
void lookup_pixels(ImBuf *ibuf, char *mask, int maxPolygonSteps)
static void zscan_store_pixel(void *map, int x, int y, float u, float v)
#define round
float distance(float, float) RET
#define sqrt
VecBase< float, 3 > cross(VecOp< float, 3 >, VecOp< float, 3 >) RET
void corner_tris_calc(Span< float3 > vert_positions, OffsetIndices< int > faces, Span< int > corner_verts, MutableSpan< int3 > corner_tris)
Array< int > build_corner_to_face_map(OffsetIndices< int > faces)
void corner_tris_calc_face_indices(OffsetIndices< int > faces, MutableSpan< int > tri_faces)
int size(const AssetLibraryReference *library_reference)
uchar4 interpolate_bilinear_border_byte(const ImBuf *in, float u, float v)
Definition IMB_interp.hh:76
float4 interpolate_bilinear_border_fl(const ImBuf *in, float u, float v)
Definition IMB_interp.hh:80
T length_squared(const VecBase< T, Size > &a)
T length(const VecBase< T, Size > &a)
T dot(const QuaternionBase< T > &a, const QuaternionBase< T > &b)
static void generate_margin(ImBuf *ibuf, char *mask, const int margin, const Span< float3 > vert_positions, const int edges_num, const OffsetIndices< int > faces, const Span< int > corner_edges, const Span< int > corner_verts, const Span< float2 > uv_map, const float uv_offset[2], const bool conservative)
BMesh Iterators.
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
VecBase< uint8_t, 4 > uchar4
__int64 int64_t
Definition BKE_text.h:90
void zspan_rasterize_conservative_wireframe(ZSpan *zspan, void *handle, const float *v1, const float *v2, const float *v3, void(*func)(void *, int, int, float, float))
Definition zbuf.cc:330
void zbuf_alloc_span(ZSpan *zspan, int rectx, int recty)
Definition zbuf.cc:33
MINLINE void copy_v2_v2(float r[2], const float a[2])
void RE_generate_texturemargin_adjacentfaces(ImBuf *ibuf, char *mask, const int margin, const Mesh *mesh, StringRef uv_layer, const float uv_offset[2], const bool conservative)
ATTR_WARN_UNUSED_RESULT const BMVert * v
void zbuf_free_span(ZSpan *zspan)
Definition zbuf.cc:44
VecBase< float, 4 > float4
unsigned int uint32_t
Definition BKE_text.h:81
VecBase< float, 2 > float2
VecBase< int32_t, 3 > int3
MINLINE int poly_to_tri_count(int poly_count, int corner_count)
ATTR_WARN_UNUSED_RESULT const BMVert * v2
void IMB_filter_extend(ImBuf *ibuf, char *mask, int filter)
Definition filter.cc:203
void zspan_rasterize_triangle(ZSpan *zspan, void *handle, const float *v1_in, const float *v2_in, const float *v3_in, void(*func)(void *, int, int, float, float))
Definition zbuf.cc:160
void * MEM_new_array_zeroed(size_t len, size_t size, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1
uint8_t * byte_data_for_write()
Definition allocimbuf.cc:60
float * float_data_for_write()
Definition allocimbuf.cc:79
float x
float y
#define PackDijkstraPixel(dist, dir)
#define DijkstraPixelIsUnset(dp)
#define DijkstraPixelGetDistance(dp)
#define DijkstraPixelGetDirection(dp)
#define IsDijkstraPixel(dp)