Permalink
Browse files

Fixes #122

  • Loading branch information...
1 parent e7899e2 commit 222940e88f7bd64ffb3ddb9c50c1970163360318 @meltingice committed Nov 13, 2013
Showing with 60 additions and 44 deletions.
  1. +1 −1 api/LICENSE.html
  2. +1 −1 api/README.md.html
  3. +1 −1 api/class_index.html
  4. +1 −1 api/classes/Caman.html
  5. +1 −1 api/classes/Caman/Analyze.html
  6. +1 −1 api/classes/Caman/Blender.html
  7. +3 −3 api/classes/Caman/Calculate.html
  8. +1 −1 api/classes/Caman/Convert.html
  9. +1 −1 api/classes/Caman/Event.html
  10. +1 −1 api/classes/Caman/Filter.html
  11. +1 −1 api/classes/Caman/IO.html
  12. +1 −1 api/classes/Caman/Layer.html
  13. +1 −1 api/classes/Caman/Logger.html
  14. +1 −1 api/classes/Caman/Pixel.html
  15. +1 −1 api/classes/Caman/Plugin.html
  16. +1 −1 api/classes/Caman/Renderer.html
  17. +1 −1 api/classes/Caman/Store.html
  18. +1 −1 api/classes/CamanParser.html
  19. +1 −1 api/classes/Module.html
  20. +1 −1 api/classes/Util.html
  21. +1 −1 api/files/core/analyze.coffee.html
  22. +1 −1 api/files/core/autoload.coffee.html
  23. +1 −1 api/files/core/blender.coffee.html
  24. +1 −1 api/files/core/calculate.coffee.html
  25. +1 −1 api/files/core/caman.coffee.html
  26. +1 −1 api/files/core/convert.coffee.html
  27. +1 −1 api/files/core/event.coffee.html
  28. +1 −1 api/files/core/filter.coffee.html
  29. +1 −1 api/files/core/io.coffee.html
  30. +1 −1 api/files/core/layer.coffee.html
  31. +1 −1 api/files/core/pixel.coffee.html
  32. +1 −1 api/files/core/plugin.coffee.html
  33. +1 −1 api/files/core/renderer.coffee.html
  34. +1 −1 api/files/core/store.coffee.html
  35. +1 −1 api/files/core/util.coffee.html
  36. +6 −0 dist/caman.full.js
  37. +3 −1 dist/caman.full.min.js
  38. +1 −1 dist/caman.full.pack.js
  39. +6 −0 dist/caman.js
  40. +3 −1 dist/caman.min.js
  41. +1 −1 dist/caman.pack.js
  42. +1 −1 docs/calculate.html
  43. +1 −1 examples/node/filter.coffee
  44. +1 −1 src/core/calculate.coffee
