FastLED 3.9.15
Loading...
Searching...
No Matches

◆ bounds_pixels()

rect< u16 > fl::XYRasterSparse_RGB8::bounds_pixels ( ) const
inline

Definition at line 286 of file raster_sparse.h.

286 {
287 u16 min_x = 0;
288 bool min_x_set = false;
289 u16 min_y = 0;
290 bool min_y_set = false;
291 u16 max_x = 0;
292 bool max_x_set = false;
293 u16 max_y = 0;
294 bool max_y_set = false;
295 for (const auto &it : mSparseGrid) {
296 const vec2<u16> &pt = it.first;
297 if (!min_x_set || pt.x < min_x) {
298 min_x = pt.x;
299 min_x_set = true;
300 }
301 if (!min_y_set || pt.y < min_y) {
302 min_y = pt.y;
303 min_y_set = true;
304 }
305 if (!max_x_set || pt.x > max_x) {
306 max_x = pt.x;
307 max_x_set = true;
308 }
309 if (!max_y_set || pt.y > max_y) {
310 max_y = pt.y;
311 max_y_set = true;
312 }
313 }
314 return rect<u16>(min_x, min_y, max_x + 1, max_y + 1);
315 }

References mSparseGrid, fl::vec2< T >::x, and fl::vec2< T >::y.

Referenced by bounds().

+ Here is the caller graph for this function: