Skip to content

Commit

Permalink
Gamma correction WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoburns committed May 21, 2024
1 parent 3bc1952 commit cab2dfb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions examples/simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,22 @@ use swash::scale::{Render, ScaleContext, Source, StrikeWith};
use swash::zeno;
use swash::{FontRef, GlyphId};

// fn u8_to_float(num: u8) -> f32 {
// num as f32 / 255.0
// }

// fn float_to_u8(num: f32) -> u8 {
// (num * 255.0) as u8
// }

// fn to_linear_rgb(srgb: f32) -> f32 {
// if srgb <= 0.04045 {
// srgb / 12.92
// } else {
// ((srgb + 0.055) / 1.055).powf(2.4)
// }
// }

fn main() {
// The text we are going to style and lay out
let text = String::from(
Expand Down
Binary file removed output.png
Binary file not shown.

0 comments on commit cab2dfb

Please sign in to comment.