當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript decode_common.decodeValueOffset函數代碼示例

本文整理匯總了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;未經允許,請勿轉載。