fromBytes static method
Future<GaussianSplats>
fromBytes(
- Uint8List bytes, {
- SplatFormat? format,
- double alphaCullThreshold = 1.0 / 255.0,
- int maxShDegree = 2,
- 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);
}