Skip to content

Commit c447e5f

Browse files
committed
Added vxTruncateArray wrapper to ivx::Array
1 parent beea04c commit c447e5f

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
@@ -2008,6 +2008,14 @@ class Array : public RefWrapper<vx_array>
20082008
IVX_CHECK_STATUS(vxAddArrayItems(ref, count, ptr, stride));
20092009
}
20102010

2011+
void truncateArray(vx_size new_count)
2012+
{
2013+
if(new_count <= itemCount())
2014+
IVX_CHECK_STATUS(vxTruncateArray(ref, new_count));
2015+
else
2016+
throw WrapperError(std::string(__func__) + "(): array is too small");
2017+
}
2018+
20112019
void copyRangeTo(size_t start, size_t end, void* data)
20122020
{
20132021
if (!data) throw WrapperError(std::string(__func__) + "(): output pointer is 0");

0 commit comments

Comments
 (0)