kinect-viewer / KVRayFieldSpaceModel.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 "KVSpaceModel.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 KVRayFieldSpaceModel : NSObject <KVSpaceModel> {
  // Memoized linearization function for 12-bit depth samples.
  float linearizationTable[2048];
  // The X coordinate of each unit ray.
  float unitX[640];
  // The Y coordinate of each unit ray.
  float unitY[480];
  // 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];


extern NSString * const KVPolygonMode;
extern NSString * const KVFilledPolygonMode;
extern NSString * const KVWireframePolygonMode;
extern NSString * const KVDottedPolygonMode;

extern NSString * const KVLighting;
extern NSString * const KVNoLighting;
extern NSString * const KVDiffuseLighting;