MCPcopy Create free account
hub / github.com/OpenKinect/libfreenect2 / populateFrame

Method populateFrame

src/openni2/DepthStream.cpp:69–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67}
68
69void DepthStream::populateFrame(libfreenect2::Frame* srcFrame, int srcX, int srcY, OniFrame* dstFrame, int dstX, int dstY, int width, int height) const
70{
71 dstFrame->sensorType = getSensorType();
72 dstFrame->stride = dstFrame->width * sizeof(uint16_t);
73
74 // XXX, save depth map for registration
75 if (reg->isEnabled())
76 reg->depthFrame(srcFrame);
77
78 if (srcFrame->width < (size_t)dstFrame->width || srcFrame->height < (size_t)dstFrame->height)
79 memset(dstFrame->data, 0x00, dstFrame->width * dstFrame->height * 2);
80
81 // copy stream buffer from freenect
82 copyFrame(static_cast<float*>((void*)srcFrame->data), srcX, srcY, srcFrame->width,
83 static_cast<uint16_t*>(dstFrame->data), dstX, dstY, dstFrame->width,
84 width, height, mirroring);
85}
86
87OniSensorType DepthStream::getSensorType() const { return ONI_SENSOR_DEPTH; }
88

Callers

nothing calls this directly

Calls 2

isEnabledMethod · 0.80
depthFrameMethod · 0.80

Tested by

no test coverage detected