pub struct DensityGrid {
pub cell_size: u32,
pub cols: u32,
pub rows: u32,
pub cells: Vec<u16>,
}Expand description
Downsampled persistence of the per-page bbox-stacking heatmap. Cell value
is the SUM of full-resolution cell counts in the corresponding
cell_size × cell_size region. Sum (not mean, not max) is what the
consumer needs: weighted-overlap scores like
sum_over_cells(page_covers_cell × cell_density) compose directly. Mean
discards the cell-area normalization; max discards multi-page consistency.
u16 fits: max value = cell_size² × page_analysis_count (at default
8 × 8 × 10 = 640, well below 65535). Implementations clip to u16::MAX
defensively in case overlapping bboxes push a cell past the steady-state
upper bound.
Fields§
§cell_size: u32Page-coordinate pt per cell. From config.heatmap_cell_size.
cols: u32ceil(page_dimensions.width / cell_size).
rows: u32ceil(page_dimensions.height / cell_size).
cells: Vec<u16>Row-major: cells[row * cols + col].
Trait Implementations§
Source§impl Clone for DensityGrid
impl Clone for DensityGrid
Source§fn clone(&self) -> DensityGrid
fn clone(&self) -> DensityGrid
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more