satdump/src-core/common/map/map_drawer.h
baskiton 077437e9c3 Add configuring map/cities overlay to result rgb-composites.
Result images will be saved to a separate file with "_map" suffix instead of the main image.

Configure options:

| Name           | Type    | Default     | Description           |
|----------------|---------|-------------|-----------------------|
| map_overlay    | Boolean | `false`     | Draw countries border |
| cities_overlay | Mapped  | `NONE`      | Draw cities           |

`cities_overlay`:

| Name           | Type    | Default     | Description                                                                |
|----------------|---------|-------------|----------------------------------------------------------------------------|
| color          | Array   | `[0, 1, 0]` | RGB float-array (0.0 - 1.0)                                                |
| font_size      | Number  | `50`        | Cities font size                                                           |
| type           | String  | `capitals`  | Cities type. See below                                                     |
| scale_rank     | Number  | `3`         | **Only for `all` type**. 0-10. The more, the smaller cities will be drawn. |

Cities `type` is one of:
* `capitals` - Draw only Capitals
* `rcapitals` - Draw Capitals and Administrative centers
* `all` - Draw all cities by Scale Rank

Example:
```json
...
"map_overlay": true,
"cities_overlay": {
    "color": [0.85, 1, 0],
    "font_size": 24,
    "type": "rcapitals",
    "scale_rank": 6
}
...
```
2023-09-05 02:40:13 +07:00

29 lines
No EOL
1.4 KiB
C++

#pragma once
#include "common/image/image.h"
#include <functional>
#include <vector>
#include <string>
#include <limits>
namespace map
{
template <typename T>
void drawProjectedMapGeoJson(std::vector<std::string> shapeFiles, image::Image<T> &image, T color[3], std::function<std::pair<int, int>(float, float, int, int)> projectionFunc, int maxLength = 2147483647);
template <typename T>
void drawProjectedCapitalsGeoJson(std::vector<std::string> shapeFiles, image::Image<T> &image, T color[3], std::function<std::pair<int, int>(float, float, int, int)> projectionFunc, int font_size = 50);
template <typename T>
void drawProjectedCitiesGeoJson(std::vector<std::string> shapeFiles, image::Image<T> &image, T color[3], std::function<std::pair<int, int>(float, float, int, int)> projectionFunc, int font_size = 50, int cities_type = 0, int cities_scale_rank = 10);
template <typename T>
void drawProjectedMapShapefile(std::vector<std::string> shapeFiles, image::Image<T> &image, T color[3], std::function<std::pair<int, int>(float, float, int, int)> projectionFunc, int maxLength = 2147483647);
struct CustomLabel
{
std::string label;
double lat;
double lon;
};
template <typename T>
void drawProjectedLabels(std::vector<CustomLabel> labels, image::Image<T> &image, T color[3], std::function<std::pair<int, int>(float, float, int, int)> projectionFunc, float ratio = 1);
}