Ubuntu16.04 安装Processing
下载
在 https://processing.org/ 上下载最新的linux 64bit版本gzip文件, 当前是 http://download.processing.org/processing-3.3.7-linux64.tgz .
安装
解压后移动到 /opt/ 目录
添加快捷方式
在 /usr/share/applications下新建新文件 processing-pde.desktop, 内容如下
[Desktop Entry]
Version=3.3.
Type=Application
Name=Processing IDE
Icon=/opt/processing-3.3./lib/icons/pde-.png
Exec=/opt/processing-3.3./processing
Comment=Processing IDE
Categories=Development;IDE;
Terminal=false
附: 用于从图片中提取LCD单色数组的代码
// THIS IS NOT ARDUINO CODE! Runs in Processing IDE (www.processing.org).
// Convert image to C header file suitable for the Adafruit_Thermal library. void setup() {
// Select and load image
selectInput("Select image file to convert:", "processImage");
} void processImage(File image) {
String filename, basename;
PImage img;
PrintWriter output;
int pixelNum, byteNum, bytesOnLine = ,
x, y, b, rowBytes, totalBytes, lastBit, sum;
println("Loading image...");
filename = image.getPath();
img = loadImage(image.getPath()); // Morph filename into output filename and base name for data
x = filename.lastIndexOf('.');
if(x > ) filename = filename.substring(, x); // Strip current extension
x = filename.lastIndexOf('/');
if(x > ) basename = filename.substring(x + ); // Strip path
else basename = filename;
filename += ".h"; // Append '.h' to output filename
println("Writing output to " + filename); // Calculate output size
rowBytes = (img.width + ) / ;
totalBytes = rowBytes * img.height;
// Convert image to B&W, make pixels readable
img.filter(THRESHOLD);
img.loadPixels(); // Open header file for output (NOTE: WILL CLOBBER EXISTING .H FILE, if any)
output = createWriter(filename); // Write image dimensions and beginning of array
output.println("#ifndef _" + basename + "_h_");
output.println("#define _" + basename + "_h_");
output.println();
output.println("#define " + basename + "_width " + img.width);
output.println("#define " + basename + "_height " + img.height);
output.println();
output.print("static const uint8_t PROGMEM " + basename + "_data[] = {"); // Generate body of array
for(pixelNum=byteNum=y=; y<img.height; y++) { // Each row...
for(x=; x<rowBytes; x++) { // Each 8-pixel block within row...
lastBit = (x < rowBytes - ) ? : ( << (rowBytes * - img.width));
sum = ; // Clear accumulated 8 bits
for(b=; b>=lastBit; b >>= ) { // Each pixel within block...
if((img.pixels[pixelNum++] & ) == ) sum |= b; // If black pixel, set bit
}
if(++bytesOnLine >= ) { // Wrap nicely
output.print("\n ");
bytesOnLine = ;
}
output.format(" 0x%02X", sum); // Write accumulated bits
if(++byteNum < totalBytes) output.print(',');
}
} // End array, close file, exit program
output.println();
output.println("};");
output.println();
output.println("#endif // _" + basename + "_h_");
output.flush();
output.close();
println("Done!");
exit();
}
.
Ubuntu16.04 安装Processing的更多相关文章
- Ubuntu16.04安装Redis并配置
Ubuntu16.04安装Redis并配置 2018年05月22日 10:40:35 Hello_刘 阅读数:29146 Ubuntu16.04安装Redis并配置 1):安装: 1:终端命令下载 ...
- ubuntu16.04安装jdk,tomcat
ubuntu16.04安装jdk,tomcat 最近装了一下tomcat,网上的教程很多,我也试了很多次,但是有一些教程关于tomcat配置是错误的,让我走上了歧途.差点重装系统,还好王总及时出手帮助 ...
- Ubuntu16.04 安装openjdk-7-jdk
Ubuntu16.04 安装openjdk-7-jdk sudo apt-get install openjdk-7-jre 或者sudo apt-get install openjdk-7-jdk ...
- Ubuntu16.04安装GTK3主题:OSX-Arc
Ubuntu16.04安装GTK3主题:OSX-Arc GTK3主题:OSX-Arc描述: 前几个月,Gnome3.20升3.22的时候,出现了大量主题崩溃的现象,其中包括Arc.Flatabulou ...
- Ubuntu16.04安装opencv for python/c++
Ubuntu16.04安装opencv for python/c++ 网上关于opencv的安装已经有了不少资料,但是没有一篇资料能让我一次性安装成功,因此花费了大量时间去解决各种意外,希望这篇能给一 ...
- ubuntu16.04安装不上有道词典的解决办法
转自:http://www.linuxdiyf.com/linux/21143.html ubuntu16.04安装不上有道词典,提示: le@hu-pc:~/下载$ sudo dpkg -i you ...
- Ubuntu16.04安装mongodb
Ubuntu16.04安装mongodb copy from: http://blog.csdn.net/zhushh/article/details/52451441 1.导入软件源的公钥 sudo ...
- 【Tools】ubuntu16.04安装搜狗输入法
Ubuntu16,04 安装搜狗输入法 1.下载搜狗输入法的安装包 下载地址为:http://pinyin.sogou.com/linux/ 2.按键Ctr+Alt+T打开终端,输入以下命令切换到下载 ...
- Ubuntu16.04安装cuda9.0+cudnn7.0
Ubuntu16.04安装cuda9.0+cudnn7.0 这篇记录拖了好久,估计是去年6月份就已经安装过几遍,然后一方面因为俺比较懒,一方面后面没有经常在自己电脑上跑算法,比较少装cuda和cudn ...
随机推荐
- scrapy框架系列 (5) Spider类
Spider Spider类定义了如何爬取某个(或某些)网站.包括了爬取的动作(例如:是否跟进链接)以及如何从网页的内容中提取结构化数据(爬取item). 换句话说,Spider就是您定义爬取的动作及 ...
- Spark简介及其在ubuntu下的安装使用
转:http://blog.csdn.net/pelick/article/details/9888311 Spark概述 Spark是一种与 Hadoop 相似的开源集群计算环境,在性能和迭代计算上 ...
- 用Hadoop构建电影推荐系统
转自:http://blog.fens.me/hadoop-mapreduce-recommend/ Hadoop家族系列文章,主要介绍Hadoop家族产品,常用的项目包括Hadoop, Hive, ...
- 性能测试vs负载测试vs压力测试
下面我们主要介绍性能测试.负载测试和压力测试. 效率作为ISO 9126内部和外部质量的重要质量属性之一,其含义是在规定条件下,相对于所用的资源的数量,软件产品可提供适当性能的能力.资源可能包括其他软 ...
- Spring(二十一):Spring JdbcTemplate、NamedParameterJdbcTemplate具名参数
JdbcTemplate主要提供以下五类方法: execute方法:可以用于执行任何SQL语句,一般用于执行DDL语句: update方法及batchUpdate方法:update方法用于执行新增.修 ...
- [React] Asynchronously Load webpack Bundles through Code-splitting and React Suspense
One approach to building high performance applications with webpack is to take advantage of code-spl ...
- ASP入门(二十二)-连接数据库
ADO 简介 在 ASP 中访问数据库使用的 ADO 组件. ADO 是一项微软的技术. ADO 指 ActiveX 数据对象(ActiveX Data Objects). ADO 是微软的 Acti ...
- robot framework-requests库安装过程问题解决
这几天本想研究下用robotframework+HTTP library (Requests)来做接口测试(http协议), 安装完Requests库后,在RIDE里导入该库时显示是红色,即导入失败( ...
- HOW TO: Synchronize changes when completing a P2V or V2V with VMware vCenter Converter Standalone 5.1
http://www.experts-exchange.com/Software/VMWare/A_11489-HOW-TO-Synchronize-changes-when-completing-a ...
- C++ 第三课:常量转义字符
常量转义字符 以下的转义字符使普通字符表示不同的意义. 转义字符 描述 \' 单引号 \" 双引号 \\ 反斜杠 \0 空字符 \a 响铃 \b 后退 \f 走纸 \n 换行 \r 回车 \ ...