04.04.2013 Views

Processing: Creative Coding and Computational Art

Processing: Creative Coding and Computational Art

Processing: Creative Coding and Computational Art

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

* Tint (using bitwise operations)<br />

Created January 18, 2006<br />

updated December 4, 2006 */<br />

size(600, 400);<br />

PImage img = loadImage("changsha2.jpg");<br />

PImage img2 = createImage(img.width, img.height, RGB);<br />

// copy pixels array from img to img2<br />

arraycopy(img.pixels, img2.pixels);<br />

int r, g, b, a;<br />

int row = height/6;<br />

for(int i=0; i> 16 & 0xFF;<br />

g = img2.pixels[i] >> 8 & 0xFF;<br />

b = img2.pixels[i] & 0xFF;<br />

a = img2.pixels[i] >> 24 & 0xFF;<br />

// tint based on height in display window<br />

if (iwidth*row && iwidth*row*2 && iwidth*row*3 && iwidth*row*4 && i

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!