Canvas export colortransform fix

This commit is contained in:
Jindra Petřík
2014-06-05 19:59:48 +02:00
parent 0d883dfa12
commit 2dd1c3f01d

View File

@@ -840,12 +840,12 @@ var cxform = function(r_add, g_add, b_add, a_add, r_mult, g_mult, b_mult, a_mult
v = max;
return v;
};
this.apply = function(c) {
var d = c;
d[0] = this._cut(d[0] * this.r_mult / 255 + this.r_add, 0, 255);
d[1] = this._cut(d[1] * this.g_mult / 255 + this.g_add, 0, 255);
d[2] = this._cut(d[2] * this.b_mult / 255 + this.b_add, 0, 255);
d[3] = this._cut(d[3] * this.a_mult / 255 + this.a_add / 255, 0, 1);
this.apply = function(c) {
var d = c;
d[0] = this._cut(Math.round(d[0] * this.r_mult / 255 + this.r_add), 0, 255);
d[1] = this._cut(Math.round(d[1] * this.g_mult / 255 + this.g_add), 0, 255);
d[2] = this._cut(Math.round(d[2] * this.b_mult / 255 + this.b_add), 0, 255);
d[3] = this._cut(Math.round(d[3] * this.a_mult / 255 + this.a_add / 255), 0, 1);
return d;
};
this.applyToImage = function(fimg) {