Permalink
Browse files

cleaned up some cruft

  • Loading branch information...
1 parent 24e74c4 commit e55163c07999046ea2ff4d8ca223eb7b5eebd355 @goddamnbugs committed May 7, 2011
Showing with 7 additions and 36 deletions.
  1. +1 −0 README
  2. +0 −33 { → lib}/node-nude.js
  3. 0 { → lib}/worker.js
  4. +3 −0 package.json
  5. +3 −3 tests/test.nude.js
View
1 README
@@ -14,6 +14,7 @@ node tests/test.nude.js (ANNNNND wait a long time...it's on my list of things to
Giants With Sore Shoulders
Peter Griess' node-webworker (https://github.com/pgriess/node-webworker)
LearnBoost's node-canvas (https://github.com/LearnBoost/node-canvas)
+
Contact
I'd very much like to thank Patrick for his original implementation.
Steve
@@ -35,7 +35,6 @@ nude.prototype.scan = function(callback){
// get the image data
var image = this.ctx.getImageData(0, 0, this.canvas.width, this.canvas.height),
imageData = image.data;
-console.log('going to scan image');
var myWorker = new Worker(path.join(__dirname, 'worker.js')),
message = [imageData, this.canvas.width, this.canvas.height];
myWorker.postMessage(message);
@@ -44,36 +43,4 @@ console.log('going to scan image');
myWorker.terminate();
}
};
- // colorizeRegions function is for testdevelopment only
- // the detected skinRegions will be painted in random colors (one color per region)
-nude.prototype.colorizeRegions = function(){
-
- var length = skinRegions.length;
- for(var i = 0; i < length; i++){
-
- var region = skinRegions[i],
- regionLength = region.length,
- randR = Math.ceil(Math.random()*255),
- randG = Math.ceil(Math.random()*255),
- rangB = Math.ceil(Math.random()*255);
-
- for(var o = 0; o < regionLength; o++){
-
- var pixel = this.ctx.getImageData(region[o].x, region[o].y, 1,1),
- pdata = pixel.data;
-
- pdata[0] = randR;
- pdata[1] = randG;
- pdata[2] = rangB;
-
- pixel.data = pdata;
-
- this.ctx.putImageData(pixel, region[o].x, region[o].y);
-
- }
-
- }
-
- };
-
exports.nude = nude;
File renamed without changes.
View
@@ -5,6 +5,9 @@
"homepage" : "http://goddamnbugs.com/",
"author" : "Steve <steve@goddamnbugs.com> (http://goddamnbugs.com/)",
"engines": { "node": ">= 0.4.7" },
+ "directories": {
+ "lib": "./lib/node-nude"
+ },
"repository" : {
"type" : "git",
"url" : "https://github.com/goddamnbugs/node-nude.git"
View
@@ -5,7 +5,7 @@
var Canvas = require('canvas')
, Image = Canvas.Image
, fs = require('fs')
- , nude = new (require('../node-nude')).nude();
+ , nude = new (require('../lib/node-nude')).nude();
var img = new Image
, start = new Date;
@@ -15,8 +15,8 @@ img.onerror = function(err){
};
img.onload = function(){
- var width = img.width / 2
- , height = img.height / 2
+ var width = img.width
+ , height = img.height
, canvas = new Canvas(width, height)
, ctx = canvas.getContext('2d');
console.log(img);

0 comments on commit e55163c

Please sign in to comment.