-
Notifications
You must be signed in to change notification settings - Fork 10
/
CropFilter.ts
66 lines (57 loc) · 1.53 KB
/
CropFilter.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 PositionUnit from './PositionUnit';
/**
* @export
* @class CropFilter
*/
export class CropFilter extends Filter {
/**
* Discriminator property for Filter
* @type {string}
* @memberof CropFilter
*/
public readonly type: FilterType = FilterType.CROP;
/**
* Amount of pixels that will be cropped of the input video from the left side. Must be zero or a positive value.
* @type {number}
* @memberof CropFilter
*/
public left?: number;
/**
* Amount of pixels that will be cropped of the input video from the right side. Must be zero or a positive value.
* @type {number}
* @memberof CropFilter
*/
public right?: number;
/**
* Amount of pixels that will be cropped of the input video from the top. Must be zero or a positive value.
* @type {number}
* @memberof CropFilter
*/
public top?: number;
/**
* Amount of pixels that will be cropped of the input video from the bottom. Must be zero or a positive value.
* @type {number}
* @memberof CropFilter
*/
public bottom?: number;
/**
* @type {PositionUnit}
* @memberof CropFilter
*/
public unit?: PositionUnit;
constructor(obj?: Partial<CropFilter>) {
super(obj);
if(!obj) {
return;
}
this.left = map(obj.left);
this.right = map(obj.right);
this.top = map(obj.top);
this.bottom = map(obj.bottom);
this.unit = map(obj.unit);
}
}
export default CropFilter;