import { resliceBufferWithPadding } from "https://deno.land/std@0.221.0/webgpu/row_padding.ts";
Creates 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 "https://deno.land/std@0.221.0/webgpu/row_padding.ts";
const input = new Uint8Array([0, 255, 0, 255, 120, 120, 120]);
resliceBufferWithPadding(input, 1, 1); // Uint8Array(4) [ 0, 255, 0, 255 ]