| 67 | } |
| 68 | |
| 69 | void 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 | |
| 87 | OniSensorType DepthStream::getSensorType() const { return ONI_SENSOR_DEPTH; } |
| 88 |
nothing calls this directly
no test coverage detected