Commits

Cliff Biffle committed 18f7166

KVRenderers no longer maintain their own Z-buffers -- this is now the job of KVDepthMap. This restores the ability to change renderers during freeze-frame, and prepares the way for reimplementing foreground isolation.

Comments (0)

Files changed (18)

KVAbstractRenderer.h

+/*
+ * Copyright 2010 Cliff L. Biffle.  All Rights Reserved.
+ * Use of this source code is governed by the Apache License 2.0,
+ * which can be found in the LICENSE file.
+ */
+
+#import <Cocoa/Cocoa.h>
+#import "types.h"
+#import "KVRenderer.h"
+
+// Abstract base class for KVRenderers.  Factors out a wee
+// bit of boilerplate code.
+@interface KVAbstractRenderer : NSObject <KVRenderer> {
+}
+
+// These properties are synthesized for the benefit of
+// subclasses.
+@property(assign, nonatomic) BOOL useLighting;
+@property(retain, nonatomic) NSColor *color;
+
+// Sets the properties to sensible defaults.
+- init;
+
+// Subclasses must implement -[drawInCurrentOpenGLContext].
+
+- (vec3f_t) colorAsRGBVector;
+
+@end

KVAbstractRenderer.m

+/*
+ * Copyright 2010 Cliff L. Biffle.  All Rights Reserved.
+ * Use of this source code is governed by the Apache License 2.0,
+ * which can be found in the LICENSE file.
+ */
+
+#import "KVAbstractRenderer.h"
+
+@implementation KVAbstractRenderer
+#pragma mark --- NSObject Overrides
+
+- init {
+  if ((self = [super init])) {
+    self.color = [NSColor colorWithDeviceRed: 1.F green: 1.F blue: 1.F alpha: 1.F];
+  }
+  return self;
+}
+
+#pragma mark --- KVRenderer implementation (partial)
+
+@synthesize useLighting;
+@synthesize color;
+
+- (void) drawInCurrentOpenGLContext: (const linear_depth_t *)zs {
+  [self doesNotRecognizeSelector: _cmd];  // subclass responsibility
+}
+
+- (vec3f_t) colorAsRGBVector {
+  return (vec3f_t) {
+    [color redComponent],
+    [color greenComponent],
+    [color blueComponent]
+  };
+}
+
+@end
+/*
+ * Copyright 2010 Cliff L. Biffle.  All Rights Reserved.
+ * Use of this source code is governed by the Apache License 2.0,
+ * which can be found in the LICENSE file.
+ */
+
+#import <Cocoa/Cocoa.h>
+#import "types.h"
+
+@protocol KVRenderer;
+
+//
+// Transforms depth samples to an internal representation,
+// and provides them to renderers on request.
+@protocol KVDepthMap
+
+// Updates the internal state with a new set of depth
+// samples.
+- (void) update: (const depth_t *)rawDepthSamples;
+
+// Provides a linearized floating-point depth map to the
+// given renderer -- possibly multiple times.
+// Implementations may freely reconfigure the renderer.
+- (void) drawInCurrentOpenGLContextWithRenderer: (id <KVRenderer>) renderer;
+
+@end
 #import "types.h"
 #import "KFKinect.h"
 #import "KVRenderer.h"
+#import "KVDepthMap.h"
 
 typedef struct {
   vec3f_t pos;
   NSColor *devicePurplish;
 }
 
+@property(retain) NSObject <KVDepthMap> *depthMap;
 @property(retain) NSObject <KVRenderer> *renderer;
 @property(assign) BOOL frozen;
 @property(assign, nonatomic) BOOL anaglyph;
 #import "KVPointCloudRenderer.h"
 #import "KVQuadRenderer.h"
 #import "KVTriStripRenderer.h"
+#import "KVSinglePlaneDepthMap.h"
 #import "trackball.h"
 #import "utility.h"
 
 #pragma mark --- Properties ---
 
 @synthesize lightsOn;
