osgEarth 2.1.1
Classes | Functions | Variables

anonymous_namespace{ImageUtils.cpp} Namespace Reference

Classes

struct  MixImage
struct  GLTypeTraits< GLbyte >
struct  GLTypeTraits< GLubyte >
struct  GLTypeTraits< GLshort >
struct  GLTypeTraits< GLushort >
struct  GLTypeTraits< GLint >
struct  GLTypeTraits< GLuint >
struct  GLTypeTraits< GLfloat >
struct  ColorReader< GL_DEPTH_COMPONENT, T >
struct  ColorWriter< GL_DEPTH_COMPONENT, T >
struct  ColorReader< GL_LUMINANCE, T >
struct  ColorWriter< GL_LUMINANCE, T >
struct  ColorReader< GL_ALPHA, T >
struct  ColorWriter< GL_ALPHA, T >
struct  ColorReader< GL_LUMINANCE_ALPHA, T >
struct  ColorWriter< GL_LUMINANCE_ALPHA, T >
struct  ColorReader< GL_RGB, T >
struct  ColorWriter< GL_RGB, T >
struct  ColorReader< GL_RGBA, T >
struct  ColorWriter< GL_RGBA, T >
struct  ColorReader< GL_BGR, T >
struct  ColorWriter< GL_BGR, T >
struct  ColorReader< GL_BGRA, T >
struct  ColorWriter< GL_BGRA, T >
struct  ColorReader< 0, T >
struct  ColorWriter< 0, T >
struct  ColorReader< GL_UNSIGNED_SHORT_5_5_5_1, GLushort >
struct  ColorWriter< GL_UNSIGNED_SHORT_5_5_5_1, GLushort >
struct  ColorReader< GL_UNSIGNED_BYTE_3_3_2, GLubyte >
struct  ColorWriter< GL_UNSIGNED_BYTE_3_3_2, GLubyte >
struct  ColorReader< GL_COMPRESSED_RGB_S3TC_DXT1_EXT, GLubyte >

Functions

template<int GLFormat>
ImageUtils::PixelReader::ReaderFunc chooseReader (GLenum dataType)
ImageUtils::PixelReader::ReaderFunc getReader (GLenum pixelFormat, GLenum dataType)
template<int GLFormat>
ImageUtils::PixelWriter::WriterFunc chooseWriter (GLenum dataType)
ImageUtils::PixelWriter::WriterFunc getWriter (GLenum pixelFormat, GLenum dataType)

Variables

static const float r5 = 1.0f/31.0f
static const float r3 = 1.0f/7.0f
static const float r2 = 1.0f/3.0f

Function Documentation

template<int GLFormat>
ImageUtils::PixelReader::ReaderFunc anonymous_namespace{ImageUtils.cpp}::chooseReader ( GLenum  dataType) [inline]

Definition at line 875 of file ImageUtils.cpp.

    {
        switch (dataType)
        {
        case GL_BYTE:
            return &ColorReader<GLFormat, GLbyte>::read;
        case GL_UNSIGNED_BYTE:
            return &ColorReader<GLFormat, GLubyte>::read;
        case GL_SHORT:
            return &ColorReader<GLFormat, GLshort>::read;
        case GL_UNSIGNED_SHORT:
            return &ColorReader<GLFormat, GLushort>::read;
        case GL_INT:
            return &ColorReader<GLFormat, GLint>::read;
        case GL_UNSIGNED_INT:
            return &ColorReader<GLFormat, GLuint>::read;
        case GL_FLOAT:
            return &ColorReader<GLFormat, GLfloat>::read;       
        case GL_UNSIGNED_SHORT_5_5_5_1:
            return &ColorReader<GL_UNSIGNED_SHORT_5_5_5_1, GLushort>::read;
        case GL_UNSIGNED_BYTE_3_3_2:
            return &ColorReader<GL_UNSIGNED_BYTE_3_3_2, GLubyte>::read;
        default:
            return &ColorReader<0, GLbyte>::read;
        }
    }
template<int GLFormat>
ImageUtils::PixelWriter::WriterFunc anonymous_namespace{ImageUtils.cpp}::chooseWriter ( GLenum  dataType) [inline]

