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

◆ bounds_pixels()

rect< int16_t > fl::XYRasterU8Sparse::bounds_pixels ( ) const
inline

Definition at line 111 of file raster_sparse.h.

111 {
112 int min_x = 0;
113 bool min_x_set = false;
114 int min_y = 0;
115 bool min_y_set = false;
116 int max_x = 0;
117 bool max_x_set = false;
118 int max_y = 0;
119 bool max_y_set = false;
120 for (const auto &it : mSparseGrid) {
121 const vec2<int16_t> &pt = it.first;
122 if (!min_x_set || pt.x < min_x) {
123 min_x = pt.x;
124 min_x_set = true;
125 }
126 if (!min_y_set || pt.y < min_y) {
127 min_y = pt.y;
128 min_y_set = true;
129 }
130 if (!max_x_set || pt.x > max_x) {
131 max_x = pt.x;
132 max_x_set = true;
133 }
134 if (!max_y_set || pt.y > max_y) {
135 max_y = pt.y;
136 max_y_set = true;
137 }
138 }
139 return rect<int16_t>(min_x, min_y, max_x + 1, max_y + 1);
140 }
HashMapLarge mSparseGrid

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

Referenced by bounds().

+ Here is the caller graph for this function: