Printing 从处理中打印画布
我正在尝试做一些类似的事情:,但是我没有一台专用的Linux机器,没有墨水的纸和WiFi。另一方面,我有一个连接到互联网的桌面和一台彩色照片打印机 所以我想到的是这个-Printing 从处理中打印画布,printing,processing,Printing,Processing,我正在尝试做一些类似的事情:,但是我没有一台专用的Linux机器,没有墨水的纸和WiFi。另一方面,我有一个连接到互联网的桌面和一台彩色照片打印机 所以我想到的是这个- 设置Instagram API应用程序,获取最新照片的所有信息 一个PHP脚本和一个服务器,可以为带有标题(“内容类型:image/jpeg”)的最新照片生成一个静态URL,这样每次我拍摄一张新照片时,静态页面上的图像内容都会变为最新照片 其他页面,比如上面提到的页面,会改变以反映我拍摄的每一张照片的新位置和标题,这些页面托管在
标题(“内容类型:image/jpeg”)
的最新照片生成一个静态URL,这样每次我拍摄一张新照片时,静态页面上的图像内容都会变为最新照片有人知道我该怎么做吗?专注于在处理过程中显示大型图像的部分,我在谷歌搜索了一下,找到了一个。引用他们的问题和结果: 目标是打印一个180 pdi图像,其形状取决于 原始画布。因此可能会有所不同,但最终会成为一个 1500x1000毫米图片,约。这么大的形象。我不想这么做 显示它只是为了将其转储到文件中 然后我设置了一个64位的JVM。Oracle网站上的最新版本。然后我 创建不同大小的图片,并将内存提升到1024MB5000x7500测试正常和6000x9000测试正常 我试图将内存设置为1500MB,但JVM无法启动。 所以我尝试了1200MB8000x12000测试OK 因此,它不做图像打印部分,而是提供了通过Java虚拟机()在内存中获取大型图像的关键信息
最后,描述了一个TileSaver类,用于使用OpenGL查看/打印大量像素。我在下面粘贴了一个大代码块。(这可能与您的问题无关,但在其他用途中会使答案更完整。)
import processing.opengl.*;
进口toxi.geom.*;
瓦工瓦工;
无效设置(){
尺寸(640480,OPENGL);
瓷砖=新瓷砖((pgd)g,瓷砖数量);
}
作废提款(){
//见线
}
/**
*实现支持FOV的屏幕磁贴导出器,
*剪裁平面和灵活的文件格式。
*
*从Marius Watz的旧版本重新设计:
* http://workshop.evolutionzone.com/unlekkerlib/
*
*@作者toxi
*/
类瓦工{
受保护的pgs3d-gfx;
受保护的图像缓冲区;
受保护的Vec2D[]tileoffset;
受保护的双层顶部;
保护双层底;
保护双左;
受保护的双重权利;
保护向量化;
受保护的整数;
受保护的int-tileID;
受保护的浮蚊;
受保护的布尔值;
受保护的字符串文件名;
保护字符串格式;
保护双摄像机;
保护双摄像机;
保护双摄像头;
公共瓷砖厂(PGS3D g,int n){
gfx=g;
numTiles=n;
}
公共无效选择器文件(内部id){
vec2do=tileOffsets[id];
gfx.平截头体(o.x,o.x+瓷砖尺寸.x,o.y,o.y+瓷砖尺寸.y,
(浮动)摄像机耳,(浮动)摄像机耳);
}
公共空间(浮动视野、浮动近距离、浮动远距离){
tileOffsets=新的Vec2D[numTiles*numTiles];
双宽=(双)gfx.width/gfx.height;
摄像机视场=视场;
cameraNear=近;
cameraFar=远;
top=数学tan(cameraFOV*0.5)*cameraNear;
底部=-顶部;
左=宽*底;
右=方向*顶部;
int-idx=0;
tileSize=新的Vec2D((浮动)(2*右/多个文件),(浮动)(2*顶/多个文件));
双y=top-tileSize.y;
while(idx1){
int x=tileID%numTiles;
int y=tileID/numTiles;
gfx.loadPixels();
缓冲设置(x*gfx.宽度,y*gfx.高度,gfx);
if(tileID==tileOffsets.length-1){
buffer.save(文件名+“”+buffer.width+“x”
+buffer.height+“+”格式);
缓冲区=空;
}
subTileID=0;
isTiling=(++tileID
我专注于在处理过程中显示大型图像的部分,在谷歌上搜索了一下,找到了一个。引用他们的问题和结果:
目标是打印一个180 pdi图像,其形状取决于
原始画布。因此可能会有所不同,但最终会成为一个
1500x1000毫米图片,约。这么大的形象。我不想这么做
显示它只是为了将其转储到文件中
然后我设置了一个64位的JVM。Oracle网站上的最新版本。然后我
创建不同大小的图片,并将内存提升到1024MB5000x7500测试正常和6000x9000测试正常
我试图将内存设置为1500MB,但JVM无法启动。
所以我
import processing.opengl.*;
import toxi.geom.*;
Tiler tiler;
void setup() {
size(640,480,OPENGL);
tiler=new Tiler((PGraphics3D)g,NUM_TILES);
}
void draw() {
// see thread
}
/**
* Implements a screen tile exporter with support for FOV,
* clip planes and flexible file formats.
*
* Re-engineered from an older version by Marius Watz:
* http://workshop.evolutionzone.com/unlekkerlib/
*
* @author toxi <info at postspectacular dot com>
*/
class Tiler {
protected PGraphics3D gfx;
protected PImage buffer;
protected Vec2D[] tileOffsets;
protected double top;
protected double bottom;
protected double left;
protected double right;
protected Vec2D tileSize;
protected int numTiles;
protected int tileID;
protected float subTileID;
protected boolean isTiling;
protected String fileName;
protected String format;
protected double cameraFOV;
protected double cameraFar;
protected double cameraNear;
public Tiler(PGraphics3D g, int n) {
gfx = g;
numTiles = n;
}
public void chooseTile(int id) {
Vec2D o = tileOffsets[id];
gfx.frustum(o.x, o.x + tileSize.x, o.y, o.y + tileSize.y,
(float) cameraNear, (float) cameraFar);
}
public void initTiles(float fov, float near, float far) {
tileOffsets = new Vec2D[numTiles * numTiles];
double aspect = (double) gfx.width / gfx.height;
cameraFOV = fov;
cameraNear = near;
cameraFar = far;
top = Math.tan(cameraFOV * 0.5) * cameraNear;
bottom = -top;
left = aspect * bottom;
right = aspect * top;
int idx = 0;
tileSize = new Vec2D((float) (2 * right / numTiles), (float) (2 * top / numTiles));
double y = top - tileSize.y;
while (idx < tileOffsets.length) {
double x = left;
for (int xi = 0; xi < numTiles; xi++) {
tileOffsets[idx++] = new Vec2D((float) x, (float) y);
x += tileSize.x;
}
y -= tileSize.y;
}
}
public void post() {
if (isTiling) {
subTileID += 0.5;
if (subTileID > 1) {
int x = tileID % numTiles;
int y = tileID / numTiles;
gfx.loadPixels();
buffer.set(x * gfx.width, y * gfx.height, gfx);
if (tileID == tileOffsets.length - 1) {
buffer.save(fileName + "_" + buffer.width + "x"
+ buffer.height + "." + format);
buffer = null;
}
subTileID = 0;
isTiling = (++tileID < tileOffsets.length);
}
}
}
public void pre() {
if (isTiling) {
chooseTile(tileID);
}
}
public void save(String path, String baseName, String format) {
(new File(path)).mkdirs();
this.fileName = path + "/" + baseName;
this.format = format;
buffer = new PImage(gfx.width * numTiles, gfx.height * numTiles);
tileID = 0;
subTileID = 0;
isTiling = true;
}
public boolean isTiling() {
return isTiling;
}
}