Restrict functions to pub(crate) where appropriate

This commit is contained in:
Andrew 2023-05-02 01:22:47 +12:00
parent b6abf4c890
commit 9285727e95
2 changed files with 8 additions and 7 deletions

View file

@ -56,7 +56,7 @@ impl ColorType {
}
#[inline]
pub fn channels_per_pixel(&self) -> u8 {
pub(crate) fn channels_per_pixel(&self) -> u8 {
match self {
ColorType::Grayscale { .. } | ColorType::Indexed { .. } => 1,
ColorType::GrayscaleAlpha => 2,
@ -66,12 +66,12 @@ impl ColorType {
}
#[inline]
pub fn is_rgb(&self) -> bool {
pub(crate) fn is_rgb(&self) -> bool {
matches!(self, ColorType::RGB { .. } | ColorType::RGBA)
}
#[inline]
pub fn has_alpha(&self) -> bool {
pub(crate) fn has_alpha(&self) -> bool {
matches!(self, ColorType::GrayscaleAlpha | ColorType::RGBA)
}

View file

@ -53,10 +53,11 @@ impl Display for RowFilter {
impl RowFilter {
pub const LAST: u8 = Self::Brute as u8;
pub const STANDARD: [Self; 5] = [Self::None, Self::Sub, Self::Up, Self::Average, Self::Paeth];
pub const SINGLE_LINE: [Self; 2] = [Self::None, Self::Sub];
pub(crate) const STANDARD: [Self; 5] =
[Self::None, Self::Sub, Self::Up, Self::Average, Self::Paeth];
pub(crate) const SINGLE_LINE: [Self; 2] = [Self::None, Self::Sub];
pub fn filter_line(
pub(crate) fn filter_line(
self,
bpp: usize,
data: &mut [u8],
@ -176,7 +177,7 @@ impl RowFilter {
}
}
pub fn unfilter_line(
pub(crate) fn unfilter_line(
self,
bpp: usize,
data: &[u8],