3#include "IPrepareRasterOverlayRendererResources.h"
5#include "RasterOverlayTileProvider.h"
7#include <CesiumAsync/AsyncSystem.h>
8#include <CesiumAsync/IAssetAccessor.h>
9#include <CesiumAsync/SharedAssetDepot.h>
10#include <CesiumGeometry/QuadtreeTileID.h>
11#include <CesiumGeometry/QuadtreeTilingScheme.h>
12#include <CesiumUtility/CreditSystem.h>
13#include <CesiumUtility/Result.h>
14#include <CesiumUtility/SharedAsset.h>
59 const std::shared_ptr<CesiumAsync::IAssetAccessor>& pAssetAccessor,
60 std::optional<CesiumUtility::Credit> credit,
61 const std::shared_ptr<IPrepareRasterOverlayRendererResources>&
62 pPrepareRendererResources,
63 const std::shared_ptr<spdlog::logger>& pLogger,
67 uint32_t minimumLevel,
68 uint32_t maximumLevel,
70 uint32_t imageHeight)
noexcept;
85 uint32_t
getWidth() const noexcept {
return this->_imageWidth; }
90 uint32_t
getHeight() const noexcept {
return this->_imageHeight; }
97 return this->_tilingScheme;
111 const glm::dvec2& screenPixels);
128 struct LoadedQuadtreeImage
131 const std::shared_ptr<LoadedRasterOverlayImage>& pLoaded_,
132 const std::optional<CesiumGeometry::Rectangle>& subset_)
133 : pLoaded(pLoaded_), subset(subset_) {}
134 std::shared_ptr<LoadedRasterOverlayImage> pLoaded =
nullptr;
135 std::optional<CesiumGeometry::Rectangle> subset = std::nullopt;
137 int64_t getSizeBytes()
const {
139 accum += int64_t(
sizeof(LoadedQuadtreeImage));
141 accum += pLoaded->getSizeBytes();
162 mapRasterTilesToGeometryTile(
164 const glm::dvec2 targetScreenPixels);
166 struct CombinedImageMeasurements {
169 int32_t heightPixels;
171 int32_t bytesPerChannel;
174 static CombinedImageMeasurements measureCombinedImage(
179 static LoadedRasterOverlayImage combineImages(
184 uint32_t _minimumLevel;
185 uint32_t _maximumLevel;
186 uint32_t _imageWidth;
187 uint32_t _imageHeight;
A system for managing asynchronous requests and tasks.
A value that will be available in the future, as produced by AsyncSystem.
A depot for CesiumUtility::SharedAsset instances, which are potentially shared between multiple objec...
A value that will be available in the future, as produced by AsyncSystem. Unlike Future,...
Defines how a rectangular region is divided into quadtree tiles.
A base class used for raster overlay providers that use a quadtree-based tiling scheme....
uint32_t getHeight() const noexcept
Returns the image height of this instance, in pixels.
uint32_t computeLevelFromTargetScreenPixels(const CesiumGeometry::Rectangle &rectangle, const glm::dvec2 &screenPixels)
Computes the best quadtree level to use for an image intended to cover a given projected rectangle wh...
uint32_t getMinimumLevel() const noexcept
Returns the minimum tile level of this instance.
QuadtreeRasterOverlayTileProvider(const CesiumUtility::IntrusivePointer< const RasterOverlay > &pOwner, const CesiumAsync::AsyncSystem &asyncSystem, const std::shared_ptr< CesiumAsync::IAssetAccessor > &pAssetAccessor, std::optional< CesiumUtility::Credit > credit, const std::shared_ptr< IPrepareRasterOverlayRendererResources > &pPrepareRendererResources, const std::shared_ptr< spdlog::logger > &pLogger, const CesiumGeospatial::Projection &projection, const CesiumGeometry::QuadtreeTilingScheme &tilingScheme, const CesiumGeometry::Rectangle &coverageRectangle, uint32_t minimumLevel, uint32_t maximumLevel, uint32_t imageWidth, uint32_t imageHeight) noexcept
Creates a new instance.
uint32_t getWidth() const noexcept
Returns the image width of this instance, in pixels.
virtual CesiumAsync::Future< LoadedRasterOverlayImage > loadQuadtreeTileImage(const CesiumGeometry::QuadtreeTileID &tileID) const =0
Asynchronously loads a tile in the quadtree.
uint32_t getMaximumLevel() const noexcept
Returns the maximum tile level of this instance.
const CesiumGeometry::QuadtreeTilingScheme & getTilingScheme() const noexcept
Returns the CesiumGeometry::QuadtreeTilingScheme of this instance.
Provides individual tiles for a RasterOverlay on demand.
Raster image data for a tile in a quadtree.
A smart pointer that calls addReference and releaseReference on the controlled object.
An asset that is potentially shared between multiple objects, such as an image shared between multipl...
std::variant< GeographicProjection, WebMercatorProjection > Projection
A projection.
Classes for raster overlays, which allow draping massive 2D textures over a model.
Uniquely identifies a node in a quadtree.
Holds the result of an operation. If the operation succeeds, it will provide a value....