Skip to content
Brass Orrery

Orrery Terrain · OrreryTerrainCore module · function

Native::

SampleBrushMaskRow

Experimental

Sample 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

NameTypeDefaultMeaning
Dabconst FBrushMaskDab&—

The dab, prepared by PrepareBrushMaskDab.

Dx_mmint64_t—

Post 0's offset from the brush centre along world X, in mm.

Dy_mmint64_t—

The row's offset from the brush centre along world Y, in mm.

Step_mmint64_t—

The spacing of the posts along world X, in mm (the cell).

Countint32_t—

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).

OutMint32_t*—

Count values, out.

OutTint32_t*nullptr

Optional: Count values, out.

Note.

Pure integer arithmetic, any thread; no allocation.