3 # pragma warning (disable: 4005) // for VS8 + WX
6 #include "ImageCanvasGLBase.hh"
8 #include <Base/Debug/Error.hh>
9 #include <Base/Debug/DebugSimple.hh>
11 #include <Base/Image/ImageIO.hh>
12 #include <Base/Math/Vector2.hh>
14 #include "GeometryGL.hh"
22 ImageCanvasGLBase::~ImageCanvasGLBase()
26 ImageCanvasGLBase::ImageCanvasGLBase(
34 ,
const wxPalette& palette )
35 :
OpenGLCanvas(parent,id,pos,size,style,name,attribList,palette )
45 ,wxGLContext* sharedContext
52 ,
const wxPalette& palette )
53 :
OpenGLCanvas(parent,sharedContext,id,pos,size,style,name,attribList,palette)
87 if(avoidAliasingByMipmapping) {
119 if (!glIsTexture(t.
id))
121 BIASERR(
"texture id not valid");
123 }
else if (t.
target!=GL_TEXTURE_2D) {
124 BIASERR(
"texture target not valid. ImageCanvasBase can only handle GL_TEXTURE_2D");
127 BIASERR(
"texture must have (brutto) pow2 size. please pad it yourself. npot is not supporte din Base class.");
130 BIASERR(
"texture widthBrutto too small");
133 BIASERR(
"texture heightBrutto too small");
142 const std::string & name)
171 const std::string & name,
172 const bool & forcePow2tex,
178 if (GetParent()->IsShown()) this->SetCurrent();
193 const std::string & name,
197 return this->
Set(img,
virtual void Display()
display call to be overridden by child classes
virtual void InitMembers()
any constructor should call this function to initialize all data members (e.g.
bool IsPowerOfTwoSize() const
virtual void InitMembers()
any constructor should call this function to initialize all data members (e.g.
BIAS::ImageBase * p_valueImage
int SetRECT(BIAS::ImageBase &img, const std::string &name=std::string("RECT Image<unsigned char>"), const bool &flipY=true)
sets imaeg as a RECT texture JW
GLenum GetTexTarget() const
virtual void DisplayCalls()
OpenGL canvases with additinal event handling (JW)
unsigned int heightBrutto
bool p_valueImage_SelfAllocated
data holder describing OpenGL texture objects in addition to its unique texID.
void Set(const T &scalar)
set all elements to a scalar value
static void DisplayQuadTexCoord2DFull(const BIAS::ImgObjGL &texobj, const bool &additionalFlipY)
void EnableMipMapping(const bool &avoidAliasingByMipmapping=true)
set to true for prettier OpenGL texture mipmapping display (which costs performance) JW ...
CameraViewInternals GetInternals() const
ImgObjGL GetTexobj() const
int Set(const ImgObjGL &NewTexobj, const std::string &name=std::string("ImgObjGL"))
feed in an existing, possibly shared, GL texture obj for display note: it is no good idea to call th...
ImageCanvasGLBase(wxFrame *parent, wxWindowID id=-1, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0, const wxString &name=AsciiToWx("ImageCanvasGLBase"), int *attribList=NULL, const wxPalette &palette=wxNullPalette)
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 all...
bool ValidTexobj(const ImgObjGL &t) const
BIAS::Vector2< float > InterestPoint
This is the base class for images in BIAS.
CameraViewController GetViewController() const