Lines Matching refs:img

23     lv_obj_t * img = lv_image_create(lv_screen_active());  in img_create()  local
24 lv_image_set_src(img, &test_img_lvgl_logo_png); in img_create()
25 lv_obj_set_style_bg_opa(img, LV_OPA_20, 0); in img_create()
26 lv_obj_set_style_bg_color(img, lv_color_hex(0x000000), 0); in img_create()
27 lv_obj_set_style_shadow_width(img, 10, 0); in img_create()
28 lv_obj_set_style_shadow_color(img, lv_color_hex(0xff0000), 0); in img_create()
29 return img; in img_create()
34 lv_obj_t * img; in test_image_rotated_pivot_center() local
37 img = img_create(); in test_image_rotated_pivot_center()
38 lv_obj_set_pos(img, 100 + (i % 4) * 160, 150 + (i / 4) * 150); in test_image_rotated_pivot_center()
39 lv_image_set_rotation(img, i * 450); in test_image_rotated_pivot_center()
48 lv_obj_t * img; in test_image_rotated_pivot_top_left() local
51 img = img_create(); in test_image_rotated_pivot_top_left()
52 lv_obj_set_pos(img, 120 + (i % 4) * 180, 100 + (i / 4) * 300); in test_image_rotated_pivot_top_left()
53 lv_image_set_rotation(img, i * 450); in test_image_rotated_pivot_top_left()
54 lv_image_set_pivot(img, 0, 0); in test_image_rotated_pivot_top_left()
62 lv_obj_t * img; in test_image_scale_pivot_center() local
65 img = img_create(); in test_image_scale_pivot_center()
66 lv_obj_set_pos(img, 40 + (i % 4) * 200, 150 + (i / 4) * 150); in test_image_scale_pivot_center()
67 lv_image_set_scale(img, 64 + i * 64); in test_image_scale_pivot_center()
76 lv_obj_t * img; in test_image_scale_pivot_top_left() local
79 img = img_create(); in test_image_scale_pivot_top_left()
80 lv_obj_set_pos(img, 10 + (i % 4) * 190, 150 + (i / 4) * 150); in test_image_scale_pivot_top_left()
81 lv_image_set_scale(img, 64 + i * 64); in test_image_scale_pivot_top_left()
82 lv_image_set_pivot(img, 0, 0); in test_image_scale_pivot_top_left()
90 lv_obj_t * img; in test_image_scale_x_pivot_center() local
93 img = img_create(); in test_image_scale_x_pivot_center()
94 lv_obj_set_pos(img, 40 + (i % 4) * 200, 150 + (i / 4) * 150); in test_image_scale_x_pivot_center()
95 lv_image_set_scale_x(img, 64 + i * 64); in test_image_scale_x_pivot_center()
104 lv_obj_t * img; in test_image_scale_x_pivot_top_left() local
107 img = img_create(); in test_image_scale_x_pivot_top_left()
108 lv_obj_set_pos(img, 10 + (i % 4) * 190, 150 + (i / 4) * 150); in test_image_scale_x_pivot_top_left()
109 lv_image_set_scale_x(img, 64 + i * 64); in test_image_scale_x_pivot_top_left()
110 lv_image_set_pivot(img, 0, 0); in test_image_scale_x_pivot_top_left()
118 lv_obj_t * img; in test_image_scale_y_pivot_center() local
121 img = img_create(); in test_image_scale_y_pivot_center()
122 lv_obj_set_pos(img, 40 + (i % 4) * 200, 150 + (i / 4) * 150); in test_image_scale_y_pivot_center()
123 lv_image_set_scale_y(img, 64 + i * 64); in test_image_scale_y_pivot_center()
132 lv_obj_t * img; in test_image_scale_y_pivot_top_left() local
135 img = img_create(); in test_image_scale_y_pivot_top_left()
136 lv_obj_set_pos(img, 10 + (i % 4) * 190, 150 + (i / 4) * 150); in test_image_scale_y_pivot_top_left()
137 lv_image_set_scale_y(img, 64 + i * 64); in test_image_scale_y_pivot_top_left()
138 lv_image_set_pivot(img, 0, 0); in test_image_scale_y_pivot_top_left()
146 lv_obj_t * img; in test_image_rotate_and_scale_pivot_center() local
149 img = img_create(); in test_image_rotate_and_scale_pivot_center()
150 lv_obj_set_pos(img, 40 + (i % 4) * 200, 150 + (i / 4) * 150); in test_image_rotate_and_scale_pivot_center()
151 lv_image_set_scale_x(img, 64 + i * 64); in test_image_rotate_and_scale_pivot_center()
152 lv_image_set_scale_y(img, 32 + i * 96); in test_image_rotate_and_scale_pivot_center()
153 lv_image_set_rotation(img, 200 + i * 333); in test_image_rotate_and_scale_pivot_center()
162 lv_obj_t * img; in test_image_rotate_and_scale_pivot_top_left() local
165 img = img_create(); in test_image_rotate_and_scale_pivot_top_left()
166 lv_obj_set_pos(img, 120 + (i % 4) * 180, 120 + (i / 4) * 220); in test_image_rotate_and_scale_pivot_top_left()
167 lv_image_set_scale_x(img, 64 + i * 64); in test_image_rotate_and_scale_pivot_top_left()
168 lv_image_set_scale_y(img, 32 + i * 96); in test_image_rotate_and_scale_pivot_top_left()
169 lv_image_set_rotation(img, 200 + i * 333); in test_image_rotate_and_scale_pivot_top_left()
170 lv_image_set_pivot(img, 0, 0); in test_image_rotate_and_scale_pivot_top_left()
178 lv_obj_t * img; in test_image_normal_align() local
187 img = img_create(); in test_image_normal_align()
188 lv_obj_set_size(img, 200, 120); in test_image_normal_align()
189 lv_obj_set_pos(img, 30 + (i % 3) * 260, 40 + (i / 3) * 150); in test_image_normal_align()
190 lv_image_set_inner_align(img, aligns[i]); in test_image_normal_align()
198 lv_obj_t * img; in test_image_normal_align_offset() local
207 img = img_create(); in test_image_normal_align_offset()
208 lv_obj_set_size(img, 200, 120); in test_image_normal_align_offset()
209 lv_obj_set_pos(img, 30 + (i % 3) * 260, 40 + (i / 3) * 150); in test_image_normal_align_offset()
210 lv_image_set_inner_align(img, aligns[i]); in test_image_normal_align_offset()
211 lv_image_set_offset_x(img, 15); in test_image_normal_align_offset()
212 lv_image_set_offset_y(img, 20); in test_image_normal_align_offset()
220 lv_obj_t * img; in test_image_transform_align() local
229 img = img_create(); in test_image_transform_align()
230 lv_obj_set_size(img, 200, 120); in test_image_transform_align()
231 lv_obj_set_pos(img, 30 + (i % 3) * 260, 40 + (i / 3) * 150); in test_image_transform_align()
232 lv_image_set_scale_x(img, 300); in test_image_transform_align()
233 lv_image_set_scale_y(img, 200); in test_image_transform_align()
234 lv_image_set_rotation(img, 200); in test_image_transform_align()
235 lv_image_set_inner_align(img, aligns[i]); in test_image_transform_align()
243 lv_obj_t * img; in test_image_transform_align_offset() local
252 img = img_create(); in test_image_transform_align_offset()
253 lv_obj_set_size(img, 200, 120); in test_image_transform_align_offset()
254 lv_obj_set_pos(img, 30 + (i % 3) * 260, 40 + (i / 3) * 150); in test_image_transform_align_offset()
255 lv_image_set_inner_align(img, aligns[i]); in test_image_transform_align_offset()
256 lv_image_set_offset_x(img, 15); in test_image_transform_align_offset()
257 lv_image_set_offset_y(img, 20); in test_image_transform_align_offset()
258 lv_image_set_scale_x(img, 300); in test_image_transform_align_offset()
259 lv_image_set_scale_y(img, 200); in test_image_transform_align_offset()
260 lv_image_set_rotation(img, 200); in test_image_transform_align_offset()
268 lv_obj_t * img; in test_image_stretch() local
278 img = img_create(); in test_image_stretch()
279 lv_obj_set_size(img, w_array[i / 3], h_array[i % 3]); in test_image_stretch()
280 lv_obj_set_pos(img, 30 + (i % 3) * 260, 40 + (i / 3) * 150); in test_image_stretch()
281 lv_image_set_inner_align(img, LV_IMAGE_ALIGN_STRETCH); in test_image_stretch()
289 lv_obj_t * img; in test_image_tile() local
291 img = img_create(); in test_image_tile()
292 lv_obj_set_size(img, 350, LV_SIZE_CONTENT); in test_image_tile()
293 lv_image_set_inner_align(img, LV_IMAGE_ALIGN_TILE); in test_image_tile()
294 lv_obj_set_pos(img, 20, 20); in test_image_tile()
295 img = img_create(); in test_image_tile()
297 lv_obj_set_size(img, LV_SIZE_CONTENT, 150); in test_image_tile()
298 lv_image_set_inner_align(img, LV_IMAGE_ALIGN_TILE); in test_image_tile()
299 lv_obj_set_pos(img, 420, 20); in test_image_tile()
301 img = img_create(); in test_image_tile()
302 lv_obj_set_size(img, LV_SIZE_CONTENT, LV_SIZE_CONTENT); in test_image_tile()
303 lv_image_set_inner_align(img, LV_IMAGE_ALIGN_TILE); in test_image_tile()
304 lv_obj_set_pos(img, 20, 220); in test_image_tile()
305 lv_image_set_offset_x(img, -20); in test_image_tile()
306 lv_image_set_offset_y(img, 20); in test_image_tile()
308 img = img_create(); in test_image_tile()
309 lv_obj_set_size(img, 150, 150); in test_image_tile()
310 lv_image_set_inner_align(img, LV_IMAGE_ALIGN_TILE); in test_image_tile()
311 lv_obj_set_pos(img, 220, 220); in test_image_tile()
313 img = img_create(); in test_image_tile()
314 lv_obj_set_size(img, 150, 150); in test_image_tile()
315 lv_image_set_inner_align(img, LV_IMAGE_ALIGN_TILE); in test_image_tile()
316 lv_obj_set_pos(img, 420, 220); in test_image_tile()
317 lv_image_set_offset_x(img, -2000); in test_image_tile()
318 lv_image_set_offset_y(img, 2000); in test_image_tile()
325 lv_obj_t * img = img_create(); in test_image_ignore_transformation_settings_when_stretched() local
326 lv_obj_set_size(img, 200, 300); in test_image_ignore_transformation_settings_when_stretched()
327 lv_image_set_inner_align(img, LV_IMAGE_ALIGN_STRETCH); in test_image_ignore_transformation_settings_when_stretched()
329 lv_image_set_rotation(img, 100); in test_image_ignore_transformation_settings_when_stretched()
330 lv_image_set_pivot(img, 200, 300); in test_image_ignore_transformation_settings_when_stretched()
331 TEST_ASSERT_EQUAL_INT(0, lv_image_get_rotation(img)); in test_image_ignore_transformation_settings_when_stretched()
334 lv_image_get_pivot(img, &pivot); in test_image_ignore_transformation_settings_when_stretched()
338 int32_t scale_x_original = lv_image_get_scale_x(img); in test_image_ignore_transformation_settings_when_stretched()
339 int32_t scale_y_original = lv_image_get_scale_y(img); in test_image_ignore_transformation_settings_when_stretched()
340 lv_image_set_scale_x(img, 400); in test_image_ignore_transformation_settings_when_stretched()
341 lv_image_set_scale_y(img, 500); in test_image_ignore_transformation_settings_when_stretched()
342 TEST_ASSERT_EQUAL_INT(scale_x_original, lv_image_get_scale_x(img)); in test_image_ignore_transformation_settings_when_stretched()
343 TEST_ASSERT_EQUAL_INT(scale_y_original, lv_image_get_scale_y(img)); in test_image_ignore_transformation_settings_when_stretched()
348 lv_obj_t * img = img_create(); in test_image_ignore_transformation_settings_when_tiled() local
349 lv_obj_set_size(img, 200, 300); in test_image_ignore_transformation_settings_when_tiled()
350 lv_image_set_inner_align(img, LV_IMAGE_ALIGN_TILE); in test_image_ignore_transformation_settings_when_tiled()
352 lv_image_set_rotation(img, 100); in test_image_ignore_transformation_settings_when_tiled()
353 lv_image_set_pivot(img, 200, 300); in test_image_ignore_transformation_settings_when_tiled()
354 lv_image_set_scale_x(img, 400); in test_image_ignore_transformation_settings_when_tiled()
355 lv_image_set_scale_y(img, 500); in test_image_ignore_transformation_settings_when_tiled()
358 lv_image_get_pivot(img, &pivot); in test_image_ignore_transformation_settings_when_tiled()
361 TEST_ASSERT_EQUAL_INT(0, lv_image_get_rotation(img)); in test_image_ignore_transformation_settings_when_tiled()
362 TEST_ASSERT_EQUAL_INT(LV_SCALE_NONE, lv_image_get_scale_x(img)); in test_image_ignore_transformation_settings_when_tiled()
363 TEST_ASSERT_EQUAL_INT(LV_SCALE_NONE, lv_image_get_scale_y(img)); in test_image_ignore_transformation_settings_when_tiled()
420 lv_obj_t * img = lv_image_create(cont); in create_test_images() local
421 lv_image_set_src(img, img_dscs[i]); in create_test_images()
422 lv_obj_set_style_radius(img, radius, 0); in create_test_images()
423 lv_obj_set_style_image_recolor(img, lv_color_hex3(0xf00), 0); in create_test_images()
424 lv_image_set_scale(img, scale); in create_test_images()
425 lv_image_set_rotation(img, angle); in create_test_images()