-
Notifications
You must be signed in to change notification settings - Fork 10
/
WatermarkFilter.ts
75 lines (65 loc) · 2.01 KB
/
WatermarkFilter.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
import {map, mapArray} from '../common/Mapper';
import Filter from './Filter';
import FilterType from './FilterType';
import PositionUnit from './PositionUnit';
/**
* @export
* @class WatermarkFilter
*/
export class WatermarkFilter extends Filter {
/**
* Discriminator property for Filter
* @type {string}
* @memberof WatermarkFilter
*/
public readonly type: FilterType = FilterType.WATERMARK;
/**
* URL of the file to be used as watermark image. Supported image formats: PNG, JPEG, BMP, GIF (required)
* @type {string}
* @memberof WatermarkFilter
*/
public image?: string;
/**
* Distance from the left edge of the input video to the left edge of the watermark image. May not be set if 'right' is set.
* @type {number}
* @memberof WatermarkFilter
*/
public left?: number;
/**
* Distance from the right edge of the input video to the right edge of the watermark image . May not be set if 'left' is set.
* @type {number}
* @memberof WatermarkFilter
*/
public right?: number;
/**
* Distance from the top edge of the input video to the top edge of the watermark image. May not be set if 'bottom' is set.
* @type {number}
* @memberof WatermarkFilter
*/
public top?: number;
/**
* Distance from the bottom edge of the input video to the bottom edge of the watermark image. May not be set if 'top' is set.
* @type {number}
* @memberof WatermarkFilter
*/
public bottom?: number;
/**
* Specifies if the values of 'left', 'right', 'top' and 'bottom' are interpreted as pixels or as a percentage of the input video's dimensions.
* @type {PositionUnit}
* @memberof WatermarkFilter
*/
public unit?: PositionUnit;
constructor(obj?: Partial<WatermarkFilter>) {
super(obj);
if(!obj) {
return;
}
this.image = map(obj.image);
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 WatermarkFilter;