Commits

Cliff Biffle committed fe74e9d

computeLinearDepthField now takes the output buffer as an argument, so I can compute multiple depth fields.

Comments (0)

Files changed (1)

 - (void) updateProjection;
 - (void) updateModelView;
 
-- (void) computeLinearDepthField;
+- (void) computeLinearDepthField: (NSMutableData *)output;
 - (void) drawDepthFieldAsPoints;
 - (void) drawDepthFieldAsCards;
 - (void) drawDepthFieldAsMesh;
 
 - (void) depthFieldUpdated: (KFKinect *)kinect {
   if (!self.frozen) {
-    [self computeLinearDepthField];
+    [self computeLinearDepthField: linearDepthField];
     [self setNeedsDisplay: YES];
   }
 }
   glLightfv(GL_LIGHT0, GL_POSITION, lightPos);
 }
 
-- (void) computeLinearDepthField {
+- (void) computeLinearDepthField: (NSMutableData *)output {
   const uint16_t *depths = [rawDepthField bytes];
-  GLfloat *linear = [linearDepthField mutableBytes];
+  GLfloat *linear = [output mutableBytes];
   
   for (int y = 0; y < 480; y++) {
     for (int x = 0; x < 640; x++) {