Jose vasquez: editor imagenes

De Casiopea


Títuloeditor imagenes
Tipo de ProyectoProyecto de Taller, Proyecto de Curso
Palabras Clavetarea 8
Período2012-
AsignaturaTaller Inicial 1ª y 2ª Etapa,
Del CursoImagen Escrita 2012,
Alumno(s)José Ignacio Vásquez
ProfesorHerbert Spencer


//import processing.pdf.*;

PImage venec; PFont font; String [] far;

 float margenDerecha = 30;
 float margenIzquierda = 20;
 float margenArriba = 20;
 float margenArribab= 20;
 

void setup() {

venec = loadImage("venec.jpg");
 size(609,765);//, PDF, "veneciaprocessing.pdf");
 
  float ancho = width - (margenIzquierda + margenDerecha);
  

 noStroke();
 background(255);
 
 font = createFont("EdwardianScriptITC", 48);
 textFont(font, 8);
 far = loadStrings("pincel.pde");

} void draw() {

 float spacer = 10;
   for(int y = 0; y<venec.height; y +=spacer){
       for(int x = 0; x<venec.width; x +=spacer){
     
      float CoX = map(x, 0, venec.width, margenIzquierda, width-margenArriba);
     float CoY = map(y, 0, venec.height, margenArriba, margenArriba + venec.height);
     color c = venec.get(x, y);
      pincel(CoX, CoY, c, spacer);
   }}
     printCode();
   println("---> PDF OK");
   exit();

}

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

 float h = hue(c);     
 float s= saturation(c);
 float b = brightness(c);
 fill(h+30, s, b); 
 line (x+1, y+1, x, y);
 pushMatrix();   
 translate(x, y);
 scale(map((h+s+b)/3, 0, 255, 0.50, 1.00)); 
 form(h, s+5, b+10);
 
 popMatrix();

} void form(float h, float s, float b) {

 fill(h, s, b);
 noStroke();
 beginShape();
 vertex(2*10, 2*10);
 vertex(1*10, 3*10);
 vertex(0.5*10, 4*10);
 vertex(1.5*10, 5*10 );
 vertex(2.5*10, 4.5*10);
 vertex(3*10, 3*10);
 endShape(CLOSE);

} void printCode() {

 float intt = 0;
 for (int i = 0; i < far.length; i++) {
   text(far[i], width/4, 2 * margenArriba + venec.height *  intt);
   intt += 15;
 }

}