Processing (programming language)

From Seo Wiki - Search Engine Optimization and Programming Languages
Jump to navigationJump to search
Processing
File:Processing-loading-logo.png
Paradigm object-oriented
Appeared in 2001
Stable release 1.0.9 (October 20, 2009; 470664338 ago)
Typing discipline strong
Influenced by Design by Numbers, Java, OpenGL, PostScript, C
OS Cross-platform
License GPL and LGPL
Website http://processing.org/

Processing is an open source "programming language and integrated development environment (IDE) built for the electronic arts and visual design communities" with the purpose of teaching the basics of computer programming in a visual context, and to serve as the foundation for electronic sketchbooks. The project was initiated in 2001 by Casey Reas and Ben Fry, both formerly of the Aesthetics and Computation Group at the MIT Media Lab. One of the stated aims of Processing is to act as a tool to get non-programmers started with programming, through the instant gratification of visual feedback. The language builds on the graphical capabilities of the Java programming language, simplifying features and creating a few new ones.

Features

File:Processing screen shot.png
The Processing IDE

Processing includes a "sketchbook", a minimal alternative to an IDE for organizing projects.

Every Processing sketch is actually a subclass of the PApplet Java-class which implements most of the Processing Language's features.

When programming in Processing all additional classes defined will be treated as inner classes when the code is translated into pure Java before compiling. This means that the use of static variables and methods in classes is prohibited unless you explicitly tell Processing that you want to code in pure Java mode.

Hello World

println("Hello World!");

While this is a valid Hello World program, the following code is a better example of the look and feel of the Processing language.

void setup() {
 // define the window size, and font we'll use. (antialiased)
 size(200, 200);
 PFont font = loadFont("Calibri-24.vlw");
 smooth();
 
 // Set "ink" color, font, and alignment for rendering text.
 fill(0);  // Black
 textAlign(CENTER);
 textFont(font);
 noLoop();  // draw() only once
}
 
void draw() {
 // Draw text to screen using the previously set font.
 text("Hello World!", width/2, height/2);
}

United States presidential election Map

The next example shows a map of the results of the 2008 USA presidential election. Blue denotes states won by Obama, and Red denotes those won by McCain. (Note: this map does not show the Nebraska district in which McCain won an elector.)

PShape usa;
PShape state;
String [] Obama  = { "HI", "RI", "CT", "MA", "ME", "NH", "VT", "NY", "NJ",
	"FL", "NC", "OH", "IN", "IA", "CO", "NV", "PA", "DE", "MD", "MI",
	"WA", "CA", "OR", "IL", "MN", "WI", "DC", "NM", "VA" };

String [] McCain = { "AK", "GA", "AL", "TN", "WV", "KY", "SC", "WY", "MT",
	"ID", "TX", "AZ", "UT", "ND", "SD", "NE", "MS", "MO", "AR", "OK",
	"KS", "LA" };

void setup() {
  size(950, 600);
  // Blank_US_Map.svg file can be found at Wikimedia Commons
  // http://upload.wikimedia.org/wikipedia/commons/3/32/Blank_US_Map.svg
  usa = loadShape("Blank_US_Map.svg");
  smooth(); // Improves the drawing quality of the SVG
  noLoop();
}

void draw() {
  background(255);
  // Draw the full map
  shape(usa, 0, 0);
  // Blue denotes states won by Obama
  statesColoring(Obama , color(0, 0, 255));
  // Red  denotes states won by McCain
  statesColoring(McCain, color(255, 0, 0));
  // Save the map as image
  saveFrame("map output.png");
}
 
void statesColoring(String[] states, int c){
  for (int i = 0; i < states.length; ++i) {
    PShape state = usa.getChild(states[i]);
    // Disable the colors found in the SVG file
    state.disableStyle();
    // Set our own coloring
    fill(c);
    noStroke();
    // Draw a single state
    shape(state, 0, 0);
  }
}

Related projects

Design By Numbers

Processing was based on the original work done on Design By Numbers project in MIT. It shares much of the same ideas and is a direct child of that experiment.

Wiring, Arduino, and Fritzing

Processing has spawned another project, Wiring, which uses the Processing IDE together with a simplified version of the C++ programming language as a way to teach artists how to program microcontrollers. There are now two separate hardware projects, Wiring and Arduino, using the Wiring environment and language. Fritzing is another software environment within this family, which supports designers and artists to document their interactive prototypes and to take the step from physical prototyping to actual product.

Mobile Processing

Another spin-off project, Mobile Processing by Francis Li, allows software written using the Processing programming language and environment to run on Java powered mobile devices.

Processing.js

John Resig has recently ported Processing to JavaScript using the Canvas element for rendering,[1] allowing Processing to be used in modern web browsers without the need for a Java plugin.

Spde

Spde (standing for Scala Processing Development Environment) replaces Processing's reduced Java syntax and custom preprocessor with the off-the-shelf Scala language which also runs on the Java platform and enforces some of the same restrictions such as disallowing statics, while also allowing more concise code, and supporting functional programming. [2] [3] [4] [5]

Awards

In 2005 Reas and Fry won the prestigious Golden Nica award from Ars Electronica in its Net Vision category for their work on Processing.

License

The IDE is licensed under the GNU General Public License.

Processing's 'core' libraries, the code included in exported applications and applets, is licensed under the GNU Lesser General Public License, allowing the programmer to release their original code with their license of choice.

Name

Originally, Processing had the URL at proce55ing.org, because the "processing" domain was taken. Eventually, however, Reas and Fry acquired the domain. Although the name had a combination of letters and numbers, it was still pronounced "processing". They do not prefer the environment being referred to as "Proce55ing." But, despite the name change, Processing still uses the term "p5" sometimes as a shortened name. However, they specifically use "p5" and not "p55".

See also

Footnotes

References

External links

ar:بروسيسنج ca:Processing de:Processing es:Processing fr:Processing ko:프로세싱 (프로그래밍 언어) nl:Processing ja:Processing no:Processing fi:Processing

If you like SEOmastering Site, you can support it by - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 and more...