i want to load an external image (.jpg, .ppm) into an optiX buffer to denoise it afterwards. i tried something like this below. I loaded the image with openCV, resized the buffer to the size of the image and tried to map the image to the buffer.
cv::Mat src = cv::imread(file_path);
int width = src.cols;
int height = src.rows;
sutil::resizeBuffer(getBuffer(), width, height);
void *dst = getBuffer()->map(0, RT_BUFFER_MAP_WRITE_DISCARD);
memcpy(dst, &src, sizeof(src));
The program throws an exception like:
“Microsoft C++ exception: prodlib::InvalidValue at memory location 0x000000000013F2E0”.
I would guess that an openCV Mat is not the correct datatyp to assign a image to the buffer. Does anyone could point me to a correct direction, so that i can load an external image to an optiX buffer?
Thank you in advance! Cheers, Jakob