We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
booleans array (Read 526 times)
booleans array
Jan 6th, 2007, 1:16am
 
Hi every body, ir really need your hel, i was worhing with the 0115 Beta version of processing but i get the latest version and this code does not work in this, in the new one. how can i make it work?
HERE IS THE CODE   you need an image named: linean.gif







PImage silueta;
int ancho = 640;
int alto = 480;
boolean[] siluetabool = new boolean[ancho*alto];

void setup(){
 size(ancho,alto,P3D);
 silueta = loadImage("linean.gif");
 bitmapabool();
}

void draw(){
 loadPixels();
 for (int i=0;i<ancho*alto;i++){
   pixels[i] = color(0,10,int(siluetabool[i])*100);
 }
 updatePixels();
}


void bitmapabool(){
 for (int i=0;i<ancho*alto;i++){
   siluetabool[i]=!boolean(silueta.pixels[i] >> 16 & 0xFF);      
 }
}


thank you all!
Re: booleans array
Reply #1 - Jan 6th, 2007, 5:47am
 
I think only the String and String[] args currently work with boolean().
The other overloaded versions seem to be commented out in the source.
Ben is this correct?
Re: booleans array
Reply #2 - Jan 6th, 2007, 2:44pm
 
just do this instead then:
!((silueta.pixels[i] >> 16 & 0xFF) != 0 );
or
(silueta.pixels[i] >> 16 & 0xFF) == 0;

F
Re: booleans array
Reply #3 - Jan 6th, 2007, 4:31pm
 
yep, it's been removed. boolean of an int seemed excessive, when you can just use != 0 or == 0 to do the same thing.
Page Index Toggle Pages: 1