Hola mundo III

Mi tercera tarea
PImage Ave;

void setup()
{
  size(2444,3200);
  Ave=loadImage("Ave.png");
}

void draw()
{
  loadPixels();
  Ave.loadPixels();
  for(int x=0;x<width;x++)
  {
    for(int y=0;y<height;y++)
    {
      int loc= x+y*width;
     
      float r=red(Ave.pixels[loc]);
      float g=green(Ave.pixels[loc]);
      float b=blue(Ave.pixels[loc]);
      pixels[loc]=color(mouseX,r,b);   
 
  /*
  float brillo=brightness(Ave.pixels[loc]);
  if (brillo>mouseX)
  {
    pixels[loc]=color(155);
  }
  else
  {
    pixels[loc]=color(100);
  }
  */
  }
  }
 
updatePixels();
}



Y parte de ella
PImage pejic2;
float offset = 10;
float easing = 0.010;

void setup() {
  size(800, 475);
  pejic2 = loadImage("pejic2.png"); 
}

void draw() {
  image(pejic2, 10, 10);
  float dx = (mouseX-pejic2.width/2) - offset;
  offset += dx * easing;
  tint(200, 100);
  image(pejic2, offset, 0);
}

Comentarios