Reputation: 133
I have an app that requires precise control of the torch output level. The level is set through this function:
The function asks for a continuous float between 0 and 1 but only seems to have 4 different output levels from 0 - 1.
Is this correct? I cannot find any documentation on whether the change is continuous or discrete across the input range.
Upvotes: 1
Views: 287
Reputation: 126167
How the underlying OS and hardware interpret the torch level value you pass is an implementation detail. In other words, the value is best understood as merely an advisory to the underlying system, with magnitude relevant only when compared against itself. That is, you can expect 1.0 to be as bright or brighter than 0.5, but only on the same hardware and the same OS version. (Max brightness on iPhone 7 is brighter than on iPhone 6, for example.) And the API makes no guarantees as to how many discrete brightness levels the underlying system supports.
(Aside: floats are not continuous. Okay, there's about 100 million discrete values between 0.0 and 1.0, not counting subnormals, which is smooth enough for a lot of use cases... but definitely not the same as continuous.)
Upvotes: 1