color lib

Ilya Yaroshenko via Digitalmars-d digitalmars-d at puremagic.com
Sun Oct 9 06:36:26 PDT 2016


On Sunday, 9 October 2016 at 13:18:22 UTC, Manu wrote:
> On 9 October 2016 at 15:34, Ilya Yaroshenko via Digitalmars-d 
> <digitalmars-d at puremagic.com> wrote:
>> On Sunday, 9 October 2016 at 05:21:32 UTC, Manu wrote:
>>>
>>> On 9 October 2016 at 14:03, Nicholas Wilson via Digitalmars-d 
>>> <digitalmars-d at puremagic.com> wrote:
>>>>
>>>> [...]
>>>
>>>
>>> Well the trouble is the lambda that you might give to 'map' 
>>> won't work anymore. Operators don't work on batches, you need 
>>> to use a completely different API, and I think that's 
>>> unfortunate.
>>
>>
>> Could you please give an example what type of operation should 
>> be vectorized?
>
> Let's consider a super simple blend:
>   dest = src.rgb * src.a + dest.rgb * (1-src.alpha);

This code do not need transposition. And can be partially 
vectorised using mir.ndslice.algorithm.

To perform full vectorization image should be regrouped in memory 
channels. For example many computer vision algorithms work better 
with each channel regrouped in memory channels.

Relevant issue for this type of optmizations: 
https://github.com/libmir/mir/issues/343

Please comment on this issue and provide a set of functions you 
would like to be vectorised. --Ilya


More information about the Digitalmars-d mailing list