Tarea 8, Ramón Pizarro

De Casiopea
Ramón Pizarro Briceño: Tarea 8
TítuloRamón Pizarro Briceño: Tarea 8
Tipo de ProyectoProyecto de Curso
Palabras Clavetarea 8
AsignaturaTaller Inicial Común 1ª y 2ª Etapa,
Del CursoImagen Escrita 2012,
CarrerasDiseño Gráfico"Diseño Gráfico" is not in the list (Arquitectura, Diseño, Magíster, Otra) of allowed values for the "Carreras Relacionadas" property., Diseño Industrial"Diseño Industrial" is not in the list (Arquitectura, Diseño, Magíster, Otra) of allowed values for the "Carreras Relacionadas" property.
Alumno(s)Ramon Pizarro
ProfesorHerbert Spencer
URLhttp://www.flickr.com/photos/topyalrevez-/5437263457/in/photostream

import processing.pdf.*;


PImage toopy; PFont font; String [] code;

// es el margen que se preestablece para el dibujo

float margenIzquierda = 30; float magenArriba = 20; float margenAbajo = 20; float margenDerecha = 30; float escala;

void setup() {

 toopy = loadImage("toopy.jpg");
 size(609, 765, PDF, "toopy.pdf");
 float ancho = width - (margenIzquierda + margenDerecha);
 escala = ancho/(float)toopy.width;
 noStroke();
 noLoop();
 background(255);
 font = createFont("Helvetica", 8);
 textFont(font, 8);
 code = loadStrings ("dibujo.pde");

}

void draw() {

 float spacer = 10 ;
 for (int y = 0; y < toopy.height; y += spacer) {
   for (int x = 0; x < toopy.width; x += spacer) {
     float plotX = map(x, 0, toopy.width, margenIzquierda, width-margenDerecha);
     float plotY = map(y, 0, toopy.height, margenDerecha, margenDerecha + (toopy.height * escala));
     color c = toopy.get(x, y);
     dibujo(plotX, plotY, c, spacer);
   }
 }
 printCode();
 println("----->PDF done!");
 exit();

}

void printCode() {
 float interlinea = 0;
 for (int i = 0; i < code.length; i++) {
   // escribo cada línea de código en la pantalla
   text(code[i], width/4, 2 * margenIzquierda + toopy.height * escala + interlinea);
   interlinea += 15;
 }

}


/* INICIO DEL PINCEL */

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

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

}