pub struct HistogramKernel { /* private fields */ }Expand description
Histogram computation kernel
Implementations§
Source§impl HistogramKernel
impl HistogramKernel
Sourcepub fn new(num_bins: usize, min_value: f32, max_value: f32) -> Self
pub fn new(num_bins: usize, min_value: f32, max_value: f32) -> Self
Create a new histogram kernel
§Arguments
num_bins- Number of histogram binsmin_value- Minimum value for histogram rangemax_value- Maximum value for histogram range
Sourcepub fn default_u8() -> Self
pub fn default_u8() -> Self
Create a histogram with default range [0, 256) for 8-bit images
Sourcepub fn execute(&self, _device: &GpuDevice, input: &[u8]) -> Result<Vec<u32>>
pub fn execute(&self, _device: &GpuDevice, input: &[u8]) -> Result<Vec<u32>>
Execute histogram computation (CPU fallback).
Each byte value v in input is mapped to a bin via:
bin = clamp(((v - min) / (max - min)) * num_bins, 0, num_bins-1)
§Arguments
_device- GPU device (CPU fallback: unused)input- Input image data
§Errors
Returns an error only on internal logic failures (currently infallible).
Sourcepub fn value_range(&self) -> (f32, f32)
pub fn value_range(&self) -> (f32, f32)
Get the value range
Auto Trait Implementations§
impl Freeze for HistogramKernel
impl RefUnwindSafe for HistogramKernel
impl Send for HistogramKernel
impl Sync for HistogramKernel
impl Unpin for HistogramKernel
impl UnsafeUnpin for HistogramKernel
impl UnwindSafe for HistogramKernel
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
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