- sweep and slide effects now honor applied CellFilters.
Cargo.lock
no longer omitted from the crate package. This was an oversight in previous releases.- Fixed test build failure when the
std-duration
feature is enabled.
Previous:
fn execute(&mut self, alpha: f32, area: Rect, cell_iter: CellIterator)
New:
fn execute(&mut self, duration: Duration, area: Rect, buf: &mut Buffer)
When implementing the Shader
trait, you must override one of these methods:
execute()
(automatic timer handling)- Effect timer handling is done automatically; use for standard effects that rely on default timer handling
- Most common implementation choice
process()
(manual timer handling)- Use when custom timer handling is needed
- Gives full control over timing behavior
- Must report timer overflow via return value
Important: The default implementations of both methods are no-ops and cannot be used alone. You must override at least one of them for a functioning effect.
CellFilter::EvalCell
: filter cells based on a predicate function that takes a&Cell
as input.blit_buffer_region()
: new function to support copying specific regions from source buffers.render_buffer_region()
method added toBufferRenderer
trait to enable region-based buffer rendering.
blit_buffer()
: now omits copying cells wherecell.skip
is true. This behavior also carries over to theBufferRenderer
trait andblit_buffer_region()
.
std-duration
feature: mismatched types error when building the glitch effect. Thanks to @Veetaha for reporting.
This is just a tiny release in order to be compatible with the latest ratatui
version.
- new
minimal
example demonstrating how to get started with tachyonfx. Thanks to @orhun for the contribution!
Color::to_rgb
: updated rgb values of standard terminal colors to be more conformant.
ratatui
updated to 0.29.0. This is also the minimum version required for tachyonfx.
fx::repeat
: visibility ofRepeatMode
is now public.
sendable
feature: Enables theSend
trait for effects, shaders, and associated parameters. This allows effects to be safely transferred across thread boundaries. Note that enabling this feature requires allShader
implementations to beSend
, which may impose additional constraints on custom shader implementations.ref_count()
: wraps a value in anRc<RefCell<T>>
or anArc<Mutex<T>>
depending on thesendable
feature.
SlidingWindowAlpha
: Now uses multiplication instead of division when calculating alpha values for the gradient.EffectTimer::alpha
: removed two redundant divisions.
EffectTimer::alpha
now correctly returns 0.0 for reversed timers with zero duration.CellIterator
now uses the intersection of the given area and the buffer's area, preventing panics from out-of-bounds access.fx::sweep_in
,fx::sweep_out
,fx::slide_in
,fx::slide_out
: now uses a "safe area" calculated as the intersection of the effect area and buffer area, preventing out-of-bounds access.
This release introduces a lot of breaking changes in the form of added and removed parameters. Sorry for any inconvenience this may cause, I'll try to tread more carefully in the future.
- New "std-duration" feature to opt-in to using
std::time::Duration
, which is the same behavior as before. - New
tachyon::Duration
type: a 4-byte wrapper around u32 milliseconds. When the "std-duration" feature is enabled, it becomes an alias for the 16-bytestd::time::Duration
.
- Replaced
rand
crate dependency with a fastSimpleRng
implementation. render_as_ansi_string()
produces a more compact output by reducing redundant ANSI escape codes.
tachyonfx::Duration
is now the default duration type.- Replace usage of
std::time::Duration
withtachyonfx::Duration
. fx::sweep_in
,fx::sweep_out
,fx::slide_in
,fx::slide_out
: addedrandomness
parameter.fx::dissolve
,fx::coalesce
: removedcycle_len
parameter, as cell visibility is recalculated on the fly.fx::sequence
,fx::parallel
: now parameterized with&[Effect]
instead ofVec<Effect>
.
EffectTimeline::from
is deprecated in favor ofEffectTimeline::builder
.
The effect timeline widget visualizes the composition of effects. It also supports rendering the
widget as an ansi-escaped string, suitable for saving to a file or straight to println!()
.
fx::delay()
: delays the start of an effect by a specified duration.fx::offscreen_buffer()
: wraps an existing effect and redirects its rendering to a separate buffer. This allows for more complex effect compositions and can improve performance for certain types of effects.fx::prolong_start
: extends the start of an effect by a specified duration.fx::prolong_end
: extends the end of an effect by a specified duration.fx::translate_buf()
: translates the contents of an auxiliary buffer onto the main buffer.widget::EffectTimeline
: a widget for visualizing the composition of effects.EffectTimeline::save_to_file()
: saves the effect timeline to a file.BufferRenderer
trait: enables rendering of one buffer onto another with offset support. This allows for more complex composition of UI elements and effects.- fn
blit_buffer()
: copies the contents of a source buffer onto a destination buffer with a specified offset. - fn
render_as_ansi_string()
: converts a buffer to a string containing ANSI escape codes for styling. - new example:
fx-chart
.
- Shader trait now requires
name()
,timer()
andas_effect_span()
methods. ratatui
updated to 0.28.0. This is also the minimum version required for tachyonfx.
CellFilter::PositionFn
: filter cells based on a predicate function.EffectTimer::durtion()
is now public.fx::slide_in()
andfx::slide_out()
: slides in/out cells by "shrinking" the cells horizontally or vertically along the given area.fx::effect_fn_buf()
: to create custom effects operating on aBuffer
instead ofCellIterator
.Shader::reset
: reinitializes the shader(*) to its original state. Previously, the approach was to clone the shader from a copy of the original instance, occasionally resulting in unintended behavior when certain internal states were expected to persist through resets.
*: Note that "shader" here is used loosely, as no GPU is involved, only terminal cells.
fx::resize_area
: signature updated withinitial_size: Size
, replacing the u16 tuple.
fx::translate()
: translate can now move out-of-bounds.fx::translate()
: hosted effects with extended duration no longer end prematurely.fx::effect_fn()
: effect state now correctly resets between iterations when usingfx::repeat()
,fx::repeating()
andfx::ping_pong()
.fx::resize_area()
: fixed numerous problems.
fx::effect_fn()
: updated the function signature to include an initial state parameter andShaderFnContext
context parameter. The custom effect closure now takes three parameters: mutable state,ShaderFnContext
, and a cell iterator.ratatui
updated to 0.27.0. This is also the minimum version required for tachyonfx.
fx::effect_fn()
: creates custom effects from user-defined functions.- Add
CellFilter::AnyOf(filters)
andCellFilter::NoneOf(filters)
variants. - Implemented
ToRgbComponents
trait forColor
to standardize extraction of RGB components.
fx::translate()
: replacetodo!()
in cell_selection().- 16 and 256 color spaces no longer output black when interpolating to a different color.
Initial release of the library.