Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env groovy
- int range = 940 - 64;
- for (r in 0..range) {
- def e = (double)r / (double)range;
- def o = new BigDecimal(eotf(e))
- println("${r + 64}: ${o.toPlainString()}")
- }
- double eotf(double o) {
- def y = ioetf(o)
- return 1_000.0 * Math.pow(y, 1.2 - 1.0) * y
- }
- double ioetf(double e) {
- return e < 0.5 ? Math.pow(e, 2.0) / 3.0 : (Math.exp(((e - 0.55991073) / 0.17883277)) + 0.28466892) / 12
- }
RAW Paste Data
Copied