[Interest] QImage detect full transparent

Xavier Bigand flamaros.xavier at gmail.com
Sun Feb 25 21:27:14 CET 2018


A complete scan will always be relatively slow, if you can you should
consider to do a cache or something similar.
Depending of your constraints the cache should be created while
packaging/building your application or when the user will request the info
the first time.

The cacheKey() won't work in my opinion because their should be have no
guaranty that rgb components are at 0 too if the alpha channel is at 0, so
their is many different images (with different keys) that can be fully
transparent.

2018-02-25 20:23 GMT+01:00 maitai <maitai at virtual-winds.org>:

> Hello,
> Seems quite basic, but I need a **fast** way to know if a QImage is just
> full transparent. I know the size in advance (256x256). If it were a
> QPixmap I would use cacheKey() and compare with the cacheKey of a full
> transparent image. For a QImage I can compare it with a preset transparent
> image, or extract the alpha channel, or etc of course. But I need a really
> fast way.
>
> Any idea?
>
> Thanks
> Philippe.
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>



-- 
Xavier
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20180225/e9e1d53e/attachment.html>


More information about the Interest mailing list