generated from napi-rs/package-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
37 lines (35 loc) · 1.12 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/* tslint:disable */
/* eslint-disable */
/* auto-generated by NAPI-RS */
/** Encodes an RGBA image to a ThumbHash. RGB should not be premultiplied by A. */
export function rgbaToThumbHash(w: number, h: number, rgba: Uint8Array): Uint8Array
/**
* Extracts the approximate aspect ratio of the original image.
* An error will be returned if the input is too short.
*/
export function thumbHashToApproximateAspectRatio(hash: Uint8Array): number
export interface Rgba {
r: number
g: number
b: number
a: number
}
/**
* Extracts the average color from a ThumbHash.
* Returns the RGBA values where each value ranges from 0 to 1.
* RGB is not be premultiplied by A.
* An error will be returned if the input is too short.
*/
export function thumbHashToAverageRGBA(hash: Uint8Array): Rgba
export interface Image {
width: number
height: number
rgba: Uint8Array
}
/**
* Decodes a ThumbHash to an RGBA image.
* RGB is not be premultiplied by A.
* Returns the width, height, and pixels of the rendered placeholder image.
* An error will be returned if the input is too short.
*/
export function thumbHashToRGBA(hash: Uint8Array): Image