Camila herrera tarea 9 imagen arreglada

De Casiopea


Títulotarea 8.1 arreglada
Tipo de ProyectoProyecto de Curso
Palabras Clavetarea 8
AsignaturaImagen Escrita 2012,
Del CursoImagen Escrita 2012,
CarrerasArquitectura
Alumno(s)Camilaherrera
ProfesorHerbert Spencer

import processing.pdf.*;

PImage fotoimagenescrita; PFont font; String[] code;

float a = 20; float l = 15; float e = 15; float i = 20; float escala;

void setup() {

fotoimagenescrita = loadImage("fotoimagenescrita.jpg");  
size(609, 765, PDF, "foto.pdf"); 
float ancho = width + (e + a);
escala = ancho/(float)fotoimagenescrita.width;
noStroke();
noLoop(); 
background(255);
font = createFont("Courier", 8);
textFont(font, 8);
code = loadStrings("trazo.pde");

}


void draw() {

float spacer = 5;
for (int y = 1; y <fotoimagenescrita.height; y += spacer) {
  for (int x = 0; x < fotoimagenescrita.width; x += spacer) {
    float plotX = map(x, 0, fotoimagenescrita.width, a, width -i);
    float plotY = map(y, 0, fotoimagenescrita.height, e, l + (fotoimagenescrita.height * escala));
    color c = fotoimagenescrita.get(x, y);
    trazo(plotX, plotY, c, spacer);
  }
}
printCode();
println("-----> PDF");
exit();

}

void printCode() {

float interlinea = 1;
interlinea += 10;

}


___________________________ trazo_____________________________


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

fill(c);
      rect(x, y, map(brightness(c), 0, 255, amp, 0), 
  map(brightness(c), 0, 255, amp, 0));

}