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.
Sourcepub fn set_interpolation(&mut self, mode: Interpolation)
pub fn set_interpolation(&mut self, mode: Interpolation)
Sets how resizing converts resample (see crate::Interpolation).
G2D scales with a fixed hardware filter, so under
crate::Interpolation::Nearest it declines converts that resize and
leaves them to a backend that can sample nearest-neighbour.
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,
options: Option<ConvertOptions>,
) -> Result<()>
fn convert( &mut self, src: &TensorDyn, dst: &mut TensorDyn, options: Option<ConvertOptions>, ) -> Result<()>
src into dst’s format and size, applying the crop first,
then the flip, then the rotation. Read moreSource§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<()>
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<()>
Source§fn set_class_colors(&mut self, _: &[[u8; 4]]) -> Result<()>
fn set_class_colors(&mut self, _: &[[u8; 4]]) -> Result<()>
Source§fn set_box_line_width(&mut self, _: u32) -> Result<()>
fn set_box_line_width(&mut self, _: u32) -> Result<()>
draw_decoded_masks
and draw_proto_masks. The default is
DEFAULT_BOX_LINE_WIDTH (3 px). Read moreSource§fn convert_deferred(
&mut self,
src: &TensorDyn,
dst: &mut TensorDyn,
options: Option<ConvertOptions>,
) -> Result<()>
fn convert_deferred( &mut self, src: &TensorDyn, dst: &mut TensorDyn, options: Option<ConvertOptions>, ) -> Result<()>
impl Send for G2DProcessor
impl Sync for G2DProcessor
Auto Trait Implementations§
impl Freeze for G2DProcessor
impl RefUnwindSafe for G2DProcessor
impl Unpin for G2DProcessor
impl UnsafeUnpin for G2DProcessor
impl UnwindSafe 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
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> ⓘ
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> ⓘ
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 more