pub struct Histogram {
pub red: [u32; 256],
pub green: [u32; 256],
pub blue: [u32; 256],
pub luminance: [u32; 256],
}Expand description
Image histogram
Fields§
§red: [u32; 256]Red channel histogram
green: [u32; 256]Green channel histogram
blue: [u32; 256]Blue channel histogram
luminance: [u32; 256]Luminance histogram
Implementations§
Source§impl Histogram
impl Histogram
Source§impl Histogram
impl Histogram
Sourcepub fn to_json(&self, width: u32, height: u32) -> HistogramJson
pub fn to_json(&self, width: u32, height: u32) -> HistogramJson
Converts the histogram to JSON-serializable format
Sourcepub fn to_json_string(&self, width: u32, height: u32) -> Result<String, Error>
pub fn to_json_string(&self, width: u32, height: u32) -> Result<String, Error>
Serializes the histogram to a JSON string
Sourcepub fn from_rgba_with_bins(
data: &[u8],
width: u32,
height: u32,
bin_edges: &[f64],
) -> WasmResult<CustomBinHistogramJson>
pub fn from_rgba_with_bins( data: &[u8], width: u32, height: u32, bin_edges: &[f64], ) -> WasmResult<CustomBinHistogramJson>
Creates a histogram with custom bin ranges from RGBA data
This allows for non-uniform bin widths, useful for specific analysis needs.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Histogram
impl RefUnwindSafe for Histogram
impl Send for Histogram
impl Sync for Histogram
impl Unpin for Histogram
impl UnsafeUnpin for Histogram
impl UnwindSafe for Histogram
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