InputFrame.H
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 #ifndef CHANNELS_INPUTFRAME_H_DEFINED
00039 #define CHANNELS_INPUTFRAME_H_DEFINED
00040
00041 #include "Image/Image.H"
00042 #include "Image/Pixels.H"
00043 #include "Image/PyramidCache.H"
00044 #include "Util/SimTime.H"
00045 #include "rutz/shared_ptr.h"
00046
00047 class InputFrame
00048 {
00049 public:
00050
00051 InputFrame();
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072 static InputFrame fromRgb(const Image<PixRGB<byte> >* in,
00073 SimTime t = SimTime::ZERO(),
00074 const Image<byte>* clip = 0,
00075 const rutz::shared_ptr<PyramidCache<float> >& cache = emptyCache,
00076 bool disableCache = false);
00077
00078 static InputFrame fromRgbFloat(const Image<PixRGB<float> >* col,
00079 SimTime t = SimTime::ZERO(),
00080 const Image<byte> * clip = 0,
00081 const rutz::shared_ptr<PyramidCache<float> >& cache = emptyCache,
00082 bool disableCache = false);
00083
00084 static InputFrame fromGrayFloat(const Image<float>* bw,
00085 SimTime t = SimTime::ZERO(),
00086 const Image<byte> * clip = 0,
00087 const rutz::shared_ptr<PyramidCache<float> >& cache = emptyCache,
00088 bool disableCache = false);
00089
00090 static InputFrame fromRgbAndGrayFloat(const Image<PixRGB<byte> >* rgbb,
00091 const Image<PixRGB<float> >* rgbf,
00092 const Image<float>* bw,
00093 SimTime t = SimTime::ZERO(),
00094 const Image<byte> * clip = 0,
00095 const rutz::shared_ptr<PyramidCache<float> >& cache = emptyCache,
00096 bool disableCache = false);
00097
00098 static InputFrame fromRgbDepth(const Image<PixRGB<byte> >* in,
00099 const Image<uint16>* depth,
00100 SimTime t = SimTime::ZERO(),
00101 const Image<byte>* clip = 0,
00102 const rutz::shared_ptr<PyramidCache<float> >& cache = emptyCache,
00103 bool disableCache = false);
00104
00105
00106 SimTime time() const { return itsTime; }
00107
00108 const Dims& getDims() const { return itsDims; }
00109 const int getWidth() const { return itsDims.w(); }
00110 const int getHeight() const { return itsDims.h(); }
00111
00112 const Image<byte>& clipMask() const { return itsClipMask; }
00113
00114 const Image<PixRGB<byte> >& colorByte() const { return itsColorByte; }
00115 const Image<PixRGB<float> >& colorFloat() const;
00116 const Image<float>& grayFloat() const { return itsGrayFloat; }
00117
00118 const rutz::shared_ptr<PyramidCache<float> >& pyrCache() const { return itsPyrCache; }
00119
00120 static const rutz::shared_ptr<PyramidCache<float> > emptyCache;
00121
00122 const Image<uint16> getDepthImage() const { return itsDepthImage; }
00123
00124 const bool hasDepthImage() const { return itsDepthImage.initialized(); }
00125
00126 void setPyrCacheRgb(const rutz::shared_ptr<PyramidCache<PixRGB<float> > >& pyr)
00127 { itsPyrCacheRgb = pyr; }
00128
00129 void setPyrCache(const rutz::shared_ptr<PyramidCache<float> >& pyr)
00130 { itsPyrCache = pyr; }
00131
00132 private:
00133 SimTime itsTime;
00134 Dims itsDims;
00135 Image<byte> itsClipMask;
00136 Image<PixRGB<byte> > itsColorByte;
00137 mutable Image<PixRGB<float> > itsColorFloat;
00138 Image<float> itsGrayFloat;
00139 rutz::shared_ptr<PyramidCache<float> > itsPyrCache;
00140 rutz::shared_ptr<PyramidCache<PixRGB<float> > > itsPyrCacheRgb;
00141 Image<uint16> itsDepthImage;
00142 };
00143
00144
00145
00146
00147
00148
00149
00150 #endif // CHANNELS_INPUTFRAME_H_DEFINED