Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
RegularPicture.h
Go to the documentation of this file.
1#pragma once
2
4#include "Frame/PictureData.h"
6#include "Math/TVector2.h"
7
8#include <Common/primitive_type.h>
9
10#include <cstddef>
11
12namespace ph
13{
14
19{
20public:
22
24 bool isReversedComponents() const;
25 bool hasAlpha() const;
26 bool isGrayscale() const;
27
28 void setColorSpace(math::EColorSpace colorSpace);
30 void setHasAlpha(bool hasAlpha);
31 void setIsGrayscale(bool isGrayscale);
32
33private:
35 math::EColorSpace m_colorSpace;
36
38 bool m_isReversedComponents;
39
41 bool m_hasAlpha;
42
44 bool m_isGrayscale;
45};
46
49class RegularPicture final
50{
51public:
55
60 math::Vector2S sizePx,
61 std::size_t numComponents,
62 EPicturePixelComponent componentType);
63
65
66 const RegularPictureFormat& getFormat() const;
67 void setFormat(const RegularPictureFormat& format);
68 std::size_t numComponents() const;
70 bool isLDR() const;
71 bool isHDR() const;
73 std::size_t getWidthPx() const;
74 std::size_t getHeightPx() const;
75
77 const PictureData& getPixels() const;
78
80
81private:
82 static bool isLDR(EPicturePixelComponent componentType);
83 static bool isHDR(EPicturePixelComponent componentType);
84
86 RegularPictureFormat m_format;
87
89 PictureData m_pictureData;
90};
91
93{
94 return m_colorSpace;
95}
96
98{
99 return m_isReversedComponents;
100}
101
103{
104 return m_hasAlpha;
105}
106
108{
109 return m_isGrayscale;
110}
111
113{
114 return m_format;
115}
116
118{
119 return m_pictureData.getSizePx();
120}
121
122inline std::size_t RegularPicture::getWidthPx() const
123{
124 return m_pictureData.getWidthPx();
125}
126
127inline std::size_t RegularPicture::getHeightPx() const
128{
129 return m_pictureData.getHeightPx();
130}
131
132inline std::size_t RegularPicture::numComponents() const
133{
134 return m_pictureData.numComponents();
135}
136
138{
139 return m_pictureData.getComponentType();
140}
141
143{
144 return m_pictureData;
145}
146
148{
149 return m_pictureData;
150}
151
152}// end namespace ph
Definition PictureData.h:21
const math::Vector2S & getSizePx() const
Definition PictureData.ipp:59
std::size_t getHeightPx() const
Definition PictureData.ipp:69
EPicturePixelComponent getComponentType() const
Definition PictureData.ipp:79
std::size_t getWidthPx() const
Definition PictureData.ipp:64
std::size_t numComponents() const
Definition PictureData.ipp:74
Format of common pictures. Typically closely related to how the picture is stored natively (e....
Definition RegularPicture.h:19
void setIsReversedComponents(bool isReversedComponents)
Definition RegularPicture.cpp:22
bool hasAlpha() const
Definition RegularPicture.h:102
void setHasAlpha(bool hasAlpha)
Definition RegularPicture.cpp:27
void setIsGrayscale(bool isGrayscale)
Definition RegularPicture.cpp:32
RegularPictureFormat()
Definition RegularPicture.cpp:10
bool isReversedComponents() const
Definition RegularPicture.h:97
void setColorSpace(math::EColorSpace colorSpace)
Definition RegularPicture.cpp:17
bool isGrayscale() const
Definition RegularPicture.h:107
math::EColorSpace getColorSpace() const
Definition RegularPicture.h:92
Raw representation of common picture types.
Definition RegularPicture.h:50
RegularPicture & operator=(RegularPicture &&rhs)
bool isLDR() const
Definition RegularPicture.cpp:59
std::size_t numComponents() const
Definition RegularPicture.h:132
RegularPicture()
Creates an empty picture.
Definition RegularPicture.cpp:37
const RegularPictureFormat & getFormat() const
Definition RegularPicture.h:112
std::size_t getHeightPx() const
Definition RegularPicture.h:127
std::size_t getWidthPx() const
Definition RegularPicture.h:122
void setFormat(const RegularPictureFormat &format)
Definition RegularPicture.cpp:54
RegularPicture(RegularPicture &&other)
bool isHDR() const
Definition RegularPicture.cpp:64
math::Vector2S getSizePx() const
Definition RegularPicture.h:117
EPicturePixelComponent getComponentType() const
Definition RegularPicture.h:137
PictureData & getPixels()
Definition RegularPicture.h:142
EColorSpace
Definition color_enums.h:7
The root for all renderer implementations.
Definition EEngineProject.h:6
EPicturePixelComponent
Definition picture_basics.h:11