Is it compatible to customize the way of rendering 16-bit grayscale images? #9077
-
I haven't use Slint yet but expected to use it. After a simple investigation, I found that only RGBA color format was supported to define images. This restriction may be harmful to my usecase, where high-resolution grayscale images (can be 10~16-bit depth) that captured from cameras need to be displayed, requiring no re-allocation nor re-alignment. I wonder whether it is possible to 'hackly' define a custom grayscale buffer and render it by GPU simply? Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
It's true that our existing renderers pretty much all assume 8-bit RGB(A) surfaces. If your buffer is GPU accessible, then perhaps what you could do is activate our |
Beta Was this translation helpful? Give feedback.
It's true that our existing renderers pretty much all assume 8-bit RGB(A) surfaces. If your buffer is GPU accessible, then perhaps what you could do is activate our
unstable-wgpu-24
feature (soonunstable-wgpu-26
in the next release), render your high-res grayscale image on the GPU to a RGBA texture, and then integrate that texture into Slint - similar to our wgpu_texture example. This means that you have full control over the conversion to RGBA, and it can happen entirely on the GPU side.