Last change
on this file since 2801 was
2798,
checked in by ldelgass, 12 years ago
|
Add emacs mode magic line in preparation for indentation cleanup
|
-
Property svn:eol-style set to
native
|
File size:
1.5 KB
|
Rev | Line | |
---|
[2798] | 1 | /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ |
---|
[379] | 2 | /* |
---|
| 3 | * ---------------------------------------------------------------------- |
---|
| 4 | * ColorMap.h: color map class contains an array of (RGBA) values |
---|
| 5 | * |
---|
| 6 | * ====================================================================== |
---|
| 7 | * AUTHOR: Wei Qiao <qiaow@purdue.edu> |
---|
| 8 | * Purdue Rendering and Perceptualization Lab (PURPL) |
---|
| 9 | * |
---|
| 10 | * Copyright (c) 2004-2006 Purdue Research Foundation |
---|
| 11 | * |
---|
| 12 | * See the file "license.terms" for information on usage and |
---|
| 13 | * redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. |
---|
| 14 | * ====================================================================== |
---|
| 15 | */ |
---|
| 16 | |
---|
| 17 | #ifndef _TRANSFER_FUNCTION_H_ |
---|
| 18 | #define _TRANSFER_FUNCTION_H_ |
---|
| 19 | |
---|
| 20 | |
---|
| 21 | #include "Texture1D.h" |
---|
[1475] | 22 | #include <R2/R2Object.h> |
---|
[379] | 23 | |
---|
| 24 | |
---|
[1475] | 25 | class TransferFunction : public R2Object { |
---|
[973] | 26 | int _size; //the resolution of the color map, how many |
---|
| 27 | //(RGBA) quadraples |
---|
| 28 | float* _data; |
---|
| 29 | Texture1D* _tex; //the texture storing the colors |
---|
[1493] | 30 | const char *_name; |
---|
| 31 | GLuint _id; //OpenGL's texture identifier |
---|
[1475] | 32 | protected : |
---|
| 33 | ~TransferFunction(); |
---|
[973] | 34 | public: |
---|
| 35 | TransferFunction(int size, float *data); |
---|
| 36 | void update(float *data); |
---|
| 37 | void update(int size, float *data); |
---|
[1493] | 38 | GLuint id(void) { |
---|
| 39 | return _id; |
---|
| 40 | } |
---|
| 41 | void id(GLuint id) { |
---|
| 42 | _id = id; |
---|
| 43 | } |
---|
[973] | 44 | Texture1D* getTexture(void) { |
---|
| 45 | return _tex; |
---|
| 46 | } |
---|
| 47 | float* getData(void) { |
---|
| 48 | return _data; |
---|
| 49 | } |
---|
[1493] | 50 | int getSize() const { |
---|
| 51 | return _size; |
---|
| 52 | } |
---|
| 53 | const char *name(void) const { |
---|
| 54 | return _name; |
---|
| 55 | } |
---|
| 56 | void name(const char *name) { |
---|
| 57 | _name = name; |
---|
| 58 | } |
---|
[379] | 59 | }; |
---|
| 60 | |
---|
| 61 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.