Basic Image AlgorithmS Library
2.8.0
Main Page
Related Pages
Modules
Classes
Examples
All
Classes
Namespaces
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Groups
Pages
GLviewer
ContextPBuffer.cpp
1
#include <GLviewer/ContextPBuffer.hh>
2
3
#include <OpenGLFramework/Base/glfException.hh>
4
5
using namespace
std;
6
using namespace
BIAS;
7
using namespace
BIAS;
8
9
10
int
ContextPBuffer::
11
Init(
unsigned
int
width,
unsigned
int
height,
12
unsigned
int
RBits,
unsigned
int
GBits,
unsigned
int
BBits,
13
unsigned
int
ABits,
unsigned
int
DepthBits,
unsigned
int
StencilBits)
14
{
15
glfRenderingContextConfig
cfg;
16
cfg.
width
= width;
17
cfg.
height
= height;
18
cfg.
doubleBuffer
= 0;
19
cfg.
redSize
= RBits;
20
cfg.
greenSize
= GBits;
21
cfg.
blueSize
= BBits;
22
cfg.
alphaSize
= ABits;
23
cfg.
depthSize
= DepthBits;
24
cfg.
stencilSize
= StencilBits;
25
26
try
{
27
glfPBuffer::Init(cfg);
28
}
catch
(
glfException
& e) {
29
std::cout <<
"Error: "
<< e.
GetMessageString
() << std::endl;
30
return
-1;
31
}
32
return
0;
33
}
34
35
36
int
ContextPBuffer::
37
Render() {
38
// MakeCurrent();
39
int
res =RenderContextBase::Render();
40
glFinish();
41
return
res;
42
}
43
44
45
int
ContextPBuffer::
46
GetImage(
BIAS::Image<unsigned char>
&
Image
,
bool
lock)
47
{
48
//TODO: Check if locking can be ignored here
49
MakeCurrent();
50
RenderContextBase::GetImage(Image);
51
glFinish();
52
return
0;
53
}
54
55
int
ContextPBuffer::
56
GetDepthMap(
BIAS::Image<float>
&
Image
,
const
float
invalid,
bool
lock)
57
{
58
//TODO: Check if locking can be ignored here
59
//MakeCurrent();
60
int
res = RenderContextBase::GetDepthMap(Image, invalid);
61
//glFinish();
62
return
res;
63
}
64
65
int
ContextPBuffer::
66
GetMetricZMap(
BIAS::Image<float>
&
Image
,
const
float
invalid,
bool
lock)
67
{
68
//TODO: Check if locking can be ignored here
69
MakeCurrent();
70
int
res = RenderContextBase::GetMetricZMap(Image, invalid);
71
glFinish();
72
return
res;
73
}
BIAS::glfRenderingContextConfig::depthSize
int depthSize
Definition:
glfRenderingContext.hh:48
BIAS::glfRenderingContextConfig::height
int height
Definition:
glfRenderingContext.hh:42
BIAS::glfRenderingContextConfig::alphaSize
int alphaSize
Definition:
glfRenderingContext.hh:47
BIAS::glfRenderingContextConfig::width
int width
Definition:
glfRenderingContext.hh:41
BIAS::glfRenderingContextConfig::greenSize
int greenSize
Definition:
glfRenderingContext.hh:45
BIAS::glfRenderingContextConfig::doubleBuffer
bool doubleBuffer
Definition:
glfRenderingContext.hh:43
BIAS::glfException
Exception class used for run-time errors in the OpenGLFramework.
Definition:
glfException.hh:79
BIAS::glfRenderingContextConfig::redSize
int redSize
Definition:
glfRenderingContext.hh:44
BIAS::glfException::GetMessageString
const std::string & GetMessageString() const
Returns the description of the error including the file name and line number where the error occured...
Definition:
glfException.cpp:52
BIAS::Image< unsigned char >
BIAS::glfRenderingContextConfig::blueSize
int blueSize
Definition:
glfRenderingContext.hh:46
BIAS::glfRenderingContextConfig
Configuration for a rendering context.
Definition:
glfRenderingContext.hh:36
BIAS::glfRenderingContextConfig::stencilSize
int stencilSize
Definition:
glfRenderingContext.hh:49
Generated on Tue Feb 6 2018 02:01:37 for Basic Image AlgorithmS Library by
1.8.5