Alex Quintanilla tarea 8
De Casiopea
| Título | Alex Quintanilla tarea 8 |
|---|---|
| Tipo de Proyecto | Proyecto de Curso |
| Palabras Clave | tarea 8 |
| Período | 2012- |
| Asignatura | Imagen Escrita 2012, |
| Del Curso | Imagen Escrita 2012, |
| Carreras | Arquitectura |
| Alumno(s) | Alex Quintanilla |
| Profesor | Herbert Spencer |
import processing.pdf.*;
PImage fotoimagenescrita; PFont font; String[] code;
float a = 15; float l = 20; 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));
}