-
Notifications
You must be signed in to change notification settings - Fork 10
/
EnhancedWatermarkFilter.ts
98 lines (85 loc) · 2.97 KB
/
EnhancedWatermarkFilter.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
import {map, mapArray} from '../common/Mapper';
import Filter from './Filter';
import FilterType from './FilterType';
import PositionUnit from './PositionUnit';
/**
* @export
* @class EnhancedWatermarkFilter
*/
export class EnhancedWatermarkFilter extends Filter {
/**
* Discriminator property for Filter
* @type {string}
* @memberof EnhancedWatermarkFilter
*/
public readonly type: FilterType = FilterType.ENHANCED_WATERMARK;
/**
* URL of the file to be used as watermark image. Supported image formats: PNG, JPEG, BMP, GIF (required)
* @type {string}
* @memberof EnhancedWatermarkFilter
*/
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 EnhancedWatermarkFilter
*/
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 EnhancedWatermarkFilter
*/
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 EnhancedWatermarkFilter
*/
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 EnhancedWatermarkFilter
*/
public bottom?: number;
/**
* @type {PositionUnit}
* @memberof EnhancedWatermarkFilter
*/
public unit?: PositionUnit;
/**
* Opacity to apply on the watermark image. Valid values are from 0.0 (completely transparent) to 1.0 (not transparent at all)
* @type {number}
* @memberof EnhancedWatermarkFilter
*/
public opacity?: number;
/**
* Desired width of the watermark image, the unit of the parameter is specified separately by the parameter 'unit'. If both width and height are set the watermark size is fixed. If only one is set the aspect ratio of the image will be used to rescale it
* @type {number}
* @memberof EnhancedWatermarkFilter
*/
public width?: number;
/**
* Desired height of the watermark image, the unit of the parameter is specified separately by the parameter 'unit'. If both width and height are set the watermark size is fixed. If only one is set the aspect ratio of the image will be used to rescale it
* @type {number}
* @memberof EnhancedWatermarkFilter
*/
public height?: number;
constructor(obj?: Partial<EnhancedWatermarkFilter>) {
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);
this.opacity = map(obj.opacity);
this.width = map(obj.width);
this.height = map(obj.height);
}
}
export default EnhancedWatermarkFilter;