use premultiplied RGB in raw image demo

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33616 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2005-04-15 00:14:32 +00:00
parent d391f6679d
commit b068dfe292

View File

@@ -319,10 +319,12 @@ public:
for ( int x = 0; x < REAL_SIZE; ++x ) for ( int x = 0; x < REAL_SIZE; ++x )
{ {
p.Red() = r; // note that RGB must be premultiplied by alpha
p.Green() = g; unsigned a = (Data::Iterator::ChannelType)((x*255.)/REAL_SIZE);
p.Blue() = b; p.Red() = r * alpha / 256;
p.Alpha() = (Data::Iterator::ChannelType)((x*255.)/REAL_SIZE); p.Green() = g * alpha / 256;
p.Blue() = b * alpha / 256;
p.Alpha() = a;
++p; // same as p.OffsetX(1) ++p; // same as p.OffsetX(1)
} }