pub unsafe trait AcceptsPixels<T> {
    fn ensure_accepts(&self) -> Result<(), IncompatiblePixelsType>;

    fn rate(&self) -> u32 { ... }
}

Required Methods

Returns an error if T cannot be used as a source of pixels for Self.

Provided Methods

The number of Ts 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(()).

Implementors