Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
BIAS::GLProjectionParametersBase Class Referenceabstract

GLPPB encapsulates the opengl rendering interface for the projectionparameter classes. More...

#include <GLviewer/GLProjectionParametersBase.hh>

+ Inheritance diagram for BIAS::GLProjectionParametersBase:
+ Collaboration diagram for BIAS::GLProjectionParametersBase:

Public Types

enum  ViewingReshapeBehaviour {
  Deny =0, AutoRescaleParams, AutoCutImage, AutoSimplePerspectiveCam,
  AdaptToCroppedImage, AutoRescaleSimple
}
 

Public Member Functions

virtual void AddDebugLevel (const long int lv)
 
void AddDebugLevel (const std::string &name)
 
void AppendOutputAttachment (int type, std::vector< int > args=std::vector< int >())
 
virtual void Assign (BIAS::ProjectionParametersBase &p)
 
bool DebugLevelIsSet (const long int lv) const
 
bool DebugLevelIsSet (const std::string &name) const
 
virtual int Draw (std::vector< BIAS::SceneBase * > &scenes, BIAS::SceneBGImage *backgroundImageScene=NULL, BIAS::glfFramebufferObject *theTarget=NULL)
 Renders scenes passed as argument beginning with the smallest index. More...
 
bool FirstRenderingPassFinished ()
 Is true if in multipass rendering procedure is rendering for second or subsequent time. More...
 
void ForceSceneUpdate ()
 Rendering will call UpdateCameraRelatedState() on scenes. More...
 
GLProjectionOutputAttachmentGetAttachmentByType (int type)
 
virtual BIAS::Vector4< float > GetClearColor ()
 
virtual float GetClearDepth ()
 
int GetDebugLevel () const
 
std::ostream & GetDebugStream () const
 
void GetDebugStream (std::ostream &os) const
 
virtual double GetDepth (const unsigned int x, const unsigned int y)
 evaluate depth. More...
 
virtual double GetDepth (const BIAS::HomgPoint2D &p)
 
int GetDepthMap (BIAS::Image< float > &depthMap, const float invalid=0.0)
 Calculates depth map from current z-Buffer state. More...
 
virtual int GetExtrinsics (BIAS::Vector3< double > &C, BIAS::Vector3< double > &up) const
 
virtual int GetExtrinsics (BIAS::Vector3< double > &C, BIAS::RMatrix &R) const
 
BIAS::Matrix4x4< double > GetGLModelViewMatrixTransposed ()
 
BIAS::Matrix4x4< double > GetGLProjectionMatrixTransposed ()
 
void GetGreyImage (BIAS::Image< unsigned char > &image)
 
void GetImage (BIAS::Image< unsigned char > &image)
 
int GetMetricZMap (BIAS::Image< float > &metricZMap, const float invalid=0.0)
 
virtual
BIAS::ProjectionParametersBase
GetMyselfAsProjectionParametersBase () const
 the pure virtual GetMyselfAsProjectionParameterBase() forces the child classes to inherit from a projectionparameterbase class and allows to access the projectionparams in cases where only a GLPPB* is available. More...
 
virtual BIAS::glfRenderTargetGetRenderTarget ()
 
bool GetViewportCoordinates (int &x, int &y)
 Takes x, y as window coordinates, checks whether the coordinates lie in the rendered image (in the viewrange of projection). More...
 
int GetZBuffer (BIAS::Image< float > &zBuffer)
 
 GLProjectionParametersBase ()
 
virtual int Load (const std::string &filename)=0
 
long int Name2DebugLevel (const std::string &name) const
 looks up a debuglevel in the internal map, returns 0 if not found More...
 
long int NewDebugLevel (const std::string &name)
 creates a new debuglevel More...
 
virtual bool PoseValid ()
 
void PrintDebugLevel (std::ostream &os=std::cout) const
 
BIAS::HomgPoint2D Project (BIAS::HomgPoint3D &point)
 
void RemoveDebugLevel (const long int lv)
 
void RemoveDebugLevel (const std::string &name)
 
void Rescale (float ratio)
 Returns the absolute world coordinate frame position of camera. More...
 
virtual int Save (const std::string &filename) const =0
 
virtual void Set (BIAS::ProjectionParametersBase *p)
 
void SetAutoReshapeBehaviour (BIAS::GLProjectionParametersInterface::ViewingReshapeBehaviour newBehaviour)
 
virtual void SetClearColor (const BIAS::Vector4< float > &cc)=0
 setclearcolor is pure virtual. More...
 
void SetClearDepth (const float d)
 set the clear depth for render targets More...
 
virtual void SetDebugLevel (const long int lv)
 
void SetDebugLevel (const std::string &name)
 
void SetDebugStream (const std::ostream &os)
 
virtual int SetExtrinsics (const BIAS::HomgPoint3D &C, const BIAS::RMatrix &R)
 
virtual int SetExtrinsics (const BIAS::Vector3< double > &C, const BIAS::RMatrix &R)
 
virtual int SetExtrinsics (const BIAS::HomgPoint3D &C, const BIAS::Quaternion< double > &Q)
 
virtual int SetExtrinsics (const BIAS::Vector3< double > &C, const BIAS::Quaternion< double > &Q)
 
