Skip to content
Permalink
16e941848f
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
74 lines (61 sloc) 2.48 KB
/** \file dab_tracker_azure_tools.h
*/
#include <iostream>
#include <map>
#include <k4a/k4a.hpp>
#include <k4arecord/types.h>
#include <k4arecord/playback.hpp>
#include "dab_value.h"
#include "dab_exception.h"
#include "dab_singleton.h"
#pragma once
#define AzureFOURCC(cc) ((cc)[0] | (cc)[1] << 8 | (cc)[2] << 16 | (cc)[3] << 24)
namespace dab
{
namespace tracker
{
class AzureCamera;
struct AzureMovieHeader
{
uint32_t biSize;
uint32_t biWidth;
uint32_t biHeight;
uint16_t biPlanes;
uint16_t biBitCount;
uint32_t biCompression;
uint32_t biSizeImage;
uint32_t biXPelsPerMeter;
uint32_t biYPelsPerMeter;
uint32_t biClrUsed;
uint32_t biClrImportant;
};
class AzureTools : public dab::Singleton<AzureTools>
{
friend class AzureCamera;
public:
AzureTools();
~AzureTools();
protected:
void init();
void initCameras();
void initCamera(std::shared_ptr<AzureCamera> pCamera) throw (dab::Exception);
void initControls(std::shared_ptr<AzureCamera> pCamera) throw (dab::Exception);
void setControlValue(const std::string& pControlName, const AbstractValue& pValue, std::shared_ptr<AzureCamera> pCamera) throw (dab::Exception);
void capture(std::shared_ptr<AzureCamera> pCamera) throw (dab::Exception);
void updateColorFrame(std::shared_ptr<AzureCamera> pCamera, const k4a::image& pNativeColorFrame) throw (dab::Exception);
void updateDepthFrame(std::shared_ptr<AzureCamera> pCamera, const k4a::image& pNativeDepthFrame) throw (dab::Exception);
void updatePointCloud(std::shared_ptr<AzureCamera> pCamera, const k4a::image& pNativePointCloudFrame) throw (dab::Exception);
void startMovieRecording(std::shared_ptr<AzureCamera> pCamera, const std::string& pFileName) throw (dab::Exception);
void stopMovieRecording(std::shared_ptr<AzureCamera> pCamera) throw (dab::Exception);
bool checkCameraAvailable(const std::string& pSerialNr);
bool checkCameraOpen(const std::string& pSerialNr);
void openCamera(std::shared_ptr<AzureCamera> pCamera) throw (dab::Exception);
void configureCamera(std::shared_ptr<AzureCamera> pCamera) throw (dab::Exception);
void openMovie(std::shared_ptr<AzureCamera> pCamera) throw (dab::Exception);
void createCameraFrames(std::shared_ptr<AzureCamera> pCamera) throw (dab::Exception);
void createMovieHeader( const std::array<uint32_t, 2>& pFrameSize, AzureMovieHeader *pHeader);
std::map<std::string, std::shared_ptr<AzureCamera> > mCameras;
std::vector<std::string> mAvailabeDevices;
};
}
}