

F.lux for iOS devices now available - ivank

Hidden in the comments on the f.lux website is an announcement:<p>"Hey guys, if you have a jailbroken iPad or iPhone, f.lux is now available for iOS. Go to Cydia &#62; Manage &#62; Sources &#62; Edit &#62; Add: flux.herf.org &#62; Search for "f.lux". Install! It's nice on phones, but amazing on iPads. Let us know how you like it!"<p>After the install, you can configure it in Settings.  I tried it out; it works really well but right now it has just three options:<p>Choose lighting: At night: [Candle | Incandescent | Halogen | Fluorescent]<p>Disabled for older devices: Long transition: [ON | OFF]<p>Turn off for color-sensitive work: Enabled: [ON | OFF]<p>Unfortunately there's no way to configure the daytime color temperature or the duration of night, so you have to keep resetting the clock if you want a reddish screen during the day.<p>You might be wondering how it works; a disassembly reveals that it uses these functions:<p><pre><code>  _IOMobileFramebufferGetGammaTable
  _IOMobileFramebufferSetGammaTable
  _IOMobileFramebufferGetMainDisplay</code></pre>
======
saurik
I worked with Herf on this: I spent a few hours at Foo Camp reversing those
functions, and then he told me enough about how gamma works (he seriously
seems to think in terms of exponential hex color shifts... it's sick) to get
the stuff working.

The code for iomfsetgamma is available in the uikittools package:
git://git.saurik.com/uikittools.git; if that version of uikittools isn't
released yet, then it will be about when iOS 5 hits.

(Note: any developers using these functions /need/ to coordinate using the
/tmp gamma cache so we don't lose the pristine gamma information. F.lux was
based on the code for iomfsetgamma, and thereby does this.)

The idea, btw, is that f.lux will be in a Cydia default repository, but as of
yesterday the depiction was still being finalized (it needed to get a mention
that it doesn't work on 2G/3G devices). I will check on the status of that
again today. ;P

(edit: oh yeah, I forgot that Herf found a simpler way to get the framebuffer,
which I haven't added to iomfsetgamma yet.)

~~~
ivank
Thanks! After seeing mobile f.lux I was looking for a way to set my own gamma
ramps. This should come in really handy.

~~~
herf
"Get" gamma ramp calls simply don't work on 2g/3g devices, so we have to
ignore Apple's calibration and just use the native display gamma. Apple is
using decent backlights on these, so it doesn't look terrible and this is now
in the 0.93 build.

------
wh-uws
Any word on an android version?

I recently discovered the program for desktop and I'm so thankful for how much
better sleep I've been getting

~~~
herf
Cyanogenmod has incorporated Jeff Sharkey's "surfaceflinger" patch to make the
compositor do a tint all the time. I have a private boot ROM that fully
implements f.lux, but it's impossible to ship that way...trying to get Google
to incorporate this patch so it can be used more generally.

Also, for calibration you'd want all Android devices to have a full gamma LUT.
It's not obvious if there's standard hardware in all the android
devices...some platforms like Snapdragon have one, but I couldn't find code
for it on all the rest. The OpenGL solution Jeff uses works everywhere.

------
jpitz
Background for those unfamiliar with f.lux - it is a utility for adjusting the
color temperature of your display at night to warmer temps. I'm quite fond of
it.

~~~
veyron
link: <http://stereopsis.com/flux/>

------
achompas
I might jailbreak my iPhone just for this.