virtual int SetExtrinsics (const BIAS::Vector3< double > &C, const BIAS::Vector3< double > &scenePoint, const BIAS::Vector3< double > &up)
 
virtual void SetGLCameraToLocal ()
 Sets gl's Modelview matrix for rendering relative to camera coordinate system (ignoring camera pose). More...
 
virtual int SetGLMatrices (bool forceUpdate=true)=0
 Method loads the parameters into the projection and modelview Matrix. More...
 
virtual void SetIntrinsics (BIAS::ProjectionParametersBase *p)
 
virtual void SetRenderTarget (BIAS::glfRenderTarget *RT)
 
void ShowDebugLevel (std::ostream &os=std::cout) const
 prints all internally known debuglevels More...
 
void SubtractFromBackgroundImage (bool subtract=true)
 
void SwitchToOffscreenRendering (bool offscreen=true)
 
virtual void TranslateDepthToZ (BIAS::Image< float > &depthtoz, const float invalid=0.0, const bool flip=true) const
 helper function which converts a z map obtained with the last camera into a depth map for the last camera More...
 
virtual void TranslateZToDepth (BIAS::Image< float > &ztodepth, const float invalid=0.0, const bool flip=true) const
 helper function which converts a z map obtained with the last camera into a depth map for the last camera More...
 
virtual void TranslateZToMetricZ (BIAS::Image< float > &depthMap, const float invalid=0.0, const bool flip=true) const
 
BIAS::HomgPoint3D UnProject (const unsigned int x, const unsigned int y)
 
BIAS::HomgPoint3D UnProject (const BIAS::HomgPoint2D &p)
 
BIAS::HomgPoint3D UnProject (BIAS::HomgPoint2D &point2D, double depth)
 
virtual int UpdateGLProjectionMatrix_ (unsigned int x0, unsigned int y0, unsigned int width, unsigned int height)=0
 
virtual int XMLRead (const std::string &Filename)=0
 
virtual int XMLWrite (const std::string &Filename) const =0
 
virtual ~GLProjectionParametersBase ()
 
virtual int SetExtrinsics (float eyex, float eyey, float eyez, float scenex, float sceney, float scenez, float upx, float upy, float upz)
 Set extrinsic similar to GL's gluLookAt. More...
 
void SetZClippingPlanes (float n, float f)
 Setting the near and far z-Clipping planes. More...
 
void SetNearClippingPlane (float n)
 
void SetFarClippingPlane (float f)
 
float GetNearClippingPlane () const
 
float GetFarClippingPlane () const
 

Static Public Member Functions

static long int GetGlobalDebugLevel ()
 
static void SetGlobalDebugLevel (long int lev)
 

Static Public Attributes

static int instanceCounter = -1
 

Protected Member Functions

virtual int BeginDraw_ (BIAS::glfFramebufferObject *theTarget=NULL)
 
long ConsumeNextFreeDebuglevel_ ()
 returns the next available debuglevel More...
 
virtual int Draw_ (std::vector< SceneBase * > &scenes, BIAS::glfFramebufferObject *theTarget=NULL)=0
 Implement in deriving classes. More...
 
int DrawPartOfImage_ (const unsigned int ulX, const unsigned int ulY, const unsigned int width, const unsigned int height, std::vector< SceneBase * > scenes)
 Renders a rectangular part of actual image. More...
 
virtual int DrawWithMatchedParamsAndViewport_ (int viewport[4], int imageWidth, int imageHeight, std::vector< SceneBase * > &scenes)
 Takes care of adapting internal parameters and gl viewport by specified behaviour scheme. More...
 
virtual int EndDraw_ (BIAS::glfFramebufferObject *theTarget=NULL)
 
int GetGLViewport_ (int &lowerleftx, int &lowerlefty, int &sizex, int &sizey)
 
void InitBeforeDraw_ ()
 
void InitRaw_ ()
 
void PrepareOutputAttachments_ ()
 
void ReadDepthBufferToTexture_ (int texID, int width, int height)
 
virtual void Rescale_ (float scale)=0
 
int SetGLViewport_ (int lowerleftx, int lowerlefty, int sizex, int sizey)
 
void SetToUnknownState_ ()
 
int UpdateGLModelViewMatrix_ ()
 
virtual double Z2Depth_ (const int x, const int y, const double z) const =0
 
virtual void ZBufferToDepthMap_ (BIAS::Image< float > &depthMap)
 used by GetDepthMap() which writes the current zbuffer in depthMap. More...
 

Protected Attributes

long int _liDebugLevel
 
long int _liNextDebugLevel
 new concept, debuglevel are managed here in the debug class More...
 
std::map< std::string, long int > _String2Debuglevel
 
BIAS::GLProjectionParametersInterface::ViewingReshapeBehaviour AutoViewingMatchBehaviour_
 
BIAS::SceneBGImagebackgroundImageScene_
 
BIAS::Vector2< unsigned int > drawingUpperLeft_
 When cutting the image this field is telling the projection the upper left corner of the drawn image part. More...
 
bool ExtrinsicStateChanged_
 Changes to the parameters or GL state that lead to new calculation of GL_MODELVIEW matrix. More...
 
bool FirstRenderingPassFinished_
 
