-
Notifications
You must be signed in to change notification settings - Fork 616
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Image Table issues (transparency & background) #425
Comments
Pixel format is 32bit ARGB |
Strange, it worked for me 3 months ago. |
So something was broken in macOS version between alpha4 and alpha4.1. |
Does it work in https://github.com/msink/kotlin-libui/releases/download/alpha-4.1-1/libui-samples-kotlin-macos.tgz ? |
Huh, with this change: diff --git a/darwin/image.m b/darwin/image.m
index 0b10cb09..75ed6347 100644
--- a/darwin/image.m
+++ b/darwin/image.m
@@ -37,7 +37,7 @@ void uiImageAppend(uiImage *i, void *pixels, int pixelWidth, int pixelHeight, in
hasAlpha:YES
isPlanar:NO
colorSpaceName:NSCalibratedRGBColorSpace
- bitmapFormat:0
+ bitmapFormat:NSAlphaNonpremultipliedBitmapFormat
bytesPerRow:0
bitsPerPixel:32];
The image is displayed correctly. But I thought libui used premultiplied image data now? This tells Cocoa, that the values aren't premuliplied. 🤔 @andlabs On this page, there are also some options regarding endianness, have you seen these? https://developer.apple.com/documentation/appkit/nsbitmapformat?language=objc |
On macOS (not Windows): On the right is the (png) image as it should be displayed, but in the table there are these green bits.
The code below has this output: Firstly, the green as described above, but secondly the alternating row background doesn't seem to work correctly.
Code: https://github.com/mischnic/libui-tests/tree/master/png
The text was updated successfully, but these errors were encountered: