build an app on os x to clear the gamma lut of display 1 or 2
$30-100 USD
Closed
Posted over 14 years ago
$30-100 USD
Paid on delivery
I need an app (which can have a UI or can run on the command line), very simple, that will clear the LUT of the graphic card of Display 1 or Display 2 attached to the mac
## Deliverables
I don't necessarily need an app with a gui, just a shell command such as
/usr/local/binresetlut 1 or?
/usr/local/binresetlut 2
would fit me perfectly
Apple has documented the ColorSync API here :? [login to view URL]
the function that is interesting for us is? `<a href="[login to view URL]" style="color: rgb(0, 51, 102); text-decoration: none;">CMSetGammaByAVID</a>`?
I have this sample code that might help you getting started.
- (void) linearizeLUT: (id) sender
{
? ? CMError? ? err? ? ? = noErr;
? ? CMVideoCardGamma? ? gamma;
? ? Fixed? ? baseGamma? ? = FloatToFixed(1.0);
? ? Fixed? ? minGamma? ? = FloatToFixed(0.0);
? ? Fixed? ? maxGamma? ? = FloatToFixed(1.0);
? ? ?
? ? [login to view URL] ? = cmVideoCardGammaFormulaType;
? ? [login to view URL] ? = baseGamma;
? ? [login to view URL] = minGamma;
? ? [login to view URL] = maxGamma;
? ? [login to view URL] ? = baseGamma;
? ? [login to view URL] ? = minGamma;
? ? [login to view URL] ? = maxGamma;
? ? [login to view URL] ? = baseGamma;
? ? [login to view URL] = minGamma;
? ? [login to view URL] = maxGamma;
? ? ?
? ? err = CMSetGammaByAVID((DisplayIDType)CGMainDisplayID(), &gamma);
? ? ?
? ? if ( err == noErr )
? ? {
? gLUTCleared = true;?
? ? }
}