What does setCropping do in openni2?

I can’t seem to find documentation on what it actually does?

The documentation in the OpenNI2 repository on GitHub (OpenNI2/Include/OpenNI.h at master · structureio/OpenNI2 · GitHub) has a small documentation about it:

/**
Changes the cropping settings for this stream. You can use the @ref isCroppingSupported()
function to make sure cropping is supported before calling this function.
@param [in] originX New X coordinate of the upper left corner of the cropping window.
@param [in] originY New Y coordinate of the upper left corner of the cropping window.
@param [in] width New horizontal width for the cropping window, in pixels.
@param [in] height New vertical height for the cropping window, in pixels.
@returns Status code indicating success or failure of this operation.
*/

I don’t know if Orbbec Astra cameras support this cropping feature though. You could check that with the isCroppingSupported() function.