本文整理汇总了TypeScript中neuroglancer/sliceview/frontend.registerChunkFormatHandler函数的典型用法代码示例。如果您正苦于以下问题:TypeScript registerChunkFormatHandler函数的具体用法?TypeScript registerChunkFormatHandler怎么用?TypeScript registerChunkFormatHandler使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了registerChunkFormatHandler函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: constructor
data, /*baseOffset=*/offset, chunkDataSize, chunkFormat.subchunkSize, dataPosition);
}
}
};
export class CompressedSegmentationChunkFormatHandler extends RefCounted implements
ChunkFormatHandler {
chunkFormat: ChunkFormat;
constructor(gl: GL, spec: VolumeChunkSpecification) {
super();
let {dataType} = spec;
if (dataType !== DataType.UINT64 && dataType !== DataType.UINT32) {
throw new Error(`Unsupported compressed segmentation data type: ${DataType[dataType]}`);
}
this.chunkFormat = this.registerDisposer(ChunkFormat.get(
gl, spec.dataType, spec.compressedSegmentationBlockSize!, spec.numChannels));
}
getChunk(source: VolumeChunkSource, x: any) {
return new CompressedSegmentationVolumeChunk(source, x);
}
};
registerChunkFormatHandler((gl: GL, spec: VolumeChunkSpecification) => {
if (spec.compressedSegmentationBlockSize != null) {
return new CompressedSegmentationChunkFormatHandler(gl, spec);
}
return null;
});
示例2: Uint64
return data[index];
case DataType.UINT64: {
let index2 = index * 2;
return new Uint64(data[index2], data[index2 + 1]);
}
}
throw new Error('Invalid data type: ' + dataType);
}
};
export class UncompressedChunkFormatHandler extends RefCounted implements ChunkFormatHandler {
chunkFormat: ChunkFormat;
textureLayout: TextureLayout;
constructor(gl: GL, spec: VolumeChunkSpecification) {
super();
this.chunkFormat = this.registerDisposer(ChunkFormat.get(gl, spec.dataType, spec.numChannels));
this.textureLayout =
this.registerDisposer(this.chunkFormat.getTextureLayout(gl, spec.chunkDataSize));
}
getChunk(source: VolumeChunkSource, x: any) { return new UncompressedVolumeChunk(source, x); }
};
registerChunkFormatHandler((gl: GL, spec: VolumeChunkSpecification) => {
if (spec.compressedSegmentationBlockSize == null && !spec.stack) {
return new UncompressedChunkFormatHandler(gl, spec);
}
return null;
});