cesium-native 0.43.0
Loading...
Searching...
No Matches
ImageSpec.h
1// This file was generated by generate-classes.
2// DO NOT EDIT THIS FILE!
3#pragma once
4
5#include <CesiumGltf/Library.h>
6#include <CesiumGltf/NamedObject.h>
7
8#include <cstdint>
9#include <optional>
10#include <string>
11
12namespace CesiumGltf {
17struct CESIUMGLTF_API ImageSpec : public CesiumGltf::NamedObject {
21 static constexpr const char* TypeName = "Image";
22
27 struct MimeType {
29 inline static const std::string image_jpeg = "image/jpeg";
30
32 inline static const std::string image_png = "image/png";
33 };
34
42 std::optional<std::string> uri;
43
51 std::optional<std::string> mimeType;
52
57 int32_t bufferView = -1;
58
65 int64_t getSizeBytes() const {
66 int64_t accum = 0;
67 accum += int64_t(sizeof(ImageSpec));
69 int64_t(sizeof(CesiumGltf::NamedObject));
70 if (this->uri) {
71 accum += int64_t(this->uri->capacity() * sizeof(char));
72 }
73 return accum;
74 }
75
76protected:
80 ImageSpec() = default;
81 friend struct Image;
82};
83} // namespace CesiumGltf
Classes for working with glTF models.
Known values for The image's media type. This field MUST be defined when bufferView is defined.
Definition ImageSpec.h:27
Image data used to create a texture. Image MAY be referenced by an URI (or IRI) or a buffer view inde...
Definition ImageSpec.h:17
ImageSpec()=default
This class is not meant to be instantiated directly. Use Image instead.
std::optional< std::string > mimeType
The image's media type. This field MUST be defined when bufferView is defined.
Definition ImageSpec.h:51
std::optional< std::string > uri
The URI (or IRI) of the image.
Definition ImageSpec.h:42
int64_t getSizeBytes() const
Calculates the size in bytes of this object, including the contents of all collections,...
Definition ImageSpec.h:65
This class is not meant to be instantiated directly. Use Image instead.
Definition Image.h:10
The base class for objects in a glTF that have a name.
Definition NamedObject.h:15
int64_t getSizeBytes() const
Calculates the size in bytes of this object, including the contents of all collections,...
Definition NamedObject.h:29