Point Cloud Library (PCL)
1.7.0
|
00001 /* 00002 * Software License Agreement (BSD License) 00003 * 00004 * Copyright (c) 2011, Willow Garage, Inc. 00005 * All rights reserved. 00006 * 00007 * Redistribution and use in source and binary forms, with or without 00008 * modification, are permitted provided that the following conditions 00009 * are met: 00010 * 00011 * * Redistributions of source code must retain the above copyright 00012 * notice, this list of conditions and the following disclaimer. 00013 * * Redistributions in binary form must reproduce the above 00014 * copyright notice, this list of conditions and the following 00015 * disclaimer in the documentation and/or other materials provided 00016 * with the distribution. 00017 * * Neither the name of Willow Garage, Inc. nor the names of its 00018 * contributors may be used to endorse or promote products derived 00019 * from this software without specific prior written permission. 00020 * 00021 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00022 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00023 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 00024 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 00025 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 00026 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 00027 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 00028 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00029 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00030 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 00031 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00032 * POSSIBILITY OF SUCH DAMAGE. 00033 * 00034 * Author: Julius Kammerl (julius@kammerl.de) 00035 */ 00036 00037 #ifndef __PCL_IO_LIBPNG_WRAPPER__ 00038 #define __PCL_IO_LIBPNG_WRAPPER__ 00039 00040 #include <vector> 00041 #include <pcl/common/common.h> 00042 #include <pcl/common/io.h> 00043 00044 namespace pcl 00045 { 00046 namespace io 00047 { 00048 /** \brief Encodes 8-bit mono image to PNG format. 00049 * \param[in] image_arg input image data 00050 * \param[in] width_arg image width 00051 * \param[in] height_arg image height 00052 * \param[out] pngData PNG compressed image data 00053 * \param[in] png_level_arg zLib compression level (default level: -1) 00054 * \ingroup io 00055 */ 00056 PCL_EXPORTS void 00057 encodeMonoImageToPNG (std::vector<uint8_t>& image_arg, 00058 size_t width_arg, 00059 size_t height_arg, 00060 std::vector<uint8_t>& pngData_arg, 00061 int png_level_arg = -1); 00062 00063 /** \brief Encodes 16-bit mono image to PNG format. 00064 * \param[in] image_arg input image data 00065 * \param[in] width_arg image width 00066 * \param[in] height_arg image height 00067 * \param[out] pngData PNG compressed image data 00068 * \param[in] png_level_arg zLib compression level (default level: -1) 00069 * \ingroup io 00070 */ 00071 PCL_EXPORTS void 00072 encodeMonoImageToPNG (std::vector<uint16_t>& image_arg, 00073 size_t width_arg, 00074 size_t height_arg, 00075 std::vector<uint8_t>& pngData_arg, 00076 int png_level_arg = -1); 00077 00078 /** \brief Encodes 8-bit RGB image to PNG format. 00079 * \param[in] image_arg input image data 00080 * \param[in] width_arg image width 00081 * \param[in] height_arg image height 00082 * \param[out] pngData PNG compressed image data 00083 * \param[in] png_level_arg zLib compression level (default level: -1) 00084 * \ingroup io 00085 */ 00086 PCL_EXPORTS void 00087 encodeRGBImageToPNG (std::vector<uint8_t>& image_arg, 00088 size_t width_arg, 00089 size_t height_arg, 00090 std::vector<uint8_t>& pngData_arg, 00091 int png_level_arg = -1); 00092 00093 /** \brief Encodes 16-bit RGB image to PNG format. 00094 * \param[in] image_arg input image data 00095 * \param[in] width_arg image width 00096 * \param[in] height_arg image height 00097 * \param[out] pngData PNG compressed image data 00098 * \param[in] png_level_arg zLib compression level (default level: -1) 00099 * \ingroup io 00100 */ 00101 PCL_EXPORTS void 00102 encodeRGBImageToPNG (std::vector<uint16_t>& image_arg, 00103 size_t width_arg, 00104 size_t height_arg, 00105 std::vector<uint8_t>& pngData_arg, 00106 int png_level_arg = -1); 00107 00108 /** \brief Decode compressed PNG to 8-bit image 00109 * \param[in] pngData PNG compressed input data 00110 * \param[in] imageData image output data 00111 * \param[out] width image width 00112 * \param[out] height image height 00113 * \param[out] channels number of channels 00114 * \ingroup io 00115 */ 00116 PCL_EXPORTS void 00117 decodePNGToImage (std::vector<uint8_t>& pngData_arg, 00118 std::vector<uint8_t>& imageData_arg, 00119 size_t& width_arg, 00120 size_t& heigh_argt, 00121 unsigned int& channels_arg); 00122 00123 /** \brief Decode compressed PNG to 16-bit image 00124 * \param[in] pngData PNG compressed input data 00125 * \param[in] imageData image output data 00126 * \param[out] width image width 00127 * \param[out] height image height 00128 * \param[out] channels number of channels 00129 * \ingroup io 00130 */ 00131 PCL_EXPORTS void 00132 decodePNGToImage (std::vector<uint8_t>& pngData_arg, 00133 std::vector<uint16_t>& imageData_arg, 00134 size_t& width_arg, 00135 size_t& height_arg, 00136 unsigned int& channels_arg); 00137 } 00138 } 00139 00140 00141 #endif 00142