documented Filters namespace, filters, and Transform class, and cleaned up jsdoc warnings

This commit is contained in:
Eric Rowell 2012-11-11 17:08:16 -08:00
parent 753971247d
commit a30d6730fe
8 changed files with 25 additions and 14 deletions

View File

@ -25,7 +25,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* @namespace
*/
var Kinetic = {};
/**
* @namespace
*/
Kinetic.Filters = {};
Kinetic.Plugins = {};
Kinetic.Global = {

View File

@ -245,7 +245,7 @@ Kinetic.Node.prototype = {
* determine if node is listening or not. Node is listening only
* if it's listening and all of its ancestors are listening. If an ancestor
* is not listening, this means that the node is also not listening
* @name getVisible
* @name getListening
* @methodOf Kinetic.Node.prototype
*/
getListening: function() {
@ -1166,10 +1166,4 @@ Kinetic.Node.prototype.isVisible = Kinetic.Node.prototype.getVisible;
* get offset
* @name getOffset
* @methodOf Kinetic.Node.prototype
*/
/**
* determine if listening to events or not
* @name getListening
* @methodOf Kinetic.Node.prototype
*/

View File

@ -1,7 +1,8 @@
/**
* Brighten Filter
* @function Brighten
* @methodOf Kinetic.Filters
* @function
* @memberOf Kinetic.Filters
* @param {Object} imageData
* @param {Object} config
* @param {Integer} config.val brightness number from -255 to 255.  Positive values increase the brightness and negative values decrease the brightness, making the image darker
*/

View File

@ -1,7 +1,9 @@
/**
* Grayscale Filter
* @function Grayscale
* @methodOf Kinetic.Filters
* @function
* @memberOf Kinetic.Filters
* @param {Object} imageData
* @param {Object} config
*/
Kinetic.Filters.Grayscale = function(imageData, config) {
var data = imageData.data;

View File

@ -1,7 +1,9 @@
/**
* Invert Filter
* @function Invert
* @methodOf Kinetic.Filters
* @function
* @memberOf Kinetic.Filters
* @param {Object} imageData
* @param {Object} config
*/
Kinetic.Filters.Invert = function(imageData, config) {
var data = imageData.data;

View File

@ -35,7 +35,7 @@ Kinetic.Polygon.prototype = {
/**
* set points array
* @name setPoints
* @methodOf Kinetic.Line.prototype
* @methodOf Kinetic.Polygon.prototype
* @param {Array} can be an array of point objects or an array
* of Numbers. e.g. [{x:1,y:2},{x:3,y:4}] or [1,2,3,4]
*/

View File

@ -14,6 +14,10 @@
* class.
*/
/**
* Transform constructor
* @constructor
*/
Kinetic.Transform = function() {
this.m = [1, 0, 0, 1, 0, 0];
}

View File

@ -222,6 +222,7 @@ Kinetic.Type = {
// if arg is a string, then it's a data url
else if(this._isString(arg)) {
var imageObj = new Image();
/** @ignore */
imageObj.onload = function() {
callback(imageObj);
}
@ -237,6 +238,7 @@ Kinetic.Type = {
context.putImageData(arg, 0, 0);
var dataUrl = canvas.toDataURL();
var imageObj = new Image();
/** @ignore */
imageObj.onload = function() {
callback(imageObj);
}