mirror of
https://github.com/lvgl/lvgl.git
synced 2026-05-30 07:06:19 +08:00
rename a lot of functions in lv_misc
This commit is contained in:
+2
-2
@@ -49,8 +49,8 @@
|
||||
#define LV_OBJ_GROUP 1 /*Enable object groups*/
|
||||
|
||||
/*Others*/
|
||||
#define LV_COLOR_TRANSP COLOR_LIME /*Images pixels with this color will not be drawn*/
|
||||
#define LV_FONT_DEFAULT &font_dejavu_40 /*Always set a default font from the built-in fonts*/
|
||||
#define LV_LV_COLOR_TRANSP LV_COLOR_LIME /*Images pixels with this color will not be drawn*/
|
||||
#define LV_FONT_DEFAULT &lv_font_dejavu_40 /*Always set a default font from the built-in fonts*/
|
||||
|
||||
/*==================
|
||||
* IMAGE USAGE
|
||||
|
||||
+286
-286
File diff suppressed because it is too large
Load Diff
+8
-8
@@ -31,7 +31,7 @@ typedef struct
|
||||
{
|
||||
uint32_t w:12; /*Width of the image map*/
|
||||
uint32_t h:12; /*Height of the image map*/
|
||||
uint32_t transp:1; /*1: The image contains transparent pixels with LV_COLOR_TRANSP color*/
|
||||
uint32_t transp:1; /*1: The image contains transparent pixels with LV_LV_COLOR_TRANSP color*/
|
||||
uint32_t cd:3; /*Color depth (0: reserved, 1: 8 bit, 2: 16 bit or 3: 24 bit, 4-7: reserved)*/
|
||||
uint32_t res :4; /*Reserved*/
|
||||
}lv_img_raw_header_t;
|
||||
@@ -46,7 +46,7 @@ typedef struct
|
||||
* @param mask_p the rectangle will be drawn only in this mask
|
||||
* @param style_p pointer to a style
|
||||
*/
|
||||
void lv_draw_rect(const area_t * cords_p, const area_t * mask_p, const lv_style_t * style_p);
|
||||
void lv_draw_rect(const lv_area_t * cords_p, const lv_area_t * mask_p, const lv_style_t * style_p);
|
||||
|
||||
|
||||
/*Experimental use for 3D modeling*/
|
||||
@@ -58,7 +58,7 @@ void lv_draw_rect(const area_t * cords_p, const area_t * mask_p, const lv_style_
|
||||
* @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);
|
||||
void lv_draw_triangle(const lv_point_t * points, const lv_area_t * mask_p, lv_color_t color);
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -70,16 +70,16 @@ void lv_draw_triangle(const point_t * points, const area_t * mask_p, color_t col
|
||||
* @param flags settings for the text from 'txt_flag_t' enum
|
||||
* @param offset text offset in x and y direction (NULL if unused)
|
||||
*/
|
||||
void lv_draw_label(const area_t * cords_p,const area_t * mask_p, const lv_style_t * style_p,
|
||||
const char * txt, txt_flag_t flag, point_t * offset);
|
||||
void lv_draw_label(const lv_area_t * cords_p,const lv_area_t * mask_p, const lv_style_t * style_p,
|
||||
const char * txt, txt_flag_t flag, lv_point_t * offset);
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @param map_p pointer to a lv_color_t array which contains the pixels of the image
|
||||
*/
|
||||
void lv_draw_img(const area_t * cords_p, const area_t * mask_p,
|
||||
void lv_draw_img(const lv_area_t * cords_p, const lv_area_t * mask_p,
|
||||
const lv_style_t * style_p, const char * fn);
|
||||
|
||||
/**
|
||||
@@ -89,7 +89,7 @@ void lv_draw_img(const area_t * cords_p, const area_t * mask_p,
|
||||
* @param mask_pthe line will be drawn only on this area
|
||||
* @param style_p pointer to a style
|
||||
*/
|
||||
void lv_draw_line(const point_t * p1, const point_t * p2, const area_t * mask_p,
|
||||
void lv_draw_line(const lv_point_t * p1, const lv_point_t * p2, const lv_area_t * mask_p,
|
||||
const lv_style_t * style_p);
|
||||
|
||||
/**********************
|
||||
|
||||
+29
-29
@@ -43,15 +43,15 @@
|
||||
* @param color color of the pixel
|
||||
* @param opa opacity (ignored, only for compatibility with lv_vpx)
|
||||
*/
|
||||
void lv_rpx(cord_t x, cord_t y, const area_t * mask_p, color_t color, opa_t opa)
|
||||
void lv_rpx(lv_coord_t x, lv_coord_t y, const lv_area_t * mask_p, lv_color_t color, lv_opa_t opa)
|
||||
{
|
||||
area_t area;
|
||||
lv_area_t area;
|
||||
area.x1 = x;
|
||||
area.y1 = y;
|
||||
area.x2 = x;
|
||||
area.y2 = y;
|
||||
|
||||
lv_rfill(&area, mask_p, color, OPA_COVER);
|
||||
lv_rfill(&area, mask_p, color, LV_OPA_COVER);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -61,18 +61,18 @@ void lv_rpx(cord_t x, cord_t y, const area_t * mask_p, color_t color, opa_t opa)
|
||||
* @param color fill color
|
||||
* @param opa opacity (ignored, only for compatibility with lv_vfill)
|
||||
*/
|
||||
void lv_rfill(const area_t * cords_p, const area_t * mask_p,
|
||||
color_t color, opa_t opa)
|
||||
void lv_rfill(const lv_area_t * cords_p, const lv_area_t * mask_p,
|
||||
lv_color_t color, lv_opa_t opa)
|
||||
{
|
||||
area_t masked_area;
|
||||
lv_area_t masked_area;
|
||||
bool union_ok = true;
|
||||
|
||||
if(mask_p != NULL) {
|
||||
union_ok = area_union(&masked_area, cords_p, mask_p);
|
||||
union_ok = lv_area_union(&masked_area, cords_p, mask_p);
|
||||
} else {
|
||||
area_t scr_area;
|
||||
area_set(&scr_area, 0, 0, LV_HOR_RES - 1, LV_VER_RES - 1);
|
||||
union_ok = area_union(&masked_area, cords_p, &scr_area);
|
||||
lv_area_t scr_area;
|
||||
lv_area_set(&scr_area, 0, 0, LV_HOR_RES - 1, LV_VER_RES - 1);
|
||||
union_ok = lv_area_union(&masked_area, cords_p, &scr_area);
|
||||
}
|
||||
|
||||
if(union_ok != false){
|
||||
@@ -89,17 +89,17 @@ void lv_rfill(const area_t * cords_p, const area_t * mask_p,
|
||||
* @param color color of letter
|
||||
* @param opa opacity of letter (ignored, only for compatibility with lv_vletter)
|
||||
*/
|
||||
void lv_rletter(const point_t * pos_p, const area_t * mask_p,
|
||||
const font_t * font_p, uint32_t letter,
|
||||
color_t color, opa_t opa)
|
||||
void lv_rletter(const lv_point_t * pos_p, const lv_area_t * mask_p,
|
||||
const lv_font_t * font_p, uint32_t letter,
|
||||
lv_color_t color, lv_opa_t opa)
|
||||
{
|
||||
uint8_t w = font_get_width(font_p, letter);
|
||||
uint8_t w = lv_font_get_width(font_p, letter);
|
||||
|
||||
if(letter == 'C') {
|
||||
letter = 'C';
|
||||
}
|
||||
|
||||
const uint8_t * bitmap_p = font_get_bitmap(font_p, letter);
|
||||
const uint8_t * bitmap_p = lv_font_get_bitmap(font_p, letter);
|
||||
|
||||
uint8_t col, col_sub, row;
|
||||
#if FONT_ANTIALIAS == 0
|
||||
@@ -151,7 +151,7 @@ void lv_rletter(const point_t * pos_p, const area_t * mask_p,
|
||||
|
||||
|
||||
if(px_cnt != 0) {
|
||||
lv_rpx(pos_p->x + col, pos_p->y + row, mask_p, color_mix(color, COLOR_SILVER, 63 * px_cnt), OPA_COVER);
|
||||
lv_rpx(pos_p->x + col, pos_p->y + row, mask_p, color_mix(color, LV_COLOR_SILVER, 63 * px_cnt), LV_OPA_COVER);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -167,43 +167,43 @@ void lv_rletter(const point_t * pos_p, const area_t * mask_p,
|
||||
* Draw a color map to the display
|
||||
* @param cords_p coordinates the color map
|
||||
* @param mask_p the map will drawn only on this area
|
||||
* @param map_p pointer to a color_t array
|
||||
* @param map_p pointer to a lv_color_t array
|
||||
* @param opa opacity of the map (ignored, only for compatibility with lv_vmap)
|
||||
* @param transp true: enable transparency of LV_IMG_COLOR_TRANSP color pixels
|
||||
* @param transp true: enable transparency of LV_IMG_LV_COLOR_TRANSP color pixels
|
||||
* @param upscale true: upscale to double size (not supported)
|
||||
* @param recolor mix the pixels with this color (not supported)
|
||||
* @param recolor_opa the intense of recoloring (not supported)
|
||||
*/
|
||||
void lv_rmap(const area_t * cords_p, const area_t * mask_p,
|
||||
const color_t * map_p, opa_t opa, bool transp, bool upscale,
|
||||
color_t recolor, opa_t recolor_opa)
|
||||
void lv_rmap(const lv_area_t * cords_p, const lv_area_t * mask_p,
|
||||
const lv_color_t * map_p, lv_opa_t opa, bool transp, bool upscale,
|
||||
lv_color_t recolor, lv_opa_t recolor_opa)
|
||||
{
|
||||
area_t masked_a;
|
||||
lv_area_t masked_a;
|
||||
bool union_ok;
|
||||
|
||||
union_ok = area_union(&masked_a, cords_p, mask_p);
|
||||
union_ok = lv_area_union(&masked_a, cords_p, mask_p);
|
||||
|
||||
/*If there are common part of the mask and map then draw the map*/
|
||||
if(union_ok == false) return;
|
||||
|
||||
/*Go to the first pixel*/
|
||||
cord_t map_width = area_get_width(cords_p);
|
||||
lv_coord_t map_width = area_get_width(cords_p);
|
||||
map_p+= (masked_a.y1 - cords_p->y1) * map_width;
|
||||
map_p += masked_a.x1 - cords_p->x1;
|
||||
|
||||
if(transp == false) {
|
||||
cord_t row;
|
||||
cord_t mask_w = area_get_width(&masked_a) - 1;
|
||||
lv_coord_t row;
|
||||
lv_coord_t mask_w = area_get_width(&masked_a) - 1;
|
||||
for(row = 0; row < area_get_height(&masked_a); row++) {
|
||||
lv_disp_map(masked_a.x1, masked_a.y1 + row, masked_a.x1 + mask_w, masked_a.y1 + row, map_p);
|
||||
|
||||
map_p += map_width;
|
||||
}
|
||||
}else {
|
||||
color_t transp_color = LV_COLOR_TRANSP;
|
||||
cord_t row;
|
||||
lv_color_t transp_color = LV_LV_COLOR_TRANSP;
|
||||
lv_coord_t row;
|
||||
for(row = 0; row < area_get_height(&masked_a); row++) {
|
||||
cord_t col;
|
||||
lv_coord_t col;
|
||||
for(col = 0; col < area_get_width(&masked_a); col ++) {
|
||||
if(map_p[col].full != transp_color.full) {
|
||||
lv_rpx(masked_a.x1 + col, masked_a.y1 + row, mask_p, map_p[col], opa);
|
||||
|
||||
+11
-11
@@ -29,7 +29,7 @@ extern "C" {
|
||||
* GLOBAL PROTOTYPES
|
||||
**********************/
|
||||
|
||||
void lv_rpx(cord_t x, cord_t y, const area_t * mask_p, color_t color, opa_t opa);
|
||||
void lv_rpx(lv_coord_t x, lv_coord_t y, const lv_area_t * mask_p, lv_color_t color, lv_opa_t opa);
|
||||
|
||||
/**
|
||||
* Fill an area on the display
|
||||
@@ -38,8 +38,8 @@ void lv_rpx(cord_t x, cord_t y, const area_t * mask_p, color_t color, opa_t opa)
|
||||
* @param color fill color
|
||||
* @param opa opacity (ignored, only for compatibility with lv_vfill)
|
||||
*/
|
||||
void lv_rfill(const area_t * cords_p, const area_t * mask_p,
|
||||
color_t color, opa_t opa);
|
||||
void lv_rfill(const lv_area_t * cords_p, const lv_area_t * mask_p,
|
||||
lv_color_t color, lv_opa_t opa);
|
||||
|
||||
/**
|
||||
* Draw a letter to the display
|
||||
@@ -50,24 +50,24 @@ void lv_rfill(const area_t * cords_p, const area_t * mask_p,
|
||||
* @param color color of letter
|
||||
* @param opa opacity of letter (ignored, only for compatibility with lv_vletter)
|
||||
*/
|
||||
void lv_rletter(const point_t * pos_p, const area_t * mask_p,
|
||||
const font_t * font_p, uint32_t letter,
|
||||
color_t color, opa_t opa);
|
||||
void lv_rletter(const lv_point_t * pos_p, const lv_area_t * mask_p,
|
||||
const lv_font_t * font_p, uint32_t letter,
|
||||
lv_color_t color, lv_opa_t opa);
|
||||
|
||||
/**
|
||||
* Draw a color map to the display
|
||||
* @param cords_p coordinates the color map
|
||||
* @param mask_p the map will drawn only on this area
|
||||
* @param map_p pointer to a color_t array
|
||||
* @param map_p pointer to a lv_color_t array
|
||||
* @param opa opacity of the map (ignored, only for compatibility with lv_vmap)
|
||||
* @param transp true: enable transparency of LV_IMG_COLOR_TRANSP color pixels
|
||||
* @param transp true: enable transparency of LV_IMG_LV_COLOR_TRANSP color pixels
|
||||
* @param upscale true: upscale to double size (not supported)
|
||||
* @param recolor mix the pixels with this color (not supported)
|
||||
* @param recolor_opa the intense of recoloring (not supported)
|
||||
*/
|
||||
void lv_rmap(const area_t * cords_p, const area_t * mask_p,
|
||||
const color_t * map_p, opa_t opa, bool transp, bool upscale,
|
||||
color_t recolor, opa_t recolor_opa);
|
||||
void lv_rmap(const lv_area_t * cords_p, const lv_area_t * mask_p,
|
||||
const lv_color_t * map_p, lv_opa_t opa, bool transp, bool upscale,
|
||||
lv_color_t recolor, lv_opa_t recolor_opa);
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
+94
-94
@@ -34,8 +34,8 @@
|
||||
/**********************
|
||||
* STATIC PROTOTYPES
|
||||
**********************/
|
||||
static void sw_color_cpy(color_t * dest, const color_t * src, uint32_t length, opa_t opa);
|
||||
static void sw_color_fill(area_t * mem_area, color_t * mem, const area_t * fill_area, color_t color, opa_t opa);
|
||||
static void sw_color_cpy(lv_color_t * dest, const lv_color_t * src, uint32_t length, lv_opa_t opa);
|
||||
static void sw_color_fill(lv_area_t * mem_area, lv_color_t * mem, const lv_area_t * fill_area, lv_color_t color, lv_opa_t opa);
|
||||
|
||||
/**********************
|
||||
* STATIC VARIABLES
|
||||
@@ -58,7 +58,7 @@ static void sw_color_fill(area_t * mem_area, color_t * mem, const area_t * fill_
|
||||
* @param color pixel color
|
||||
* @param opa opacity of the area (0..255)
|
||||
*/
|
||||
void lv_vpx(cord_t x, cord_t y, const area_t * mask_p, color_t color, opa_t opa)
|
||||
void lv_vpx(lv_coord_t x, lv_coord_t y, const lv_area_t * mask_p, lv_color_t color, lv_opa_t opa)
|
||||
{
|
||||
lv_vdb_t * vdb_p = lv_vdb_get();
|
||||
|
||||
@@ -73,12 +73,12 @@ void lv_vpx(cord_t x, cord_t y, const area_t * mask_p, color_t color, opa_t opa)
|
||||
/*Make the coordinates relative to VDB*/
|
||||
x-=vdb_p->area.x1;
|
||||
y-=vdb_p->area.y1;
|
||||
color_t * vdb_px_p = vdb_p->buf + y * vdb_width + x;
|
||||
if(opa == OPA_COVER) {
|
||||
lv_color_t * vdb_px_p = vdb_p->buf + y * vdb_width + x;
|
||||
if(opa == LV_OPA_COVER) {
|
||||
*vdb_px_p = color;
|
||||
}
|
||||
else {
|
||||
*vdb_px_p = color_mix(color,*vdb_px_p, opa);
|
||||
*vdb_px_p = lv_color_mix(color,*vdb_px_p, opa);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -91,28 +91,28 @@ void lv_vpx(cord_t x, cord_t y, const area_t * mask_p, color_t color, opa_t opa)
|
||||
* @param color fill color
|
||||
* @param opa opacity of the area (0..255)
|
||||
*/
|
||||
void lv_vfill(const area_t * cords_p, const area_t * mask_p,
|
||||
color_t color, opa_t opa)
|
||||
void lv_vfill(const lv_area_t * cords_p, const lv_area_t * mask_p,
|
||||
lv_color_t color, lv_opa_t opa)
|
||||
{
|
||||
area_t res_a;
|
||||
lv_area_t res_a;
|
||||
bool union_ok;
|
||||
lv_vdb_t * vdb_p = lv_vdb_get();
|
||||
|
||||
/*Get the union of cord and mask*/
|
||||
/* The mask is already truncated to the vdb size
|
||||
* in 'lv_refr_area_with_vdb' function */
|
||||
union_ok = area_union(&res_a, cords_p, mask_p);
|
||||
union_ok = lv_area_union(&res_a, cords_p, mask_p);
|
||||
|
||||
/*If there are common part of the three area then draw to the vdb*/
|
||||
if(union_ok == false) return;
|
||||
|
||||
area_t vdb_rel_a; /*Stores relative coordinates on vdb*/
|
||||
lv_area_t vdb_rel_a; /*Stores relative coordinates on vdb*/
|
||||
vdb_rel_a.x1 = res_a.x1 - vdb_p->area.x1;
|
||||
vdb_rel_a.y1 = res_a.y1 - vdb_p->area.y1;
|
||||
vdb_rel_a.x2 = res_a.x2 - vdb_p->area.x1;
|
||||
vdb_rel_a.y2 = res_a.y2 - vdb_p->area.y1;
|
||||
|
||||
color_t * vdb_buf_tmp = vdb_p->buf;
|
||||
lv_color_t * vdb_buf_tmp = vdb_p->buf;
|
||||
uint32_t vdb_width = area_get_width(&vdb_p->area);
|
||||
/*Move the vdb_tmp to the first row*/
|
||||
vdb_buf_tmp += vdb_width * vdb_rel_a.y1;
|
||||
@@ -120,9 +120,9 @@ void lv_vfill(const area_t * cords_p, const area_t * mask_p,
|
||||
if(lv_disp_is_copy_supported() == false) {
|
||||
sw_color_fill(&vdb_p->area, vdb_buf_tmp, &vdb_rel_a, color, opa);
|
||||
} else {
|
||||
static color_t color_map[LV_HOR_RES];
|
||||
static cord_t last_width = 0;
|
||||
cord_t map_width = area_get_width(&vdb_rel_a);
|
||||
static lv_color_t color_map[LV_HOR_RES];
|
||||
static lv_coord_t last_width = 0;
|
||||
lv_coord_t map_width = area_get_width(&vdb_rel_a);
|
||||
if(color_map[0].full != color.full || last_width != map_width) {
|
||||
uint16_t i;
|
||||
for(i = 0; i < map_width; i++) {
|
||||
@@ -131,7 +131,7 @@ void lv_vfill(const area_t * cords_p, const area_t * mask_p,
|
||||
|
||||
last_width = map_width;
|
||||
}
|
||||
cord_t row;
|
||||
lv_coord_t row;
|
||||
for(row = vdb_rel_a.y1;row <= vdb_rel_a.y2; row++) {
|
||||
lv_disp_copy(&vdb_buf_tmp[vdb_rel_a.x1], color_map, map_width, opa);
|
||||
vdb_buf_tmp += vdb_width;
|
||||
@@ -148,16 +148,16 @@ void lv_vfill(const area_t * cords_p, const area_t * mask_p,
|
||||
* @param color color of letter
|
||||
* @param opa opacity of letter (0..255)
|
||||
*/
|
||||
void lv_vletter(const point_t * pos_p, const area_t * mask_p,
|
||||
const font_t * font_p, uint32_t letter,
|
||||
color_t color, opa_t opa)
|
||||
void lv_vletter(const lv_point_t * pos_p, const lv_area_t * mask_p,
|
||||
const lv_font_t * font_p, uint32_t letter,
|
||||
lv_color_t color, lv_opa_t opa)
|
||||
{
|
||||
if(font_p == NULL) return;
|
||||
|
||||
uint8_t letter_w = font_get_width(font_p, letter);
|
||||
uint8_t letter_h = font_get_height(font_p);
|
||||
uint8_t letter_w = lv_font_get_width(font_p, letter);
|
||||
uint8_t letter_h = lv_font_get_height(font_p);
|
||||
|
||||
const uint8_t * map_p = font_get_bitmap(font_p, letter);
|
||||
const uint8_t * map_p = lv_font_get_bitmap(font_p, letter);
|
||||
|
||||
if(map_p == NULL) return;
|
||||
|
||||
@@ -166,9 +166,9 @@ void lv_vletter(const point_t * pos_p, const area_t * mask_p,
|
||||
pos_p->y + letter_h < mask_p->y1 || pos_p->y > mask_p->y2) return;
|
||||
|
||||
lv_vdb_t * vdb_p = lv_vdb_get();
|
||||
cord_t vdb_width = area_get_width(&vdb_p->area);
|
||||
color_t * vdb_buf_tmp = vdb_p->buf;
|
||||
cord_t col, row;
|
||||
lv_coord_t vdb_width = area_get_width(&vdb_p->area);
|
||||
lv_color_t * vdb_buf_tmp = vdb_p->buf;
|
||||
lv_coord_t col, row;
|
||||
uint8_t col_bit;
|
||||
uint8_t col_byte_cnt;
|
||||
uint8_t width_byte = letter_w >> 3; /*Width in bytes (e.g. w = 11 -> 2 bytes wide)*/
|
||||
@@ -176,10 +176,10 @@ void lv_vletter(const point_t * pos_p, const area_t * mask_p,
|
||||
|
||||
/* Calculate the col/row start/end on the map
|
||||
* If font anti alaiassing is enabled use the reduced letter sizes*/
|
||||
cord_t col_start = pos_p->x > mask_p->x1 ? 0 : mask_p->x1 - pos_p->x;
|
||||
cord_t col_end = pos_p->x + (letter_w >> FONT_ANTIALIAS) < mask_p->x2 ? (letter_w >> FONT_ANTIALIAS) : mask_p->x2 - pos_p->x + 1;
|
||||
cord_t row_start = pos_p->y > mask_p->y1 ? 0 : mask_p->y1 - pos_p->y;
|
||||
cord_t row_end = pos_p->y + (letter_h >> FONT_ANTIALIAS) < mask_p->y2 ? (letter_h >> FONT_ANTIALIAS) : mask_p->y2 - pos_p->y + 1;
|
||||
lv_coord_t col_start = pos_p->x > mask_p->x1 ? 0 : mask_p->x1 - pos_p->x;
|
||||
lv_coord_t col_end = pos_p->x + (letter_w >> FONT_ANTIALIAS) < mask_p->x2 ? (letter_w >> FONT_ANTIALIAS) : mask_p->x2 - pos_p->x + 1;
|
||||
lv_coord_t row_start = pos_p->y > mask_p->y1 ? 0 : mask_p->y1 - pos_p->y;
|
||||
lv_coord_t row_end = pos_p->y + (letter_h >> FONT_ANTIALIAS) < mask_p->y2 ? (letter_h >> FONT_ANTIALIAS) : mask_p->y2 - pos_p->y + 1;
|
||||
|
||||
/*Set a pointer on VDB to the first pixel of the letter*/
|
||||
vdb_buf_tmp += ((pos_p->y - vdb_p->area.y1) * vdb_width)
|
||||
@@ -192,8 +192,8 @@ void lv_vletter(const point_t * pos_p, const area_t * mask_p,
|
||||
map_p += ((row_start << FONT_ANTIALIAS) * width_byte) + ((col_start << FONT_ANTIALIAS) >> 3);
|
||||
|
||||
#if FONT_ANTIALIAS != 0
|
||||
opa_t opa_tmp = opa;
|
||||
if(opa_tmp != OPA_COVER) opa_tmp = opa_tmp >> 2; /*Opacity per pixel (used when sum the pixels)*/
|
||||
lv_opa_t opa_tmp = opa;
|
||||
if(opa_tmp != LV_OPA_COVER) opa_tmp = opa_tmp >> 2; /*Opacity per pixel (used when sum the pixels)*/
|
||||
const uint8_t * map1_p = map_p;
|
||||
const uint8_t * map2_p = map_p + width_byte;
|
||||
uint8_t px_cnt;
|
||||
@@ -224,8 +224,8 @@ void lv_vletter(const point_t * pos_p, const area_t * mask_p,
|
||||
|
||||
|
||||
if(px_cnt != 0) {
|
||||
if(opa == OPA_COVER) *vdb_buf_tmp = color_mix(color, *vdb_buf_tmp, 63*px_cnt);
|
||||
else *vdb_buf_tmp = color_mix(color, *vdb_buf_tmp, opa_tmp * px_cnt);
|
||||
if(opa == LV_OPA_COVER) *vdb_buf_tmp = lv_color_mix(color, *vdb_buf_tmp, 63*px_cnt);
|
||||
else *vdb_buf_tmp = lv_color_mix(color, *vdb_buf_tmp, opa_tmp * px_cnt);
|
||||
}
|
||||
|
||||
vdb_buf_tmp++;
|
||||
@@ -244,8 +244,8 @@ void lv_vletter(const point_t * pos_p, const area_t * mask_p,
|
||||
for(col = col_start; col < col_end; col ++) {
|
||||
|
||||
if((*map_p & (1 << col_bit)) != 0) {
|
||||
if(opa == OPA_COVER) *vdb_buf_tmp = color;
|
||||
else *vdb_buf_tmp = color_mix(color, *vdb_buf_tmp, opa);
|
||||
if(opa == LV_OPA_COVER) *vdb_buf_tmp = color;
|
||||
else *vdb_buf_tmp = lv_color_mix(color, *vdb_buf_tmp, opa);
|
||||
}
|
||||
|
||||
vdb_buf_tmp++;
|
||||
@@ -268,25 +268,25 @@ void lv_vletter(const point_t * pos_p, const area_t * mask_p,
|
||||
* Draw a color map to the display
|
||||
* @param cords_p coordinates the color map
|
||||
* @param mask_p the map will drawn only on this area (truncated to VDB area)
|
||||
* @param map_p pointer to a color_t array
|
||||
* @param map_p pointer to a lv_color_t array
|
||||
* @param opa opacity of the map (ignored, only for compatibility with lv_vmap)
|
||||
* @param transp true: enable transparency of LV_IMG_COLOR_TRANSP color pixels
|
||||
* @param transp true: enable transparency of LV_IMG_LV_COLOR_TRANSP color pixels
|
||||
* @param upscale true: upscale to double size
|
||||
* @param recolor mix the pixels with this color
|
||||
* @param recolor_opa the intense of recoloring
|
||||
*/
|
||||
void lv_vmap(const area_t * cords_p, const area_t * mask_p,
|
||||
const color_t * map_p, opa_t opa, bool transp, bool upscale,
|
||||
color_t recolor, opa_t recolor_opa)
|
||||
void lv_vmap(const lv_area_t * cords_p, const lv_area_t * mask_p,
|
||||
const lv_color_t * map_p, lv_opa_t opa, bool transp, bool upscale,
|
||||
lv_color_t recolor, lv_opa_t recolor_opa)
|
||||
{
|
||||
area_t masked_a;
|
||||
lv_area_t masked_a;
|
||||
bool union_ok;
|
||||
lv_vdb_t * vdb_p = lv_vdb_get();
|
||||
|
||||
/*Get the union of map size and mask*/
|
||||
/* The mask is already truncated to the vdb size
|
||||
* in 'lv_refr_area_with_vdb' function */
|
||||
union_ok = area_union(&masked_a, cords_p, mask_p);
|
||||
union_ok = lv_area_union(&masked_a, cords_p, mask_p);
|
||||
|
||||
/*If there are common part of the three area then draw to the vdb*/
|
||||
if(union_ok == false) return;
|
||||
@@ -295,7 +295,7 @@ void lv_vmap(const area_t * cords_p, const area_t * mask_p,
|
||||
if(upscale != false) ds_shift = 1;
|
||||
|
||||
/*If the map starts OUT of the masked area then calc. the first pixel*/
|
||||
cord_t map_width = area_get_width(cords_p) >> ds_shift;
|
||||
lv_coord_t map_width = area_get_width(cords_p) >> ds_shift;
|
||||
if(cords_p->y1 < masked_a.y1) {
|
||||
map_p += (uint32_t) map_width * ((masked_a.y1 - cords_p->y1) >> ds_shift);
|
||||
}
|
||||
@@ -309,8 +309,8 @@ void lv_vmap(const area_t * cords_p, const area_t * mask_p,
|
||||
masked_a.x2 = masked_a.x2 - vdb_p->area.x1;
|
||||
masked_a.y2 = masked_a.y2 - vdb_p->area.y1;
|
||||
|
||||
cord_t vdb_width = area_get_width(&vdb_p->area);
|
||||
color_t * vdb_buf_tmp = vdb_p->buf;
|
||||
lv_coord_t vdb_width = area_get_width(&vdb_p->area);
|
||||
lv_color_t * vdb_buf_tmp = vdb_p->buf;
|
||||
vdb_buf_tmp += (uint32_t) vdb_width * masked_a.y1; /*Move to the first row*/
|
||||
|
||||
map_p -= (masked_a.x1 >> ds_shift); /*Move back. It will be easier to index 'map_p' later*/
|
||||
@@ -318,8 +318,8 @@ void lv_vmap(const area_t * cords_p, const area_t * mask_p,
|
||||
/*No upscalse*/
|
||||
if(upscale == false) {
|
||||
if(transp == false) { /*Simply copy the pixels to the VDB*/
|
||||
cord_t row;
|
||||
cord_t map_useful_w = area_get_width(&masked_a);
|
||||
lv_coord_t row;
|
||||
lv_coord_t map_useful_w = area_get_width(&masked_a);
|
||||
|
||||
for(row = masked_a.y1; row <= masked_a.y2; row++) {
|
||||
if(lv_disp_is_copy_supported() == false) {
|
||||
@@ -331,16 +331,16 @@ void lv_vmap(const area_t * cords_p, const area_t * mask_p,
|
||||
vdb_buf_tmp += vdb_width; /*Next row on the VDB*/
|
||||
}
|
||||
/*To recolor draw simply a rectangle above the image*/
|
||||
if(recolor_opa != OPA_TRANSP) {
|
||||
if(recolor_opa != LV_OPA_TRANSP) {
|
||||
lv_vfill(cords_p, mask_p, recolor, recolor_opa);
|
||||
}
|
||||
} else { /*transp == true: Check all pixels */
|
||||
cord_t row;
|
||||
cord_t col;
|
||||
color_t transp_color = LV_COLOR_TRANSP;
|
||||
lv_coord_t row;
|
||||
lv_coord_t col;
|
||||
lv_color_t transp_color = LV_LV_COLOR_TRANSP;
|
||||
|
||||
if(recolor_opa == OPA_TRANSP) {/*No recolor*/
|
||||
if(opa == OPA_COVER) { /*no opa */
|
||||
if(recolor_opa == LV_OPA_TRANSP) {/*No recolor*/
|
||||
if(opa == LV_OPA_COVER) { /*no opa */
|
||||
for(row = masked_a.y1; row <= masked_a.y2; row++) {
|
||||
for(col = masked_a.x1; col <= masked_a.x2; col ++) {
|
||||
if(map_p[col].full != transp_color.full) {
|
||||
@@ -355,7 +355,7 @@ void lv_vmap(const area_t * cords_p, const area_t * mask_p,
|
||||
for(row = masked_a.y1; row <= masked_a.y2; row++) {
|
||||
for(col = masked_a.x1; col <= masked_a.x2; col ++) {
|
||||
if(map_p[col].full != transp_color.full) {
|
||||
vdb_buf_tmp[col] = color_mix( map_p[col], vdb_buf_tmp[col], opa);
|
||||
vdb_buf_tmp[col] = lv_color_mix( map_p[col], vdb_buf_tmp[col], opa);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -364,13 +364,13 @@ void lv_vmap(const area_t * cords_p, const area_t * mask_p,
|
||||
}
|
||||
}
|
||||
} else { /*Recolor needed*/
|
||||
color_t color_tmp;
|
||||
if(opa == OPA_COVER) { /*no opa */
|
||||
lv_color_t lv_color_tmp;
|
||||
if(opa == LV_OPA_COVER) { /*no opa */
|
||||
for(row = masked_a.y1; row <= masked_a.y2; row++) {
|
||||
for(col = masked_a.x1; col <= masked_a.x2; col ++) {
|
||||
if(map_p[col].full != transp_color.full) {
|
||||
color_tmp = color_mix(recolor, map_p[col], recolor_opa);
|
||||
vdb_buf_tmp[col] = color_tmp;
|
||||
lv_color_tmp = lv_color_mix(recolor, map_p[col], recolor_opa);
|
||||
vdb_buf_tmp[col] = lv_color_tmp;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -381,8 +381,8 @@ void lv_vmap(const area_t * cords_p, const area_t * mask_p,
|
||||
for(row = masked_a.y1; row <= masked_a.y2; row++) {
|
||||
for(col = masked_a.x1; col <= masked_a.x2; col ++) {
|
||||
if(map_p[col].full != transp_color.full) {
|
||||
color_tmp = color_mix(recolor, map_p[col], recolor_opa);
|
||||
vdb_buf_tmp[col] = color_mix(color_tmp, vdb_buf_tmp[col], opa);
|
||||
lv_color_tmp = lv_color_mix(recolor, map_p[col], recolor_opa);
|
||||
vdb_buf_tmp[col] = lv_color_mix(lv_color_tmp, vdb_buf_tmp[col], opa);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -395,19 +395,19 @@ void lv_vmap(const area_t * cords_p, const area_t * mask_p,
|
||||
}
|
||||
/*Upscalse*/
|
||||
else {
|
||||
cord_t row;
|
||||
cord_t col;
|
||||
color_t transp_color = LV_COLOR_TRANSP;
|
||||
color_t color_tmp;
|
||||
color_t prev_color = COLOR_BLACK;
|
||||
cord_t map_col;
|
||||
lv_coord_t row;
|
||||
lv_coord_t col;
|
||||
lv_color_t transp_color = LV_LV_COLOR_TRANSP;
|
||||
lv_color_t lv_color_tmp;
|
||||
lv_color_t prev_color = LV_COLOR_BLACK;
|
||||
lv_coord_t map_col;
|
||||
|
||||
/*The most simple case (but upscale): 0 opacity, no recolor, no transp. pixels*/
|
||||
if(transp == false && opa == OPA_COVER && recolor_opa == OPA_TRANSP) {
|
||||
cord_t map_col_start = masked_a.x1 >> 1;
|
||||
cord_t map_col_end = masked_a.x2 >> 1;
|
||||
cord_t vdb_col; /*Col. in this row*/
|
||||
cord_t vdb_col2; /*Col. in next row*/
|
||||
if(transp == false && opa == LV_OPA_COVER && recolor_opa == LV_OPA_TRANSP) {
|
||||
lv_coord_t map_col_start = masked_a.x1 >> 1;
|
||||
lv_coord_t map_col_end = masked_a.x2 >> 1;
|
||||
lv_coord_t vdb_col; /*Col. in this row*/
|
||||
lv_coord_t vdb_col2; /*Col. in next row*/
|
||||
for(row = masked_a.y1; row <= masked_a.y2; row += 2) {
|
||||
map_col_start = masked_a.x1 >> 1;
|
||||
map_col_end = masked_a.x2 >> 1;
|
||||
@@ -427,27 +427,27 @@ void lv_vmap(const area_t * cords_p, const area_t * mask_p,
|
||||
}
|
||||
/*Handle other cases*/
|
||||
else {
|
||||
color_tmp = color_mix(recolor, prev_color, recolor_opa);
|
||||
lv_color_tmp = lv_color_mix(recolor, prev_color, recolor_opa);
|
||||
for(row = masked_a.y1; row <= masked_a.y2; row++) {
|
||||
for(col = masked_a.x1; col <= masked_a.x2; col ++) {
|
||||
map_col = col >> 1;
|
||||
|
||||
/*Handle recoloring*/
|
||||
if(recolor_opa == OPA_TRANSP) {
|
||||
color_tmp.full = map_p[map_col].full;
|
||||
if(recolor_opa == LV_OPA_TRANSP) {
|
||||
lv_color_tmp.full = map_p[map_col].full;
|
||||
} else {
|
||||
if(map_p[map_col].full != prev_color.full) {
|
||||
prev_color.full = map_p[map_col].full;
|
||||
color_tmp = color_mix(recolor, prev_color, recolor_opa);
|
||||
lv_color_tmp = lv_color_mix(recolor, prev_color, recolor_opa);
|
||||
}
|
||||
}
|
||||
/*Put the NOT transparent pixels*/
|
||||
if(transp == false || map_p[map_col].full != transp_color.full) {
|
||||
/*Handle opacity*/
|
||||
if(opa == OPA_COVER) {
|
||||
vdb_buf_tmp[col] = color_tmp;
|
||||
if(opa == LV_OPA_COVER) {
|
||||
vdb_buf_tmp[col] = lv_color_tmp;
|
||||
} else {
|
||||
vdb_buf_tmp[col] = color_mix( color_tmp, vdb_buf_tmp[col], opa);
|
||||
vdb_buf_tmp[col] = lv_color_mix( lv_color_tmp, vdb_buf_tmp[col], opa);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -467,16 +467,16 @@ void lv_vmap(const area_t * cords_p, const area_t * mask_p,
|
||||
* @param dest a memory address. Copy 'src' here.
|
||||
* @param src pointer to pixel map. Copy it to 'dest'.
|
||||
* @param length number of pixels in 'src'
|
||||
* @param opa opacity (0, OPA_TRANSP: transparent ... 255, OPA_COVER, fully cover)
|
||||
* @param opa opacity (0, LV_OPA_TRANSP: transparent ... 255, LV_OPA_COVER, fully cover)
|
||||
*/
|
||||
static void sw_color_cpy(color_t * dest, const color_t * src, uint32_t length, opa_t opa)
|
||||
static void sw_color_cpy(lv_color_t * dest, const lv_color_t * src, uint32_t length, lv_opa_t opa)
|
||||
{
|
||||
if(opa == OPA_COVER) {
|
||||
memcpy(dest, src, length * sizeof(color_t));
|
||||
if(opa == LV_OPA_COVER) {
|
||||
memcpy(dest, src, length * sizeof(lv_color_t));
|
||||
} else {
|
||||
cord_t col;
|
||||
lv_coord_t col;
|
||||
for(col = 0; col < length; col++) {
|
||||
dest[col] = color_mix(src[col], dest[col], opa);
|
||||
dest[col] = lv_color_mix(src[col], dest[col], opa);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -487,24 +487,24 @@ static void sw_color_cpy(color_t * dest, const color_t * src, uint32_t length, o
|
||||
* @param mem a memory address. Considered to a rectangular window according to 'mem_area'
|
||||
* @param fill_area coordinates of an area to fill. Relative to 'mem_area'.
|
||||
* @param color fill color
|
||||
* @param opa opacity (0, OPA_TRANSP: transparent ... 255, OPA_COVER, fully cover)
|
||||
* @param opa opacity (0, LV_OPA_TRANSP: transparent ... 255, LV_OPA_COVER, fully cover)
|
||||
*/
|
||||
static void sw_color_fill(area_t * mem_area, color_t * mem, const area_t * fill_area, color_t color, opa_t opa)
|
||||
static void sw_color_fill(lv_area_t * mem_area, lv_color_t * mem, const lv_area_t * fill_area, lv_color_t color, lv_opa_t opa)
|
||||
{
|
||||
/*Set all row in vdb to the given color*/
|
||||
cord_t row;
|
||||
lv_coord_t row;
|
||||
uint32_t col;
|
||||
cord_t mem_width = area_get_width(mem_area);
|
||||
lv_coord_t mem_width = area_get_width(mem_area);
|
||||
|
||||
/*Run simpler function without opacity*/
|
||||
if(opa == OPA_COVER) {
|
||||
if(opa == LV_OPA_COVER) {
|
||||
/*Fill the first row with 'color'*/
|
||||
for(col = fill_area->x1; col <= fill_area->x2; col++) {
|
||||
mem[col] = color;
|
||||
}
|
||||
/*Copy the first row to all other rows*/
|
||||
color_t * mem_first = &mem[fill_area->x1];
|
||||
cord_t copy_size = (fill_area->x2 - fill_area->x1 + 1) * sizeof(color_t);
|
||||
lv_color_t * mem_first = &mem[fill_area->x1];
|
||||
lv_coord_t copy_size = (fill_area->x2 - fill_area->x1 + 1) * sizeof(lv_color_t);
|
||||
mem += mem_width;
|
||||
|
||||
for(row = fill_area->y1 + 1; row <= fill_area->y2; row++) {
|
||||
@@ -514,14 +514,14 @@ static void sw_color_fill(area_t * mem_area, color_t * mem, const area_t * fill_
|
||||
}
|
||||
/*Calculate with alpha too*/
|
||||
else {
|
||||
color_t bg_tmp = COLOR_BLACK;
|
||||
color_t opa_tmp = color_mix(color, bg_tmp, opa);
|
||||
lv_color_t bg_tmp = LV_COLOR_BLACK;
|
||||
lv_color_t opa_tmp = lv_color_mix(color, bg_tmp, opa);
|
||||
for(row = fill_area->y1; row <= fill_area->y2; row++) {
|
||||
for(col = fill_area->x1; col <= fill_area->x2; col++) {
|
||||
/*If the bg color changed recalculate the result color*/
|
||||
if(mem[col].full != bg_tmp.full) {
|
||||
bg_tmp = mem[col];
|
||||
opa_tmp = color_mix(color, bg_tmp, opa);
|
||||
opa_tmp = lv_color_mix(color, bg_tmp, opa);
|
||||
}
|
||||
mem[col] = opa_tmp;
|
||||
}
|
||||
|
||||
+11
-11
@@ -33,7 +33,7 @@ extern "C" {
|
||||
* GLOBAL PROTOTYPES
|
||||
**********************/
|
||||
|
||||
void lv_vpx(cord_t x, cord_t y, const area_t * mask_p, color_t color, opa_t opa);
|
||||
void lv_vpx(lv_coord_t x, lv_coord_t y, const lv_area_t * mask_p, lv_color_t color, lv_opa_t opa);
|
||||
/**
|
||||
* Fill an area in the Virtual Display Buffer
|
||||
* @param cords_p coordinates of the area to fill
|
||||
@@ -41,8 +41,8 @@ void lv_vpx(cord_t x, cord_t y, const area_t * mask_p, color_t color, opa_t opa)
|
||||
* @param color fill color
|
||||
* @param opa opacity of the area (0..255)
|
||||
*/
|
||||
void lv_vfill(const area_t * cords_p, const area_t * mask_p,
|
||||
color_t color, opa_t opa);
|
||||
void lv_vfill(const lv_area_t * cords_p, const lv_area_t * mask_p,
|
||||
lv_color_t color, lv_opa_t opa);
|
||||
|
||||
/**
|
||||
* Draw a letter in the Virtual Display Buffer
|
||||
@@ -53,24 +53,24 @@ void lv_vfill(const area_t * cords_p, const area_t * mask_p,
|
||||
* @param color color of letter
|
||||
* @param opa opacity of letter (0..255)
|
||||
*/
|
||||
void lv_vletter(const point_t * pos_p, const area_t * mask_p,
|
||||
const font_t * font_p, uint32_t letter,
|
||||
color_t color, opa_t opa);
|
||||
void lv_vletter(const lv_point_t * pos_p, const lv_area_t * mask_p,
|
||||
const lv_font_t * font_p, uint32_t letter,
|
||||
lv_color_t color, lv_opa_t opa);
|
||||
|
||||
/**
|
||||
* Draw a color map to the display
|
||||
* @param cords_p coordinates the color map
|
||||
* @param mask_p the map will drawn only on this area
|
||||
* @param map_p pointer to a color_t array
|
||||
* @param map_p pointer to a lv_color_t array
|
||||
* @param opa opacity of the map (ignored, only for compatibility with lv_vmap)
|
||||
* @param transp true: enable transparency of LV_IMG_COLOR_TRANSP color pixels
|
||||
* @param transp true: enable transparency of LV_IMG_LV_COLOR_TRANSP color pixels
|
||||
* @param upscale true: upscale to double size
|
||||
* @param recolor mix the pixels with this color
|
||||
* @param recolor_opa the intense of recoloring
|
||||
*/
|
||||
void lv_vmap(const area_t * cords_p, const area_t * mask_p,
|
||||
const color_t * map_p, opa_t opa, bool transp, bool upscale,
|
||||
color_t recolor, opa_t recolor_opa);
|
||||
void lv_vmap(const lv_area_t * cords_p, const lv_area_t * mask_p,
|
||||
const lv_color_t * map_p, lv_opa_t opa, bool transp, bool upscale,
|
||||
lv_color_t recolor, lv_opa_t recolor_opa);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ lv_disp_t * lv_disp_register(lv_disp_drv_t *driver)
|
||||
{
|
||||
lv_disp_t *node;
|
||||
|
||||
node = dm_alloc(sizeof(lv_disp_t));
|
||||
node = lv_mem_alloc(sizeof(lv_disp_t));
|
||||
if (!node) return NULL;
|
||||
|
||||
memcpy(&node->driver,driver, sizeof(lv_disp_drv_t));
|
||||
@@ -109,7 +109,7 @@ lv_disp_t * lv_disp_next(lv_disp_t * disp)
|
||||
* @param y2 bottom coordinate of the rectangle
|
||||
* @param color fill color
|
||||
*/
|
||||
void lv_disp_fill(int32_t x1, int32_t y1, int32_t x2, int32_t y2, color_t color)
|
||||
void lv_disp_fill(int32_t x1, int32_t y1, int32_t x2, int32_t y2, lv_color_t color)
|
||||
{
|
||||
if(active == NULL) return;
|
||||
if(active->driver.fill != NULL) active->driver.fill(x1, y1, x2, y2, color);
|
||||
@@ -123,7 +123,7 @@ void lv_disp_fill(int32_t x1, int32_t y1, int32_t x2, int32_t y2, color_t color)
|
||||
* @param y2 bottom coordinate of the rectangle
|
||||
* @param color_map pointer to an array of colors
|
||||
*/
|
||||
void lv_disp_map(int32_t x1, int32_t y1, int32_t x2, int32_t y2, const color_t * color_map)
|
||||
void lv_disp_map(int32_t x1, int32_t y1, int32_t x2, int32_t y2, const lv_color_t * color_map)
|
||||
{
|
||||
if(active == NULL) return;
|
||||
if(active->driver.map != NULL) active->driver.map(x1, y1, x2, y2, color_map);
|
||||
@@ -136,9 +136,9 @@ void lv_disp_map(int32_t x1, int32_t y1, int32_t x2, int32_t y2, const color_t *
|
||||
* @param dest a memory address. Copy 'src' here.
|
||||
* @param src pointer to pixel map. Copy it to 'dest'.
|
||||
* @param length number of pixels in 'src'
|
||||
* @param opa opacity (0, OPA_TRANSP: transparent ... 255, OPA_COVER, fully cover)
|
||||
* @param opa opacity (0, LV_OPA_TRANSP: transparent ... 255, LV_OPA_COVER, fully cover)
|
||||
*/
|
||||
void lv_disp_copy(color_t * dest, const color_t * src, uint32_t length, opa_t opa)
|
||||
void lv_disp_copy(lv_color_t * dest, const lv_color_t * src, uint32_t length, lv_opa_t opa)
|
||||
{
|
||||
if(active == NULL) return;
|
||||
if(active->driver.copy != NULL) active->driver.copy(dest, src, length, opa);
|
||||
|
||||
@@ -32,9 +32,9 @@ extern "C" {
|
||||
* Display Driver structure to be registered by HAL
|
||||
*/
|
||||
typedef struct _disp_drv_t {
|
||||
void (*fill)(int32_t x1, int32_t y1, int32_t x2, int32_t y2, color_t color);
|
||||
void (*map)(int32_t x1, int32_t y1, int32_t x2, int32_t y2, const color_t * color_p);
|
||||
void (*copy)(color_t * dest, const color_t * src, uint32_t length, opa_t opa);
|
||||
void (*fill)(int32_t x1, int32_t y1, int32_t x2, int32_t y2, lv_color_t color);
|
||||
void (*map)(int32_t x1, int32_t y1, int32_t x2, int32_t y2, const lv_color_t * color_p);
|
||||
void (*copy)(lv_color_t * dest, const lv_color_t * src, uint32_t length, lv_opa_t opa);
|
||||
} lv_disp_drv_t;
|
||||
|
||||
typedef struct _disp_t {
|
||||
@@ -82,7 +82,7 @@ lv_disp_t * lv_disp_next(lv_disp_t * disp);
|
||||
* @param y2 bottom coordinate of the rectangle
|
||||
* @param color fill color
|
||||
*/
|
||||
void lv_disp_fill(int32_t x1, int32_t y1, int32_t x2, int32_t y2, color_t color);
|
||||
void lv_disp_fill(int32_t x1, int32_t y1, int32_t x2, int32_t y2, lv_color_t color);
|
||||
|
||||
/**
|
||||
* Put a color map to a rectangular area on the active display
|
||||
@@ -92,7 +92,7 @@ void lv_disp_fill(int32_t x1, int32_t y1, int32_t x2, int32_t y2, color_t color)
|
||||
* @param y2 bottom coordinate of the rectangle
|
||||
* @param color_map pointer to an array of colors
|
||||
*/
|
||||
void lv_disp_map(int32_t x1, int32_t y1, int32_t x2, int32_t y2, const color_t * color_map);
|
||||
void lv_disp_map(int32_t x1, int32_t y1, int32_t x2, int32_t y2, const lv_color_t * color_map);
|
||||
|
||||
/**
|
||||
* Copy pixels to a destination memory applying opacity
|
||||
@@ -100,9 +100,9 @@ void lv_disp_map(int32_t x1, int32_t y1, int32_t x2, int32_t y2, const color_t *
|
||||
* @param dest a memory address. Copy 'src' here.
|
||||
* @param src pointer to pixel map. Copy it to 'dest'.
|
||||
* @param length number of pixels in 'src'
|
||||
* @param opa opacity (0, OPA_TRANSP: transparent ... 255, OPA_COVER, fully cover)
|
||||
* @param opa opacity (0, LV_OPA_TRANSP: transparent ... 255, LV_OPA_COVER, fully cover)
|
||||
*/
|
||||
void lv_disp_copy(color_t * dest, const color_t * src, uint32_t length, opa_t opa);
|
||||
void lv_disp_copy(lv_color_t * dest, const lv_color_t * src, uint32_t length, lv_opa_t opa);
|
||||
|
||||
/**
|
||||
* Shows if 'copy' is supported or not
|
||||
|
||||
@@ -45,7 +45,7 @@ lv_indev_t * lv_indev_register(lv_indev_drv_t *driver)
|
||||
{
|
||||
lv_indev_t *node;
|
||||
|
||||
node = dm_alloc(sizeof(lv_indev_t));
|
||||
node = lv_mem_alloc(sizeof(lv_indev_t));
|
||||
if (!node) return NULL;
|
||||
|
||||
memcpy(&node->driver, driver, sizeof(lv_indev_drv_t));
|
||||
|
||||
@@ -45,7 +45,7 @@ typedef enum {
|
||||
/*Data type when an input device is read */
|
||||
typedef struct {
|
||||
union {
|
||||
point_t point; /*For INDEV_TYPE_TOUCHPAD, INDEV_TYPE_POINTER, LV_INDEV_TYPE_BUTTON*/
|
||||
lv_point_t point; /*For INDEV_TYPE_TOUCHPAD, INDEV_TYPE_POINTER, LV_INDEV_TYPE_BUTTON*/
|
||||
uint32_t key; /*For INDEV_TYPE_KEYPAD*/
|
||||
};
|
||||
lv_indev_event_t state; /*LV_INDEV_EVENT_REL or LV_INDEV_EVENT_PR*/
|
||||
@@ -63,10 +63,10 @@ typedef struct _lv_indev_state_t {
|
||||
lv_indev_event_t event;
|
||||
union {
|
||||
struct {
|
||||
point_t act_point;
|
||||
point_t last_point;
|
||||
point_t vect;
|
||||
point_t drag_sum; /*Count the dragged pixels to check LV_INDEV_DRAG_LIMIT*/
|
||||
lv_point_t act_point;
|
||||
lv_point_t last_point;
|
||||
lv_point_t vect;
|
||||
lv_point_t drag_sum; /*Count the dragged pixels to check LV_INDEV_DRAG_LIMIT*/
|
||||
struct _lv_obj_t * act_obj;
|
||||
struct _lv_obj_t * last_obj;
|
||||
|
||||
|
||||
+33
-31
@@ -7,11 +7,13 @@
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include "misc_conf.h"
|
||||
#include "../lv_misc/lv_task.h"
|
||||
#include "lv_anim.h"
|
||||
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "lv_task.h"
|
||||
#include "lv_anim.h"
|
||||
|
||||
#if USE_ANIM != 0
|
||||
#include "lv_math.h"
|
||||
#include MISC_SYSTICK_INCLUDE
|
||||
@@ -32,7 +34,7 @@
|
||||
* STATIC PROTOTYPES
|
||||
**********************/
|
||||
static void anim_task (void * param);
|
||||
static bool anim_ready_handler(anim_t * a);
|
||||
static bool anim_ready_handler(lv_anim_t * a);
|
||||
|
||||
/**********************
|
||||
* STATIC VARIABLES
|
||||
@@ -41,13 +43,13 @@ static ll_dsc_t anim_ll;
|
||||
static uint32_t last_task_run;
|
||||
static bool anim_del_global_flag = false;
|
||||
|
||||
static anim_path_t anim_path_lin[] =
|
||||
static lv_anim_path_t anim_path_lin[] =
|
||||
{64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
|
||||
96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
|
||||
128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
|
||||
160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192};
|
||||
|
||||
static anim_path_t anim_path_step[] =
|
||||
static lv_anim_path_t anim_path_step[] =
|
||||
{64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
|
||||
64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
|
||||
64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
|
||||
@@ -64,9 +66,9 @@ static anim_path_t anim_path_step[] =
|
||||
/**
|
||||
* Init. the animation module
|
||||
*/
|
||||
void anim_init(void)
|
||||
void lv_anim_init(void)
|
||||
{
|
||||
ll_init(&anim_ll, sizeof(anim_t));
|
||||
ll_init(&anim_ll, sizeof(lv_anim_t));
|
||||
last_task_run = MISC_SYSTICK_GET();
|
||||
ptask_create(anim_task, ANIM_REFR_PERIOD, PTASK_PRIO_MID, NULL);
|
||||
}
|
||||
@@ -75,18 +77,18 @@ void anim_init(void)
|
||||
* Create an animation
|
||||
* @param anim_p an initialized 'anim_t' variable. Not required after call.
|
||||
*/
|
||||
void anim_create(anim_t * anim_p)
|
||||
void lv_anim_create(lv_anim_t * anim_p)
|
||||
{
|
||||
/* Do not let two animations for the same 'var' with the same 'fp'*/
|
||||
if(anim_p->fp != NULL) anim_del(anim_p->var, anim_p->fp); /*fp == NULL would delete all animations of var*/
|
||||
if(anim_p->fp != NULL) lv_anim_del(anim_p->var, anim_p->fp); /*fp == NULL would delete all animations of var*/
|
||||
|
||||
/*Add the new animation to the animation linked list*/
|
||||
anim_t * new_anim = ll_ins_head(&anim_ll);
|
||||
lv_anim_t * new_anim = ll_ins_head(&anim_ll);
|
||||
dm_assert(new_anim);
|
||||
|
||||
/*Initialize the animation descriptor*/
|
||||
anim_p->playback_now = 0;
|
||||
memcpy(new_anim, anim_p, sizeof(anim_t));
|
||||
memcpy(new_anim, anim_p, sizeof(lv_anim_t));
|
||||
|
||||
/*Set the start value*/
|
||||
if(new_anim->fp != NULL) new_anim->fp(new_anim->var, new_anim->start);
|
||||
@@ -99,11 +101,11 @@ void anim_create(anim_t * anim_p)
|
||||
* or NULL to delete all animations of 'var'
|
||||
* @return true: at least 1 animation is deleted, false: no animation is deleted
|
||||
*/
|
||||
bool anim_del(void * var, anim_fp_t fp)
|
||||
bool lv_anim_del(void * var, lv_anim_fp_t fp)
|
||||
{
|
||||
bool del = false;
|
||||
anim_t * a;
|
||||
anim_t * a_next;
|
||||
lv_anim_t * a;
|
||||
lv_anim_t * a_next;
|
||||
a = ll_get_head(&anim_ll);
|
||||
while(a != NULL) {
|
||||
/*'a' might be deleted, so get the next object while 'a' is valid*/
|
||||
@@ -111,7 +113,7 @@ bool anim_del(void * var, anim_fp_t fp)
|
||||
|
||||
if(a->var == var && (a->fp == fp || fp == NULL)) {
|
||||
ll_rem(&anim_ll, a);
|
||||
dm_free(a);
|
||||
lv_mem_free(a);
|
||||
del = true;
|
||||
anim_del_global_flag = true;
|
||||
}
|
||||
@@ -129,7 +131,7 @@ bool anim_del(void * var, anim_fp_t fp)
|
||||
* @param end end value of the animation
|
||||
* @return the required time [ms] for the animation with the given parameters
|
||||
*/
|
||||
uint16_t anim_speed_to_time(uint16_t speed, int32_t start, int32_t end)
|
||||
uint16_t lv_anim_speed_to_time(uint16_t speed, int32_t start, int32_t end)
|
||||
{
|
||||
int32_t d = MATH_ABS((int32_t) start - end);
|
||||
uint16_t time = (int32_t)((int32_t)(d * 1000) / speed);
|
||||
@@ -146,13 +148,13 @@ uint16_t anim_speed_to_time(uint16_t speed, int32_t start, int32_t end)
|
||||
* @param name name of the path from 'anim_path_name_t'
|
||||
* @return pointer to the path array
|
||||
*/
|
||||
anim_path_t * anim_get_path(anim_path_name_t name)
|
||||
lv_anim_path_t * lv_anim_get_path(lv_anim_path_name_t name)
|
||||
{
|
||||
switch (name) {
|
||||
case ANIM_PATH_LIN:
|
||||
case LV_ANIM_PATH_LIN:
|
||||
return anim_path_lin;
|
||||
break;
|
||||
case ANIM_PATH_STEP:
|
||||
case LV_ANIM_PATH_STEP:
|
||||
return anim_path_step;
|
||||
break;
|
||||
default:
|
||||
@@ -173,8 +175,8 @@ static void anim_task (void * param)
|
||||
volatile uint32_t elaps;
|
||||
elaps = MISC_SYSTICK_ELAPS(last_task_run);
|
||||
|
||||
anim_t * a;
|
||||
anim_t * a_next;
|
||||
lv_anim_t * a;
|
||||
lv_anim_t * a_next;
|
||||
a = ll_get_head(&anim_ll);
|
||||
while(a != NULL) {
|
||||
/*'a' might be deleted, so get the next object while 'a' is valid*/
|
||||
@@ -222,7 +224,7 @@ static void anim_task (void * param)
|
||||
* @param a pointer to an animation descriptor
|
||||
* @return true: animation delete occurred
|
||||
* */
|
||||
static bool anim_ready_handler(anim_t * a)
|
||||
static bool anim_ready_handler(lv_anim_t * a)
|
||||
{
|
||||
bool invalid = false;
|
||||
|
||||
@@ -234,7 +236,7 @@ static bool anim_ready_handler(anim_t * a)
|
||||
void (*cb) (void *) = a->end_cb;
|
||||
void * p = a->var;
|
||||
ll_rem(&anim_ll, a);
|
||||
dm_free(a);
|
||||
lv_mem_free(a);
|
||||
|
||||
/*Call the callback function at the end*/
|
||||
/* Check if an animation is deleted in the cb function
|
||||
@@ -275,7 +277,7 @@ static void anim_dummy_handler(void * anim_dm);
|
||||
* Create an animation. Immediately set to end value
|
||||
* @param anim_p an initialized 'anim_t' variable. Not required after call.
|
||||
*/
|
||||
void anim_create(anim_t * anim_p)
|
||||
void lv_anim_create(lv_anim_t * anim_p)
|
||||
{
|
||||
|
||||
/*If no delay simply set the end value end call the callback */
|
||||
@@ -287,8 +289,8 @@ void anim_create(anim_t * anim_p)
|
||||
else {
|
||||
#if USE_DYN_MEM != 0 && USE_PTASK != 0
|
||||
if(anim_p->fp != NULL) anim_p->fp(anim_p->var, anim_p->start);
|
||||
void * anim_dm = dm_alloc(sizeof(anim_t));
|
||||
memcpy(anim_dm, anim_p, sizeof(anim_t));
|
||||
void * anim_dm = dm_alloc(sizeof(lv_anim_t));
|
||||
memcpy(anim_dm, anim_p, sizeof(lv_anim_t));
|
||||
ptask_t * ptask = ptask_create(anim_dummy_handler, -anim_p->act_time, PTASK_PRIO_LOW, anim_dm);
|
||||
ptask_once(ptask);
|
||||
#else
|
||||
@@ -305,7 +307,7 @@ void anim_create(anim_t * anim_p)
|
||||
* or NULL to ignore it and delete all animation with 'var
|
||||
* @return true: at least 1 animation is deleted, false: no animation is deleted
|
||||
*/
|
||||
bool anim_del(void * var, anim_fp_t fp)
|
||||
bool lv_anim_del(void * var, lv_anim_fp_t fp)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -317,7 +319,7 @@ bool anim_del(void * var, anim_fp_t fp)
|
||||
* @param end end value of the animation
|
||||
* @return the required time [ms] for the animation with the given parameters
|
||||
*/
|
||||
uint16_t anim_speed_to_time(uint16_t speed, int32_t start, int32_t end)
|
||||
uint16_t lv_anim_speed_to_time(uint16_t speed, int32_t start, int32_t end)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
@@ -327,7 +329,7 @@ uint16_t anim_speed_to_time(uint16_t speed, int32_t start, int32_t end)
|
||||
* @param name name of the path from 'anim_path_name_t'
|
||||
* @return pointer to the path array
|
||||
*/
|
||||
anim_path_t * anim_get_path(anim_path_name_t name)
|
||||
lv_anim_path_t * lv_anim_get_path(lv_anim_path_name_t name)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
@@ -340,12 +342,12 @@ anim_path_t * anim_get_path(anim_path_name_t name)
|
||||
*/
|
||||
static void anim_dummy_handler(void * anim_dm)
|
||||
{
|
||||
anim_t * anim = anim_dm;
|
||||
lv_anim_t * anim = anim_dm;
|
||||
|
||||
if(anim->fp != NULL) anim->fp(anim->var, anim->end);
|
||||
if(anim->end_cb != NULL) anim->end_cb(anim->var);
|
||||
|
||||
dm_free(anim_dm);
|
||||
lv_mem_free(anim_dm);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
+16
-16
@@ -30,21 +30,21 @@ extern "C" {
|
||||
|
||||
typedef enum
|
||||
{
|
||||
ANIM_PATH_LIN,
|
||||
ANIM_PATH_STEP,
|
||||
}anim_path_name_t;
|
||||
LV_ANIM_PATH_LIN,
|
||||
LV_ANIM_PATH_STEP,
|
||||
}lv_anim_path_name_t;
|
||||
|
||||
typedef uint8_t anim_path_t;
|
||||
typedef uint8_t lv_anim_path_t;
|
||||
|
||||
typedef void (*anim_fp_t)(void *, int32_t);
|
||||
typedef void (*anim_cb_t)(void *);
|
||||
typedef void (*lv_anim_fp_t)(void *, int32_t);
|
||||
typedef void (*lv_anim_cb_t)(void *);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
void * var; /*Variable to animate*/
|
||||
anim_fp_t fp; /*Animator function*/
|
||||
anim_cb_t end_cb; /*Call it when the animation is ready*/
|
||||
anim_path_t * path; /*An array with the steps of animations*/
|
||||
lv_anim_fp_t fp; /*Animator function*/
|
||||
lv_anim_cb_t end_cb; /*Call it when the animation is ready*/
|
||||
lv_anim_path_t * path; /*An array with the steps of animations*/
|
||||
int32_t start; /*Start value*/
|
||||
int32_t end; /*End value*/
|
||||
int16_t time; /*Animation time in ms*/
|
||||
@@ -55,10 +55,10 @@ typedef struct
|
||||
uint8_t repeat :1; /*Repeat the animation infinitely*/
|
||||
/*Animation system use these - user shouldn't set*/
|
||||
uint8_t playback_now :1; /*Play back is in progress*/
|
||||
}anim_t;
|
||||
}lv_anim_t;
|
||||
|
||||
/*Example initialization
|
||||
anim_t a;
|
||||
lv_anim_t a;
|
||||
a.var = obj;
|
||||
a.start = lv_obj_get_height(obj);
|
||||
a.end = new_height;
|
||||
@@ -79,13 +79,13 @@ a.repeat_pause = 0;
|
||||
/**
|
||||
* Init. the animation module
|
||||
*/
|
||||
void anim_init(void);
|
||||
void lv_anim_init(void);
|
||||
|
||||
/**
|
||||
* Create an animation
|
||||
* @param anim_p an initialized 'anim_t' variable. Not required after call.
|
||||
*/
|
||||
void anim_create(anim_t * anim_p);
|
||||
void lv_anim_create(lv_anim_t * anim_p);
|
||||
|
||||
/**
|
||||
* Delete an animation for a variable with a given animatior function
|
||||
@@ -94,7 +94,7 @@ void anim_create(anim_t * anim_p);
|
||||
* or NULL to ignore it and delete all animation with 'var
|
||||
* @return true: at least 1 animation is deleted, false: no animation is deleted
|
||||
*/
|
||||
bool anim_del(void * var, anim_fp_t fp);
|
||||
bool lv_anim_del(void * var, lv_anim_fp_t fp);
|
||||
|
||||
/**
|
||||
* Calculate the time of an animation with a given speed and the start and end values
|
||||
@@ -103,14 +103,14 @@ bool anim_del(void * var, anim_fp_t fp);
|
||||
* @param end end value of the animation
|
||||
* @return the required time [ms] for the animation with the given parameters
|
||||
*/
|
||||
uint16_t anim_speed_to_time(uint16_t speed, int32_t start, int32_t end);
|
||||
uint16_t lv_anim_speed_to_time(uint16_t speed, int32_t start, int32_t end);
|
||||
|
||||
/**
|
||||
* Get a predefine animation path
|
||||
* @param name name of the path from 'anim_path_name_t'
|
||||
* @return pointer to the path array
|
||||
*/
|
||||
anim_path_t * anim_get_path(anim_path_name_t name);
|
||||
lv_anim_path_t * lv_anim_get_path(lv_anim_path_name_t name);
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
|
||||
+22
-25
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @file 2d.c
|
||||
* @file lv_area.c
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include "misc_conf.h"
|
||||
#if USE_AREA != 0
|
||||
|
||||
#include "lv_area.h"
|
||||
#include "lv_math.h"
|
||||
@@ -44,7 +43,7 @@
|
||||
* @param x2 right coordinate of the area
|
||||
* @param y2 bottom coordinate of the area
|
||||
*/
|
||||
void area_set(area_t * area_p, cord_t x1, cord_t y1, cord_t x2, cord_t y2)
|
||||
void lv_area_set(lv_area_t * area_p, lv_coord_t x1, lv_coord_t y1, lv_coord_t x2, lv_coord_t y2)
|
||||
{
|
||||
area_p->x1 = x1;
|
||||
area_p->y1 = y1;
|
||||
@@ -57,7 +56,7 @@ void area_set(area_t * area_p, cord_t x1, cord_t y1, cord_t x2, cord_t y2)
|
||||
* @param area_p pointer to an area
|
||||
* @param w the new width of the area (w == 1 makes x1 == x2)
|
||||
*/
|
||||
void area_set_width(area_t * area_p, cord_t w)
|
||||
void lv_area_set_width(lv_area_t * area_p, lv_coord_t w)
|
||||
{
|
||||
area_p->x2 = area_p->x1 + w - 1;
|
||||
}
|
||||
@@ -67,7 +66,7 @@ void area_set_width(area_t * area_p, cord_t w)
|
||||
* @param area_p pointer to an area
|
||||
* @param h the new height of the area (h == 1 makes y1 == y2)
|
||||
*/
|
||||
void area_set_height(area_t * area_p, cord_t h)
|
||||
void lv_area_set_height(lv_area_t * area_p, lv_coord_t h)
|
||||
{
|
||||
area_p->y2 = area_p->y1 + h - 1;
|
||||
}
|
||||
@@ -78,14 +77,14 @@ void area_set_height(area_t * area_p, cord_t h)
|
||||
* @param x the new x coordinate of the area
|
||||
* @param y the new y coordinate of the area
|
||||
*/
|
||||
void area_set_pos(area_t * area_p, cord_t x, cord_t y)
|
||||
void lv_area_set_pos(lv_area_t * area_p, lv_coord_t x, lv_coord_t y)
|
||||
{
|
||||
cord_t w = area_get_width(area_p);
|
||||
cord_t h = area_get_height(area_p);
|
||||
lv_coord_t w = area_get_width(area_p);
|
||||
lv_coord_t h = area_get_height(area_p);
|
||||
area_p->x1 = x;
|
||||
area_p->y1 = y;
|
||||
area_set_width(area_p, w);
|
||||
area_set_height(area_p, h);
|
||||
lv_area_set_width(area_p, w);
|
||||
lv_area_set_height(area_p, h);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -93,7 +92,7 @@ void area_set_pos(area_t * area_p, cord_t x, cord_t y)
|
||||
* @param area_p pointer to an area
|
||||
* @return size of area
|
||||
*/
|
||||
uint32_t area_get_size(const area_t * area_p)
|
||||
uint32_t lv_area_get_size(const lv_area_t * area_p)
|
||||
{
|
||||
uint32_t size;
|
||||
|
||||
@@ -110,7 +109,7 @@ uint32_t area_get_size(const area_t * area_p)
|
||||
* @param a2_p pointer to the second area
|
||||
* @return false: the two area has NO common parts, res_p is invalid
|
||||
*/
|
||||
bool area_union(area_t * res_p, const area_t * a1_p, const area_t * a2_p)
|
||||
bool lv_area_union(lv_area_t * res_p, const lv_area_t * a1_p, const lv_area_t * a2_p)
|
||||
{
|
||||
/* Get the smaller area from 'a1_p' and 'a2_p' */
|
||||
res_p->x1 = MATH_MAX(a1_p->x1, a2_p->x1);
|
||||
@@ -134,7 +133,7 @@ bool area_union(area_t * res_p, const area_t * a1_p, const area_t * a2_p)
|
||||
* @param a1_p pointer to the first area
|
||||
* @param a2_p pointer to the second area
|
||||
*/
|
||||
void area_join(area_t * a_res_p, const area_t * a1_p, const area_t * a2_p)
|
||||
void lv_area_join(lv_area_t * a_res_p, const lv_area_t * a1_p, const lv_area_t * a2_p)
|
||||
{
|
||||
a_res_p->x1 = MATH_MIN(a1_p->x1, a2_p->x1);
|
||||
a_res_p->y1 = MATH_MIN(a1_p->y1, a2_p->y1);
|
||||
@@ -148,7 +147,7 @@ void area_join(area_t * a_res_p, const area_t * a1_p, const area_t * a2_p)
|
||||
* @param p_p pointer to a point
|
||||
* @return false:the point is out of the area
|
||||
*/
|
||||
bool area_is_point_on(const area_t * a_p, const point_t * p_p)
|
||||
bool lv_area_is_point_on(const lv_area_t * a_p, const lv_point_t * p_p)
|
||||
{
|
||||
bool is_on = false;
|
||||
|
||||
@@ -167,30 +166,30 @@ bool area_is_point_on(const area_t * a_p, const point_t * p_p)
|
||||
* @param a2_p pointer to an other area
|
||||
* @return false: a1_p and a2_p has no common parts
|
||||
*/
|
||||
bool area_is_on(const area_t * a1_p, const area_t * a2_p)
|
||||
bool lv_area_is_on(const lv_area_t * a1_p, const lv_area_t * a2_p)
|
||||
{
|
||||
/*Two area are on each other if... */
|
||||
|
||||
point_t p;
|
||||
lv_point_t p;
|
||||
/*a2 left-top corner is on a1*/
|
||||
p.x = a2_p->x1;
|
||||
p.y = a2_p->y1;
|
||||
if(area_is_point_on(a1_p, &p)) return true;
|
||||
if(lv_area_is_point_on(a1_p, &p)) return true;
|
||||
|
||||
/*a2 right-top corner is on a1*/
|
||||
p.x = a2_p->x1;
|
||||
p.y = a2_p->y1;
|
||||
if(area_is_point_on(a1_p, &p)) return true;
|
||||
if(lv_area_is_point_on(a1_p, &p)) return true;
|
||||
|
||||
/*a2 left-bottom corner is on a1*/
|
||||
p.x = a2_p->x1;
|
||||
p.y = a2_p->y2;
|
||||
if(area_is_point_on(a1_p, &p)) return true;
|
||||
if(lv_area_is_point_on(a1_p, &p)) return true;
|
||||
|
||||
/*a2 right-bottom corner is on a1*/
|
||||
p.x = a2_p->x2;
|
||||
p.y = a2_p->y2;
|
||||
if(area_is_point_on(a1_p, &p)) return true;
|
||||
if(lv_area_is_point_on(a1_p, &p)) return true;
|
||||
|
||||
/*a2 is horizontally bigger then a1 and covers it*/
|
||||
if((a2_p->x1 <= a1_p->x1 && a2_p->x2 >= a1_p->x2) && /*a2 hor. cover a1?*/
|
||||
@@ -212,11 +211,11 @@ bool area_is_on(const area_t * a1_p, const area_t * a2_p)
|
||||
|
||||
/**
|
||||
* Check if an area is fully on an other
|
||||
* @param ain_p pointer to an area which could be on aholder_p
|
||||
* @param aholder pointer to an area which could involve ain_p
|
||||
* @param ain_p pointer to an area which could be in 'aholder_p'
|
||||
* @param aholder pointer to an area which could involve 'ain_p'
|
||||
* @return
|
||||
*/
|
||||
bool area_is_in(const area_t * ain_p, const area_t * aholder_p)
|
||||
bool lv_area_is_in(const lv_area_t * ain_p, const lv_area_t * aholder_p)
|
||||
{
|
||||
bool is_in = false;
|
||||
|
||||
@@ -234,5 +233,3 @@ bool area_is_in(const area_t * ain_p, const area_t * aholder_p)
|
||||
/**********************
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
|
||||
#endif /*USE_AREA*/
|
||||
|
||||
+28
-28
@@ -1,10 +1,10 @@
|
||||
/**
|
||||
* @file area.h
|
||||
* @file lv_area.h
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef AREA_H
|
||||
#define AREA_H
|
||||
#ifndef LV_AREA_H
|
||||
#define LV_AREA_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -24,27 +24,27 @@ extern "C" {
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
#define CORD_MAX (16383) /*To avoid overflow don't let the max [-32,32k] range */
|
||||
#define CORD_MIN (-16384)
|
||||
#define LV_COORD_MAX (16383) /*To avoid overflow don't let the max [-32,32k] range */
|
||||
#define LV_COORD_MIN (-16384)
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
typedef int16_t cord_t;
|
||||
typedef int16_t lv_coord_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
cord_t x;
|
||||
cord_t y;
|
||||
}point_t;
|
||||
lv_coord_t x;
|
||||
lv_coord_t y;
|
||||
}lv_point_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
cord_t x1;
|
||||
cord_t y1;
|
||||
cord_t x2;
|
||||
cord_t y2;
|
||||
}area_t;
|
||||
lv_coord_t x1;
|
||||
lv_coord_t y1;
|
||||
lv_coord_t x2;
|
||||
lv_coord_t y2;
|
||||
}lv_area_t;
|
||||
|
||||
/**********************
|
||||
* GLOBAL PROTOTYPES
|
||||
@@ -58,16 +58,16 @@ typedef struct
|
||||
* @param x2 right coordinate of the area
|
||||
* @param y2 bottom coordinate of the area
|
||||
*/
|
||||
void area_set(area_t * area_p, cord_t x1, cord_t y1, cord_t x2, cord_t y2);
|
||||
void lv_area_set(lv_area_t * area_p, lv_coord_t x1, lv_coord_t y1, lv_coord_t x2, lv_coord_t y2);
|
||||
|
||||
/**
|
||||
* Copy an area
|
||||
* @param dest pointer to the destination area
|
||||
* @param src pointer to the source area
|
||||
*/
|
||||
static void inline area_cpy(area_t * dest, const area_t * src)
|
||||
static void inline area_cpy(lv_area_t * dest, const lv_area_t * src)
|
||||
{
|
||||
memcpy(dest, src, sizeof(area_t));
|
||||
memcpy(dest, src, sizeof(lv_area_t));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -75,7 +75,7 @@ static void inline area_cpy(area_t * dest, const area_t * src)
|
||||
* @param area_p pointer to an area
|
||||
* @return the width of the area (if x1 == x2 -> width = 1)
|
||||
*/
|
||||
static inline cord_t area_get_width(const area_t * area_p)
|
||||
static inline lv_coord_t area_get_width(const lv_area_t * area_p)
|
||||
{
|
||||
return area_p->x2 - area_p->x1 + 1;
|
||||
}
|
||||
@@ -85,7 +85,7 @@ static inline cord_t area_get_width(const area_t * area_p)
|
||||
* @param area_p pointer to an area
|
||||
* @return the height of the area (if y1 == y2 -> height = 1)
|
||||
*/
|
||||
static inline cord_t area_get_height(const area_t * area_p)
|
||||
static inline lv_coord_t area_get_height(const lv_area_t * area_p)
|
||||
{
|
||||
return area_p->y2 - area_p->y1 + 1;
|
||||
}
|
||||
@@ -95,14 +95,14 @@ static inline cord_t area_get_height(const area_t * area_p)
|
||||
* @param area_p pointer to an area
|
||||
* @param w the new width of the area (w == 1 makes x1 == x2)
|
||||
*/
|
||||
void area_set_width(area_t * area_p, cord_t w);
|
||||
void lv_area_set_width(lv_area_t * area_p, lv_coord_t w);
|
||||
|
||||
/**
|
||||
* Set the height of an area
|
||||
* @param area_p pointer to an area
|
||||
* @param h the new height of the area (h == 1 makes y1 == y2)
|
||||
*/
|
||||
void area_set_height(area_t * area_p, cord_t h);
|
||||
void lv_area_set_height(lv_area_t * area_p, lv_coord_t h);
|
||||
|
||||
/**
|
||||
* Set the position of an area (width and height will be kept)
|
||||
@@ -110,14 +110,14 @@ void area_set_height(area_t * area_p, cord_t h);
|
||||
* @param x the new x coordinate of the area
|
||||
* @param y the new y coordinate of the area
|
||||
*/
|
||||
void area_set_pos(area_t * area_p, cord_t x, cord_t y);
|
||||
void lv_area_set_pos(lv_area_t * area_p, lv_coord_t x, lv_coord_t y);
|
||||
|
||||
/**
|
||||
* Return with area of an area (x * y)
|
||||
* @param area_p pointer to an area
|
||||
* @return size of area
|
||||
*/
|
||||
uint32_t area_get_size(const area_t * area_p);
|
||||
uint32_t lv_area_get_size(const lv_area_t * area_p);
|
||||
|
||||
/**
|
||||
* Get the common parts of two areas
|
||||
@@ -126,7 +126,7 @@ uint32_t area_get_size(const area_t * area_p);
|
||||
* @param a2_p pointer to the second area
|
||||
* @return false: the two area has NO common parts, res_p is invalid
|
||||
*/
|
||||
bool area_union(area_t * res_p, const area_t * a1_p, const area_t * a2_p);
|
||||
bool lv_area_union(lv_area_t * res_p, const lv_area_t * a1_p, const lv_area_t * a2_p);
|
||||
|
||||
/**
|
||||
* Join two areas into a third which involves the other two
|
||||
@@ -134,7 +134,7 @@ bool area_union(area_t * res_p, const area_t * a1_p, const area_t * a2_p);
|
||||
* @param a1_p pointer to the first area
|
||||
* @param a2_p pointer to the second area
|
||||
*/
|
||||
void area_join(area_t * a_res_p, const area_t * a1_p, const area_t * a2_p);
|
||||
void lv_area_join(lv_area_t * a_res_p, const lv_area_t * a1_p, const lv_area_t * a2_p);
|
||||
|
||||
/**
|
||||
* Check if a point is on an area
|
||||
@@ -142,7 +142,7 @@ void area_join(area_t * a_res_p, const area_t * a1_p, const area_t * a2_p);
|
||||
* @param p_p pointer to a point
|
||||
* @return false:the point is out of the area
|
||||
*/
|
||||
bool area_is_point_on(const area_t * a_p, const point_t * p_p);
|
||||
bool lv_area_is_point_on(const lv_area_t * a_p, const lv_point_t * p_p);
|
||||
|
||||
/**
|
||||
* Check if two area has common parts
|
||||
@@ -150,7 +150,7 @@ bool area_is_point_on(const area_t * a_p, const point_t * p_p);
|
||||
* @param a2_p pointer to an other area
|
||||
* @return false: a1_p and a2_p has no common parts
|
||||
*/
|
||||
bool area_is_on(const area_t * a1_p, const area_t * a2_p);
|
||||
bool lv_area_is_on(const lv_area_t * a1_p, const lv_area_t * a2_p);
|
||||
|
||||
/**
|
||||
* Check if an area is fully on an other
|
||||
@@ -158,7 +158,7 @@ bool area_is_on(const area_t * a1_p, const area_t * a2_p);
|
||||
* @param aholder pointer to an area which could involve ain_p
|
||||
* @return
|
||||
*/
|
||||
bool area_is_in(const area_t * ain_p, const area_t * aholder_p);
|
||||
bool lv_area_is_in(const lv_area_t * ain_p, const lv_area_t * aholder_p);
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
|
||||
+4
-7
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @file circ.c
|
||||
* @file lv_circ.c
|
||||
* Circle drawing algorithm (with Bresenham)
|
||||
* Only a 1/8 circle is calculated. Use CIRC_OCT1_X, CIRC_OCT1_Y macros to get
|
||||
* the other octets.
|
||||
@@ -9,7 +9,6 @@
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include "misc_conf.h"
|
||||
#if USE_CIRC != 0
|
||||
|
||||
#include "lv_area.h"
|
||||
|
||||
@@ -43,7 +42,7 @@
|
||||
* @param tmp point to a variable. It will store temporary data
|
||||
* @param radius radius of the circle
|
||||
*/
|
||||
void circ_init(point_t * c, cord_t * tmp, cord_t radius)
|
||||
void lv_circ_init(lv_point_t * c, lv_coord_t * tmp, lv_coord_t radius)
|
||||
{
|
||||
c->x = radius;
|
||||
c->y = 0;
|
||||
@@ -55,7 +54,7 @@ void circ_init(point_t * c, cord_t * tmp, cord_t radius)
|
||||
* @param c same as in circ_init
|
||||
* @return true if the circle is not ready yet
|
||||
*/
|
||||
bool circ_cont(point_t * c)
|
||||
bool lv_circ_cont(lv_point_t * c)
|
||||
{
|
||||
return c->y <= c->x ? true : false;
|
||||
}
|
||||
@@ -65,7 +64,7 @@ bool circ_cont(point_t * c)
|
||||
* @param c same as in circ_init. The next point stored here.
|
||||
* @param tmp same as in circ_init.
|
||||
*/
|
||||
void circ_next(point_t * c, cord_t * tmp)
|
||||
void lv_circ_next(lv_point_t * c, lv_coord_t * tmp)
|
||||
{
|
||||
c->y++;
|
||||
|
||||
@@ -80,5 +79,3 @@ void circ_next(point_t * c, cord_t * tmp)
|
||||
/**********************
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
#endif /*USE_CIRC*/
|
||||
|
||||
|
||||
+22
-22
@@ -1,10 +1,10 @@
|
||||
/**
|
||||
* @file circ.h
|
||||
* @file lv_circ.h
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef CIRC_H
|
||||
#define CIRC_H
|
||||
#ifndef LV_CIRC_H
|
||||
#define LV_CIRC_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -23,22 +23,22 @@ extern "C" {
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
#define CIRC_OCT1_X(p) (p.x)
|
||||
#define CIRC_OCT1_Y(p) (p.y)
|
||||
#define CIRC_OCT2_X(p) (p.y)
|
||||
#define CIRC_OCT2_Y(p) (p.x)
|
||||
#define CIRC_OCT3_X(p) (-p.y)
|
||||
#define CIRC_OCT3_Y(p) (p.x)
|
||||
#define CIRC_OCT4_X(p) (-p.x)
|
||||
#define CIRC_OCT4_Y(p) (p.y)
|
||||
#define CIRC_OCT5_X(p) (-p.x)
|
||||
#define CIRC_OCT5_Y(p) (-p.y)
|
||||
#define CIRC_OCT6_X(p) (-p.y)
|
||||
#define CIRC_OCT6_Y(p) (-p.x)
|
||||
#define CIRC_OCT7_X(p) (p.y)
|
||||
#define CIRC_OCT7_Y(p) (-p.x)
|
||||
#define CIRC_OCT8_X(p) (p.x)
|
||||
#define CIRC_OCT8_Y(p) (-p.y)
|
||||
#define LV_CIRC_OCT1_X(p) (p.x)
|
||||
#define LV_CIRC_OCT1_Y(p) (p.y)
|
||||
#define LV_CIRC_OCT2_X(p) (p.y)
|
||||
#define LV_CIRC_OCT2_Y(p) (p.x)
|
||||
#define LV_CIRC_OCT3_X(p) (-p.y)
|
||||
#define LV_CIRC_OCT3_Y(p) (p.x)
|
||||
#define LV_CIRC_OCT4_X(p) (-p.x)
|
||||
#define LV_CIRC_OCT4_Y(p) (p.y)
|
||||
#define LV_CIRC_OCT5_X(p) (-p.x)
|
||||
#define LV_CIRC_OCT5_Y(p) (-p.y)
|
||||
#define LV_CIRC_OCT6_X(p) (-p.y)
|
||||
#define LV_CIRC_OCT6_Y(p) (-p.x)
|
||||
#define LV_CIRC_OCT7_X(p) (p.y)
|
||||
#define LV_CIRC_OCT7_Y(p) (-p.x)
|
||||
#define LV_CIRC_OCT8_X(p) (p.x)
|
||||
#define LV_CIRC_OCT8_Y(p) (-p.y)
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
@@ -54,21 +54,21 @@ extern "C" {
|
||||
* @param tmp point to a variable. It will store temporary data
|
||||
* @param radius radius of the circle
|
||||
*/
|
||||
void circ_init(point_t * c, cord_t * tmp, cord_t radius);
|
||||
void lv_circ_init(lv_point_t * c, lv_coord_t * tmp, lv_coord_t radius);
|
||||
|
||||
/**
|
||||
* Test the circle drawing is ready or not
|
||||
* @param c same as in circ_init
|
||||
* @return true if the circle is not ready yet
|
||||
*/
|
||||
bool circ_cont(point_t * c);
|
||||
bool lv_circ_cont(lv_point_t * c);
|
||||
|
||||
/**
|
||||
* Get the next point from the circle
|
||||
* @param c same as in circ_init. The next point stored here.
|
||||
* @param tmp same as in circ_init.
|
||||
*/
|
||||
void circ_next(point_t * c, cord_t * tmp);
|
||||
void lv_circ_next(lv_point_t * c, lv_coord_t * tmp);
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
|
||||
+7
-10
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @file color.c
|
||||
* @file lv_color.c
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include "lv_color.h"
|
||||
#if USE_COLOR != 0
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
@@ -42,9 +41,9 @@
|
||||
* @param h hue [0..359]
|
||||
* @param s saturation [0..100]
|
||||
* @param v value [0..100]
|
||||
* @return the given RGB color in RGB (with COLOR_DEPTH depth)
|
||||
* @return the given RGB color in RGB (with LV_COLOR_DEPTH depth)
|
||||
*/
|
||||
color_t color_hsv_to_rgb(uint16_t h, uint8_t s, uint8_t v)
|
||||
lv_color_t lv_color_hsv_to_rgb(uint16_t h, uint8_t s, uint8_t v)
|
||||
{
|
||||
h = (uint32_t)((uint32_t)h * 255) / 360;
|
||||
s = (uint16_t)((uint16_t)s * 255) / 100;
|
||||
@@ -59,7 +58,7 @@ color_t color_hsv_to_rgb(uint16_t h, uint8_t s, uint8_t v)
|
||||
r = v;
|
||||
g = v;
|
||||
b = v;
|
||||
return COLOR_MAKE(v, v, v);
|
||||
return LV_COLOR_MAKE(v, v, v);
|
||||
}
|
||||
|
||||
region = h / 43;
|
||||
@@ -91,7 +90,7 @@ color_t color_hsv_to_rgb(uint16_t h, uint8_t s, uint8_t v)
|
||||
break;
|
||||
}
|
||||
|
||||
color_t result = COLOR_MAKE(r, g, b);
|
||||
lv_color_t result = LV_COLOR_MAKE(r, g, b);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -102,9 +101,9 @@ color_t color_hsv_to_rgb(uint16_t h, uint8_t s, uint8_t v)
|
||||
* @param b blue
|
||||
* @return the given RGB color n HSV
|
||||
*/
|
||||
color_hsv_t color_rgb_to_hsv(uint8_t r, uint8_t g, uint8_t b)
|
||||
lv_color_hsv_t lv_color_rgb_to_hsv(uint8_t r, uint8_t g, uint8_t b)
|
||||
{
|
||||
color_hsv_t hsv;
|
||||
lv_color_hsv_t hsv;
|
||||
uint8_t rgbMin, rgbMax;
|
||||
|
||||
rgbMin = r < g ? (r < b ? r : b) : (g < b ? g : b);
|
||||
@@ -134,5 +133,3 @@ color_hsv_t color_rgb_to_hsv(uint8_t r, uint8_t g, uint8_t b)
|
||||
|
||||
return hsv;
|
||||
}
|
||||
|
||||
#endif /*USE_COLOR*/
|
||||
|
||||
+94
-97
@@ -1,10 +1,10 @@
|
||||
/**
|
||||
* @file color.h
|
||||
* @file lv_color.h
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef COLOR_H
|
||||
#define COLOR_H
|
||||
#ifndef LV_LV_COLOR_H
|
||||
#define LV_LV_COLOR_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -14,45 +14,44 @@ extern "C" {
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include "misc_conf.h"
|
||||
#if USE_COLOR != 0
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
#define COLOR_BLACK COLOR_MAKE(0x00,0x00,0x00)
|
||||
#define COLOR_WHITE COLOR_MAKE(0xFF,0xFF,0xFF)
|
||||
#define COLOR_RED COLOR_MAKE(0xFF,0x00,0x00)
|
||||
#define COLOR_LIME COLOR_MAKE(0x00,0xFF,0x00)
|
||||
#define COLOR_BLUE COLOR_MAKE(0x00,0x00,0xFF)
|
||||
#define COLOR_YELLOW COLOR_MAKE(0xFF,0xFF,0x00)
|
||||
#define COLOR_CYAN COLOR_MAKE(0x00,0xFF,0xFF)
|
||||
#define COLOR_AQUA COLOR_CYAN
|
||||
#define COLOR_MAGENTA COLOR_MAKE(0xFF,0x00,0xFF)
|
||||
#define COLOR_SILVER COLOR_MAKE(0xC0,0xC0,0xC0)
|
||||
#define COLOR_GRAY COLOR_MAKE(0x80,0x80,0x80)
|
||||
#define COLOR_MARRON COLOR_MAKE(0x80,0x00,0x00)
|
||||
#define COLOR_OLIVE COLOR_MAKE(0x80,0x80,0x00)
|
||||
#define COLOR_GREEN COLOR_MAKE(0x00,0x80,0x00)
|
||||
#define COLOR_PURPLE COLOR_MAKE(0x80,0x00,0x80)
|
||||
#define COLOR_TEAL COLOR_MAKE(0x00,0x80,0x80)
|
||||
#define COLOR_NAVY COLOR_MAKE(0x00,0x00,0x80)
|
||||
#define COLOR_ORANGE COLOR_MAKE(0xFF,0xA5,0x00)
|
||||
#define LV_COLOR_BLACK LV_COLOR_MAKE(0x00,0x00,0x00)
|
||||
#define LV_COLOR_WHITE LV_COLOR_MAKE(0xFF,0xFF,0xFF)
|
||||
#define LV_COLOR_RED LV_COLOR_MAKE(0xFF,0x00,0x00)
|
||||
#define LV_COLOR_LIME LV_COLOR_MAKE(0x00,0xFF,0x00)
|
||||
#define LV_COLOR_BLUE LV_COLOR_MAKE(0x00,0x00,0xFF)
|
||||
#define LV_COLOR_YELLOW LV_COLOR_MAKE(0xFF,0xFF,0x00)
|
||||
#define LV_COLOR_CYAN LV_COLOR_MAKE(0x00,0xFF,0xFF)
|
||||
#define LV_COLOR_AQUA LV_COLOR_CYAN
|
||||
#define LV_COLOR_MAGENTA LV_COLOR_MAKE(0xFF,0x00,0xFF)
|
||||
#define LV_COLOR_SILVER LV_COLOR_MAKE(0xC0,0xC0,0xC0)
|
||||
#define LV_COLOR_GRAY LV_COLOR_MAKE(0x80,0x80,0x80)
|
||||
#define LV_COLOR_MARRON LV_COLOR_MAKE(0x80,0x00,0x00)
|
||||
#define LV_COLOR_OLIVE LV_COLOR_MAKE(0x80,0x80,0x00)
|
||||
#define LV_COLOR_GREEN LV_COLOR_MAKE(0x00,0x80,0x00)
|
||||
#define LV_COLOR_PURPLE LV_COLOR_MAKE(0x80,0x00,0x80)
|
||||
#define LV_COLOR_TEAL LV_COLOR_MAKE(0x00,0x80,0x80)
|
||||
#define LV_COLOR_NAVY LV_COLOR_MAKE(0x00,0x00,0x80)
|
||||
#define LV_COLOR_ORANGE LV_COLOR_MAKE(0xFF,0xA5,0x00)
|
||||
|
||||
#define OPA_TRANSP 0
|
||||
#define OPA_0 0
|
||||
#define OPA_10 25
|
||||
#define OPA_20 51
|
||||
#define OPA_30 76
|
||||
#define OPA_40 102
|
||||
#define OPA_50 127
|
||||
#define OPA_60 153
|
||||
#define OPA_70 178
|
||||
#define OPA_80 204
|
||||
#define OPA_90 229
|
||||
#define OPA_100 255
|
||||
#define OPA_COVER 255
|
||||
#define LV_OPA_TRANSP 0
|
||||
#define LV_OPA_0 0
|
||||
#define LV_OPA_10 25
|
||||
#define LV_OPA_20 51
|
||||
#define LV_OPA_30 76
|
||||
#define LV_OPA_40 102
|
||||
#define LV_OPA_50 127
|
||||
#define LV_OPA_60 153
|
||||
#define LV_OPA_70 178
|
||||
#define LV_OPA_80 204
|
||||
#define LV_OPA_90 229
|
||||
#define LV_OPA_100 255
|
||||
#define LV_OPA_COVER 255
|
||||
|
||||
|
||||
/**********************
|
||||
@@ -65,7 +64,7 @@ typedef union
|
||||
uint8_t green :1;
|
||||
uint8_t red :1;
|
||||
uint8_t full :1;
|
||||
}color1_t;
|
||||
}lv_color1_t;
|
||||
|
||||
typedef union
|
||||
{
|
||||
@@ -76,7 +75,7 @@ typedef union
|
||||
uint8_t red :3;
|
||||
};
|
||||
uint8_t full;
|
||||
}color8_t;
|
||||
}lv_color8_t;
|
||||
|
||||
typedef union
|
||||
{
|
||||
@@ -87,7 +86,7 @@ typedef union
|
||||
uint16_t red :5;
|
||||
};
|
||||
uint16_t full;
|
||||
}color16_t;
|
||||
}lv_color16_t;
|
||||
|
||||
typedef union
|
||||
{
|
||||
@@ -98,32 +97,32 @@ typedef union
|
||||
uint8_t red;
|
||||
};
|
||||
uint32_t full;
|
||||
}color24_t;
|
||||
}lv_color24_t;
|
||||
|
||||
#if COLOR_DEPTH == 1
|
||||
#if LV_COLOR_DEPTH == 1
|
||||
typedef uint8_t color_int_t;
|
||||
typedef color1_t color_t;
|
||||
#elif COLOR_DEPTH == 8
|
||||
typedef lv_color1_t lv_color_t;
|
||||
#elif LV_COLOR_DEPTH == 8
|
||||
typedef uint8_t color_int_t;
|
||||
typedef color8_t color_t;
|
||||
#elif COLOR_DEPTH == 16
|
||||
typedef lv_color8_t lv_color_t;
|
||||
#elif LV_COLOR_DEPTH == 16
|
||||
typedef uint16_t color_int_t;
|
||||
typedef color16_t color_t;
|
||||
#elif COLOR_DEPTH == 24
|
||||
typedef lv_color16_t lv_color_t;
|
||||
#elif LV_COLOR_DEPTH == 24
|
||||
typedef uint32_t color_int_t;
|
||||
typedef color24_t color_t;
|
||||
typedef lv_color24_t lv_color_t;
|
||||
#else
|
||||
#error "Invalid COLOR_DEPTH in misc_conf.h! Set it to 1, 8, 16 or 24!"
|
||||
#error "Invalid LV_COLOR_DEPTH in misc_conf.h! Set it to 1, 8, 16 or 24!"
|
||||
#endif
|
||||
|
||||
typedef uint8_t opa_t;
|
||||
typedef uint8_t lv_opa_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint16_t h;
|
||||
uint8_t s;
|
||||
uint8_t v;
|
||||
} color_hsv_t;
|
||||
} lv_color_hsv_t;
|
||||
|
||||
/**********************
|
||||
* GLOBAL PROTOTYPES
|
||||
@@ -143,11 +142,11 @@ typedef struct
|
||||
* Shift right with 5 - 3 = 2
|
||||
*/
|
||||
|
||||
static inline uint8_t color_to1(color_t color)
|
||||
static inline uint8_t lv_color_to1(lv_color_t color)
|
||||
{
|
||||
#if COLOR_DEPTH == 1
|
||||
#if LV_COLOR_DEPTH == 1
|
||||
return color.full;
|
||||
#elif COLOR_DEPTH == 8
|
||||
#elif LV_COLOR_DEPTH == 8
|
||||
if((color.red & 0b100) ||
|
||||
(color.green & 0b100) ||
|
||||
(color.blue & 0b10)) {
|
||||
@@ -155,7 +154,7 @@ static inline uint8_t color_to1(color_t color)
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
#elif COLOR_DEPTH == 16
|
||||
#elif LV_COLOR_DEPTH == 16
|
||||
if((color.red & 0b10000) ||
|
||||
(color.green & 0b100000) ||
|
||||
(color.blue & 0b10000)) {
|
||||
@@ -163,7 +162,7 @@ static inline uint8_t color_to1(color_t color)
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
#elif COLOR_DEPTH == 24
|
||||
#elif LV_COLOR_DEPTH == 24
|
||||
if((color.red & 0x80) ||
|
||||
(color.green & 0x80) ||
|
||||
(color.blue & 0x80)) {
|
||||
@@ -174,21 +173,21 @@ static inline uint8_t color_to1(color_t color)
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline uint8_t color_to8(color_t color)
|
||||
static inline uint8_t lv_color_to8(lv_color_t color)
|
||||
{
|
||||
#if COLOR_DEPTH == 1
|
||||
#if LV_COLOR_DEPTH == 1
|
||||
if(color.full == 0) return 0;
|
||||
else return 0xFF;
|
||||
#elif COLOR_DEPTH == 8
|
||||
#elif LV_COLOR_DEPTH == 8
|
||||
return color.full;
|
||||
#elif COLOR_DEPTH == 16
|
||||
color8_t ret;
|
||||
#elif LV_COLOR_DEPTH == 16
|
||||
lv_color8_t ret;
|
||||
ret.red = color.red >> 2; /* 5 - 3 = 2*/
|
||||
ret.green = color.green >> 3; /* 6 - 3 = 3*/
|
||||
ret.blue = color.blue >> 3; /* 5 - 2 = 3*/
|
||||
return ret.full;
|
||||
#elif COLOR_DEPTH == 24
|
||||
color8_t ret;
|
||||
#elif LV_COLOR_DEPTH == 24
|
||||
lv_color8_t ret;
|
||||
ret.red = color.red >> 5; /* 8 - 3 = 5*/
|
||||
ret.green = color.green >> 5; /* 8 - 3 = 5*/
|
||||
ret.blue = color.blue >> 6; /* 8 - 2 = 6*/
|
||||
@@ -196,21 +195,21 @@ static inline uint8_t color_to8(color_t color)
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline uint16_t color_to16(color_t color)
|
||||
static inline uint16_t lv_color_to16(lv_color_t color)
|
||||
{
|
||||
#if COLOR_DEPTH == 1
|
||||
#if LV_COLOR_DEPTH == 1
|
||||
if(color.full == 0) return 0;
|
||||
else return 0xFFFF;
|
||||
#elif COLOR_DEPTH == 8
|
||||
color16_t ret;
|
||||
#elif LV_COLOR_DEPTH == 8
|
||||
lv_color16_t ret;
|
||||
ret.red = color.red * 4; /*(2^5 - 1)/(2^3 - 1) = 31/7 = 4*/
|
||||
ret.green = color.green * 9; /*(2^6 - 1)/(2^3 - 1) = 63/7 = 9*/
|
||||
ret.blue = color.blue * 10; /*(2^5 - 1)/(2^2 - 1) = 31/3 = 10*/
|
||||
return ret.full;
|
||||
#elif COLOR_DEPTH == 16
|
||||
#elif LV_COLOR_DEPTH == 16
|
||||
return color.full;
|
||||
#elif COLOR_DEPTH == 24
|
||||
color16_t ret;
|
||||
#elif LV_COLOR_DEPTH == 24
|
||||
lv_color16_t ret;
|
||||
ret.red = color.red >> 3; /* 8 - 5 = 3*/
|
||||
ret.green = color.green >> 2; /* 8 - 6 = 2*/
|
||||
ret.blue = color.blue >> 3; /* 8 - 5 = 3*/
|
||||
@@ -218,31 +217,31 @@ static inline uint16_t color_to16(color_t color)
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline uint32_t color_to24(color_t color)
|
||||
static inline uint32_t lv_color_to24(lv_color_t color)
|
||||
{
|
||||
#if COLOR_DEPTH == 1
|
||||
#if LV_COLOR_DEPTH == 1
|
||||
if(color.full == 0) return 0;
|
||||
else return 0xFFFFFF;
|
||||
#elif COLOR_DEPTH == 8
|
||||
color24_t ret;
|
||||
#elif LV_COLOR_DEPTH == 8
|
||||
lv_color24_t ret;
|
||||
ret.red = color.red * 36; /*(2^8 - 1)/(2^3 - 1) = 255/7 = 36*/
|
||||
ret.green = color.green * 36; /*(2^8 - 1)/(2^3 - 1) = 255/7 = 36*/
|
||||
ret.blue = color.blue * 85; /*(2^8 - 1)/(2^2 - 1) = 255/3 = 85*/
|
||||
return ret.full;
|
||||
#elif COLOR_DEPTH == 16
|
||||
color24_t ret;
|
||||
#elif LV_COLOR_DEPTH == 16
|
||||
lv_color24_t ret;
|
||||
ret.red = color.red * 8; /*(2^8 - 1)/(2^5 - 1) = 255/31 = 8*/
|
||||
ret.green = color.green * 4; /*(2^8 - 1)/(2^6 - 1) = 255/63 = 4*/
|
||||
ret.blue = color.blue * 8; /*(2^8 - 1)/(2^5 - 1) = 255/31 = 8*/
|
||||
return ret.full;
|
||||
#elif COLOR_DEPTH == 24
|
||||
#elif LV_COLOR_DEPTH == 24
|
||||
return color.full;
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline color_t color_mix(color_t c1, color_t c2, uint8_t mix)
|
||||
static inline lv_color_t lv_color_mix(lv_color_t c1, lv_color_t c2, uint8_t mix)
|
||||
{
|
||||
color_t ret;
|
||||
lv_color_t ret;
|
||||
ret.red = (uint16_t)((uint16_t) c1.red * mix + (c2.red * (255 - mix))) >> 8;
|
||||
ret.green = (uint16_t)((uint16_t) c1.green * mix + (c2.green * (255 - mix))) >> 8;
|
||||
ret.blue = (uint16_t)((uint16_t) c1.blue * mix + (c2.blue * (255 - mix))) >> 8;
|
||||
@@ -254,30 +253,30 @@ static inline color_t color_mix(color_t c1, color_t c2, uint8_t mix)
|
||||
* @param color a color
|
||||
* @return the brightness [0..255]
|
||||
*/
|
||||
static inline uint8_t color_brightness(color_t color)
|
||||
static inline uint8_t lv_color_brightness(lv_color_t color)
|
||||
{
|
||||
color24_t c24;
|
||||
c24.full = color_to24(color);
|
||||
lv_color24_t c24;
|
||||
c24.full = lv_color_to24(color);
|
||||
uint16_t bright = 3 * c24.red + c24.blue + 4 * c24.green;
|
||||
return (uint16_t) bright >> 3;
|
||||
}
|
||||
|
||||
#if COLOR_DEPTH == 1
|
||||
#define COLOR_MAKE(r8, g8, b8) ((color_t){b8 >> 7 | g8 >> 7 | r8 >> 7})
|
||||
#elif COLOR_DEPTH == 8
|
||||
#define COLOR_MAKE(r8, g8, b8) ((color_t){{b8 >> 6, g8 >> 5, r8 >> 5}})
|
||||
#elif COLOR_DEPTH == 16
|
||||
#define COLOR_MAKE(r8, g8, b8) ((color_t){{b8 >> 3, g8 >> 2, r8 >> 3}})
|
||||
#elif COLOR_DEPTH == 24
|
||||
#define COLOR_MAKE(r8, g8, b8) ((color_t){{b8, g8, r8}})
|
||||
#if LV_COLOR_DEPTH == 1
|
||||
#define LV_COLOR_MAKE(r8, g8, b8) ((lv_color_t){b8 >> 7 | g8 >> 7 | r8 >> 7})
|
||||
#elif LV_COLOR_DEPTH == 8
|
||||
#define LV_COLOR_MAKE(r8, g8, b8) ((lv_color_t){{b8 >> 6, g8 >> 5, r8 >> 5}})
|
||||
#elif LV_COLOR_DEPTH == 16
|
||||
#define LV_COLOR_MAKE(r8, g8, b8) ((lv_color_t){{b8 >> 3, g8 >> 2, r8 >> 3}})
|
||||
#elif LV_COLOR_DEPTH == 24
|
||||
#define LV_COLOR_MAKE(r8, g8, b8) ((lv_color_t){{b8, g8, r8}})
|
||||
#endif
|
||||
|
||||
#define COLOR_HEX(c) COLOR_MAKE(((uint32_t)((uint32_t)c >> 16) & 0xFF), \
|
||||
#define LV_COLOR_HEX(c) LV_COLOR_MAKE(((uint32_t)((uint32_t)c >> 16) & 0xFF), \
|
||||
((uint32_t)((uint32_t)c >> 8) & 0xFF), \
|
||||
((uint32_t) c & 0xFF))
|
||||
|
||||
/*Usage COLOR_HEX3(0x16C) which means COLOR_HEX(0x1166CC)*/
|
||||
#define COLOR_HEX3(c) COLOR_MAKE((((c >> 4) & 0xF0) | ((c >> 8) & 0xF)), \
|
||||
/*Usage LV_COLOR_HEX3(0x16C) which means LV_COLOR_HEX(0x1166CC)*/
|
||||
#define LV_COLOR_HEX3(c) LV_COLOR_MAKE((((c >> 4) & 0xF0) | ((c >> 8) & 0xF)), \
|
||||
((uint32_t)(c & 0xF0) | ((c & 0xF0) >> 4)), \
|
||||
((uint32_t)(c & 0xF) | ((c & 0xF) << 4)))
|
||||
|
||||
@@ -287,9 +286,9 @@ static inline uint8_t color_brightness(color_t color)
|
||||
* @param h hue [0..359]
|
||||
* @param s saturation [0..100]
|
||||
* @param v value [0..100]
|
||||
* @return the given RGB color in RGB (with COLOR_DEPTH depth)
|
||||
* @return the given RGB color in RGB (with LV_COLOR_DEPTH depth)
|
||||
*/
|
||||
color_t color_hsv_to_rgb(uint16_t h, uint8_t s, uint8_t v);
|
||||
lv_color_t lv_color_hsv_to_rgb(uint16_t h, uint8_t s, uint8_t v);
|
||||
|
||||
/**
|
||||
* Convert an RGB color to HSV
|
||||
@@ -298,7 +297,7 @@ color_t color_hsv_to_rgb(uint16_t h, uint8_t s, uint8_t v);
|
||||
* @param b blue
|
||||
* @return the given RGB color n HSV
|
||||
*/
|
||||
color_hsv_t color_rgb_to_hsv(uint8_t r, uint8_t g, uint8_t b);
|
||||
lv_color_hsv_t lv_color_rgb_to_hsv(uint8_t r, uint8_t g, uint8_t b);
|
||||
|
||||
|
||||
/**********************
|
||||
@@ -310,5 +309,3 @@ color_hsv_t color_rgb_to_hsv(uint8_t r, uint8_t g, uint8_t b);
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
+187
-201
File diff suppressed because it is too large
Load Diff
+16
-18
@@ -1,10 +1,10 @@
|
||||
/**
|
||||
* @file font.h
|
||||
* @file lv_font.h
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef FONT_H
|
||||
#define FONT_H
|
||||
#ifndef LV_FONT_H
|
||||
#define LV_FONT_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -15,7 +15,6 @@ extern "C" {
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include "misc_conf.h"
|
||||
#if USE_FONT != 0
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
@@ -30,9 +29,7 @@ extern "C" {
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
struct _font_struct;
|
||||
|
||||
typedef struct _font_struct
|
||||
typedef struct _lv_font_struct
|
||||
{
|
||||
uint32_t first_ascii;
|
||||
uint32_t last_ascii;
|
||||
@@ -40,8 +37,8 @@ typedef struct _font_struct
|
||||
const uint8_t * bitmap;
|
||||
const uint32_t * map;
|
||||
const uint8_t * width;
|
||||
struct _font_struct * next_page; /*Pointer to a font extension*/
|
||||
}font_t;
|
||||
struct _lv_font_struct * next_page; /*Pointer to a font extension*/
|
||||
}lv_font_t;
|
||||
|
||||
/**********************
|
||||
* GLOBAL PROTOTYPES
|
||||
@@ -50,14 +47,14 @@ typedef struct _font_struct
|
||||
/**
|
||||
* Initialize the built-in fonts
|
||||
*/
|
||||
void font_init(void);
|
||||
void lv_font_init(void);
|
||||
|
||||
/**
|
||||
* Create a pair from font name and font dsc. get function. After it 'font_get' can be used for this font
|
||||
* @param child pointer to a font to join to the 'parent'
|
||||
* @param parent pointer to a font. 'child' will be joined here
|
||||
*/
|
||||
void font_add(font_t *child, font_t *parent);
|
||||
void lv_font_add(lv_font_t *child, lv_font_t *parent);
|
||||
|
||||
/**
|
||||
* Return with the bitmap of a font.
|
||||
@@ -65,14 +62,14 @@ void font_add(font_t *child, font_t *parent);
|
||||
* @param letter a letter
|
||||
* @return pointer to the bitmap of the letter
|
||||
*/
|
||||
const uint8_t * font_get_bitmap(const font_t * font_p, uint32_t letter);
|
||||
const uint8_t * lv_font_get_bitmap(const lv_font_t * font_p, uint32_t letter);
|
||||
|
||||
/**
|
||||
* Get the height of a font
|
||||
* @param font_p pointer to a font
|
||||
* @return the height of a font
|
||||
*/
|
||||
static inline uint8_t font_get_height(const font_t * font_p)
|
||||
static inline uint8_t lv_font_get_height(const lv_font_t * font_p)
|
||||
{
|
||||
return font_p->height_row;
|
||||
}
|
||||
@@ -82,7 +79,7 @@ static inline uint8_t font_get_height(const font_t * font_p)
|
||||
* @param font_p pointer to a font
|
||||
* @return the height of a font
|
||||
*/
|
||||
static inline uint8_t font_get_height_scale(const font_t * font_p)
|
||||
static inline uint8_t lv_font_get_height_scale(const lv_font_t * font_p)
|
||||
{
|
||||
return font_p->height_row >> FONT_ANTIALIAS;
|
||||
}
|
||||
@@ -94,7 +91,7 @@ static inline uint8_t font_get_height_scale(const font_t * font_p)
|
||||
* @param letter a letter
|
||||
* @return the width of a letter
|
||||
*/
|
||||
uint8_t font_get_width(const font_t * font_p, uint32_t letter);
|
||||
uint8_t lv_font_get_width(const lv_font_t * font_p, uint32_t letter);
|
||||
|
||||
/**
|
||||
* Get the width of a letter in a font )Give the real size on the screen (half size if FONT_ANTIALIAS is enabled)
|
||||
@@ -102,7 +99,10 @@ uint8_t font_get_width(const font_t * font_p, uint32_t letter);
|
||||
* @param letter a letter
|
||||
* @return the width of a letter
|
||||
*/
|
||||
uint8_t font_get_width_scale(const font_t * font_p, uint32_t letter);
|
||||
static inline uint8_t lv_font_get_width_scale(const lv_font_t * font_p, uint32_t letter)
|
||||
{
|
||||
return lv_font_get_width(font_p, letter) >> FONT_ANTIALIAS;
|
||||
}
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
@@ -173,5 +173,3 @@ uint8_t font_get_width_scale(const font_t * font_p, uint32_t letter);
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "misc_conf.h"
|
||||
#if USE_FONT_DEJAVU_10 != 0
|
||||
#if USE_LV_FONT_DEJAVU_10 != 0
|
||||
#include <stdint.h>
|
||||
#include "../lv_misc/lv_font.h"
|
||||
|
||||
@@ -1181,7 +1181,7 @@ static const uint8_t dejavu_10_width[] =
|
||||
5, 5, 6, 5, 3, 5, 8,
|
||||
};
|
||||
|
||||
font_t font_dejavu_10 =
|
||||
lv_font_t lv_font_dejavu_10 =
|
||||
{
|
||||
32, /*First letter's unicode */
|
||||
126, /*Last letter's unicode */
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
|
||||
#include "misc_conf.h"
|
||||
|
||||
#if USE_FONT_DEJAVU_10 != 0
|
||||
#if USE_LV_FONT_DEJAVU_10 != 0
|
||||
|
||||
#include <stdint.h>
|
||||
#include "../lv_misc/lv_font.h"
|
||||
|
||||
extern font_t font_dejavu_10;
|
||||
extern lv_font_t lv_font_dejavu_10;
|
||||
|
||||
#endif /*USE_FONT_DEJAVU_10 != 0*/
|
||||
#endif /*USE_LV_FONT_DEJAVU_10 != 0*/
|
||||
|
||||
#endif /*DEJAVU_10_H*/
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "misc_conf.h"
|
||||
#if USE_FONT_DEJAVU_10_CYRILLIC != 0
|
||||
#if USE_LV_FONT_DEJAVU_10_CYRILLIC != 0
|
||||
#include <stdint.h>
|
||||
#include "../lv_misc/lv_font.h"
|
||||
|
||||
@@ -3153,7 +3153,7 @@ static const uint8_t dejavu_10_cyrillic_width[] =
|
||||
8, 7, 6, 6, 6, 5, 6, 5,
|
||||
};
|
||||
|
||||
font_t font_dejavu_10_cyrillic =
|
||||
lv_font_t lv_font_dejavu_10_cyrillic =
|
||||
{
|
||||
1024, /*First letter's unicode */
|
||||
1279, /*Last letter's unicode */
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
|
||||
#include "misc_conf.h"
|
||||
|
||||
#if USE_FONT_DEJAVU_10_CYRILLIC != 0
|
||||
#if USE_LV_FONT_DEJAVU_10_CYRILLIC != 0
|
||||
|
||||
#include <stdint.h>
|
||||
#include "../lv_misc/lv_font.h"
|
||||
|
||||
extern font_t font_dejavu_10_cyrillic;
|
||||
extern lv_font_t lv_font_dejavu_10_cyrillic;
|
||||
|
||||
#endif /*USE_FONT_DEJAVU_10_CYRILLIC != 0*/
|
||||
#endif /*USE_LV_FONT_DEJAVU_10_CYRILLIC != 0*/
|
||||
|
||||
#endif /*DEJAVU_10_CYRILLIC_H*/
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "misc_conf.h"
|
||||
#if USE_FONT_DEJAVU_10_LATIN_EXT_A != 0
|
||||
#if USE_LV_FONT_DEJAVU_10_LATIN_EXT_A != 0
|
||||
#include <stdint.h>
|
||||
#include "../lv_misc/lv_font.h"
|
||||
|
||||
@@ -1585,7 +1585,7 @@ static const uint8_t dejavu_10_latin_ext_a_width[] =
|
||||
5, 5, 6, 5, 6, 5, 6, 3,
|
||||
};
|
||||
|
||||
font_t font_dejavu_10_latin_ext_a =
|
||||
lv_font_t lv_font_dejavu_10_latin_ext_a =
|
||||
{
|
||||
256, /*First letter's unicode */
|
||||
383, /*Last letter's unicode */
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
|
||||
#include "misc_conf.h"
|
||||
|
||||
#if USE_FONT_DEJAVU_10_LATIN_EXT_A != 0
|
||||
#if USE_LV_FONT_DEJAVU_10_LATIN_EXT_A != 0
|
||||
|
||||
#include <stdint.h>
|
||||
#include "../lv_misc/lv_font.h"
|
||||
|
||||
extern font_t font_dejavu_10_latin_ext_a;
|
||||
extern lv_font_t lv_font_dejavu_10_latin_ext_a;
|
||||
|
||||
#endif /*USE_FONT_DEJAVU_10_LATIN_EXT_A != 0*/
|
||||
#endif /*USE_LV_FONT_DEJAVU_10_LATIN_EXT_A != 0*/
|
||||
|
||||
#endif /*DEJAVU_10_LATIN_EXT_A_H*/
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "misc_conf.h"
|
||||
#if USE_FONT_DEJAVU_10_LATIN_EXT_B != 0
|
||||
#if USE_LV_FONT_DEJAVU_10_LATIN_EXT_B != 0
|
||||
#include <stdint.h>
|
||||
#include "../lv_misc/lv_font.h"
|
||||
|
||||
@@ -2565,7 +2565,7 @@ static const uint8_t dejavu_10_latin_ext_b_width[] =
|
||||
3, 3, 7, 6, 6, 4, 6, 5,
|
||||
};
|
||||
|
||||
font_t font_dejavu_10_latin_ext_b =
|
||||
lv_font_t lv_font_dejavu_10_latin_ext_b =
|
||||
{
|
||||
384, /*First letter's unicode */
|
||||
591, /*Last letter's unicode */
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
|
||||
#include "misc_conf.h"
|
||||
|
||||
#if USE_FONT_DEJAVU_10_LATIN_EXT_B != 0
|
||||
#if USE_LV_FONT_DEJAVU_10_LATIN_EXT_B != 0
|
||||
|
||||
#include <stdint.h>
|
||||
#include "../lv_misc/lv_font.h"
|
||||
|
||||
extern font_t font_dejavu_10_latin_ext_b;
|
||||
extern lv_font_t lv_font_dejavu_10_latin_ext_b;
|
||||
|
||||
#endif /*USE_FONT_DEJAVU_10_LATIN_EXT_B != 0*/
|
||||
#endif /*USE_LV_FONT_DEJAVU_10_LATIN_EXT_B != 0*/
|
||||
|
||||
#endif /*DEJAVU_10_LATIN_EXT_B_H*/
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "misc_conf.h"
|
||||
#if USE_FONT_DEJAVU_10_SUP != 0
|
||||
#if USE_LV_FONT_DEJAVU_10_SUP != 0
|
||||
#include <stdint.h>
|
||||
#include "../lv_misc/lv_font.h"
|
||||
|
||||
@@ -1193,7 +1193,7 @@ static const uint8_t dejavu_10_sup_width[] =
|
||||
6, 6, 6, 6, 6, 5, 6, 5,
|
||||
};
|
||||
|
||||
font_t font_dejavu_10_sup =
|
||||
lv_font_t lv_font_dejavu_10_sup =
|
||||
{
|
||||
160, /*First letter's unicode */
|
||||
255, /*Last letter's unicode */
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
|
||||
#include "misc_conf.h"
|
||||
|
||||
#if USE_FONT_DEJAVU_10_SUP != 0
|
||||
#if USE_LV_FONT_DEJAVU_10_SUP != 0
|
||||
|
||||
#include <stdint.h>
|
||||
#include "../lv_misc/lv_font.h"
|
||||
|
||||
extern font_t font_dejavu_10_sup;
|
||||
extern lv_font_t lv_font_dejavu_10_sup;
|
||||
|
||||
#endif /*USE_FONT_DEJAVU_10_SUP != 0*/
|
||||
#endif /*USE_LV_FONT_DEJAVU_10_SUP != 0*/
|
||||
|
||||
#endif /*DEJAVU_10_SUP_H*/
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "misc_conf.h"
|
||||
#if USE_FONT_DEJAVU_20 != 0
|
||||
#if USE_LV_FONT_DEJAVU_20 != 0
|
||||
#include <stdint.h>
|
||||
#include "../lv_misc/lv_font.h"
|
||||
|
||||
@@ -2131,7 +2131,7 @@ static const uint8_t dejavu_20_width[] =
|
||||
10, 10, 8, 11, 6, 11, 14,
|
||||
};
|
||||
|
||||
font_t font_dejavu_20 =
|
||||
lv_font_t lv_font_dejavu_20 =
|
||||
{
|
||||
32, /*First letter's unicode */
|
||||
126, /*Last letter's unicode */
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
|
||||
#include "misc_conf.h"
|
||||
|
||||
#if USE_FONT_DEJAVU_20 != 0
|
||||
#if USE_LV_FONT_DEJAVU_20 != 0
|
||||
|
||||
#include <stdint.h>
|
||||
#include "../lv_misc/lv_font.h"
|
||||
|
||||
extern font_t font_dejavu_20;
|
||||
extern lv_font_t lv_font_dejavu_20;
|
||||
|
||||
#endif /*USE_FONT_DEJAVU_20 != 0*/
|
||||
#endif /*USE_LV_FONT_DEJAVU_20 != 0*/
|
||||
|
||||
#endif /*DEJAVU_20_H*/
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "misc_conf.h"
|
||||
#if USE_FONT_DEJAVU_20_CYRILLIC != 0
|
||||
#if USE_LV_FONT_DEJAVU_20_CYRILLIC != 0
|
||||
#include <stdint.h>
|
||||
#include "../lv_misc/lv_font.h"
|
||||
|
||||
@@ -5713,7 +5713,7 @@ static const uint8_t dejavu_20_cyrillic_width[] =
|
||||
15, 13, 12, 11, 12, 10, 12, 10,
|
||||
};
|
||||
|
||||
font_t font_dejavu_20_cyrillic =
|
||||
lv_font_t lv_font_dejavu_20_cyrillic =
|
||||
{
|
||||
1024, /*First letter's unicode */
|
||||
1279, /*Last letter's unicode */
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
|
||||
#include "misc_conf.h"
|
||||
|
||||
#if USE_FONT_DEJAVU_20_CYRILLIC != 0
|
||||
#if USE_LV_FONT_DEJAVU_20_CYRILLIC != 0
|
||||
|
||||
#include <stdint.h>
|
||||
#include "../lv_misc/lv_font.h"
|
||||
|
||||
extern font_t font_dejavu_20_cyrillic;
|
||||
extern lv_font_t lv_font_dejavu_20_cyrillic;
|
||||
|
||||
#endif /*USE_FONT_DEJAVU_20_CYRILLIC != 0*/
|
||||
#endif /*USE_LV_FONT_DEJAVU_20_CYRILLIC != 0*/
|
||||
|
||||
#endif /*DEJAVU_20_CYRILLIC_H*/
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "misc_conf.h"
|
||||
#if USE_FONT_DEJAVU_20_LATIN_EXT_A != 0
|
||||
#if USE_LV_FONT_DEJAVU_20_LATIN_EXT_A != 0
|
||||
#include <stdint.h>
|
||||
#include "../lv_misc/lv_font.h"
|
||||
|
||||
@@ -2865,7 +2865,7 @@ static const uint8_t dejavu_20_latin_ext_a_width[] =
|
||||
10, 12, 8, 12, 8, 12, 8, 6,
|
||||
};
|
||||
|
||||
font_t font_dejavu_20_latin_ext_a =
|
||||
lv_font_t lv_font_dejavu_20_latin_ext_a =
|
||||
{
|
||||
256, /*First letter's unicode */
|
||||
383, /*Last letter's unicode */
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
|
||||
#include "misc_conf.h"
|
||||
|
||||
#if USE_FONT_DEJAVU_20_LATIN_EXT_A != 0
|
||||
#if USE_LV_FONT_DEJAVU_20_LATIN_EXT_A != 0
|
||||
|
||||
#include <stdint.h>
|
||||
#include "../lv_misc/lv_font.h"
|
||||
|
||||
extern font_t font_dejavu_20_latin_ext_a;
|
||||
extern lv_font_t lv_font_dejavu_20_latin_ext_a;
|
||||
|
||||
#endif /*USE_FONT_DEJAVU_20_LATIN_EXT_A != 0*/
|
||||
#endif /*USE_LV_FONT_DEJAVU_20_LATIN_EXT_A != 0*/
|
||||
|
||||
#endif /*DEJAVU_20_LATIN_EXT_A_H*/
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "misc_conf.h"
|
||||
#if USE_FONT_DEJAVU_20_LATIN_EXT_B != 0
|
||||
#if USE_LV_FONT_DEJAVU_20_LATIN_EXT_B != 0
|
||||
#include <stdint.h>
|
||||
#include "../lv_misc/lv_font.h"
|
||||
|
||||
@@ -4645,7 +4645,7 @@ static const uint8_t dejavu_20_latin_ext_b_width[] =
|
||||
6, 5, 13, 10, 12, 7, 10, 10,
|
||||
};
|
||||
|
||||
font_t font_dejavu_20_latin_ext_b =
|
||||
lv_font_t lv_font_dejavu_20_latin_ext_b =
|
||||
{
|
||||
384, /*First letter's unicode */
|
||||
591, /*Last letter's unicode */
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
|
||||
#include "misc_conf.h"
|
||||
|
||||
#if USE_FONT_DEJAVU_20_LATIN_EXT_B != 0
|
||||
#if USE_LV_FONT_DEJAVU_20_LATIN_EXT_B != 0
|
||||
|
||||
#include <stdint.h>
|
||||
#include "../lv_misc/lv_font.h"
|
||||
|
||||
extern font_t font_dejavu_20_latin_ext_b;
|
||||
extern lv_font_t lv_font_dejavu_20_latin_ext_b;
|
||||
|
||||
#endif /*USE_FONT_DEJAVU_20_LATIN_EXT_B != 0*/
|
||||
#endif /*USE_LV_FONT_DEJAVU_20_LATIN_EXT_B != 0*/
|
||||
|
||||
#endif /*DEJAVU_20_LATIN_EXT_B_H*/
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "misc_conf.h"
|
||||
#if USE_FONT_DEJAVU_20_SUP != 0
|
||||
#if USE_LV_FONT_DEJAVU_20_SUP != 0
|
||||
#include <stdint.h>
|
||||
#include "../lv_misc/lv_font.h"
|
||||
|
||||
@@ -2153,7 +2153,7 @@ static const uint8_t dejavu_20_sup_width[] =
|
||||
10, 11, 11, 11, 11, 10, 10, 10,
|
||||
};
|
||||
|
||||
font_t font_dejavu_20_sup =
|
||||
lv_font_t lv_font_dejavu_20_sup =
|
||||
{
|
||||
160, /*First letter's unicode */
|
||||
255, /*Last letter's unicode */
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
|
||||
#include "misc_conf.h"
|
||||
|
||||
#if USE_FONT_DEJAVU_20_SUP != 0
|
||||
#if USE_LV_FONT_DEJAVU_20_SUP != 0
|
||||
|
||||
#include <stdint.h>
|
||||
#include "../lv_misc/lv_font.h"
|
||||
|
||||
extern font_t font_dejavu_20_sup;
|
||||
extern lv_font_t lv_font_dejavu_20_sup;
|
||||
|
||||
#endif /*USE_FONT_DEJAVU_20_SUP != 0*/
|
||||
#endif /*USE_LV_FONT_DEJAVU_20_SUP != 0*/
|
||||
|
||||
#endif /*DEJAVU_20_SUP_H*/
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "misc_conf.h"
|
||||
#if USE_FONT_DEJAVU_30 != 0
|
||||
#if USE_LV_FONT_DEJAVU_30 != 0
|
||||
#include <stdint.h>
|
||||
#include "../lv_misc/lv_font.h"
|
||||
|
||||
@@ -3081,7 +3081,7 @@ static const uint8_t dejavu_30_width[] =
|
||||
15, 15, 14, 17, 9, 17, 22,
|
||||
};
|
||||
|
||||
font_t font_dejavu_30 =
|
||||
lv_font_t lv_font_dejavu_30 =
|
||||
{
|
||||
32, /*First letter's unicode */
|
||||
126, /*Last letter's unicode */
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
|
||||
#include "misc_conf.h"
|
||||
|
||||
#if USE_FONT_DEJAVU_30 != 0
|
||||
#if USE_LV_FONT_DEJAVU_30 != 0
|
||||
|
||||
#include <stdint.h>
|
||||
#include "../lv_misc/lv_font.h"
|
||||
|
||||
extern font_t font_dejavu_30;
|
||||
extern lv_font_t lv_font_dejavu_30;
|
||||
|
||||
#endif /*USE_FONT_DEJAVU_30 != 0*/
|
||||
#endif /*USE_LV_FONT_DEJAVU_30 != 0*/
|
||||
|
||||
#endif /*DEJAVU_30_H*/
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "misc_conf.h"
|
||||
#if USE_FONT_DEJAVU_30_CYRILLIC != 0
|
||||
#if USE_LV_FONT_DEJAVU_30_CYRILLIC != 0
|
||||
#include <stdint.h>
|
||||
#include "../lv_misc/lv_font.h"
|
||||
|
||||
@@ -8273,7 +8273,7 @@ static const uint8_t dejavu_30_cyrillic_width[] =
|
||||
23, 21, 18, 16, 18, 15, 18, 15,
|
||||
};
|
||||
|
||||
font_t font_dejavu_30_cyrillic =
|
||||
lv_font_t lv_font_dejavu_30_cyrillic =
|
||||
{
|
||||
1024, /*First letter's unicode */
|
||||
1279, /*Last letter's unicode */
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
|
||||
#include "misc_conf.h"
|
||||
|
||||
#if USE_FONT_DEJAVU_30_CYRILLIC != 0
|
||||
#if USE_LV_FONT_DEJAVU_30_CYRILLIC != 0
|
||||
|
||||
#include <stdint.h>
|
||||
#include "../lv_misc/lv_font.h"
|
||||
|
||||
extern font_t font_dejavu_30_cyrillic;
|
||||
extern lv_font_t lv_font_dejavu_30_cyrillic;
|
||||
|
||||
#endif /*USE_FONT_DEJAVU_30_CYRILLIC != 0*/
|
||||
#endif /*USE_LV_FONT_DEJAVU_30_CYRILLIC != 0*/
|
||||
|
||||
#endif /*DEJAVU_30_CYRILLIC_H*/
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "misc_conf.h"
|
||||
#if USE_FONT_DEJAVU_30_LATIN_EXT_A != 0
|
||||
#if USE_LV_FONT_DEJAVU_30_LATIN_EXT_A != 0
|
||||
#include <stdint.h>
|
||||
#include "../lv_misc/lv_font.h"
|
||||
|
||||
@@ -4145,7 +4145,7 @@ static const uint8_t dejavu_30_latin_ext_a_width[] =
|
||||
16, 18, 14, 18, 14, 18, 14, 9,
|
||||
};
|
||||
|
||||
font_t font_dejavu_30_latin_ext_a =
|
||||
lv_font_t lv_font_dejavu_30_latin_ext_a =
|
||||
{
|
||||
256, /*First letter's unicode */
|
||||
383, /*Last letter's unicode */
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
|
||||
#include "misc_conf.h"
|
||||
|
||||
#if USE_FONT_DEJAVU_30_LATIN_EXT_A != 0
|
||||
#if USE_LV_FONT_DEJAVU_30_LATIN_EXT_A != 0
|
||||
|
||||
#include <stdint.h>
|
||||
#include "../lv_misc/lv_font.h"
|
||||
|
||||
extern font_t font_dejavu_30_latin_ext_a;
|
||||
extern lv_font_t lv_font_dejavu_30_latin_ext_a;
|
||||
|
||||
#endif /*USE_FONT_DEJAVU_30_LATIN_EXT_A != 0*/
|
||||
#endif /*USE_LV_FONT_DEJAVU_30_LATIN_EXT_A != 0*/
|
||||
|
||||
#endif /*DEJAVU_30_LATIN_EXT_A_H*/
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "misc_conf.h"
|
||||
#if USE_FONT_DEJAVU_30_LATIN_EXT_B != 0
|
||||
#if USE_LV_FONT_DEJAVU_30_LATIN_EXT_B != 0
|
||||
#include <stdint.h>
|
||||
#include "../lv_misc/lv_font.h"
|
||||
|
||||
@@ -6725,7 +6725,7 @@ static const uint8_t dejavu_30_latin_ext_b_width[] =
|
||||
8, 7, 20, 17, 18, 11, 16, 15,
|
||||
};
|
||||
|
||||
font_t font_dejavu_30_latin_ext_b =
|
||||
lv_font_t lv_font_dejavu_30_latin_ext_b =
|
||||
{
|
||||
384, /*First letter's unicode */
|
||||
591, /*Last letter's unicode */
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
|
||||
#include "misc_conf.h"
|
||||
|
||||
#if USE_FONT_DEJAVU_30_LATIN_EXT_B != 0
|
||||
#if USE_LV_FONT_DEJAVU_30_LATIN_EXT_B != 0
|
||||
|
||||
#include <stdint.h>
|
||||
#include "../lv_misc/lv_font.h"
|
||||
|
||||
extern font_t font_dejavu_30_latin_ext_b;
|
||||
extern lv_font_t lv_font_dejavu_30_latin_ext_b;
|
||||
|
||||
#endif /*USE_FONT_DEJAVU_30_LATIN_EXT_B != 0*/
|
||||
#endif /*USE_LV_FONT_DEJAVU_30_LATIN_EXT_B != 0*/
|
||||
|
||||
#endif /*DEJAVU_30_LATIN_EXT_B_H*/
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "misc_conf.h"
|
||||
#if USE_FONT_DEJAVU_30_SUP != 0
|
||||
#if USE_LV_FONT_DEJAVU_30_SUP != 0
|
||||
#include <stdint.h>
|
||||
#include "../lv_misc/lv_font.h"
|
||||
|
||||
@@ -3113,7 +3113,7 @@ static const uint8_t dejavu_30_sup_width[] =
|
||||
16, 16, 16, 16, 16, 15, 17, 15,
|
||||
};
|
||||
|
||||
font_t font_dejavu_30_sup =
|
||||
lv_font_t lv_font_dejavu_30_sup =
|
||||
{
|
||||
160, /*First letter's unicode */
|
||||
255, /*Last letter's unicode */
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user