Point Cloud Library (PCL)  1.6.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
print.h
Go to the documentation of this file.
1 /*
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2010, Willow Garage, Inc.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * * Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  * * Redistributions in binary form must reproduce the above
14  * copyright notice, this list of conditions and the following
15  * disclaimer in the documentation and/or other materials provided
16  * with the distribution.
17  * * Neither the name of Willow Garage, Inc. nor the names of its
18  * contributors may be used to endorse or promote products derived
19  * from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32  * POSSIBILITY OF SUCH DAMAGE.
33  *
34  * $Id: print.h 6126 2012-07-03 20:19:58Z aichim $
35  *
36  */
37 #ifndef TERMINAL_TOOLS_PRINT_H_
38 #define TERMINAL_TOOLS_PRINT_H_
39 
40 #include <stdio.h>
41 #include <stdarg.h>
42 
43 #include <pcl/pcl_macros.h>
44 
45 #define PCL_ALWAYS(...) pcl::console::print (pcl::console::L_ALWAYS, __VA_ARGS__)
46 #define PCL_ERROR(...) pcl::console::print (pcl::console::L_ERROR, __VA_ARGS__)
47 #define PCL_WARN(...) pcl::console::print (pcl::console::L_WARN, __VA_ARGS__)
48 #define PCL_INFO(...) pcl::console::print (pcl::console::L_INFO, __VA_ARGS__)
49 #define PCL_DEBUG(...) pcl::console::print (pcl::console::L_DEBUG, __VA_ARGS__)
50 #define PCL_VERBOSE(...) pcl::console::print (pcl::console::L_VERBOSE, __VA_ARGS__)
51 
52 namespace pcl
53 {
54  namespace console
55  {
57  {
58  TT_RESET = 0,
59  TT_BRIGHT = 1,
60  TT_DIM = 2,
62  TT_BLINK = 4,
65  };
66 
67  enum TT_COLORS
68  {
77  };
78 
80  {
87  };
88 
90  PCL_EXPORTS void
92 
96 
98  PCL_EXPORTS bool
100 
102  PCL_EXPORTS bool
104 
111  PCL_EXPORTS void
112  change_text_color (FILE *stream, int attribute, int fg, int bg);
113 
119  PCL_EXPORTS void
120  change_text_color (FILE *stream, int attribute, int fg);
121 
125  PCL_EXPORTS void
126  reset_text_color (FILE *stream);
127 
134  PCL_EXPORTS void
135  print_color (FILE *stream, int attr, int fg, const char *format, ...);
136 
140  PCL_EXPORTS void
141  print_info (const char *format, ...);
142 
147  PCL_EXPORTS void
148  print_info (FILE *stream, const char *format, ...);
149 
153  PCL_EXPORTS void
154  print_highlight (const char *format, ...);
155 
160  PCL_EXPORTS void
161  print_highlight (FILE *stream, const char *format, ...);
162 
166  PCL_EXPORTS void
167  print_error (const char *format, ...);
168 
173  PCL_EXPORTS void
174  print_error (FILE *stream, const char *format, ...);
175 
179  PCL_EXPORTS void
180  print_warn (const char *format, ...);
181 
186  PCL_EXPORTS void
187  print_warn (FILE *stream, const char *format, ...);
188 
192  PCL_EXPORTS void
193  print_debug (const char *format, ...);
194 
199  PCL_EXPORTS void
200  print_debug (FILE *stream, const char *format, ...);
201 
202 
206  PCL_EXPORTS void
207  print_value (const char *format, ...);
208 
213  PCL_EXPORTS void
214  print_value (FILE *stream, const char *format, ...);
215 
221  PCL_EXPORTS void
222  print (VERBOSITY_LEVEL level, FILE *stream, const char *format, ...);
223 
228  PCL_EXPORTS void
229  print (VERBOSITY_LEVEL level, const char *format, ...);
230  }
231 }
232 
233 #endif