writeFourdgsBytes function

Uint8List writeFourdgsBytes(
  1. FourdgsGaussianSet gaussians,
  2. double durationSec, {
  3. FourdgsWriteOptions options = const FourdgsWriteOptions(),
})

Encode gaussians as one in-memory .4dgs file.

durationSec is the scene length; playback covers [0, durationSec). A static asset is 0, and the index it produces is the single half-open interval [0, 1e-9) the reference encoders write for one — a seek at t=0 has to land somewhere, and an empty interval covers no instant at all.

Implementation

Uint8List writeFourdgsBytes(
  FourdgsGaussianSet gaussians,
  double durationSec, {
  FourdgsWriteOptions options = const FourdgsWriteOptions(),
}) {
  final collector = _ByteCollector();
  writeFourdgsToSink(collector, gaussians, durationSec, options: options);
  return collector.finish();
}