bool informScenesOfChange_
 Abstract projection params have changed, scenes have to be informed about this. More...
 
unsigned int instanceNum_
 
bool IntrinsicStateChanged_
 Changes to the parameters or GL state that lead to new calculation of GL_PROJECTION matrix. More...
 
double lastAutoRescaleRatio_
 
BIAS::Vector2< unsigned int > lastDrawingUpperLeft_
 Keeping track which image part was drawn last time Draw() was called. More...
 
BIAS::Vector4< int > lastFullGLViewport_
 Remembering the last full viewport prevent unecessary calculations in AutoRescaleParams behaviour. More...
 
BIAS::Vector4< int > lastUsedGLViewport_
 Keeping track which part of image was drawn last time Draw() was called and where it was drawn. More...
 
bool offscreenRenderingEnabled_
 
bool subtractFromBackgroundImage_
 
double zFar_
 
double zNear_
 
BIAS::Matrix4x4< double > GLProjectionMatrix_
 
BIAS::Matrix4x4< double > GLModelViewMatrix_
 
bool callInitBeforeDraw_
 }@ More...
 
BIAS::Vector4< float > ClearColor_
 
float ClearDepth_
 
bool useStencilBuffer_
 
int cubeSideResolution_
 
bool distort_
 
BIAS::glfRenderTargetcurrentRenderTarget_
 
std::deque
< BIAS::GLProjectionOutputAttachment * > 
outputAttachments_
 
std::deque< std::vector< int > > outputAttachmentOptions_
 
std::deque< int > outputAttachmentIdentifiers_
 

Static Protected Attributes

static std::ostream _zDebugStream
 
static long int GlobalDebugLevel = 0
 

Detailed Description

GLPPB encapsulates the opengl rendering interface for the projectionparameter classes.

GLPPB replaces the glprojection. In constrast to the good old glprojection every projection type (e.g. perspective or fisheye) implements its own class based on the GLPPB interface. This hopefully reduces the code complextity and the need for gigantic case differentiations. Unlike the glprojection it does not inherit anything from the related projection class. the specific implementations (e.g. GLprojectionsparametersperspective ) are derived from GLPPB and a projectionparameter class (e.g. projectionparametersperspective). the GLPPbase class should stay generic and must not contain methods or members only related to a specific projection type. (e.g. distortion)

Author
MIP

Definition at line 44 of file GLProjectionParametersBase.hh.

Member Enumeration Documentation

Enumerator
Deny 

Do not do anything! Do not render either!

AutoRescaleParams 

rescale internal projection parameters preserving aspect ratio and scale by integer values only.

This can lead to two black borders: right and bottom

AutoCutImage 

Render part of the image or the whole image, does not change projection parameters.

drawingUpperLeft_ are the projection image coordinates which will appear in the rendered image in the upper left corner.

AutoSimplePerspectiveCam 

Calculate new simple perspective camera parameters keeping the current field of view in "y direction".

AdaptToCroppedImage 
AutoRescaleSimple 

rescale internal projection parameters preeerving aspectration but use non-integer values.

This should result in only one black border.

Definition at line 44 of file GLProjectionParametersInterface.hh.

Constructor & Destructor Documentation

GLProjectionParametersBase::GLProjectionParametersBase ( )
GLProjectionParametersBase::~GLProjectionParametersBase ( )
virtual

Definition at line 50 of file GLProjectionParametersBase.cpp.

Member Function Documentation

void GLProjectionParametersBase::AddDebugLevel ( const long int  lv)
virtual
void BIAS::Debug::AddDebugLevel ( const std::string &  name)
inlineinherited

Definition at line 362 of file Debug.hh.

void GLProjectionParametersBase::AppendOutputAttachment ( int  type,
std::vector< int >  args = std::vector<int>() 
)
virtual
void GLProjectionParametersBase::Assign ( BIAS::ProjectionParametersBase p)
virtual
int GLProjectionParametersBase::BeginDraw_ ( BIAS::glfFramebufferObject theTarget = NULL)
protectedvirtual
long BIAS::Debug::ConsumeNextFreeDebuglevel_ ( )
inlineprotectedinherited

returns the next available debuglevel

Author
woelk 09/2006

Definition at line 521 of file Debug.hh.

bool BIAS::Debug::DebugLevelIsSet ( const long int  lv) const
inlineinherited
bool BIAS::Debug::DebugLevelIsSet ( const std::string &  name) const
inlineinherited

Definition at line 350 of file Debug.hh.

int GLProjectionParametersBase::Draw ( std::vector< BIAS::SceneBase * > &  scenes,
BIAS::SceneBGImage backgroundImageScene = NULL,
BIAS::glfFramebufferObject theTarget = NULL 
)
virtual

Renders scenes passed as argument beginning with the smallest index.

Depth test is enabled per default with depth func set to GL_LESS< >. Therfore scenes rendered first will also appear in front if competing with other scenes over depth-values. If different behaviour is wanted change this within specific scene code! The background image scene must be passed through a special parameter and should not be contained in the 'scenes' vector.

Implements BIAS::GLProjectionParametersInterface.

Examples:
ExampleMultisampleBlit.cpp, and ExampleStencilBuffer.cpp.