+@synthesize depthMap;
 
 @synthesize renderer;
 - (void) setRenderer: (NSObject <KVRenderer> *)newRenderer {
   deviceWhite = [[NSColor colorWithDeviceRed: 1.F green: 1.F blue: 1.F alpha: 1.F] retain];
   devicePurplish = [[NSColor colorWithDeviceRed: 1.F green: 0.5F blue: 1.F alpha: 1.F] retain];
   [self selectPointCloudRenderer: nil];
+  self.depthMap = [[[KVSinglePlaneDepthMap alloc] init] autorelease];
 }
 
 #pragma mark --- NSOpenGLView Overrides ---
   
   // Draw right eye or center.
   [self updateModelView];
-  [renderer drawInCurrentOpenGLContext];
+  [depthMap drawInCurrentOpenGLContextWithRenderer: renderer];
   
   if (self.anaglyph) {
     // Draw left eye.
     
     glColorMask(GL_TRUE, GL_FALSE, GL_FALSE, GL_TRUE);
     [self updateModelView];
-    [renderer drawInCurrentOpenGLContext];
+    [depthMap drawInCurrentOpenGLContextWithRenderer: renderer];
 
     glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
     
   }
       
   if (!self.frozen) {
-    [renderer update: buffer];
+    [depthMap update: buffer];
     [self setNeedsDisplay: YES];
   }
 }

KVPointCloudRenderer.h

  */
 
 #import <Cocoa/Cocoa.h>
-#import "KVSinglePlaneRenderer.h"
+#import "KVAbstractRenderer.h"
 
 // Renders depth samples into a cloud of zero-dimensional
 // points in 3D space.
-@interface KVPointCloudRenderer : KVSinglePlaneRenderer {
+@interface KVPointCloudRenderer : KVAbstractRenderer {
 }
 
-- (void) drawInCurrentOpenGLContext;
-
 @end

KVPointCloudRenderer.m

 
 @implementation KVPointCloudRenderer
 
-- (void) drawInCurrentOpenGLContext {
-  // Avoid the ivar indirection for a very slight perf win.
-  const linear_depth_t *localZs = &zs;
+- (void) drawInCurrentOpenGLContext: (const linear_depth_t *)zs {
   // Avoid the property message send for a significant perf win.
   // (Sending a message doubles our render time.)
   BOOL lights = self.useLighting;
   
   for (int y = 0; y < 480; y++) {
     for (int x = 0; x < 640; x++) {
-      GLfloat d = localZs->z[y][x];
+      GLfloat d = zs->z[y][x];
       if (d == 0.F) continue;
       
       vec3f_t coords = correctPerspective(x, y, d);
  */
 
 #import <Cocoa/Cocoa.h>
-#import "KVSinglePlaneRenderer.h"
+#import "KVAbstractRenderer.h"
 
 // Renders depth samples by joining them to their
 // neighbors using quads.  Correctly computes surface
 // normals, etc.
-@interface KVQuadRenderer : KVSinglePlaneRenderer {
+@interface KVQuadRenderer : KVAbstractRenderer {
 }
 
-- (void) drawInCurrentOpenGLContext;
-
 @end
 
 @implementation KVQuadRenderer
 
-- (void) drawInCurrentOpenGLContext {
-  // Avoid ivar indirection for slight performance win.
-  const linear_depth_t *localZs = &zs;
+- (void) drawInCurrentOpenGLContext: (const linear_depth_t *)zs {
   // Avoid message send for large performance win.
   BOOL lightsOn = self.useLighting;
   
       GLfloat colors[4];
       GLfloat minDepth = 1000.F, maxDepth = -1000.F;
       for (int i = 0; i < 4; i++) {
-        GLfloat d = localZs->z[ys[i]][xs[i]];
+        GLfloat d = zs->z[ys[i]][xs[i]];
         
         if (d == 0.F) skip = YES;
         
 // or even ignore this color.
 @property(retain, nonatomic) NSColor *color;
 
-// Updates the renderer's internal state with a new set
-// of depth samples.  OpenGL will *not* be available when
-// this method is called.
-- (void) update: (const depth_t *)rawDepthSamples;
-
 // Applies the renderer's internal state to the currently
 // active OpenGL context.  This method may be called many
 // times for a single call to -[update:].
-- (void) drawInCurrentOpenGLContext;
+- (void) drawInCurrentOpenGLContext: (const linear_depth_t *)zs;
 
 @end

KVSinglePlaneDepthMap.h

+//
+//  KVSinglePlaneDepthMap.h
+//  KinectViewer
+//
+//  Created by Cliff L. Biffle on 2010-11-26.
+//  Copyright 2010 Cliff L. Biffle. All rights reserved.
+//
+
+#import <Cocoa/Cocoa.h>
+#import "types.h"
+#import "KVDepthMap.h"
+
+@interface KVSinglePlaneDepthMap : NSObject <KVDepthMap> {
+ @private
+  GLfloat linearizationTable[2048];
+  linear_depth_t zs;
+}
+
+@end

KVSinglePlaneDepthMap.m

+//
+//  KVSinglePlaneDepthMap.m
+//  KinectViewer
+//
+//  Created by Cliff L. Biffle on 2010-11-26.
+//  Copyright 2010 Cliff L. Biffle. All rights reserved.
+//
+
+#import "KVSinglePlaneDepthMap.h"
+#import "KVRenderer.h"
+
+@interface KVSinglePlaneDepthMap ()
+- (void) buildLinearizationTable;
+@end
+
+@implementation KVSinglePlaneDepthMap
+
+- init {
+  if ((self = [super init])) {
+    [self buildLinearizationTable];
+  }
+  return self;
+}
+
+#pragma mark --- KVDepthMap implementation
+
+- (void) update: (const depth_t *)rawDepthSamples {
+  linear_depth_t *out = &zs;  // Avoid ivar indirection during loop.
+  
+  for (int y = 0; y < 480; y++) {
+    for (int x = 0; x < 640; x++) {
+      out->z[y][x] = linearizationTable[rawDepthSamples->samples[y][x]];
+    }
+  }
+}
+
+- (void) drawInCurrentOpenGLContextWithRenderer: (id <KVRenderer>) renderer {
+  [renderer drawInCurrentOpenGLContext: &zs];
+}
+
+#pragma mark --- Internals
+
+// The Kinect produces 11-bit depth samples.  Z-resolution decreases
+// with distance, following a curve that looks suspiciously like the
+// one used for perspective projection.  The ROS folks at CCNY derived
+// the equation below, for converting Kinect depth samples to meters.
+// This method memoizes the function over the entire 2048-element
+// domain.  This implies replacing a couple of floating-point constant
+// loads, an addition, and a division with an indirection to very hot
+// memory.  On my machine this eliminates 60% of time spent calculating
+// linear depths.
+- (void) buildLinearizationTable {
+  for (uint16_t depth = 0; depth < 2048; depth++) {
+    linearizationTable[depth] = -325.616F / ((GLfloat) depth + -1084.61F);
+    
+    // Simplification: when the Kinect reports "no data" for a point
+    // (typically because the IR projector is occluded) the result is
+    // a "very close" reading of nearly zero meters.  All my renderers
+    // filter out such readings, so we coerce it to exactly 0.F here
+    // to simplify that.
+    if (linearizationTable[depth] < 0.1F) {
+      linearizationTable[depth] = 0.F;
+    }
+  }
+}
+
+@end

KVSinglePlaneRenderer.h

-/*
- * Copyright 2010 Cliff L. Biffle.  All Rights Reserved.
- * Use of this source code is governed by the Apache License 2.0,
- * which can be found in the LICENSE file.
- */
-
-#import <Cocoa/Cocoa.h>
-#import "types.h"
-#import "KVRenderer.h"
-
-// Our single-precision Z buffer.  Roughly in meters.
-typedef struct {
-  GLfloat z[480][640];
-} linear_depth_t;
-
-// Abstract base class for KVRenderers that operate on a
-// simple two-dimensional Z-plane with single precision.
-@interface KVSinglePlaneRenderer : NSObject <KVRenderer> {
-@protected
-  // The Z-buffer produced by the last call to -[update:].
-  linear_depth_t zs;
-  
-@private
-  GLfloat linearizationTable[2048];
-}
-
-// These properties are synthesized for the benefit of
-// subclasses.
-@property(assign, nonatomic) BOOL useLighting;
-@property(retain, nonatomic) NSColor *color;
-
-// This implementation simply linearizes all samples
-// into our Z-buffer.
-- (void) update: (const depth_t *)rawDepthSamples;
-
-// Subclasses must implement -[drawInCurrentOpenGLContext].
-
-- (vec3f_t) colorAsRGBVector;
-
-@end

KVSinglePlaneRenderer.m

-/*
- * Copyright 2010 Cliff L. Biffle.  All Rights Reserved.
- * Use of this source code is governed by the Apache License 2.0,
- * which can be found in the LICENSE file.
- */
-
-#import "KVSinglePlaneRenderer.h"
-
-@interface KVSinglePlaneRenderer ()
-- (void) buildLinearizationTable;
-@end
-
-@implementation KVSinglePlaneRenderer
-#pragma mark --- NSObject Overrides
-
-- init {
-  if ((self = [super init])) {
-    [self buildLinearizationTable];
-    self.color = [NSColor colorWithDeviceRed: 1.F green: 1.F blue: 1.F alpha: 1.F];
-  }
-  return self;
-}
-
-#pragma mark --- KVRenderer implementation (partial)
-
-@synthesize useLighting;
-@synthesize color;
-
-- (void) update: (const depth_t *)rawDepthSamples {
-  linear_depth_t *out = &zs;  // Avoid ivar indirection during loop.
-
-  for (int y = 0; y < 480; y++) {
-    for (int x = 0; x < 640; x++) {
-      out->z[y][x] = linearizationTable[rawDepthSamples->samples[y][x]];
-    }
-  }
-}
-
-- (void) drawInCurrentOpenGLContext {
-  [self doesNotRecognizeSelector: _cmd];  // subclass responsibility
-}
-
-- (vec3f_t) colorAsRGBVector {
-  return (vec3f_t) {
-    [color redComponent],
-    [color greenComponent],
-    [color blueComponent]
-  };
-}
-
-#pragma mark --- Internals
-
-// The Kinect produces 11-bit depth samples.  Z-resolution decreases
-// with distance, following a curve that looks suspiciously like the
-// one used for perspective projection.  The ROS folks at CCNY derived
-// the equation below, for converting Kinect depth samples to meters.
-// This method memoizes the function over the entire 2048-element
-// domain.  This implies replacing a couple of floating-point constant
-// loads, an addition, and a division with an indirection to very hot
-// memory.  On my machine this eliminates 60% of time spent calculating
-// linear depths.
-- (void) buildLinearizationTable {
-  for (uint16_t depth = 0; depth < 2048; depth++) {
-    linearizationTable[depth] = -325.616F / ((GLfloat) depth + -1084.61F);
-    
-    // Simplification: when the Kinect reports "no data" for a point
-    // (typically because the IR projector is occluded) the result is
-    // a "very close" reading of nearly zero meters.  All my renderers
-    // filter out such readings, so we coerce it to exactly 0.F here
-    // to simplify that.
-    if (linearizationTable[depth] < 0.1F) {
-      linearizationTable[depth] = 0.F;
-    }
-  }
-}
-
-@end

KVTriStripRenderer.h

  */
 
 #import <Cocoa/Cocoa.h>
-#import "KVSinglePlaneRenderer.h"
+#import "KVAbstractRenderer.h"
 
 // Renders depth samples by joining adjacent samples
 // into triangle strips.  Computes almost-correct
 // vertex normals for smooth shading.
-@interface KVTriStripRenderer : KVSinglePlaneRenderer {
+@interface KVTriStripRenderer : KVAbstractRenderer {
 }
 
-- (void) drawInCurrentOpenGLContext;
-
 @end

KVTriStripRenderer.m

 
 @implementation KVTriStripRenderer
 
-- (void) drawInCurrentOpenGLContext {
+- (void) drawInCurrentOpenGLContext: (const linear_depth_t *)zs {
   // Theory: each horizontal raster row of the image is converted to a
   // triangle strip, using the simplest possible method:
   //
   // |/|/|/
   // 1 3 5   ...and so on.
   
-  // Avoid ivar indirection for a small performance win.
-  const linear_depth_t *localZs = &zs;
   // Avoid message send for a large performance win.
   BOOL lightsOn = self.useLighting;
   
     // Whether we have called glBegin
     BOOL inStrip = YES;
     // Z of last point rendered, for slope test.
-    GLfloat lastDepth = localZs->z[y][0];
+    GLfloat lastDepth = zs->z[y][0];
     
     // By not initializing prev here we will calcluate bogus
     // normals along the leftmost edge.  So be it.
     for (int x = 0; x < 640; x++) {
       
       for (int step = 0; step < 2; step++) {
-        GLfloat d = localZs->z[(y + step)][x];
+        GLfloat d = zs->z[(y + step)][x];
         GLfloat deltaZ = fabsf(d - lastDepth);
         lastDepth = d;
         

KinectViewer.xcodeproj/project.pbxproj

 		8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
 		8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
 		8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
-		C708F46412A03E8500656901 /* KVSinglePlaneRenderer.m in Sources */ = {isa = PBXBuildFile; fileRef = C708F46112A03E8500656901 /* KVSinglePlaneRenderer.m */; };
+		C708F46412A03E8500656901 /* KVAbstractRenderer.m in Sources */ = {isa = PBXBuildFile; fileRef = C708F46112A03E8500656901 /* KVAbstractRenderer.m */; };
 		C708F46512A03E8500656901 /* KVTriStripRenderer.m in Sources */ = {isa = PBXBuildFile; fileRef = C708F46312A03E8500656901 /* KVTriStripRenderer.m */; };
 		C708F46A12A03E8F00656901 /* KVPointCloudRenderer.m in Sources */ = {isa = PBXBuildFile; fileRef = C708F46712A03E8F00656901 /* KVPointCloudRenderer.m */; };
 		C708F46B12A03E8F00656901 /* KVQuadRenderer.m in Sources */ = {isa = PBXBuildFile; fileRef = C708F46912A03E8F00656901 /* KVQuadRenderer.m */; };
+		C708F55912A0728800656901 /* KVSinglePlaneDepthMap.m in Sources */ = {isa = PBXBuildFile; fileRef = C708F55812A0728800656901 /* KVSinglePlaneDepthMap.m */; };
 		C70E62AF129C5055004A44B3 /* KVDepthView.m in Sources */ = {isa = PBXBuildFile; fileRef = C70E62AE129C5055004A44B3 /* KVDepthView.m */; };
 		C70E62FB129C572E004A44B3 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C70E62FA129C572E004A44B3 /* OpenGL.framework */; };
 		C70E635F129C63BE004A44B3 /* trackball.c in Sources */ = {isa = PBXBuildFile; fileRef = C70E635D129C63BE004A44B3 /* trackball.c */; };
 		C708F28C129F95C100656901 /* types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = types.h; sourceTree = "<group>"; };
 		C708F3D8129FAE4300656901 /* utility.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = utility.h; sourceTree = "<group>"; };
 		C708F45F12A03E6500656901 /* KVRenderer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KVRenderer.h; sourceTree = "<group>"; };
-		C708F46012A03E8500656901 /* KVSinglePlaneRenderer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KVSinglePlaneRenderer.h; sourceTree = "<group>"; };
-		C708F46112A03E8500656901 /* KVSinglePlaneRenderer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KVSinglePlaneRenderer.m; sourceTree = "<group>"; };
+		C708F46012A03E8500656901 /* KVAbstractRenderer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KVAbstractRenderer.h; sourceTree = "<group>"; };
+		C708F46112A03E8500656901 /* KVAbstractRenderer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KVAbstractRenderer.m; sourceTree = "<group>"; };
 		C708F46212A03E8500656901 /* KVTriStripRenderer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KVTriStripRenderer.h; sourceTree = "<group>"; };
 		C708F46312A03E8500656901 /* KVTriStripRenderer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KVTriStripRenderer.m; sourceTree = "<group>"; };
 		C708F46612A03E8F00656901 /* KVPointCloudRenderer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KVPointCloudRenderer.h; sourceTree = "<group>"; };
 		C708F46712A03E8F00656901 /* KVPointCloudRenderer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KVPointCloudRenderer.m; sourceTree = "<group>"; };
 		C708F46812A03E8F00656901 /* KVQuadRenderer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KVQuadRenderer.h; sourceTree = "<group>"; };
 		C708F46912A03E8F00656901 /* KVQuadRenderer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KVQuadRenderer.m; sourceTree = "<group>"; };
+		C708F55412A0726800656901 /* KVDepthMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KVDepthMap.h; sourceTree = "<group>"; };
+		C708F55712A0728800656901 /* KVSinglePlaneDepthMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KVSinglePlaneDepthMap.h; sourceTree = "<group>"; };
+		C708F55812A0728800656901 /* KVSinglePlaneDepthMap.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KVSinglePlaneDepthMap.m; sourceTree = "<group>"; };
 		C70E62AD129C5055004A44B3 /* KVDepthView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KVDepthView.h; sourceTree = "<group>"; };
 		C70E62AE129C5055004A44B3 /* KVDepthView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KVDepthView.m; sourceTree = "<group>"; };
 		C70E62FA129C572E004A44B3 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = System/Library/Frameworks/OpenGL.framework; sourceTree = SDKROOT; };
 				C70E6685129C8FD5004A44B3 /* KFKinect.m */,
 				256AC3D80F4B6AC300CF3369 /* KinectViewerAppDelegate.h */,
 				256AC3D90F4B6AC300CF3369 /* KinectViewerAppDelegate.m */,
+				C708F55412A0726800656901 /* KVDepthMap.h */,
+				C708F55712A0728800656901 /* KVSinglePlaneDepthMap.h */,
+				C708F55812A0728800656901 /* KVSinglePlaneDepthMap.m */,
 				C70E62AD129C5055004A44B3 /* KVDepthView.h */,
 				C70E62AE129C5055004A44B3 /* KVDepthView.m */,
 				C708F45F12A03E6500656901 /* KVRenderer.h */,
-				C708F46012A03E8500656901 /* KVSinglePlaneRenderer.h */,
-				C708F46112A03E8500656901 /* KVSinglePlaneRenderer.m */,
+				C708F46012A03E8500656901 /* KVAbstractRenderer.h */,
+				C708F46112A03E8500656901 /* KVAbstractRenderer.m */,
 				C708F46612A03E8F00656901 /* KVPointCloudRenderer.h */,
 				C708F46712A03E8F00656901 /* KVPointCloudRenderer.m */,
 				C708F46812A03E8F00656901 /* KVQuadRenderer.h */,
 				C70E62AF129C5055004A44B3 /* KVDepthView.m in Sources */,
 				C70E635F129C63BE004A44B3 /* trackball.c in Sources */,
 				C70E6691129C8FD5004A44B3 /* KFKinect.m in Sources */,
-				C708F46412A03E8500656901 /* KVSinglePlaneRenderer.m in Sources */,
+				C708F46412A03E8500656901 /* KVAbstractRenderer.m in Sources */,
 				C708F46512A03E8500656901 /* KVTriStripRenderer.m in Sources */,
 				C708F46A12A03E8F00656901 /* KVPointCloudRenderer.m in Sources */,
 				C708F46B12A03E8F00656901 /* KVQuadRenderer.m in Sources */,
+				C708F55912A0728800656901 /* KVSinglePlaneDepthMap.m in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
   uint16_t samples[480][640];
 } depth_t;
 
+// A single-precision Z buffer.  Roughly in meters.
+typedef struct {
+  float z[480][640];
+} linear_depth_t;
+
 #endif __types_h__
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.