pub struct DefaultKernel<PadIntermediateX: ArrayLength + Add<U127> = U0, PadIntermediateY: ArrayLength + Add<U127> = U0>where
<PadIntermediateX as Add<U127>>::Output: ArrayLength,
<PadIntermediateY as Add<U127>>::Output: ArrayLength,{ /* private fields */ }Expand description
A pure-Rust implementation of the Kernel trait.
Trait Implementations§
Source§impl<PadIntermediateX: Clone + ArrayLength + Add<U127>, PadIntermediateY: Clone + ArrayLength + Add<U127>> Clone for DefaultKernel<PadIntermediateX, PadIntermediateY>where
<PadIntermediateX as Add<U127>>::Output: ArrayLength,
<PadIntermediateY as Add<U127>>::Output: ArrayLength,
impl<PadIntermediateX: Clone + ArrayLength + Add<U127>, PadIntermediateY: Clone + ArrayLength + Add<U127>> Clone for DefaultKernel<PadIntermediateX, PadIntermediateY>where
<PadIntermediateX as Add<U127>>::Output: ArrayLength,
<PadIntermediateY as Add<U127>>::Output: ArrayLength,
Source§fn clone(&self) -> DefaultKernel<PadIntermediateX, PadIntermediateY>
fn clone(&self) -> DefaultKernel<PadIntermediateX, PadIntermediateY>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<PadIntermediateX: Copy + ArrayLength + Add<U127>, PadIntermediateY: Copy + ArrayLength + Add<U127>> Copy for DefaultKernel<PadIntermediateX, PadIntermediateY>where
<PadIntermediateX as Add<U127>>::Output: ArrayLength,
<PadIntermediateY as Add<U127>>::Output: ArrayLength,
Source§impl<PadIntermediateX: ArrayLength + Add<U127>, PadIntermediateY: ArrayLength + Add<U127>> Default for DefaultKernel<PadIntermediateX, PadIntermediateY>where
<PadIntermediateX as Add<U127>>::Output: ArrayLength,
<PadIntermediateY as Add<U127>>::Output: ArrayLength,
impl<PadIntermediateX: ArrayLength + Add<U127>, PadIntermediateY: ArrayLength + Add<U127>> Default for DefaultKernel<PadIntermediateX, PadIntermediateY>where
<PadIntermediateX as Add<U127>>::Output: ArrayLength,
<PadIntermediateY as Add<U127>>::Output: ArrayLength,
Source§impl<PadIntermediateX: ArrayLength + Add<U127>, PadIntermediateY: ArrayLength + Add<U127>> Kernel for DefaultKernel<PadIntermediateX, PadIntermediateY>where
<PadIntermediateX as Add<U127>>::Output: ArrayLength,
<PadIntermediateY as Add<U127>>::Output: ArrayLength,
impl<PadIntermediateX: ArrayLength + Add<U127>, PadIntermediateY: ArrayLength + Add<U127>> Kernel for DefaultKernel<PadIntermediateX, PadIntermediateY>where
<PadIntermediateX as Add<U127>>::Output: ArrayLength,
<PadIntermediateY as Add<U127>>::Output: ArrayLength,
Source§type Buffer1WidthX = <PadIntermediateX as Add<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>, B1>, B1>, B1>>>::Output
type Buffer1WidthX = <PadIntermediateX as Add<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>, B1>, B1>, B1>>>::Output
The width of the first stage (compression) buffer.
Source§type Buffer1LengthY = <PadIntermediateY as Add<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>, B1>, B1>, B1>>>::Output
type Buffer1LengthY = <PadIntermediateY as Add<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>, B1>, B1>, B1>>>::Output
The length of the first stage (compression) buffer.
Source§type InternalFloat = f32
type InternalFloat = f32
The internal floating point type used for intermediate calculations.
Source§type InputDimension = UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>
type InputDimension = UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>
The width and height of the input image.
Source§type OutputDimension = UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>
type OutputDimension = UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>
The width and height of the output hash.
Source§type RequiredHardwareFeature = Term
type RequiredHardwareFeature = Term
The hardware features required to run this kernel
Source§fn ident(&self) -> &'static str
fn ident(&self) -> &'static str
Return an identification of the kernel. For composite kernels that route to multiple kernels, report the kernel that would be executed.
Source§fn quantize(
&mut self,
input: &GenericArray<GenericArray<Self::InternalFloat, U16>, U16>,
threshold: &mut Self::InternalFloat,
output: &mut GenericArray<GenericArray<u8, U2>, U16>,
)
fn quantize( &mut self, input: &GenericArray<GenericArray<Self::InternalFloat, U16>, U16>, threshold: &mut Self::InternalFloat, output: &mut GenericArray<GenericArray<u8, U2>, U16>, )
Convert input to binary by thresholding at median
Source§fn adjust_quality(input: Self::InternalFloat) -> f32
fn adjust_quality(input: Self::InternalFloat) -> f32
Adjust the quality metric to be between 0 and 1.
Source§fn sum_of_gradients(
&mut self,
input: &GenericArray<GenericArray<Self::InternalFloat, U16>, U16>,
) -> Self::InternalFloat
fn sum_of_gradients( &mut self, input: &GenericArray<GenericArray<Self::InternalFloat, U16>, U16>, ) -> Self::InternalFloat
Compute the sum of gradients of the input buffer in both horizontal and vertical directions.
Source§fn jarosz_compress(
&mut self,
buffer: &GenericArray<GenericArray<f32, U512>, U512>,
output: &mut GenericArray<GenericArray<Self::InternalFloat, Self::Buffer1WidthX>, Self::Buffer1LengthY>,
)
fn jarosz_compress( &mut self, buffer: &GenericArray<GenericArray<f32, U512>, U512>, output: &mut GenericArray<GenericArray<Self::InternalFloat, Self::Buffer1WidthX>, Self::Buffer1LengthY>, )
Apply a tent-filter average to every 8x8 sub-block of the input buffer and write the result of each sub-block to the output buffer.
Source§fn dct2d(
&mut self,
buffer: &GenericArray<GenericArray<f32, Self::Buffer1WidthX>, Self::Buffer1LengthY>,
tmp_row_buffer: &mut GenericArray<f32, Self::Buffer1WidthX>,
output: &mut GenericArray<GenericArray<f32, U16>, U16>,
)
fn dct2d( &mut self, buffer: &GenericArray<GenericArray<f32, Self::Buffer1WidthX>, Self::Buffer1LengthY>, tmp_row_buffer: &mut GenericArray<f32, Self::Buffer1WidthX>, output: &mut GenericArray<GenericArray<f32, U16>, U16>, )
Apply a 2D DCT-II transformation to the input buffer write the result to the output buffer.
Source§fn cvt_rgb8_to_luma8f<const R_COEFF: u32, const G_COEFF: u32, const B_COEFF: u32>(
&mut self,
input: &GenericArray<GenericArray<u8, U3>, Self::InputDimension>,
output: &mut GenericArray<f32, Self::InputDimension>,
)
fn cvt_rgb8_to_luma8f<const R_COEFF: u32, const G_COEFF: u32, const B_COEFF: u32>( &mut self, input: &GenericArray<GenericArray<u8, U3>, Self::InputDimension>, output: &mut GenericArray<f32, Self::InputDimension>, )
Convert one row of input from RGB8 to LUMA8 floating point. Read more
Source§fn cvt_rgba8_to_luma8f<const R_COEFF: u32, const G_COEFF: u32, const B_COEFF: u32>(
&mut self,
input: &GenericArray<GenericArray<u8, U4>, Self::InputDimension>,
output: &mut GenericArray<f32, Self::InputDimension>,
)
fn cvt_rgba8_to_luma8f<const R_COEFF: u32, const G_COEFF: u32, const B_COEFF: u32>( &mut self, input: &GenericArray<GenericArray<u8, U4>, Self::InputDimension>, output: &mut GenericArray<f32, Self::InputDimension>, )
Convert RGBA8 to LUMA8. Read more
Source§fn pdqf_t(
&mut self,
input: &mut GenericArray<GenericArray<Self::InternalFloat, Self::OutputDimension>, Self::OutputDimension>,
)
fn pdqf_t( &mut self, input: &mut GenericArray<GenericArray<Self::InternalFloat, Self::OutputDimension>, Self::OutputDimension>, )
Transpose a PDQF matrix in place. Output is equivalent to PDQF(t(image)). Read more
Source§fn pdqf_negate_alt_cols<const NEGATE: bool>(
&mut self,
input: &mut GenericArray<GenericArray<Self::InternalFloat, Self::OutputDimension>, Self::OutputDimension>,
)
fn pdqf_negate_alt_cols<const NEGATE: bool>( &mut self, input: &mut GenericArray<GenericArray<Self::InternalFloat, Self::OutputDimension>, Self::OutputDimension>, )
Negate alternative columns of PDQF matrix in place. Equivalent to PDQF(flop(image)). Read more
Source§fn pdqf_negate_alt_rows<const NEGATE: bool>(
&mut self,
input: &mut GenericArray<GenericArray<Self::InternalFloat, Self::OutputDimension>, Self::OutputDimension>,
)
fn pdqf_negate_alt_rows<const NEGATE: bool>( &mut self, input: &mut GenericArray<GenericArray<Self::InternalFloat, Self::OutputDimension>, Self::OutputDimension>, )
Negate alternative rows of PDQF matrix in place. Equivalent to PDQF(flip(image)). Read more
Source§fn pdqf_negate_off_diagonals(
&mut self,
input: &mut GenericArray<GenericArray<Self::InternalFloat, Self::OutputDimension>, Self::OutputDimension>,
)
fn pdqf_negate_off_diagonals( &mut self, input: &mut GenericArray<GenericArray<Self::InternalFloat, Self::OutputDimension>, Self::OutputDimension>, )
Negate off-diagonals of PDQF matrix in place. Equivalent to PDQF(rotate180(image)). Read more
Source§fn required_hardware_features_met() -> bool
fn required_hardware_features_met() -> bool
Shorthand to
<<K as Kernel>::RequiredHardwareFeature as EvaluateHardwareFeature>::met_runtime() Read moreAuto Trait Implementations§
impl<PadIntermediateX, PadIntermediateY> Freeze for DefaultKernel<PadIntermediateX, PadIntermediateY>
impl<PadIntermediateX, PadIntermediateY> RefUnwindSafe for DefaultKernel<PadIntermediateX, PadIntermediateY>where
<PadIntermediateY as Add<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>, B1>, B1>, B1>>>::Output: Sized,
<PadIntermediateX as Add<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>, B1>, B1>, B1>>>::Output: Sized,
PadIntermediateX: RefUnwindSafe,
PadIntermediateY: RefUnwindSafe,
impl<PadIntermediateX, PadIntermediateY> Send for DefaultKernel<PadIntermediateX, PadIntermediateY>
impl<PadIntermediateX, PadIntermediateY> Sync for DefaultKernel<PadIntermediateX, PadIntermediateY>
impl<PadIntermediateX, PadIntermediateY> Unpin for DefaultKernel<PadIntermediateX, PadIntermediateY>
impl<PadIntermediateX, PadIntermediateY> UnsafeUnpin for DefaultKernel<PadIntermediateX, PadIntermediateY>
impl<PadIntermediateX, PadIntermediateY> UnwindSafe for DefaultKernel<PadIntermediateX, PadIntermediateY>where
<PadIntermediateY as Add<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>, B1>, B1>, B1>>>::Output: Sized,
<PadIntermediateX as Add<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>, B1>, B1>, B1>>>::Output: Sized,
PadIntermediateX: UnwindSafe,
PadIntermediateY: UnwindSafe,
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