-
-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #616 from Shallowmallow/invertBrightness
Invert + Brightness filter
- Loading branch information
Showing
3 changed files
with
40 additions
and
0 deletions.
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,19 @@ | ||
package haxe.ui.filters; | ||
|
||
class Brightness extends Filter { | ||
public static var DEFAULTS:Array<Any> = [1]; | ||
|
||
/** | ||
0 is black, 1 is has no effect, over 1 it brightens the image. | ||
**/ | ||
public var multiplier:Float; | ||
|
||
public override function parse(filterDetails:Array<Any>) { | ||
var copy = Filter.applyDefaults(filterDetails, DEFAULTS); | ||
this.multiplier = copy[0]; | ||
|
||
if (this.multiplier < 0) { | ||
this.multiplier = 0; | ||
} | ||
} | ||
} |
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,19 @@ | ||
package haxe.ui.filters; | ||
|
||
class Invert extends Filter { | ||
public static var DEFAULTS:Array<Any> = [1]; | ||
|
||
/** | ||
0 does nothing, 1 inverts the image | ||
**/ | ||
public var multiplier:Float; | ||
|
||
public override function parse(filterDetails:Array<Any>) { | ||
var copy = Filter.applyDefaults(filterDetails, DEFAULTS); | ||
this.multiplier = copy[0]; | ||
|
||
if (this.multiplier < 0) { | ||
this.multiplier = 0; | ||
} | ||
} | ||
} |
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