1 #ifndef IMAGE_BUFFER_6RYGHM2V 2 #define IMAGE_BUFFER_6RYGHM2V 5 #include <boost/thread/mutex.hpp> 6 #include <boost/shared_ptr.hpp> 7 #include <boost/lexical_cast.hpp> 9 #include <libfreenect/libfreenect.h> 37 return RGB_FOCAL_LENGTH_SXGA * scale;
46 float depth_focal_length_sxga =
50 return depth_focal_length_sxga * scale;
65 boost::lock_guard<boost::mutex> buffer_lock(buffer.
mutex);
84 throw std::runtime_error(
"libfreenect: Invalid video fmt, res: " +
85 boost::lexical_cast<std::string>(format) +
"," +
86 boost::lexical_cast<std::string>(resolution));
90 throw std::runtime_error(
"libfreenect: Invalid video resolution: " +
91 boost::lexical_cast<std::string>(resolution));
95 throw std::runtime_error(
"libfreenect: Invalid video format: " +
96 boost::lexical_cast<std::string>(format));
114 throw std::runtime_error(
"libfreenect: shouldn't reach here");
131 boost::lock_guard<boost::mutex> buffer_lock(buffer.
mutex);
144 switch (resolution) {
149 throw std::runtime_error(
"libfreenect: Invalid depth fmt, res: " +
150 boost::lexical_cast<std::string>(format) +
"," +
151 boost::lexical_cast<std::string>(resolution));
155 throw std::runtime_error(
"libfreenect: Invalid depth resolution: " +
156 boost::lexical_cast<std::string>(resolution));
160 throw std::runtime_error(
"libfreenect: Invalid depth format: " +
161 boost::lexical_cast<std::string>(format));
181 throw std::runtime_error(
"libfreenect: shouldn't reach here");
void allocateBufferDepth(ImageBuffer &buffer, const freenect_depth_format &format, const freenect_resolution &resolution, const freenect_registration ®istration)
void allocateBufferVideo(ImageBuffer &buffer, const freenect_video_format &format, const freenect_resolution &resolution, const freenect_registration ®istration)
void fillImage(const ImageBuffer &buffer, void *data)
freenect_zero_plane_info zero_plane_info
FREENECT_DEPTH_10BIT_PACKED
FREENECT_DEPTH_11BIT_PACKED
const float RGB_FOCAL_LENGTH_SXGA
float getDepthFocalLength(const freenect_registration ®istration, int width)
Holds an image buffer with all the metadata required to transmit the image over ROS channels...
float getRGBFocalLength(int width)
freenect_frame_mode freenect_find_video_mode(freenect_resolution res, freenect_video_format fmt)
freenect_frame_mode freenect_find_depth_mode(freenect_resolution res, freenect_depth_format fmt)
boost::shared_array< unsigned char > image_buffer
freenect_frame_mode metadata
FREENECT_RESOLUTION_MEDIUM
FREENECT_VIDEO_IR_10BIT_PACKED
float reference_pixel_size
FREENECT_DEPTH_REGISTERED