logo

Struct dssim::Dssim

source · []
pub struct Dssim { /* private fields */ }
Expand description

Configuration for the comparison

Implementations

Create new context for comparisons

Set how many scales will be used, and weights of each scale

Set how many scales will be kept for saving

Create image from an array of RGBA pixels (sRGB, non-premultiplied, alpha last).

If you have a slice of u8, then see rgb crate’s as_rgba().

Create image from an array of packed RGB pixels (sRGB).

If you have a slice of u8, then see rgb crate’s as_rgb().

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..1
  • ImgVec<RGBLU> — RGBA linear, float scaled to 0..1
  • ImgVec<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.

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.