コンテンツにスキップ

Processing

出典: フリー百科事典『ウィキペディア(Wikipedia)』
Processing
ロゴ
Processingのロゴ
パラダイム オブジェクト指向
登場時期 2001年
設計者 ケイシー・リース、ベンジャミン・フライ
最新リリース 4.3[1] ウィキデータを編集 - 2023年7月26日 (9か月前) [±][+/−]
型付け 強い型付け
影響を受けた言語 Design by Numbers
プラットフォーム クロスプラットフォーム
ライセンス GPLLGPL
ウェブサイト processing.org
テンプレートを表示

ProcessingCasey ReasBenjamin FryMITIDE Java 

[]

Processing IDE

Processing sketchbookIDE

Processing  Java 使Java

GPUAPIProcessingAPI便OpenGLAPI

processing.js

プログラム例[編集]

Hello World[編集]

println("Hello World!");

上記も正しいプログラムだが、次のようなコードの方がProcessingの雰囲気をよく表している。

text("Hello World!", 20,50);

図形を描く[編集]

rect(20, 20, 100, 80);//四角形
ellipse(140, 140, 40, 50);//楕円

日本地図の塗り分け[編集]

ウィキメディアのSVG形式の日本地図の白地図を読み込み、Prefecturesという配列に記述された番号の県のみ塗り分けるプログラム。英語版の例のように地図データが各県ごとにnameを持っていれば県名で指定することも可能である。

PShape japan;
float map_scale=0.25;
int square_len=512;
int [] Prefectures={2,3,5,7,11,13,17,19,23,29,31,37,41,43};  // Prime numbers

void setup() {
  japan=loadShape("https://upload.wikimedia.org/wikipedia/commons/5/56/Blank_map_of_Japan.svg");
  size(square_len,square_len);
  smooth();
  noLoop();
}

void draw() {
  background(color(0, 0, 255));  // blue
  japan.disableStyle();
  japan.getChild("ground").getChild(0).scale(map_scale);
  fill(color(255, 255, 0));  // yellow
  shape(japan.getChild("ground").getChild(0), square_len * map_scale, square_len * map_scale);
  prefecturesColoring(japan ,Prefectures , color(255, 0, 255), map_scale);  // magenta
  saveFrame("map output.png");
}

void prefecturesColoring(PShape nation, int[] prefectures, int c, float n){
  for (int i=0; i < prefectures.length; i++) {
    PShape prefecture=nation.getChild("ground").getChild(0).getChild(prefectures[i]);
    prefecture.disableStyle();  // Disable the colors found in the SVG file
    prefecture.scale(n);
    fill(c);  // Set our own coloring
    noStroke();
    shape(prefecture, square_len * map_scale, square_len * map_scale);  // Draw a single prefecture
  }
}

関連プロジェクト[編集]


Processing WiringProcessing CWiring 使 Arduino Mobile ProcessingProcessing 使 Java 

[]


2005 Processing 

[]


 GPL 

 LGPL 

[]


 processing.org  proce55ing.org  processing.org proce55ing.org  p5 

[]


200811241.0

201362.0

201593.0

202284.0

[]


Processing.js - JavaScript

openFrameworks

cinder

[]




Processing Foundation

processing4 - GitHub

Processing Foundation (page.processing) - Facebook

Processing Foundation (@ProcessingOrg) - Medium

processingorg (@processingorg) - Instagram

processingorg (@processingorg) - XTwitter

Processing - YouTube

Processing Foundation - Vimeo

processinghacks.com

Processing Blogs

processing.js

p5js.org
  1. ^ "Processing is open source and is available for macOS, Windows, and Linux."; 閲覧日: 2023年8月15日; 出版日: 2023年7月26日.