source: trunk/packages/vizservers/nanovis/TransferFunction.h @ 2618

Last change on this file since 2618 was 2096, checked in by ldelgass, 13 years ago

Normalize line endings, set eol-style to native on *.cpp, *.h files

  • Property svn:eol-style set to native
File size: 1.5 KB
Line 
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"
22#include <R2/R2Object.h>
23
24
25class TransferFunction : public R2Object {
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    const char *_name;
31    GLuint _id;                 //OpenGL's texture identifier
32protected :
33    ~TransferFunction();
34public:
35    TransferFunction(int size, float *data);
36    void update(float *data);
37    void update(int size, float *data);
38    GLuint id(void) {
39        return _id;
40    }
41    void id(GLuint id) {
42        _id = id;
43    }
44    Texture1D* getTexture(void) {
45        return _tex;
46    }
47    float* getData(void) {
48        return _data;
49    }
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    }
59};
60
61#endif
Note: See TracBrowser for help on using the repository browser.