processing / processing/processing4
Copying PGraphics to PImage using .get() or .copy() clears PGraphics object, if the renderer is P2D
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Java
- Sterne
- 494
- Forks
- 183
- Ø Merge
- 4 Std. 39 Min.
- Gemergte PRs (30 T.)
- 3
Beschreibung
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:
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, die bereitgestellte P2D-Skizze auszuführen und die Einstiegspunkte get() und copy() von PGraphics in der Java-Kernbibliothek nachzuverfolgen. Vergleiche das Verhalten von P2D mit dem Standard-Renderer und prüfe, warum Quelle und Ziel leer werden. Die Arbeit ist abgeschlossen, wenn das Kopieren den Inhalt von PGraphics bewahrt und unter P2D ein gefülltes PImage erzeugt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- java
- Bereich
- computer-graphics
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100