Blog About Contact

Quick update for Google Summer of Code

Quick update for Google Summer of Code

For the last week I have been reading and understanding the code of kis_imagepipe_brush.cpp, and it has been an eye opening experience.

Unfortunately, the last few days I was sick and I was unable to work on the code and my school activities, so I had a little delay, but today I tried to get back on track. I wrote a little of code, and I hope to get feedback soon to be able to fix everything.

Connecting Classes

So far I've been adventuring more and more into reading code and getting used to it, sometimes it can be quite hard, specially because I am reading code related to GBR brushes, which are not so simple, or even complex.

I've been reading kis_imagepipe_brush.cpp and I've checking the classes related to it, like kis_gbr_brush.cpp and kis_brushes_pipe.h.

Now, I have to recognize that using classes has been fun, but hard and confusing, sometimes I get a little frustrated, I feel like I am completely lost. The positive thing about this is that it means I am actually learning, and I am pushing my self.

The problem

I feel confused about how classes seem to know when to be applied and when to work, don't get me wrong, they seem to be an smart feature and that can reduce complexity, however they also feel like magic, doing stuff when it is the right moment.

The thing is, I need to understand how to connect the classes I am writing: kis_animated_brushes.h and kis_vector_animated_brush, so they work with the other classes I need, like kis_brush.cpp, kis_brushes_pipe.h, and kis_scaling_size_brush.cpp.

My tutor explained to me that they work like a cookie, so once they are called they will remain there until they are destroyed or 'eaten'. I understand this concept, it seems simple, now I just need to know how to apply it.

Cycling through the brush

Right now I am trying to give my brush the ability to cycle through a QList of KoShapes, so that every dab it will render a different image.

I understand the basic concept, I need to call the function .at() on the QList, so that with every dab I will get a different image.

(Actually, now that I think about it, I think I could do it right away with all the QList and instead call the resulting QImages every time…)

I just need to get the brusIndex and add 1 every time, seems easy enough, however I still need to figure how to do this at every dab. I have to do this in my new class and using chooseNextBrush(), seems easy enough, get a dab event, add one to brushIndex and get next image, but for some reason I still feel lost on how to actually write this.

The positive

Well it might seem like I am not competent at programming, but I had been learning about Object Oriented Programming, and every day I feel more and more good with it, so I hope in a couple days I will have figured it out, so I can move to the next part of my project.