Re: [Interest] QImage detect full transparent

2018-02-25 Thread Allan Sandfeld Jensen
On Sonntag, 25. Februar 2018 21:35:41 CET maitai wrote: > Just what I was looking for. I already live with using qt private stuff > Though if you want to check for only fully transparent pixels, and not just some, it might be faster to do just do a memory compare against null. That should be rea

Re: [Interest] QImage detect full transparent

2018-02-25 Thread maitai
Wow! Nice idea. Probably a bit faster than to compare with a known fully transparent image. Le 25-02-2018 21:41, Xavier Bigand a écrit : > I think that I forgot to tell that it can be faster to do a pseudo random > search than a pure straight forward brut-force lookup in the alpha channel > buf

Re: [Interest] QImage detect full transparent

2018-02-25 Thread Xavier Bigand
I think that I forgot to tell that it can be faster to do a pseudo random search than a pure straight forward brut-force lookup in the alpha channel buffer. Depending on type of pictures you will analyse, it might be faster to have an algorithm that do something like the quick search algorithm. For

Re: [Interest] QImage detect full transparent

2018-02-25 Thread maitai
Just what I was looking for. I already live with using qt private stuff :) Many thanks. Le 25-02-2018 20:55, Allan Sandfeld Jensen a écrit : On Sonntag, 25. Februar 2018 20:23:32 CET maitai wrote: Hello, Seems quite basic, but I need a **fast** way to know if a QImage is just full transpar

Re: [Interest] QImage detect full transparent

2018-02-25 Thread Xavier Bigand
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

Re: [Interest] QImage detect full transparent

2018-02-25 Thread Allan Sandfeld Jensen
On Sonntag, 25. Februar 2018 20:23:32 CET maitai wrote: > 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 i

[Interest] QImage detect full transparent

2018-02-25 Thread maitai
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