function resliceBufferWithPadding
resliceBufferWithPadding(): Uint8ArrayCreates a new buffer while removing any unnecessary empty bytes. Useful for when wanting to save an image as a specific format.
Examples
Example 1
Example 1
import { resliceBufferWithPadding } from "@std/webgpu/row_padding"; const input = new Uint8Array([0, 255, 0, 255, 120, 120, 120]); resliceBufferWithPadding(input, 1, 1); // Uint8Array(4) [ 0, 255, 0, 255 ]