pub struct G2DProcessor { /* private fields */ }Expand description
G2DConverter implements the ImageProcessor trait using the NXP G2D library for hardware-accelerated image processing on i.MX platforms.
Implementations§
Source§impl G2DProcessor
impl G2DProcessor
Sourcepub fn new() -> Result<Self>
pub fn new() -> Result<Self>
Creates a new G2DConverter instance.
The BT.709 matrix set here is only a safe default; each convert() call
re-programs the matrix from the resolved colorimetry of the YUV side of
that conversion (see convert_impl). G2D is matrix-only — it has no
range control (limited-range only) and no BT.2020 matrix — so full-range
YUV and BT.2020 conversions are declined and fall through to GL/CPU.
Trait Implementations§
Source§impl Debug for G2DProcessor
impl Debug for G2DProcessor
Source§impl ImageProcessorTrait for G2DProcessor
impl ImageProcessorTrait for G2DProcessor
Source§fn convert(
&mut self,
src: &TensorDyn,
dst: &mut TensorDyn,
rotation: Rotation,
flip: Flip,
crop: Crop,
) -> Result<()>
fn convert( &mut self, src: &TensorDyn, dst: &mut TensorDyn, rotation: Rotation, flip: Flip, crop: Crop, ) -> Result<()>
Converts the source image to the destination image format and size. The
image is cropped first, then flipped, then rotated Read more
Source§fn draw_decoded_masks(
&mut self,
dst: &mut TensorDyn,
detect: &[DetectBox],
segmentation: &[Segmentation],
overlay: MaskOverlay<'_>,
) -> Result<()>
fn draw_decoded_masks( &mut self, dst: &mut TensorDyn, detect: &[DetectBox], segmentation: &[Segmentation], overlay: MaskOverlay<'_>, ) -> Result<()>
Draw pre-decoded detection boxes and segmentation masks onto
dst. Read moreSource§fn draw_proto_masks(
&mut self,
dst: &mut TensorDyn,
detect: &[DetectBox],
_proto_data: &ProtoData,
overlay: MaskOverlay<'_>,
) -> Result<()>
fn draw_proto_masks( &mut self, dst: &mut TensorDyn, detect: &[DetectBox], _proto_data: &ProtoData, overlay: MaskOverlay<'_>, ) -> Result<()>
Draw masks from proto data onto image (fused decode+draw). Read more
Source§fn set_class_colors(&mut self, _: &[[u8; 4]]) -> Result<()>
fn set_class_colors(&mut self, _: &[[u8; 4]]) -> Result<()>
Sets the colors used for rendering segmentation masks. Up to 20 colors
can be set.
impl Send for G2DProcessor
impl Sync for G2DProcessor
Auto Trait Implementations§
impl !RefUnwindSafe for G2DProcessor
impl !UnwindSafe for G2DProcessor
impl Freeze for G2DProcessor
impl Unpin for G2DProcessor
impl UnsafeUnpin for G2DProcessor
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.