Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
VideoSource_ShmPMD.hh
1 /*
2 This file is part of the BIAS library (Basic ImageAlgorithmS).
3 
4 Copyright (C) 2003-2009 (see file CONTACT for details)
5  Multimediale Systeme der Informationsverarbeitung
6  Institut fuer Informatik
7  Christian-Albrechts-Universitaet Kiel
8 
9 
10 BIAS is free software; you can redistribute it and/or modify
11 it under the terms of the GNU Lesser General Public License as published by
12 the Free Software Foundation; either version 2.1 of the License, or
13 (at your option) any later version.
14 
15 BIAS is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU Lesser General Public License for more details.
19 
20 You should have received a copy of the GNU Lesser General Public License
21 along with BIAS; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 */
24 #ifndef __BIASVIDEOSOURCE_SHMPMD_HH__
25 #define __BIASVIDEOSOURCE_SHMPMD_HH__
26 
27 
28 
29 #include <iostream>
30 #include <sstream>
31 #include <VideoSource/VideoSource_Shm.hh>
32 
33 #ifdef WIN32
34 # define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
35 # include <windows.h>
36 # ifdef Yield
37 # undef Yield
38 # endif
39 #endif
40 
41 
42 namespace BIAS{
43 
44 
45 
46  /**
47  \class VideoSource_ShmPMD
48  \ingroup g_videosource
49  \author Birger Streckel
50  \brief This class implements a video streaming client using shared memory to
51  receive images from another application. It also transfers Depth and
52  Amplitude data coming from a PMD camera.
53  */
54  class BIASVideoSource_EXPORT VideoSource_ShmPMD : public VideoSource_Shm {
55 
56  public:
57 
60  int GrabSingle(BIAS::Camera <unsigned char> &image);
61 
62  /** Returns the depth image. Must be called after GrabSingle() */
63  inline int GrabSingleDepth(Camera<float> &image)
64  {
65  if (!DepthImg_.IsEmpty()) {
66  image = DepthImg_;
67  return 0;
68  }
69  return -1;
70  }
71 
72  /** Returns the depth image. Must be called after GrabSingle() */
73  inline int GrabSingleModCoeff(Camera<float> &image)
74  {
75  if (!ModCoeffImg_.IsEmpty()) {
76  image = ModCoeffImg_;
77  return 0;
78  }
79  return -1;
80  }
81 
82 
83  protected:
84  /*!\brief prohibit default function (move to 'public' if needed) */
86  /*!\brief prohibit default function (move to 'public' if needed) */
87  VideoSource_ShmPMD& operator =(const VideoSource_ShmPMD &source);
88 
90 
91  };
92 
93 
94 } // namespace MIP
95 
96 #endif
This class implements a video streaming client using shared memory to receive images from another app...
BIAS::Camera< float > ModCoeffImg_
This class implements a video streaming client using shared memory to receive images from another app...
int GrabSingleDepth(Camera< float > &image)
Returns the depth image.
int GrabSingleModCoeff(Camera< float > &image)
Returns the depth image.