HighMap library (C++)
Loading...
Searching...
No Matches
colorize.hpp
Go to the documentation of this file.
1/* Copyright (c) 2023 Otto Link. Distributed under the terms of the GNU General
2 Public License. The full license is in the file LICENSE, distributed with
3 this software. */
4
18#pragma once
19#include "highmap/array.hpp"
20#include "highmap/tensor.hpp"
21
22namespace hmap
23{
24
32enum Cmap : int; // highmap/colormap.hpp
33
50void apply_hillshade(Tensor &img,
51 const Array &array,
52 float vmin = 0.f,
53 float vmax = 1.f,
54 float exponent = 1.f);
55
74void apply_hillshade(std::vector<uint8_t> &img,
75 const Array &array,
76 float vmin = 0.f,
77 float vmax = 1.f,
78 float exponent = 1.f,
79 bool is_img_rgba = false);
80
97Tensor colorize(const Array &array,
98 float vmin,
99 float vmax,
100 int cmap,
101 bool hillshading,
102 bool reverse = false,
103 const Array *p_noise = nullptr);
104
113Tensor colorize_grayscale(const Array &array);
114
124Tensor colorize_histogram(const Array &array);
125
165Tensor colorize_slope_height_heatmap(const Array &array, int cmap);
166
184Tensor colorize_vec2(const Array &array1, const Array &array2);
185
186} // namespace hmap
Declaration of the Array class for 2D floating-point arrays with various mathematical operations and ...
Definition algebra.hpp:28
Tensor colorize(const Array &array, float vmin, float vmax, int cmap, bool hillshading, bool reverse=false, const Array *p_noise=nullptr)
Apply colorization to an array.
Definition colorize.cpp:88
void apply_hillshade(Tensor &img, const Array &array, float vmin=0.f, float vmax=1.f, float exponent=1.f)
Apply hillshading to a Tensor image.
Definition colorize.cpp:22
Tensor colorize_vec2(const Array &array1, const Array &array2)
Combine two arrays into a colored image.
Definition colorize.cpp:237
Tensor colorize_slope_height_heatmap(const Array &array, int cmap)
Colorizes a slope height heatmap based on the gradient norms of a given array.
Definition colorize.cpp:191
Tensor colorize_grayscale(const Array &array)
Convert an array to a grayscale image.
Definition colorize.cpp:147
Cmap
Enumeration for different colormap types.
Definition colormaps.hpp:81
Tensor colorize_histogram(const Array &array)
Convert an array to a histogram-based grayscale image.
Definition colorize.cpp:155
Header file for the Tensor class.