[−][src]Enum libblackbody::thermogram::Thermogram
The wrapper enum through which most processing of thermograms is recommend to
happen. Use Thermogram::from_file()
to read files.
The enum itself, and all thermogram formats it wraps, implement ThermogramTrait
. Below
several of its methods are listed. Consult the documentation of ThermogramTrait
for
more details.
pub trait ThermogramTrait { fn thermal(&self) -> &Array<f32, Ix2>; // Extract the thermal data fn optical(&self) -> &Array<u8, Ix3>>; // Extract embedded photos, if present fn identifier(&self) -> &str; // A uniquely identifying string for this thermogram fn render(&self min_temp: f32, max_temp: f32, palette: [[f32; 3]; 256]) -> Array<u8, Ix3>; // Thermal data render using the given palette fn render_defaults(&self) -> Array<u8, Ix3>; // Thermal data rendered using the minimum and maximum thermal value and the `palette::TURBO` palette. fn thermal_shape(&self) -> [usize; 2]; // The [height, width] of the thermal data fn normalized_minmax(&self) -> Array<f32, Ix2>; // Thermal data normalized to lie in the range 0.0..=1.0 }
Variants
Flir(FlirThermogram)
Tiff(TiffThermogram)
Implementations
impl Thermogram
[src]
pub fn from_file(path: &Path) -> Option<Self>
[src]
Tries to recognize the file type based on its magic number and return a Thermogram
.
Arguments
path
- A path to a thermogram file.
Returns
In case of success an Some<Thermogram>
, otherwise None
. A Thermogam
implements
ThermogramTrait
, forwarding them to the wrapped struct.
Examples
let file_path = "/home/user/FLIR0123.jpg"; let r_thermogram = Thermogram::from_file(&file_path); match r_thermogram { None => println!("Failed opening thermogram {:?}", file_path), Some(thermogram) => { println!("Successfully opened thermogram {:?}", file_path); // Do something with `thermogram` // ... }, }
Trait Implementations
impl Clone for Thermogram
[src]
pub fn clone(&self) -> Thermogram
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for Thermogram
[src]
impl ThermogramTrait for Thermogram
[src]
The ThermogramTrait
implemented for the Thermogram
enum. Method calls are forwarded to the
specific format wrapped by the enum. Consult the trait for documentation on the supported
methods.
pub fn thermal(&self) -> &Array<f32, Ix2>
[src]
pub fn optical(&self) -> Option<&Array<u8, Ix3>>
[src]
pub fn identifier(&self) -> &str
[src]
pub fn path(&self) -> Option<&str>
[src]
pub fn render(
&self,
min_temp: f32,
max_temp: f32,
palette: [[f32; 3]; 256]
) -> Array<u8, Ix3>
[src]
&self,
min_temp: f32,
max_temp: f32,
palette: [[f32; 3]; 256]
) -> Array<u8, Ix3>
pub fn render_defaults(&self) -> Array<u8, Ix3>
[src]
pub fn export_thermal(&self, path: &PathBuf) -> Option<()>
[src]
pub fn save_render(
&self,
path: PathBuf,
min_temp: f32,
max_temp: f32,
palette: [[f32; 3]; 256]
) -> Option<()>
[src]
&self,
path: PathBuf,
min_temp: f32,
max_temp: f32,
palette: [[f32; 3]; 256]
) -> Option<()>
pub fn thermal_shape(&self) -> [usize; 2]
[src]
pub fn has_optical(&self) -> bool
[src]
pub fn min_temp(&self) -> f32
[src]
pub fn max_temp(&self) -> f32
[src]
pub fn normalized_minmax(&self) -> Array<f32, Ix2>
[src]
Auto Trait Implementations
impl RefUnwindSafe for Thermogram
[src]
impl Send for Thermogram
[src]
impl Sync for Thermogram
[src]
impl Unpin for Thermogram
[src]
impl UnwindSafe for Thermogram
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,