本文整理匯總了TypeScript中neuroglancer/util/array.tile2dArray函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript tile2dArray函數的具體用法?TypeScript tile2dArray怎麽用?TypeScript tile2dArray使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了tile2dArray函數的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: getSquareCornersArray
export function getSquareCornersArray(
startX = -1, startY = -1, endX = 1, endY = 1, minorTiles = 1, majorTiles = 1) {
return tile2dArray(
new Float32Array([
startX, startY, //
startX, endY, //
endX, endY, //
endX, startY, //
]),
/*majorDimension=*/2, minorTiles, majorTiles);
}
示例2: it
it('majorDimension=2, majorTiles work, minorTiles work', () => {
const input = Uint8Array.of(0, 1, 2, 3);
const expected = Uint8Array.of(0, 1, 0, 1, 2, 3, 2, 3, 0, 1, 0, 1, 2, 3, 2, 3);
const result = tile2dArray(input, /*majorDimension=*/2, /*minorTiles=*/2, /*majorTiles=*/2);
expect(result).toEqual(expected);
});