Source

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 {
  // A static field of points representing the imaging sensor's
  // pixel grid.  We transform these in a vertex shader to recreate
  // the environment.
  vec2f_t points[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 const NSString * const KVSurfaceMode;
extern const NSString * const KVPlainSurfaceMode;
extern const NSString * const KVTexturedSurfaceMode;
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.