pub struct Image {
pub format: Format,
pub width: u32,
pub height: u32,
/* private fields */
}Expand description
Represents a 2 dimesional array of data.
Fields§
§format: FormatThe format of the image.
width: u32The width of the image.
height: u32The height of the image.
Implementations§
Source§impl Image
impl Image
Sourcepub fn new(
device: &Arc<Device>,
width: u32,
height: u32,
format: Format,
layout: ImageLayout,
usage: ImageUsageFlags,
image_aspect: ImageAspectFlags,
) -> Result<Self, Error>
pub fn new( device: &Arc<Device>, width: u32, height: u32, format: Format, layout: ImageLayout, usage: ImageUsageFlags, image_aspect: ImageAspectFlags, ) -> Result<Self, Error>
Creates a Image.
§Examples
let image = plate::Image::new(
&device,
width,
height,
plate::Format::R8G8B8A8_SRGB,
plate::ImageLayout::UNDEFINED,
plate::ImageUsageFlags::TRANSFER_DST | plate::ImageUsageFlags::SAMPLED,
plate::ImageAspectFlags::COLOR,
)?;Trait Implementations§
Auto Trait Implementations§
impl Freeze for Image
impl RefUnwindSafe for Image
impl Send for Image
impl Sync for Image
impl Unpin for Image
impl UnsafeUnpin for Image
impl UnwindSafe for Image
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