| 1 | /*! |
| 2 | `tiny-skia` is a tiny [Skia](https://skia.org/) subset ported to Rust. |
| 3 | |
| 4 | `tiny-skia` API is a bit unconventional. |
| 5 | It doesn't look like cairo, QPainter (Qt), HTML Canvas or even Skia itself. |
| 6 | Instead, `tiny-skia` provides a set of low-level drawing APIs |
| 7 | and a user should manage the world transform, clipping mask and style manually. |
| 8 | |
| 9 | See the `examples/` directory for usage examples. |
| 10 | */ |
| 11 | |
| 12 | #![no_std ] |
| 13 | #![warn (missing_docs)] |
| 14 | #![warn (missing_copy_implementations)] |
| 15 | #![warn (missing_debug_implementations)] |
| 16 | #![allow (clippy::approx_constant)] |
| 17 | #![allow (clippy::clone_on_copy)] |
| 18 | #![allow (clippy::collapsible_else_if)] |
| 19 | #![allow (clippy::collapsible_if)] |
| 20 | #![allow (clippy::comparison_chain)] |
| 21 | #![allow (clippy::enum_variant_names)] |
| 22 | #![allow (clippy::excessive_precision)] |
| 23 | #![allow (clippy::identity_op)] |
| 24 | #![allow (clippy::manual_range_contains)] |
| 25 | #![allow (clippy::needless_range_loop)] |
| 26 | #![allow (clippy::too_many_arguments)] |
| 27 | #![allow (clippy::wrong_self_convention)] |
| 28 | |
| 29 | #[cfg (not(any(feature = "std" , feature = "no-std-float" )))] |
| 30 | compile_error!("You have to activate either the `std` or the `no-std-float` feature." ); |
| 31 | |
| 32 | #[cfg (feature = "std" )] |
| 33 | extern crate std; |
| 34 | |
| 35 | extern crate alloc; |
| 36 | |
| 37 | mod alpha_runs; |
| 38 | mod blend_mode; |
| 39 | mod blitter; |
| 40 | mod color; |
| 41 | mod edge; |
| 42 | mod edge_builder; |
| 43 | mod edge_clipper; |
| 44 | mod fixed_point; |
| 45 | mod geom; |
| 46 | mod line_clipper; |
| 47 | mod mask; |
| 48 | mod math; |
| 49 | mod path64; |
| 50 | mod path_geometry; |
| 51 | mod pipeline; |
| 52 | mod pixmap; |
| 53 | mod scan; |
| 54 | mod shaders; |
| 55 | mod wide; |
| 56 | |
| 57 | mod painter; // Keep it under `pixmap` for a better order in the docs. |
| 58 | |
| 59 | pub use blend_mode::BlendMode; |
| 60 | pub use color::{Color, ColorU8, PremultipliedColor, PremultipliedColorU8}; |
| 61 | pub use color::{ALPHA_OPAQUE, ALPHA_TRANSPARENT, ALPHA_U8_OPAQUE, ALPHA_U8_TRANSPARENT}; |
| 62 | pub use mask::{Mask, MaskType}; |
| 63 | pub use painter::{FillRule, Paint}; |
| 64 | pub use pixmap::{Pixmap, PixmapMut, PixmapRef, BYTES_PER_PIXEL}; |
| 65 | pub use shaders::{FilterQuality, GradientStop, PixmapPaint, SpreadMode}; |
| 66 | pub use shaders::{LinearGradient, Pattern, RadialGradient, Shader}; |
| 67 | |
| 68 | pub use tiny_skia_path::{IntRect, IntSize, NonZeroRect, Point, Rect, Size, Transform}; |
| 69 | pub use tiny_skia_path::{LineCap, LineJoin, Stroke, StrokeDash}; |
| 70 | pub use tiny_skia_path::{Path, PathBuilder, PathSegment, PathSegmentsIter, PathStroker}; |
| 71 | |
| 72 | /// An integer length that is guarantee to be > 0 |
| 73 | type LengthU32 = core::num::NonZeroU32; |
| 74 | |