From 18adef9924be0b6f95b0236cfa3e32cf20abbd6d Mon Sep 17 00:00:00 2001 From: Olaf Val Date: Sun, 15 Apr 2018 22:49:28 +0200 Subject: [PATCH] Delete sketch_001.js --- sketch_001.js | 156 -------------------------------------------------- 1 file changed, 156 deletions(-) delete mode 100644 sketch_001.js diff --git a/sketch_001.js b/sketch_001.js deleted file mode 100644 index 512635c..0000000 --- a/sketch_001.js +++ /dev/null @@ -1,156 +0,0 @@ -// Button Example - -var mouseUp = 1; -var bFunction = -1; -var frame = 0; -var icon; - -var scan = 0; -var l = 0; // Lines for var -var c = 0; // Columns for var -var t = 0; // scann Thickness for var -var st = 3; // Scann Thickness -var w = 0; -var h = 0; -var oldPixels = []; -var once = 0; - -function setup() { - pixelDensity(1); - // landscape mode only! - if(windowWidth > windowHeight){ - createCanvas(windowWidth, windowHeight); - }else{ - createCanvas(windowWidth, windowWidth* 0.56); - } - w = width; - h = height; - - capture = createCapture(VIDEO); - capture.size(width, height); - capture.hide(); -} - -function draw() { - p5ButtonSetup(); - - background(255); - - textSize(14); - textAlign(LEFT); - text("Frame " + frame, 5, 20); - - if(frame == 0){ - // start screen - imageMode(CENTER); - image(icon, width/2, height/5, 200, 200); - p5Button(width/2, height/ 5*3, 180, 40, 24, "New Scan", 1); - p5Button(width/2, height/ 5*4, 180, 40, 24, "About", 2); - } - - if(frame == 1){ - // start Capture - imageMode(CORNER); - image(capture, 0, 0, width, height); - p5Button(width/2, height/ 5*4, 180, 40, 24, "Start", 4); - scan = 0; - - loadPixels(); - for(l=0; l<(width*height*4); l++){ - oldPixels[l] = pixels[l]; - } - } - - if(frame == 2){ - // precessing Capture ----------------------- * * * * * * * * * - pixelDensity(1); - imageMode(CORNER); - image(capture, 0, 0, width, height); - - if(once == 0){ - //once = 1; - loadPixels(); - for(c=0; c= width) { - frame = 5; - } - } - - if(frame == 5){ - // Save Menue - p5Button(width/2, height/ 5, 180, 40, 24, "Save", 0); - p5Button(width/2, height/ 5*2, 180, 40, 24, "New Scan", 1); - p5Button(width/2, height/ 5*3, 180, 40, 24, "About", 2); - p5Button(width/2, height/ 5*4, 180, 40, 24, "Quit", 3); - } -} - -function p5ButtonSetup(){ - if(!mouseIsPressed){ - mouseUp = 0; - } -} - -// x, y, width, width, textSize, text, p5ButtonFunction-Number (starts with 0) -function p5Button(bx, by, bw, bh, bts, bt, bN){ - - if(mouseIsPressed){ - - if ( (mouseX>bx-bw/2)&&(mouseXby-bh/2)&&(mouseY