Explorar el Código

radically improved speed

master
Victor Giers hace 3 años
padre
commit
fd485ba6a8
Se han modificado 1 ficheros con 7 adiciones y 26 borrados
  1. 7
    26
      scancropper2.pde

+ 7
- 26
scancropper2.pde Ver fichero

@@ -6,12 +6,14 @@ int imageNo = 0;
int imageAmount;
String[] imagePaths;
PImage[] images;
PImage imageThumb;
boolean imageLoaded;
String folderURI;

void setup() {
size(240, 100);
frameRate(30);
noSmooth;
drop = new SDrop(this);
surface.setResizable(true);
bounder = new Bounder();
@@ -24,7 +26,8 @@ void draw() {

if (imageLoaded) {
if (images[imageNo] != null) {
image(images[imageNo], 0, 0, width, height);
// image(images[imageNo], 0, 0, width, height);
image(imageThumb, 0, 0, width, height);
}
}

@@ -67,8 +70,9 @@ void mousePressed() {
}

void setImage(int i) {
imageLoaded = false; //seperate threat not present ladida
images[i] = loadImage(imagePaths[imageNo]);
imageThumb = images[i].get();
imageThumb.resize(images[i].width/7, images[i].height/7);
imageLoaded = true;
}

@@ -93,32 +97,9 @@ void dropEvent(DropEvent theDropEvent) {
imagePaths = new String[imageAmount];
imagePaths = imgs.toArray(imagePaths);
imagePaths = sort(imagePaths);
/*
for (int i = 0; i < imageAmount; i++) {
imagePaths[i] = droppedFiles[i].toString();
}
*/
images = new PImage[imageAmount];
setImage(imageNo);
/*
imageAmount = droppedFiles.length-1; // assuming all files in folder are images
images = new PImage[imageAmount];
imageList = new String[imageAmount];
for (int i = 0; i < imageAmount; i++) {
imageList[i] = droppedFiles[i].toString();
}
imageList = sort(imageList);
setImage(imageNo);
*/
/*for (int i = 0; i < imageAmount; i++) {
images[i] = loadImage(droppedFiles[i].toString());
println("hi");
} // braucht zu lang die scheisse */

}
}
}

Cargando…
Cancelar
Guardar