libigl v2.5.0
Loading...
Searching...
No Matches
REDRUM.h
Go to the documentation of this file.
1// This file is part of libigl, a simple c++ geometry processing library.
2//
3// Copyright (C) 2013 Alec Jacobson <alecjacobson@gmail.com>
4//
5// This Source Code Form is subject to the terms of the Mozilla Public License
6// v. 2.0. If a copy of the MPL was not distributed with this file, You can
7// obtain one at http://mozilla.org/MPL/2.0/.
8#ifndef IGL_REDRUM_H
9#define IGL_REDRUM_H
10
11// Q: These should probably be inside the igl namespace. What's the correct
12// way to do that?
13// A: I guess the right way is to not use a macro but a proper function with
14// streams as input and output.
15
16// ANSI color codes for formatting iostream style output
17
18#ifdef IGL_REDRUM_NOOP
19
20// Bold Red, etc.
21#define NORUM(X) X
22#define REDRUM(X) X
23#define GREENRUM(X) X
24#define YELLOWRUM(X) X
25#define BLUERUM(X) X
26#define MAGENTARUM(X) X
27#define CYANRUM(X) X
28// Regular Red, etc.
29#define REDGIN(X) X
30#define GREENGIN(X) X
31#define YELLOWGIN(X) X
32#define BLUEGIN(X) X
33#define MAGENTAGIN(X) X
34#define CYANGIN(X) X
35
36#else
37
46#define REDRUM(X) "\e[1m\e[31m"<<X<<"\e[m"
47// Bold Red, etc.
48#define NORUM(X) ""<<X<<""
49#define GREENRUM(X) "\e[1m\e[32m"<<X<<"\e[m"
50#define YELLOWRUM(X) "\e[1m\e[33m"<<X<<"\e[m"
51#define BLUERUM(X) "\e[1m\e[34m"<<X<<"\e[m"
52#define MAGENTARUM(X) "\e[1m\e[35m"<<X<<"\e[m"
53#define CYANRUM(X) "\e[1m\e[36m"<<X<<"\e[m"
54// Regular Red, etc.
55#define REDGIN(X) "\e[31m"<<X<<"\e[m"
56#define GREENGIN(X) "\e[32m"<<X<<"\e[m"
57#define YELLOWGIN(X) "\e[33m"<<X<<"\e[m"
58#define BLUEGIN(X) "\e[34m"<<X<<"\e[m"
59#define MAGENTAGIN(X) "\e[35m"<<X<<"\e[m"
60#define CYANGIN(X) "\e[36m"<<X<<"\e[m"
61#endif
62
63#endif