[−][src]Struct native_windows_gui::ImageData
Represents a source of pixel that can be read, but cannot be written back to.
Fields
frame: *mut IWICBitmapSource
Implementations
impl ImageData
[src]
pub fn resolution(&self) -> (f64, f64)
[src]
Retrieves the sampling rate between pixels and physical world measurements.
pub fn size(&self) -> (u32, u32)
[src]
Retrieves the pixel width and height of the bitmap.
pub fn pixel_format(&self) -> WICPixelFormatGUID
[src]
pub fn pixels(&self, pixel_size: u32) -> Result<Vec<u8>, NwgError>
[src]
Copy the frame pixels into a buffer.
Parameters: pixel_size: defines the size of a pixel in bytes. In a typical RGBA image, this would be 4 (1 byte for each component). If unsure, use the pixel_format.
May return an error if the pixel data could not be read
pub fn region_pixels(
&self,
offset: [i32; 2],
size: [i32; 2],
pixel_size: u32
) -> Result<Vec<u8>, NwgError>
[src]
&self,
offset: [i32; 2],
size: [i32; 2],
pixel_size: u32
) -> Result<Vec<u8>, NwgError>
Copy a region of the frames pixel into a buffer.
Parameters: offset: The [x,y] offset at which the region begins size: The [width, height] size of the region pixel_size: defines the size of a pixel in bytes. In a typical RGBA image, this would be 4 (1 byte for each component). If unsure, use the pixel_format.
May return an error if the pixel data could not be read
pub fn as_bitmap(&self) -> Result<Bitmap, NwgError>
[src]
Create a bitmap resource the the image data. This resource can then be used in the other NWG component. The bitmap returned is considered "owned".
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for ImageData
[src]
impl !Send for ImageData
[src]
impl !Sync for ImageData
[src]
impl Unpin for ImageData
[src]
impl UnwindSafe for ImageData
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,