Lines Matching refs:img

155     lv_image_t * img = (lv_image_t *)obj;  in lv_image_set_src()  local
176 if(img->src_type == LV_IMAGE_SRC_SYMBOL || img->src_type == LV_IMAGE_SRC_FILE) { in lv_image_set_src()
177 lv_free((void *)img->src); in lv_image_set_src()
179 img->src = NULL; in lv_image_set_src()
180 img->src_type = LV_IMAGE_SRC_UNKNOWN; in lv_image_set_src()
198 if(img->src_type == LV_IMAGE_SRC_FILE || img->src_type == LV_IMAGE_SRC_SYMBOL) { in lv_image_set_src()
199 lv_free((void *)img->src); in lv_image_set_src()
201 img->src = src; in lv_image_set_src()
205 if(img->src != src) { in lv_image_set_src()
210 if(img->src_type == LV_IMAGE_SRC_FILE || img->src_type == LV_IMAGE_SRC_SYMBOL) { in lv_image_set_src()
211 old_src = img->src; in lv_image_set_src()
216 img->src = new_str; in lv_image_set_src()
233 img->src_type = src_type; in lv_image_set_src()
234 img->w = header.w; in lv_image_set_src()
235 img->h = header.h; in lv_image_set_src()
236 img->cf = header.cf; in lv_image_set_src()
243 if(img->rotation || img->scale_x != LV_SCALE_NONE || img->scale_y != LV_SCALE_NONE) { in lv_image_set_src()
254 lv_image_t * img = (lv_image_t *)obj; in lv_image_set_offset_x() local
256 img->offset.x = x; in lv_image_set_offset_x()
264 lv_image_t * img = (lv_image_t *)obj; in lv_image_set_offset_y() local
266 img->offset.y = y; in lv_image_set_offset_y()
274 lv_image_t * img = (lv_image_t *)obj; in lv_image_set_rotation() local
275 if(img->align > LV_IMAGE_ALIGN_AUTO_TRANSFORM) { in lv_image_set_rotation()
283 if((uint32_t)angle == img->rotation) return; in lv_image_set_rotation()
291 … lv_image_buf_get_transformed_area(&a, w, h, img->rotation, img->scale_x, img->scale_y, &pivot_px); in lv_image_set_rotation()
298 img->rotation = angle; in lv_image_set_rotation()
307 … lv_image_buf_get_transformed_area(&a, w, h, img->rotation, img->scale_x, img->scale_y, &pivot_px); in lv_image_set_rotation()
319 lv_image_t * img = (lv_image_t *)obj; in lv_image_set_pivot() local
320 if(img->align > LV_IMAGE_ALIGN_AUTO_TRANSFORM) { in lv_image_set_pivot()
325 if(img->pivot.x == x && img->pivot.y == y) return; in lv_image_set_pivot()
333 … lv_image_buf_get_transformed_area(&a, w, h, img->rotation, img->scale_x, img->scale_y, &pivot_px); in lv_image_set_pivot()
340 lv_point_set(&img->pivot, x, y); in lv_image_set_pivot()
350 … lv_image_buf_get_transformed_area(&a, w, h, img->rotation, img->scale_x, img->scale_y, &pivot_px); in lv_image_set_pivot()
362 lv_image_t * img = (lv_image_t *)obj; in lv_image_set_scale() local
365 if(img->align > LV_IMAGE_ALIGN_AUTO_TRANSFORM) return; in lv_image_set_scale()
367 if(zoom == img->scale_x && zoom == img->scale_y) return; in lv_image_set_scale()
378 lv_image_t * img = (lv_image_t *)obj; in lv_image_set_scale_x() local
381 if(img->align > LV_IMAGE_ALIGN_AUTO_TRANSFORM) return; in lv_image_set_scale_x()
383 if(zoom == img->scale_x) return; in lv_image_set_scale_x()
387 scale_update(obj, zoom, img->scale_y); in lv_image_set_scale_x()
394 lv_image_t * img = (lv_image_t *)obj; in lv_image_set_scale_y() local
397 if(img->align > LV_IMAGE_ALIGN_AUTO_TRANSFORM) return; in lv_image_set_scale_y()
399 if(zoom == img->scale_y) return; in lv_image_set_scale_y()
403 scale_update(obj, img->scale_x, zoom); in lv_image_set_scale_y()
410 lv_image_t * img = (lv_image_t *)obj; in lv_image_set_blend_mode() local
413 if(img->blend_mode == blend_mode) return; in lv_image_set_blend_mode()
415 img->blend_mode = blend_mode; in lv_image_set_blend_mode()
424 lv_image_t * img = (lv_image_t *)obj; in lv_image_set_antialias() local
425 if(antialias == img->antialias) return; in lv_image_set_antialias()
427 img->antialias = antialias; in lv_image_set_antialias()
435 lv_image_t * img = (lv_image_t *)obj; in lv_image_set_inner_align() local
436 if(align == img->align) return; in lv_image_set_inner_align()
439 if(img->align == LV_IMAGE_ALIGN_STRETCH) { in lv_image_set_inner_align()
443 img->align = align; in lv_image_set_inner_align()
452 lv_image_t * img = (lv_image_t *)obj; in lv_image_set_bitmap_map_src() local
453 img->bitmap_mask_src = src; in lv_image_set_bitmap_map_src()
465 lv_image_t * img = (lv_image_t *)obj; in lv_image_get_src() local
467 return img->src; in lv_image_get_src()
474 lv_image_t * img = (lv_image_t *)obj; in lv_image_get_offset_x() local
476 return img->offset.x; in lv_image_get_offset_x()
483 lv_image_t * img = (lv_image_t *)obj; in lv_image_get_offset_y() local
485 return img->offset.y; in lv_image_get_offset_y()
492 lv_image_t * img = (lv_image_t *)obj; in lv_image_get_rotation() local
494 return img->rotation; in lv_image_get_rotation()
501 lv_image_t * img = (lv_image_t *)obj; in lv_image_get_pivot() local
503 pivot->x = lv_pct_to_px(img->pivot.x, img->w); in lv_image_get_pivot()
504 pivot->y = lv_pct_to_px(img->pivot.y, img->h); in lv_image_get_pivot()
511 lv_image_t * img = (lv_image_t *)obj; in lv_image_get_scale() local
513 return img->scale_x; in lv_image_get_scale()
520 lv_image_t * img = (lv_image_t *)obj; in lv_image_get_scale_x() local
522 return img->scale_x; in lv_image_get_scale_x()
529 lv_image_t * img = (lv_image_t *)obj; in lv_image_get_scale_y() local
531 return img->scale_y; in lv_image_get_scale_y()
538 lv_image_t * img = (lv_image_t *)obj; in lv_image_get_blend_mode() local
540 return img->blend_mode; in lv_image_get_blend_mode()
547 lv_image_t * img = (lv_image_t *)obj; in lv_image_get_antialias() local
549 return img->antialias ? true : false; in lv_image_get_antialias()
556 lv_image_t * img = (lv_image_t *)obj; in lv_image_get_inner_align() local
558 return img->align; in lv_image_get_inner_align()
565 lv_image_t * img = (lv_image_t *)obj; in lv_image_get_bitmap_map_src() local
567 return img->bitmap_mask_src; in lv_image_get_bitmap_map_src()
579 lv_image_t * img = (lv_image_t *)obj; in lv_image_constructor() local
581 img->src = NULL; in lv_image_constructor()
582 img->src_type = LV_IMAGE_SRC_UNKNOWN; in lv_image_constructor()
583 img->cf = LV_COLOR_FORMAT_UNKNOWN; in lv_image_constructor()
584 img->w = lv_obj_get_width(obj); in lv_image_constructor()
585 img->h = lv_obj_get_height(obj); in lv_image_constructor()
586 img->rotation = 0; in lv_image_constructor()
587 img->scale_x = LV_SCALE_NONE; in lv_image_constructor()
588 img->scale_y = LV_SCALE_NONE; in lv_image_constructor()
589 img->antialias = LV_COLOR_DEPTH > 8 ? 1 : 0; in lv_image_constructor()
590 lv_point_set(&img->offset, 0, 0); in lv_image_constructor()
591 lv_point_set(&img->pivot, LV_PCT(50), LV_PCT(50)); /*Default pivot to image center*/ in lv_image_constructor()
592 img->align = LV_IMAGE_ALIGN_CENTER; in lv_image_constructor()
603 lv_image_t * img = (lv_image_t *)obj; in lv_image_destructor() local
604 if(img->src_type == LV_IMAGE_SRC_FILE || img->src_type == LV_IMAGE_SRC_SYMBOL) { in lv_image_destructor()
605 lv_free((void *)img->src); in lv_image_destructor()
606 img->src = NULL; in lv_image_destructor()
607 img->src_type = LV_IMAGE_SRC_UNKNOWN; in lv_image_destructor()
622 lv_image_t * img = (lv_image_t *)obj; in lv_image_event() local
628 if(img->src_type == LV_IMAGE_SRC_SYMBOL) { in lv_image_event()
629 lv_image_set_src(obj, img->src); in lv_image_event()
641 if(img->rotation || img->scale_x != LV_SCALE_NONE || img->scale_y != LV_SCALE_NONE) { in lv_image_event()
645 … lv_image_buf_get_transformed_area(&a, w, h, img->rotation, img->scale_x, img->scale_y, &pivot_px); in lv_image_event()
657 if(img->w == lv_obj_get_width(obj) && img->h == lv_obj_get_height(obj) && in lv_image_event()
658 (img->scale_x != LV_SCALE_NONE || img->scale_y != LV_SCALE_NONE || in lv_image_event()
659 img->rotation != 0 || img->pivot.x != img->w / 2 || img->pivot.y != img->h / 2)) { in lv_image_event()
664 …lv_image_buf_get_transformed_area(&coords, w, h, img->rotation, img->scale_x, img->scale_y, &pivot… in lv_image_event()
680 p->x = img->w; in lv_image_event()
681 p->y = img->h; in lv_image_event()
692 lv_image_t * img = (lv_image_t *)obj; in draw_image() local
696 if(img->src_type == LV_IMAGE_SRC_UNKNOWN || img->src_type == LV_IMAGE_SRC_SYMBOL) { in draw_image()
702 if(lv_color_format_has_alpha(img->cf)) { in draw_image()
713 if(img->rotation != 0) { in draw_image()
718 if(img->scale_x == LV_SCALE_NONE && img->scale_y == LV_SCALE_NONE) { in draw_image()
728 …_transformed_area(&a, lv_obj_get_width(obj), lv_obj_get_height(obj), 0, img->scale_x, img->scale_y, in draw_image()
740 if(img->bitmap_mask_src) { in draw_image()
747 if(img->h == 0 || img->w == 0) return; in draw_image()
748 if(img->scale_x == 0 || img->scale_y == 0) return; in draw_image()
752 if(img->src_type == LV_IMAGE_SRC_FILE || img->src_type == LV_IMAGE_SRC_VARIABLE) { in draw_image()
761 draw_dsc.scale_x = img->scale_x; in draw_image()
762 draw_dsc.scale_y = img->scale_y; in draw_image()
763 draw_dsc.rotation = img->rotation; in draw_image()
764 draw_dsc.antialias = img->antialias; in draw_image()
765 draw_dsc.blend_mode = img->blend_mode; in draw_image()
766 draw_dsc.bitmap_mask_src = img->bitmap_mask_src; in draw_image()
767 draw_dsc.src = img->src; in draw_image()
771 obj->coords.x1 + img->w - 1, in draw_image()
772 obj->coords.y1 + img->h - 1); in draw_image()
777 if(img->align < LV_IMAGE_ALIGN_AUTO_TRANSFORM) { in draw_image()
778 … lv_area_align(&obj->coords, &draw_dsc.image_area, img->align, img->offset.x, img->offset.y); in draw_image()
781 else if(img->align == LV_IMAGE_ALIGN_TILE) { in draw_image()
783 lv_area_move(&draw_dsc.image_area, img->offset.x, img->offset.y); in draw_image()
786 … ((layer->_clip_area.x1 - draw_dsc.image_area.x1 - (img->w - 1)) / img->w) * img->w, in draw_image()
787 … ((layer->_clip_area.y1 - draw_dsc.image_area.y1 - (img->h - 1)) / img->h) * img->h); in draw_image()
799 else if(img->src_type == LV_IMAGE_SRC_SYMBOL) { in draw_image()
804 label_dsc.text = img->src; in draw_image()
807 else if(img->src == NULL) { in draw_image()
820 lv_image_t * img = (lv_image_t *)obj; in scale_update() local
828 … lv_image_buf_get_transformed_area(&a, w, h, img->rotation, img->scale_x, img->scale_y, &pivot_px); in scale_update()
835 img->scale_x = scale_x; in scale_update()
836 img->scale_y = scale_y; in scale_update()
845 … lv_image_buf_get_transformed_area(&a, w, h, img->rotation, img->scale_x, img->scale_y, &pivot_px); in scale_update()
855 lv_image_t * img = (lv_image_t *)obj; in update_align() local
856 if(img->align == LV_IMAGE_ALIGN_STRETCH) { in update_align()
859 if(img->w != 0 && img->h != 0) { in update_align()
861 int32_t scale_x = lv_obj_get_width(obj) * LV_SCALE_NONE / img->w; in update_align()
862 int32_t scale_y = lv_obj_get_height(obj) * LV_SCALE_NONE / img->h; in update_align()
866 else if(img->align == LV_IMAGE_ALIGN_TILE) { in update_align()