-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
76 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
class Blur { | ||
static get Model() { | ||
return { | ||
_class: 'blur', | ||
center: '{0.5, 0.5}', | ||
isEnabled: true, | ||
motionAngle: 0, | ||
radius: 0, | ||
saturation: 1, | ||
type: Blur.Type.Gaussian, | ||
}; | ||
} | ||
|
||
static get Type() { | ||
return { | ||
Gaussian: 0, | ||
Motion: 1, | ||
Zoom: 2, | ||
Background: 3, | ||
}; | ||
} | ||
|
||
/** | ||
* @param {Blur.Model} args | ||
* @param {Blur.Model} json | ||
*/ | ||
constructor(args, json) { | ||
if (json) Object.assign(this, json); | ||
if (args) Object.assign(this, Blur.Model, args); | ||
} | ||
|
||
/** | ||
* @param {Blur.Model} json | ||
* @returns {Blur} | ||
*/ | ||
static fromJSON(json) { | ||
return new Blur(null, json); | ||
} | ||
} | ||
|
||
module.exports = Blur; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
declare enum BlurType { | ||
Gaussian = 0, | ||
Motion = 1, | ||
Zoom = 2, | ||
Background = 3, | ||
} | ||
|
||
declare class Blur { | ||
_class: 'blur'; | ||
center: string; | ||
isEnabled: boolean; | ||
motionAngle: number; | ||
radius: number; | ||
saturation: number; | ||
type: BlurType; | ||
|
||
static readonly Type: BlurType; | ||
static fromJSON(json: Blur): Blur; | ||
|
||
constructor(args: Partial<Blur>) | ||
constructor(args: any) | ||
constructor(args: null | undefined, json: Blur) | ||
} | ||
|
||
export = Blur; |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters