Treehopper C++ API
Utility.h
Go to the documentation of this file.
1 #pragma once
2 
4 #include <math.h>
5 
6 namespace Treehopper {
7  namespace Libraries {
8  namespace Displays {
10  public:
19  static double brightnessToCieLuminance(double brightness) {
20  if (brightness > 0.008856)
21  return ((15625 * pow(brightness, 3)) + (7500 * pow(brightness, 2)) + (1200 * brightness) + 64) /
22  24389.0;
23  else
24  return 1000 * brightness / 9033.0;
25  }
26  };
27  }
28  }
29 }
#define LIBRARIES_API
Definition: Treehopper.Libraries.h:17
Definition: AdcPin.h:3
static double brightnessToCieLuminance(double brightness)
Returns the CIE 1976 relative luminance calculated from an input intensity (brightness) ...
Definition: Utility.h:19