Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
SceneBGImage.hh
1 /*
2  This file is part of the BIAS library (Basic ImageAlgorithmS).
3 
4  Copyright (C) 2003, 2004 (see file CONTACTS for details)
5  Multimediale Systeme der Informationsverarbeitung
6  Institut fuer Informatik
7  Christian-Albrechts-Universitaet Kiel
8 
9 
10  BIAS is free software; you can redistribute it and/or modify
11  it under the terms of the GNU Lesser General Public License as published by
12  the Free Software Foundation; either version 2.1 of the License, or
13  (at your option) any later version.
14 
15  BIAS is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  GNU Lesser General Public License for more details.
19 
20  You should have received a copy of the GNU Lesser General Public License
21  along with BIAS; if not, write to the Free Software
22  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 */
24 
25 #ifndef __SCENEBGIMAGE_HH__
26 #define __SCENEBGIMAGE_HH__
27 
28 #include <GLviewer/Scenes/SceneBase.hh>
29 #include <bias_config.h>
30 #include <Gui/biasgl.h>
31 #include <Base/Image/Image.hh>
32 #include <Base/Math/Vector2.hh>
33 #include <Base/Math/Vector3.hh>
34 
35 namespace BIAS
36 {
37 /** \class SceneBGImage
38  \brief Scene that renders a background image behind all other scenes
39  \ingroup g_glviewer
40  \author MIP
41  */
42  class BIASGLviewer_EXPORT SceneBGImage : public SceneBase
43  {
44  public:
45  virtual ~SceneBGImage(){}
46  SceneBGImage();
47  int SetImage(const BIAS::Image<unsigned char> &img);
48 
49  /// Query the maximum texture size supported by OpenGL. Only valid after calling SetImage() at least once.
50  int GetMaxTextureSize(){return MaxTextureSize_;};
51  /// set filter for minification and magnification , use GL_NEAREST, GL_LINEAR and co.
52  void SetMinMagFilter(int MinFilter,int MagFilter);
53  protected:
54  virtual void Draw();
55 
56  // take a _copy_ of the image to allow resizing
57  int InitializeTexture_(BIAS::Image<unsigned char> img);
61  GLint MinFilter_,MagFilter_;
62  unsigned int ImgWidth_,ImgHeight_;
63  BIAS::Vector2<float> TexCoord_[4];
64  };
65 }//end of namespace
66 
67 #endif
Scene that renders a background image behind all other scenes.
Definition: SceneBGImage.hh:42
GLuint BackgroundImageTex_
Definition: SceneBGImage.hh:60
int GetMaxTextureSize()
Query the maximum texture size supported by OpenGL. Only valid after calling SetImage() at least once...
Definition: SceneBGImage.hh:50
class BIASGLviewer_EXPORT SceneBGImage
unsigned int ImgWidth_
Definition: SceneBGImage.hh:62
Base class for all scenes.
Definition: SceneBase.hh:68
virtual ~SceneBGImage()
Definition: SceneBGImage.hh:45