* Load p0 tables from a command response, * @param buffer Buffer containing the response. * @param buffer_length Length of the response data. */
| 829 | * @param buffer_length Length of the response data. |
| 830 | */ |
| 831 | void CpuDepthPacketProcessor::loadP0TablesFromCommandResponse(unsigned char* buffer, size_t buffer_length) |
| 832 | { |
| 833 | // TODO: check known header fields (headersize, tablesize) |
| 834 | libfreenect2::protocol::P0TablesResponse* p0table = (libfreenect2::protocol::P0TablesResponse*)buffer; |
| 835 | |
| 836 | if(buffer_length < sizeof(libfreenect2::protocol::P0TablesResponse)) |
| 837 | { |
| 838 | LOG_ERROR << "P0Table response too short!"; |
| 839 | return; |
| 840 | } |
| 841 | |
| 842 | if(impl_->flip_ptables) |
| 843 | { |
| 844 | flipHorizontal(Mat<uint16_t>(424, 512, p0table->p0table0), impl_->p0_table0); |
| 845 | flipHorizontal(Mat<uint16_t>(424, 512, p0table->p0table1), impl_->p0_table1); |
| 846 | flipHorizontal(Mat<uint16_t>(424, 512, p0table->p0table2), impl_->p0_table2); |
| 847 | } |
| 848 | else |
| 849 | { |
| 850 | Mat<uint16_t> p00(424, 512, p0table->p0table0); |
| 851 | p00.copyTo(impl_->p0_table0); |
| 852 | Mat<uint16_t>(424, 512, p0table->p0table1).copyTo(impl_->p0_table1); |
| 853 | Mat<uint16_t>(424, 512, p0table->p0table2).copyTo(impl_->p0_table2); |
| 854 | } |
| 855 | |
| 856 | impl_->fillTrigTable(impl_->p0_table0, impl_->trig_table0); |
| 857 | impl_->fillTrigTable(impl_->p0_table1, impl_->trig_table1); |
| 858 | impl_->fillTrigTable(impl_->p0_table2, impl_->trig_table2); |
| 859 | } |
| 860 | |
| 861 | void CpuDepthPacketProcessor::loadXZTables(const float *xtable, const float *ztable) |
| 862 | { |
nothing calls this directly
no test coverage detected