How to access the main camera image as an array in c++?

Hi,

I am trying to simulate a camera moving through a scene while storing the frames. I can navigate the main camera through the scene but I don’t know how to access the image array per frame in my c++ code so I can store/record each frame. What I am basically looking for is something like this

unsigned char image_array[width*height];
memcp(ue4_engine.main_camera.image.data, image_array, sizeof(unsigned char)widthheight);

Could anyone point me to the correct “ue4_engine.main_camera.image.data”?

Thank you!