Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv_contrib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv_contrib
Commits
3604786e
Commit
3604786e
authored
Nov 22, 2019
by
Pavel Rojtberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ovis: add support for off-screen windows
parent
dff14225
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
2 deletions
+24
-2
ovis.hpp
modules/ovis/include/opencv2/ovis.hpp
+7
-1
ovis.cpp
modules/ovis/src/ovis.cpp
+17
-1
No files found.
modules/ovis/include/opencv2/ovis.hpp
View file @
3604786e
...
...
@@ -25,7 +25,9 @@ enum SceneSettings
/// draw coordinate system crosses for debugging
SCENE_SHOW_CS_CROSS
=
4
,
/// Apply anti-aliasing. The first window determines the setting for all windows.
SCENE_AA
=
8
SCENE_AA
=
8
,
/// Render off-screen without a window. Allows separate AA setting. Requires manual update via @ref WindowScene::update
SCENE_OFFSCREEN
=
16
};
enum
MaterialProperty
...
...
@@ -276,6 +278,10 @@ public:
CV_WRAP
virtual
void
setCameraIntrinsics
(
InputArray
K
,
const
Size
&
imsize
,
float
zNear
=
-
1
,
float
zFar
=
-
1
)
=
0
;
/**
* render this window, but do not swap buffers. Automatically called by @ref ovis::waitKey
*/
CV_WRAP
virtual
void
update
()
=
0
;
};
/**
...
...
modules/ovis/src/ovis.cpp
View file @
3604786e
...
...
@@ -289,7 +289,7 @@ class WindowSceneImpl : public WindowScene
Root
*
root
;
SceneManager
*
sceneMgr
;
SceneNode
*
camNode
;
Render
Window
*
rWin
;
Render
Target
*
rWin
;
Ptr
<
OgreBites
::
CameraMan
>
camman
;
Ptr
<
Rectangle2D
>
bgplane
;
std
::
unordered_map
<
AnimationState
*
,
Controller
<
Real
>*>
frameCtrlrs
;
...
...
@@ -344,11 +344,22 @@ public:
if
(
!
app
->
sceneMgr
)
{
CV_Assert
((
flags
&
SCENE_OFFSCREEN
)
==
0
&&
"off-screen rendering for main window not supported"
);
app
->
sceneMgr
=
sceneMgr
;
rWin
=
app
->
getRenderWindow
();
if
(
camman
)
app
->
addInputListener
(
camman
.
get
());
}
else
if
(
flags
&
SCENE_OFFSCREEN
)
{
// render into an offscreen texture
TexturePtr
tex
=
TextureManager
::
getSingleton
().
createManual
(
title
,
RESOURCEGROUP_NAME
,
TEX_TYPE_2D
,
sz
.
width
,
sz
.
height
,
0
,
PF_BYTE_RGB
,
TU_RENDERTARGET
,
NULL
,
false
,
flags
&
SCENE_AA
?
4
:
0
);
rWin
=
tex
->
getBuffer
()
->
getRenderTarget
();
rWin
->
setAutoUpdated
(
false
);
// only update when requested
}
else
{
OgreBites
::
NativeWindowPair
nwin
=
app
->
createWindow
(
title
,
sz
.
width
,
sz
.
height
);
...
...
@@ -820,6 +831,11 @@ public:
ndc
=
(
2
*
f
*
n
)
/
ndc
;
}
void
update
()
{
rWin
->
update
(
false
);
}
void
fixCameraYawAxis
(
bool
useFixed
,
InputArray
_up
)
CV_OVERRIDE
{
#if OGRE_VERSION >= ((1 << 16) | (11 << 8) | 5)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment