mirror of
https://github.com/processing/processing4.git
synced 2026-02-03 21:59:20 +01:00
add loadPixels() to mask() as well
This commit is contained in:
@@ -352,10 +352,9 @@ public class PImage implements PConstants, Cloneable {
|
||||
int index = y*width + x;
|
||||
int index2 = 0;
|
||||
for (int row = y; row < y+h; row++) {
|
||||
System.arraycopy(pixels, index,
|
||||
newbie.pixels, index2, w);
|
||||
index+=width;
|
||||
index2+=w;
|
||||
System.arraycopy(pixels, index, newbie.pixels, index2, w);
|
||||
index += width;
|
||||
index2 += w;
|
||||
}
|
||||
return newbie;
|
||||
}
|
||||
@@ -455,6 +454,7 @@ public class PImage implements PConstants, Cloneable {
|
||||
* performing a proper luminance-based conversion.
|
||||
*/
|
||||
public void mask(int alpha[]) {
|
||||
loadPixels();
|
||||
// don't execute if mask image is different size
|
||||
if (alpha.length != pixels.length) {
|
||||
throw new RuntimeException("The PImage used with mask() must be " +
|
||||
|
||||
@@ -23,6 +23,9 @@ _ undo this--may need to be better about specifying screen and all
|
||||
X PImage mask doesn't work after first call
|
||||
X http://dev.processing.org/bugs/show_bug.cgi?id=744
|
||||
|
||||
_ work through loadPixels in PImage, how consistent do we need to be?
|
||||
_ with get() and set() methods, this gets really tricky (too slow)
|
||||
|
||||
_ change openStream() to createInput()
|
||||
_ add createOutput() (and raw versions of the same, err.. no raw)
|
||||
_ deprecate openStream() naming
|
||||
|
||||
Reference in New Issue
Block a user