pub struct Image<T, L = C1> { /* private fields */ }Expand description
RAII owner for pitched image memory allocated by NPP.
Values are created through Image::create and released with
sys::nppiFree from Drop.
The raw pointer must not be freed by callers.
step is the NPP row pitch in bytes and can be larger than the logical ROI
row size.
Implementations§
Source§impl<T, L> Image<T, L>where
L: ChannelLayout,
impl<T, L> Image<T, L>where
L: ChannelLayout,
pub fn create(size: Size) -> Result<Self>where
T: SupportedImage<L>,
pub fn copy_to_device_memory(&self) -> Result<DeviceMemory<T>>
pub fn copy_to_host_vec(&self) -> Result<Vec<T>>
pub fn copy_into_device_memory( &self, destination: &mut DeviceMemory<T>, ) -> Result<()>
Sourcepub fn view(&self) -> Result<ImageView<'_, T, L>>
pub fn view(&self) -> Result<ImageView<'_, T, L>>
Borrows this allocation as an immutable NPP image view.
§Errors
Returns an error if the stored size or pitch is not valid for an NPP image view.
Sourcepub fn view_mut(&mut self) -> Result<ImageViewMut<'_, T, L>>
pub fn view_mut(&mut self) -> Result<ImageViewMut<'_, T, L>>
Borrows this allocation as a mutable NPP image view.
§Errors
Returns an error if the stored size or pitch is not valid for an NPP image view.
Sourcepub const fn as_ptr(&self) -> *const T
pub const fn as_ptr(&self) -> *const T
Returns the raw device pointer owned by this allocation.
The pointer remains owned by self and is freed with nppiFree when the
Image is dropped.
Sourcepub const fn as_mut_ptr(&mut self) -> *mut T
pub const fn as_mut_ptr(&mut self) -> *mut T
Returns the mutable raw device pointer owned by this allocation.
The pointer remains owned by self and is freed with nppiFree when the
Image is dropped.