Skip to content

Commit

Permalink
slight doc changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ripytide committed Jul 8, 2024
1 parent 79d2e63 commit 4a0165a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
1 change: 1 addition & 0 deletions src/formats/gray.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ pub struct Gray_v08<T>(
#[cfg_attr(feature = "defmt-03", derive(defmt::Format))]
#[derive(Copy, Clone, Debug, Default, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[doc(alias = "Luma")]
#[doc(alias = "Mono")]
#[doc(alias = "GRAY8")]
#[doc(alias = "GRAY16")]
pub struct Gray_v09<T> {
Expand Down
3 changes: 1 addition & 2 deletions src/pixel_traits/gain_alpha.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ pub trait GainAlpha: HetPixel {
/// assert_eq!(rgb.with_default_alpha(0), Rgba {r: 0, g: 10, b: 100, a: 0});
/// assert_eq!(rgba.with_default_alpha(0), Rgba {r: 0, g: 10, b: 100, a: 50});
/// ```
#[doc(alias = "gain_alpha_with")]
#[doc(alias = "gain_alpha")]
fn with_default_alpha(self, alpha: Self::AlphaComponent) -> Self::GainAlpha;

Expand All @@ -49,7 +48,7 @@ pub trait GainAlpha: HetPixel {
/// assert_eq!(rgb.with_alpha(0), Rgba {r: 0, g: 10, b: 100, a: 0});
/// assert_eq!(rgba.with_alpha(0), Rgba {r: 0, g: 10, b: 100, a: 0});
/// ```
#[doc(alias = "gain_alpha_exact")]
#[doc(alias = "gain_alpha")]
fn with_alpha(self, alpha: Self::AlphaComponent) -> Self::GainAlpha;
}

Expand Down
18 changes: 9 additions & 9 deletions src/pixel_traits/het_pixel.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use core::fmt::Display;
use crate::{Abgr, Argb, ArrayLike, Bgr, Bgra, Gray, GrayA, Grb, Rgb, Rgba, Rgbw};
use core::fmt::Display;

#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
/// Error returned from the [`HetPixel::try_from_colors_alpha()`] function.
Expand Down Expand Up @@ -41,16 +41,16 @@ pub trait HetPixel: Copy + 'static {
/// [`Rgba`] has a `COMPONENTS` == 4.
const COMPONENTS: u8;

/// Number of components minus alpha
/// The number of components in the pixel minus alpha.
///
/// * `Rgba` has `COLOR_COMPONENTS` == 3.
/// * `Rgbw` has `COLOR_COMPONENTS` == 4.
/// For example, [`Rgb`] has a `COLOR_COMPONENTS` == 3 whereas
/// [`Rgbw`] has a `COLOR_COMPONENTS` == 4.
const COLOR_COMPONENTS: u8;

/// The same pixel type as `Self` but with a different component type `U`.
///
/// This is used to allow the implementation of
/// [`HetPixel::map_colors`] and similar methods due to rust's
/// [`HetPixel::map_colors()`] and similar methods due to rust's
/// current lack of higher kinded types.
///
/// For example, [`Rgb`] has `SelfType<U, V> = Rgb<U>` whereas
Expand Down Expand Up @@ -117,9 +117,9 @@ pub trait HetPixel: Copy + 'static {
/// assert_eq!(rgb.alpha_opt(), None);
/// assert_eq!(rgba.alpha_opt(), Some(50));
/// ```
#[doc(alias="alpha")]
#[doc(alias="try_alpha")]
#[doc(alias="alpha_checked")]
#[doc(alias = "alpha")]
#[doc(alias = "try_alpha")]
#[doc(alias = "alpha_checked")]
fn alpha_opt(&self) -> Option<Self::AlphaComponent>;
/// Returns a mutable borrow of the pixel's alpha alpha component if it has one.
///
Expand All @@ -143,7 +143,7 @@ pub trait HetPixel: Copy + 'static {
/// assert_eq!(rgb.alpha_opt(), None);
/// assert_eq!(rgba.alpha_opt(), Some(40));
/// ```
#[doc(alias="alpha_checked_mut")]
#[doc(alias = "alpha_checked_mut")]
fn alpha_opt_mut(&mut self) -> Option<&mut Self::AlphaComponent>;

/// Tries to create new instance given an iterator of color components and an alpha component.
Expand Down

0 comments on commit 4a0165a

Please sign in to comment.