You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

37 lines
877 B

  1. #if !defined(__FBG_UTILS__)
  2. #define __FBG_UTILS__
  3. #include "fbgraphics.h"
  4. #include "fonts.h"
  5. #include "image.h"
  6. struct color_rgb {
  7. uint8_t r;
  8. uint8_t g;
  9. uint8_t b;
  10. };
  11. /**
  12. * Swap RGB color to BGR color
  13. **/
  14. void swap_bgr(struct color_rgb* color);
  15. /**
  16. * Alpha blend background b and front f with alpha a
  17. **/
  18. uint8_t alpha_blend(uint8_t b, uint8_t f, uint8_t a);
  19. /**
  20. * Draw font buffer to screen
  21. **/
  22. void draw_font(struct _fbg* f, struct font_render_buffer* src, int x, int y,
  23. struct color_rgb color);
  24. /**
  25. * Draw font with border to screen
  26. **/
  27. void draw_font_border(struct _fbg* f, struct font_render_buffer* src, int x, int y,
  28. struct color_rgb color, struct color_rgb border_color);
  29. /**
  30. * Convert image buffer to fbg buffer
  31. **/
  32. void image_data_to_buffer(struct _fbg* fbg, struct image_data* img, struct _fbg_img* outImg);
  33. #endif // __FBG_UTILS__