Definition at line 967 of file ImageUtils.cpp.

    {
        switch (dataType)
        {
        case GL_BYTE:
            return &ColorWriter<GLFormat, GLbyte>::write;
        case GL_UNSIGNED_BYTE:
            return &ColorWriter<GLFormat, GLubyte>::write;
        case GL_SHORT:
            return &ColorWriter<GLFormat, GLshort>::write;
        case GL_UNSIGNED_SHORT:
            return &ColorWriter<GLFormat, GLushort>::write;
        case GL_INT:
            return &ColorWriter<GLFormat, GLint>::write;
        case GL_UNSIGNED_INT:
            return &ColorWriter<GLFormat, GLuint>::write;
        case GL_FLOAT:
            return &ColorWriter<GLFormat, GLfloat>::write;       
        case GL_UNSIGNED_SHORT_5_5_5_1:
            return &ColorWriter<GL_UNSIGNED_SHORT_5_5_5_1, GLushort>::write;
        case GL_UNSIGNED_BYTE_3_3_2:
            return &ColorWriter<GL_UNSIGNED_BYTE_3_3_2, GLubyte>::write;
        default:
            return 0L;
        }
    }
ImageUtils::PixelReader::ReaderFunc anonymous_namespace{ImageUtils.cpp}::getReader ( GLenum  pixelFormat,
GLenum  dataType 
) [inline]

Definition at line 903 of file ImageUtils.cpp.

    {
        switch( pixelFormat )
        {
        case GL_DEPTH_COMPONENT:
            return chooseReader<GL_DEPTH_COMPONENT>(dataType);
            break;
        case GL_LUMINANCE:
            return chooseReader<GL_LUMINANCE>(dataType);
            break;        
        case GL_ALPHA:
            return chooseReader<GL_ALPHA>(dataType);
            break;        
        case GL_LUMINANCE_ALPHA:
            return chooseReader<GL_LUMINANCE_ALPHA>(dataType);
            break;        
        case GL_RGB:
            return chooseReader<GL_RGB>(dataType);
            break;        
        case GL_RGBA:
            return chooseReader<GL_RGBA>(dataType);
            break;        
        case GL_BGR:
            return chooseReader<GL_BGR>(dataType);
            break;        
        case GL_BGRA:
            return chooseReader<GL_BGRA>(dataType);
            break; 
        case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
            return &ColorReader<GL_COMPRESSED_RGB_S3TC_DXT1_EXT, GLubyte>::read;
            break;
        default:
            return 0L;
            break;
        }
    }
ImageUtils::PixelWriter::WriterFunc anonymous_namespace{ImageUtils.cpp}::getWriter ( GLenum  pixelFormat,
GLenum  dataType 
) [inline]

Definition at line 994 of file ImageUtils.cpp.

    {
        switch( pixelFormat )
        {
        case GL_DEPTH_COMPONENT:
            return chooseWriter<GL_DEPTH_COMPONENT>(dataType);
            break;
        case GL_LUMINANCE:
            return chooseWriter<GL_LUMINANCE>(dataType);
            break;        
        case GL_ALPHA:
            return chooseWriter<GL_ALPHA>(dataType);
            break;        
        case GL_LUMINANCE_ALPHA:
            return chooseWriter<GL_LUMINANCE_ALPHA>(dataType);
            break;        
        case GL_RGB:
            return chooseWriter<GL_RGB>(dataType);
            break;        
        case GL_RGBA:
            return chooseWriter<GL_RGBA>(dataType);
            break;        
        case GL_BGR:
            return chooseWriter<GL_BGR>(dataType);
            break;        
        case GL_BGRA:
            return chooseWriter<GL_BGRA>(dataType);
            break; 
        default:
            return 0L;
            break;
        }
    }

Here is the caller graph for this function:


Variable Documentation

const float anonymous_namespace{ImageUtils.cpp}::r2 = 1.0f/3.0f [static]

Definition at line 518 of file ImageUtils.cpp.

const float anonymous_namespace{ImageUtils.cpp}::r3 = 1.0f/7.0f [static]

Definition at line 517 of file ImageUtils.cpp.

const float anonymous_namespace{ImageUtils.cpp}::r5 = 1.0f/31.0f [static]

Definition at line 515 of file ImageUtils.cpp.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines