Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoit Bolsee <benoit.bolsee@online.be>2008-11-04 15:04:59 +0300
committerBenoit Bolsee <benoit.bolsee@online.be>2008-11-04 15:04:59 +0300
commit1886b7bf52f73f03d60967504b474cdde7a4e1e7 (patch)
tree688163d0a7fc0330c6438ff9be890f8b2e7ed8d1 /source/gameengine/VideoTexture/FilterBlueScreen.h
parent6eb3bf53dd753d4b00f0f76f9f7739aecb9af2f8 (diff)
VideoTexture: fix RGB/BGR confusion, make code compatible with big endian CPU, add RGBA source filter.
Diffstat (limited to 'source/gameengine/VideoTexture/FilterBlueScreen.h')
-rw-r--r--source/gameengine/VideoTexture/FilterBlueScreen.h15
1 files changed, 7 insertions, 8 deletions
diff --git a/source/gameengine/VideoTexture/FilterBlueScreen.h b/source/gameengine/VideoTexture/FilterBlueScreen.h
index 20660804f78..820e4a44501 100644
--- a/source/gameengine/VideoTexture/FilterBlueScreen.h
+++ b/source/gameengine/VideoTexture/FilterBlueScreen.h
@@ -63,25 +63,24 @@ protected:
short * size, unsigned int pixSize, unsigned int val)
{
// calculate differences
- int difRed = int((val >> 16) & 0xFF) - int(m_color[0]);
- int difGreen = int((val >> 8) & 0xFF) - int(m_color[1]);
- int difBlue = int(val & 0xFF) - int(m_color[2]);
+ int difRed = int(VT_R(val)) - int(m_color[0]);
+ int difGreen = int(VT_G(val)) - int(m_color[1]);
+ int difBlue = int(VT_B(val)) - int(m_color[2]);
// calc distance from "blue screen" color
unsigned int dist = (unsigned int)(difRed * difRed + difGreen * difGreen
+ difBlue * difBlue);
// condition for fully transparent color
if (m_squareLimits[0] >= dist)
// return color with zero alpha
- //return 0xFF000000;
- return val & 0x00FFFFFF;
+ VT_A(val) = 0;
// condition for fully opaque color
else if (m_squareLimits[1] <= dist)
// return normal colour
- return val | 0xFF000000;
+ VT_A(val) = 0xFF;
// otherwise calc alpha
else
- return (val & 0x00FFFFFF) | ((((dist - m_squareLimits[0]) << 8)
- / m_limitDist) << 24);
+ VT_A(val) = (((dist - m_squareLimits[0]) << 8) / m_limitDist);
+ return val;
}
/// virtual filtering function for byte source