newton.utils.copy_rgb_frame_uint8#

newton.utils.copy_rgb_frame_uint8 = <warp._src.context.Kernel object>[source]#

Copy a flat RGB buffer to a 3D array with vertical flip.

Converts a flat RGB uint8 buffer (as produced by OpenGL readPixels) into a 3D array of shape (height, width, 3) with the image flipped vertically to convert from OpenGL’s bottom-left origin to top-left origin.

Launch with dim=(width, height).

Parameters:
  • input_img (array(ndim=1, dtype=uint8)) – Flat uint8 array of size (width * height * 3) containing packed RGB values.

  • width (int) – Image width in pixels.

  • height (int) – Image height in pixels.

  • output_img (array(ndim=3, dtype=uint8)) – Output array of shape (height, width, 3) to write the flipped RGB image.