mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-14 00:14:18 +00:00
CoreGraphics alpha-channel clipping fix.
This commit is contained in:
parent
b0ba2f7388
commit
88ca4b9901
3 changed files with 15 additions and 10 deletions
|
|
@ -95464,7 +95464,8 @@ const Image Image::convertedToFormat (PixelFormat newFormat) const
|
|||
if (image == 0 || newFormat == image->format)
|
||||
return *this;
|
||||
|
||||
Image newImage (newFormat, image->width, image->height, false, image->getType());
|
||||
const int w = image->width, h = image->height;
|
||||
Image newImage (newFormat, w, h, false, image->getType());
|
||||
|
||||
if (newFormat == SingleChannel)
|
||||
{
|
||||
|
|
@ -95474,15 +95475,15 @@ const Image Image::convertedToFormat (PixelFormat newFormat) const
|
|||
}
|
||||
else
|
||||
{
|
||||
const BitmapData destData (newImage, 0, 0, image->width, image->height, true);
|
||||
const BitmapData srcData (*this, 0, 0, image->width, image->height);
|
||||
const BitmapData destData (newImage, 0, 0, w, h, true);
|
||||
const BitmapData srcData (*this, 0, 0, w, h);
|
||||
|
||||
for (int y = 0; y < image->height; ++y)
|
||||
for (int y = 0; y < h; ++y)
|
||||
{
|
||||
const PixelARGB* src = (const PixelARGB*) srcData.getLinePointer(y);
|
||||
uint8* dst = destData.getLinePointer (y);
|
||||
|
||||
for (int x = image->width; --x >= 0;)
|
||||
for (int x = w; --x >= 0;)
|
||||
{
|
||||
*dst++ = src->getAlpha();
|
||||
++src;
|
||||
|
|
@ -266125,6 +266126,7 @@ public:
|
|||
applyTransform (t.inverted());
|
||||
flip();
|
||||
|
||||
CGContextFlush (context);
|
||||
CGImageRelease (image);
|
||||
lastClipRectIsValid = false;
|
||||
}
|
||||
|
|
@ -270821,6 +270823,7 @@ public:
|
|||
applyTransform (t.inverted());
|
||||
flip();
|
||||
|
||||
CGContextFlush (context);
|
||||
CGImageRelease (image);
|
||||
lastClipRectIsValid = false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -209,7 +209,8 @@ const Image Image::convertedToFormat (PixelFormat newFormat) const
|
|||
if (image == 0 || newFormat == image->format)
|
||||
return *this;
|
||||
|
||||
Image newImage (newFormat, image->width, image->height, false, image->getType());
|
||||
const int w = image->width, h = image->height;
|
||||
Image newImage (newFormat, w, h, false, image->getType());
|
||||
|
||||
if (newFormat == SingleChannel)
|
||||
{
|
||||
|
|
@ -219,15 +220,15 @@ const Image Image::convertedToFormat (PixelFormat newFormat) const
|
|||
}
|
||||
else
|
||||
{
|
||||
const BitmapData destData (newImage, 0, 0, image->width, image->height, true);
|
||||
const BitmapData srcData (*this, 0, 0, image->width, image->height);
|
||||
const BitmapData destData (newImage, 0, 0, w, h, true);
|
||||
const BitmapData srcData (*this, 0, 0, w, h);
|
||||
|
||||
for (int y = 0; y < image->height; ++y)
|
||||
for (int y = 0; y < h; ++y)
|
||||
{
|
||||
const PixelARGB* src = (const PixelARGB*) srcData.getLinePointer(y);
|
||||
uint8* dst = destData.getLinePointer (y);
|
||||
|
||||
for (int x = image->width; --x >= 0;)
|
||||
for (int x = w; --x >= 0;)
|
||||
{
|
||||
*dst++ = src->getAlpha();
|
||||
++src;
|
||||
|
|
|
|||
|
|
@ -277,6 +277,7 @@ public:
|
|||
applyTransform (t.inverted());
|
||||
flip();
|
||||
|
||||
CGContextFlush (context);
|
||||
CGImageRelease (image);
|
||||
lastClipRectIsValid = false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue