Hello everyone, I am a student from Germany and currently working on a project with LVGL. A part of my work also includes explaining the mechanisms behind the library and I’m kind of stuck with the drawing and masking mechanics.
I already read the sections in the documentation regarding this topic and understood it that way:
-The base for every drawing is a filled rectangle. Color, Size etc. according to the draw descriptor.
-That rectangle is loaded into a draw buffer; now that buffer should look sth like this(for a purple rect):
(255,0,255) (255,0,255) (255,0,255) …
(255,0,255) (255,0,255) (255,0,255) …
(255,0,255) (255,0,255) …
… …
-Next on, we need to create masks (if we want to draw something more complex than an image or a rect) and load them into the mask buffer (which has the same size as the draw buffer ?) The mask buffer looks like this:
255 255 255…
255 255 255…
255 255 …
… …
Now if I interpreted correctly the mask types e.g. LV_DRAW_MASK_TYPE_LINE are basically algorithms that change the 255 to a 0 in the right spots.
In the documentation this line confuses me:
Apply all the created mask(s) for one or a few lines.
What do you mean by line ? I thought the mask buffer contains all masks for the whole rectangle, and not for one or a few lines.
Also the values in the mask buffer between 0 and 255, do they indicate the opacity ?
Alright, my style of explaining and asking questions at the same may be a little confusing and I’m sorry for that. I hope someone could give me some more hints on my questions and correct me on the statements I made. Thank you!!
Edit (new Questions):
Is it correct, that fonts are already saved masks?
How big is the draw buffer? Is it as big as the area on the screen, that needs to be changed or is it as big as the display?