gnustep-dev
[Top][All Lists]
Advanced

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

NSBitmapImageRep scaling/copying issue


From: Riccardo Mottola
Subject: NSBitmapImageRep scaling/copying issue
Date: Tue, 12 Apr 2016 15:26:09 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:43.0) Gecko/20100101 Firefox/43.0 SeaMonkey/2.40

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



reply via email to

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