fromBytes static method

Future<GaussianSplats> fromBytes(
  1. Uint8List bytes, {
  2. SplatFormat? format,
  3. double alphaCullThreshold = 1.0 / 255.0,
  4. int maxShDegree = 2,
  5. SplatColorSpace colorSpace = SplatColorSpace.displayReferred,
})

Decodes splat file bytes on a background isolate.

Implementation

static Future<GaussianSplats> fromBytes(
  Uint8List bytes, {
  SplatFormat? format,
  double alphaCullThreshold = 1.0 / 255.0,
  int maxShDegree = 2,
  SplatColorSpace colorSpace = SplatColorSpace.displayReferred,
}) async {
  final sniffed = sniffSplatFormat(bytes, fallback: format);
  final packed = await compute(decodeSplatsForIsolate, (
    bytes: bytes,
    format: sniffed,
    alphaCullThreshold: alphaCullThreshold,
    maxShDegree: maxShDegree,
  ), debugLabel: 'decodeSplats');
  return GaussianSplats._(packed, colorSpace);
}