pub struct Histogram { /* private fields */ }Expand description
Overlapping channels from ready-made bins, in a linear or logarithmic scale, with a mark at each end when too much of a channel piles up there. Where channels overlap, their colors add up, as light does, so each stays readable.
use ravenrs_core::Color;
use ravenrs_widgets::{Histogram, HistogramChannel, HistogramScale};
let red: Vec<u32> = (0..256).map(|i| (i * (256 - i)) as u32).collect();
let view = Histogram::new([HistogramChannel::new("Red", Color::rgb(0.9, 0.2, 0.2), red)])
.scale(HistogramScale::Logarithmic)
.zones(5);Implementations§
Source§impl Histogram
impl Histogram
Sourcepub fn new(channels: impl IntoIterator<Item = HistogramChannel>) -> Self
pub fn new(channels: impl IntoIterator<Item = HistogramChannel>) -> Self
A histogram of these channels, 96 logical pixels tall, across its parent.
Sourcepub fn scale(self, scale: HistogramScale) -> Self
pub fn scale(self, scale: HistogramScale) -> Self
How counts turn into heights (Linear by default).
The share of a channel that must sit in an end bin to light that end’s mark, from 0 to 1 (0.001 by default, which ignores a stray reflection).
Trait Implementations§
Auto Trait Implementations§
impl !Send for Histogram
impl !Sync for Histogram
impl Freeze for Histogram
impl RefUnwindSafe 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<V> ViewExt for Vwhere
V: View,
impl<V> ViewExt for Vwhere
V: View,
Source§fn padding(self, padding: impl Into<Insets>) -> Styled<Self>
fn padding(self, padding: impl Into<Insets>) -> Styled<Self>
Adds padding inside the box, in logical pixels.
Source§fn background(self, fill: impl Into<Fill>) -> Styled<Self>
fn background(self, fill: impl Into<Fill>) -> Styled<Self>
Paints a background behind the content.
Source§fn frame(self, width: Option<f32>, height: Option<f32>) -> Styled<Self>
fn frame(self, width: Option<f32>, height: Option<f32>) -> Styled<Self>
Fixes the width and/or height in logical pixels;
None keeps the content size.