本文整理匯總了TypeScript中neuroglancer/sliceview/compressed_segmentation/encode_uint32.encodeChannels函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript encodeChannels函數的具體用法?TypeScript encodeChannels怎麽用?TypeScript encodeChannels使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了encodeChannels函數的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: it
it(`round trip ${volumeSize.join(',')} with blockSize ${vec3Key(blockSize)}`, () => {
const numPossibleValues = 15;
const input = makeRandomUint32Array(prod4(volumeSize), numPossibleValues);
const output = new Uint32ArrayBuilder();
encodeChannels(output, blockSize, input, volumeSize);
const decoded = new Uint32Array(input.length);
decodeChannels(decoded, output.view, 0, volumeSize, blockSize);
expect(decoded).toEqual(input);
});
示例2: it
it('basic 1-channel 1-block', () => {
const blockSize = [2, 2, 1];
const input = Uint32Array.of(
4, 4, 4, 4 //
);
const volumeSize = [2, 2, 1, 1];
const output = new Uint32ArrayBuilder();
encodeChannels(output, blockSize, input, volumeSize);
expect(output.view)
.toEqual(Uint32Array.of(
1, //
2, 2, 4 //
));
});
示例3: benchmark
benchmark(`encode_uint32`, () => {
output.clear();
encodeChannelsUint32(output, blockSize, exampleChunkData32, volumeSize);
});