mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 16:44:36 +00:00
Merge pull request #1634 from Azaezel/alpha41/getColorAugs
add optional mip and face lookups for gbitmap::getcolor
This commit is contained in:
commit
62e8de233c
2 changed files with 5 additions and 4 deletions
|
|
@ -721,12 +721,13 @@ LinearColorF GBitmap::sampleTexel(F32 u, F32 v, bool retAlpha) const
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
bool GBitmap::getColor(const U32 x, const U32 y, ColorI& rColor) const
|
bool GBitmap::getColor(const U32 x, const U32 y, ColorI& rColor, const U32 mipLevel, const U32 face) const
|
||||||
{
|
{
|
||||||
if (x >= mWidth || y >= mHeight)
|
if (x >= mWidth || y >= mHeight)
|
||||||
return false;
|
return false;
|
||||||
|
U32 targMip = getNumMipLevels() < mipLevel ? getNumMipLevels()-1 : mipLevel;
|
||||||
const U8* p = getAddress(x, y);
|
U32 targFace = getNumFaces() < face ? getNumFaces()-1 : face;
|
||||||
|
const U8* p = getAddress(x, y, targMip, targFace);
|
||||||
|
|
||||||
switch (mInternalFormat)
|
switch (mInternalFormat)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -223,7 +223,7 @@ public:
|
||||||
bool checkForTransparency();
|
bool checkForTransparency();
|
||||||
|
|
||||||
LinearColorF sampleTexel(F32 u, F32 v, bool retAlpha = false) const;
|
LinearColorF sampleTexel(F32 u, F32 v, bool retAlpha = false) const;
|
||||||
bool getColor(const U32 x, const U32 y, ColorI& rColor) const;
|
bool getColor(const U32 x, const U32 y, ColorI& rColor, const U32 mipLevel = 0, const U32 face = 0) const;
|
||||||
bool setColor(const U32 x, const U32 y, const ColorI& rColor);
|
bool setColor(const U32 x, const U32 y, const ColorI& rColor);
|
||||||
U8 getChanelValueAt(U32 x, U32 y, U32 chan);
|
U8 getChanelValueAt(U32 x, U32 y, U32 chan);
|
||||||
U32 getNumFaces() const { return mNumFaces; }
|
U32 getNumFaces() const { return mNumFaces; }
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue