import type { GpuBuffer, GpuContext, GpuTexture } from "./types.js"; export interface ReadTextureOptions extends Pick { /** Region origin. Defaults to 0. */ x?: number; /** Region origin. Defaults to 0. */ y?: number; /** Region size. Defaults to the mip level's width. */ width?: number; /** Region size. Defaults to the mip level's height. */ height?: number; /** Array layer or cube face to read from. */ layer?: number; } /** * Asynchronously read pixels back from a texture (eg. for picking). The source * needs a `usage` including COPY_SRC. Compressed formats read back as their raw * block bytes, the region rounded out to whole blocks. * * ```js * const [r, g, b, a] = await gpu.readTexture(ctx, pickingTexture, { * x, * y, * width: 1, * height: 1, * }); * ``` */ export declare function readTexture(ctx: GpuContext, source: GpuTexture, options?: ReadTextureOptions): Promise; /** * Asynchronously read a buffer back to the CPU. * * ```js * const data = new Float32Array(await gpu.readBuffer(ctx, particleBuffer)); * ``` */ export declare function readBuffer(ctx: GpuContext, source: GpuBuffer, byteOffset?: number, byteLength?: number): Promise; //# sourceMappingURL=readback.d.ts.map