[fpc-devel] defaultformatsettings

Marco van de Voort marcov at stack.nl
Tue Nov 30 08:56:10 CET 2010


In our previous episode, Paul Ishenin said:
> 30.11.2010 1:23, Marco van de Voort wrote:
> 
> > Like anything new in Delphi nowadays, it is a record-with-some-helpers
> 
> Time to implement this kind of records in FPC?

If generics are more mature, we are going to need it.

E.g. I'm thinking of parameterizing some of the core fpimage readers/writers
with stuff like

   YUV422 = record
             pixel : word;
             function red:integer;    inline;
             function green:integer;  inline;
             function blue:integer;   inline;
             function alpha:integer; inline;
            end;

for pixel value

Since r/g/b are only shift+ and mask, and alpha is even constant, that would
speed up the reader etc.

I still plan to keep a basic polymorphic everything to 64-bit pixel readers,
but have avenues to instantiate a couple of faster paths.  I hope to reach
speedups in the magnitude of 50 times.  (currently my routines are 100 times
faster, but that is handcoded for a couple of formats without any general
purposeness)




More information about the fpc-devel mailing list