protected:
+ FILE *file;
typedef struct _ImageRec {
unsigned short imagic;
unsigned short type;
unsigned int wasteBytes;
char name[80];
unsigned long colorMap;
- gzFile gzfile;
- FILE *file;
- GLubyte *tmp, *tmpR, *tmpG, *tmpB;
+ gzFile file;
+ GLubyte *tmp;
unsigned long rleEnd;
unsigned int *rowStart;
int *rowSize;
inline GLuint id() { return texture_id; }
inline GLubyte *texture() { return texture_data; }
inline void set_data(GLubyte *data) { texture_data = data; }
+ // inline void set_colors(int c) { num_colors = c; }
inline int width() { return texture_width; }
inline int height() { return texture_height; }
+ inline int colors() { return num_colors; }
// dynamic texture functions.
// everything drawn to the OpenGL screen after prepare is
void finish(unsigned int width, unsigned int height);
// texture pixel manipulation functions.
- void set_pixel(GLuint x, GLuint y, sgVec3 &c);
- float *get_pixel(GLuint x, GLuint y);
+ void set_pixel(GLuint x, GLuint y, GLubyte *c);
+ GLubyte *get_pixel(GLuint x, GLuint y);
void bind();
inline void select(bool keep_data = false) {
inline const char *err_str() { return errstr; }
inline void clear_err_str() { errstr = ""; }
+
+ void make_maxcolorwindow();
+ void make_grayscale(float contrast = 1.0);
+ void make_monochrome(float contrast = 1.0,
+ GLubyte r=255, GLubyte g=255, GLubyte b=255);
+ void make_normalmap(float brightness = 1.0, float contrast = 1.0);
+ void make_bumpmap(float brightness = 1.0, float contrast = 1.0);
};
#endif