Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 //------------------------------------------------------------------------------ --- | 1 //------------------------------------------------------------------------------ --- |
| 2 // | 2 // |
| 3 // Little Color Management System | 3 // Little Color Management System |
| 4 // Copyright (c) 1998-2014 Marti Maria Saguer | 4 // Copyright (c) 1998-2014 Marti Maria Saguer |
| 5 // | 5 // |
| 6 // Permission is hereby granted, free of charge, to any person obtaining | 6 // Permission is hereby granted, free of charge, to any person obtaining |
| 7 // a copy of this software and associated documentation files (the "Software"), | 7 // a copy of this software and associated documentation files (the "Software"), |
| 8 // to deal in the Software without restriction, including without limitation | 8 // to deal in the Software without restriction, including without limitation |
| 9 // the rights to use, copy, modify, merge, publish, distribute, sublicense, | 9 // the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 10 // and/or sell copies of the Software, and to permit persons to whom the Softwar e | 10 // and/or sell copies of the Software, and to permit persons to whom the Softwar e |
| (...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 605 | 605 |
| 606 | 606 |
| 607 cmsHPROFILE CMSEXPORT cmsCreateXYZProfile(void) | 607 cmsHPROFILE CMSEXPORT cmsCreateXYZProfile(void) |
| 608 { | 608 { |
| 609 return cmsCreateXYZProfileTHR(NULL); | 609 return cmsCreateXYZProfileTHR(NULL); |
| 610 } | 610 } |
| 611 | 611 |
| 612 | 612 |
| 613 //sRGB Curves are defined by: | 613 //sRGB Curves are defined by: |
| 614 // | 614 // |
| 615 //If RsRGB,GsRGB, BsRGB < 0.04045 | 615 //If R'sRGB,G'sRGB, B'sRGB < 0.04045 |
|
Tom Sepez
2016/12/01 21:06:14
nit: can we lose the ' here?
scottmg
2016/12/01 21:13:56
I thought it was supposed to be how Rprime was use
| |
| 616 // | 616 // |
| 617 // R = RsRGB / 12.92 | 617 // R = R'sRGB / 12.92 |
| 618 // G = GsRGB / 12.92 | 618 // G = G'sRGB / 12.92 |
| 619 // B = BsRGB / 12.92 | 619 // B = B'sRGB / 12.92 |
| 620 // | 620 // |
| 621 // | 621 // |
| 622 //else if RsRGB,GsRGB, BsRGB >= 0.04045 | 622 //else if R'sRGB,G'sRGB, B'sRGB >= 0.04045 |
| 623 // | 623 // |
| 624 // R = ((RsRGB + 0.055) / 1.055)^2.4 | 624 // R = ((R'sRGB + 0.055) / 1.055)^2.4 |
| 625 // G = ((GsRGB + 0.055) / 1.055)^2.4 | 625 // G = ((G'sRGB + 0.055) / 1.055)^2.4 |
| 626 // B = ((BsRGB + 0.055) / 1.055)^2.4 | 626 // B = ((B'sRGB + 0.055) / 1.055)^2.4 |
| 627 | 627 |
| 628 static | 628 static |
| 629 cmsToneCurve* Build_sRGBGamma(cmsContext ContextID) | 629 cmsToneCurve* Build_sRGBGamma(cmsContext ContextID) |
| 630 { | 630 { |
| 631 cmsFloat64Number Parameters[5]; | 631 cmsFloat64Number Parameters[5]; |
| 632 | 632 |
| 633 Parameters[0] = 2.4; | 633 Parameters[0] = 2.4; |
| 634 Parameters[1] = 1. / 1.055; | 634 Parameters[1] = 1. / 1.055; |
| 635 Parameters[2] = 0.055 / 1.055; | 635 Parameters[2] = 0.055 / 1.055; |
| 636 Parameters[3] = 1. / 12.92; | 636 Parameters[3] = 1. / 12.92; |
| (...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1185 cmsSetHeaderRenderingIntent(hProfile, xform ->RenderingIntent); | 1185 cmsSetHeaderRenderingIntent(hProfile, xform ->RenderingIntent); |
| 1186 | 1186 |
| 1187 cmsPipelineFree(LUT); | 1187 cmsPipelineFree(LUT); |
| 1188 return hProfile; | 1188 return hProfile; |
| 1189 | 1189 |
| 1190 Error: | 1190 Error: |
| 1191 if (LUT != NULL) cmsPipelineFree(LUT); | 1191 if (LUT != NULL) cmsPipelineFree(LUT); |
| 1192 cmsCloseProfile(hProfile); | 1192 cmsCloseProfile(hProfile); |
| 1193 return NULL; | 1193 return NULL; |
| 1194 } | 1194 } |
| OLD | NEW |