pub struct ResizeKernel { /* private fields */ }Expand description
Image resize kernel
Implementations§
Source§impl ResizeKernel
impl ResizeKernel
Sourcepub fn new(filter: ResizeFilter) -> Self
pub fn new(filter: ResizeFilter) -> Self
Create a new resize kernel
Sourcepub fn execute(
&self,
device: &GpuDevice,
input: &[u8],
_src_width: u32,
_src_height: u32,
output: &mut [u8],
dst_width: u32,
dst_height: u32,
) -> Result<()>
pub fn execute( &self, device: &GpuDevice, input: &[u8], _src_width: u32, _src_height: u32, output: &mut [u8], dst_width: u32, dst_height: u32, ) -> Result<()>
Execute the resize operation
§Arguments
device- GPU deviceinput- Input image buffersrc_width- Source image widthsrc_height- Source image heightoutput- Output image bufferdst_width- Destination image widthdst_height- Destination image height
§Errors
Returns an error if the resize operation fails.
Sourcepub fn filter(&self) -> ResizeFilter
pub fn filter(&self) -> ResizeFilter
Get the filter type
Sourcepub fn output_size(dst_width: u32, dst_height: u32, channels: u32) -> usize
pub fn output_size(dst_width: u32, dst_height: u32, channels: u32) -> usize
Calculate output buffer size
Sourcepub fn estimate_flops(
_src_width: u32,
_src_height: u32,
dst_width: u32,
dst_height: u32,
filter: ResizeFilter,
) -> u64
pub fn estimate_flops( _src_width: u32, _src_height: u32, dst_width: u32, dst_height: u32, filter: ResizeFilter, ) -> u64
Estimate FLOPS for the resize operation
Auto Trait Implementations§
impl Freeze for ResizeKernel
impl RefUnwindSafe for ResizeKernel
impl Send for ResizeKernel
impl Sync for ResizeKernel
impl Unpin for ResizeKernel
impl UnsafeUnpin for ResizeKernel
impl UnwindSafe for ResizeKernel
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 more