public PImage get(int index, int fg) { PImage msk = font[index]; PImage img = pa.createImage(msk.width, msk.height, PConstants.RGB); msk.loadPixels(); img.loadPixels(); for (int i = 0; i < img.pixels.length; i++) { img.pixels[i] = fg; } img.mask(msk); return img; }
public PImage get(int index, int fg, int bg) { PImage msk = font[index]; PImage img = pa.createImage(msk.width, msk.height, PConstants.RGB); msk.loadPixels(); img.loadPixels(); for (int i = 0; i < msk.pixels.length; i++) { if (msk.pixels[i] == Colors.WHITE) { img.pixels[i] = fg; } else { img.pixels[i] = bg; } } return img; }
public KinectTracker() { kinect = new Kinect(p); kinect.start(); kinect.enableDepth(true); // Calibration du degrŽ de la camŽra kinect.tilt(deg); // Mise en place de la kinect en mode dŽtecteur de mouvement (rouge) kinect.led(LEDStatus.LED_RED); // We could skip processing the grayscale image for efficiency // but this example is just demonstrating everything kinect.processDepthImage(true); display = p.createImage(kw, kh, PConstants.RGB); loc = new PVector(0, 0); lerpedLoc = new PVector(0, 0); }