[fpc-pascal] FPImage and GetDataLineStart
Marco van de Voort
marcov at stack.nl
Thu Apr 21 22:10:45 CEST 2011
In our previous episode, Michael Van Canneyt said:
> >> The best we can do is create a memory class with some pre-defined memory storages,
> >> with appropriate getscanline/setscanline routines and make sure the reader classes
> >> can
> >> a) detect them
> >> b) make use of them if they find one matching the file storage format.
> >> c) fall back on the current mechanism if no fitting format is found.
> >> If well-chosen, this approach should cover most cases.
> >
> > Something like that yes. Still duplication for the various formats though.
>
> I don't see where the duplication comes in.
It allows to address multiple points in the imagesize vs reader/writer class
matrix (that you described) in one source.
> There may be duplication in your classes (I don't know, but I suspect it is
> delegation classes I think there is no need for duplication...
Basically I use delegation for the slow case, where you operate on the base
type.
However when implemented using generics you can also directly use the
specialized type, and have fairly quick direct access.
> The thing will be to parametrize the needed storage formats, and then implement
> the reader support for them.
How will you implement reader support for many memory layouts?
More information about the fpc-pascal
mailing list