Rasterizes vector primitives into a CesiumGltf::ImageAsset.
More...
#include <CesiumVectorData/VectorRasterizer.h>
|
| | 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 CesiumGeospatial::CartographicPolygon &polygon, const PolygonStyle &style) |
| | Draws a CesiumGeospatial::CartographicPolygon to the canvas.
|
| |
| 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 | drawPolygon (const std::vector< std::vector< CesiumGeospatial::Cartographic > > &polygon, const PolygonStyle &style) |
| | Draws a set of linear rings representing a polygon and its holes to the canvas.
|
| |
| void | drawPolyline (const std::vector< glm::dvec3 > &points, const LineStyle &style) |
| | Draws a polyline (a set of multiple line segments) to the canvas.
|
| |
| void | drawPolyline (const std::vector< CesiumGeospatial::Cartographic > &points, const LineStyle &style) |
| | Draws a polyline (a set of multiple line segments) to the canvas.
|
| |
| void | drawPoints (const std::vector< glm::dvec3 > &points, const PointStyle &style) |
| | Draws a set of points to the canvas.
|
| |
| void | drawPoints (const std::vector< CesiumGeospatial::Cartographic > &points, const PointStyle &style) |
| | Draws a set of points to the canvas.
|
| |
| void | drawGeoJsonObject (const GeoJsonObject &geoJsonObject, const VectorStyle &style) |
| | Rasterizes a GeoJsonObject to the canvas.
|
| |
| void | clear (const CesiumUtility::Color &clearColor) |
| | Fills the entire canvas with the given color.
|
| |
| CesiumUtility::IntrusivePointer< CesiumGltf::ImageAsset > | finalize () |
| | Finalizes the rasterization operations, flushing all draw calls to the canvas, ensuring proper pixel ordering, and releasing the draw context.
|
| |
Rasterizes vector primitives into a CesiumGltf::ImageAsset.
Definition at line 28 of file VectorRasterizer.h.
◆ VectorRasterizer()
Creates a new VectorRasterizer representing the given rectangle on the globe.
- Parameters
-
| bounds | The bounds on the globe that this rasterizer's canvas will cover. |
| imageAsset | The destination image asset. This CesiumGltf::ImageAsset must be four channels, with only one byte per channel (RGBA32). |
| mipLevel | The mip level that the rasterizer should rasterize for the image. |
| ellipsoid | The ellipsoid to use. |
◆ clear()
Fills the entire canvas with the given color.
- Parameters
-
| clearColor | The color to use to clear the canvas. |
◆ drawGeoJsonObject()
| void CesiumVectorData::VectorRasterizer::drawGeoJsonObject |
( |
const GeoJsonObject & | geoJsonObject, |
|
|
const VectorStyle & | style ) |
Rasterizes a GeoJsonObject to the canvas.
This will recurse through any children of the GeoJsonObject as well. All GeoJSON objects will be considered (that is, no object's children will be ignored), but only LineString types (LineString and MultiLineString) and Polygon types (Polygon and MultiPolygon) will actually be rendered.
This method can potentially be very slow if a large tree is passed in. If better performance is needed, selecting a subset of leaf objects (those without any children) and calling drawGeoJsonObject on each one will have better results.
- Parameters
-
| geoJsonObject | The GeoJSON object to draw. |
| style | The VectorStyle to use when drawing the object. |
◆ drawPoints() [1/2]
Draws a set of points to the canvas.
- Parameters
-
| points | The set of points to draw. |
| style | The PointStyle to use when drawing the points. |
◆ drawPoints() [2/2]
| void CesiumVectorData::VectorRasterizer::drawPoints |
( |
const std::vector< glm::dvec3 > & | points, |
|
|
const PointStyle & | style ) |
Draws a set of points to the canvas.
- Parameters
-
| points | The set of points to draw. The coordinates should be specified in degrees. |
| style | The PointStyle to use when drawing the points. |
◆ drawPolygon() [1/3]
◆ drawPolygon() [2/3]
Draws a set of linear rings representing a polygon and its holes to the canvas.
- Parameters
-
| polygon | The polygon to draw. It is assumed to have right-hand winding order (exterior rings are counterclockwise, holes are clockwise) as is the case in GeoJSON. The coordinates should be specified in degrees. |
| style | The PolygonStyle to use when drawing the polygon. |
◆ drawPolygon() [3/3]
| void CesiumVectorData::VectorRasterizer::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.
- Parameters
-
| polygon | The polygon to draw. It is assumed to have right-hand winding order (exterior rings are counterclockwise, holes are clockwise) as is the case in GeoJSON. The coordinates should be specified in degrees. |
| style | The PolygonStyle to use when drawing the polygon. |
◆ drawPolyline() [1/2]
Draws a polyline (a set of multiple line segments) to the canvas.
- Parameters
-
| points | The set of points making up the polyline. |
| style | The LineStyle to use when drawing the polyline. |
◆ drawPolyline() [2/2]
| void CesiumVectorData::VectorRasterizer::drawPolyline |
( |
const std::vector< glm::dvec3 > & | points, |
|
|
const LineStyle & | style ) |
Draws a polyline (a set of multiple line segments) to the canvas.
- Parameters
-
| points | The set of points making up the polyline. The coordinates should be specified in degrees. |
| style | The LineStyle to use when drawing the polyline. |
◆ finalize()
Finalizes the rasterization operations, flushing all draw calls to the canvas, ensuring proper pixel ordering, and releasing the draw context.
Once a VectorRasterizer is finalized, it can no longer be used for drawing. Subsequent calls to its methods will do nothing.
The documentation for this class was generated from the following file:
- /home/runner/work/cesium-native/cesium-native/CesiumVectorData/include/CesiumVectorData/VectorRasterizer.h