UNPKG

1.04 kBTypeScriptView Raw
1/**
2 * A class containing utility functions for images.
3 * @see {@link https://threejs.org/docs/index.html#api/en/extras/ImageUtils | Official Documentation}
4 * @see {@link https://github.com/mrdoob/three.js/blob/master/src/extras/ImageUtils.js | Source}
5 */
6declare class ImageUtils {
7 /**
8 * Returns a data URI containing a representation of the given image.
9 * @param image The image object.
10 */
11 static getDataURL(
12 image: HTMLImageElement | HTMLCanvasElement | CanvasImageSource | ImageBitmap | ImageData,
13 ): string;
14
15 /**
16 * Converts the given sRGB image data to linear color space.
17 * @param image
18 */
19 static sRGBToLinear(image: HTMLImageElement | HTMLCanvasElement | ImageBitmap): HTMLCanvasElement;
20
21 /**
22 * Converts the given sRGB image data to linear color space.
23 * @param image
24 */
25 static sRGBToLinear(image: ImageData): {
26 data: ImageData["data"];
27 width: ImageData["width"];
28 height: ImageData["height"];
29 };
30}
31
32export { ImageUtils };