Hello all,
I am trying to save an image from the Java-Android with FastCV. From the JNI part, in my c++ code, i receives and array of bytes with format
YUV NV21, and I'd like to parser it as a RGB888_u8 image in order to get a .bmp file, but i am not able to do it... ..I only get a black image...
This is my code:
uint8_t *pToData = (uint8_t *) data;
uint32_t *dstRGB888 = (uint32_t *)fcvMemAlloc(WIDTH*HEIGHT*sizeof(uint32_t),16);
fcvColorYCrCb420PseudoPlanarToRGB8888u8(pToData,WIDTH,HEIGHT,0,0,dstRGB888,0);
data contains the array of bytes... (unsigned char*)
WIDTH = 600
HEIGHT = 480
This is the function to save in a file
inline void SaveFile (std::string filename, uint32_t * rgb888, int width, int height) {
std::fstream file(filename, std::ios::out | std::ios::binary);
file.write((char*)rgb888,width*height*sizeof(uint32_t));;
file.close();
}
I would appreciate any help... (or some code snippet to know how implement this part...)