|
CGVIS Utils
|
2D scalar grid (float) with sampling, arithmetic, SDF, and I/O helpers. More...
#include <iostream>#include <string>#include <vector>#include "Vec2.h"#include "Vec3.h"#include "Image.h"#include "GLTexture2D.h"Go to the source code of this file.
Classes | |
| class | Grid2D |
2D scalar grid (float) with sampling, arithmetic, SDF, and I/O helpers.
Represents a width×height grid of single‑precision values stored in row‑major order. Provides bilinear sampling in normalized coordinates, gradient‑based normal estimation, per‑element arithmetic (with scalars and other grids, with automatic size reconciliation), conversion to images / textures, and simple binary streaming.
Unless stated otherwise, functions interpret normalized positions (x,y) with 0 at the left/bottom and 1 at the right/top, and clamp to [0,1]. When combining two grids of different sizes, operations resample the smaller grid to the larger grid's resolution using bilinear sampling.