simd_blit/
lib.rs

1//! Alpha Compositing & SSAA, optionally using SIMD
2//!
3//! If you want this crate to use SIMD, activate the `simd` feature;
4//! You will need a nightly toolchain for this to work, however.
5//!
6//! If the feature is disabled, a sequential implementation is also provided.
7
8#![no_std]
9#![cfg_attr(feature = "simd", feature(portable_simd))]
10
11use rgb::RGBA8;
12
13#[cfg_attr(feature = "simd", path = "simd.rs")]
14#[cfg_attr(not(feature = "simd"), path = "sequential.rs")]
15mod implementation;
16
17#[doc(inline)]
18pub use implementation::*;
19
20/// Trait for 2D-sized & indexed pixel storage
21pub trait PixelArray {
22    fn get   (&self, index: usize) -> RGBA8;
23    fn width (&self) -> usize;
24    fn height(&self) -> usize;
25    fn length(&self) -> usize;
26    fn bytes_per_pixel() -> usize;
27    fn has_alpha() -> bool;
28}