Skip to content

Add accessors for the various depth tables. #554

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 3, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions include/libfreenect2/packet_pipeline.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@

#include <libfreenect2/config.h>

#include <stdlib.h>

namespace libfreenect2
{

Expand Down Expand Up @@ -71,6 +73,13 @@ class LIBFREENECT2_API PacketPipeline
public:
DumpPacketPipeline();
virtual ~DumpPacketPipeline();

// These are all required to decode depth data
const unsigned char* getDepthP0Tables(size_t* length);

const float* getDepthXTable(size_t* length);
const float* getDepthZTable(size_t* length);
const short* getDepthLookupTable(size_t* length);
};

/** Pipeline with CPU depth processing. */
Expand Down
21 changes: 21 additions & 0 deletions src/packet_pipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <libfreenect2/data_callback.h>
#include <libfreenect2/rgb_packet_stream_parser.h>
#include <libfreenect2/depth_packet_stream_parser.h>
#include <libfreenect2/protocol/response.h>

namespace libfreenect2
{
Expand Down Expand Up @@ -138,4 +139,24 @@ DumpPacketPipeline::DumpPacketPipeline()

DumpPacketPipeline::~DumpPacketPipeline() {}

const unsigned char* DumpPacketPipeline::getDepthP0Tables(size_t* length) {
*length = sizeof(libfreenect2::protocol::P0TablesResponse);
return static_cast<DumpDepthPacketProcessor*>(getDepthPacketProcessor())->getP0Tables();
}

const float* DumpPacketPipeline::getDepthXTable(size_t* length) {
*length = DepthPacketProcessor::TABLE_SIZE;
return static_cast<DumpDepthPacketProcessor*>(getDepthPacketProcessor())->getXTable();
}

const float* DumpPacketPipeline::getDepthZTable(size_t* length) {
*length = DepthPacketProcessor::TABLE_SIZE;
return static_cast<DumpDepthPacketProcessor*>(getDepthPacketProcessor())->getZTable();
}

const short* DumpPacketPipeline::getDepthLookupTable(size_t* length) {
*length = DepthPacketProcessor::LUT_SIZE;
return static_cast<DumpDepthPacketProcessor*>(getDepthPacketProcessor())->getLookupTable();
}

} /* namespace libfreenect2 */