Is it possible to resize the image properties of a dwimage once extracted from a streamer?
below is the code of image streamer simple.
I tried modifying the width of “cudaProp.width” to a different value I got the below error.
How do I change the width in such an example before or after streaming.
// create a new imageStreamer to stream CUDA to GL and get a openGL texture to render on screen
// properties are the same as cpu image except for the type. For demonstration purposes the image is
// created as RGB, format converted in CUDA to rgba and then streamed to gL
dwImageProperties cudaProp = cpuProp;
cudaProp.type = DW_IMAGE_CUDA;
cudaProp.format = DW_IMAGE_FORMAT_RGBA_UINT8;
cudaProp.width = 500;
status = dwImage_create(&m_rgbaCUDA, cudaProp, m_context);
if (status != DW_SUCCESS) {
logError("Cannot create m_rgbaCUDA: %s\n", dwGetStatusName(status));
return false;
}
status = dwImageStreamer_initialize(&m_streamerCUDA2GL, &cudaProp, DW_IMAGE_GL, m_context);
if (status != DW_SUCCESS) {
logError("Cannot init gl image streamer m_streamerCUDA2GL: %s\n", dwGetStatusName(status));
return false;
};
}
error
[10-3-2020 17:4:49] Driveworks exception thrown: DW_INVALID_ARGUMENT: FormatConverter (cuda): width output != input
terminate called after throwing an instance of ‘std::runtime_error’
what(): Cannot format convert: DW_INVALID_ARGUMENT