MCPcopy Create free account
hub / github.com/RobTillaart/Arduino / boundingBox

Method boundingBox

libraries/SparseMatrix/SparseMatrix.cpp:111–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109
110
111void SparseMatrix::boundingBox(uint8_t &minX, uint8_t &maxX, uint8_t &minY, uint8_t &maxY)
112{
113 uint8_t _minx = 255, _maxx = 0,
114 _miny = 255, _maxy = 0;
115 for (uint16_t i = 0; i < _count; i++)
116 {
117 if (_x[i] < _minx) _minx = _x[i];
118 if (_x[i] > _maxx) _maxx = _x[i];
119 if (_y[i] < _miny) _miny = _y[i];
120 if (_y[i] > _maxy) _maxy = _y[i];
121 }
122 minX = _minx;
123 maxX = _maxx;
124 minY = _miny;
125 maxY = _maxy;
126}
127
128
129//////////////////////////////////////////////////////

Callers 1

unittestFunction · 0.80

Calls

no outgoing calls

Tested by 1

unittestFunction · 0.64