1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-02-01 03:10:06 +00:00

Changes to Image::BitmapData constructors, replacing the bool with a more explicit enum for the read/write mode. Some win32 dLL declarator changes. Android work. Small Quicktime fix.

This commit is contained in:
Julian Storer 2011-02-09 10:50:19 +00:00
parent 1d215fa865
commit 3dfbb0d713
37 changed files with 1216 additions and 431 deletions

View file

@ -66,38 +66,40 @@ void DropShadowEffect::applyEffect (Image& image, Graphics& g, float alpha)
Image shadowImage (Image::SingleChannel, w, h, false);
const Image::BitmapData srcData (image, false);
const Image::BitmapData destData (shadowImage, true);
const int filter = roundToInt (63.0f / radius);
const int radiusMinus1 = roundToInt ((radius - 1.0f) * 63.0f);
for (int x = w; --x >= 0;)
{
int shadowAlpha = 0;
const Image::BitmapData srcData (image, Image::BitmapData::readOnly);
const Image::BitmapData destData (shadowImage, Image::BitmapData::readWrite);
const PixelARGB* src = ((const PixelARGB*) srcData.data) + x;
uint8* shadowPix = destData.data + x;
for (int y = h; --y >= 0;)
{
shadowAlpha = ((shadowAlpha * radiusMinus1 + (src->getAlpha() << 6)) * filter) >> 12;
*shadowPix = (uint8) shadowAlpha;
src = (const PixelARGB*) (((const uint8*) src) + srcData.lineStride);
shadowPix += destData.lineStride;
}
}
for (int y = h; --y >= 0;)
{
int shadowAlpha = 0;
uint8* shadowPix = destData.getLinePointer (y);
const int filter = roundToInt (63.0f / radius);
const int radiusMinus1 = roundToInt ((radius - 1.0f) * 63.0f);
for (int x = w; --x >= 0;)
{
shadowAlpha = ((shadowAlpha * radiusMinus1 + (*shadowPix << 6)) * filter) >> 12;
*shadowPix++ = (uint8) shadowAlpha;
int shadowAlpha = 0;
const PixelARGB* src = ((const PixelARGB*) srcData.data) + x;
uint8* shadowPix = destData.data + x;
for (int y = h; --y >= 0;)
{
shadowAlpha = ((shadowAlpha * radiusMinus1 + (src->getAlpha() << 6)) * filter) >> 12;
*shadowPix = (uint8) shadowAlpha;
src = addBytesToPointer (src, srcData.lineStride);
shadowPix += destData.lineStride;
}
}
for (int y = h; --y >= 0;)
{
int shadowAlpha = 0;
uint8* shadowPix = destData.getLinePointer (y);
for (int x = w; --x >= 0;)
{
shadowAlpha = ((shadowAlpha * radiusMinus1 + (*shadowPix << 6)) * filter) >> 12;
*shadowPix++ = (uint8) shadowAlpha;
}
}
}