View
@@ -129,7 +129,7 @@
</div>
<div id='footer'>
Generated on
- Wed Nov 13 2013 00:43:52 GMT-0500 (EST)
+ Wed Nov 13 2013 09:33:09 GMT-0500 (EST)
by
<a href='https://github.com/netzpirat/codo' title='CoffeeScript API documentation generator'>Codo</a>
v1.7.0
View
@@ -139,7 +139,7 @@
</div>
<div id='footer'>
Generated on
- Wed Nov 13 2013 00:43:52 GMT-0500 (EST)
+ Wed Nov 13 2013 09:33:09 GMT-0500 (EST)
by
<a href='https://github.com/netzpirat/codo' title='CoffeeScript API documentation generator'>Codo</a>
v1.7.0
@@ -416,7 +416,7 @@ <h1 class='alphaindex'>Alphabetic Index</h1>
</div>
<div id='footer'>
Generated on
- Wed Nov 13 2013 00:43:52 GMT-0500 (EST)
+ Wed Nov 13 2013 09:33:09 GMT-0500 (EST)
by
<a href='https://github.com/netzpirat/codo' title='CoffeeScript API documentation generator'>Codo</a>
v1.7.0
@@ -1493,7 +1493,7 @@ <h3 class='inherited'>
</div>
<div id='footer'>
Generated on
- Wed Nov 13 2013 00:43:52 GMT-0500 (EST)
+ Wed Nov 13 2013 09:33:09 GMT-0500 (EST)
by
<a href='https://github.com/netzpirat/codo' title='CoffeeScript API documentation generator'>Codo</a>
v1.7.0
@@ -181,7 +181,7 @@
</div>
<div id='footer'>
Generated on
- Wed Nov 13 2013 00:43:52 GMT-0500 (EST)
+ Wed Nov 13 2013 09:33:09 GMT-0500 (EST)
by
<a href='https://github.com/netzpirat/codo' title='CoffeeScript API documentation generator'>Codo</a>
v1.7.0
@@ -220,7 +220,7 @@
</div>
<div id='footer'>
Generated on
- Wed Nov 13 2013 00:43:52 GMT-0500 (EST)
+ Wed Nov 13 2013 09:33:09 GMT-0500 (EST)
by
<a href='https://github.com/netzpirat/codo' title='CoffeeScript API documentation generator'>Codo</a>
v1.7.0
@@ -157,7 +157,7 @@
<li>
<span class='signature'>
<a href='#bezier-class'>
- + (Array) <strong>bezier</strong>(start, ctrl1, ctrl2, end, lowBound, highBound)
+ + (Array) <strong>bezier</strong>(start, ctrl1, ctrl2, end, lowBound = 0, highBound = 255)
</a>
</span>
<span class='desc'>
@@ -313,7 +313,7 @@
</div>
<div class='method_details'>
<p class='signature' id='bezier-class'>
- + (Array) <strong>bezier</strong>(start, ctrl1, ctrl2, end, lowBound, highBound)
+ + (Array) <strong>bezier</strong>(start, ctrl1, ctrl2, end, lowBound = 0, highBound = 255)
</p>
<div class='docstring'>
<p>Generates a bezier curve given a start and end point, with control points in between.
@@ -459,7 +459,7 @@
</div>
<div id='footer'>
Generated on
- Wed Nov 13 2013 00:43:52 GMT-0500 (EST)
+ Wed Nov 13 2013 09:33:09 GMT-0500 (EST)
by
<a href='https://github.com/netzpirat/codo' title='CoffeeScript API documentation generator'>Codo</a>
v1.7.0
@@ -986,7 +986,7 @@
</div>
<div id='footer'>
Generated on
- Wed Nov 13 2013 00:43:52 GMT-0500 (EST)
+ Wed Nov 13 2013 09:33:09 GMT-0500 (EST)
by
<a href='https://github.com/netzpirat/codo' title='CoffeeScript API documentation generator'>Codo</a>
v1.7.0
@@ -272,7 +272,7 @@
</div>
<div id='footer'>
Generated on
- Wed Nov 13 2013 00:43:52 GMT-0500 (EST)
+ Wed Nov 13 2013 09:33:09 GMT-0500 (EST)
by
<a href='https://github.com/netzpirat/codo' title='CoffeeScript API documentation generator'>Codo</a>
v1.7.0
@@ -170,7 +170,7 @@
</div>
<div id='footer'>
Generated on
- Wed Nov 13 2013 00:43:52 GMT-0500 (EST)
+ Wed Nov 13 2013 09:33:09 GMT-0500 (EST)
by
<a href='https://github.com/netzpirat/codo' title='CoffeeScript API documentation generator'>Codo</a>
v1.7.0
@@ -362,7 +362,7 @@
</div>
<div id='footer'>
Generated on
- Wed Nov 13 2013 00:43:52 GMT-0500 (EST)
+ Wed Nov 13 2013 09:33:09 GMT-0500 (EST)
by
<a href='https://github.com/netzpirat/codo' title='CoffeeScript API documentation generator'>Codo</a>
v1.7.0
@@ -302,7 +302,7 @@
</div>
<div id='footer'>
Generated on
- Wed Nov 13 2013 00:43:52 GMT-0500 (EST)
+ Wed Nov 13 2013 09:33:09 GMT-0500 (EST)
by
<a href='https://github.com/netzpirat/codo' title='CoffeeScript API documentation generator'>Codo</a>
v1.7.0
@@ -149,7 +149,7 @@
</div>
<div id='footer'>
Generated on
- Wed Nov 13 2013 00:43:52 GMT-0500 (EST)
+ Wed Nov 13 2013 09:33:09 GMT-0500 (EST)
by
<a href='https://github.com/netzpirat/codo' title='CoffeeScript API documentation generator'>Codo</a>
v1.7.0
@@ -363,7 +363,7 @@
</div>
<div id='footer'>
Generated on
- Wed Nov 13 2013 00:43:52 GMT-0500 (EST)
+ Wed Nov 13 2013 09:33:09 GMT-0500 (EST)
by
<a href='https://github.com/netzpirat/codo' title='CoffeeScript API documentation generator'>Codo</a>
v1.7.0
@@ -165,7 +165,7 @@
</div>
<div id='footer'>
Generated on
- Wed Nov 13 2013 00:43:52 GMT-0500 (EST)
+ Wed Nov 13 2013 09:33:09 GMT-0500 (EST)
by
<a href='https://github.com/netzpirat/codo' title='CoffeeScript API documentation generator'>Codo</a>
v1.7.0
@@ -369,7 +369,7 @@
</div>
<div id='footer'>
Generated on
- Wed Nov 13 2013 00:43:52 GMT-0500 (EST)
+ Wed Nov 13 2013 09:33:09 GMT-0500 (EST)
by
<a href='https://github.com/netzpirat/codo' title='CoffeeScript API documentation generator'>Codo</a>
v1.7.0
@@ -217,7 +217,7 @@
</div>
<div id='footer'>
Generated on
- Wed Nov 13 2013 00:43:52 GMT-0500 (EST)
+ Wed Nov 13 2013 09:33:09 GMT-0500 (EST)
by
<a href='https://github.com/netzpirat/codo' title='CoffeeScript API documentation generator'>Codo</a>
v1.7.0
@@ -227,7 +227,7 @@
</div>
<div id='footer'>
Generated on
- Wed Nov 13 2013 00:43:52 GMT-0500 (EST)
+ Wed Nov 13 2013 09:33:09 GMT-0500 (EST)
by
<a href='https://github.com/netzpirat/codo' title='CoffeeScript API documentation generator'>Codo</a>
v1.7.0
@@ -249,7 +249,7 @@
</div>
<div id='footer'>
Generated on
- Wed Nov 13 2013 00:43:52 GMT-0500 (EST)
+ Wed Nov 13 2013 09:33:09 GMT-0500 (EST)
by
<a href='https://github.com/netzpirat/codo' title='CoffeeScript API documentation generator'>Codo</a>
v1.7.0
@@ -201,7 +201,7 @@
</div>
<div id='footer'>
Generated on
- Wed Nov 13 2013 00:43:52 GMT-0500 (EST)
+ Wed Nov 13 2013 09:33:09 GMT-0500 (EST)
by
<a href='https://github.com/netzpirat/codo' title='CoffeeScript API documentation generator'>Codo</a>
v1.7.0
@@ -119,7 +119,7 @@
</div>
<div id='footer'>
Generated on
- Wed Nov 13 2013 00:43:52 GMT-0500 (EST)
+ Wed Nov 13 2013 09:33:09 GMT-0500 (EST)
by
<a href='https://github.com/netzpirat/codo' title='CoffeeScript API documentation generator'>Codo</a>
v1.7.0
@@ -146,7 +146,7 @@
</div>
<div id='footer'>
Generated on
- Wed Nov 13 2013 00:43:52 GMT-0500 (EST)
+ Wed Nov 13 2013 09:33:09 GMT-0500 (EST)
by
<a href='https://github.com/netzpirat/codo' title='CoffeeScript API documentation generator'>Codo</a>
v1.7.0
@@ -119,7 +119,7 @@
</div>
<div id='footer'>
Generated on
- Wed Nov 13 2013 00:43:52 GMT-0500 (EST)
+ Wed Nov 13 2013 09:33:09 GMT-0500 (EST)
by
<a href='https://github.com/netzpirat/codo' title='CoffeeScript API documentation generator'>Codo</a>
v1.7.0
@@ -119,7 +119,7 @@
</div>
<div id='footer'>
Generated on
- Wed Nov 13 2013 00:43:52 GMT-0500 (EST)
+ Wed Nov 13 2013 09:33:09 GMT-0500 (EST)
by
<a href='https://github.com/netzpirat/codo' title='CoffeeScript API documentation generator'>Codo</a>
v1.7.0
@@ -119,7 +119,7 @@
</div>
<div id='footer'>
Generated on
- Wed Nov 13 2013 00:43:52 GMT-0500 (EST)
+ Wed Nov 13 2013 09:33:09 GMT-0500 (EST)
by
<a href='https://github.com/netzpirat/codo' title='CoffeeScript API documentation generator'>Codo</a>
v1.7.0
@@ -119,7 +119,7 @@
</div>
<div id='footer'>
Generated on
- Wed Nov 13 2013 00:43:52 GMT-0500 (EST)
+ Wed Nov 13 2013 09:33:09 GMT-0500 (EST)
by
<a href='https://github.com/netzpirat/codo' title='CoffeeScript API documentation generator'>Codo</a>
v1.7.0
@@ -119,7 +119,7 @@
</div>
<div id='footer'>
Generated on
- Wed Nov 13 2013 00:43:52 GMT-0500 (EST)
+ Wed Nov 13 2013 09:33:09 GMT-0500 (EST)
by
<a href='https://github.com/netzpirat/codo' title='CoffeeScript API documentation generator'>Codo</a>
v1.7.0
@@ -119,7 +119,7 @@
</div>
<div id='footer'>
Generated on
- Wed Nov 13 2013 00:43:52 GMT-0500 (EST)
+ Wed Nov 13 2013 09:33:09 GMT-0500 (EST)
by
<a href='https://github.com/netzpirat/codo' title='CoffeeScript API documentation generator'>Codo</a>
v1.7.0
@@ -229,7 +229,7 @@
</div>
<div id='footer'>
Generated on
- Wed Nov 13 2013 00:43:52 GMT-0500 (EST)
+ Wed Nov 13 2013 09:33:09 GMT-0500 (EST)
by
<a href='https://github.com/netzpirat/codo' title='CoffeeScript API documentation generator'>Codo</a>
v1.7.0
@@ -119,7 +119,7 @@
</div>
<div id='footer'>
Generated on
- Wed Nov 13 2013 00:43:52 GMT-0500 (EST)
+ Wed Nov 13 2013 09:33:09 GMT-0500 (EST)
by
<a href='https://github.com/netzpirat/codo' title='CoffeeScript API documentation generator'>Codo</a>
v1.7.0
@@ -119,7 +119,7 @@
</div>
<div id='footer'>
Generated on
- Wed Nov 13 2013 00:43:52 GMT-0500 (EST)
+ Wed Nov 13 2013 09:33:09 GMT-0500 (EST)
by
<a href='https://github.com/netzpirat/codo' title='CoffeeScript API documentation generator'>Codo</a>
v1.7.0
@@ -119,7 +119,7 @@
</div>
<div id='footer'>
Generated on
- Wed Nov 13 2013 00:43:52 GMT-0500 (EST)
+ Wed Nov 13 2013 09:33:09 GMT-0500 (EST)
by
<a href='https://github.com/netzpirat/codo' title='CoffeeScript API documentation generator'>Codo</a>
v1.7.0
@@ -119,7 +119,7 @@
</div>
<div id='footer'>
Generated on
- Wed Nov 13 2013 00:43:52 GMT-0500 (EST)
+ Wed Nov 13 2013 09:33:09 GMT-0500 (EST)
by
<a href='https://github.com/netzpirat/codo' title='CoffeeScript API documentation generator'>Codo</a>
v1.7.0
@@ -119,7 +119,7 @@
</div>
<div id='footer'>
Generated on
- Wed Nov 13 2013 00:43:52 GMT-0500 (EST)
+ Wed Nov 13 2013 09:33:09 GMT-0500 (EST)
by
<a href='https://github.com/netzpirat/codo' title='CoffeeScript API documentation generator'>Codo</a>
v1.7.0
@@ -146,7 +146,7 @@
</div>
<div id='footer'>
Generated on
- Wed Nov 13 2013 00:43:52 GMT-0500 (EST)
+ Wed Nov 13 2013 09:33:09 GMT-0500 (EST)
by
<a href='https://github.com/netzpirat/codo' title='CoffeeScript API documentation generator'>Codo</a>
v1.7.0
View
@@ -927,6 +927,12 @@
Calculate.bezier = function(start, ctrl1, ctrl2, end, lowBound, highBound) {
var bezier, clamp, controlPoints, endX, i, j, lerp, next, prev, t, _i, _j, _ref;
+ if (lowBound == null) {
+ lowBound = 0;
+ }
+ if (highBound == null) {
+ highBound = 255;
+ }
if (start[0] instanceof Array) {
controlPoints = start;
lowBound = ctrl1;
@@ -74,7 +74,9 @@ r=new RegExp(INST_REGEX);_results=[];for(_i=0,_len=unparsedInstructions.length;_
return _results;};CamanParser.prototype.execute=function(){var ele;ele=this.ele;return this.caman.render(function(){return ele.parentNode.replaceChild(this.toImage(),ele);});};return CamanParser;})();Caman.Blender=(function(){function Blender(){}
Blender.blenders={};Blender.register=function(name,func){return this.blenders[name]=func;};Blender.execute=function(name,rgbaLayer,rgbaParent){return this.blenders[name](rgbaLayer,rgbaParent);};return Blender;})();Blender=Caman.Blender;Caman.Calculate=(function(){function Calculate(){}
Calculate.distance=function(x1,y1,x2,y2){return Math.sqrt(Math.pow(x2-x1,2)+Math.pow(y2-y1,2));};Calculate.randomRange=function(min,max,getFloat){var rand;if(getFloat==null){getFloat=false;}
-rand=min+(Math.random()*(max-min));if(getFloat){return rand.toFixed(getFloat);}else{return Math.round(rand);}};Calculate.luminance=function(rgba){return(0.299*rgba.r)+(0.587*rgba.g)+(0.114*rgba.b);};Calculate.bezier=function(start,ctrl1,ctrl2,end,lowBound,highBound){var bezier,clamp,controlPoints,endX,i,j,lerp,next,prev,t,_i,_j,_ref;if(start[0]instanceof Array){controlPoints=start;lowBound=ctrl1;highBound=ctrl2;}else{controlPoints=[start,ctrl1,ctrl2,end];}
+rand=min+(Math.random()*(max-min));if(getFloat){return rand.toFixed(getFloat);}else{return Math.round(rand);}};Calculate.luminance=function(rgba){return(0.299*rgba.r)+(0.587*rgba.g)+(0.114*rgba.b);};Calculate.bezier=function(start,ctrl1,ctrl2,end,lowBound,highBound){var bezier,clamp,controlPoints,endX,i,j,lerp,next,prev,t,_i,_j,_ref;if(lowBound==null){lowBound=0;}
+if(highBound==null){highBound=255;}
+if(start[0]instanceof Array){controlPoints=start;lowBound=ctrl1;highBound=ctrl2;}else{controlPoints=[start,ctrl1,ctrl2,end];}
if(controlPoints.length<2){throw"Invalid number of arguments to bezier";}
bezier={};lerp=function(a,b,t){return a*(1-t)+b*t;};clamp=function(a,min,max){return Math.min(Math.max(a,min),max);};for(i=_i=0;_i<1000;i=++_i){t=i/1000;prev=controlPoints;while(prev.length>1){next=[];for(j=_j=0,_ref=prev.length-2;0<=_ref?_j<=_ref:_j>=_ref;j=0<=_ref?++_j:--_j){next.push([lerp(prev[j][0],prev[j+1][0],t),lerp(prev[j][1],prev[j+1][1],t)]);}
prev=next;}
Oops, something went wrong.
View
@@ -927,6 +927,12 @@
Calculate.bezier = function(start, ctrl1, ctrl2, end, lowBound, highBound) {
var bezier, clamp, controlPoints, endX, i, j, lerp, next, prev, t, _i, _j, _ref;
+ if (lowBound == null) {
+ lowBound = 0;
+ }
+ if (highBound == null) {
+ highBound = 255;
+ }
if (start[0] instanceof Array) {
controlPoints = start;
lowBound = ctrl1;
View
@@ -74,7 +74,9 @@ r=new RegExp(INST_REGEX);_results=[];for(_i=0,_len=unparsedInstructions.length;_
return _results;};CamanParser.prototype.execute=function(){var ele;ele=this.ele;return this.caman.render(function(){return ele.parentNode.replaceChild(this.toImage(),ele);});};return CamanParser;})();Caman.Blender=(function(){function Blender(){}
Blender.blenders={};Blender.register=function(name,func){return this.blenders[name]=func;};Blender.execute=function(name,rgbaLayer,rgbaParent){return this.blenders[name](rgbaLayer,rgbaParent);};return Blender;})();Blender=Caman.Blender;Caman.Calculate=(function(){function Calculate(){}
Calculate.distance=function(x1,y1,x2,y2){return Math.sqrt(Math.pow(x2-x1,2)+Math.pow(y2-y1,2));};Calculate.randomRange=function(min,max,getFloat){var rand;if(getFloat==null){getFloat=false;}
-rand=min+(Math.random()*(max-min));if(getFloat){return rand.toFixed(getFloat);}else{return Math.round(rand);}};Calculate.luminance=function(rgba){return(0.299*rgba.r)+(0.587*rgba.g)+(0.114*rgba.b);};Calculate.bezier=function(start,ctrl1,ctrl2,end,lowBound,highBound){var bezier,clamp,controlPoints,endX,i,j,lerp,next,prev,t,_i,_j,_ref;if(start[0]instanceof Array){controlPoints=start;lowBound=ctrl1;highBound=ctrl2;}else{controlPoints=[start,ctrl1,ctrl2,end];}
+rand=min+(Math.random()*(max-min));if(getFloat){return rand.toFixed(getFloat);}else{return Math.round(rand);}};Calculate.luminance=function(rgba){return(0.299*rgba.r)+(0.587*rgba.g)+(0.114*rgba.b);};Calculate.bezier=function(start,ctrl1,ctrl2,end,lowBound,highBound){var bezier,clamp,controlPoints,endX,i,j,lerp,next,prev,t,_i,_j,_ref;if(lowBound==null){lowBound=0;}
+if(highBound==null){highBound=255;}
+if(start[0]instanceof Array){controlPoints=start;lowBound=ctrl1;highBound=ctrl2;}else{controlPoints=[start,ctrl1,ctrl2,end];}
if(controlPoints.length<2){throw"Invalid number of arguments to bezier";}
bezier={};lerp=function(a,b,t){return a*(1-t)+b*t;};clamp=function(a,min,max){return Math.min(Math.max(a,min),max);};for(i=_i=0;_i<1000;i=++_i){t=i/1000;prev=controlPoints;while(prev.length>1){next=[];for(j=_j=0,_ref=prev.length-2;0<=_ref?_j<=_ref:_j>=_ref;j=0<=_ref?++_j:--_j){next.push([lerp(prev[j][0],prev[j+1][0],t),lerp(prev[j][1],prev[j+1][1],t)]);}
prev=next;}
View
Oops, something went wrong.
View
@@ -275,7 +275,7 @@
</div>
- <div class="content"><div class='highlight'><pre> <span class="property">@bezier</span>: (start, ctrl1, ctrl2, end, lowBound, highBound) -&gt;</pre></div></div>
+ <div class="content"><div class='highlight'><pre> <span class="property">@bezier</span>: (start, ctrl1, ctrl2, end, lowBound = <span class="number">0</span>, highBound = <span class="number">255</span>) -&gt;</pre></div></div>
</li>
@@ -3,7 +3,7 @@ Caman.DEBUG = true
Caman.allowRevert = false
Caman __dirname + "/../images/test1_1280.jpg", ->
- @hemingway()
+ @lomo()
start = (new Date()).getTime()
@render ->
Oops, something went wrong.

0 comments on commit 222940e

Please sign in to comment.