2016-06-08 07:25:08 +02:00
|
|
|
/**
|
2017-04-10 11:33:38 +02:00
|
|
|
* @file lv_draw.h
|
2016-06-08 07:25:08 +02:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef LV_DRAW_H
|
|
|
|
#define LV_DRAW_H
|
|
|
|
|
2017-07-09 15:32:49 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2016-06-08 07:25:08 +02:00
|
|
|
/*********************
|
|
|
|
* INCLUDES
|
|
|
|
*********************/
|
2017-01-02 10:48:21 +01:00
|
|
|
#include "misc_conf.h"
|
2017-04-21 09:15:39 +02:00
|
|
|
#include "misc/gfx/text.h"
|
2017-04-13 10:20:35 +02:00
|
|
|
#include "../lv_obj/lv_style.h"
|
2017-01-02 10:48:21 +01:00
|
|
|
|
2016-06-08 07:25:08 +02:00
|
|
|
/*********************
|
|
|
|
* DEFINES
|
|
|
|
*********************/
|
|
|
|
|
|
|
|
/**********************
|
|
|
|
* TYPEDEFS
|
|
|
|
**********************/
|
|
|
|
|
|
|
|
/**********************
|
|
|
|
* GLOBAL PROTOTYPES
|
|
|
|
**********************/
|
2017-01-13 23:27:49 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Draw a rectangle
|
|
|
|
* @param cords_p the coordinates of the rectangle
|
|
|
|
* @param mask_p the rectangle will be drawn only in this mask
|
2017-04-13 10:20:35 +02:00
|
|
|
* @param style_p pointer to a style
|
2017-01-13 23:27:49 +01:00
|
|
|
*/
|
2017-04-13 10:20:35 +02:00
|
|
|
void lv_draw_rect(const area_t * cords_p, const area_t * mask_p, const lv_style_t * style_p);
|
2017-01-02 15:29:05 +01:00
|
|
|
|
2017-02-17 11:29:17 +01:00
|
|
|
|
|
|
|
/*Experimental use for 3D modeling*/
|
|
|
|
#define USE_LV_TRIANGLE 0
|
|
|
|
#if USE_LV_TRIANGLE != 0
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @param points pointer to an array with 3 points
|
|
|
|
* @param mask_p the triangle will be drawn only in this mask
|
|
|
|
* @param color color of the triangle
|
|
|
|
*/
|
|
|
|
void lv_draw_triangle(const point_t * points, const area_t * mask_p, color_t color);
|
|
|
|
#endif
|
|
|
|
|
2017-01-13 23:27:49 +01:00
|
|
|
/**
|
|
|
|
* Write a text
|
|
|
|
* @param cords_p coordinates of the label
|
|
|
|
* @param mask_p the label will be drawn only in this area
|
2017-04-13 10:20:35 +02:00
|
|
|
* @param style_p pointer to a style
|
2017-01-13 23:27:49 +01:00
|
|
|
* @param txt 0 terminated text to write
|
2017-02-01 11:39:48 +01:00
|
|
|
* @param flags settings for the text from 'txt_flag_t' enum
|
2017-06-18 18:25:25 +02:00
|
|
|
* @param offset text offset in x and y direction (NULL if unused)
|
2017-01-13 23:27:49 +01:00
|
|
|
*/
|
2017-04-13 10:20:35 +02:00
|
|
|
void lv_draw_label(const area_t * cords_p,const area_t * mask_p, const lv_style_t * style_p,
|
2017-06-18 18:25:25 +02:00
|
|
|
const char * txt, txt_flag_t flag, point_t * offset);
|
2017-01-02 15:29:05 +01:00
|
|
|
|
2017-01-13 23:27:49 +01:00
|
|
|
/**
|
|
|
|
* Draw an image
|
|
|
|
* @param cords_p the coordinates of the image
|
|
|
|
* @param mask_p the image will be drawn only in this area
|
|
|
|
* @param map_p pointer to a color_t array which contains the pixels of the image
|
|
|
|
*/
|
|
|
|
void lv_draw_img(const area_t * cords_p, const area_t * mask_p,
|
2017-04-13 10:20:35 +02:00
|
|
|
const lv_style_t * style_p, const char * fn);
|
2017-01-02 10:48:21 +01:00
|
|
|
|
2017-01-13 23:27:49 +01:00
|
|
|
/**
|
|
|
|
* Draw a line
|
|
|
|
* @param p1 first point of the line
|
|
|
|
* @param p2 second point of the line
|
|
|
|
* @param mask_pthe line will be drawn only on this area
|
2017-04-13 10:20:35 +02:00
|
|
|
* @param style_p pointer to a style
|
2017-01-13 23:27:49 +01:00
|
|
|
*/
|
|
|
|
void lv_draw_line(const point_t * p1, const point_t * p2, const area_t * mask_p,
|
2017-04-13 10:20:35 +02:00
|
|
|
const lv_style_t * style_p);
|
2017-01-13 23:27:49 +01:00
|
|
|
|
2016-06-08 07:25:08 +02:00
|
|
|
/**********************
|
|
|
|
* MACROS
|
|
|
|
**********************/
|
|
|
|
|
2017-07-09 15:32:49 +02:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
} /* extern "C" */
|
2016-06-08 07:25:08 +02:00
|
|
|
#endif
|
2017-07-09 15:32:49 +02:00
|
|
|
|
|
|
|
#endif /*LV_DRAW_H*/
|