![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "develop/masks/masks_solid.h"#include "develop/masks_gui.h"#include "caches/pixelpipe_cache_alloc.h"#include "system/mem_alloc.h"#include "common/logging.h"#include "common/times.h"#include <float.h>#include <math.h>#include <stdint.h>#include <stdlib.h>#include <string.h>Go to the source code of this file.
Data Structures | |
| struct | _solid_edge_t |
| struct | _solid_crossing_t |
| struct | _solid_bands_t |
| struct | _solid_grid_t |
Macros | |
| #define | SOLID_SUBLINES 4 |
| #define | SOLID_MAX_CELLS ((size_t)8 << 20) |
| #define | SOLID_MAX_CROSSINGS ((size_t)32 << 20) |
| #define | SOLID_DRIFT 0.1f |
| #define | SOLID_INSERTION 32 |
Typedefs | |
| typedef struct _solid_edge_t | _solid_edge_t |
| typedef struct _solid_crossing_t | _solid_crossing_t |
| typedef struct _solid_bands_t | _solid_bands_t |
| typedef struct _solid_grid_t | _solid_grid_t |
Enumerations | |
| enum | { SOLID_TOP = 0 , SOLID_RIGHT = 1 , SOLID_BOTTOM = 2 , SOLID_LEFT = 3 } |
Functions | |
| static gboolean | _solid_spokes_cross (const _solid_bands_t *const b, const int k, const int l, float *const t) |
| static int | _solid_band_signs (const _solid_bands_t *const b, int8_t *const sign, float bbox[4], int *const twisted) |
| static int | _solid_add_edge (_solid_edge_t *const e, const float xa, const float ya, const float xb, const float yb, const int winding) |
| static int | _solid_untwist (const _solid_bands_t *const b, const int k, const int l, const float t, const int s, _solid_edge_t *const edges) |
| static int | _solid_edges (const _solid_bands_t *const bands, const int8_t *const sign, _solid_edge_t *const edges) |
| static void | _solid_grid_fit (_solid_grid_t *const g, const float bbox[4], float cell) |
| static void | _solid_lines (const _solid_edge_t *const e, const _solid_grid_t *const g, int *t0, int *t1) |
| static size_t | _solid_count (const _solid_edge_t *const edges, const int count, const _solid_grid_t *const g, int *const offset) |
| static uint32_t | _solid_key (const _solid_crossing_t *const c) |
| static void | _solid_sort (_solid_crossing_t *const c, _solid_crossing_t *const scratch, const int m) |
| static void | _solid_span (float *const partial, float *const step, const float xa, const float xb, int *const lo, int *const hi) |
| static int | _solid_fill (const _solid_edge_t *const edges, const int count, const _solid_grid_t *const g, const int *const offset, _solid_crossing_t *const crossing, uint8_t *const cover, int *const range) |
| static void | _solid_spine (const _solid_bands_t *const b, const int8_t *const sign, const _solid_grid_t *const g, uint8_t *const cover, int *const range) |
| static uint8_t * | _solid_visit (uint8_t *const visited, const int w, const int i, const int j, const int e, uint8_t *const bit) |
| static int | _solid_exit (const uint8_t *const cover, const int w, const int i, const int j, const int entry) |
| static void | _solid_point (const uint8_t *const cover, const _solid_grid_t *const g, const int i, const int j, const int e, float *const out) |
| static int | _solid_follow (const uint8_t *const cover, uint8_t *const visited, const _solid_grid_t *const g, int i, int j, float *const out) |
| static int | _solid_trace (const uint8_t *const cover, const int *const range, const _solid_grid_t *const g, dt_masks_form_gui_points_t *const gp) |
| int | dt_masks_solid_edge (dt_masks_form_gui_points_t *gui_points, const float *contour, const int header, const float cell) |
Variables | |
| static const int | _corner_i [4] = { 0, 1, 1, 0 } |
| static const int | _corner_j [4] = { 0, 0, 1, 1 } |
| static const int | _visit_corner [4] = { 0, 1, 3, 0 } |
| static const int | _step_i [4] = { 0, 1, 0, -1 } |
| static const int | _step_j [4] = { -1, 0, 1, 0 } |
| #define SOLID_DRIFT 0.1f |
Definition at line 52 of file masks_solid.c.
Referenced by _solid_band_signs().
| #define SOLID_INSERTION 32 |
Definition at line 54 of file masks_solid.c.
Referenced by _solid_sort().
| #define SOLID_MAX_CELLS ((size_t)8 << 20) |
Definition at line 49 of file masks_solid.c.
Referenced by _solid_grid_fit().
| #define SOLID_MAX_CROSSINGS ((size_t)32 << 20) |
Definition at line 50 of file masks_solid.c.
Referenced by _solid_count(), and dt_masks_solid_edge().
| #define SOLID_SUBLINES 4 |
Definition at line 47 of file masks_solid.c.
Referenced by _solid_count(), _solid_fill(), _solid_lines(), _solid_span(), and dt_masks_solid_edge().
| typedef struct _solid_bands_t _solid_bands_t |
| typedef struct _solid_crossing_t _solid_crossing_t |
| typedef struct _solid_edge_t _solid_edge_t |
| typedef struct _solid_grid_t _solid_grid_t |
| anonymous enum |
| Enumerator | |
|---|---|
| SOLID_TOP | |
| SOLID_RIGHT | |
| SOLID_BOTTOM | |
| SOLID_LEFT | |
Definition at line 56 of file masks_solid.c.
|
static |
Definition at line 197 of file masks_solid.c.
References _solid_edge_t::dir, _solid_edge_t::slope, _solid_edge_t::x, _solid_edge_t::y, and _solid_edge_t::y_end.
Referenced by _solid_edges(), and _solid_untwist().
|
static |
Definition at line 119 of file masks_solid.c.
References _solid_spokes_cross(), bbox, k, n, sign, SOLID_DRIFT, t, and width.
Referenced by dt_masks_solid_edge().
|
static |
Definition at line 308 of file masks_solid.c.
References _solid_lines(), g, k, SOLID_MAX_CROSSINGS, SOLID_SUBLINES, and t.
Referenced by dt_masks_solid_edge().
|
static |
Definition at line 238 of file masks_solid.c.
References _solid_add_edge(), _solid_spokes_cross(), _solid_untwist(), _solid_bands_t::contour, _solid_bands_t::count, FALSE, _solid_bands_t::n, n, sign, _solid_bands_t::spine, and t.
Referenced by dt_masks_solid_edge().
|
static |
Definition at line 537 of file masks_solid.c.
References i, SOLID_BOTTOM, SOLID_LEFT, SOLID_RIGHT, SOLID_TOP, top, and v.
Referenced by _solid_follow().
|
static |
Definition at line 399 of file masks_solid.c.
References _solid_lines(), _solid_sort(), _solid_span(), _solid_edge_t::dir, dt_alloc_align(), dt_calloc_align_float(), dt_free_align, g, i, IS_NULL_PTR, k, m, MAX, memcpy(), row, _solid_edge_t::slope, SOLID_SUBLINES, t, _solid_edge_t::x, x, and _solid_edge_t::y.
Referenced by dt_masks_solid_edge().
|
static |
Definition at line 575 of file masks_solid.c.
References _solid_exit(), _solid_point(), _solid_visit(), _step_i, _step_j, g, i, out, and SOLID_TOP.
Referenced by _solid_trace().
|
static |
Definition at line 279 of file masks_solid.c.
References bbox, g, and SOLID_MAX_CELLS.
Referenced by dt_masks_solid_edge().
|
inlinestatic |
Definition at line 336 of file masks_solid.c.
Referenced by _solid_sort().
|
inlinestatic |
Definition at line 299 of file masks_solid.c.
References g, SOLID_SUBLINES, _solid_edge_t::y, and _solid_edge_t::y_end.
Referenced by _solid_count(), and _solid_fill().
|
inlinestatic |
Definition at line 558 of file masks_solid.c.
References _corner_i, _corner_j, g, i, out, t, and x.
Referenced by _solid_follow().
|
static |
Definition at line 346 of file masks_solid.c.
References _solid_key(), d, m, memcpy(), r, SOLID_INSERTION, and v.
Referenced by _solid_fill().
|
inlinestatic |
Definition at line 377 of file masks_solid.c.
References k, MAX, MIN, and SOLID_SUBLINES.
Referenced by _solid_fill().
|
static |
Definition at line 482 of file masks_solid.c.
References g, i, k, MAX, MIN, and sign.
Referenced by dt_masks_solid_edge().
|
inlinestatic |
Definition at line 93 of file masks_solid.c.
References c1, FALSE, k, and t.
Referenced by _solid_band_signs(), and _solid_edges().
|
static |
Definition at line 600 of file masks_solid.c.
References _solid_follow(), dt_calloc_align(), dt_free_align, dt_pixelpipe_cache_alloc_align_cache, dt_pixelpipe_cache_alloc_align_float_cache, dt_pixelpipe_cache_free_align, dt_masks_form_gui_points_t::fading, dt_masks_form_gui_points_t::fading_break_count, dt_masks_form_gui_points_t::fading_breaks, dt_masks_form_gui_points_t::fading_count, g, i, IS_NULL_PTR, MAX, MIN, and row.
Referenced by dt_masks_solid_edge().
|
static |
Definition at line 214 of file masks_solid.c.
References _solid_add_edge(), c1, k, t, and x.
Referenced by _solid_edges().
|
inlinestatic |
Definition at line 528 of file masks_solid.c.
References _corner_i, _corner_j, _visit_corner, and i.
Referenced by _solid_follow().
| int dt_masks_solid_edge | ( | struct dt_masks_form_gui_points_t * | gui_points, |
| const float * | contour, | ||
| int | header, | ||
| float | cell ) |
The edge of the part of a stroke painted at full density, as closed loops.
The rasteriser paints every spoke solid from its spine sample to its contour sample, so the solid part is the union of the bands between neighbouring spokes. That union is filled on a grid of cell image pixels and its edge traced at half coverage.
Reads points and border_count of gui_points, and contour, index-aligned with points, their first header samples being node data. Writes fading, fading_count, fading_breaks and fading_break_count: every loop ends on its first point, and a zero-length break starts each loop but the first.
Definition at line 649 of file masks_solid.c.
References _solid_band_signs(), _solid_count(), _solid_edges(), _solid_fill(), _solid_grid_fit(), _solid_spine(), _solid_trace(), bbox, dt_masks_form_gui_points_t::border_count, dt_alloc_align(), dt_calloc_align(), DT_DEBUG_MASKS, DT_DEBUG_PERF, dt_free_align, dt_get_debug_flags(), dt_get_wtime(), dt_print(), dt_masks_form_gui_points_t::fading_break_count, dt_masks_form_gui_points_t::fading_count, g, IS_NULL_PTR, MAX, n, dt_masks_form_gui_points_t::points, sign, SOLID_MAX_CROSSINGS, and SOLID_SUBLINES.
Referenced by _judge_fading_edge(), and dt_masks_gui_form_create().
|
static |
Definition at line 522 of file masks_solid.c.
Referenced by _solid_point(), and _solid_visit().
|
static |
Definition at line 523 of file masks_solid.c.
Referenced by _solid_point(), and _solid_visit().
|
static |
Definition at line 525 of file masks_solid.c.
Referenced by _solid_follow().
|
static |
Definition at line 526 of file masks_solid.c.
Referenced by _solid_follow().
|
static |
Definition at line 524 of file masks_solid.c.
Referenced by _solid_visit().