[−][src]Trait vulkano::format::AcceptsPixels
Required methods
fn ensure_accepts(&self) -> Result<(), IncompatiblePixelsType>
Returns an error if T
cannot be used as a source of pixels for Self
.
Provided methods
fn rate(&self) -> u32
The number of T
s which make up a single pixel.
use vulkano::format::{AcceptsPixels, R8G8B8A8Srgb}; assert_eq!(<R8G8B8A8Srgb as AcceptsPixels<[u8; 4]>>::rate(&R8G8B8A8Srgb), 1); assert_eq!(<R8G8B8A8Srgb as AcceptsPixels<u8>>::rate(&R8G8B8A8Srgb), 4);
Panics
May panic if ensure_accepts
would not return Ok(())
.