Skip to main content

TensorImageDst

Trait TensorImageDst 

Source
pub trait TensorImageDst {
    // Required methods
    fn tensor(&self) -> &Tensor<u8>;
    fn tensor_mut(&mut self) -> &mut Tensor<u8>;
    fn fourcc(&self) -> FourCharCode;
    fn is_planar(&self) -> bool;
    fn width(&self) -> usize;
    fn height(&self) -> usize;
    fn channels(&self) -> usize;
    fn row_stride(&self) -> usize;
}
Expand description

Trait for types that can be used as destination images for conversion.

This trait abstracts over the difference between owned (TensorImage) and borrowed (TensorImageRef) image buffers, enabling the same conversion code to work with both.

Required Methods§

Source

fn tensor(&self) -> &Tensor<u8>

Returns a reference to the underlying tensor.

Source

fn tensor_mut(&mut self) -> &mut Tensor<u8>

Returns a mutable reference to the underlying tensor.

Source

fn fourcc(&self) -> FourCharCode

Returns the FourCC code representing the image format.

Source

fn is_planar(&self) -> bool

Returns whether the image is in planar format.

Source

fn width(&self) -> usize

Returns the width of the image in pixels.

Source

fn height(&self) -> usize

Returns the height of the image in pixels.

Source

fn channels(&self) -> usize

Returns the number of channels in the image.

Source

fn row_stride(&self) -> usize

Returns the row stride in bytes.

Implementors§