-
Notifications
You must be signed in to change notification settings - Fork 1
/
obelisk.min.js
8 lines (8 loc) · 20 KB
/
obelisk.min.js
1
2
3
4
5
6
7
8
/*!
* obelisk.js 1.0.2
* https://github.com/nosir/obelisk.js
* MIT licensed
*
* Copyright (C) 2012 Max Huang https://github.com/nosir/
*/
!function(a){"use strict";var b={};b.version="1.0.2",b.author="max huang",a.obelisk=b}(window),function(a){"use strict";var b,c;b=function(){this.initialize()},c=b.prototype,c.inner=null,c.border=null,c.borderHighlight=null,c.left=null,c.right=null,c.horizontal=null,c.leftSlope=null,c.rightSlope=null,c.initialize=function(){return this},c.toString=function(){return"[AbstractColor]"},a.AbstractColor=b}(obelisk),function(a){"use strict";var b,c;b=function(a,b,c,d,e){this.initialize(a,b,c,d,e)},c=b.prototype=new a.AbstractColor,c.BRIGHTNESS_GAIN=-20,c.initialize=function(b,c,d,e,f){return this.border=a.ColorGeom.get32(void 0===b?8882055:b),this.borderHighlight=a.ColorGeom.get32(void 0===c?16777215:c),this.left=a.ColorGeom.get32(void 0===d?13225936:d),this.right=a.ColorGeom.get32(void 0===e?14935011:e),this.horizontal=a.ColorGeom.get32(void 0===f?15658992:f),this},c.getByHorizontalColor=function(c){return new b(a.ColorGeom.applyBrightness(c,4*this.BRIGHTNESS_GAIN),a.ColorGeom.applyBrightness(c,0,!0),a.ColorGeom.applyBrightness(c,2*this.BRIGHTNESS_GAIN),a.ColorGeom.applyBrightness(c,this.BRIGHTNESS_GAIN),c)},c.toString=function(){return"[CubeColor]"},a.CubeColor=b}(obelisk),function(a){"use strict";var b,c;b=function(a,b,c,d){this.initialize(a,b,c,d)},c=b.prototype=new a.AbstractColor,c.BRIGHTNESS_GAIN=-20,c.initialize=function(b,c,d,e){return this.border=a.ColorGeom.get32(void 0===b?9737880:b),this.borderHighlight=a.ColorGeom.get32(void 0===c?16777215:c),this.left=a.ColorGeom.get32(void 0===d?15132905:d),this.right=a.ColorGeom.get32(void 0===e?15658992:e),this},c.getByRightColor=function(c){return new b(a.ColorGeom.applyBrightness(c,4*this.BRIGHTNESS_GAIN),a.ColorGeom.applyBrightness(c,0,!0),a.ColorGeom.applyBrightness(c,this.BRIGHTNESS_GAIN),c)},c.toString=function(){return"[PyramidColor]"},a.PyramidColor=b}(obelisk),function(a){"use strict";var b,c;b=function(a,b){this.initialize(a,b)},c=b.prototype=new a.AbstractColor,c.BRIGHTNESS_GAIN=-20,c.initialize=function(b,c){return this.border=a.ColorGeom.get32(void 0===b?8882055:b),this.inner=a.ColorGeom.get32(void 0===c?15658734:c),this},c.getByInnerColor=function(b){return new a.SideColor(a.ColorGeom.applyBrightness(b,4*this.BRIGHTNESS_GAIN),b)},c.toString=function(){return"[SideColor]"},a.SideColor=b}(obelisk),function(a){"use strict";var b,c;b=function(){this.initialize()},c=b.prototype,c.xAxis=null,c.yAxis=null,c.zAxis=null,c.tall=!1,c.initialize=function(){return this},c.toString=function(){return"[AbstractDimension]"},a.AbstractDimension=b}(obelisk),function(a){"use strict";var b,c;b=function(a,b){this.initialize(a,b)},c=b.prototype=new a.AbstractDimension,c.initialize=function(a,b){if(this.xAxis=a||30,this.yAxis=b||30,1===this.xAxis%2||1===this.yAxis%2)throw new Error("x,yAxis must be even number");if(this.xAxis<=4||this.yAxis<=4)throw new Error("dimension is too small");return this},c.toString=function(){return"[BrickDimension]"},a.BrickDimension=b}(obelisk),function(a){"use strict";var b,c;b=function(a,b,c){this.initialize(a,b,c)},c=b.prototype=new a.AbstractDimension,c.initialize=function(a,b,c){if(this.xAxis=a||30,this.yAxis=b||30,this.zAxis=c||30,1===this.xAxis%2||1===this.yAxis%2)throw new Error("x,yAxis must be even number");if(this.xAxis<=4||this.yAxis<=4||this.zAxis<=2)throw new Error("dimension is too small");return this},c.toString=function(){return"[CubeDimension]"},a.CubeDimension=b}(obelisk),function(a){"use strict";var b,c;b=function(a,b){this.initialize(a,b)},c=b.prototype=new a.AbstractDimension,c.initialize=function(a,b){if(this.xAxis=a||30,this.yAxis=a||30,this.tall=b||!1,1===this.xAxis%2)throw new Error("axis must be even number");if(this.xAxis<=4)throw new Error("dimension is too small");return this},c.toString=function(){return"[PyramidDimension]"},a.PyramidDimension=b}(obelisk),function(a){"use strict";var b,c;b=function(a,b){this.initialize(a,b)},c=b.prototype=new a.AbstractDimension,c.initialize=function(a,b){if(this.xAxis=a||30,this.zAxis=b||30,1===this.xAxis%2)throw new Error("xAxis must be even number");if(this.xAxis<=4||this.zAxis<=2)throw new Error("dimension is too small");return this},c.toString=function(){return"[SideXDimension]"},a.SideXDimension=b}(obelisk),function(a){"use strict";var b,c;b=function(a,b){this.initialize(a,b)},c=b.prototype=new a.AbstractDimension,c.initialize=function(a,b){if(this.yAxis=a||30,this.zAxis=b||30,1===this.yAxis%2)throw new Error("yAxis must be even number");if(this.yAxis<=4||this.zAxis<=2)throw new Error("dimension is too small");return this},c.toString=function(){return"[SideYDimension]"},a.SideYDimension=b}(obelisk),function(a){"use strict";var b,c;b=function(a,b,c){this.initialize(a,b,c)},c=b.prototype,c.imageData=null,c.canvas=null,c.context=null,c.initialize=function(b,c,d){if(void 0===b||void 0===c)throw new Error("BitmapData width or height is missing");return this.canvas=d?a.CanvasManager.getDefaultCanvas():a.CanvasManager.getNewCanvas(),this.canvas.setAttribute("width",b),this.canvas.setAttribute("height",c),this.context=this.canvas.getContext("2d"),this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this.imageData=this.context.createImageData(b,c),this},c.setPixel=function(a,b,c){var d=4*(b*this.imageData.width+a);this.setPixelByIndex(d,c)},c.setPixelByIndex=function(a,b){var c=this.imageData.data;c[a]=255&b>>>16,c[a+1]=255&b>>>8,c[a+2]=255&b>>>0,c[a+3]=255&b>>>24},c.checkPixelAvailable=function(a,b){var c=4*(b*this.imageData.width+a);return 0===this.imageData.data[c+3]},c.floodFill=function(a,b,c){if(0!==(255&c>>>24)){var d,e,f,g,h,i=a,j=b,k=[],l=[],m=[],n=this.imageData.width,o=this.imageData.height;if(!(0>i||0>j||i>=n||j>=o)){if(!this.checkPixelAvailable(i,j))throw new Error("Start point for flood fill is already filled");for(d=i;d>=0;d-=1){for(e=j;e>=0;e-=1)if(this.checkPixelAvailable(d,e))k.push(4*(e*n+d)),l.push(e);else if(e!==j||!this.checkPixelAvailable(d+1,e-1))break;for(e=j;o>e;e+=1)if(this.checkPixelAvailable(d,e))k.push(4*(e*n+d)),l.push(e);else if(e!==j||!this.checkPixelAvailable(d+1,e+1))break;for(d===i&&(m=l.concat()),f=!1,g=0;g<m.length;g+=1){for(h=0;h<m.length;h+=1)if(l[h]===m[g]){f=!0,j=m[g];break}if(f)break}if(!f)break;m=l.concat(),l=[]}for(i=a,j=b,m=[],l=[],d=i;n>d;d+=1){for(e=j;e>=0;e-=1)if(this.checkPixelAvailable(d,e))k.push(4*(e*n+d)),l.push(e);else if(e!==j||!this.checkPixelAvailable(d-1,e-1))break;for(e=j;o>e;e+=1)if(this.checkPixelAvailable(d,e))k.push(4*(e*n+d)),l.push(e);else if(e!==j||!this.checkPixelAvailable(d-1,e+1))break;for(d===i&&(m=l.concat()),f=!1,g=0;g<m.length;g+=1){for(h=0;h<m.length;h+=1)if(l[h]===m[g]){f=!0,j=m[g];break}if(f)break}if(!f)break;m=l.concat(),l=[]}for(g=0;g<k.length;g+=1)this.setPixelByIndex(k[g],c)}}},c.toString=function(){return"[BitmapData]"},a.BitmapData=b}(obelisk),function(a){"use strict";var b,c;b=function(a,b){this.initialize(a,b)},c=b.prototype,c.x=null,c.y=null,c.canvas=null,c.initialize=function(b,c){if(!b)throw new Error("Primitive is not defined");var d=c||new a.Point3D;return this.canvas=b.canvas,this.x=b.matrix.tx+d.x-d.y,this.y=b.matrix.ty+Math.floor(d.x/2+d.y/2)-d.z,this},c.toString=function(){return"[PixelObject]"},a.PixelObject=b}(obelisk),function(a){"use strict";var b,c;b=function(a,b){this.initialize(a,b)},c=b.prototype,c.canvas=null,c.context=null,c.point=null,c.initialize=function(b,c){if(!b)throw new Error("Canvas is not defined");try{b instanceof jQuery&&(b=b.get(0))}catch(d){}return this.canvas=b,this.context=this.canvas.getContext("2d"),this.point=c||new a.Point(0,0),this},c.renderObject=function(b,c){var d=new a.PixelObject(b,c);this.context.drawImage(d.canvas,this.point.x+d.x,this.point.y+d.y)},c.clear=function(){this.context.clearRect(0,0,this.canvas.width,this.canvas.height)},c.toString=function(){return"[PixelView]"},a.PixelView=b}(obelisk),function(a){"use strict";var b,c;b=function(a,b,c,d,e,f){this.initialize(a,b,c,d,e,f)},c=b.prototype,c.a=1,c.b=0,c.c=0,c.d=1,c.tx=0,c.ty=0,c.initialize=function(a,b,c,d,e,f){return this.a=void 0===a?1:a,this.b=b||0,this.c=c||0,this.d=void 0===d?1:d,this.tx=e||0,this.ty=f||0,this},c.toString=function(){return"[Matrix]"},a.Matrix=b}(obelisk),function(a){"use strict";var b,c;b=function(a,b){this.initialize(a,b)},c=b.prototype,c.x=0,c.y=0,c.initialize=function(a,b){return this.x=void 0===a?0:a,this.y=void 0===b?0:b,this},c.toString=function(){return"[Point x : "+this.x+", y : "+this.y+"]"},a.Point=b}(obelisk),function(a){"use strict";var b,c;b=function(a,b,c){this.initialize(a,b,c)},c=b.prototype,c.x=0,c.y=0,c.z=0,c.initialize=function(a,b,c){return this.x=void 0===a?0:a,this.y=void 0===b?0:b,this.z=void 0===c?0:c,this},c.toString=function(){return"[Point3D x : "+this.x+", y : "+this.y+", z: "+this.z+"]"},a.Point3D=b}(obelisk),function(a){"use strict";var b,c;b=function(){this.initialize()},c=b.prototype,c.canvas=null,c.w=null,c.h=null,c.dimension=null,c.color=null,c.border=null,c.bitmapData=null,c.useDefaultCanvas=null,c.matrix=null,c.initialize=function(){return this},c.toString=function(){return"[AbstractPrimitive]"},a.AbstractPrimitive=b}(obelisk),function(a){"use strict";var b,c;b=function(a,b,c,d){this.initialize(a,b,c,d)},c=b.prototype=new a.AbstractPrimitive,c.initialize=function(a,b,c,d){return this.initRender(a,b,c,d),this.initRectangle(),this.initBitmapData(),this.build(),this.renderBitmapDataForCanvas(),this},c.initRender=function(b,c,d,e){this.useDefaultCanvas=e||!1,this.border=d||void 0===d,this.dimension=void 0===b?new a.BrickDimension:b,this.color=void 0===c?new a.SideColor:c},c.initRectangle=function(){this.w=this.dimension.xAxis+this.dimension.yAxis,this.h=(this.dimension.xAxis+this.dimension.yAxis)/2,this.w-=2,this.h-=1,this.matrix=new a.Matrix,this.matrix.tx=-this.dimension.yAxis+2,this.matrix.ty=0},c.initBitmapData=function(){this.bitmapData=new a.BitmapData(this.w,this.h,this.useDefaultCanvas)},c.renderBitmapDataForCanvas=function(){this.bitmapData.context.putImageData(this.bitmapData.imageData,0,0),this.canvas=this.bitmapData.canvas},c.build=function(){var a,b,c,d,e,f,g;for(a=this.dimension.yAxis-2,b=0,c=this.dimension.xAxis-1,d=this.h-1,g=this.border?this.color.border:this.color.inner,e=0;e<this.dimension.xAxis;e+=1)this.bitmapData.setPixel(a+e,b+Math.floor(e/2),g),this.bitmapData.setPixel(c-e,d-Math.floor(e/2),g);for(f=0;f<this.dimension.yAxis;f+=1)this.bitmapData.setPixel(a+1-f,b+Math.floor(f/2),g),this.bitmapData.setPixel(c-1+f,d-Math.floor(f/2),g);this.bitmapData.floodFill(Math.floor(this.w/2),Math.floor(this.h/2),this.color.inner)},c.toString=function(){return"[Brick]"},a.Brick=b}(obelisk),function(a){"use strict";var b,c;b=function(a,b,c,d){this.initialize(a,b,c,d)},c=b.prototype=new a.AbstractPrimitive,c.initialize=function(a,b,c,d){return this.initRender(a,b,c,d),this.initRectangle(),this.initBitmapData(),this.build(),this.renderBitmapDataForCanvas(),this},c.initRender=function(b,c,d,e){this.useDefaultCanvas=e||!1,this.border=d||void 0===d,this.dimension=void 0===b?new a.CubeDimension:b,this.color=void 0===c?new a.CubeColor:c},c.initRectangle=function(){this.w=this.dimension.xAxis+this.dimension.yAxis,this.h=this.dimension.zAxis+(this.dimension.xAxis+this.dimension.yAxis)/2,this.w-=2,this.h-=1,this.matrix=new a.Matrix,this.matrix.tx=-this.dimension.yAxis+2,this.matrix.ty=-this.dimension.zAxis},c.initBitmapData=function(){this.bitmapData=new a.BitmapData(this.w,this.h,this.useDefaultCanvas)},c.renderBitmapDataForCanvas=function(){this.canvas=this.bitmapData.canvas},c.build=function(){var b,c,d,e,f,g,h,i,j,k,l,m,n;if(b=new a.Brick(new a.BrickDimension(this.dimension.xAxis,this.dimension.yAxis),new a.SideColor(this.color.border,this.color.horizontal),this.border),c=new a.SideX(new a.SideXDimension(this.dimension.xAxis,this.dimension.zAxis),new a.SideColor(this.color.border,this.color.left),this.border),d=new a.SideY(new a.SideYDimension(this.dimension.yAxis,this.dimension.zAxis),new a.SideColor(this.color.border,this.color.right),this.border),e=new a.PixelObject(b),f=new a.PixelObject(c),g=new a.PixelObject(d),h=this.bitmapData.context,h.drawImage(e.canvas,e.x+this.dimension.yAxis-2,e.y),h.drawImage(f.canvas,f.x,f.y+this.dimension.zAxis+this.dimension.yAxis/2-1),h.drawImage(g.canvas,g.x+this.w-2,f.y+this.dimension.zAxis+this.dimension.xAxis/2-1),i=new a.BitmapData(this.w,this.h),this.border){for(j=this.dimension.xAxis-2,k=(this.dimension.xAxis+this.dimension.yAxis)/2-2,l=0;l<this.dimension.xAxis-2;l+=1)i.setPixel(j+1-l,k-Math.floor(l/2),this.color.borderHighlight);for(m=0;m<this.dimension.yAxis-2;m+=1)i.setPixel(j+m,k-Math.floor(m/2),this.color.borderHighlight);for(n=0;n<this.dimension.zAxis;n+=1)i.setPixel(j,k+n,this.color.borderHighlight)}else for(l=0;l<this.dimension.zAxis;l+=1)i.setPixel(this.dimension.xAxis-2,(this.dimension.xAxis+this.dimension.yAxis)/2-1+l,this.color.left);i.context.putImageData(i.imageData,0,0),h.drawImage(i.canvas,0,0)},c.toString=function(){return"[Cube]"},a.Cube=b}(obelisk),function(a){"use strict";var b,c;b=function(a,b,c,d){this.initialize(a,b,c,d)},c=b.prototype=new a.AbstractPrimitive,c.hSize=null,c.hOffset=null,c.initialize=function(a,b,c,d){return this.initRender(a,b,c,d),this.initRectangle(),this.initBitmapData(),this.build(),this.renderBitmapDataForCanvas(),this},c.initRender=function(b,c,d,e){this.useDefaultCanvas=e||!1,this.border=d||void 0===d,this.dimension=void 0===b?new a.PyramidDimension:b,this.color=void 0===c?new a.PyramidColor:c,this.hSize=this.dimension.tall?2*this.dimension.xAxis:this.dimension.xAxis,this.hOffset=this.dimension.tall?-3:-2},c.initRectangle=function(){this.w=this.dimension.xAxis+this.dimension.yAxis,this.h=this.hSize+this.dimension.xAxis/2,this.w-=2,this.h+=this.hOffset,this.matrix=new a.Matrix,this.matrix.tx=-this.dimension.xAxis+2,this.matrix.ty=-this.hSize/2+2-(this.dimension.tall?this.dimension.xAxis/2:1)},c.initBitmapData=function(){this.bitmapData=new a.BitmapData(this.w,this.h,this.useDefaultCanvas)},c.renderBitmapDataForCanvas=function(){this.bitmapData.context.putImageData(this.bitmapData.imageData,0,0),this.canvas=this.bitmapData.canvas},c.build=function(){var a,b,c,d,e,f,g,h,i,j;for(a=this.border?this.color.border:this.color.left,b=this.border?this.color.border:this.color.right,c=this.border?this.color.borderHighlight:a,f=0;f<this.hSize+this.dimension.xAxis/2-4;f+=1)this.bitmapData.setPixel(this.dimension.xAxis-2,f+3+this.hOffset,c);for(d=0;d<this.dimension.xAxis;d+=1)this.bitmapData.setPixel(d,this.hSize+Math.floor(d/2)+this.hOffset,a);for(e=0;e<this.dimension.xAxis;e+=1)this.bitmapData.setPixel(e+this.dimension.xAxis-2,this.hSize+this.dimension.xAxis/2-Math.floor(e/2)-1+this.hOffset,b);if(this.dimension.tall){for(i=0;i<this.hSize-2;i+=1)this.bitmapData.setPixel(Math.floor(i/2),this.hSize-i+this.hOffset,a);for(j=2;j<this.hSize;j+=1)this.bitmapData.setPixel(Math.floor(j/2)+this.dimension.xAxis-2,j+1+this.hOffset,b)}else{for(g=0;g<this.hSize;g+=1)this.bitmapData.setPixel(g,this.hSize-g+this.hOffset,a);for(h=0;h<this.hSize;h+=1)this.bitmapData.setPixel(h+this.hSize-2,h+1+this.hOffset,b)}this.border||this.bitmapData.setPixel(this.dimension.xAxis-2,this.hSize+this.dimension.xAxis/2-1+this.hOffset,a),this.bitmapData.floodFill(this.dimension.xAxis-1,this.hSize+Math.floor((this.dimension.xAxis-1)/2)+this.hOffset-1,this.color.right),this.bitmapData.floodFill(this.dimension.xAxis-3,this.hSize+Math.floor((this.dimension.xAxis-1)/2)+this.hOffset-2,this.color.left)},c.toString=function(){return"[Pyramid]"},a.Pyramid=b}(obelisk),function(a){"use strict";var b,c;b=function(a,b,c,d){this.initialize(a,b,c,d)},c=b.prototype=new a.AbstractPrimitive,c.initialize=function(a,b,c,d){return this.initRender(a,b,c,d),this.initRectangle(),this.initBitmapData(),this.build(),this.renderBitmapDataForCanvas(),this},c.initRender=function(b,c,d,e){this.useDefaultCanvas=e||!1,this.border=d||void 0===d,this.dimension=void 0===b?new a.SideXDimension:b,this.color=void 0===c?new a.SideColor:c},c.initRectangle=function(){this.w=this.dimension.xAxis,this.h=this.dimension.zAxis+this.dimension.xAxis/2,this.matrix=new a.Matrix,this.matrix.tx=0,this.matrix.ty=-this.dimension.zAxis},c.initBitmapData=function(){this.bitmapData=new a.BitmapData(this.w,this.h,this.useDefaultCanvas)},c.renderBitmapDataForCanvas=function(){this.bitmapData.context.putImageData(this.bitmapData.imageData,0,0),this.canvas=this.bitmapData.canvas},c.build=function(){var a,b,c,d,e,f,g;for(a=0,b=this.dimension.zAxis,c=this.dimension.xAxis-1,d=this.h-this.dimension.zAxis-1,g=this.border?this.color.border:this.color.inner,e=0;e<this.dimension.xAxis;e+=1)this.bitmapData.setPixel(a+e,b+Math.floor(e/2),g),this.bitmapData.setPixel(c-e,d-Math.floor(e/2),g);for(f=0;f<this.dimension.zAxis;f+=1)this.bitmapData.setPixel(a,b-f,g),this.bitmapData.setPixel(c,d+f,g);this.bitmapData.floodFill(Math.floor(this.w/2),Math.floor(this.h/2),this.color.inner)},c.toString=function(){return"[SideX]"},a.SideX=b}(obelisk),function(a){"use strict";var b,c;b=function(a,b,c,d){this.initialize(a,b,c,d)},c=b.prototype=new a.AbstractPrimitive,c.initialize=function(a,b,c,d){return this.initRender(a,b,c,d),this.initRectangle(),this.initBitmapData(),this.build(),this.renderBitmapDataForCanvas(),this},c.initRender=function(b,c,d,e){this.useDefaultCanvas=e||!1,this.border=d||void 0===d,this.dimension=void 0===b?new a.SideYDimension:b,this.color=void 0===c?new a.SideColor:c},c.initRectangle=function(){this.w=this.dimension.yAxis,this.h=this.dimension.zAxis+this.dimension.yAxis/2,this.matrix=new a.Matrix,this.matrix.tx=-this.dimension.yAxis+2,this.matrix.ty=-this.dimension.zAxis},c.initBitmapData=function(){this.bitmapData=new a.BitmapData(this.w,this.h,this.useDefaultCanvas)},c.renderBitmapDataForCanvas=function(){this.bitmapData.context.putImageData(this.bitmapData.imageData,0,0),this.canvas=this.bitmapData.canvas},c.build=function(){var a,b,c,d,e,f,g;for(a=0,b=this.h-this.dimension.zAxis-1,c=this.dimension.yAxis-1,d=this.dimension.zAxis,g=this.border?this.color.border:this.color.inner,e=0;e<this.dimension.yAxis;e+=1)this.bitmapData.setPixel(a+e,b-Math.floor(e/2),g),this.bitmapData.setPixel(c-e,d+Math.floor(e/2),g);for(f=0;f<this.dimension.zAxis;f+=1)this.bitmapData.setPixel(a,b+f,g),this.bitmapData.setPixel(c,d-f,g);this.bitmapData.floodFill(Math.floor(this.w/2),Math.floor(this.h/2),this.color.inner)},c.toString=function(){return"[SideY]"},a.SideY=b}(obelisk),function(a,b){"use strict";var c,d;c=function(){throw new Error("ColorGeom is a static Class, cannot be instanced.")},d=c,d.defaultCanvas=null,d.getDefaultCanvas=function(){return d.defaultCanvas=d.defaultCanvas||b.createElement("canvas"),d.defaultCanvas},d.getNewCanvas=function(){return b.createElement("canvas")},d.toString=function(){return"[CanvasManager]"},a.CanvasManager=c}(obelisk,document),function(a){"use strict";var b,c;b=function(){throw new Error("CanvasTool is a static Class, cannot be instanced.")},c=b,c.getPixel=function(a,b,c){var d,e,f,g,h;return d=a.data,e=4*(c*a.width+b),f=d[e],g=d[e+1],h=d[e+2],f<<16|g<<8|h},c.toString=function(){return"[CanvasTool]"},a.CanvasTool=b}(obelisk),function(a){"use strict";var b,c;b=function(){throw new Error("ColorGeom is a static Class, cannot be instanced.")},c=b,c.get32=function(a){return 4278190080>a?a+4278190080:a},c.applyBrightness=function(a,b,c){var d,e,f,g,h,i,j;return d=255&a>>>24,e=255&a>>>16,f=255&a>>>8,g=255&a,h=(313524*e>>20)+(615514*f>>20)+(119538*g>>20),j=-(155189*e>>20)-(303038*f>>20)+(458227*g>>20),i=(644874*e>>20)-(540016*f>>20)-(104857*g>>20),c?h=60+Math.pow(h,1.2):h+=b,e=h+(1195376*i>>20),f=h-(408944*j>>20)-(608174*i>>20),g=h+(2128609*j>>20),e=Math.max(0,Math.min(e,255)),f=Math.max(0,Math.min(f,255)),g=Math.max(0,Math.min(g,255)),d<<24|e<<16|f<<8|g},c.toString=function(){return"[ColorGeom]"},a.ColorGeom=b}(obelisk),function(a){"use strict";var b,c;b=function(){throw new Error("ColorGeom is a static Class, cannot be instanced.")},c=b,c.GRASS_GREEN=13434624,c.YELLOW=16776960,c.WINE_RED=16711833,c.PINK=16743615,c.PURPLE=13369599,c.BLUE=52479,c.GRAY=15658734,c.BLACK=6710886,c.FINE_COLORS=[c.GRASS_GREEN,c.YELLOW,c.WINE_RED,c.PINK,c.PURPLE,c.BLUE,c.GRAY,c.BLACK],c.getRandomComfortableColor=function(){return c.FINE_COLORS[Math.floor(Math.random()*c.FINE_COLORS.length)]},c.toString=function(){return"[ColorPattern]"},a.ColorPattern=b}(obelisk);