Filippa Massa - Tarea 9 - 2012

De Casiopea
Filippa Massa - Tarea 9 - 2012


TítuloFilippa Massa - Tarea 9 - 2012
Tipo de ProyectoProyecto de Curso
Palabras Clavetarea 9
Período2012-
AsignaturaImagen Escrita 2012,
Del CursoImagen Escrita 2012,
CarrerasArquitectura
Alumno(s)Filippa Massa
ProfesorHerbert Spencer

import processing.pdf.*;

PImage lagotodoslossantos; PFont font; String[] code;

float a = 10; float b = 10; float d = 10; float e = 10; float escala;

void setup() {

 lagotodoslossantos = loadImage("lagotodoslossantos.jpg");  
 size(609, 765, PDF, "lagotodoslossantos.pdf"); 


 float ancho = width + (b - e);
 escala = ancho/(float)lagotodoslossantos.width;
 noStroke();
 noLoop(); 
 background(255);
 font = createFont("Courier", 9);
 textFont(font, 9);
 code = loadStrings("pincel.pde");

}


void draw() {

 float spacer = 2.5;


 for (int y = 0; y <lagotodoslossantos.width; y += spacer) {
   for (int x = 0; x < lagotodoslossantos.height; x += spacer) {
     float plotX = map(x, 0, lagotodoslossantos.width, b, width -a);
     float plotY = map(y, 0, lagotodoslossantos.height, b, a + (lagotodoslossantos.height * escala));
     color c =lagotodoslossantos.get(x, y);
     trazo(plotX, plotY, c, spacer);
   }
 }
 printCode();
 println("PDF terminado");
 exit();

}

void printCode() {

 float interlinea = 1;

 interlinea += 1;

}


/**** pincel ****/

void trazo(float x, float y, color c, float amp) {

 fill(c);
int puntos = round(random(1));
 for(int i = 0; i <= puntos; i++){
   float a = hue(c) + random(10);       
   float e = saturation(c) + random(2);
   float b = brightness(c) + random(10);
   float k = alpha (c) + random (1);
      pushMatrix();
   line(x,y,x+random(10),y+random(-2,10)); 
   stroke(a,e,b,k);
   popMatrix();
 }

}