[−][src]Struct dssim_core::Dssim
Configuration for the comparison
Implementations
impl Dssim[src]
pub fn new() -> Dssim[src]
Create new context for comparisons
pub fn set_scales(&mut self, scales: &[f64])[src]
Set how many scales will be used, and weights of each scale
pub fn set_save_ssim_maps(&mut self, num_scales: u8)[src]
Set how many scales will be kept for saving
pub fn create_image<InBitmap, OutBitmap>(
&self,
src_img: &InBitmap
) -> Option<DssimImage<f32>> where
InBitmap: ToLABBitmap + Send + Sync + Downsample<Output = OutBitmap>,
OutBitmap: ToLABBitmap + Send + Sync + Downsample<Output = OutBitmap>, [src]
&self,
src_img: &InBitmap
) -> Option<DssimImage<f32>> where
InBitmap: ToLABBitmap + Send + Sync + Downsample<Output = OutBitmap>,
OutBitmap: ToLABBitmap + Send + Sync + Downsample<Output = OutBitmap>,
The input image is defined using the imgref crate, and the pixel type can be:
ImgVec<RGBAPLU>— RGBA premultiplied alpha, linear, float scaled to 0..1ImgVec<RGBLU>— RGBA linear, float scaled to 0..1ImgVec<f32>— linear light grayscale, float scaled to 0..1
And there's ToRGBAPLU::to_rgbaplu() trait to convert the input pixels from
[RGBA<u8>], [RGBA<u16>], [RGB<u8>], or RGB<u16>. See lib.rs for example how it's done.
You can implement ToLABBitmap and Downsample traits on your own image type.
pub fn compare<M: Borrow<DssimImage<f32>>>(
&self,
original_image: &DssimImage<f32>,
modified_image: M
) -> (Val, Vec<SsimMap>)[src]
&self,
original_image: &DssimImage<f32>,
modified_image: M
) -> (Val, Vec<SsimMap>)
Compare original with another image. See create_image
The SsimMaps are returned only if you've enabled them first.
Val is a fancy wrapper for f64
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Dssim
impl Send for Dssim
impl Sync for Dssim
impl Unpin for Dssim
impl UnwindSafe for Dssim
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,
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.
fn to_owned(&self) -> T[src]
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.
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>,