Skip to main content

tachyonfx/
lib.rs

1//! tachyonfx - A ratatui library for creating shader-like effects in terminal UIs
2//!
3//! This library provides a collection of effects that can be used to enhance the visual
4//! appeal of terminal applications, offering capabilities such as color transformations,
5//! animations, and complex effect combinations.
6
7#![cfg_attr(not(feature = "std"), no_std)]
8
9extern crate alloc;
10extern crate core;
11
12// Feature validation
13#[cfg(all(feature = "std-duration", feature = "wasm"))]
14compile_error!("Features 'std-duration' and 'wasm' cannot be enabled simultaneously");
15
16#[cfg(all(feature = "std-duration", not(feature = "std")))]
17compile_error!("Feature 'std-duration' requires 'std' feature");
18
19#[cfg(all(feature = "dsl", not(feature = "std")))]
20compile_error!("DSL feature is not supported in no-std environments. Use either 'dsl' with 'std' or disable 'dsl' for no-std builds.");
21
22#[cfg(all(feature = "std-duration", feature = "wasm"))]
23compile_error!("Features 'std-duration' and 'wasm' cannot be enabled simultaneously");
24
25mod bitvec;
26mod bounding_box;
27mod buffer_renderer;
28mod cell_filter;
29mod cell_iter;
30mod color_cache;
31mod color_ext;
32mod color_mapper;
33mod color_space;
34mod duration;
35mod effect;
36mod effect_manager;
37mod effect_timer;
38mod features;
39mod interpolation;
40mod lru_cache;
41mod math;
42mod motion;
43pub mod pattern;
44mod rect_ext;
45mod ref_rect;
46mod render_effect;
47mod shader;
48mod simple_rng;
49pub mod wave;
50
51pub mod fx;
52pub mod widget;
53
54#[doc = include_str!("../docs/dsl.md")]
55#[cfg(feature = "dsl")]
56pub mod dsl;
57
58pub use buffer_renderer::*;
59pub use cell_filter::*;
60/// `CellIterator` provides an iterator over terminal cells.
61pub use cell_iter::CellIterator;
62pub use color_cache::ColorCache;
63pub use color_ext::ToRgbComponents;
64#[allow(deprecated)]
65pub use color_mapper::ColorMapper;
66pub use color_space::*;
67pub use duration::Duration;
68#[allow(unused_imports)] // not actually unused, misidentified by clippy
69pub(crate) use effect::ShaderExt;
70pub use effect::{Effect, IntoEffect};
71pub use effect_manager::EffectManager;
72pub use effect_timer::EffectTimer;
73pub use features::{ref_count, RefCount, ThreadSafetyMarker};
74pub use interpolation::*;
75pub use lru_cache::LruCache;
76pub use math::{parabolic_cos, parabolic_sin, wave_cos, wave_sin};
77pub use motion::*;
78pub use rect_ext::CenteredShrink;
79pub use ref_rect::RefRect;
80pub use render_effect::EffectRenderer;
81pub use shader::Shader;
82pub use simple_rng::*;