00001 /************************************************************************************************** 00002 Software License Agreement (BSD License) 00003 00004 Copyright (c) 2011-2013, LAR toolkit developers - University of Aveiro - http://lars.mec.ua.pt 00005 All rights reserved. 00006 00007 Redistribution and use in source and binary forms, with or without modification, are permitted 00008 provided that the following conditions are met: 00009 00010 *Redistributions of source code must retain the above copyright notice, this list of 00011 conditions and the following disclaimer. 00012 *Redistributions in binary form must reproduce the above copyright notice, this list of 00013 conditions and the following disclaimer in the documentation and/or other materials provided 00014 with the distribution. 00015 *Neither the name of the University of Aveiro nor the names of its contributors may be used to 00016 endorse or promote products derived from this software without specific prior written permission. 00017 00018 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR 00019 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 00020 FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 00021 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00022 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 00023 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 00024 IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 00025 OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00026 ***************************************************************************************************/ 00033 #ifndef _colormap_H_ 00034 #define _colormap_H_ 00035 00036 //#################################################################### 00037 // Includes: 00038 //#################################################################### 00039 #include <ros/ros.h> 00040 #include <sensor_msgs/PointCloud2.h> 00041 #include <sensor_msgs/PointCloud.h> 00042 #include <visualization_msgs/Marker.h> 00043 #include <tf/transform_broadcaster.h> 00044 00045 #include <opencv2/core/core.hpp> 00046 00047 00048 class class_colormap 00049 { 00050 public: 00051 class_colormap(std::string name, int total, float alfa, bool reverse=false); 00052 ~class_colormap(void); 00053 00054 std_msgs::ColorRGBA color(int i); 00055 cv::Scalar cv_color(int i); 00056 00057 private: 00058 std::vector<std_msgs::ColorRGBA> cm; 00059 int max_index; 00060 00061 00062 00063 int setup_colormap(int total, float alfa, bool reverse, float* r, float* g, float* b); 00064 00065 int init_colormap_jet(int total, float alfa, bool reverse); 00066 int init_colormap_hsv(int total, float alfa, bool reverse); 00067 int init_colormap_hot(int total, float alfa, bool reverse); 00068 int init_colormap_cool(int total, float alfa, bool reverse); 00069 int init_colormap_spring(int total, float alfa, bool reverse); 00070 int init_colormap_summer(int total, float alfa, bool reverse); 00071 int init_colormap_autumn(int total, float alfa, bool reverse); 00072 int init_colormap_winter(int total, float alfa, bool reverse); 00073 int init_colormap_gray(int total, float alfa, bool reverse); 00074 int init_colormap_bone(int total, float alfa, bool reverse); 00075 int init_colormap_copper(int total, float alfa, bool reverse); 00076 int init_colormap_pink(int total, float alfa, bool reverse); 00077 int init_colormap_lines(int total, float alfa, bool reverse); 00078 }; 00079 00080 #endif 00081