Share via


INuiFusionReconstruction::ImportVolumeBlock Method

Imports a reconstruction volume as a buffer of shorts, with color as an integer buffer.

Syntax

public:
HRESULT ImportVolumeBlock(
         UINT cbVolumeBlock,
         const SHORT *pVolumeBlock
)

Parameters

  • cbVolumeBlock
    Type: UINT
    The size of the pVolumeBlock buffer.

  • pVolumeBlock
    Type: SHORT
    A pre-allocated short buffer filled with volume data. This buffer must equal the size of the current initialized reconstruction volume. The number of elements in this buffer should be allocated as (destinationResolutionX*destinationResolutionY*destinationResolutionZ). To access the voxel located at x,y,z use pVolume[z][y][x], or index as a one-dimensional array for a particular voxel (x,y,z) as follows (with pitch = x resolution, slice = (y resolution * pitch)). `

    unsigned int index = (z * slice)  + (y * pitch) + x;

    Note

    A right handed coordinate system is used, with the origin of the volume (that is, voxel 0,0,0) at the top left of the front plane of the cube. Similar to bitmap images with top left origin, +X is to the right, +Y down, and +Z is forward from the origin into the reconstruction volume.

Return value

Type: HRESULT
S_OK if successful; otherwise, returns a failure code.

Requirements

Header: nuikinectfusionvolume.h

Library: TBD