gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSBitmapImageRep scaling/copying issue


From: Ivan Vučica
Subject: Re: NSBitmapImageRep scaling/copying issue
Date: Tue, 12 Apr 2016 20:41:12 +0100

Do you have any screenshots?

Bonus points for repro code + images...

Side note: thanks for the work on tiffs...

On Tue, Apr 12, 2016 at 2:26 PM, Riccardo Mottola <address@hidden> wrote:
Hi,

while trying to debug the issue betweeen GUI and GWorkspace icons with multi-page tiffs and high-res versions of our GUI controls, I noticed something strange.

I did a test-case on Mac where due to different backgrounds it is easier to detect.

The "scale" (but actually any) code I use IN PRICE and thus in also in GWorkspace appears to be broken, it produces artefacts with images with Alpha channel.

Even verys imple code, where I copy from the source to destination all "samples per pixels" copies all colors correctly, copies but produces effect around the borders and, apparently, on certain images it totally ruins alpha, on others not, just around the borders.

e.g in simplified pseudocode.

for (height)
  for (width)
    for (i in samples per pixel)
     destData[xy +  i] = srcData[xy +i];

fails. The actual code is actually smarter and tries to use bytesPerRow.

Does a bell ring for anybody? I know that e.g. when scaling, pre-multiplied alpha should be considered, but this produces minor issues and should not affect just simple copying or flipping or such. The nested loops should essentially do a byte-copy.. and they do for images without alpha.

Riccardo

_______________________________________________
Gnustep-dev mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/gnustep-dev


reply via email to

[Prev in Thread] Current Thread [Next in Thread]