Definition at line 158 of file GLProjectionParametersBase.cpp.

References BIAS::GLProjectionParametersInterface::AdaptToCroppedImage, AutoViewingMatchBehaviour_, backgroundImageScene_, Draw_(), DrawWithMatchedParamsAndViewport_(), ExtrinsicStateChanged_, GetGLViewport_(), BIAS::glfException::GetMessageString(), lastDrawingUpperLeft_, BIAS::GLProjectionParametersInterface::offscreenRenderingEnabled_, outputAttachments_, PrepareOutputAttachments_(), SetGLViewport_(), SetRenderTarget(), UpdateGLModelViewMatrix_(), and UpdateGLProjectionMatrix_().

Referenced by EndDraw_().

virtual int BIAS::GLProjectionParametersBase::Draw_ ( std::vector< SceneBase * > &  scenes,
BIAS::glfFramebufferObject theTarget = NULL 
)
protectedpure virtual

Implement in deriving classes.

Implemented in BIAS::GLProjectionParametersPerspective.

Referenced by Draw(), DrawPartOfImage_(), and DrawWithMatchedParamsAndViewport_().

int GLProjectionParametersBase::DrawPartOfImage_ ( const unsigned int  ulX,
const unsigned int  ulY,
const unsigned int  width,
const unsigned int  height,
std::vector< SceneBase * >  scenes 
)
protected

Renders a rectangular part of actual image.

Use if not full resolution is available for example with scrollbars. Does not update external parameter forces internal parameter update upon next call to Draw().

Attention
make sure your rendering context ist current

Definition at line 668 of file GLProjectionParametersBase.cpp.

References Draw_(), ExtrinsicStateChanged_, IntrinsicStateChanged_, UpdateGLModelViewMatrix_(), and UpdateGLProjectionMatrix_().

Referenced by DrawWithMatchedParamsAndViewport_().

int GLProjectionParametersBase::DrawWithMatchedParamsAndViewport_ ( int  viewport[4],
int  imageWidth,
int  imageHeight,
std::vector< SceneBase * > &  scenes 
)
protectedvirtual
int GLProjectionParametersBase::EndDraw_ ( BIAS::glfFramebufferObject theTarget = NULL)
protectedvirtual
bool BIAS::GLProjectionParametersBase::FirstRenderingPassFinished ( )
inline

Is true if in multipass rendering procedure is rendering for second or subsequent time.

In single pass rendering it never should return true.

Definition at line 207 of file GLProjectionParametersBase.hh.

void GLProjectionParametersBase::ForceSceneUpdate ( )

Rendering will call UpdateCameraRelatedState() on scenes.

Definition at line 1514 of file GLProjectionParametersBase.cpp.

References informScenesOfChange_.

GLProjectionOutputAttachment * GLProjectionParametersBase::GetAttachmentByType ( int  type)
virtual
virtual BIAS::Vector4<float> BIAS::GLProjectionParametersBase::GetClearColor ( )
inlinevirtual
virtual float BIAS::GLProjectionParametersBase::GetClearDepth ( )
inlinevirtual
int BIAS::Debug::GetDebugLevel ( ) const
inlineinherited
std::ostream& BIAS::Debug::GetDebugStream ( ) const
inlineinherited

Definition at line 405 of file Debug.hh.

void BIAS::Debug::GetDebugStream ( std::ostream &  os) const
inlineinherited

Definition at line 414 of file Debug.hh.

double GLProjectionParametersBase::GetDepth ( const unsigned int  x,
const unsigned int  y 
)
virtual

evaluate depth.

Point is given in pixel coords relative to upper left image corner with positive x axis directed to the right and the positive y-axis pointing down. Result is the depth on optical ray.

Attention
Point coordinates passed to this method must lie within used viewport and at the same time have the origin in the upper left corner with the y-axis pointing down the viewport side.
Result is only valid if rendering is up to date
make sure your rendering context is current

Implements BIAS::GLProjectionParametersInterface.

Definition at line 1191 of file GLProjectionParametersBase.cpp.

References BIAS::glfRenderTarget::Bind(), GetRenderTarget(), lastUsedGLViewport_, and Z2Depth_().

Referenced by GetDepth(), and UnProject().

double GLProjectionParametersBase::GetDepth ( const BIAS::HomgPoint2D p)
virtual

Implements BIAS::GLProjectionParametersInterface.

Definition at line 1157 of file GLProjectionParametersBase.cpp.

References GetDepth(), and BIAS::Less().

int GLProjectionParametersBase::GetDepthMap ( BIAS::Image< float > &  depthMap,
const float  invalid = 0.0 
)
virtual

Calculates depth map from current z-Buffer state.

Implements BIAS::GLProjectionParametersInterface.

Examples:
ExampleStencilBuffer.cpp.

Definition at line 1233 of file GLProjectionParametersBase.cpp.

References GetZBuffer(), and TranslateZToDepth().

int GLProjectionParametersBase::GetExtrinsics ( BIAS::Vector3< double > &  C,
BIAS::Vector3< double > &  up 
) const
virtual
int GLProjectionParametersBase::GetExtrinsics ( BIAS::Vector3< double > &  C,
BIAS::RMatrix R 
) const
virtual
float BIAS::GLProjectionParametersBase::GetFarClippingPlane ( ) const
inlinevirtual
BIAS::Matrix4x4<double> BIAS::GLProjectionParametersBase::GetGLModelViewMatrixTransposed ( )
inline

