arbeit
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

simTexture.cpp File Reference

#include <GL/glew.h>
#include "simTexture.h"
#include <nrro/nrro.h>
#include <GL/glUtil.h>
#include <iostream>

Go to the source code of this file.

Enumerations

enum  SIM_TEX_FORMATS {
  SIMTL_HILO, SIMTL_NV3_FLOAT, SIMTL_NV3_HFLOAT, SIMTL_ATI97_16,
  SIMTL_ATI97_HFLOAT, SIMTL_ATI97_FLOAT, SIMTL_8BIT
}

Functions

void derr (char *when, char *where=0)
glift::SingleTexloadNrrdTexture (char *nrrdTexName, int texType)
 Load a single nrrd texture Check for zero on return value for failure to load.

glift::SingleTexSP loadNrroTexture (const NrroSP n, int texType)
int getSimtType (const NrroSP n, int texType)
glift::SingleTexSP loadTexture3D (float *data, int sx, int sy, int sz, int comp, int texType)
 Load Texture, explicit, standard texture object state: Linear, clamp to boarder (if applicable) or clamp BEST FITS: Comps Type General Type nv123x Type ATI 9700+ 1 Lumanance HILO16 Fixed16 Lum 2 Lumanance Alpha HILO16 Fixed16 Lum Alpha 3 RGB8 RGB8 RGB16 (FIXED) 4 RGBA8 RGBA8 RGBA16 (FIXED).

glift::SingleTexSP loadTexture3D (char *data, int sx, int sy, int sz, int comp, int texType)
glift::SingleTexloadTexture1D (float *data, int sx, int comp, int texType)
glift::SingleTexloadTexture2D (float *data, int sx, int sy, int comp, int texType)
GLenum getInternalFormat (int nComps, int simtType)
 find the best fit texture type, returns the higest precision (best == interpolating) type for the current platform and the number of components requested this function is mostly for internal use, SIMT_BEST is "best"

GLenum getExternalFormat (int nComps, GLenum inFormat)
 Get the gl texture format for the reqested number of components you can pass in the internal format if that effects the type of the external format, as it does on NVidia cards, (HILO).


Enumeration Type Documentation

enum SIM_TEX_FORMATS
 

Enumeration values:
SIMTL_HILO 
SIMTL_NV3_FLOAT 
SIMTL_NV3_HFLOAT 
SIMTL_ATI97_16 
SIMTL_ATI97_HFLOAT 
SIMTL_ATI97_FLOAT 
SIMTL_8BIT 

Definition at line 32 of file simTexture.cpp.


Function Documentation

void derr char *  when,
char *  where = 0
[inline]
 

Definition at line 42 of file simTexture.cpp.

Referenced by getExternalFormat(), getInternalFormat(), getSimtType(), loadNrrdTexture(), loadNrroTexture(), and loadTexture3D().

GLenum getExternalFormat int  nComps,
GLenum  inFormat
 

Get the gl texture format for the reqested number of components you can pass in the internal format if that effects the type of the external format, as it does on NVidia cards, (HILO).

< unreachable

Definition at line 424 of file simTexture.cpp.

References derr(), GL_HILO16_NV, GL_HILO_NV, GL_LUMINANCE, GL_LUMINANCE_ALPHA, GL_RGB, GL_RGBA, and GLenum.

Referenced by loadTexture1D(), loadTexture2D(), and loadTexture3D().

GLenum getInternalFormat int  nComps,
int  simtType
 

find the best fit texture type, returns the higest precision (best == interpolating) type for the current platform and the number of components requested this function is mostly for internal use, SIMT_BEST is "best"

< unreachable

try to identify the platform type this is a fucking hack, fix it, there must be a better way

NVIDIA

ATI

Default types

Definition at line 315 of file simTexture.cpp.

