Trait vulkano::format::AcceptsPixels
source · pub unsafe trait AcceptsPixels<T> {
fn ensure_accepts(&self) -> Result<(), IncompatiblePixelsType>;
fn rate(&self) -> u32 { ... }
}
Required Methods
sourcefn ensure_accepts(&self) -> Result<(), IncompatiblePixelsType>
fn ensure_accepts(&self) -> Result<(), IncompatiblePixelsType>
Returns an error if T
cannot be used as a source of pixels for Self
.
Provided Methods
sourcefn rate(&self) -> u32
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(())
.