Definition at line 235 of file GLProjectionParametersBase.hh.

References BIAS::Matrix4x4< T >::Transpose().

static long int BIAS::Debug::GetGlobalDebugLevel ( )
inlinestaticinherited

Definition at line 431 of file Debug.hh.

BIAS::Matrix4x4<double> BIAS::GLProjectionParametersBase::GetGLProjectionMatrixTransposed ( )
inline

Definition at line 232 of file GLProjectionParametersBase.hh.

References BIAS::Matrix4x4< T >::Transpose().

int GLProjectionParametersBase::GetGLViewport_ ( int &  lowerleftx,
int &  lowerlefty,
int &  sizex,
int &  sizey 
)
protected

Definition at line 250 of file GLProjectionParametersBase.cpp.

Referenced by BeginDraw_(), and Draw().

void GLProjectionParametersBase::GetGreyImage ( BIAS::Image< unsigned char > &  image)
virtual
void GLProjectionParametersBase::GetImage ( BIAS::Image< unsigned char > &  image)
virtual
int GLProjectionParametersBase::GetMetricZMap ( BIAS::Image< float > &  metricZMap,
const float  invalid = 0.0 
)
virtual
virtual BIAS::ProjectionParametersBase* BIAS::GLProjectionParametersBase::GetMyselfAsProjectionParametersBase ( ) const
inlinevirtual

the pure virtual GetMyselfAsProjectionParameterBase() forces the child classes to inherit from a projectionparameterbase class and allows to access the projectionparams in cases where only a GLPPB* is available.

this avoids the undesired need to derive GLPPB from PPB.

Implements BIAS::GLProjectionParametersInterface.

Reimplemented in BIAS::GLProjectionParametersPerspective.

Definition at line 61 of file GLProjectionParametersBase.hh.

Referenced by PrepareOutputAttachments_(), and SetExtrinsics().

float BIAS::GLProjectionParametersBase::GetNearClippingPlane ( ) const
inlinevirtual
BIAS::glfRenderTarget * GLProjectionParametersBase::GetRenderTarget ( )
virtual
bool GLProjectionParametersBase::GetViewportCoordinates ( int &  x,
int &  y 
)
virtual

Takes x, y as window coordinates, checks whether the coordinates lie in the rendered image (in the viewrange of projection).

If so

Returns
the coordinates relative to the upper left image corner of the used viewport and true. else coordintes are unchanged and return value is false.

Implements BIAS::GLProjectionParametersInterface.

Definition at line 939 of file GLProjectionParametersBase.cpp.

References lastUsedGLViewport_.

int GLProjectionParametersBase::GetZBuffer ( BIAS::Image< float > &  zBuffer)
virtual
void GLProjectionParametersBase::InitBeforeDraw_ ( )
protected
void GLProjectionParametersBase::InitRaw_ ( )
protected
virtual int BIAS::GLProjectionParametersBase::Load ( const std::string &  filename)
pure virtual
long int BIAS::Debug::Name2DebugLevel ( const std::string &  name) const
inlineinherited

looks up a debuglevel in the internal map, returns 0 if not found

Author
woelk 09/2006

Definition at line 454 of file Debug.hh.

long int BIAS::Debug::NewDebugLevel ( const std::string &  name)
inlineinherited
virtual bool BIAS::GLProjectionParametersBase::PoseValid ( )
inlinevirtual

Implements BIAS::GLProjectionParametersInterface.

Definition at line 104 of file GLProjectionParametersBase.hh.

References PoseValid().

Referenced by PoseValid(), and UpdateGLModelViewMatrix_().

void GLProjectionParametersBase::PrepareOutputAttachments_ ( )
protected
void BIAS::Debug::PrintDebugLevel ( std::ostream &  os = std::cout) const
inlineinherited

Definition at line 383 of file Debug.hh.

BIAS::HomgPoint2D GLProjectionParametersBase::Project ( BIAS::HomgPoint3D point)
virtual
void GLProjectionParametersBase::ReadDepthBufferToTexture_ ( int  texID,
int  width,
int  height 
)
protected

Definition at line 1363 of file GLProjectionParametersBase.cpp.

void BIAS::Debug::RemoveDebugLevel ( const long int  lv)
inlineinherited

Definition at line 369 of file Debug.hh.

void BIAS::Debug::RemoveDebugLevel ( const std::string &  name)
inlineinherited

Definition at line 376 of file Debug.hh.

void GLProjectionParametersBase::Rescale ( float  ratio)

Returns the absolute world coordinate frame position of camera.

Definition at line 1225 of file GLProjectionParametersBase.cpp.

References IntrinsicStateChanged_, and Rescale_().

Referenced by BIAS::GLProjectionParametersPerspective::DrawWithMatchedParamsAndViewport_(), and DrawWithMatchedParamsAndViewport_().

virtual void BIAS::GLProjectionParametersBase::Rescale_ ( float  scale)
protectedpure virtual

Implemented in BIAS::GLProjectionParametersPerspective.

Referenced by Rescale().

