[libcamera-devel] Debayering

Dorota Czaplejewicz dorota.czaplejewicz at puri.sm
Tue Nov 16 12:41:50 CET 2021


On Mon, 15 Nov 2021 12:16:39 +0200
Laurent Pinchart <laurent.pinchart at ideasonboard.com> wrote:

> Hi Dorota,
> 
> On Sat, Nov 13, 2021 at 11:56:04AM +0100, Dorota Czaplejewicz wrote:
> >
> > "Quick hacks" is not what I intend to merge. Rather, I found the
> > libcamera codebase difficult to learn, and I don't see the point in  
> 
> Is there anything in particular that would have made it easier ?

After digging in some more, I can point out some things already.

Initially I thought there was nearly zero documentation on the internals. I used three ways to access the code: stepping through executing code, reading header files, and looking through the documentation web site.

Then I discovered that there's documentation in the beginning of the .cpp file, as well as some strings interspersed through some files (notably, simple.cpp, and camera.cpp). But it took me a long time to notice them, and I only found out where the documentation for base classes is hours after I started looking at the code.

The main problem with learning libcamera is that it's complex. I don't yet know if it's incidental or not, having discovered the docs literally 5 minutes ago.

The other problem is that documentation is far separated from the things it documents. Part of that is caused by the choice of C++, which splits headers and source files, which necessarily creates a choice between:
1. prototypes being separate from documentation,
2. bodies being separate from documentation,
3. documentation being duplicated, or
4. documentation being entirely separate from code, like needing a separate browser.

In the case of class fields and abstract methods, there's only one place where they are mentioned, which is the declaration. In libcamera, they are not documented there, but instead the documentation is inserted in the corresponding cpp file, which… doesn't have either the declaration of the body of the documented item, making it honestly confusing. I think moving those to header files would have saved me a lot of wandering about the sources.

Following this precedent, the header files could also contain the docs for the rest of the items, to be able to create a complete picture of a module in one place (although I'm much less confident about this).

I'll report back once I have some knowledge from reading the comments.

Cheers,
Dorota
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.libcamera.org/pipermail/libcamera-devel/attachments/20211116/fd27d32f/attachment.sig>


More information about the libcamera-devel mailing list