Skip to content

Instantly share code, notes, and snippets.

@aforsythe
Last active October 21, 2017 17:16
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aforsythe/073275042058247d36d4d3428febf8da to your computer and use it in GitHub Desktop.
Save aforsythe/073275042058247d36d4d3428febf8da to your computer and use it in GitHub Desktop.
Unified ODT API
struct ODT_tonescale_params
{
float Y_max;
float Y_min;
float Y_mid;
};
struct Primaries
{
float red[2];
float green[2];
float blue[2];
};
struct Whitepoint
{
float x;
float y;
};
struct EOTF_1886_params
{
float gamma;
float Lw;
float Lb;
};
struct EOTF_MonCurve_params
{
float gamma;
float offset;
};
struct EOTF_GammaOffset_params
{
float gamma;
float offset;
};
struct EOTF_params
{
EOTF_1886_params eotf_1886;
EOTF_MonCurve_params eotf_moncurve;
EOTF_GammaOffset_params eotf_gammaoffset;
};
struct ODT_Parameters
{
ODT_tonescale_params tonescale_params;
Primaries device_primaries;
Whitepoint device_whitepoint;
Primaries limit_primaries;
int eotf_equation;
EOTF_params eotf_params;
bool dim_surround;
bool d60_sim;
bool legal_range;
};
import "ACESlib.ODT_Common";
void main
(
input varying float rIn,
input varying float gIn,
input varying float bIn,
input varying float aIn,
output varying float rOut,
output varying float gOut,
output varying float bOut,
output varying float aOut,
input uniform ODT_Parameters custom_params
)
{
// Execute Unified ODT
float aces[3] = {rIn, gIn, bIn}
float outputCV[3] = unified_odt( in, custom_params);
aOut = aIn;
}
// <ACEStransformID>ODT.Academy.P3D60_48nits.a1.x</ACEStransformID>
// <ACESuserName>ACES 1.0 Output - P3-D60</ACESuserName>
//
// Output Device Transform - P3D60
//
//
// Summary :
// This transform is intended for mapping OCES onto a P3 digital cinema
// projector that is calibrated to a D60 white point at 48 cd/m^2. The assumed
// observer adapted white is D60, and the viewing environment is that of a dark // theater.
//
// Device Primaries :
// CIE 1931 chromaticities: x y Y
// Red: 0.68 0.32
// Green: 0.265 0.69
// Blue: 0.15 0.06
// White: 0.32168 0.33767 48 cd/m^2
//
// Display EOTF :
// Gamma: 2.6
//
// Assumed observer adapted white point:
// CIE 1931 chromaticities: x y
// 0.32168 0.33767
//
// Viewing Environment:
// Environment specified in SMPTE RP 431-2-2007
//
import "ACESlib.ODT_Common";
void main
(
input varying float rIn,
input varying float gIn,
input varying float bIn,
input varying float aIn,
output varying float rOut,
output varying float gOut,
output varying float bOut,
output varying float aOut)
{
// Declare ODT parameters
ODT_Parameters P3D60_params =
{
{ 48, 0, 4.8 }
{ { 0.73470, 0.26530}, { 0.00000, 1.00000}, { 0.00010, -0.07700} }, // device primaries
{ 0.32168, 0.33767}, // device whitepoint
{ { 0.73470, 0.26530}, { 0.00000, 1.00000}, { 0.00010, -0.07700} }, // limit_primaries
3, // eotf model pq=0, 1886=1, moncurve=2, gammaOffset=3
{ { 0., 0., 0.}, {0., 0.}, {2.6, 48.} }, // EOTF parameters
0, // dim surround
0, // d60 sim
0 // legal range
};
// Execute Unified ODT
float aces[3] = {rIn, gIn, bIn}
float outputCV[3] = unified_odt( in, P3D60_params);
aOut = aIn;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment