Path: blob/master/modules/videoio/src/cap_intelperc.hpp
16354 views
/*M///////////////////////////////////////////////////////////////////////////////////////1//2// This file is part of OpenCV project.3// It is subject to the license terms in the LICENSE file found in the top-level directory4// of this distribution and at http://opencv.org/license.html.5//6// Copyright (C) 2014, Itseez, Inc., all rights reserved.7// Third party copyrights are property of their respective owners.8//9//M*/1011#ifndef _CAP_INTELPERC_HPP_12#define _CAP_INTELPERC_HPP_1314#include "precomp.hpp"1516#ifdef HAVE_INTELPERC1718#include "pxcsession.h"19#include "pxcsmartptr.h"20#include "pxccapture.h"2122namespace cv23{2425class IntelPerCStreamBase26{27public:28IntelPerCStreamBase();29virtual ~IntelPerCStreamBase();3031bool isValid();32bool grabFrame();33int getProfileIDX() const;34public:35virtual bool initStream(PXCSession *session) = 0;36virtual double getProperty(int propIdx) const;37virtual bool setProperty(int propIdx, double propVal);38protected:39mutable PXCSmartPtr<PXCCapture::Device> m_device;40bool initDevice(PXCSession *session);4142PXCSmartPtr<PXCCapture::VideoStream> m_stream;43void initStreamImpl(PXCImage::ImageType type);44protected:45std::vector<PXCCapture::VideoStream::ProfileInfo> m_profiles;46int m_profileIdx;47int m_frameIdx;48pxcU64 m_timeStampStartNS;49double m_timeStamp;50PXCSmartPtr<PXCImage> m_pxcImage;5152virtual bool validProfile(const PXCCapture::VideoStream::ProfileInfo& /*pinfo*/);53void enumProfiles();54};5556class IntelPerCStreamImage57: public IntelPerCStreamBase58{59public:60IntelPerCStreamImage();61virtual ~IntelPerCStreamImage();6263virtual bool initStream(PXCSession *session);64virtual double getProperty(int propIdx) const;65virtual bool setProperty(int propIdx, double propVal);66public:67bool retrieveAsOutputArray(OutputArray image);68};6970class IntelPerCStreamDepth71: public IntelPerCStreamBase72{73public:74IntelPerCStreamDepth();75virtual ~IntelPerCStreamDepth();7677virtual bool initStream(PXCSession *session);78virtual double getProperty(int propIdx) const;79virtual bool setProperty(int propIdx, double propVal);80public:81bool retrieveDepthAsOutputArray(OutputArray image);82bool retrieveIRAsOutputArray(OutputArray image);83bool retrieveUVAsOutputArray(OutputArray image);84protected:85virtual bool validProfile(const PXCCapture::VideoStream::ProfileInfo& pinfo);86protected:87bool retriveFrame(int type, int planeIdx, OutputArray frame);88};8990class VideoCapture_IntelPerC : public IVideoCapture91{92public:93VideoCapture_IntelPerC();94virtual ~VideoCapture_IntelPerC();9596virtual double getProperty(int propIdx) const CV_OVERRIDE;97virtual bool setProperty(int propIdx, double propVal) CV_OVERRIDE;9899virtual bool grabFrame() CV_OVERRIDE;100virtual bool retrieveFrame(int outputType, OutputArray frame) CV_OVERRIDE;101virtual int getCaptureDomain() CV_OVERRIDE;102virtual bool isOpened() const CV_OVERRIDE;103protected:104bool m_contextOpened;105106PXCSmartPtr<PXCSession> m_session;107IntelPerCStreamImage m_imageStream;108IntelPerCStreamDepth m_depthStream;109};110111}112113#endif //HAVE_INTELPERC114#endif //_CAP_INTELPERC_HPP_115116