kinect-viewer / KVAbstractRenderer.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"
#import "KVRenderer.h"

// Abstract base class for KVRenderers.  Factors out a wee
// bit of boilerplate code.
@interface KVAbstractRenderer : NSObject <KVRenderer> {
  float yRays[240];
  float xRays[320];

// These properties are synthesized for the benefit of
// subclasses.
@property(assign, nonatomic) BOOL lit;
@property(assign, nonatomic) BOOL textured;
@property(retain, nonatomic) NSColor *color;
@property(assign, nonatomic) projective_transform_t colorTransform;

// Sets the properties to sensible defaults.
- init;

// Subclasses must implement -[drawInCurrentOpenGLContext:colors:].

- (vec3f_t) colorAsRGBVector;

- (void) projectInto: (vec3f_t *) coord x: (int) x y: (int) y z: (float) z;


typedef vec3f_t (*KVAbstractRendererProjector)(id, SEL, vec3f_t *, int, int, float);