Point Cloud Library (PCL)  1.9.1
image_ir.h
1 /*
2 * Software License Agreement (BSD License)
3 *
4 * Copyright (c) 2011 Willow Garage, Inc.
5 *
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 *
12 * * Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * * Redistributions in binary form must reproduce the above
15 * copyright notice, this list of conditions and the following
16 * disclaimer in the documentation and/or other materials provided
17 * with the distribution.
18 * * Neither the name of the copyright holder(s) nor the names of its
19 * contributors may be used to endorse or promote products derived
20 * from this software without specific prior written permission.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
25 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
28 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
30 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
32 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33 * POSSIBILITY OF SUCH DAMAGE.
34 *
35 */
36 #ifndef PCL_IO_IMAGE_IR_H_
37 #define PCL_IO_IMAGE_IR_H_
38 
39 #include <pcl/pcl_macros.h>
40 #include <pcl/io/boost.h>
41 
42 #include <pcl/io/image_metadata_wrapper.h>
43 
44 namespace pcl
45 {
46  namespace io
47  {
48 
49  /**
50  * @brief Class containing just a reference to IR meta data.
51  */
52  class PCL_EXPORTS IRImage
53  {
54  public:
55  typedef boost::shared_ptr<IRImage> Ptr;
56  typedef boost::shared_ptr<const IRImage> ConstPtr;
57 
58  typedef boost::chrono::high_resolution_clock Clock;
59  typedef boost::chrono::high_resolution_clock::time_point Timestamp;
60 
61  IRImage (FrameWrapper::Ptr ir_metadata);
62  IRImage (FrameWrapper::Ptr ir_metadata, Timestamp time);
63 
64  ~IRImage () throw ()
65  {}
66 
67  void
68  fillRaw (unsigned width, unsigned height, unsigned short* ir_buffer, unsigned line_step = 0) const;
69 
70  unsigned
71  getWidth () const;
72 
73  unsigned
74  getHeight () const;
75 
76  unsigned
77  getFrameID () const;
78 
79  pcl::uint64_t
80  getTimestamp () const;
81 
82  Timestamp
83  getSystemTimestamp () const;
84 
85  // Get a const pointer to the raw depth buffer. If the data is accessed just read-only, then this method is faster than a fillXXX method
86  const unsigned short*
87  getData ();
88 
89  // Data buffer size in bytes
90  int
91  getDataSize () const;
92 
93  // Size of each row, including any padding
94  inline unsigned
95  getStep() const
96  {
97  return (getDataSize() / getHeight());
98  }
99 
100  /** \brief method to access the internal data structure wrapper, which needs to be cast to an
101  * approperate subclass before the getMetadata(..) function is available to access the native data type.
102  */
103  const FrameWrapper::Ptr
104  getMetaData () const;
105 
106  protected:
109  };
110 
111  } // namespace
112 }
113 
114 #endif // PCL_IO_IMAGE_IR_H_
Timestamp timestamp_
Definition: image_ir.h:108
boost::shared_ptr< FrameWrapper > Ptr
boost::shared_ptr< const IRImage > ConstPtr
Definition: image_ir.h:56
Class containing just a reference to IR meta data.
Definition: image_ir.h:52
boost::shared_ptr< IRImage > Ptr
Definition: image_ir.h:55
This file defines compatibility wrappers for low level I/O functions.
Definition: convolution.h:45
unsigned getStep() const
Definition: image_ir.h:95
boost::chrono::high_resolution_clock::time_point Timestamp
Definition: image_ir.h:59
FrameWrapper::Ptr wrapper_
Definition: image_ir.h:107
boost::chrono::high_resolution_clock Clock
Definition: image_ir.h:58