References GLEW::ATI_texture_float, derr(), GL_FLOAT_R16_NV, GL_FLOAT_R32_NV, GL_FLOAT_RG16_NV, GL_FLOAT_RG32_NV, GL_FLOAT_RGB16_NV, GL_FLOAT_RGB32_NV, GL_FLOAT_RGBA16_NV, GL_FLOAT_RGBA32_NV, GL_HILO16_NV, GL_LUMINANCE16, GL_LUMINANCE16_ALPHA16, GL_LUMINANCE8, GL_LUMINANCE8_ALPHA8, GL_LUMINANCE_ALPHA_FLOAT16_ATI, GL_LUMINANCE_ALPHA_FLOAT32_ATI, GL_LUMINANCE_FLOAT16_ATI, GL_LUMINANCE_FLOAT32_ATI, GL_RGB16, GL_RGB8, GL_RGB_FLOAT16_ATI, GL_RGB_FLOAT32_ATI, GL_RGBA16, GL_RGBA8, GL_RGBA_FLOAT16_ATI, GL_RGBA_FLOAT32_ATI, GLenum, glew, GLEW::NV_float_buffer, GLEW::NV_texture_shader3, SIMT_16FIXED, SIMT_16FLOAT, SIMT_32FLOAT, and SIMT_BEST.

Referenced by loadTexture1D(), loadTexture2D(), and loadTexture3D().

int getSimtType const NrroSP  n,
int  texType
 

Definition at line 105 of file simTexture.cpp.

References derr(), n, SIMT_8BIT, and SIMT_UNKNOWN.

Referenced by loadNrroTexture().

glift::SingleTex* loadNrrdTexture char *  nrrdTexName,
int  texType = SIMT_BEST
 

Load a single nrrd texture Check for zero on return value for failure to load.

Definition at line 55 of file simTexture.cpp.

References derr(), loadNrroTexture(), and n.

glift::SingleTexSP loadNrroTexture const NrroSP  n,
int  texType
 

Definition at line 83 of file simTexture.cpp.

References Nrro::CHAR, derr(), getSimtType(), loadTexture3D(), n, and Nrro::UCHAR.

Referenced by VolField::genTexture(), and loadNrrdTexture().

glift::SingleTex* loadTexture1D float *  data,
int  sx,
int  comp,
int  texType
 

< should be unreachable

create the tex data object

create texture object

Definition at line 226 of file simTexture.cpp.

References data, getExternalFormat(), getInternalFormat(), GL_FLOAT, GL_TEXTURE_1D, GLenum, glErr(), glift::TS_LINEAR, glift::TS_S_CLAMP_TO_EDGE, glift::TS_T_CLAMP_TO_EDGE, and gutz::vec3i.

glift::SingleTex* loadTexture2D float *  data,
int  sx,
int  sy,
int  comp,
int  texType
 

< should be unreachable

create the tex data object

create texture object

Definition at line 269 of file simTexture.cpp.

References data, getExternalFormat(), getInternalFormat(), GL_FLOAT, GL_TEXTURE_2D, GLenum, glErr(), glift::TS_LINEAR, glift::TS_S_CLAMP_TO_EDGE, glift::TS_T_CLAMP_TO_EDGE, and gutz::vec3i.

glift::SingleTexSP loadTexture3D char *  data,
int  sx,
int  sy,
int  sz,
int  comp,
int  texType
 

< should be unreachable

create the tex data object

create texture object

Definition at line 178 of file simTexture.cpp.

References data, derr(), getExternalFormat(), getInternalFormat(), GL_TEXTURE_3D, GL_UNSIGNED_BYTE, GLenum, glErr(), glift::TS_LINEAR, glift::TS_S_CLAMP_TO_EDGE, glift::TS_T_CLAMP_TO_EDGE, and gutz::vec3i.

Referenced by loadNrroTexture().

glift::SingleTexSP loadTexture3D float *  data,
int  sx,
int  sy,
int  sz,
int  comp,
int  texType
 

Load Texture, explicit, standard texture object state: Linear, clamp to boarder (if applicable) or clamp BEST FITS: Comps Type General Type nv123x Type ATI 9700+ 1 Lumanance HILO16 Fixed16 Lum 2 Lumanance Alpha HILO16 Fixed16 Lum Alpha 3 RGB8 RGB8 RGB16 (FIXED) 4 RGBA8 RGBA8 RGBA16 (FIXED).

< should be unreachable

create the tex data object

create texture object

Definition at line 135 of file simTexture.cpp.


Send questions, comments, and bug reports to:
jmk