export type ImageFormat = "jpg" | "png"; export interface Decoder { (data: Uint8Array): ImageData | Promise; } export type DecoderMap = { [key in ImageFormat]: Decoder; }; /** * Detect the format of the image. Returns undefined if the format is not supported. */ export declare function getFormat(data: Uint8Array): ImageFormat | undefined; export interface ImageData { width: number; height: number; data: Uint8Array; } /** * Decodes JPEG or PNG image data into a raw Uint8Array pixel array. */ export declare function decodeImageData(imageData: Uint8Array, decoders: DecoderMap): ImageData | Promise; /** * Loads an image from a URL and returns it as a Uint8Array without decoding it. */ export declare function getDataFromUrl(url: string | URL): Promise; /** * Gets the raw, decoded pixel data from an image source. * The source can be a URL, a string containing the URL, a Uint8Array containing the image data, * or an ArrayBuffer containing the image data. */ export declare function getPixels(source: URL | string | Uint8Array | ArrayBuffer, decoders: DecoderMap): Promise; /** * A function that gets the raw pixel data from an image source. */ export type GetPixelsFunction = (source: URL | string | Uint8Array | ArrayBuffer) => Promise; //# sourceMappingURL=get-pixels.d.ts.map