| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- #pragma once
- #include "BsCorePrerequisites.h"
- namespace BansheeEngine
- {
- /**
- * @brief Represents a 3D region of pixels used for referencing pixel data.
- */
- struct BS_CORE_EXPORT PixelVolume
- {
- UINT32 left, top, right, bottom, front, back;
- PixelVolume()
- : left(0), top(0), right(1), bottom(1), front(0), back(1)
- { }
- PixelVolume(UINT32 left, UINT32 top, UINT32 right, UINT32 bottom):
- left(left), top(top), right(right), bottom(bottom), front(0), back(1)
- {
- assert(right >= left && bottom >= top && back >= front);
- }
- PixelVolume(UINT32 left, UINT32 top, UINT32 front, UINT32 right, UINT32 bottom, UINT32 back):
- left(left), top(top), right(right), bottom(bottom), front(front), back(back)
- {
- assert(right >= left && bottom >= top && back >= front);
- }
-
- /**
- * @brief Return true if the other box is a part of this one.
- */
- bool contains(const PixelVolume &volume) const
- {
- return (volume.left >= left && volume.top >= top && volume.front >= front &&
- volume.right <= right && volume.bottom <= bottom && volume.back <= back);
- }
-
- UINT32 getWidth() const { return right-left; }
- UINT32 getHeight() const { return bottom-top; }
- UINT32 getDepth() const { return back-front; }
- };
- }
|