LayerData.idxToCol

get the column corresponding to a position in the data or objects array.

struct LayerData
@property
idxToCol
(
size_t idx
)

Examples

LayerData layer;
layer.numCols = 3;
layer.numRows = 2;

assert(layer.idxToCol(0) == 0);
assert(layer.idxToCol(1) == 1);
assert(layer.idxToCol(2) == 2);
assert(layer.idxToCol(3) == 0);
assert(layer.idxToCol(4) == 1);
assert(layer.idxToCol(5) == 2);

Meta