cesium-native 0.50.0
Loading...
Searching...
No Matches
VectorRasterizer.h
1#pragma once
2
3#include "VectorStyle.h"
4
5#include <CesiumGeometry/Rectangle.h>
6#include <CesiumGeospatial/CartographicPolygon.h>
7#include <CesiumGeospatial/Ellipsoid.h>
8#include <CesiumGeospatial/GlobeRectangle.h>
9#include <CesiumGltf/ImageAsset.h>
10#include <CesiumUtility/Color.h>
11#include <CesiumUtility/IntrusivePointer.h>
12#include <CesiumUtility/ReferenceCounted.h>
13#include <CesiumVectorData/GeoJsonObject.h>
14
15#include <blend2d.h>
16#include <blend2d/context.h>
17#include <blend2d/image.h>
18
19#include <span>
20
21namespace CesiumVectorData {
22
27public:
44 uint32_t mipLevel = 0,
45 const CesiumGeospatial::Ellipsoid& ellipsoid =
47
56 const PolygonStyle& style);
57
68 const std::vector<std::vector<glm::dvec3>>& polygon,
69 const PolygonStyle& style);
70
79 const std::span<const glm::dvec3>& points,
80 const LineStyle& style);
81
100 const GeoJsonObject& geoJsonObject,
101 const VectorStyle& style);
102
108 void clear(const CesiumUtility::Color& clearColor);
109
118
119private:
121 BLImage _image;
122 BLContext _context;
124 uint32_t _mipLevel;
126 bool _finalized = false;
127};
128} // namespace CesiumVectorData
A 2D polygon expressed as a list of longitude/latitude coordinates in radians.
A quadratic surface defined in Cartesian coordinates.
Definition Ellipsoid.h:39
static const Ellipsoid WGS84
An Ellipsoid instance initialized to the WGS84 standard.
Definition Ellipsoid.h:48
A two-dimensional, rectangular region on a globe, specified using longitude and latitude coordinates....
A smart pointer that calls addReference and releaseReference on the controlled object.
void drawPolygon(const CesiumGeospatial::CartographicPolygon &polygon, const PolygonStyle &style)
Draws a CesiumGeospatial::CartographicPolygon to the canvas.
CesiumUtility::IntrusivePointer< CesiumGltf::ImageAsset > finalize()
Finalizes the rasterization operations, flushing all draw calls to the canvas, ensuring proper pixel ...
void drawPolyline(const std::span< const glm::dvec3 > &points, const LineStyle &style)
Draws a polyline (a set of multiple line segments) to the canvas.
void clear(const CesiumUtility::Color &clearColor)
Fills the entire canvas with the given color.
VectorRasterizer(const CesiumGeospatial::GlobeRectangle &bounds, CesiumUtility::IntrusivePointer< CesiumGltf::ImageAsset > &imageAsset, uint32_t mipLevel=0, const CesiumGeospatial::Ellipsoid &ellipsoid=CesiumGeospatial::Ellipsoid::WGS84)
Creates a new VectorRasterizer representing the given rectangle on the globe.
void drawPolygon(const std::vector< std::vector< glm::dvec3 > > &polygon, const PolygonStyle &style)
Draws a set of linear rings representing a polygon and its holes to the canvas.
void drawGeoJsonObject(const GeoJsonObject &geoJsonObject, const VectorStyle &style)
Rasterizes a GeoJsonObject to the canvas.
Classes for loading vector data such as GeoJSON.
Represents an RGBA color value.
Definition Color.h:9
An object in a GeoJSON document.
The style used to draw polylines and strokes.
Definition VectorStyle.h:66
The style used to draw a Polygon.
Definition VectorStyle.h:80
Style information to use when drawing vector data.
Definition VectorStyle.h:96