Skip to main content

takumi_raster/
lib.rs

1#![deny(
2  clippy::unwrap_used,
3  clippy::expect_used,
4  clippy::panic,
5  clippy::unreachable,
6  clippy::todo,
7  clippy::unimplemented
8)]
9#![cfg_attr(
10  test,
11  allow(
12    clippy::unwrap_used,
13    clippy::expect_used,
14    clippy::panic,
15    clippy::unreachable,
16    clippy::todo,
17    clippy::unimplemented
18  )
19)]
20#![deny(missing_docs)]
21//! Raster painting backend for takumi, built on tiny-skia.
22//!
23//! [`render`] paints a node tree into a [`Bitmap`], and [`write_image`] encodes it as PNG,
24//! JPEG, WebP, or ICO. [`write_animation`] encodes animated WebP, APNG, or GIF.
25//!
26//! Use it through the `takumi` crate, which re-exports these functions at its root. The whole
27//! crate is `takumi::unstable::raster`. This crate does not re-export core types; reach them
28//! through `takumi_core` or `takumi::unstable::base`.
29
30use takumi_core::*;
31
32/// Background and color drawing functions
33mod background_drawing;
34mod blend;
35mod canvas;
36mod components;
37/// Debug drawing utilities
38mod debug_drawing;
39mod dithering;
40/// Filter rasterization (blur, drop-shadow, backdrop, pixel filters)
41mod filter;
42/// Image drawing functions
43mod image_drawing;
44pub(crate) mod inline_drawing;
45mod node_paint;
46mod palette;
47mod path;
48/// Main image renderer and viewport management
49mod render;
50#[cfg(all(test, feature = "pages"))]
51mod render_pages_tests;
52mod scanline;
53mod simd;
54mod stacking_context;
55/// Text drawing functions
56mod text_drawing;
57mod webp;
58mod write;
59mod zlib;
60
61pub(crate) use background_drawing::*;
62pub(crate) use canvas::*;
63pub(crate) use components::*;
64pub(crate) use debug_drawing::*;
65pub use dithering::*;
66pub(crate) use filter::*;
67pub(crate) use image_drawing::*;
68pub(crate) use node_paint::*;
69pub(crate) use path::*;
70pub use render::*;
71pub(crate) use takumi_core::geometry::Placement;
72pub(crate) use text_drawing::*;
73pub use write::*;
74
75pub(crate) use crate::{
76  context::RenderContext,
77  font_style::*,
78  style::math::{div_255, mul_div_255},
79};