This repository has been archived by the owner on May 24, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
metadata.ts
78 lines (76 loc) · 1.97 KB
/
metadata.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/**
* @since 2019-12-29 11:05
* @author vivaxy
*/
import { COLOR_TYPES } from './color-types';
type Metadata = {
width: number; // Image width
height: number; // Image height
depth: number; // Bit depth; depth per channel
colorType: COLOR_TYPES; // Color type as grayscale, true color, palette or with alpha
compression: number; // Compression method; always be 0
interlace: number; // Interlaced
filter: number; // Filter method; always be 0
palette?: [number, number, number, number][]; // Palette if presented
transparent?: [number, number, number, number]; // Transparent color if presented
chromaticities?: {
// Primary chromaticities
white: {
x: number;
y: number;
};
red: {
x: number;
y: number;
};
green: {
x: number;
y: number;
};
blue: {
x: number;
y: number;
};
};
gamma?: number; // Image gamma
icc?: {
// Embedded ICC profile
name: string;
profile: number[];
};
significantBits?: [number, number, number, number]; // Significant bits
sRGB?: number; // Standard RGB color space rendering intent
text?: {
// Keywords and text strings
[keyword: string]: string;
};
compressedText?: {
// Compressed textual data
[keyword: string]: string;
};
internationalText?: {
// International textual data
[keyword: string]: {
languageTag: string;
translatedKeyword: string;
text: string;
};
};
background?: [number, number, number, number]; // Background color if presented
histogram?: number[]; // Image histogram
physicalDimensions?: {
// Physical pixel dimensions
pixelPerUnitX: number;
pixelPerUnitY: number;
unit: number;
};
suggestedPalette?: {
// Suggested palette
name: string;
depth: number;
palette: [number, number, number, number, number][];
};
lastModificationTime?: number; // Image last-modification time (UTC)
data: number[]; // ImageData
};
export default Metadata;