Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
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
Commits
b689eca8
Commit
b689eca8
authored
Dec 05, 2012
by
Vladislav Vinogradov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed OpenGL tests
now create window only once per test case
parent
aabc33c7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
10 deletions
+13
-10
opengl_interop.hpp
modules/core/include/opencv2/core/opengl_interop.hpp
+3
-3
opengl_interop.cpp
modules/core/src/opengl_interop.cpp
+10
-7
test_opengl.cpp
modules/gpu/test/test_opengl.cpp
+0
-0
No files found.
modules/core/include/opencv2/core/opengl_interop.hpp
View file @
b689eca8
...
...
@@ -106,10 +106,10 @@ public:
void
copyFrom
(
InputArray
arr
,
Target
target
=
ARRAY_BUFFER
,
bool
autoRelease
=
false
);
//! copy to host/device memory
void
copyTo
(
OutputArray
arr
,
Target
target
=
ARRAY_BUFFER
)
const
;
void
copyTo
(
OutputArray
arr
,
Target
target
=
ARRAY_BUFFER
,
bool
autoRelease
=
false
)
const
;
//! create copy of current buffer
GlBuffer
clone
(
Target
target
=
ARRAY_BUFFER
)
const
;
GlBuffer
clone
(
Target
target
=
ARRAY_BUFFER
,
bool
autoRelease
=
false
)
const
;
//! bind buffer for specified target
void
bind
(
Target
target
)
const
;
...
...
@@ -189,7 +189,7 @@ public:
void
copyFrom
(
InputArray
arr
,
bool
autoRelease
=
false
);
//! copy to host/device memory
void
copyTo
(
OutputArray
arr
,
int
ddepth
=
CV_32F
)
const
;
void
copyTo
(
OutputArray
arr
,
int
ddepth
=
CV_32F
,
bool
autoRelease
=
false
)
const
;
//! bind texture to current active texture unit for GL_TEXTURE_2D target
void
bind
()
const
;
...
...
modules/core/src/opengl_interop.cpp
View file @
b689eca8
...
...
@@ -672,11 +672,12 @@ void cv::GlBuffer::copyFrom(InputArray arr, Target target, bool autoRelease)
#endif
}
void
cv
::
GlBuffer
::
copyTo
(
OutputArray
arr
,
Target
target
)
const
void
cv
::
GlBuffer
::
copyTo
(
OutputArray
arr
,
Target
target
,
bool
autoRelease
)
const
{
#ifndef HAVE_OPENGL
(
void
)
arr
;
(
void
)
target
;
(
void
)
autoRelease
;
throw_nogl
();
#else
const
int
kind
=
arr
.
kind
();
...
...
@@ -685,13 +686,13 @@ void cv::GlBuffer::copyTo(OutputArray arr, Target target) const
{
case
_InputArray
:
:
OPENGL_BUFFER
:
{
arr
.
getGlBufferRef
().
copyFrom
(
*
this
,
target
);
arr
.
getGlBufferRef
().
copyFrom
(
*
this
,
target
,
autoRelease
);
break
;
}
case
_InputArray
:
:
OPENGL_TEXTURE2D
:
{
arr
.
getGlTexture2DRef
().
copyFrom
(
*
this
);
arr
.
getGlTexture2DRef
().
copyFrom
(
*
this
,
autoRelease
);
break
;
}
...
...
@@ -719,15 +720,16 @@ void cv::GlBuffer::copyTo(OutputArray arr, Target target) const
#endif
}
GlBuffer
cv
::
GlBuffer
::
clone
(
Target
target
)
const
GlBuffer
cv
::
GlBuffer
::
clone
(
Target
target
,
bool
autoRelease
)
const
{
#ifndef HAVE_OPENGL
(
void
)
target
;
(
void
)
autoRelease
;
throw_nogl
();
return
GlBuffer
();
#else
GlBuffer
buf
;
buf
.
copyFrom
(
*
this
,
target
);
buf
.
copyFrom
(
*
this
,
target
,
autoRelease
);
return
buf
;
#endif
}
...
...
@@ -1156,11 +1158,12 @@ void cv::GlTexture2D::copyFrom(InputArray arr, bool autoRelease)
#endif
}
void
cv
::
GlTexture2D
::
copyTo
(
OutputArray
arr
,
int
ddepth
)
const
void
cv
::
GlTexture2D
::
copyTo
(
OutputArray
arr
,
int
ddepth
,
bool
autoRelease
)
const
{
#ifndef HAVE_OPENGL
(
void
)
arr
;
(
void
)
ddepth
;
(
void
)
autoRelease
;
throw_nogl
();
#else
const
int
kind
=
arr
.
kind
();
...
...
@@ -1173,7 +1176,7 @@ void cv::GlTexture2D::copyTo(OutputArray arr, int ddepth) const
case
_InputArray
:
:
OPENGL_BUFFER
:
{
GlBuffer
&
buf
=
arr
.
getGlBufferRef
();
buf
.
create
(
rows_
,
cols_
,
CV_MAKE_TYPE
(
ddepth
,
cn
),
GlBuffer
::
PIXEL_PACK_BUFFER
);
buf
.
create
(
rows_
,
cols_
,
CV_MAKE_TYPE
(
ddepth
,
cn
),
GlBuffer
::
PIXEL_PACK_BUFFER
,
autoRelease
);
buf
.
bind
(
GlBuffer
::
PIXEL_PACK_BUFFER
);
impl_
->
copyTo
(
dstFormat
,
gl_types
[
ddepth
],
0
);
GlBuffer
::
unbind
(
GlBuffer
::
PIXEL_PACK_BUFFER
);
...
...
modules/gpu/test/test_opengl.cpp
View file @
b689eca8
This diff is collapsed.
Click to expand it.
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