kinect-viewer / KVRenderer.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"

// Projects depth and color data into 3D space, starting from
// scratch at each frame and describing only the nearest visible
// surfaces.
@interface KVRenderer : NSObject {
  // The actual scene model.  Alarmingly, gcc generates suboptimal
  // code if we use [480][640].
  vec3f_t rays[480 * 640];
  
  // Normal vectors for each vertex.
  vec3f_t normals[480 * 640];
  
  // The raw RGB samples of the last color image.  These do not
  // map one-to-one onto rays because the cameras are offset.
  rgb_t colorImage[480][640];
  
  // The raw samples of the last depth image.
  uint16_t depthImage[480][640];
}

// Called within an active GL context to allocate any resources.
- (void) initGL;

// Most recent frame of depth samples, in the format generated by
// KVDataSource.  Note that the setter will either make an internal
// copy of this or simply use it to update an internal model.
- (void) setDepthSamples: (NSData *) depthSamples;

// Most recent frame of depth samples, in the format generated by
// KVDataSource.  Note that the setter will either make an internal
// copy of this or simply use it to update an internal model.
- (void) setColorSamples: (NSData *) colorSamples;

- (void) drawInCurrentOpenGLContextWithOptions: (NSDictionary *) options;

@end

extern NSString * const KVPolygonMode;
extern NSString * const KVFilledPolygonMode;
extern NSString * const KVWireframePolygonMode;
extern NSString * const KVDottedPolygonMode;
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.