Hey guys! I'm doing a little experiment and need a sanity check. Haven't been able to find a whole lot of information, so I'm wondering if anyone's here looked at this.
So, I have a COP Subnet HDA that's simply loading an image. However, when I try to extract it to memory and write it out to a file or have Qt load it, it looks completely washed out. Does this code look like the right method for a simple image extraction through COPs?
HAPI_CookNode( this->session, this->assetNode, &this->cookOptions); HAPI_RenderCOPToImage(this->session, this->assetNode); int bufferSize; HAPI_ExtractImageToMemory(this->session, this->assetNode, HAPI_PNG_FORMAT_NAME, "C A", &bufferSize); std::vector<char> data; data.resize(bufferSize); HAPI_GetImageMemoryBuffer(this->session, this->assetNode, &data.front(), bufferSize);
Regarding writing out, I'm just using ofstream:
std::ofstream file(outputFilePath); if( file ) { file.write(&data.front(), data.size()); }
Notes: I attached a sample of the output. I also haven't looked through the data of the image itself to see what is exactly missing.