Avara3D 0.2.0
C++ API reference
CubeImage.h
1//
2// CubeImage.h
3// avara3d
4//
5// Created by Morgan Davis on 4/30/18.
6// Copyright © 2026 Morgan K Davis. All rights reserved.
7//
8
9#ifndef AVARA3D_CUBEIMAGE_H
10#define AVARA3D_CUBEIMAGE_H
11
12#include <array>
13#include <cstdint>
14#include <memory>
15
16namespace a3d {
17
18 class Image;
19
25 class CubeImage {
26
27 public:
28 // [Public Types]
29
31 enum class Face : uint8_t {
32 X_Pos,
33 X_Neg,
34 Y_Pos,
35 Y_Neg,
36 Z_Pos,
37 Z_Neg
38 };
39
40 // [Public Lifecycle Functions]
41
51 explicit CubeImage(std::array<std::unique_ptr<Image>, 6> faces);
52
53 CubeImage(const CubeImage&) = delete;
54 CubeImage& operator=(const CubeImage&) = delete;
55
56 CubeImage(CubeImage&&) noexcept;
57 CubeImage& operator=(CubeImage&&) noexcept;
58
59 ~CubeImage();
60
61 // [Public Member Functions]
62
64 unsigned width() const;
65
67 unsigned height() const;
68
70 unsigned bytesPerPixel() const;
71
74
75 private:
76 // [Private Member Variables]
77
78 std::array<std::unique_ptr<Image>, 6> _faces;
79
80 unsigned _width;
81 unsigned _height;
82 unsigned _bytesPerPixel;
83 };
84
85}
86
87#endif // AVARA3D_CUBEIMAGE_H
Owns the six images used as cubemap faces.
Definition: CubeImage.h:25
CubeImage(std::array< std::unique_ptr< Image >, 6 > faces)
Takes ownership of the six cubemap face images.
unsigned width() const
Returns the common face width in pixels.
unsigned height() const
Returns the common face height in pixels.
Image * face(Face face) const
Returns the Image owned for face.
unsigned bytesPerPixel() const
Returns the common number of bytes per pixel.
Face
Identifies a cubemap face by its outward axis direction.
Definition: CubeImage.h:31
Owns decoded pixel data and its dimensions.
Definition: Image.h:27