libigl v2.5.0
Loading...
Searching...
No Matches
colormap.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) 2017 Joe Graus <jgraus@gmu.edu>, 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
9#ifndef IGL_COLORMAP_H
10#define IGL_COLORMAP_H
11#include "igl_inline.h"
12
13#include <Eigen/Dense>
14
15namespace igl {
16
17 // Common colormap types.
35 template <typename T>
36 IGL_INLINE void colormap(const ColorMapType cm, const T f, T * rgb);
45 template <typename T>
46 IGL_INLINE void colormap(const ColorMapType cm, const T f, T & r, T & g, T & b);
55 template <typename T>
57 const double palette[256][3], const T x_in, T & r, T & g, T & b);
65 template <typename DerivedZ, typename DerivedC>
67 const ColorMapType cm,
68 const Eigen::MatrixBase<DerivedZ> & Z,
69 const bool normalize,
70 Eigen::PlainObjectBase<DerivedC> & C);
79 template <typename DerivedZ, typename DerivedC>
81 const ColorMapType cm,
82 const Eigen::MatrixBase<DerivedZ> & Z,
83 const double min_Z,
84 const double max_Z,
85 Eigen::PlainObjectBase<DerivedC> & C);
86};
87
88#ifndef IGL_STATIC_LIBRARY
89# include "colormap.cpp"
90#endif
91
92#endif
#define IGL_INLINE
Definition igl_inline.h:15
Definition AABB.h:17
ColorMapType
Definition colormap.h:19
@ COLOR_MAP_TYPE_PLASMA
Definition colormap.h:24
@ COLOR_MAP_TYPE_TURBO
Definition colormap.h:26
@ COLOR_MAP_TYPE_MAGMA
Definition colormap.h:22
@ COLOR_MAP_TYPE_PARULA
Definition colormap.h:23
@ COLOR_MAP_TYPE_INFERNO
Definition colormap.h:20
@ NUM_COLOR_MAP_TYPES
Definition colormap.h:27
@ COLOR_MAP_TYPE_JET
Definition colormap.h:21
@ COLOR_MAP_TYPE_VIRIDIS
Definition colormap.h:25
void colormap(const ColorMapType cm, const T f, T *rgb)
Compute [r,g,b] values of the selected colormap for a given factor f between 0 and 1.