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 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE. * THE SOFTWARE.
*/ */
/**
* @namespace
*/
var Kinetic = {}; var Kinetic = {};
/**
* @namespace
*/
Kinetic.Filters = {}; Kinetic.Filters = {};
Kinetic.Plugins = {}; Kinetic.Plugins = {};
Kinetic.Global = { Kinetic.Global = {

View File

@@ -245,7 +245,7 @@ Kinetic.Node.prototype = {
* determine if node is listening or not. Node is listening only * 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 * 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 * is not listening, this means that the node is also not listening
* @name getVisible * @name getListening
* @methodOf Kinetic.Node.prototype * @methodOf Kinetic.Node.prototype
*/ */
getListening: function() { getListening: function() {
@@ -1167,9 +1167,3 @@ Kinetic.Node.prototype.isVisible = Kinetic.Node.prototype.getVisible;
* @name getOffset * @name getOffset
* @methodOf Kinetic.Node.prototype * @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 * Brighten Filter
* @function Brighten * @function
* @methodOf Kinetic.Filters * @memberOf Kinetic.Filters
* @param {Object} imageData
* @param {Object} config * @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 * @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 * Grayscale Filter
* @function Grayscale * @function
* @methodOf Kinetic.Filters * @memberOf Kinetic.Filters
* @param {Object} imageData
* @param {Object} config
*/ */
Kinetic.Filters.Grayscale = function(imageData, config) { Kinetic.Filters.Grayscale = function(imageData, config) {
var data = imageData.data; var data = imageData.data;

View File

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

View File

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

View File

@@ -14,6 +14,10 @@
* class. * class.
*/ */
/**
* Transform constructor
* @constructor
*/
Kinetic.Transform = function() { Kinetic.Transform = function() {
this.m = [1, 0, 0, 1, 0, 0]; 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 // if arg is a string, then it's a data url
else if(this._isString(arg)) { else if(this._isString(arg)) {
var imageObj = new Image(); var imageObj = new Image();
/** @ignore */
imageObj.onload = function() { imageObj.onload = function() {
callback(imageObj); callback(imageObj);
} }
@@ -237,6 +238,7 @@ Kinetic.Type = {
context.putImageData(arg, 0, 0); context.putImageData(arg, 0, 0);
var dataUrl = canvas.toDataURL(); var dataUrl = canvas.toDataURL();
var imageObj = new Image(); var imageObj = new Image();
/** @ignore */
imageObj.onload = function() { imageObj.onload = function() {
callback(imageObj); callback(imageObj);
} }