Lotsawa Tony Duff

Duff's device deals with serial copying, rather than just any old problem, but is a classic example of how optimisations can be made by reducing the number of times that a comparison needs to be done in a loop.

Lotsawa Tony Duff 1

4 Duff's device In computer science, Duff's device is an optimized implementation of a serial copy that uses a technique widely applied in assembly language for loop unwinding. Its discovery is credited to Tom Duff in November of 1983, who at the time was working for Lucasfilm.

I would like to know what PorterDuff.Mode means in android graphics. I know that it is a transfer mode. I also know, that it has attributes such as DST_IN, Multiply etc.

Lotsawa Tony Duff 3

Please, please don't use Duff's device. A thousand maintenance programmers will thank you. I used to work for a training company where someone thought it funny to introduce the device in the first ten pages of their C programming course. As an instructor it was impossible to deal with, unless (as the guy that that wrote that bit of the course apparently did) you believe in "kewl" coding ...

Can I use Duff's Device on an array in C? - Stack Overflow

Now, everything draws great, but... the background is BLACK in whole View. If I set canvas.drawColor(..., PorterDuff.Mode.DST) and omit canvas.drawBitmap() - the arc is drawn properly on transparent background. My question is - how to set PorterDuff modes to make it work with transparency? Of course bitmap is 32-bit PNG with alpha channel.

Lotsawa Tony Duff 6

porter duff - How to create a 'transparent circle inside rectangle ...

Lotsawa Tony Duff 7

In all seriousness, I'd suggest looking into separate compilation of just that bit with -funroll-loops before using Duff's Device: it's a beautiful thing to study, but an ugly thing to have in your code.