3#include <Foundation/Basics/Assert.h>
4#include <Foundation/Math/Color8UNorm.h>
5#include <Foundation/Math/Math.h>
7#include <Texture/Image/ImageFormat.h>
8#include <Texture/TextureDLL.h>
25 m_uiNumArrayIndices = 1;
29 m_Format = plImageFormat::UNKNOWN;
39 void SetWidth(plUInt32 uiWidth) { m_uiWidth = uiWidth; }
42 plUInt32
GetWidth(plUInt32 uiMipLevel = 0)
const
44 PL_ASSERT_DEV(uiMipLevel < m_uiNumMipLevels,
"Invalid mip level");
49 void SetHeight(plUInt32 uiHeight) { m_uiHeight = uiHeight; }
54 PL_ASSERT_DEV(uiMipLevel < m_uiNumMipLevels,
"Invalid mip level");
59 void SetDepth(plUInt32 uiDepth) { m_uiDepth = uiDepth; }
62 plUInt32
GetDepth(plUInt32 uiMipLevel = 0)
const
64 PL_ASSERT_DEV(uiMipLevel < m_uiNumMipLevels,
"Invalid mip level");
71 void SetNumMipLevels(plUInt32 uiNumMipLevels) { m_uiNumMipLevels = uiNumMipLevels; }
79 void SetNumFaces(plUInt32 uiNumFaces) { m_uiNumFaces = uiNumFaces; }
99 plUInt32
GetNumBlocksX(plUInt32 uiMipLevel = 0, plUInt32 uiPlaneIndex = 0)
const
105 plUInt32
GetNumBlocksY(plUInt32 uiMipLevel = 0, plUInt32 uiPlaneIndex = 0)
const
111 plUInt32
GetNumBlocksZ(plUInt32 uiMipLevel = 0, plUInt32 uiPlaneIndex = 0)
const
117 plUInt64
GetRowPitch(plUInt32 uiMipLevel = 0, plUInt32 uiPlaneIndex = 0)
const
123 plUInt64
GetDepthPitch(plUInt32 uiMipLevel = 0, plUInt32 uiPlaneIndex = 0)
const
131 plUInt64 uiDataSize = 0;
133 for (plUInt32 uiMipLevel = 0; uiMipLevel < GetNumMipLevels(); uiMipLevel++)
135 for (plUInt32 uiPlaneIndex = 0; uiPlaneIndex < GetPlaneCount(); ++uiPlaneIndex)
137 uiDataSize += GetDepthPitch(uiMipLevel, uiPlaneIndex) *
static_cast<plUInt64
>(GetDepth(uiMipLevel));
147 plUInt32 numMipMaps = 1;
148 plUInt32 width = GetWidth();
149 plUInt32 height = GetHeight();
150 plUInt32 depth = GetDepth();
152 while (width > 1 || height > 1 || depth > 1)
167 m_uiNumMipLevels == other.m_uiNumMipLevels &&
168 m_uiNumFaces == other.m_uiNumFaces &&
169 m_uiNumArrayIndices == other.m_uiNumArrayIndices &&
170 m_uiWidth == other.m_uiWidth &&
171 m_uiHeight == other.m_uiHeight &&
172 m_uiDepth == other.m_uiDepth &&
173 m_Format == other.m_Format;
178 return !operator==(other);
182 plUInt32 m_uiNumMipLevels;
183 plUInt32 m_uiNumFaces;
184 plUInt32 m_uiNumArrayIndices;
PL_FOUNDATION_DLL plUInt64 SafeMultiply64(plUInt64 a, plUInt64 b, plUInt64 c=1, plUInt64 d=1)
returns a * b. If an overflow happens, the program is terminated.
Definition Math.cpp:200
constexpr PL_ALWAYS_INLINE T Max(T f1, T f2)
Returns the greater value, f1 or f2.
Definition Math_inl.h:39
PL_FOUNDATION_DLL plUInt32 SafeMultiply32(plUInt32 a, plUInt32 b, plUInt32 c=1, plUInt32 d=1)
returns a * b. If an overflow happens, the program is terminated.
Definition Math.cpp:132