virtual int BIAS::GLProjectionParametersBase::Save ( const std::string &  filename) const
pure virtual
void GLProjectionParametersBase::Set ( BIAS::ProjectionParametersBase p)
virtual

Reimplemented in BIAS::GLProjectionParametersPerspective.

Definition at line 85 of file GLProjectionParametersBase.cpp.

void BIAS::GLProjectionParametersBase::SetAutoReshapeBehaviour ( BIAS::GLProjectionParametersInterface::ViewingReshapeBehaviour  newBehaviour)
inlinevirtual
virtual void BIAS::GLProjectionParametersBase::SetClearColor ( const BIAS::Vector4< float > &  cc)
pure virtual

setclearcolor is pure virtual.

in some cases like for example distortion rendering the lower render layers (offscreen surfaces) must informed about changes of the clear color thus the child classes have to deal with the clear color on their own.

Implements BIAS::GLProjectionParametersInterface.

Implemented in BIAS::GLProjectionParametersPerspective.

void BIAS::GLProjectionParametersBase::SetClearDepth ( const float  d)
inlinevirtual

set the clear depth for render targets

Implements BIAS::GLProjectionParametersInterface.

Definition at line 250 of file GLProjectionParametersBase.hh.

void GLProjectionParametersBase::SetDebugLevel ( const long int  lv)
virtual
void BIAS::Debug::SetDebugLevel ( const std::string &  name)
inlineinherited

Definition at line 325 of file Debug.hh.

void BIAS::Debug::SetDebugStream ( const std::ostream &  os)
inlineinherited

Definition at line 398 of file Debug.hh.

int GLProjectionParametersBase::SetExtrinsics ( const BIAS::HomgPoint3D C,
const BIAS::RMatrix R 
)
virtual
int GLProjectionParametersBase::SetExtrinsics ( const BIAS::Vector3< double > &  C,
const BIAS::RMatrix R 
)
virtual
int GLProjectionParametersBase::SetExtrinsics ( const BIAS::HomgPoint3D C,
const BIAS::Quaternion< double > &  Q 
)
virtual
int GLProjectionParametersBase::SetExtrinsics ( const BIAS::Vector3< double > &  C,
const BIAS::Quaternion< double > &  Q 
)
virtual
int GLProjectionParametersBase::SetExtrinsics ( float  eyex,
float  eyey,
float  eyez,
float  scenex,
float  sceney,
float  scenez,
float  upx,
float  upy,
float  upz 
)
virtual

Set extrinsic similar to GL's gluLookAt.

Defines the camera coordinate base through specified scenepoint that is observed from given position (the eye point). And the up direction in the image (which is the -y axis of image cooridinates). Assuming orthonormal base, extrinsics are calculated. Orthonormality is assured.

Definition at line 1094 of file GLProjectionParametersBase.cpp.

References SetExtrinsics().

int GLProjectionParametersBase::SetExtrinsics ( const BIAS::Vector3< double > &  C,
const BIAS::Vector3< double > &  scenePoint,
const BIAS::Vector3< double > &  up 
)
virtual
void GLProjectionParametersBase::SetFarClippingPlane ( float  f)
virtual

Implements BIAS::GLProjectionParametersInterface.

Definition at line 972 of file GLProjectionParametersBase.cpp.

References IntrinsicStateChanged_, and zFar_.

Referenced by SetZClippingPlanes().

void GLProjectionParametersBase::SetGLCameraToLocal ( )
virtual

Sets gl's Modelview matrix for rendering relative to camera coordinate system (ignoring camera pose).

Attention
changes gl state, take care of resets yourself.
make sure your rendering context ist current

Definition at line 146 of file GLProjectionParametersBase.cpp.

virtual int BIAS::GLProjectionParametersBase::SetGLMatrices ( bool  forceUpdate = true)
pure virtual

Method loads the parameters into the projection and modelview Matrix.

forceUpdate do not check if camera state changed always recalculate.

Attention
make sure your rendering context is current.
Method is not equivalent to draw yet.

Implemented in BIAS::GLProjectionParametersPerspective.

static void BIAS::Debug::SetGlobalDebugLevel ( long int  lev)
inlinestaticinherited

Definition at line 424 of file Debug.hh.

int GLProjectionParametersBase::SetGLViewport_ ( int  lowerleftx,
int  lowerlefty,
int  sizex,
int  sizey 
)
protected
void GLProjectionParametersBase::SetIntrinsics ( BIAS::ProjectionParametersBase p)
virtual

Reimplemented in BIAS::GLProjectionParametersPerspective.

Definition at line 80 of file GLProjectionParametersBase.cpp.

Referenced by Assign().

void GLProjectionParametersBase::SetNearClippingPlane ( float  n)
virtual

Implements BIAS::GLProjectionParametersInterface.

Definition at line 965 of file GLProjectionParametersBase.cpp.

References IntrinsicStateChanged_, and zNear_.

Referenced by SetZClippingPlanes().

void GLProjectionParametersBase::SetRenderTarget ( BIAS::glfRenderTarget RT)
virtual
void GLProjectionParametersBase::SetToUnknownState_ ( )
protected
void GLProjectionParametersBase::SetZClippingPlanes ( float  n,
float  f 
)
virtual

