|
| int | createHandle (std::string type, std::string className, size_t datasetIndex=HandleRecord::kNoDataset, std::string slot="") |
| int | createHandleAt (int figureId, size_t axesIndex, std::string type, std::string className, std::string slot="", size_t datasetIndex=HandleRecord::kNoDataset) |
| HandleRecord * | findHandle (int id) |
| void | deleteHandle (int id) |
| void | removeAxes (int figureId, size_t axesIndex) |
| DatasetInfo * | datasetOf (const HandleRecord &rec) |
| AxesState * | axesOf (const HandleRecord &rec) |
| FigureState * | figureOf (int figureId) |
| void | markFigureModified (int figureId) |
| void | invalidateHandles (int figureId, int axesIdx, bool includeAxesRecord, bool includeFigureRecord) |
| std::unordered_map< int, HandleRecord > & | handles () |
| void | setOutputFunc (OutputFunc f) |
| | Set the output callback for figure/close markers.
|
| FigureState & | current () |
| AxesState & | currentAxes () |
| | Convenience: current axes of current figure.
|
| void | pushDataset (DatasetInfo ds) |
| int | newFigure () |
| int | setFigure (int n) |
| int | currentFigureId () const |
| void | setSubplot (int m, int n, int p) |
| | subplot(m,n,p) — set grid and switch to axes at position p
|
| void | prepareForPlot () |
| void | beginChartCall () |
| size_t | chartCallBase () const |
| void | emitModified () |
| | Emit JSON for all modified figures.
|
| void | closeFigure (int id) |
| void | closeFigureNotify (int id) |
| | Close and emit notification marker.
|
| void | closeCurrent () |
| void | closeCurrentNotify () |
| void | closeAll () |
| void | closeAllNotify () |
| const std::map< int, FigureState > & | figures () const |
|
FigureCheckpoint | checkpointFigures () const |
|
void | restoreFigures (const FigureCheckpoint &cp) |
| DecimatedSeries | getSeriesDisplayTile (int figId, int axIdx, int dsIdx, double x0, double x1, int width, int algo) const |
| | Display-grid tile resampler.
|
| bool | getFigureDisplayTile (int figId, int axIdx, int dsIdx, double srcR0, double srcC0, double srcH, double srcW, int displayH, int displayW, bool xLog, bool yLog, uint8_t *out) const |
| void | ensureLOD (const DatasetInfo &ds, int targetLevel) const |
| | Build the LOD pyramid up to targetLevel if it isn't already cached.
|
| bool | getFigureTile (int figId, int axIdx, int dsIdx, int r0, int c0, int h, int w, int lod, std::vector< uint8_t > &out, size_t &outRows, size_t &outCols) const |
| | Source-grid tile fetcher (kept for Stage A/B compat tests).
|
Definition at line 465 of file figure_manager.hpp.
| void nk::FigureManager::ensureLOD |
( |
const DatasetInfo & | ds, |
|
|
int | targetLevel ) const |
|
inline |
Build the LOD pyramid up to targetLevel if it isn't already cached.
Each level halves dims via 2×2 mean-pooling of the parent (NaN-skip). Idempotent — repeated calls with smaller targetLevel are no-ops.
Stops early if a level would shrink below 32×32 (further pooling is useless detail-wise) or if memory allocation throws.
Definition at line 1331 of file figure_manager.hpp.
| bool nk::FigureManager::getFigureTile |
( |
int | figId, |
|
|
int | axIdx, |
|
|
int | dsIdx, |
|
|
int | r0, |
|
|
int | c0, |
|
|
int | h, |
|
|
int | w, |
|
|
int | lod, |
|
|
std::vector< uint8_t > & | out, |
|
|
size_t & | outRows, |
|
|
size_t & | outCols ) const |
|
inline |
Source-grid tile fetcher (kept for Stage A/B compat tests).
Reads a sub-rectangle rows [r0, r0+h) × cols [c0, c0+w) from zQuantized, mean-pools by lod×lod, writes row-major uint8 indices to out. Stage C uses getFigureDisplayTile instead — that one resamples to display-pixel grid in one pass.
Definition at line 1381 of file figure_manager.hpp.
| DecimatedSeries nk::FigureManager::getSeriesDisplayTile |
( |
int | figId, |
|
|
int | axIdx, |
|
|
int | dsIdx, |
|
|
double | x0, |
|
|
double | x1, |
|
|
int | width, |
|
|
int | algo ) const |
|
inline |
Display-grid tile resampler.
Fills a displayH × displayW row-major uint8 buffer with mean-pooled samples from the dataset's zQuantized, applying optional log10 inverse on either axis so the buffer can be blitted directly to the panel's pixel grid.
srcR0, srcC0, srcH, srcW : visible source-rect in source-cell coords (fractional allowed for log inverse) xLog, yLog : log10 axis transforms — when set, the source-cell at display-pixel u (or v) is srcC0 * (srcC1/srcC0)^(u/displayW), etc. Requires srcC0 > 0 (yLog: srcR0 > 0). out : caller-allocated, size ≥ displayH*displayW
Per display pixel:
- compute its source-cell centre via linear or log map
- mean-pool over a small ⌈srcStep⌉×⌈cStep⌉ block centred there
- skip NaN sentinels (idx 255), write 255 if the block is all-NaN
Cost: O(displayH * displayW * ⌈rStep⌉ * ⌈cStep⌉) — for a 800×600 panel showing the full 10000² extent that's ~30M ops, ~30ms in WASM. The upcoming Stage D LOD pyramid drops this to ~3 ms by reading from a pre-pooled level rather than the L0 source.
Returns false if request is out of range / not imagesc / no zQuantized / log requested with non-positive source coords.
Definition at line 1187 of file figure_manager.hpp.