Basic Image AlgorithmS Library
2.8.0
|
data holder describing OpenGL texture objects in addition to its unique texID. More...
#include <Gui/ImgObjGL.hh>
Public Member Functions | |
void | CreateGLCubemap (const std::vector< BIAS::ImageBase * > cm, const bool ImmediateCopyData=IMGOBJ_IMMEDIATE_COPY_DEFAULT, const bool mipmapped=IMGOBJ_DEFAULT_MIPMAPPED) |
int | CreateGLCubemap (const std::string &cm0PosX, const std::string &cm1NegX, const std::string &cm2PosY, const std::string &cm3NegY, const std::string &cm4PosZ, const std::string &cm5NegZ, const bool ImmediateCopyData=IMGOBJ_IMMEDIATE_COPY_DEFAULT, const bool mipmapped=IMGOBJ_DEFAULT_MIPMAPPED) |
helper creating cubemap from disk files More... | |
int | CreateGLCubemap (const std::vector< std::string > cmFilenames, const bool ImmediateCopyData=IMGOBJ_IMMEDIATE_COPY_DEFAULT, const bool mipmapped=IMGOBJ_DEFAULT_MIPMAPPED) |
helper creating cubemap from disk files More... | |
void | CreateGLCubemapEmpty (const unsigned int w, const unsigned int h, GLint gpu_internalFmt=GL_RGBA, const bool &mipmapped=false) |
void | CreateGLTexture (const BIAS::ImageBase &c_img, const bool &forcePow2tex=true, const bool &flipY=true, const bool ImmediateCopyData=IMGOBJ_IMMEDIATE_COPY_DEFAULT) |
creates an OpenGL texture from p_valueImage JW if ImmediateCopyData is false the memory is just allocated and not copied from c_img. More... | |
void | DeleteGLTexture () |
deletes the texture memory and frees texture in GL More... | |
ImgObjGL () | |
ImgObjGL (const GLuint &id, const unsigned int &widthBrutto, const unsigned int &heightBrutto, const GLenum &target=GL_TEXTURE_2D) | |
void | InitMembers () |
set members to defaults More... | |
bool | IsCubemap () const |
bool | IsRectangleTexture () const |
bool | IsTexture2D () const |
void | Release () |
frees the pointer members if we allocated them More... | |
void | SetTarget2D () |
void | SetTargetCUBE () |
void | SetTargetPOW2 () |
set the textur retarget to rectangular or pow 2 texture JW More... | |
void | SetTargetRECT () |
~ImgObjGL () | |
Static Public Member Functions | |
static GLint | GetGLInternalFormat (const BIAS::ImageBase::EStorageType &biasST, const BIAS::ImageBase::EColorModel &biasCM, const unsigned int &channelcount, const unsigned int &ByteDepth, const unsigned int &BitDepth) |
JW determin the GPU internal format the src data should be mapped to. More... | |
static GLint | GetGLInternalFormat (const BIAS::ImageBase &img) |
interface for the above More... | |
static GLenum | GetGLPixelFormat (const BIAS::ImageBase::EColorModel &biasCM, const unsigned int &channelcount) |
get the GLenum pixel src format for the corresponding BIAS enum ColroModel More... | |
static GLenum | GetGLStorageType (const BIAS::ImageBase::EStorageType &biasST, const unsigned int &ByteDepth) |
get the GLenum pixel storage type for the corresponding BIAS enum More... | |
static void | InitGlew () |
convenience interace for glewInit() c´with checks and ifdefs More... | |
Public Attributes | |
unsigned int | heightBrutto |
unsigned int | heightOrig |
GLuint | id |
GLenum | magnificationMode |
GLenum | minificationMode |
bool | p_id_SelfAllocated |
BIAS::ImageBase * | p_valueImage |
bool | p_valueImage_SelfAllocated |
GLenum | target |
unsigned int | widthBrutto |
unsigned int | widthOrig |
data holder describing OpenGL texture objects in addition to its unique texID.
Please note that querying glTexImage2D(GL_PROXY_TEXTURE_2D,... may be more reliable See http://www.opengl.org/resources/faq/technical/texture.htm
Definition at line 34 of file ImgObjGL.hh.
ImgObjGL::~ImgObjGL | ( | ) |
Definition at line 15 of file ImgObjGL.cpp.
ImgObjGL::ImgObjGL | ( | ) |
Definition at line 22 of file ImgObjGL.cpp.
References InitMembers().
ImgObjGL::ImgObjGL | ( | const GLuint & | id, |
const unsigned int & | widthBrutto, | ||
const unsigned int & | heightBrutto, | ||
const GLenum & | target = GL_TEXTURE_2D |
||
) |
Definition at line 30 of file ImgObjGL.cpp.
References heightBrutto, heightOrig, id, InitMembers(), target, widthBrutto, and widthOrig.
void ImgObjGL::CreateGLCubemap | ( | const std::vector< BIAS::ImageBase * > | cm, |
const bool | ImmediateCopyData = IMGOBJ_IMMEDIATE_COPY_DEFAULT , |
||
const bool | mipmapped = IMGOBJ_DEFAULT_MIPMAPPED |
||
) |
Definition at line 355 of file ImgObjGL.cpp.
References CreateGLCubemapEmpty(), GetGLInternalFormat(), GetGLPixelFormat(), GetGLStorageType(), heightBrutto, InitGlew(), BIAS::ImageBase::IsPowerOfTwoSize(), magnificationMode, minificationMode, p_id_SelfAllocated, Release(), target, and widthBrutto.
Referenced by CreateGLCubemap().
int ImgObjGL::CreateGLCubemap | ( | const std::string & | cm0PosX, |
const std::string & | cm1NegX, | ||
const std::string & | cm2PosY, | ||
const std::string & | cm3NegY, | ||
const std::string & | cm4PosZ, | ||
const std::string & | cm5NegZ, | ||
const bool | ImmediateCopyData = IMGOBJ_IMMEDIATE_COPY_DEFAULT , |
||
const bool | mipmapped = IMGOBJ_DEFAULT_MIPMAPPED |
||
) |
helper creating cubemap from disk files
Definition at line 568 of file ImgObjGL.cpp.
References CreateGLCubemap().
int ImgObjGL::CreateGLCubemap | ( | const std::vector< std::string > | cmFilenames, |
const bool | ImmediateCopyData = IMGOBJ_IMMEDIATE_COPY_DEFAULT , |
||
const bool | mipmapped = IMGOBJ_DEFAULT_MIPMAPPED |
||
) |
helper creating cubemap from disk files
Definition at line 589 of file ImgObjGL.cpp.
References CreateGLCubemap(), and BIAS::ImageIO::Load().
void ImgObjGL::CreateGLCubemapEmpty | ( | const unsigned int | w, |
const unsigned int | h, | ||
GLint | gpu_internalFmt = GL_RGBA , |
||
const bool & | mipmapped = false |
||
) |
Definition at line 459 of file ImgObjGL.cpp.
References heightBrutto, heightOrig, InitGlew(), BIAS::ImageBase::IsPowerOfTwoSize(), magnificationMode, minificationMode, p_id_SelfAllocated, Release(), target, widthBrutto, and widthOrig.
Referenced by CreateGLCubemap().
void ImgObjGL::CreateGLTexture | ( | const BIAS::ImageBase & | c_img, |
const bool & | forcePow2tex = true , |
||
const bool & | flipY = true , |
||
const bool | ImmediateCopyData = IMGOBJ_IMMEDIATE_COPY_DEFAULT |
||
) |
creates an OpenGL texture from p_valueImage JW
if ImmediateCopyData is false the memory is just allocated and not copied from c_img.
JW
Definition at line 182 of file ImgObjGL.cpp.
References BIAS::ImageBase::Flip(), BIAS::ImageBase::GetChannelCount(), BIAS::ImageBase::GetColorModel(), BIAS::ImageBase::GetDepth(), GetGLInternalFormat(), GetGLPixelFormat(), GetGLStorageType(), BIAS::ImageBase::GetHeight(), BIAS::ImageBase::GetImageData(), BIAS::ImageBase::GetStorageType(), BIAS::ImageBase::GetWidth(), heightBrutto, heightOrig, InitGlew(), BIAS::ImageBase::IsPowerOfTwoSize(), IsRectangleTexture(), magnificationMode, minificationMode, p_id_SelfAllocated, BIAS::ImageBase::PadToPowerOfTwo(), BIAS::ImageBase::PadToPowerOfTwoAndFlip(), BIAS::ImageBase::PowerOfTwoSize(), Release(), target, widthBrutto, and widthOrig.
Referenced by BIAS::ImageCanvasGLBase::Set().
void ImgObjGL::DeleteGLTexture | ( | ) |
deletes the texture memory and frees texture in GL
Definition at line 120 of file ImgObjGL.cpp.
References target.
Referenced by Release().
|
static |
JW determin the GPU internal format the src data should be mapped to.
Definition at line 751 of file ImgObjGL.cpp.
References BIAS::ImageBase::GetSizeByte().
Referenced by CreateGLCubemap(), CreateGLTexture(), and GetGLInternalFormat().
|
static |
interface for the above
Definition at line 738 of file ImgObjGL.cpp.
References BIAS::ImageBase::GetBitDepth(), BIAS::ImageBase::GetChannelCount(), BIAS::ImageBase::GetColorModel(), BIAS::ImageBase::GetDepth(), GetGLInternalFormat(), and BIAS::ImageBase::GetStorageType().
|
static |
get the GLenum pixel src format for the corresponding BIAS enum ColroModel
Definition at line 668 of file ImgObjGL.cpp.
References BIAS::ImageBase::CM_Bayer_BGGR, BIAS::ImageBase::CM_Bayer_GBRG, BIAS::ImageBase::CM_Bayer_GRBG, BIAS::ImageBase::CM_Bayer_RGGB, BIAS::ImageBase::CM_BGR, BIAS::ImageBase::CM_BGRA, BIAS::ImageBase::CM_Grey, BIAS::ImageBase::CM_GreyA, BIAS::ImageBase::CM_HSL, BIAS::ImageBase::CM_hsL, BIAS::ImageBase::CM_HSV, BIAS::ImageBase::CM_RGB, and BIAS::ImageBase::CM_RGBA.
Referenced by CreateGLCubemap(), and CreateGLTexture().
|
static |
get the GLenum pixel storage type for the corresponding BIAS enum
Definition at line 625 of file ImgObjGL.cpp.
References BIAS::ImageBase::ST_char, BIAS::ImageBase::ST_float, BIAS::ImageBase::ST_int, BIAS::ImageBase::ST_shortint, BIAS::ImageBase::ST_unsignedchar, BIAS::ImageBase::ST_unsignedint, and BIAS::ImageBase::ST_unsignedshortint.
Referenced by CreateGLCubemap(), and CreateGLTexture().
|
static |
convenience interace for glewInit() c´with checks and ifdefs
Definition at line 50 of file ImgObjGL.cpp.
Referenced by CreateGLCubemap(), CreateGLCubemapEmpty(), and CreateGLTexture().
void ImgObjGL::InitMembers | ( | ) |
set members to defaults
Definition at line 78 of file ImgObjGL.cpp.
References heightBrutto, heightOrig, magnificationMode, minificationMode, p_id_SelfAllocated, p_valueImage, p_valueImage_SelfAllocated, target, widthBrutto, and widthOrig.
Referenced by ImgObjGL().
bool ImgObjGL::IsCubemap | ( | ) | const |
bool ImgObjGL::IsRectangleTexture | ( | ) | const |
Definition at line 140 of file ImgObjGL.cpp.
References target.
Referenced by CreateGLTexture(), and BIAS::GeometryGL::DisplayQuadTexCoord2D().
bool ImgObjGL::IsTexture2D | ( | ) | const |
Definition at line 135 of file ImgObjGL.cpp.
References target.
void ImgObjGL::Release | ( | ) |
frees the pointer members if we allocated them
Definition at line 107 of file ImgObjGL.cpp.
References DeleteGLTexture(), p_id_SelfAllocated, p_valueImage, and p_valueImage_SelfAllocated.
Referenced by CreateGLCubemap(), CreateGLCubemapEmpty(), and CreateGLTexture().
void ImgObjGL::SetTarget2D | ( | ) |
void ImgObjGL::SetTargetCUBE | ( | ) |
Definition at line 171 of file ImgObjGL.cpp.
References target.
void ImgObjGL::SetTargetPOW2 | ( | ) |
set the textur retarget to rectangular or pow 2 texture JW
Definition at line 158 of file ImgObjGL.cpp.
References SetTarget2D().
void ImgObjGL::SetTargetRECT | ( | ) |
Definition at line 164 of file ImgObjGL.cpp.
References target.
Referenced by BIAS::ImageCanvasGLBase::SetRECT().
unsigned int BIAS::ImgObjGL::heightBrutto |
Definition at line 152 of file ImgObjGL.hh.
Referenced by CreateGLCubemap(), CreateGLCubemapEmpty(), CreateGLTexture(), BIAS::ImageCanvasGLBase::DisplayCalls(), BIAS::GeometryGL::DisplayQuadTexCoord2D(), ImgObjGL(), InitMembers(), and BIAS::ImageCanvasGLBase::ValidTexobj().
unsigned int BIAS::ImgObjGL::heightOrig |
Definition at line 148 of file ImgObjGL.hh.
Referenced by CreateGLCubemapEmpty(), CreateGLTexture(), BIAS::GeometryGL::DisplayQuadTexCoord2D(), ImgObjGL(), and InitMembers().
GLuint BIAS::ImgObjGL::id |
Definition at line 137 of file ImgObjGL.hh.
Referenced by BIAS::GeometryGL::DisplayQuadTexCoord2D(), BIAS::ImageCanvasGLBase::GetTexId(), ImgObjGL(), and BIAS::ImageCanvasGLBase::ValidTexobj().
GLenum BIAS::ImgObjGL::magnificationMode |
Definition at line 144 of file ImgObjGL.hh.
Referenced by CreateGLCubemap(), CreateGLCubemapEmpty(), CreateGLTexture(), BIAS::GeometryGL::DisplayQuadTexCoord2D(), and InitMembers().
GLenum BIAS::ImgObjGL::minificationMode |
Definition at line 143 of file ImgObjGL.hh.
Referenced by CreateGLCubemap(), CreateGLCubemapEmpty(), CreateGLTexture(), BIAS::GeometryGL::DisplayQuadTexCoord2D(), BIAS::ImageCanvasGLBase::EnableMipMapping(), and InitMembers().
bool BIAS::ImgObjGL::p_id_SelfAllocated |
Definition at line 141 of file ImgObjGL.hh.
Referenced by CreateGLCubemap(), CreateGLCubemapEmpty(), CreateGLTexture(), InitMembers(), and Release().
BIAS::ImageBase* BIAS::ImgObjGL::p_valueImage |
Definition at line 155 of file ImgObjGL.hh.
Referenced by InitMembers(), Release(), and BIAS::ImageCanvasGLBase::Set().
bool BIAS::ImgObjGL::p_valueImage_SelfAllocated |
Definition at line 159 of file ImgObjGL.hh.
Referenced by InitMembers(), Release(), and BIAS::ImageCanvasGLBase::Set().
GLenum BIAS::ImgObjGL::target |
Definition at line 138 of file ImgObjGL.hh.
Referenced by CreateGLCubemap(), CreateGLCubemapEmpty(), CreateGLTexture(), DeleteGLTexture(), BIAS::GeometryGL::DisplayQuadTexCoord2D(), BIAS::ImageCanvasGLBase::GetTexTarget(), ImgObjGL(), InitMembers(), IsCubemap(), IsRectangleTexture(), IsTexture2D(), SetTarget2D(), SetTargetCUBE(), SetTargetRECT(), and BIAS::ImageCanvasGLBase::ValidTexobj().
unsigned int BIAS::ImgObjGL::widthBrutto |
Definition at line 151 of file ImgObjGL.hh.
Referenced by CreateGLCubemap(), CreateGLCubemapEmpty(), CreateGLTexture(), BIAS::ImageCanvasGLBase::DisplayCalls(), BIAS::GeometryGL::DisplayQuadTexCoord2D(), ImgObjGL(), InitMembers(), and BIAS::ImageCanvasGLBase::ValidTexobj().
unsigned int BIAS::ImgObjGL::widthOrig |
Definition at line 147 of file ImgObjGL.hh.
Referenced by CreateGLCubemapEmpty(), CreateGLTexture(), BIAS::GeometryGL::DisplayQuadTexCoord2D(), ImgObjGL(), and InitMembers().