The work I had to do

For the last two weeks been working on Krita, I had been solving two different problems.

  1. The first problem was using the Flake library to parse the XML and transform it to a QList of KoShapes because this are objects that Krita can handle, after that, I needed to transform each one of those objects to QImages, so they can be feed to kis_brush.cpp, using setBrushTipImage(); so the rendering can be done.
  2. The second part of my work has consisted, because is not finished yet, in feeding the QImages one by one to kis_brush.cpp, instead of all at once, and they will change with every dab, this means the basic functionality of my brush will be working. To do this I am writing a new class, based on kis_brushes_pipe.h.

My thoughts on the work.

For the last weeks I've continued to learn a lot. Now, I'm not a Computer Science student, and I've never had a class about programming in school. I've learnt by myself only through books and experience. Because of this, I've mainly tended toward functional programming. But Krita uses C++ and QT, and Object Oriented Programming, a paradigm shift I'm still going through.

My reason for working with Krita wasn't because I am good at C++ or CS, but to help others. I care about Free Software, and I see designers often having difficulties in switching away from proprietary solutions, but many were optimistic about Krita, and I wanted to help these people switch from proprietary software.

However, I have to say I've actually been enjoying working with Krita's code. I'm finding my way around the codebase, learning about inheritance, initializing objects, encapsulation, etc. My work with Krita has been fun so far, and though I'd like to go faster, I'm still learning lots.

For instance, to implement the changing of my brush'es images with every dab, I had to read kis_brush.cpp, kis_pipebrush.cpp, and kis_brush_pipe.h. I've also had to learn the FLAKE library for handling SVG-parsing, so as to transform them into QImages to fit the brush. This has given me a good base understanding of how Krita development works, as I now see that it's necessary to initialize objects, which is something I did not learn about in my functional programming-oriented studies. I'm warming more and more to the work-flow.

I thought I would have a working first implementation of my brush by now, but I think I was being too optimistic, as there was still things I needed to learn. Fortunately, I started to read kis_brushes_pipe.h, and instead of stopping and rushing for help, I tried to understand it myself. I didn't grokk all of it, but I understood a fair amount, and thought I had a good idea of what I should do further. I checked with my mentor, and it turns out I was not far away from the solution: I had to implement a subclass of kis_brushes_pipe.h.

I hope I'll have working functional operation within two, three days tops.