Restrict functions to pub(crate) where appropriate
This commit is contained in:
parent
b6abf4c890
commit
9285727e95
2 changed files with 8 additions and 7 deletions
|
|
@ -56,7 +56,7 @@ impl ColorType {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn channels_per_pixel(&self) -> u8 {
|
pub(crate) fn channels_per_pixel(&self) -> u8 {
|
||||||
match self {
|
match self {
|
||||||
ColorType::Grayscale { .. } | ColorType::Indexed { .. } => 1,
|
ColorType::Grayscale { .. } | ColorType::Indexed { .. } => 1,
|
||||||
ColorType::GrayscaleAlpha => 2,
|
ColorType::GrayscaleAlpha => 2,
|
||||||
|
|
@ -66,12 +66,12 @@ impl ColorType {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn is_rgb(&self) -> bool {
|
pub(crate) fn is_rgb(&self) -> bool {
|
||||||
matches!(self, ColorType::RGB { .. } | ColorType::RGBA)
|
matches!(self, ColorType::RGB { .. } | ColorType::RGBA)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn has_alpha(&self) -> bool {
|
pub(crate) fn has_alpha(&self) -> bool {
|
||||||
matches!(self, ColorType::GrayscaleAlpha | ColorType::RGBA)
|
matches!(self, ColorType::GrayscaleAlpha | ColorType::RGBA)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -53,10 +53,11 @@ impl Display for RowFilter {
|
||||||
|
|
||||||
impl RowFilter {
|
impl RowFilter {
|
||||||
pub const LAST: u8 = Self::Brute as u8;
|
pub const LAST: u8 = Self::Brute as u8;
|
||||||
pub const STANDARD: [Self; 5] = [Self::None, Self::Sub, Self::Up, Self::Average, Self::Paeth];
|
pub(crate) const STANDARD: [Self; 5] =
|
||||||
pub const SINGLE_LINE: [Self; 2] = [Self::None, Self::Sub];
|
[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,
|
self,
|
||||||
bpp: usize,
|
bpp: usize,
|
||||||
data: &mut [u8],
|
data: &mut [u8],
|
||||||
|
|
@ -176,7 +177,7 @@ impl RowFilter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn unfilter_line(
|
pub(crate) fn unfilter_line(
|
||||||
self,
|
self,
|
||||||
bpp: usize,
|
bpp: usize,
|
||||||
data: &[u8],
|
data: &[u8],
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue