processing / processing/processing4
Copying PGraphics to PImage using .get() or .copy() clears PGraphics object, if the renderer is P2D
还没有人认领这个 Issue。
- 主要语言
- Java
- 星标
- 494
- 派生
- 183
- 平均合并
- 4 小时 39 分钟
- 30 天内合并 PR
- 3
描述
Created by: agrshch
Description
An attempt of copying information from PGraphics to PImage using get() or copy() clears the PGraphics object if P2D renderer is used. It makes impossible many things, for example using PGraphics (or its copy) as a texture for the shader.
Expected Behavior
successful copying, like with default renderer
Current Behavior
both PGraphics and PImage are empty.
Steps to Reproduce
PGraphics img1;
void setup() {
size(300, 300, P2D);
img1 = createGraphics(200, 200, P2D);
img1.beginDraw();
img1.background(120);
img1.endDraw();
PImage img2 = img1.get(); // if comment out this line — grey rectangle appears
}
void draw() {
background(255);
image(img1, 100, 20);
}
Your Environment
- Processing version: 4.2
- Operating System and OS version: Mac OS 10.15.7
- Other information:
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先运行提供的 P2D sketch,并跟踪 Java 核心库中 PGraphics 的 get() 和 copy() 入口点。将 P2D 的行为与默认渲染器进行比较,检查源和目标为何会变为空。完成的标准是:复制操作保留 PGraphics 的内容,并在 P2D 下生成一个有内容的 PImage。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- java
- 领域
- computer-graphics
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100