Skip to content

feat: support inline payloads#41

Merged
orhun merged 4 commits into
mainfrom
feat/rgp-inline-payloads
May 13, 2026
Merged

feat: support inline payloads#41
orhun merged 4 commits into
mainfrom
feat/rgp-inline-payloads

Conversation

@orhun

@orhun orhun commented May 13, 2026

Copy link
Copy Markdown
Owner

closes #37

This PR extends the Ratty Graphics Protocol with payload-based object registration.

This is useful if you want to load objects from base64-encoded strings instead of files.

Example registration pipeline:

ESC _ ratty;g;r;id=42;fmt=obj;source=payload;more=1;name=rat.obj;<base64 chunk 1> ESC \
ESC _ ratty;g;r;id=42;fmt=obj;source=payload;more=1;<base64 chunk 2> ESC \
ESC _ ratty;g;r;id=42;fmt=obj;source=payload;more=0;<base64 chunk N> ESC \
ESC _ ratty;g;p;id=42;row=12;col=8;w=4;h=2 ESC \

Example usage in Rust:

use ratatui_ratty::{ObjectFormat, RattyGraphic, RattyGraphicSettings};

let graphic = RattyGraphic::new(
    RattyGraphicSettings::new("live_draw.obj")
        .id(42)
        .format(ObjectFormat::Obj),
);

let obj_bytes = std::fs::read("live_draw.obj")?;
graphic.register_payload(&obj_bytes)?;

@orhun orhun merged commit ae09100 into main May 13, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support inline payloads for RGP

1 participant