CameraSystem.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*
  2. * TI Voxel Lib component.
  3. *
  4. * Copyright (c) 2014 Texas Instruments Inc.
  5. */
  6. #ifndef VOXEL_CAMERASYSTEM_H
  7. #define VOXEL_CAMERASYSTEM_H
  8. #include <DepthCameraLibrary.h>
  9. #include "DownloaderFactory.h"
  10. namespace Voxel
  11. {
  12. /**
  13. * \defgroup CamSys Camera System Components
  14. * @{
  15. * \brief This group of classes provide the higher level API for cameras
  16. * @}
  17. */
  18. /**
  19. * \ingroup CamSys
  20. *
  21. * \brief This class provides ways to instantiate individual cameras and components like filters.
  22. */
  23. class VOXEL_EXPORT CameraSystem
  24. {
  25. protected:
  26. Vector<DepthCameraLibraryPtr> _libraries;
  27. Map<String, DepthCameraFactoryPtr> _factories; // Key = device ID as returned by Device::id()
  28. Map<String, DepthCameraPtr> _depthCameras; // Key = device ID as returned by Device::id()
  29. Map<String, FilterFactoryPtr> _filterFactories; // Key = filter name
  30. Map<String, DownloaderFactoryPtr> _downloaderFactories;// Key = device ID as returned by Device::id()
  31. Map<GeneratorIDType, DepthCameraFactoryPtr> _factoryForGeneratorID; // Key = frame generator ID
  32. void _init();
  33. void _loadLibraries(const Vector<String> &paths);
  34. public:
  35. CameraSystem();
  36. bool addDepthCameraFactory(DepthCameraFactoryPtr factory);
  37. Vector<DevicePtr> scan();
  38. DepthCameraPtr connect(const DevicePtr &device);
  39. // Remove local reference. Outside calling function should remove reference to its DepthCamera as well
  40. bool disconnect(const DepthCameraPtr &depthCamera, bool reset = false);
  41. bool addFilterFactory(FilterFactoryPtr filterFactory);
  42. Vector<String> getSupportedFilters();
  43. bool getFilterDescription(const String &filterName, FilterDescription &description);
  44. FilterPtr createFilter(const String &name, DepthCamera::FrameType type);
  45. Vector<DevicePtr> getProgrammableDevices();
  46. bool addDownloaderFactory(DownloaderFactoryPtr downloaderFactory);
  47. DownloaderPtr getDownloader(const DevicePtr &device);
  48. bool getFrameGenerator(uint8_t frameType, GeneratorIDType generatorID, FrameGeneratorPtr &frameGenerator);
  49. virtual ~CameraSystem();
  50. };
  51. }
  52. #endif // VOXEL_CAMERASYSTEM_H