pub struct HistogramEqualizer {
pub use_parallel: bool,
}Expand description
Histogram equalization algorithms for 8-bit luma images.
Fields§
§use_parallel: boolWhen true, tile processing in CLAHE runs in parallel via rayon.
Implementations§
Source§impl HistogramEqualizer
impl HistogramEqualizer
Sourcepub fn equalize_luma(frame: &[u8], width: u32, height: u32) -> Vec<u8> ⓘ
pub fn equalize_luma(frame: &[u8], width: u32, height: u32) -> Vec<u8> ⓘ
Apply global histogram equalization to a single-channel (luma) image.
If the frame contains a single unique value, the input is returned unchanged.
§Arguments
frame– packed 8-bit luma bytes, row-major.width/height– image dimensions (informational; total pixels isframe.len()).
Sourcepub fn equalize_luma_instance(
&self,
frame: &[u8],
width: u32,
height: u32,
) -> Vec<u8> ⓘ
pub fn equalize_luma_instance( &self, frame: &[u8], width: u32, height: u32, ) -> Vec<u8> ⓘ
Instance method wrapping the static equalize_luma.
Sourcepub fn clahe(
frame: &[u8],
width: u32,
height: u32,
clip_limit: f32,
tile_size: u32,
) -> Vec<u8> ⓘ
pub fn clahe( frame: &[u8], width: u32, height: u32, clip_limit: f32, tile_size: u32, ) -> Vec<u8> ⓘ
Apply Contrast Limited Adaptive Histogram Equalization.
The image is partitioned into a tile_size × tile_size grid. Each
tile’s histogram is clipped at clip_limit, redistributed, and used to
derive a local look-up table. Each output pixel is produced by
bilinear interpolation of the four surrounding tile LUTs.
§Arguments
frame– packed 8-bit luma bytes, row-major.width/height– image dimensions.clip_limit– histogram clip ratio; 1.0 = fully clipped (equivalent to global equalization), larger values allow more local contrast.tile_size– tile edge length in pixels.
Trait Implementations§
Source§impl Clone for HistogramEqualizer
impl Clone for HistogramEqualizer
Source§fn clone(&self) -> HistogramEqualizer
fn clone(&self) -> HistogramEqualizer
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HistogramEqualizer
impl Debug for HistogramEqualizer
Source§impl Default for HistogramEqualizer
impl Default for HistogramEqualizer
Source§fn default() -> HistogramEqualizer
fn default() -> HistogramEqualizer
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for HistogramEqualizer
impl RefUnwindSafe for HistogramEqualizer
impl Send for HistogramEqualizer
impl Sync for HistogramEqualizer
impl Unpin for HistogramEqualizer
impl UnsafeUnpin for HistogramEqualizer
impl UnwindSafe for HistogramEqualizer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more