#ifndef VOLUME_DATA_STRUCT_H #define VOLUME_DATA_STRUCT_H #include "rts_glTextureMap.h" #include "rtsFilename.h" #define VOLUME_FILE_AUTO 0 #define VOLUME_FILE_RAW 1 #define VOLUME_FILE_IMAGES 2 #define LOAD_LITTLE_ENDIAN 0 #define LOAD_BIG_ENDIAN 1 struct VolumeData { //character name of the texture for the shader string Name; //RTS variable for the texture map (takes care of texture management) rts_glTextureMap Texture; //file information int FileType; vector Filenames; //volume size vector3D Dim; int HeaderSize; //big or little endian int BitType; //format of the incoming data int ExternalComponents; GLuint ExternalDatatype; //format of the data on the GPU int InternalComponents; GLuint InternalDatatype; int Normalized; GLuint getInternalFormat() { switch(InternalComponents) { case 1: if(InternalDatatype == GL_FLOAT) return GL_LUMINANCE32F_ARB; if(InternalDatatype == GL_UNSIGNED_BYTE && !Normalized) return GL_R8; if(InternalDatatype == GL_UNSIGNED_BYTE && Normalized) return GL_R8_SNORM; if(InternalDatatype == GL_SHORT && !Normalized) return GL_R16; if(InternalDatatype == GL_SHORT && Normalized) return GL_R16_SNORM; break; case 2: break; case 3: if(InternalDatatype == GL_FLOAT) return GL_RGB32F; if(InternalDatatype == GL_UNSIGNED_BYTE && !Normalized) return GL_RGB8; if(InternalDatatype == GL_UNSIGNED_BYTE && Normalized) return GL_RGB8_SNORM; if(InternalDatatype == GL_SHORT && !Normalized) return GL_RGB16; if(InternalDatatype == GL_SHORT && Normalized) return GL_RGB16_SNORM; break; case 4: if(InternalDatatype == GL_FLOAT) return GL_RGBA32F; if(InternalDatatype == GL_UNSIGNED_BYTE && !Normalized) return GL_RGBA8; if(InternalDatatype == GL_UNSIGNED_BYTE && Normalized) return GL_RGBA8_SNORM; if(InternalDatatype == GL_SHORT && !Normalized) return GL_RGBA16; if(InternalDatatype == GL_SHORT && Normalized) return GL_RGBA16_SNORM; break; default: break; } cout<<"Error getting internal format."<