mirror of
https://github.com/lvgl/lvgl.git
synced 2025-02-04 07:13:00 +08:00
chore: change anlge
and zoom
to lv_coord
(#4247)
This commit is contained in:
parent
87fbaad477
commit
42d24403c3
@ -1136,8 +1136,8 @@ static void layout_update_core(lv_obj_t * obj)
|
|||||||
|
|
||||||
static void transform_point(const lv_obj_t * obj, lv_point_t * p, bool inv)
|
static void transform_point(const lv_obj_t * obj, lv_point_t * p, bool inv)
|
||||||
{
|
{
|
||||||
int16_t angle = lv_obj_get_style_transform_angle(obj, 0);
|
lv_coord_t angle = lv_obj_get_style_transform_angle(obj, 0);
|
||||||
int16_t zoom = lv_obj_get_style_transform_zoom_safe(obj, 0);
|
lv_coord_t zoom = lv_obj_get_style_transform_zoom_safe(obj, 0);
|
||||||
|
|
||||||
if(angle == 0 && zoom == LV_ZOOM_NONE) return;
|
if(angle == 0 && zoom == LV_ZOOM_NONE) return;
|
||||||
|
|
||||||
|
@ -38,9 +38,8 @@ typedef struct {
|
|||||||
} lv_draw_img_sup_t;
|
} lv_draw_img_sup_t;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
lv_coord_t angle;
|
||||||
int16_t angle;
|
lv_coord_t zoom;
|
||||||
uint16_t zoom;
|
|
||||||
lv_point_t pivot;
|
lv_point_t pivot;
|
||||||
|
|
||||||
lv_color_t chroma_key_color;
|
lv_color_t chroma_key_color;
|
||||||
|
@ -58,7 +58,7 @@ void lv_img_buf_free(lv_img_dsc_t * dsc)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void _lv_img_buf_get_transformed_area(lv_area_t * res, lv_coord_t w, lv_coord_t h, int16_t angle, uint16_t zoom,
|
void _lv_img_buf_get_transformed_area(lv_area_t * res, lv_coord_t w, lv_coord_t h, lv_coord_t angle, uint16_t zoom,
|
||||||
const lv_point_t * pivot)
|
const lv_point_t * pivot)
|
||||||
{
|
{
|
||||||
#if LV_USE_DRAW_MASKS
|
#if LV_USE_DRAW_MASKS
|
||||||
|
@ -113,7 +113,7 @@ void lv_img_buf_free(lv_img_dsc_t * dsc);
|
|||||||
* @param zoom zoom, (256 no zoom)
|
* @param zoom zoom, (256 no zoom)
|
||||||
* @param pivot x,y pivot coordinates of rotation
|
* @param pivot x,y pivot coordinates of rotation
|
||||||
*/
|
*/
|
||||||
void _lv_img_buf_get_transformed_area(lv_area_t * res, lv_coord_t w, lv_coord_t h, int16_t angle, uint16_t zoom,
|
void _lv_img_buf_get_transformed_area(lv_area_t * res, lv_coord_t w, lv_coord_t h, lv_coord_t angle, uint16_t zoom,
|
||||||
const lv_point_t * pivot);
|
const lv_point_t * pivot);
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
|
@ -191,7 +191,7 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_sw_img_decoded(struct _lv_draw_ctx_t * draw_c
|
|||||||
/*Blend*/
|
/*Blend*/
|
||||||
lv_draw_sw_blend(draw_ctx, &blend_dsc);
|
lv_draw_sw_blend(draw_ctx, &blend_dsc);
|
||||||
|
|
||||||
/*Go the the next lines*/
|
/*Go to the next lines*/
|
||||||
blend_area.y1 = blend_area.y2 + 1;
|
blend_area.y1 = blend_area.y2 + 1;
|
||||||
blend_area.y2 = blend_area.y1 + buf_h - 1;
|
blend_area.y2 = blend_area.y1 + buf_h - 1;
|
||||||
if(blend_area.y2 > y_last) blend_area.y2 = y_last;
|
if(blend_area.y2 > y_last) blend_area.y2 = y_last;
|
||||||
|
@ -327,7 +327,7 @@ lv_coord_t lv_img_get_offset_y(lv_obj_t * obj)
|
|||||||
return img->offset.y;
|
return img->offset.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t lv_img_get_angle(lv_obj_t * obj)
|
lv_coord_t lv_img_get_angle(lv_obj_t * obj)
|
||||||
{
|
{
|
||||||
LV_ASSERT_OBJ(obj, MY_CLASS);
|
LV_ASSERT_OBJ(obj, MY_CLASS);
|
||||||
|
|
||||||
@ -345,7 +345,7 @@ void lv_img_get_pivot(lv_obj_t * obj, lv_point_t * pivot)
|
|||||||
*pivot = img->pivot;
|
*pivot = img->pivot;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t lv_img_get_zoom(lv_obj_t * obj)
|
lv_coord_t lv_img_get_zoom(lv_obj_t * obj)
|
||||||
{
|
{
|
||||||
LV_ASSERT_OBJ(obj, MY_CLASS);
|
LV_ASSERT_OBJ(obj, MY_CLASS);
|
||||||
|
|
||||||
@ -386,13 +386,13 @@ static void lv_img_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj)
|
|||||||
img->cf = LV_COLOR_FORMAT_UNKNOWN;
|
img->cf = LV_COLOR_FORMAT_UNKNOWN;
|
||||||
img->w = lv_obj_get_width(obj);
|
img->w = lv_obj_get_width(obj);
|
||||||
img->h = lv_obj_get_height(obj);
|
img->h = lv_obj_get_height(obj);
|
||||||
img->angle = 0;
|
img->angle = 0;
|
||||||
img->zoom = LV_ZOOM_NONE;
|
img->zoom = LV_ZOOM_NONE;
|
||||||
img->antialias = LV_COLOR_DEPTH > 8 ? 1 : 0;
|
img->antialias = LV_COLOR_DEPTH > 8 ? 1 : 0;
|
||||||
img->offset.x = 0;
|
img->offset.x = 0;
|
||||||
img->offset.y = 0;
|
img->offset.y = 0;
|
||||||
img->pivot.x = 0;
|
img->pivot.x = 0;
|
||||||
img->pivot.y = 0;
|
img->pivot.y = 0;
|
||||||
img->obj_size_mode = LV_IMG_SIZE_MODE_VIRTUAL;
|
img->obj_size_mode = LV_IMG_SIZE_MODE_VIRTUAL;
|
||||||
|
|
||||||
lv_obj_clear_flag(obj, LV_OBJ_FLAG_CLICKABLE);
|
lv_obj_clear_flag(obj, LV_OBJ_FLAG_CLICKABLE);
|
||||||
|
@ -43,9 +43,9 @@ typedef struct {
|
|||||||
lv_point_t offset;
|
lv_point_t offset;
|
||||||
lv_coord_t w; /*Width of the image (Handled by the library)*/
|
lv_coord_t w; /*Width of the image (Handled by the library)*/
|
||||||
lv_coord_t h; /*Height of the image (Handled by the library)*/
|
lv_coord_t h; /*Height of the image (Handled by the library)*/
|
||||||
uint16_t angle; /*rotation angle of the image*/
|
lv_coord_t angle; /*rotation angle of the image*/
|
||||||
lv_point_t pivot; /*rotation center of the image*/
|
lv_point_t pivot; /*rotation center of the image*/
|
||||||
uint16_t zoom; /*256 means no zoom, 512 double size, 128 half size*/
|
lv_coord_t zoom; /*256 means no zoom, 512 double size, 128 half size*/
|
||||||
uint8_t src_type : 2; /*See: lv_img_src_t*/
|
uint8_t src_type : 2; /*See: lv_img_src_t*/
|
||||||
uint8_t cf : 5; /*Color format from `lv_color_format_t`*/
|
uint8_t cf : 5; /*Color format from `lv_color_format_t`*/
|
||||||
uint8_t antialias : 1; /*Apply anti-aliasing in transformations (rotate, zoom)*/
|
uint8_t antialias : 1; /*Apply anti-aliasing in transformations (rotate, zoom)*/
|
||||||
@ -192,7 +192,7 @@ lv_coord_t lv_img_get_offset_y(lv_obj_t * obj);
|
|||||||
* @param obj pointer to an image object
|
* @param obj pointer to an image object
|
||||||
* @return rotation angle in 0.1 degrees (0..3600)
|
* @return rotation angle in 0.1 degrees (0..3600)
|
||||||
*/
|
*/
|
||||||
uint16_t lv_img_get_angle(lv_obj_t * obj);
|
lv_coord_t lv_img_get_angle(lv_obj_t * obj);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the pivot (rotation center) of the image.
|
* Get the pivot (rotation center) of the image.
|
||||||
@ -206,7 +206,7 @@ void lv_img_get_pivot(lv_obj_t * obj, lv_point_t * pivot);
|
|||||||
* @param obj pointer to an image object
|
* @param obj pointer to an image object
|
||||||
* @return zoom factor (256: no zoom)
|
* @return zoom factor (256: no zoom)
|
||||||
*/
|
*/
|
||||||
uint16_t lv_img_get_zoom(lv_obj_t * obj);
|
lv_coord_t lv_img_get_zoom(lv_obj_t * obj);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get whether the transformations (rotate, zoom) are anti-aliased or not
|
* Get whether the transformations (rotate, zoom) are anti-aliased or not
|
||||||
|
Loading…
x
Reference in New Issue
Block a user