Setting the near and far z-Clipping planes.

Implements BIAS::GLProjectionParametersInterface.

Examples:
ExampleMultisampleBlit.cpp, and ExampleStencilBuffer.cpp.

Definition at line 958 of file GLProjectionParametersBase.cpp.

References SetFarClippingPlane(), and SetNearClippingPlane().

void BIAS::Debug::ShowDebugLevel ( std::ostream &  os = std::cout) const
inlineinherited

prints all internally known debuglevels

Author
woelk 09/2006

Definition at line 496 of file Debug.hh.

void BIAS::GLProjectionParametersBase::SubtractFromBackgroundImage ( bool  subtract = true)
inline

Definition at line 209 of file GLProjectionParametersBase.hh.

void GLProjectionParametersBase::SwitchToOffscreenRendering ( bool  offscreen = true)
virtual
void GLProjectionParametersBase::TranslateDepthToZ ( BIAS::Image< float > &  depthtoz,
const float  invalid = 0.0,
const bool  flip = true 
) const
virtual

helper function which converts a z map obtained with the last camera into a depth map for the last camera

Implements BIAS::GLProjectionParametersInterface.

Definition at line 1286 of file GLProjectionParametersBase.cpp.

References BIAS::ImageBase::Flip(), BIAS::Image< StorageType >::GetImageDataArray(), BIAS::HomgPoint2D, lastUsedGLViewport_, BIAS::Vector3< T >::MultIP(), BIAS::Vector3< T >::Normalize(), zFar_, and zNear_.

void GLProjectionParametersBase::TranslateZToDepth ( BIAS::Image< float > &  ztodepth,
const float  invalid = 0.0,
const bool  flip = true 
) const
virtual

helper function which converts a z map obtained with the last camera into a depth map for the last camera

Implements BIAS::GLProjectionParametersInterface.

Definition at line 1243 of file GLProjectionParametersBase.cpp.

References BIAS::ImageBase::Flip(), BIAS::ImageBase::GetHeight(), BIAS::Image< StorageType >::GetImageDataArray(), BIAS::ImageBase::GetWidth(), Z2Depth_(), zFar_, and zNear_.

Referenced by GetDepthMap().

void GLProjectionParametersBase::TranslateZToMetricZ ( BIAS::Image< float > &  depthMap,
const float  invalid = 0.0,
const bool  flip = true 
) const
virtual
BIAS::HomgPoint3D GLProjectionParametersBase::UnProject ( const unsigned int  x,
const unsigned int  y 
)
virtual
BIAS::HomgPoint3D GLProjectionParametersBase::UnProject ( const BIAS::HomgPoint2D p)
BIAS::HomgPoint3D GLProjectionParametersBase::UnProject ( BIAS::HomgPoint2D point2D,
double  depth 
)
virtual
int GLProjectionParametersBase::UpdateGLModelViewMatrix_ ( )
protected
virtual int BIAS::GLProjectionParametersBase::UpdateGLProjectionMatrix_ ( unsigned int  x0,
unsigned int  y0,
unsigned int  width,
unsigned int  height 
)
pure virtual
virtual int BIAS::GLProjectionParametersBase::XMLRead ( const std::string &  Filename)
pure virtual
virtual int BIAS::GLProjectionParametersBase::XMLWrite ( const std::string &  Filename) const
pure virtual
virtual double BIAS::GLProjectionParametersBase::Z2Depth_ ( const int  x,
const int  y,
const double  z 
) const
protectedpure virtual
void GLProjectionParametersBase::ZBufferToDepthMap_ ( BIAS::Image< float > &  depthMap)
protectedvirtual

used by GetDepthMap() which writes the current zbuffer in depthMap.

AdjustRawZBuffer_ computes the distance from the camera to every pixel

Definition at line 1209 of file GLProjectionParametersBase.cpp.

References BIAS::Image< StorageType >::GetImageData(), lastUsedGLViewport_, and Z2Depth_().

Member Data Documentation

long int BIAS::Debug::_liDebugLevel
protectedinherited

Definition at line 510 of file Debug.hh.

Referenced by BIAS::Debug::operator=(), and BIAS::ImageBase::operator=().

long int BIAS::Debug::_liNextDebugLevel
protectedinherited

new concept, debuglevel are managed here in the debug class

Definition at line 516 of file Debug.hh.

Referenced by BIAS::Debug::operator=().

std::map<std::string, long int> BIAS::Debug::_String2Debuglevel
protectedinherited

Definition at line 517 of file Debug.hh.

Referenced by BIAS::Debug::operator=().

std::ostream BIAS::Debug::_zDebugStream
staticprotectedinherited

Definition at line 511 of file Debug.hh.

Referenced by BIAS::Debug::operator=().

BIAS::GLProjectionParametersInterface::ViewingReshapeBehaviour BIAS::GLProjectionParametersBase::AutoViewingMatchBehaviour_
protected
BIAS::SceneBGImage* BIAS::GLProjectionParametersBase::backgroundImageScene_
protected

Definition at line 321 of file GLProjectionParametersBase.hh.

Referenced by Draw(), EndDraw_(), and GLProjectionParametersBase().

bool BIAS::GLProjectionParametersBase::callInitBeforeDraw_
protected

}@

