Lines Matching +full:- +full:y
98 if(img->src_type == LV_IMG_SRC_SYMBOL || img->src_type == LV_IMG_SRC_FILE) { in lv_img_set_src()
99 lv_mem_free((void *)img->src); in lv_img_set_src()
101 img->src = NULL; in lv_img_set_src()
102 img->src_type = LV_IMG_SRC_UNKNOWN; in lv_img_set_src()
112 if(img->src_type == LV_IMG_SRC_FILE || img->src_type == LV_IMG_SRC_SYMBOL) { in lv_img_set_src()
113 lv_mem_free((void *)img->src); in lv_img_set_src()
115 img->src = src; in lv_img_set_src()
119 if(img->src != src) { in lv_img_set_src()
124 if(img->src_type == LV_IMG_SRC_FILE || img->src_type == LV_IMG_SRC_SYMBOL) { in lv_img_set_src()
125 old_src = img->src; in lv_img_set_src()
131 img->src = new_str; in lv_img_set_src()
145 header.h = size.y; in lv_img_set_src()
148 img->src_type = src_type; in lv_img_set_src()
149 img->w = header.w; in lv_img_set_src()
150 img->h = header.h; in lv_img_set_src()
151 img->cf = header.cf; in lv_img_set_src()
152 img->pivot.x = header.w / 2; in lv_img_set_src()
153 img->pivot.y = header.h / 2; in lv_img_set_src()
158 if(img->angle || img->zoom != LV_IMG_ZOOM_NONE) lv_obj_refresh_ext_draw_size(obj); in lv_img_set_src()
169 img->offset.x = x; in lv_img_set_offset_x()
173 void lv_img_set_offset_y(lv_obj_t * obj, lv_coord_t y) in lv_img_set_offset_y() argument
179 img->offset.y = y; in lv_img_set_offset_y()
185 while(angle >= 3600) angle -= 3600; in lv_img_set_angle()
189 if(angle == img->angle) return; in lv_img_set_angle()
195 _lv_img_buf_get_transformed_area(&a, w, h, img->angle, img->zoom, &img->pivot); in lv_img_set_angle()
196 a.x1 += obj->coords.x1; in lv_img_set_angle()
197 a.y1 += obj->coords.y1; in lv_img_set_angle()
198 a.x2 += obj->coords.x1; in lv_img_set_angle()
199 a.y2 += obj->coords.y1; in lv_img_set_angle()
202 img->angle = angle; in lv_img_set_angle()
211 _lv_img_buf_get_transformed_area(&a, w, h, img->angle, img->zoom, &img->pivot); in lv_img_set_angle()
212 a.x1 += obj->coords.x1; in lv_img_set_angle()
213 a.y1 += obj->coords.y1; in lv_img_set_angle()
214 a.x2 += obj->coords.x1; in lv_img_set_angle()
215 a.y2 += obj->coords.y1; in lv_img_set_angle()
219 void lv_img_set_pivot(lv_obj_t * obj, lv_coord_t x, lv_coord_t y) in lv_img_set_pivot() argument
222 if(img->pivot.x == x && img->pivot.y == y) return; in lv_img_set_pivot()
228 _lv_img_buf_get_transformed_area(&a, w, h, img->angle, img->zoom, &img->pivot); in lv_img_set_pivot()
229 a.x1 += obj->coords.x1; in lv_img_set_pivot()
230 a.y1 += obj->coords.y1; in lv_img_set_pivot()
231 a.x2 += obj->coords.x1; in lv_img_set_pivot()
232 a.y2 += obj->coords.y1; in lv_img_set_pivot()
235 img->pivot.x = x; in lv_img_set_pivot()
236 img->pivot.y = y; in lv_img_set_pivot()
245 _lv_img_buf_get_transformed_area(&a, w, h, img->angle, img->zoom, &img->pivot); in lv_img_set_pivot()
246 a.x1 += obj->coords.x1; in lv_img_set_pivot()
247 a.y1 += obj->coords.y1; in lv_img_set_pivot()
248 a.x2 += obj->coords.x1; in lv_img_set_pivot()
249 a.y2 += obj->coords.y1; in lv_img_set_pivot()
256 if(zoom == img->zoom) return; in lv_img_set_zoom()
264 _lv_img_buf_get_transformed_area(&a, w, h, img->angle, img->zoom >> 8, &img->pivot); in lv_img_set_zoom()
265 a.x1 += obj->coords.x1 - 1; in lv_img_set_zoom()
266 a.y1 += obj->coords.y1 - 1; in lv_img_set_zoom()
267 a.x2 += obj->coords.x1 + 1; in lv_img_set_zoom()
268 a.y2 += obj->coords.y1 + 1; in lv_img_set_zoom()
271 img->zoom = zoom; in lv_img_set_zoom()
280 _lv_img_buf_get_transformed_area(&a, w, h, img->angle, img->zoom, &img->pivot); in lv_img_set_zoom()
281 a.x1 += obj->coords.x1 - 1; in lv_img_set_zoom()
282 a.y1 += obj->coords.y1 - 1; in lv_img_set_zoom()
283 a.x2 += obj->coords.x1 + 1; in lv_img_set_zoom()
284 a.y2 += obj->coords.y1 + 1; in lv_img_set_zoom()
291 if(antialias == img->antialias) return; in lv_img_set_antialias()
293 img->antialias = antialias; in lv_img_set_antialias()
301 if(mode == img->obj_size_mode) return; in lv_img_set_size_mode()
303 img->obj_size_mode = mode; in lv_img_set_size_mode()
317 return img->src; in lv_img_get_src()
326 return img->offset.x; in lv_img_get_offset_x()
335 return img->offset.y; in lv_img_get_offset_y()
344 return img->angle; in lv_img_get_angle()
353 *pivot = img->pivot; in lv_img_get_pivot()
362 return img->zoom; in lv_img_get_zoom()
371 return img->antialias ? true : false; in lv_img_get_antialias()
378 return img->obj_size_mode; in lv_img_get_size_mode()
392 img->src = NULL; in lv_img_constructor()
393 img->src_type = LV_IMG_SRC_UNKNOWN; in lv_img_constructor()
394 img->cf = LV_IMG_CF_UNKNOWN; in lv_img_constructor()
395 img->w = lv_obj_get_width(obj); in lv_img_constructor()
396 img->h = lv_obj_get_height(obj); in lv_img_constructor()
397 img->angle = 0; in lv_img_constructor()
398 img->zoom = LV_IMG_ZOOM_NONE; in lv_img_constructor()
399 img->antialias = LV_COLOR_DEPTH > 8 ? 1 : 0; in lv_img_constructor()
400 img->offset.x = 0; in lv_img_constructor()
401 img->offset.y = 0; in lv_img_constructor()
402 img->pivot.x = 0; in lv_img_constructor()
403 img->pivot.y = 0; in lv_img_constructor()
404 img->obj_size_mode = LV_IMG_SIZE_MODE_VIRTUAL; in lv_img_constructor()
416 if(img->src_type == LV_IMG_SRC_FILE || img->src_type == LV_IMG_SRC_SYMBOL) { in lv_img_destructor()
417 lv_mem_free((void *)img->src); in lv_img_destructor()
418 img->src = NULL; in lv_img_destructor()
419 img->src_type = LV_IMG_SRC_UNKNOWN; in lv_img_destructor()
428 _lv_img_buf_get_transformed_area(&area_transform, img->w, img->h, in lv_img_get_transformed_size()
429 img->angle, img->zoom, &img->pivot); in lv_img_get_transformed_size()
454 if(img->src_type == LV_IMG_SRC_SYMBOL) { in lv_img_event()
455 lv_img_set_src(obj, img->src); in lv_img_event()
467 if(img->angle || img->zoom != LV_IMG_ZOOM_NONE) { in lv_img_event()
471 _lv_img_buf_get_transformed_area(&a, w, h, img->angle, img->zoom, &img->pivot); in lv_img_event()
472 *s = LV_MAX(*s, -a.x1); in lv_img_event()
473 *s = LV_MAX(*s, -a.y1); in lv_img_event()
474 *s = LV_MAX(*s, a.x2 - w); in lv_img_event()
475 *s = LV_MAX(*s, a.y2 - h); in lv_img_event()
483 if(img->w == lv_obj_get_width(obj) && img->h == lv_obj_get_height(obj) && in lv_img_event()
484 …(img->zoom != LV_IMG_ZOOM_NONE || img->angle != 0 || img->pivot.x != img->w / 2 || img->pivot.y !=… in lv_img_event()
489 _lv_img_buf_get_transformed_area(&coords, w, h, img->angle, img->zoom, &img->pivot); in lv_img_event()
490 coords.x1 += obj->coords.x1; in lv_img_event()
491 coords.y1 += obj->coords.y1; in lv_img_event()
492 coords.x2 += obj->coords.x1; in lv_img_event()
493 coords.y2 += obj->coords.y1; in lv_img_event()
495 info->res = _lv_area_is_point_on(&coords, info->point, 0); in lv_img_event()
500 info->res = _lv_area_is_point_on(&a, info->point, 0); in lv_img_event()
505 if(img->obj_size_mode == LV_IMG_SIZE_MODE_REAL) { in lv_img_event()
509 p->x = img->w; in lv_img_event()
510 p->y = img->h; in lv_img_event()
525 if(info->res == LV_COVER_RES_MASKED) return; in draw_img()
526 if(img->src_type == LV_IMG_SRC_UNKNOWN || img->src_type == LV_IMG_SRC_SYMBOL) { in draw_img()
527 info->res = LV_COVER_RES_NOT_COVER; in draw_img()
532 if(img->cf != LV_IMG_CF_TRUE_COLOR && img->cf != LV_IMG_CF_RAW) { in draw_img()
533 info->res = LV_COVER_RES_NOT_COVER; in draw_img()
539 info->res = LV_COVER_RES_NOT_COVER; in draw_img()
543 if(img->angle != 0) { in draw_img()
544 info->res = LV_COVER_RES_NOT_COVER; in draw_img()
549 if(img->zoom == LV_IMG_ZOOM_NONE) { in draw_img()
550 if(_lv_area_is_in(clip_area, &obj->coords, 0) == false) { in draw_img()
551 info->res = LV_COVER_RES_NOT_COVER; in draw_img()
557 …get_transformed_area(&a, lv_obj_get_width(obj), lv_obj_get_height(obj), 0, img->zoom, &img->pivot); in draw_img()
558 a.x1 += obj->coords.x1; in draw_img()
559 a.y1 += obj->coords.y1; in draw_img()
560 a.x2 += obj->coords.x1; in draw_img()
561 a.y2 += obj->coords.y1; in draw_img()
564 info->res = LV_COVER_RES_NOT_COVER; in draw_img()
581 bg_pivot.x = img->pivot.x + pleft; in draw_img()
582 bg_pivot.y = img->pivot.y + ptop; in draw_img()
585 if(img->obj_size_mode == LV_IMG_SIZE_MODE_REAL) { in draw_img()
591 img->angle, img->zoom, &bg_pivot); in draw_img()
594 bg_coords.x1 += obj->coords.x1; in draw_img()
595 bg_coords.y1 += obj->coords.y1; in draw_img()
596 bg_coords.x2 += obj->coords.x1; in draw_img()
597 bg_coords.y2 += obj->coords.y1; in draw_img()
601 lv_area_copy(&ori_coords, &obj->coords); in draw_img()
602 lv_area_copy(&obj->coords, &bg_coords); in draw_img()
607 lv_area_copy(&obj->coords, &ori_coords); in draw_img()
610 if(img->h == 0 || img->w == 0) return; in draw_img()
611 if(img->zoom == 0) return; in draw_img()
616 lv_area_copy(&img_max_area, &obj->coords); in draw_img()
620 if(img->obj_size_mode == LV_IMG_SIZE_MODE_REAL) { in draw_img()
621 img_max_area.x1 -= ((img->w - img_size_final.x) + 1) / 2; in draw_img()
622 img_max_area.x2 -= ((img->w - img_size_final.x) + 1) / 2; in draw_img()
623 img_max_area.y1 -= ((img->h - img_size_final.y) + 1) / 2; in draw_img()
624 img_max_area.y2 -= ((img->h - img_size_final.y) + 1) / 2; in draw_img()
627 img_max_area.x2 = img_max_area.x1 + lv_area_get_width(&bg_coords) - 1; in draw_img()
628 img_max_area.y2 = img_max_area.y1 + lv_area_get_height(&bg_coords) - 1; in draw_img()
633 img_max_area.x2 -= pright; in draw_img()
634 img_max_area.y2 -= pbottom; in draw_img()
636 if(img->src_type == LV_IMG_SRC_FILE || img->src_type == LV_IMG_SRC_VARIABLE) { in draw_img()
641 img_dsc.zoom = img->zoom; in draw_img()
642 img_dsc.angle = img->angle; in draw_img()
643 img_dsc.pivot.x = img->pivot.x; in draw_img()
644 img_dsc.pivot.y = img->pivot.y; in draw_img()
645 img_dsc.antialias = img->antialias; in draw_img()
650 img_clip_area.x2 = bg_coords.x2 - pright; in draw_img()
651 img_clip_area.y2 = bg_coords.y2 - pbottom; in draw_img()
652 const lv_area_t * clip_area_ori = draw_ctx->clip_area; in draw_img()
654 if(!_lv_area_intersect(&img_clip_area, draw_ctx->clip_area, &img_clip_area)) return; in draw_img()
655 draw_ctx->clip_area = &img_clip_area; in draw_img()
658 lv_coord_t offset_x = img->offset.x % img->w; in draw_img()
659 lv_coord_t offset_y = img->offset.y % img->h; in draw_img()
661 if(coords_tmp.y1 > img_max_area.y1) coords_tmp.y1 -= img->h; in draw_img()
662 coords_tmp.y2 = coords_tmp.y1 + img->h - 1; in draw_img()
664 …s_tmp.y1 < img_max_area.y2; coords_tmp.y1 += img_size_final.y, coords_tmp.y2 += img_size_final.y) { in draw_img()
666 if(coords_tmp.x1 > img_max_area.x1) coords_tmp.x1 -= img->w; in draw_img()
667 coords_tmp.x2 = coords_tmp.x1 + img->w - 1; in draw_img()
670 lv_draw_img(draw_ctx, &img_dsc, &coords_tmp, img->src); in draw_img()
673 draw_ctx->clip_area = clip_area_ori; in draw_img()
675 else if(img->src_type == LV_IMG_SRC_SYMBOL) { in draw_img()
680 lv_draw_label(draw_ctx, &label_dsc, &obj->coords, img->src, NULL); in draw_img()
685 lv_draw_img(draw_ctx, NULL, &obj->coords, NULL); in draw_img()