Skip to content

Commit 5592142

Browse files
committed
Merge pull request opencv#7831 from terfendail:ovx_array_update
2 parents 53f72f1 + c447e5f commit 5592142

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

3rdparty/openvx/include/ivx.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2135,6 +2135,14 @@ class Array : public RefWrapper<vx_array>
21352135
IVX_CHECK_STATUS(vxAddArrayItems(ref, count, ptr, stride));
21362136
}
21372137

2138+
void truncateArray(vx_size new_count)
2139+
{
2140+
if(new_count <= itemCount())
2141+
IVX_CHECK_STATUS(vxTruncateArray(ref, new_count));
2142+
else
2143+
throw WrapperError(std::string(__func__) + "(): array is too small");
2144+
}
2145+
21382146
void copyRangeTo(size_t start, size_t end, void* data)
21392147
{
21402148
if (!data) throw WrapperError(std::string(__func__) + "(): output pointer is 0");

0 commit comments

Comments
 (0)