cesium-native  0.41.0
ImageDecoder.h
1 #pragma once
2 
3 #include "CesiumGltf/ImageAsset.h"
4 #include "CesiumGltfReader/Library.h"
5 
6 #include <CesiumUtility/IntrusivePointer.h>
7 
8 #include <gsl/span>
9 
10 #include <optional>
11 #include <string>
12 #include <vector>
13 
14 namespace CesiumGltfReader {
15 
19 struct CESIUMGLTFREADER_API ImageReaderResult {
20 
27 
31  std::vector<std::string> errors;
32 
36  std::vector<std::string> warnings;
37 };
38 
42 class ImageDecoder {
43 public:
57  const gsl::span<const std::byte>& data,
58  const CesiumGltf::Ktx2TranscodeTargets& ktx2TranscodeTargets);
59 
69  static std::optional<std::string>
71 };
72 
73 } // namespace CesiumGltfReader
Contains methods for reading and manipulating images.
Definition: ImageDecoder.h:42
static ImageReaderResult readImage(const gsl::span< const std::byte > &data, const CesiumGltf::Ktx2TranscodeTargets &ktx2TranscodeTargets)
Reads an image from a buffer.
static std::optional< std::string > generateMipMaps(CesiumGltf::ImageAsset &image)
Generate mipmaps for this image.
Classes for reading glTF models.
Definition: GltfReader.h:25
The result of reading an image with ImageDecoder::readImage.
Definition: ImageDecoder.h:19
std::vector< std::string > errors
Error messages that occurred while trying to read the image.
Definition: ImageDecoder.h:31
CesiumUtility::IntrusivePointer< CesiumGltf::ImageAsset > pImage
The ImageAsset that was read.
Definition: ImageDecoder.h:26
std::vector< std::string > warnings
Warning messages that occurred while reading the image.
Definition: ImageDecoder.h:36
A 2D image asset, including its pixel data. The image may have mipmaps, and it may be encoded in a GP...
Definition: ImageAsset.h:34
For each possible input transmission format, this struct names the ideal target gpu-compressed pixel ...