当前位置:网站首页>[openvx] VX for basic use of objects_ lut
[openvx] VX for basic use of objects_ lut
2022-07-28 03:39:00 【zhy29563】
Catalog
1. Test source
#include <iostream>
#include <VX/vx.h>
void print_lut(vx_lut lut, const char *message)
{
std::cout << "===============================" << std::endl;
std::cout << message << std::endl;
vx_enum type;
vxQueryLUT(lut, (vx_enum)VX_LUT_TYPE, &type, sizeof(type));
vx_size count;
vxQueryLUT(lut, (vx_enum)VX_LUT_COUNT, &count, sizeof(count));
vx_size size;
vxQueryLUT(lut, (vx_enum)VX_LUT_SIZE, &size, sizeof(size));
vx_uint32 offset;
vxQueryLUT(lut, (vx_enum)VX_LUT_OFFSET, &offset, sizeof(offset));
std::cout << "type : " << type << std::endl;
std::cout << "count : " << count << std::endl;
std::cout << "size : " << size << std::endl;
std::cout << "offset : " << offset << std::endl;
vx_map_id map_id;
void* ptr;
std::cout << "item : " << std::endl;
vxMapLUT(lut, &map_id, &ptr, VX_READ_ONLY, VX_MEMORY_TYPE_HOST, 0);
for (int i = 0; i < count; ++i) {
std::cout << "\t" << "index: " << i << ", value: " << (int)((vx_uint8*)ptr)[i] << std::endl;
}
vxUnmapLUT(lut, map_id);
}
int main(int argc, char *argv[])
{
(void)argc;
(void)argv;
vx_context context = vxCreateContext();
vx_lut lut = vxCreateLUT(context, VX_TYPE_UINT8, 10);
print_lut(lut, "create");
vx_uint8 *array = new vx_uint8 [10];
for (int i = 0; i < 10; ++i)
array[i] = i;
vxCopyLUT(lut, array, VX_WRITE_ONLY, VX_MEMORY_TYPE_HOST);
print_lut(lut, "update");
delete[] array;
vxReleaseLUT(&lut);
vxReleaseContext(&context);
return EXIT_SUCCESS;
}
2. Running results
===============================
create
type : 3
count : 10
size : 10
offset : 0
item :
index: 0, value: 112
index: 1, value: 215
index: 2, value: 2
index: 3, value: 30
index: 4, value: 102
index: 5, value: 85
index: 6, value: 0
index: 7, value: 0
index: 8, value: 0
index: 9, value: 0
===============================
update
type : 3
count : 10
size : 10
offset : 0
item :
index: 0, value: 0
index: 1, value: 1
index: 2, value: 2
index: 3, value: 3
index: 4, value: 4
index: 5, value: 5
index: 6, value: 6
index: 7, value: 7
index: 8, value: 8
index: 9, value: 9
边栏推荐
- How to use JDBC to operate database
- 20220727 use the Bluetooth module hc-05 of Huicheng technology to pair mobile phones for Bluetooth serial port demonstration
- 【P4】 查看库文件两个历史版本的区别
- 收藏|0 基础开源数据可视化平台 FlyFish 大屏开发指南
- 每日练习------实现双色球的彩票功能。规则:从36个红球中随机选择不重复的6个数,从15个篮球中随机选择1个组成一注彩票。可以选择买多注。
- ⽇志分析⼯具(Splunk)
- 695. Maximum area of the island
- Response to questions about the balanced beacon group of Hubei University of Arts and Sciences
- 【P4】解决本地文件修改与库文件间的冲突问题
- How to solve MySQL deep paging problem
猜你喜欢

12月份PMP考试首次采用新考纲,该怎么学?

How to uninstall clean ZABBIX service? (super detailed)

收藏|0 基础开源数据可视化平台 FlyFish 大屏开发指南

LabVIEW loads and uses custom symbols in tree control projects

20220727 use the Bluetooth module hc-05 of Huicheng technology to pair mobile phones for Bluetooth serial port demonstration

单调栈——42. 接雨水——面大厂必须会的困难题

Prefix-Tuning: Optimizing Continuous Prompts for Generation

【论文笔记】基于深度学习的移动机器人自主导航实验平台

20220726 at command test of Bluetooth module hc-05 of Huicheng Technology

The wonderful use of asemi rectifier bridge GBPC3510 in DC brush motor
随机推荐
Asemi rectifier bridge gbpc5010, gbpc5010 parameters, gbpc5010 size
ASEMI整流桥GBPC3510在直流有刷电机中的妙用
BRD,MRD,PRD的区别
动态规划——1049. 最后一块石头的重量 II
ES6 from getting started to mastering 09: symbol type
The open source of "avoiding disease and avoiding medicine" will not go far
SQL Server备份数据库的方法
【OPENVX】对象基本使用之vx_image
接口自动化测试,完整入门篇
【OPENVX】对象基本使用之vx_matrix
LabVIEW加载和使用树型控件项目中的定制符号
695. 岛屿的最大面积
Responsive high-end website template source code Gallery material resource download platform source code
过亿资产地址被拉入黑名单?Tether地址冻结功能该怎么用?
Mysql基础篇(创建、管理、增删改表)
C language to achieve a dynamic version of the address book
自定义注解的使用
[paper notes] mobile robot autonomous navigation experimental platform based on deep learning
golang gorm查询任意字段的组装方法
Xctf attack and defense world web master advanced area php2