<
INTRIXLABS

AnimByte

1-byte character rendering engine for terminal animation. Minimal API. Flat buffer. High-speed output.

System Properties
1B
Memory / Cell
O(d)
Update Cost
100+
Max FPS
0
Dependencies
Core Architecture
Flat Buffer
MEMORY

Continuous char* array of size width × height bytes. Cache-friendly and highly predictable. No structs, no metadata.

Delta Tracking
PERF

Set_Char() only pushes a cell to the dirty list when its value actually changes. Frame_Clean resets only those cells.

Frame Generation
RENDER

Buffer is converted into a newline-delimited string. Uses \033[H to jump cursor and a single write() syscall. Zero flicker.

Pure ASCII
DESIGN

Every character is a single byte from the 7-bit ASCII table (0–127). No UTF-8 multibyte sequences. No ANSI color styling.

API Interface
Initialise(int w, int h)
→ int (0 on success)
Allocates the flat buffer of size width × height and fills it with spaces. Must be called before any other method.
Set_Char(int r, int c, char ch)
→ int (0 or -1)
Writes one ASCII character at the 1-indexed position. Returns -1 if out-of-bounds or value unchanged (no dirty push). Otherwise 0.
Render_Frame()
→ int (0 or -1)
Builds the full frame string from the buffer, repositions cursor with \033[H, and flushes everything in one write() syscall.
Frame_Clean()
→ int (0)
Iterates only the dirty list and sets each cell back to ' '. Cost is O(d) where d is the number of changed cells.
Implementation Example
main.cpp
#include "AnimByte.cpp"

int main() {
    AnimByte ab;
    ab.Initialise(80, 24);

    while(true){
        ab.Frame_Clean();

        // Write your frame data
        ab.Set_Char(12, 40, '@');

        ab.Render_Frame();
        usleep(16000); // ~60 FPS
    }
    
    return 0;
}
Design Philosophy
"No abstraction. No widgets. Just characters."