pub struct ImageLoader {
pub device: Device,
/* private fields */
}Expand description
Helper for decoding CPU bitmap data into vk-graph images.
Fields§
§device: DeviceThe device used to create temporary buffers, images, and decode pipelines.
Implementations§
Source§impl ImageLoader
impl ImageLoader
Sourcepub fn new(device: &Device) -> Result<Self, DriverError>
pub fn new(device: &Device) -> Result<Self, DriverError>
Creates a new image loader and its internal decode pipelines.
Sourcepub fn decode_bitmap(
&mut self,
queue_family_index: u32,
queue_index: u32,
pixels: &[u8],
format: ImageFormat,
width: u32,
height: u32,
is_srgb: bool,
) -> Result<Arc<Image>>
pub fn decode_bitmap( &mut self, queue_family_index: u32, queue_index: u32, pixels: &[u8], format: ImageFormat, width: u32, height: u32, is_srgb: bool, ) -> Result<Arc<Image>>
Decodes bitmap pixels into an image and uploads it through a temporary graph submission.
Sourcepub fn decode_linear(
&mut self,
queue_family_index: u32,
queue_index: u32,
pixels: &[u8],
format: ImageFormat,
width: u32,
height: u32,
) -> Result<Arc<Image>>
pub fn decode_linear( &mut self, queue_family_index: u32, queue_index: u32, pixels: &[u8], format: ImageFormat, width: u32, height: u32, ) -> Result<Arc<Image>>
Decodes a linear-color bitmap into an image.
Sourcepub fn decode_srgb(
&mut self,
queue_family_index: u32,
queue_index: u32,
pixels: &[u8],
format: ImageFormat,
width: u32,
height: u32,
) -> Result<Arc<Image>>
pub fn decode_srgb( &mut self, queue_family_index: u32, queue_index: u32, pixels: &[u8], format: ImageFormat, width: u32, height: u32, ) -> Result<Arc<Image>>
Decodes an sRGB bitmap into an image.
Sourcepub fn load_bitmap_font<'a>(
&mut self,
queue_family_index: u32,
queue_index: u32,
font: BMFont,
pages: impl IntoIterator<Item = (&'a [u8], u32, u32)>,
) -> Result<BitmapFont>
pub fn load_bitmap_font<'a>( &mut self, queue_family_index: u32, queue_index: u32, font: BMFont, pages: impl IntoIterator<Item = (&'a [u8], u32, u32)>, ) -> Result<BitmapFont>
Loads a bitmap font by decoding each supplied page image and pairing it with the font data.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ImageLoader
impl !UnwindSafe for ImageLoader
impl Freeze for ImageLoader
impl Send for ImageLoader
impl Sync for ImageLoader
impl Unpin for ImageLoader
impl UnsafeUnpin for ImageLoader
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