Orrery Terrain · OrreryTerrainCore module · function
Native::
SampleBrushMaskRow
ExperimentalSample one row of posts: post i lies at offset (Dx_mm + i × Step_mm, Dy_mm) from the brush centre.
Declaration
void SampleBrushMaskRow(const FBrushMaskDab& Dab, int64_t Dx_mm, int64_t Dy_mm, int64_t Step_mm, int32_t Count,
int32_t* OutM, int32_t* OutT = nullptr);- Header
#include "Native/BrushMask.h"- Module
PublicDependencyModuleNames.Add("OrreryTerrainCore");in your module’s Build.cs.- Stability
- Experimental: supported, may change in a minor version, with a changelog line.
- Thread
- Pure integer arithmetic, any thread; no allocation.
Description
Writes OutM[i], the value SampleBrushMask gives at the post's local position (FBrushMaskDab::Local), or kBrushMaskOutside when the post is off the rectangle; and, when OutT is not null, OutT[i], FBrushMaskDab::SquareT_q16 there (unspecified off it).
The rotation's two accumulators step along the row by Step_mm × cos and Step_mm × sin, exact integer sums, so every value equals the per-post one bit for bit, however long the row (BrushMask.RowSampler).
Parameters
| Name | Type | Default | Meaning |
|---|---|---|---|
Dab | const FBrush | — | The dab, prepared by PrepareBrushMaskDab. |
Dx_mm | int64_ | — | Post 0's offset from the brush centre along world X, in mm. |
Dy_mm | int64_ | — | The row's offset from the brush centre along world Y, in mm. |
Step_mm | int64_ | — | The spacing of the posts along world X, in mm (the cell). |
Count | int32_ | — | Posts in the row, at least 0. Every post's offset, and the one a step past the last, lies within ±2^31 mm (any post of a footprint does). |
OutM | int32_ | — | Count values, out. |
OutT | int32_ | nullptr | Optional: Count values, out. |
Pure integer arithmetic, any thread; no allocation.