PImage roadmap

Standard

With Processing.js’s 0.7 release coming late this week I’m preparing to get as much PImage content packed up, tested, and approved for this release.

Here is a complete list of everything that has to be done to bring the library in line with being able to handle and use a PImage object internally.

PImage upcoming changes to library

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
Blend modes

BLEND, ADD, SUBTRACT, LIGHTEST, DARKEST, DIFFERENCE, EXCLUSION, MULTIPLY, SCREEN, OVERLAY, HARD_LIGHT, SOFT_LIGHT, DODGE, BURN

Filter modes

THRESHOLD, GRAY, INVERT, POSTERIZE, BLUR, OPAQUE, ERODE, or DILATE

Some of this is done, some is started, some is not yet started.  I’ll be adding tickets to lighthouse later today to keep track of it all and pushing some code this evening for 0.7 review and approval hopefully in time !

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s