Experiment(){
Context(){
AssignmentGroup(){
SubjectCode = "pxlab";
RandomizeTrials = 0;
// D65 white point at 100 cd/qm
CIEWhitePoint = [100, 0.313, 0.329];
new x = gray();
new xToXYZ = toXYZ(x);
new xToCIELab = toCIELab(x);
new xToCIELabLCh = toCIELabLCh(x);
new xToDevRGB = toDevRGB(x);
new a = 0;
new aXYZ = fromXYZ(a);
new b = 0;
new bCIELab = fromCIELab(b);
new c = 0;
new cCIELabLCh = fromCIELabLCh(c);
new d = 0;
new dDevRGB = fromDevRGB(d);
}
Session(){
Instruction(){
Text = ["Color Transformations", " ", " ", "This application can test PXLab\'s color transformations and it can be used to check whether a color table is used properly.", " ", "Press any key now to start!"];
}
}
Trial( x, a, b, c, d){
TextParagraph(){
Text = ["Input:", "x = %x%", "Transformations:", "toXYZ(x) = %xToXYZ%", "toCIELab(x) = %xToCIELab%", "toCIELabLCh(x) = %xToCIELabLCh%", "toDevRGB(x) = %xToDevRGB%", " ", "Input: XYZ a = %a%", "Transformation: fromXYZ(a) = %aXYZ%", " ", "Input: CIELab b = %b%", "Transformation: fromCIELab(b) = %bCIELab%", " ", "Input: CIELabLCh c = %b%", "Transformation: fromCIELabLCh(c) = %cCIELabLCh%", " ", "Input: RGB d = %d%", "Transformation: fromDevRGB(d) = %dDevRGB%", " ", "Current CIELab White Point = %CIEWhitePoint%"];
Timer = RESPONSE_TIMER;
FontSize = screenHeight()/40;
}
}
Trial:short( x, a, d){
TextParagraph(){
Text = ["Input:", "x = %x%", "Transformations:", "toXYZ(x) = %xToXYZ%", "toDevRGB(x) = %xToDevRGB%", " ", "Input: XYZ a = %a%", "Transformation: fromXYZ(a) = %aXYZ%", " ", "Input: RGB d = %d%", "Transformation: fromDevRGB(d) = %dDevRGB%", " ", "Current CIELab White Point = %CIEWhitePoint%"];
Timer = RESPONSE_TIMER;
FontSize = screenHeight()/40;
}
}
// Command line assignments
AssignmentGroup();
}
Procedure(){
Session(){
Block(){
// This is for testing the forward and backward transforms
Trial( [40, 0.356, 0.244], [58.3607, 40, 65.5738], [69.4695, 56.4387, -21.5704], [69.4695, 60.4202, -20.9164], [200, 105, 176]);
// This is for testing the color table usage
Trial:short( [21.26, 0.511, 0.299], [36.334, 21.26, 13.5097], [189, 53, 82]);
Trial:short( [92.78, 0.364, 0.423], [79.8391, 92.78, 46.719], [209, 207, 129]);
// Only a single digit (92.78 -> 92.77) change // will prevent PXLab to use th color table
Trial:short( [92.77, 0.364, 0.423], [79.8391, 92.78, 46.719], [209, 207, 129]);
}
}
}
}