lib.rs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. //! kahlo is a software drawing library designed for speed and flexibility.
  2. //!
  3. //! The main goal for kahlo is to provide _fast_ drawing of simple 2D shapes and paths onto
  4. //! multiple surface formats. See the [`formats`] module for the supported formats.
  5. //!
  6. //! kahlo will use AVX, if present, but has fallbacks to unoptimized implementations as well. Note
  7. //! that the unoptimized implementations are mostly present for automated testing and verification
  8. //! purposes, and are written for clarity and not speed.
  9. mod bitmap;
  10. mod op;
  11. #[cfg(target_endian = "big")]
  12. std::compile_error!("kahlo only works on little-endian targets!");
  13. /// Colour-related functionality.
  14. pub mod colour;
  15. /// Pixel format definitions.
  16. pub mod formats;
  17. /// Trait re-exports.
  18. pub mod prelude {
  19. // pub use crate::ops::{AlphaPaintable, Readable, RgbaPaintable, Paintable, Writable};
  20. pub use crate::bitmap::{BitmapAccess, BitmapMutAccess};
  21. pub use crate::op::KahloOps;
  22. }
  23. pub mod math;
  24. pub use bitmap::{Bitmap, BitmapMut, BitmapRef};
  25. /// Helper type alias for a Rgba32 bitmap.
  26. pub type RgbaBitmap = Bitmap<formats::Rgba32>;
  27. /// Helper type alias for an A8 bitmap.
  28. pub type Alphamap = Bitmap<formats::A8>;