CMSC23700 Common Code Library
Support code for CS23700 programming projects
cs237::__detail::image_base Class Reference

#include <cs237-image.hxx>

Inherited by cs237::image1d, and cs237::image2d.

Public Member Functions

unsigned int nDims () const
 the number of dimensions (1, 2, or 3) More...
 
unsigned int format () const
 
unsigned int type () const
 
void * data () const
 the data pointer More...
 
size_t nBytes () const
 the total number of bytes of image data More...
 
unsigned int nChannels () const
 the number of channels (1, 2, 3, or 4) More...
 

Protected Member Functions

 image_base ()
 
 image_base (uint32_t nd)
 
 image_base (uint32_t nd, GLenum fmt, GLenum ty, size_t nPixels)
 
virtual ~image_base ()
 

Protected Attributes

uint32_t _nDims
 the number of dimensions (1 or 2) More...
 
GLenum _format
 
GLenum _type
 
size_t _nBytes
 size in bytes of image data More...
 
void * _data
 the raw image data More...
 

Constructor & Destructor Documentation

cs237::__detail::image_base::image_base ( )
inlineexplicitprotected
cs237::__detail::image_base::image_base ( uint32_t  nd)
inlineexplicitprotected
cs237::__detail::image_base::image_base ( uint32_t  nd,
GLenum  fmt,
GLenum  ty,
size_t  nPixels 
)
explicitprotected
virtual cs237::__detail::image_base::~image_base ( )
protectedvirtual

Member Function Documentation

void* cs237::__detail::image_base::data ( ) const
inline

the data pointer

unsigned int cs237::__detail::image_base::format ( ) const
inline

the OpenGL format of the pixels.

Returns
the OpenGL format, which will be one of GL_RED, GL_RG, GL_RGB, GL_BGR GL_RGBA, or GL_BGRA.
size_t cs237::__detail::image_base::nBytes ( ) const
inline

the total number of bytes of image data

unsigned int cs237::__detail::image_base::nChannels ( ) const

the number of channels (1, 2, 3, or 4)

unsigned int cs237::__detail::image_base::nDims ( ) const
inline

the number of dimensions (1, 2, or 3)

unsigned int cs237::__detail::image_base::type ( ) const
inline

the OpenGL type of the pixels

Returns
the OpenGL element type of the pixels, which should be one of GL_UNSIGNED_BYTE, GL_UNSIGNED_BYTE, GL_BYTE, GL_UNSIGNED_SHORT, GL_SHORT, GL_UNSIGNED_INT, GL_INT, GL_FLOAT, GL_UNSIGNED_BYTE_3_3_2, GL_UNSIGNED_BYTE_2_3_3_REV, GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_5_6_5_REV, GL_UNSIGNED_SHORT_4_4_4_4, GL_UNSIGNED_SHORT_4_4_4_4_REV, GL_UNSIGNED_SHORT_5_5_5_1, GL_UNSIGNED_SHORT_1_5_5_5_REV, GL_UNSIGNED_INT_8_8_8_8, GL_UNSIGNED_INT_8_8_8_8_REV, GL_UNSIGNED_INT_10_10_10_2, or GL_UNSIGNED_INT_2_10_10_10_REV

Member Data Documentation

void* cs237::__detail::image_base::_data
protected

the raw image data

GLenum cs237::__detail::image_base::_format
protected

the texture format; will be one of GL_RED (1 chan), GL_RG (2 chan), GL_RGB (3 chan), GL_BGR (3 chan), GL_RGBA (4 chan), or GL_BGRA (4 chan).

size_t cs237::__detail::image_base::_nBytes
protected

size in bytes of image data

uint32_t cs237::__detail::image_base::_nDims
protected

the number of dimensions (1 or 2)

GLenum cs237::__detail::image_base::_type
protected

the representation type of the data; will be one of GL_UNSIGNED_BYTE, GL_BYTE, GL_UNSIGNED_SHORT, GL_SHORT, GL_UNSIGNED_INT, GL_INT, GL_FLOAT, etc.


The documentation for this class was generated from the following file: