mirror of
https://github.com/processing/processing4.git
synced 2026-02-11 09:39:19 +01:00
rockin the video
This commit is contained in:
@@ -75,7 +75,7 @@ public class PImage implements PConstants, Cloneable {
|
||||
boolean smooth = false;
|
||||
|
||||
// for gl subclass / hardware accel
|
||||
int cacheIndex;
|
||||
public int cacheIndex;
|
||||
|
||||
// private fields
|
||||
private int fracU, ifU, fracV, ifV, u1, u2, v1, v2, sX, sY, iw, iw1, ih1;
|
||||
@@ -104,7 +104,8 @@ public class PImage implements PConstants, Cloneable {
|
||||
* alpha is zero, it will be transparent.
|
||||
*/
|
||||
public PImage(int width, int height) {
|
||||
this(new int[width * height], width, height, RGBA);
|
||||
setup(width, height, RGBA);
|
||||
//this(new int[width * height], width, height, RGBA);
|
||||
// toxi: is it maybe better to init the image with max alpha enabled?
|
||||
//for(int i=0; i<pixels.length; i++) pixels[i]=0xffffffff;
|
||||
// fry: i'm opting for the full transparent image, which is how
|
||||
@@ -125,6 +126,18 @@ public class PImage implements PConstants, Cloneable {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function to be used by subclasses to setup their own bidness.
|
||||
*/
|
||||
public void setup(int width, int height, int format) {
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
this.pixels = new int[width*height];
|
||||
this.format = format;
|
||||
this.cacheIndex = -1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Construct a new PImage from a java.awt.Image
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user