Source

kinect-viewer / KVRenderer.h

Full commit
/*
 * 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