MCPcopy Create free account
hub / github.com/FastLED/FastLED / map

Method map

src/fl/math/math.h:194–215  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

192namespace map_range_detail {
193
194inline u8 map_range_math<u8, u8>::map(u8 value, u8 in_min, u8 in_max,
195 u8 out_min, u8 out_max) FL_NOEXCEPT {
196 if (value == in_min) {
197 return out_min;
198 }
199 if (value == in_max) {
200 return out_max;
201 }
202 i16 v16 = value;
203 i16 in_min16 = in_min;
204 i16 in_max16 = in_max;
205 i16 out_min16 = out_min;
206 i16 out_max16 = out_max;
207 i16 out16 = fl::map_range<i16, i16>(v16, in_min16, in_max16,
208 out_min16, out_max16);
209 if (out16 < 0) {
210 out16 = 0;
211 } else if (out16 > 255) {
212 out16 = 255;
213 }
214 return static_cast<u8>(out16);
215}
216
217inline u16 map_range_math<u16, u16>::map(u16 value, u16 in_min, u16 in_max,
218 u16 out_min, u16 out_max) FL_NOEXCEPT {

Callers 15

index.tsFile · 0.45
customPrintFunctionFunction · 0.45
partitionFunction · 0.45
getFileManifestJsonFunction · 0.45
fetchAllFilesFunction · 0.45
initializeMethod · 0.45
calculateMetricsMethod · 0.45
markdownToHtmlFunction · 0.45
startRecordingMethod · 0.45
readMethod · 0.45
create_checkersFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected