-
Notifications
You must be signed in to change notification settings - Fork 10
/
ScaleFilter.ts
66 lines (57 loc) · 1.97 KB
/
ScaleFilter.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
import {map, mapArray} from '../common/Mapper';
import Filter from './Filter';
import FilterType from './FilterType';
import ScalingAlgorithm from './ScalingAlgorithm';
/**
* @export
* @class ScaleFilter
*/
export class ScaleFilter extends Filter {
/**
* Discriminator property for Filter
* @type {string}
* @memberof ScaleFilter
*/
public readonly type: FilterType = FilterType.SCALE;
/**
* The width of the output frame in pixels. If not set it will be based on the configured height by maintaining the original aspect ratio. If height is also not set, the original source dimensions will be applied.
* @type {number}
* @memberof ScaleFilter
*/
public width?: number;
/**
* The height of the output frame in pixels. If not set it will be based on the configured width by maintaining the original aspect ratio. If width is also not set, the original source dimensions will be applied.
* @type {number}
* @memberof ScaleFilter
*/
public height?: number;
/**
* @type {ScalingAlgorithm}
* @memberof ScaleFilter
*/
public scalingAlgorithm?: ScalingAlgorithm;
/**
* The numerator of the sample aspect ratio (also known as pixel aspect ratio). Must be set if sampleAspectRatioDenominator is set.
* @type {number}
* @memberof ScaleFilter
*/
public sampleAspectRatioNumerator?: number;
/**
* The denominator of the sample aspect ratio (also known as pixel aspect ratio). Must be set if sampleAspectRatioNumerator is set.
* @type {number}
* @memberof ScaleFilter
*/
public sampleAspectRatioDenominator?: number;
constructor(obj?: Partial<ScaleFilter>) {
super(obj);
if(!obj) {
return;
}
this.width = map(obj.width);
this.height = map(obj.height);
this.scalingAlgorithm = map(obj.scalingAlgorithm);
this.sampleAspectRatioNumerator = map(obj.sampleAspectRatioNumerator);
this.sampleAspectRatioDenominator = map(obj.sampleAspectRatioDenominator);
}
}
export default ScaleFilter;