/
antialiasingkernel.ts
41 lines (31 loc) · 1.06 KB
/
antialiasingkernel.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
/* spellchecker: disable */
import { RandomSquareKernel } from './randomsquarekernel';
/* spellchecker: enable */
/**
* An anti-aliasing kernel which provides NDC offsets for anti-aliasing, e.g., when using multi-frame sampling.
*/
export class AntiAliasingKernel extends RandomSquareKernel {
/**
* AntiAliasingKernel is fixed to one-dimension (x-axis) and 2-components per sample.
* @param width - Width of the kernel along its x-axis.
*/
constructor(width: GLsizei) {
super(width);
}
/**
* Invokes regeneration of all values. If width is either 8 or 64 pre-built kernels will be loaded (golden set). In
* any other case, a random square kernel will be created.
*/
protected generate(): void {
switch (this._width) {
case 8:
this.fromJSON(require('./data/goldenset08.json'));
break;
case 64:
this.fromJSON(require('./data/goldenset64.json'));
break;
default:
super.generate();
}
}
}