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.)
"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.
Also, I had found the hardware registers through some hacking, so I asked Jay how to write to kernel memory...he pointed out that Apple had added this API as a PrivateFramework already.
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.)