本文整理汇总了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;
}
示例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];
}
示例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;
}