<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?action=history&amp;feed=atom&amp;title=GMU%3AProcessing_im_Park%2FEmilio_Aguas%2Fsample_code_final</id>
	<title>GMU:Processing im Park/Emilio Aguas/sample code final - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?action=history&amp;feed=atom&amp;title=GMU%3AProcessing_im_Park%2FEmilio_Aguas%2Fsample_code_final"/>
	<link rel="alternate" type="text/html" href="https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Processing_im_Park/Emilio_Aguas/sample_code_final&amp;action=history"/>
	<updated>2026-06-11T18:43:34Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.6</generator>
	<entry>
		<id>https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Processing_im_Park/Emilio_Aguas/sample_code_final&amp;diff=80548&amp;oldid=prev</id>
		<title>EmilioAguas: /* --- Processing3.0 Code--- */</title>
		<link rel="alternate" type="text/html" href="https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Processing_im_Park/Emilio_Aguas/sample_code_final&amp;diff=80548&amp;oldid=prev"/>
		<updated>2016-04-05T00:11:48Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;--- Processing3.0 Code---&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 00:11, 5 April 2016&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l21&quot;&gt;Line 21:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 21:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;    &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;    &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   //initialize the web cam&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   //initialize the web cam&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   cam = new Capture (this, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;800&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;600&lt;/del&gt;, &amp;quot;FaceTime HD Camera (Built-in)&amp;quot;, 30);&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   cam = new Capture (this, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;1440&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;900&lt;/ins&gt;, &amp;quot;FaceTime HD Camera (Built-in)&amp;quot;, 30);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   cam.start();&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   cam.start();&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>EmilioAguas</name></author>
	</entry>
	<entry>
		<id>https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Processing_im_Park/Emilio_Aguas/sample_code_final&amp;diff=80427&amp;oldid=prev</id>
		<title>EmilioAguas: Created page with &quot;====--- Processing3.0 Code--- ====  Discover the Images of nature that are hidden in the dark with the help of a lighter  &lt;source lang=&quot;java&quot;&gt;  import processing.video.*;  int k,...&quot;</title>
		<link rel="alternate" type="text/html" href="https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Processing_im_Park/Emilio_Aguas/sample_code_final&amp;diff=80427&amp;oldid=prev"/>
		<updated>2016-04-01T17:36:17Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;====--- Processing3.0 Code--- ====  Discover the Images of nature that are hidden in the dark with the help of a lighter  &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;  import processing.video.*;  int k,...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;====--- Processing3.0 Code--- ====&lt;br /&gt;
&lt;br /&gt;
Discover the Images of nature that are hidden in the dark with the help of a lighter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
import processing.video.*;&lt;br /&gt;
&lt;br /&gt;
int k, l; //coordinates for the brightest pixel&lt;br /&gt;
int photos = 8; //maximum of photos&lt;br /&gt;
int index = 0; // first image&lt;br /&gt;
PImage[] pics = new PImage[photos]; //images array&lt;br /&gt;
Capture cam; // Declare Capture object&lt;br /&gt;
&lt;br /&gt;
void setup() {&lt;br /&gt;
  //fullScreen();&lt;br /&gt;
  size (1440, 900);&lt;br /&gt;
  background (0);&lt;br /&gt;
  smooth ();&lt;br /&gt;
  noStroke();&lt;br /&gt;
  &lt;br /&gt;
  //initialize the web cam&lt;br /&gt;
  cam = new Capture (this, 800, 600, &amp;quot;FaceTime HD Camera (Built-in)&amp;quot;, 30);&lt;br /&gt;
  cam.start();&lt;br /&gt;
&lt;br /&gt;
  //load the images into the array&lt;br /&gt;
  for (int i = 0; i &amp;lt; pics.length; i++ ) {&lt;br /&gt;
    pics[i] = loadImage (&amp;quot;IMG_024&amp;quot;+ (i+2) + &amp;quot;.jpg&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void draw () {&lt;br /&gt;
  loadPixels();&lt;br /&gt;
&lt;br /&gt;
  //load the pixels of every image&lt;br /&gt;
  pics[index].loadPixels();&lt;br /&gt;
&lt;br /&gt;
  //load the pixels of the web cam&lt;br /&gt;
  if (cam.available()) {&lt;br /&gt;
    cam.read();&lt;br /&gt;
    cam.loadPixels();&lt;br /&gt;
&lt;br /&gt;
    // Start values of the brightness of the pixels&lt;br /&gt;
    float theLight = 0;&lt;br /&gt;
    int brightnessPix =0;&lt;br /&gt;
&lt;br /&gt;
    // campare if the actual brightness values net to be replaced for new ones higher than 0 &lt;br /&gt;
    for (int i=0; i&amp;lt;cam.pixels.length; i++) {&lt;br /&gt;
      if (brightness(cam.pixels[i]) &amp;gt; theLight) {&lt;br /&gt;
        theLight= brightness (cam.pixels[i]);&lt;br /&gt;
        brightnessPix = i;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    k = brightnessPix % cam.width; // moving in the colums of the pixel array&lt;br /&gt;
    l = brightnessPix / cam.width; // moving in the rows of the pixel array&lt;br /&gt;
&lt;br /&gt;
    //moving through the pixels in two dimensions&lt;br /&gt;
    for (int x =0; x &amp;lt;  pics[index].width; x++) {&lt;br /&gt;
      for (int y =0; y &amp;lt;  pics[index].height; y++) {&lt;br /&gt;
&lt;br /&gt;
        //position of the pixels in one dimension&lt;br /&gt;
        int pixel_Loc = x + (y * pics[index].width);&lt;br /&gt;
&lt;br /&gt;
        //take the r,g.b values from the image pixel by pixel&lt;br /&gt;
        float red = red (pics[index].pixels [pixel_Loc]);&lt;br /&gt;
        float green = green (pics[index].pixels [pixel_Loc]);&lt;br /&gt;
        float blue = blue (pics[index].pixels [pixel_Loc]);&lt;br /&gt;
&lt;br /&gt;
        //change the brightness according to the proximity of the mouse&lt;br /&gt;
        float flash = dist (x, y, k, l);//using dist function with the 4 values points in X and Y coordinates&lt;br /&gt;
        float flashLightX = (60-flash) / 50;// change the values for filters or the &amp;quot;100&amp;quot; for the size of the flashlight&lt;br /&gt;
        float flashLightY = (80-flash) / 50;// change the values for filters or the &amp;quot;100&amp;quot; for the size of the flashlight&lt;br /&gt;
        red *= flashLightX;&lt;br /&gt;
        green *= flashLightY;&lt;br /&gt;
        blue *= flashLightX;&lt;br /&gt;
&lt;br /&gt;
        // Constrain rgb values&lt;br /&gt;
        red = constrain (red, 0, 255);&lt;br /&gt;
        green = constrain (green, 0, 255);&lt;br /&gt;
        blue = constrain (blue, 0, 255);&lt;br /&gt;
&lt;br /&gt;
        //change the pixels for a new value&lt;br /&gt;
        color images = color (red, green, blue);&lt;br /&gt;
        pixels[pixel_Loc] = images;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    //dispaly the pixels&lt;br /&gt;
    updatePixels();&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void mousePressed() {&lt;br /&gt;
  //change the image every time the mouse is clicked&lt;br /&gt;
  index = (index + 1) % pics.length;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>EmilioAguas</name></author>
	</entry>
</feed>