Skip to content

Commit

Permalink
trait BitDepth: Justify docs for fn from_c to col 80 and change l…
Browse files Browse the repository at this point in the history
…anguage to avoid discussing the dev process.
  • Loading branch information
kkysen committed Jul 24, 2023
1 parent 509293c commit c595197
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions include/common/bitdepth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,14 @@ pub trait BitDepth: Clone + Copy {

fn new(bitdepth_max: Self::BitDepthMax) -> Self;

/// While [`Self::new`] is the implementation specific way to construct a [`BitDepth`],
/// [`Self::from_c`] is a uniform way to construct a [`BitDepth`]
/// from its C representation, which is a [`c_int`].
/// While [`BitDepth::new`] is the implementation specific way to
/// construct a [`BitDepth`], [`BitDepth::from_c`] is a uniform way to
/// construct a [`BitDepth`] from its C representation, a [`c_int`].
///
/// Since we're deduplicating [`BitDepth`]-dependent `fn` ptr types through type erasure,
/// and always passing the `bitdepth_max` last argument
/// even for `8bpc` `fn`s where it's superfluous (it's constant),
/// we need to convert from that `bitdepth_max: c_int` arg back to a [`BitDepth`].
/// Since [`BitDepth`]-dependent `fn` ptr types use type erasure, they
/// always pass the `bitdepth_max` last argument (even for `8bpc``fn`s
/// where it's superfluous (it's constant)), so we need to convert from
/// that `bitdepth_max: c_int` arg back to a [`BitDepth`].
fn from_c(bitdepth_max: c_int) -> Self;

fn pixel_copy(dest: &mut [Self::Pixel], src: &[Self::Pixel], n: usize) {
Expand Down

0 comments on commit c595197

Please sign in to comment.