[CREATE] Lens correction database

Andrew Zabolotny zap at homelink.ru
Sun Sep 9 01:26:38 PDT 2007


From Sat, 8 Sep 2007 21:53:55 +0200
Cyrille Berger <cberger at cberger.net> wrote:

> Or even better:
> void Apply (const uint8 *rgbSrc, uint8 *rgbDst , int length);
> 
> And you can allow rgbSrc == rgbDst. This usefull for people who need
> to have an undo operation, that allow to spare a memcpy of the
> original data.
That'll take one extra register in the processing routine, and x86
for example doesn't have a lot of registers :) Maybe people that needs
undo will copy pixels first to the undo buffer, and then do the
processing in the undo buffer directly, this should work faster if the
chunks won't be too large (so that they fit in CPU cache and won't
require a memory access second time).

> But I don't see how pixel by pixel processing could work except for
> vignetting correction ? Distortion correction needs more than one
> pixel.
That's why I have a per-pixel function. It returns you the distorted
coordinates and you do with them what you need.

The coordinate transform itself is not a easy task (especially for the
PTLens distortion model) so I expect the cost of the computations to be
much higher than the overhead of the call.

Sure, this could be set up as a complex process with callbacks like
"get me the pixel from there" and so on, but I think this is way too
complex to be universal and effective.

> As for TCA or CCI I don't know :/ But I thought you would need
> it.
Well, maybe for colors this could be something like:

void Apply (uint8 *rgb, int count, int pixel_stride);

pixel_stride is the size in elements of a single pixel, since somebody
may want to apply transforms on something like RGBA or maybe even
something more complex.

Also another question: right now we're talking of the "reverse"
transform (e.g. correcting a image). Does it make sense to allow for
"forward" transforms too, e.g. immitation of some lens distortions? :)

Also, what formats Krita uses? uint8, uint16, maybe float? I would like
to cover all possible pixel formats.

-- 
Andrew
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/create/attachments/20070909/d4903d89/attachment.pgp 


More information about the CREATE mailing list