Skip to content

Commit

Permalink
Fix some typos, backticks, new clippy lint. (#683)
Browse files Browse the repository at this point in the history
  • Loading branch information
waywardmonkeys authored Sep 6, 2024
1 parent 71b484c commit 3c9343b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions vello_encoding/src/mask.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ fn one_mask(slope: f64, mut translation: f64, is_pos: bool) -> u8 {
/// Make a lookup table of half-plane masks.
///
/// The table is organized into two blocks each with `MASK_HEIGHT/2` slopes.
/// The first block is negative slopes (x decreases as y increates),
/// The first block is negative slopes (x decreases as y increases),
/// the second as positive.
pub fn make_mask_lut() -> Vec<u8> {
(0..MASK_WIDTH * MASK_HEIGHT)
Expand Down Expand Up @@ -78,7 +78,7 @@ fn one_mask_16(slope: f64, mut translation: f64, is_pos: bool) -> u16 {
/// Make a lookup table of half-plane masks.
///
/// The table is organized into two blocks each with `MASK16_HEIGHT/2` slopes.
/// The first block is negative slopes (x decreases as y increates),
/// The first block is negative slopes (x decreases as y increases),
/// the second as positive.
pub fn make_mask_lut_16() -> Vec<u8> {
let v16 = (0..MASK16_WIDTH * MASK16_HEIGHT)
Expand Down
6 changes: 4 additions & 2 deletions vello_encoding/src/math.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ pub fn point_to_f32(point: kurbo::Point) -> [f32; 2] {
[point.x as f32, point.y as f32]
}

/// Converts an f32 to IEEE-754 binary16 format represented as the bits of a u16.
/// Converts an `f32` to IEEE-754 binary16 format represented as the bits of a `u16`.
///
/// This implementation was adapted from Fabian Giesen's `float_to_half_fast3`()
/// function which can be found at <https://gist.github.com/rygorous/2156668#file-gistfile1-cpp-L285>
///
Expand Down Expand Up @@ -122,7 +123,8 @@ pub(crate) fn f32_to_f16(val: f32) -> u16 {
output | (sign >> 16) as u16
}

/// Convertes a 16-bit precision IEEE-754 binary16 float to a f32.
/// Converts a 16-bit precision IEEE-754 binary16 float to a `f32`.
///
/// This implementation was adapted from Fabian Giesen's `half_to_float()`
/// function which can be found at <https://gist.github.com/rygorous/2156668#file-gistfile1-cpp-L574>
pub fn f16_to_f32(bits: u16) -> f32 {
Expand Down

0 comments on commit 3c9343b

Please sign in to comment.