本文整理汇总了TypeScript中neuroglancer/sliceview/compressed_segmentation/decode_common.decodeValueOffset函数的典型用法代码示例。如果您正苦于以下问题:TypeScript decodeValueOffset函数的具体用法?TypeScript decodeValueOffset怎么用?TypeScript decodeValueOffset使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了decodeValueOffset函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: decodeChannel
export function decodeChannel(
out: Uint32Array,
data: Uint32Array, baseOffset: number, chunkDataSize: ArrayLike<number>, blockSize: ArrayLike<number>) {
const expectedLength = chunkDataSize[0] * chunkDataSize[1] * chunkDataSize[2] * 2;
if (expectedLength !== out.length) {
throw new Error(`Output length ${out.length} is not equal to expected length ${expectedLength}.`);
}
let vx = chunkDataSize[0];
let vy = chunkDataSize[1];
let vz = chunkDataSize[2];
let dataPosition = [0, 0, 0];
let outputOffset = 0;
for (let z = 0; z < vz; ++z) {
dataPosition[2] = z;
for (let y = 0; y < vy; ++y) {
dataPosition[1] = y;
for (let x = 0; x < vx; ++x) {
dataPosition[0] = x;
let outputValueOffset = decodeValueOffset(data, baseOffset, chunkDataSize, blockSize, dataPosition,
2);
out[outputOffset++] = data[baseOffset + outputValueOffset];
out[outputOffset++] = data[baseOffset + outputValueOffset + 1];
}
}
}
return out;
}
开发者ID:j6k4m8,项目名称:neuroglancer,代码行数:29,代码来源:decode_uint64.ts
示例2: readSingleChannelValue
export function readSingleChannelValue(
data: Uint32Array, baseOffset: number, chunkDataSize: ArrayLike<number>,
blockSize: ArrayLike<number>, dataPosition: ArrayLike<number>) {
let outputValueOffset =
decodeValueOffset(data, baseOffset, chunkDataSize, blockSize, dataPosition, 1) + baseOffset;
return data[outputValueOffset];
}
开发者ID:google,项目名称:neuroglancer,代码行数:9,代码来源:decode_uint32.ts
示例3: readSingleChannelValue
export function readSingleChannelValue(
out: Uint64,
data: Uint32Array, baseOffset: number, chunkDataSize: ArrayLike<number>,
blockSize: ArrayLike<number>, dataPosition: ArrayLike<number>) {
let outputValueOffset =
decodeValueOffset(data, baseOffset, chunkDataSize, blockSize, dataPosition, 2) + baseOffset;
out.low = data[outputValueOffset];
out.high = data[outputValueOffset + 1];
return out;
}
开发者ID:google,项目名称:neuroglancer,代码行数:13,代码来源:decode_uint64.ts
注:本文中的neuroglancer/sliceview/compressed_segmentation/decode_common.decodeValueOffset函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论