Definition at line 367 of file GLProjectionParametersBase.hh.

Referenced by BeginDraw_(), and GLProjectionParametersBase().

BIAS::Vector4<float> BIAS::GLProjectionParametersBase::ClearColor_
protected
float BIAS::GLProjectionParametersBase::ClearDepth_
protected

Definition at line 370 of file GLProjectionParametersBase.hh.

Referenced by BeginDraw_(), and GLProjectionParametersBase().

int BIAS::GLProjectionParametersBase::cubeSideResolution_
protected

Definition at line 379 of file GLProjectionParametersBase.hh.

BIAS::glfRenderTarget* BIAS::GLProjectionParametersBase::currentRenderTarget_
protected
bool BIAS::GLProjectionParametersBase::distort_
protected
BIAS::Vector2<unsigned int> BIAS::GLProjectionParametersBase::drawingUpperLeft_
protected

When cutting the image this field is telling the projection the upper left corner of the drawn image part.

Definition at line 334 of file GLProjectionParametersBase.hh.

Referenced by DrawWithMatchedParamsAndViewport_(), and SetToUnknownState_().

bool BIAS::GLProjectionParametersBase::ExtrinsicStateChanged_
protected
bool BIAS::GLProjectionParametersBase::FirstRenderingPassFinished_
protected

Definition at line 320 of file GLProjectionParametersBase.hh.

Referenced by SetToUnknownState_().

BIAS::Matrix4x4<double> BIAS::GLProjectionParametersBase::GLModelViewMatrix_
protected
long int BIAS::Debug::GlobalDebugLevel = 0
staticprotectedinherited

Definition at line 513 of file Debug.hh.

BIAS::Matrix4x4<double> BIAS::GLProjectionParametersBase::GLProjectionMatrix_
protected
Attention
BIAS::Matrix4x4 stores the matrix in row major order where GL expects a matrix in column major order! Since we want to use those matrices for rendering they are stored the way they can directly be used in GL. Before operating on those matrices and other Matrix4x4 objects some transpositions might be neccessary!

Definition at line 363 of file GLProjectionParametersBase.hh.

Referenced by BeginDraw_(), BIAS::GLProjectionParametersPerspective::SetGLMatrices(), and BIAS::GLProjectionParametersPerspective::UpdateGLProjectionMatrix_().

bool BIAS::GLProjectionParametersBase::informScenesOfChange_
protected
int GLProjectionParametersBase::instanceCounter = -1
static

Definition at line 221 of file GLProjectionParametersBase.hh.

Referenced by GLProjectionParametersBase().

unsigned int BIAS::GLProjectionParametersBase::instanceNum_
protected

Definition at line 316 of file GLProjectionParametersBase.hh.

Referenced by GLProjectionParametersBase().

bool BIAS::GLProjectionParametersBase::IntrinsicStateChanged_
protected
double BIAS::GLProjectionParametersBase::lastAutoRescaleRatio_
protected

Definition at line 341 of file GLProjectionParametersBase.hh.

BIAS::Vector2<unsigned int> BIAS::GLProjectionParametersBase::lastDrawingUpperLeft_
protected

Keeping track which image part was drawn last time Draw() was called.

The width and height of the drawn image is contained in lastUsedGLViewport

Definition at line 339 of file GLProjectionParametersBase.hh.

Referenced by Draw(), DrawWithMatchedParamsAndViewport_(), and SetToUnknownState_().

BIAS::Vector4<int> BIAS::GLProjectionParametersBase::lastFullGLViewport_
protected

Remembering the last full viewport prevent unecessary calculations in AutoRescaleParams behaviour.

Definition at line 330 of file GLProjectionParametersBase.hh.

Referenced by BIAS::GLProjectionParametersPerspective::DrawWithMatchedParamsAndViewport_(), DrawWithMatchedParamsAndViewport_(), and SetToUnknownState_().

BIAS::Vector4<int> BIAS::GLProjectionParametersBase::lastUsedGLViewport_
protected

Keeping track which part of image was drawn last time Draw() was called and where it was drawn.

Set by Draw_();

Definition at line 326 of file GLProjectionParametersBase.hh.

Referenced by BeginDraw_(), DrawWithMatchedParamsAndViewport_(), GetDepth(), GetGreyImage(), GetImage(), GetViewportCoordinates(), GetZBuffer(), SetGLViewport_(), SetToUnknownState_(), TranslateDepthToZ(), and ZBufferToDepthMap_().

bool BIAS::GLProjectionParametersInterface::offscreenRenderingEnabled_
protectedinherited
std::deque<int> BIAS::GLProjectionParametersBase::outputAttachmentIdentifiers_
protected
std::deque<std::vector<int> > BIAS::GLProjectionParametersBase::outputAttachmentOptions_
protected
std::deque<BIAS::GLProjectionOutputAttachment *> BIAS::GLProjectionParametersBase::outputAttachments_
protected
bool BIAS::GLProjectionParametersBase::subtractFromBackgroundImage_
protected
bool BIAS::GLProjectionParametersBase::useStencilBuffer_
protected
double BIAS::GLProjectionParametersBase::zFar_
protected
double BIAS::GLProjectionParametersBase::zNear_
protected

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