https://wiki.ead.pucv.cl/index.php?title=Alex_Quintanilla_tarea_8&feed=atom&action=history
Alex Quintanilla tarea 8 - Historial de revisiones
2024-03-28T19:50:31Z
Historial de revisiones de esta página en la wiki
MediaWiki 1.39.6
https://wiki.ead.pucv.cl/index.php?title=Alex_Quintanilla_tarea_8&diff=186089&oldid=prev
Alxd14: Página creada con '{{Proyecto |Título=Alex Quintanilla tarea 8 |Tipo de Proyecto=Proyecto de Curso |Palabras Clave=tarea 8 |Año de Inicio=2012 |Carreras Relacionadas=Arquitectura |Asignaturas Re...'
2012-06-21T05:51:53Z
<p>Página creada con '{{Proyecto |Título=Alex Quintanilla tarea 8 |Tipo de Proyecto=Proyecto de Curso |Palabras Clave=tarea 8 |Año de Inicio=2012 |Carreras Relacionadas=Arquitectura |Asignaturas Re...'</p>
<p><b>Página nueva</b></p><div>{{Proyecto<br />
|Título=Alex Quintanilla tarea 8<br />
|Tipo de Proyecto=Proyecto de Curso<br />
|Palabras Clave=tarea 8<br />
|Año de Inicio=2012<br />
|Carreras Relacionadas=Arquitectura<br />
|Asignaturas Relacionadas=Imagen Escrita 2012, <br />
|Cursos Relacionados=Imagen Escrita 2012, <br />
|Profesor=Herbert Spencer, <br />
|Alumnos=Alex Quintanilla, <br />
|Imagen=Foto.pdf<br />
}}<br />
import processing.pdf.*;<br />
<br />
PImage fotoimagenescrita; <br />
PFont font; <br />
String[] code; <br />
<br />
float a = 15; <br />
float l = 20;<br />
float e = 15;<br />
float i = 20;<br />
float escala;<br />
<br />
void setup() {<br />
<br />
fotoimagenescrita = loadImage("fotoimagenescrita.jpg"); <br />
size(609, 765, PDF, "foto.pdf"); <br />
<br />
<br />
float ancho = width + (e + a);<br />
escala = ancho/(float)fotoimagenescrita.width;<br />
<br />
noStroke();<br />
noLoop(); <br />
background(255);<br />
<br />
font = createFont("Courier", 8);<br />
textFont(font, 8);<br />
<br />
code = loadStrings("trazo.pde");<br />
}<br />
<br />
<br />
<br />
void draw() {<br />
<br />
float spacer = 5;<br />
<br />
<br />
for (int y = 1; y <fotoimagenescrita.height; y += spacer) {<br />
for (int x = 0; x < fotoimagenescrita.width; x += spacer) {<br />
<br />
float plotX = map(x, 0, fotoimagenescrita.width, a, width -i);<br />
float plotY = map(y, 0, fotoimagenescrita.height, e, l + (fotoimagenescrita.height * escala));<br />
color c = fotoimagenescrita.get(x, y);<br />
trazo(plotX, plotY, c, spacer);<br />
}<br />
}<br />
printCode();<br />
println("-----> PDF");<br />
exit();<br />
}<br />
<br />
void printCode() {<br />
float interlinea = 1;<br />
<br />
interlinea += 10;<br />
}<br />
<br />
/***************************************trazo**********************************/<br />
<br />
<br />
<br />
<br />
void trazo(float x, float y, color c, float amp) {<br />
fill(c);<br />
rect(x, y, map(brightness(c), 0, 255, amp, 0), <br />
map(brightness(c), 0, 255, amp, 0));<br />
}</div>
Alxd14