LayerData.idxToCol

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

struct LayerData
@property
idxToCol
(
size_t idx
)

Examples

1 LayerData layer;
2 layer.numCols = 3;
3 layer.numRows = 2;
4 
5 assert(layer.idxToCol(0) == 0);
6 assert(layer.idxToCol(1) == 1);
7 assert(layer.idxToCol(2) == 2);
8 assert(layer.idxToCol(3) == 0);
9 assert(layer.idxToCol(4) == 1);
10 assert(layer.idxToCol(5) == 2);

Meta