Skip to content

About

Bitmap animation engine and multi-client RPC service written in C.

Topics

Resources

Stars

4 stars

Watchers

0 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

Repository files navigation

PointerPro Animate

CI

PointerPro Animate is a C systems project for building and serving simple bitmap animations. It combines a low-level animation engine with a multi-client service layer that exposes the engine through a small text-based RPC protocol.

Demo

demo

This is the real output of a scripted client/server session: a canvas is created, three sprites are placed on it, two are given velocity/acceleration via set_animation_params, and generate renders the frames through ffmpeg. Reproduce it with:

./examples/demo.sh

(requires ffmpeg on PATH; the script builds the project, drives animate_server/animate_client over the real FIFO/signal RPC protocol, and converts the rendered clip to docs/demo.gif)

Lifecycle demo: layering and deletion

demo

The first demo only covers create/place/animate/render. This one shows resource lifecycle: a red square and a blue square are placed overlapping (blue on top, since it was placed second); placement_top then reorders the red square above blue; finally destroy_placement removes the circle mid-session, and it's gone for good. Each phase is rendered as its own generate call and the three clips are concatenated with ffmpeg. Reproduce it with:

./examples/demo_lifecycle.sh

Project Structure

  • core/ implements the animation library: canvases, sprites, placements, layer ordering, simple shapes, bitmap-backed sprites, and frame generation.
  • service/ implements the runtime service: a signal/FIFO based client handshake, request parsing, handle management, user authorization, a fixed-size worker pool, RPC execution, canvas sharing, barriers, and movie generation through ffmpeg.

The service is integrated with the local core implementation and builds directly from core/animate.c; it does not require a precompiled animation library.

Build

Build everything from the repository root:

make

Build only the animation engine:

make -C core animate.o

Build only the client/server service:

make -C service

Test

Run the core animation test suite:

core/tests/run_all_tests.sh

or from the repository root:

make test

CI also builds and runs the core suite under AddressSanitizer + UBSan (see .github/workflows/ci.yml); it's clean.

Run

Start the server with a fixed worker-pool size:

cd service
./animate_server 4

The server prints its process ID. Start a client with that PID:

./animate_client <server-pid>

Users are loaded from service/users.txt. After logging in, clients can issue animation RPC commands such as creating canvases, creating sprites, placing sprites, sharing canvases, synchronizing with barriers, and generating output frame/movie files.

Design Highlights

  • IPC handshake: each client sends SIGUSR1 to the server's PID; the server responds with SIGUSR2 and a pair of named FIFOs (FIFO_C2S_<pid>, FIFO_S2C_<pid>) dedicated to that client.
  • Fixed-size worker pool: the main thread only poll()s client FIFOs and enqueues requests; a configurable number of worker threads (animate_server <n>) pull from a shared queue guarded by a mutex/condition variable, so RPC handling is decoupled from connection I/O.
  • Concurrent resource handles: canvases, sprites, and placements live in fixed-size handle tables (service/handle_registry.c) guarded by a global pthread_rwlock_t plus a per-canvas mutex, so multiple clients can read/share a canvas while writes stay serialized.
  • Canvas sharing + barriers: share_canvas grants other users access to a canvas, and a per-canvas barrier (barrier, condition variables in server_requests.c) lets multiple clients synchronize edits to a shared canvas before it's rendered.
  • Rendering pipeline: generate writes raw color_t frames to a .dat file, then forks/execs ffmpeg to encode it to .mp4 — the same pipeline the demo above was produced with.

Notes

Generated binaries, debug symbol folders, FIFO files, and rendered movie outputs are intentionally excluded from version control.

About

Bitmap animation engine and multi-client RPC service written in C.

Topics

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages