PImage constructors
|
| PImage(<img>) |
accept a reference to a HTML img object and convert it to a PImage |
| PImage(w, h) |
create a PImage object with default mode RGB (alpha set to 255) |
| PImage(w, h, f) |
create a PImage object with format ARGB |
PImage prototypes
|
| .toImageData |
converts the PImage object to a canvas ImageData object |
| .fromImageData(ImageData) |
converts a canvas ImageData object to a PImage object |
| .get() |
PImage.get() returns a PImage object of itself |
| .get(x,y) |
returns color (int) of PImage coordinate x,y |
| .get(x,y,w,h) |
returns PImage object of width and height at coordinate x,y |
| .set(x,y,color) |
x,y coordinate, color is a color set the pixel that color |
| .copy(sx,sy,sw,sh,dx,dy,dw,dh) |
copy source area to destination area |
| .copy(srcimg,sx,sy,sw,sh,dx,dy,dw,dh) |
copy source area of srcimg to destination area |
| .mask(img) |
a source image to use as the alpha channel for this image |
| .mask(alphaArray) |
an int array to use as the alpha channel for this image |
| .blend(sx,sy,sw,sh,dx,dy,dw,dh,MODE) |
blend the source rect to the dest rect of MODE mode |
| .blend(srcimg,sx,sy,sw,sh,dx,dy,dw,dh,MODE) |
blend the source rect of srcimg to the dest rect of MODE mode |
| .filter(MODE) |
filter an image with mode MODE |
| .filter(MODE, l) |
filter an image with mode MODE and level l (int of range 0-1) |
| .save(filename) |
save the PImage to a file |
| .resize(w,h) |
resize PImage to width and height |
| .loadPixels() |
loadPixel data into PImage objects pixels[] array |
| .updatePixels() |
update the pixels in the PImage objects pixel array |
Processing functions that need updating to handle PImage objects
|
| p.createImage(w,h,f) |
create a PImage object of width height and format specified |
| p.loadImage(f) |
load an image of filename f |
| p.loadImage(f, e) |
load an image of filename f with extension e if no extension given in f |
| p.requestImage(f) |
asynchronously load an image f in a separate thread while continuing sketch execution |
| p.requestImage(f,e) |
asynchronously load an image f with extension e in a seperate thread while continuing sketch execution |
| p.image(img,x,y) |
place a PImage img at x,y coordinate |
| p.image(img,x,y,w,h) |
place a PImage img at x,y coordinate of width w height h |
| p.imageMode(MODE) |
set a flag to tell p.image() how to interpret w,h |
| p.get() |
return a PImage of the current canvas |
| p.get(x,y) |
return the color at coordinate x,y |
| p.get(x,y,w,h) |
return a PImage of width and height at x,y from main canvas |
| p.set(x,y,c) |
x,y coordinate, set this pixel color c |
| p.set(x,y,img) |
x,y coordinate, img is a PImage, draw the PImage there |
| p.loadPixels |
load a pixel array of the main canvas into pixels[] |
| p.updatePixels |
update a pixel array of the main canvas into pixels[] |
| p.blend(sx,sy,sw,sh,dx,dy,dw,dh,MODE) |
blend the source rect to the dest rect of MODE mode |
| p.blend(srcimg,sx,sy,sw,sh,dx,dy,dw,dh,MODE) |
blend the source rect of srcimg to the dest rect of MODE mode |
| p.copy(sx,sy,sw,sh,dx,dy,dw,dh) |
copy source area to destination area |
| p.copy(srcimg,sx,sy,sw,sh,dx,dy,dw,dh) |
copy source area of srcimg to destination area |
| p.filter(MODE) |
filter the canvas with mode MODE |
| p.filter(MODE, l) |
filter the canvas with mode MODE and level l (int of range 0-1) |
| p.pixels[] |
pixel array of the current canvas |
| p.background(b) |
draw the background PImage b to the background |