@version:
- release: "4.1.1"
- date: "4/8/2013"
diff --git a/api/LICENSE.html b/api/LICENSE.html index da11e826..1491712e 100644 --- a/api/LICENSE.html +++ b/api/LICENSE.html @@ -129,7 +129,7 @@
Tests for CamanJS run both in NodeJS and the browser.
Initialization function for NodeJS.
+ - (void) nodeFileReady(err, data) + (bound) +
+E-P){C.g=E}T B(C.g
E-P){C.b=E}T B(C.b
0){C.r+=(E-C.r)*1G.3b}T{C.r-=C.r*O.4D(1G.3b)}}B(1G.4x!=L){B(1G.4x>0){C.g+=(E-C.g)*1G.4x}T{C.g-=C.g*O.4D(1G.4x)}}B(1G.3M!=L){B(1G.3M>0){C.b+=(E-C.b)*1G.3M}T{C.b-=C.b*O.4D(1G.3M)}}u C})});Q.S("2b",A(){M 1R,3P,3K,3F,3H,1v,i,1L,I,1o,K,2T;3P=1n[0],3K=2<=1n.V?5E.1y(1n,1):[];B(1w 3P==="3D"){3P=3P.e4("")}B(3P[0]==="v"){3P=[\'r\',\'g\',\'b\']}B(3K.V<3||3K.V>4){34"7T aY e3 1n 48 2b 1D";}1L=3K[0];3F=3K[1];3H=3K.V===4?3K[2]:3K[1];1v=3K[3K.V-1];1R=2S.1R(1L,3F,3H,1v,0,E);B(1L[0]>0){Y(i=I=0,K=1L[0];0<=K?I 35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(A(){M $,4K,2h,2L,D,4R,41,1W,2P,6y,Q,2I,5w,34,1Y,3K,1X,2s,1N,7K,2X,1w,fs,7J,4V,8L,6h=[].ew||A(a1){X(M i=0,l=o.T;i E-P){C.g=E}S B(C.g E-P){C.b=E}S B(C.b 0){C.r+=(E-C.r)*1K.3d}S{C.r-=C.r*O.4z(1K.3d)}}B(1K.4M!=L){B(1K.4M>0){C.g+=(E-C.g)*1K.4M}S{C.g-=C.g*O.4z(1K.4M)}}B(1K.3N!=L){B(1K.3N>0){C.b+=(E-C.b)*1K.3N}S{C.b-=C.b*O.4z(1K.3N)}}u C})});Q.V("2a",A(){M 1T,3Z,3D,3H,3I,1v,i,1L,I,1n,K,2R;3Z=1o[0],3D=2<=1o.T?5P.1z(1o,1):[];B(1x 3Z==="3F"){3Z=3Z.d7("")}B(3Z[0]==="v"){3Z=[\'r\',\'g\',\'b\']}B(3D.T<3||3D.T>4){38"7V b0 d6 1o 4m 2a 1D";}1L=3D[0];3H=3D[1];3I=3D.T===4?3D[2]:3D[1];1v=3D[3D.T-1];1T=2L.1T(1L,3H,3I,1v,0,E);B(1L[0]>0){X(i=I=0,K=1L[0];0<=K?I 35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(u(){J $,2A,1y,25,C,33,2M,1q,1N,47,V,1Q,3s,20,1n,29,1p,1V,1i,4S,1X,19,3t,4J,3k,3X=[].aZ||u(6i){U(J i=0,l=9.O;icaman.coffee
@version:
- release: "4.1.1"
- date: "4/8/2013"
initNode: ->
Log.debug "Initializing for NodeJS"
+ if typeof @initObj is "string"
+ fs.readFile @initObj, @nodeFileReady
+ else
+ @nodeFileReady null, @initObj
+
+ nodeFileReady: (err, data) =>
+ throw err if err
+
@image = new Image()
- @image.onload = =>
- Log.debug "Image loaded. Width = #{@imageWidth()}, Height = #{@imageHeight()}"
- @canvas = new Canvas @imageWidth(), @imageHeight()
- @finishInit()
+ @image.src = data
- @image.onerror = (err) -> throw err
- @image.src = @initObj