You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
536 B
30 lines
536 B
14 years ago
|
|
||
|
/*!
|
||
|
* Canvas - PixelArray
|
||
|
* Copyright (c) 2010 LearnBoost <tj@learnboost.com>
|
||
|
* MIT Licensed
|
||
|
*/
|
||
|
|
||
|
/**
|
||
|
* Module dependencies.
|
||
|
*/
|
||
|
|
||
|
var Canvas = require('../build/default/canvas')
|
||
|
, PixelArray = Canvas.CanvasPixelArray;
|
||
|
|
||
|
/**
|
||
|
* Custom inspect.
|
||
|
*/
|
||
|
|
||
|
PixelArray.prototype.inspect = function(){
|
||
|
var buf = '[PixelArray ';
|
||
|
for (var i = 0, len = this.length; i < len; ++i) {
|
||
|
buf += '\n ' + i + ': rgba('
|
||
|
+ this[i++] + ','
|
||
|
+ this[i++] + ','
|
||
|
+ this[i++] + ','
|
||
|
+ this[i] + ')';
|
||
|
}
|
||
|
return buf + '\n]';
|
||
|
};
|