Last change
on this file since 1489 was
1475,
checked in by vrinside, 15 years ago
|
mofified a way of dealing with volumes by adding reference counts to data objects.
- To-do : check any memory leaks for graphics objects
|
File size:
1.3 KB
|
Rev | Line | |
---|
[379] | 1 | |
---|
| 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 |
---|
| 30 | |
---|
[1475] | 31 | protected : |
---|
| 32 | ~TransferFunction(); |
---|
[973] | 33 | public: |
---|
| 34 | GLuint id; //OpenGL's texture identifier |
---|
[379] | 35 | |
---|
[973] | 36 | TransferFunction(int size, float *data); |
---|
| 37 | void update(float *data); |
---|
| 38 | void update(int size, float *data); |
---|
| 39 | Texture1D* getTexture(void) { |
---|
| 40 | return _tex; |
---|
| 41 | } |
---|
| 42 | float* getData(void) { |
---|
| 43 | return _data; |
---|
| 44 | } |
---|
[1475] | 45 | int getSize() const; |
---|
[379] | 46 | }; |
---|
| 47 | |
---|
[1475] | 48 | inline int TransferFunction::getSize() const |
---|
| 49 | { |
---|
| 50 | return _size; |
---|
| 51 | } |
---|
[379] | 52 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.