[v. dev-7.0] Is there any api like lv_draw_px(...)?

I developed some higher-apis and must use by low-level drawing api,

In version 6.x lvgl has low-level lv_draw_px(...) .
But when upgrades to the next version dev-7.0,
many low-level drawing is changed to mask-drawing.

In version dev-7.0 , is there any api for lv_draw_px(..) like version 6.x?

Thank you.

I’ve added it.
Note that, that the new draw system is not designed to be fast with pixel level operation so lv_draw_px can be slow.

@kisvegabor Thank you for adding lv_draw_px(..) and description.
Mainly I use lv_draw_fill(...) in version6.xx
and move to lv_blend_fill(...) instead in dev-7.0.
Only a few pixels after using lv_draw_fill(...) / lv_blend_fill(...),
I use lv_draw_px(..), or can you advice to use any new api in dev-7.0 instead for better performance?

And the other point, do you mind to change the prototype of lv_draw_px(...)
as the same in previous version?

(or by the 2 first parameters lv_coord_t x, lv_coord_t y instead of lv_point_t* point,
I don’t want to add another variable lv_point_t before calling the api in dev-7.0 )

Prototype V.6.xx

void lv_draw_px(lv_coord_t x, lv_coord_t y, const lv_area_t * mask_p, lv_color_t color, lv_opa_t opa);

Prototype V. dev-7.0

void lv_draw_px(const lv_point_t * point, const lv_area_t * clip_area, const lv_style_t * style, lv_opa_t opa_scale);

Thank you again ^ ^

The less arguments passed into a C function, the more efficient the function call is. That’s one reason I see for doing it the new way.

I agree with the less arguments, but the first parameter is the pointer,
then it will make many step before passing into a C function.

Such as the comparation
between lv_draw_px(…) in lvgl v6.x and lvgl v.dev-7.0.

In new prototype of lv_draw_px(...) must do at lease 2 steps
before passing to the lv_draw_px(...)

  • must create a lv_point_t variable
  • must copy line’s color to style’s body.main_color

lv_point_t can be changed to x and y. It’s a slow function anyway so passing one more parameter shouldn’t matter too much.

However, lv_style_t should remain because not only the color is used but thestyle->body.blend_mode and opa too. So it’s more general to pass the style if more attributes are used.

1 Like