Java Code Examples for processing.core.PImage#ALPHA

The following examples show how to use processing.core.PImage#ALPHA . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Device.java    From KinectPV2 with MIT License 4 votes vote down vote up
/**
 * Start device
 *
 * @param _p
 *            PApplet
 */
public Device(PApplet _p) {
	parent = _p;
	// SETUP IMAGES
	colorImg = new Image(parent, WIDTHColor, HEIGHTColor, PImage.ARGB);
	depthImg = new Image(parent, WIDTHDepth, HEIGHTDepth, PImage.ALPHA);
	depth256Img = new Image(parent, WIDTHDepth, HEIGHTDepth, PImage.ALPHA);
	infraredImg = new Image(parent, WIDTHDepth, HEIGHTDepth, PImage.ALPHA);

	bodyTrackImg = new Image(parent, WIDTHDepth, HEIGHTDepth, PImage.RGB);
	depthMaskImg = new Image(parent, WIDTHDepth, HEIGHTDepth, PImage.RGB);

	bodyTrackUsersImg = new Image[BODY_COUNT];
	for (int i = 0; i < BODY_COUNT; i++) {
		bodyTrackUsersImg[i] = new Image(parent, WIDTHDepth, HEIGHTDepth, PImage.RGB);
	}

	infraredLongExposureImg = new Image(parent, WIDTHDepth, HEIGHTDepth,
			PImage.ALPHA);

	pointCloudDepthImg = new Image(parent, WIDTHDepth, HEIGHTDepth,
			PImage.ALPHA);

	pointCloudDepthPos = Buffers.newDirectFloatBuffer(WIDTHDepth
			* HEIGHTDepth * 3);

	pointCloudColorPos = Buffers.newDirectFloatBuffer(WIDTHColor
			* HEIGHTColor * 3);
	colorChannelBuffer = Buffers.newDirectFloatBuffer(WIDTHColor
			* HEIGHTColor * 3);

	// SETUP SKELETON
	skeletonDepth = new KSkeleton[BODY_COUNT];
	for (int i = 0; i < BODY_COUNT; i++) {
		skeletonDepth[i] = new KSkeleton();
	}

	skeleton3d = new KSkeleton[BODY_COUNT];
	for (int i = 0; i < BODY_COUNT; i++) {
		skeleton3d[i] = new KSkeleton();
	}

	skeletonColor = new KSkeleton[BODY_COUNT];
	for (int i = 0; i < BODY_COUNT; i++) {
		skeletonColor[i] = new KSkeleton();
	}

	// SETUP FACEDATA
	faceData = new FaceData[BODY_COUNT];
	for (int i = 0; i < BODY_COUNT; i++) {
		faceData[i] = new FaceData();
	}

	HDFace = new HDFaceData[BODY_COUNT];
	for (int i = 0; i < BODY_COUNT; i++) {
		HDFace[i] = new HDFaceData();
	}

	//colors
	depthColorBuffer       = Buffers.newDirectIntBuffer(WIDTHDepth * HEIGHTDepth);
	irColorBuffer          = Buffers.newDirectIntBuffer(WIDTHDepth * HEIGHTDepth);
	registeredColorBuffer  = Buffers.newDirectIntBuffer(WIDTHDepth * HEIGHTDepth);

	startSensor = false;

	jniDevice();

}
 
Example 2
Source File: Device.java    From KinectPV2 with MIT License 4 votes vote down vote up
/**
 * Start device
 * 
 * @param _p
 *            PApplet
 */
public Device(PApplet _p) {
	parent = _p;
	// SETUP IMAGES
	colorImg = new Image(parent, WIDTHColor, HEIGHTColor, PImage.ARGB);
	depthImg = new Image(parent, WIDTHDepth, HEIGHTDepth, PImage.ALPHA);
	depth256Img = new Image(parent, WIDTHDepth, HEIGHTDepth, PImage.ALPHA);
	infraredImg = new Image(parent, WIDTHDepth, HEIGHTDepth, PImage.ALPHA);

	bodyTrackImg = new Image(parent, WIDTHDepth, HEIGHTDepth, PImage.RGB);
	depthMaskImg = new Image(parent, WIDTHDepth, HEIGHTDepth, PImage.RGB);
	

	bodyTrackUsersImg = new Image[BODY_COUNT];
	for (int i = 0; i < BODY_COUNT; i++) {
		bodyTrackUsersImg[i] = new Image(parent, WIDTHDepth, HEIGHTDepth, PImage.RGB);
	}  
	

	infraredLongExposureImg = new Image(parent, WIDTHDepth, HEIGHTDepth,
			PImage.ALPHA);

	pointCloudDepthImg = new Image(parent, WIDTHDepth, HEIGHTDepth,
			PImage.ALPHA);

	pointCloudDepthPos = Buffers.newDirectFloatBuffer(WIDTHDepth
			* HEIGHTDepth * 3);
	pointCloudColorPos = Buffers.newDirectFloatBuffer(WIDTHColor
			* HEIGHTColor * 3);
	colorChannelBuffer = Buffers.newDirectFloatBuffer(WIDTHColor
			* HEIGHTColor * 3);

	// SETUP SKELETON
	skeletonDepth = new Skeleton[BODY_COUNT];
	for (int i = 0; i < BODY_COUNT; i++) {
		skeletonDepth[i] = new Skeleton();
	}

	skeleton3d = new Skeleton[BODY_COUNT];
	for (int i = 0; i < BODY_COUNT; i++) {
		skeleton3d[i] = new Skeleton();
	}

	skeletonColor = new Skeleton[BODY_COUNT];
	for (int i = 0; i < BODY_COUNT; i++) {
		skeletonColor[i] = new Skeleton();
	}

	// SETUP FACEDATA
	faceData = new FaceData[BODY_COUNT];
	for (int i = 0; i < BODY_COUNT; i++) {
		faceData[i] = new FaceData();
	}

	HDFace = new HDFaceData[BODY_COUNT];
	for (int i = 0; i < BODY_COUNT; i++) {
		HDFace[i] = new HDFaceData();
	}
	
	startSensor = false;

	jniDevice();

}