- void rga_dms(char *img, char *result) {
- RockchipRga &rkRga(RockchipRga::get());
- rga_info_t src;
- rga_info_t crop;
- rga_info_t resize;
- unsigned char buf_crop[360 * 480 * 3];
- unsigned char buf_resize[320 * 320 * 3];
- memset(&src, 0, sizeof(rga_info_t));
- memset(&crop, 0, sizeof(rga_info_t));
- memset(&resize, 0, sizeof(rga_info_t));
- src.fd = -1;
- src.virAddr = img;
- src.mmuFlag = 1;
- LOGE("11111");
- crop.fd = -1;
- crop.virAddr = buf_crop;
- crop.mmuFlag = 1;
- rga_set_rect(&src.rect, 0, 0, 360, 480, 640, 480, RK_FORMAT_RGB_888);
- rga_set_rect(&crop.rect, 0, 0, 360, 480, 360, 480, RK_FORMAT_RGB_888);
- rkRga.RkRgaBlit(&src, &crop, NULL);
- LOGE("2222");
- resize.fd = -1;
- resize.virAddr = buf_resize;
- resize.mmuFlag = 1;
- rga_set_rect(&resize.rect, 0, 0, 320, 320, 320, 320, RK_FORMAT_RGB_888);
- rkRga.RkRgaBlit(&crop, &resize, NULL);
- LOGE("3333");
- }
复制代码
欢迎光临 Toybrick (https://t.rock-chips.com/) | Powered by Discuz! X3.3 |