scenepic 1.1.0
3D Visualization Made Easy
image.h
Go to the documentation of this file.
1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT License.
3
4#ifndef _SCENEPIC_IMAGE_H_
5#define _SCENEPIC_IMAGE_H_
6
7#include "json_value.h"
8
9#include <cstdint>
10#include <string>
11#include <vector>
12
13namespace scenepic
14{
16 class Image
17 {
18 public:
22 void load(const std::string& path);
23
25 std::string to_string() const;
26
31
33 const std::string& image_id() const;
34
36 const std::vector<std::uint8_t>& data() const;
37
39 std::vector<std::uint8_t>& data();
40
42 Image& data(const std::vector<std::uint8_t>& value);
43
45 const std::string& ext() const;
46
48 Image& ext(const std::string& value);
49
50 private:
51 friend class Scene;
52
56 Image(const std::string& image_id);
57
58 std::vector<std::uint8_t> m_data;
59 std::string m_image_id;
60 std::string m_ext;
61 };
62} // namespace scenepic
63
64#endif
A ScenePic Image type.
Definition: image.h:17
const std::vector< std::uint8_t > & data() const
The encoded binary image data.
const std::string & ext() const
The extension of the image (e.g.
JsonValue to_json() const
Convert this object into ScenePic json.
Image & data(const std::vector< std::uint8_t > &value)
The encoded binary image data.
const std::string & image_id() const
A unique identifier for the image.
void load(const std::string &path)
Load an image file from the disk.
std::string to_string() const
Return a JSON string representing the object.
std::vector< std::uint8_t > & data()
The encoded binary image data.
Image & ext(const std::string &value)
The extension of the image (e.g.
Representation of a JSON value according to the specification at https://www.json....
Definition: json_value.h:30
Top level container representing an entire ScenePic.
Definition: scene.h:58
Definition: audio_track.h:14