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
e8d2aad9
Commit
e8d2aad9
authored
Nov 17, 2016
by
apavlenko
Committed by
Rostislav Vasilikhin
Nov 22, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sugar for single plane images
parent
9032a7ab
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
0 deletions
+30
-0
ivx.hpp
3rdparty/openvx/include/ivx.hpp
+30
-0
No files found.
3rdparty/openvx/include/ivx.hpp
View file @
e8d2aad9
...
...
@@ -871,6 +871,10 @@ public:
static
Image
createVirtual
(
vx_graph
graph
,
vx_uint32
width
=
0
,
vx_uint32
height
=
0
,
vx_df_image
format
=
VX_DF_IMAGE_VIRT
)
{
return
Image
(
vxCreateVirtualImage
(
graph
,
width
,
height
,
format
));
}
/// vxCreateUniformImage() wrapper
static
Image
createUniform
(
vx_context
context
,
vx_uint32
width
,
vx_uint32
height
,
vx_df_image
format
,
const
vx_pixel_value_t
&
value
)
{
return
Image
(
vxCreateUniformImage
(
context
,
width
,
height
,
format
,
&
value
));
}
/// Planes number for the specified image format (fourcc)
/// \return 0 for unknown formats
static
vx_size
planes
(
vx_df_image
format
)
...
...
@@ -954,6 +958,13 @@ public:
#endif
}
/// vxCreateImageFromHandle() wrapper for a single plane image
static
Image
createFromHandle
(
vx_context
context
,
vx_df_image
format
,
const
vx_imagepatch_addressing_t
&
addr
,
void
*
ptr
)
{
if
(
planes
(
format
)
!=
1
)
throw
WrapperError
(
std
::
string
(
__func__
)
+
"(): not a single plane format"
);
return
Image
(
vxCreateImageFromHandle
(
context
,
format
,
&
addr
,
&
ptr
,
VX_MEMORY_TYPE_HOST
));
}
#ifdef VX_VERSION_1_1
/// vxSwapImageHandle() wrapper
/// \param newPtrs keeps addresses of new image planes data, can be of image planes size or empty when new pointers are not provided
...
...
@@ -973,6 +984,17 @@ public:
num
)
);
}
/// vxSwapImageHandle() wrapper for a single plane image
/// \param newPtr an address of new image data, can be zero when new pointer is not provided
/// \return the previuos address of image data
void
*
swapHandle
(
void
*
newPtr
)
{
if
(
planes
()
!=
1
)
throw
WrapperError
(
std
::
string
(
__func__
)
+
"(): not a single plane image"
);
void
*
prevPtr
=
0
;
IVX_CHECK_STATUS
(
vxSwapImageHandle
(
ref
,
&
newPtr
,
&
prevPtr
,
1
)
);
return
prevPtr
;
}
/// vxSwapImageHandle() wrapper for the case when no new pointers provided and previous ones are not needed (retrive memory back)
void
swapHandle
()
{
IVX_CHECK_STATUS
(
vxSwapImageHandle
(
ref
,
0
,
0
,
0
)
);
}
...
...
@@ -1251,6 +1273,14 @@ static const vx_enum
//vx_rectangle_t r = getValidRegion();
copyFrom
(
planeIdx
,
createAddressing
((
vx_uint32
)
m
.
cols
,
(
vx_uint32
)
m
.
rows
,
(
vx_int32
)
m
.
elemSize
(),
(
vx_int32
)
m
.
step
),
m
.
ptr
());
}
/*
static Image createFromHandle(vx_context context, const cv::Mat& mat)
{ throw WrapperError(std::string(__func__)+"(): NYI"); }
cv::Mat swapHandle(const cv::Mat& newMat)
{ throw WrapperError(std::string(__func__)+"(): NYI"); }
*/
#endif //IVX_USE_OPENCV
struct
Patch
;
...
...
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