color-management: implement set_tf_power
This commit is contained in:
parent
a2d726e508
commit
c37567f1cd
8 changed files with 121 additions and 28 deletions
10
src/theme.rs
10
src/theme.rs
|
|
@ -121,6 +121,11 @@ impl Color {
|
|||
Eotf::Log100 => convert!(log100),
|
||||
Eotf::Log316 => convert!(log316),
|
||||
Eotf::St428 => convert!(st428),
|
||||
Eotf::Pow(n) => {
|
||||
let e = n.eotf_f32();
|
||||
let pow = |c: f32| -> f32 { c.signum() * c.abs().powf(e) };
|
||||
convert!(pow)
|
||||
}
|
||||
}
|
||||
Self { r, g, b, a: 1.0 }
|
||||
}
|
||||
|
|
@ -246,6 +251,11 @@ impl Color {
|
|||
Eotf::Log100 => convert!(log100),
|
||||
Eotf::Log316 => convert!(log316),
|
||||
Eotf::St428 => convert!(st428),
|
||||
Eotf::Pow(n) => {
|
||||
let e = n.inv_eotf_f32();
|
||||
let pow = |c: f32| -> f32 { c.signum() * c.abs().powf(e) };
|
||||
convert!(pow)
|
||||
}
|
||||
}
|
||||
if self.a < 1.0 {
|
||||
for c in &mut res[..3] {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue