1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-01 10:52:19 +01:00

[image] Transparency changes; code refactor (#7908)

This commit is contained in:
Clyde Stubbs
2025-01-13 14:21:42 +11:00
committed by GitHub
parent aa87c60717
commit f1c0570e3b
27 changed files with 845 additions and 787 deletions

View File

@@ -0,0 +1,4 @@
*.apng -text
*.webp -text
*.gif -text

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

View File

@@ -0,0 +1,23 @@
animation:
- id: rgb565_animation
file: $component_dir/anim.gif
type: RGB565
use_transparency: opaque
resize: 50x50
- id: rgb_animation
file: $component_dir/anim.apng
type: RGB
use_transparency: chroma_key
resize: 50x50
- id: grayscale_animation
file: $component_dir/anim.apng
type: grayscale
display:
lambda: |-
id(rgb565_animation).next_frame();
id(rgb_animation1).next_frame();
id(grayscale_animation2).next_frame();
it.image(0, 0, rgb565_animation);
it.image(120, 0, rgb_animation1);
it.image(240, 0, grayscale_animation2);

View File

@@ -13,12 +13,6 @@ display:
reset_pin: 21
invert_colors: false
# Purposely test that `animation:` does auto-load `image:`
# Keep the `image:` undefined.
# image:
packages:
animation: !include common.yaml
animation:
- id: rgb565_animation
file: ../../pnglogo.png
type: RGB565
use_transparency: false

View File

@@ -13,12 +13,5 @@ display:
reset_pin: 10
invert_colors: false
# Purposely test that `animation:` does auto-load `image:`
# Keep the `image:` undefined.
# image:
animation:
- id: rgb565_animation
file: ../../pnglogo.png
type: RGB565
use_transparency: false
packages:
animation: !include common.yaml

View File

@@ -13,12 +13,5 @@ display:
reset_pin: 10
invert_colors: false
# Purposely test that `animation:` does auto-load `image:`
# Keep the `image:` undefined.
# image:
animation:
- id: rgb565_animation
file: ../../pnglogo.png
type: RGB565
use_transparency: false
packages:
animation: !include common.yaml

View File

@@ -13,12 +13,5 @@ display:
reset_pin: 21
invert_colors: false
# Purposely test that `animation:` does auto-load `image:`
# Keep the `image:` undefined.
# image:
animation:
- id: rgb565_animation
file: ../../pnglogo.png
type: RGB565
use_transparency: false
packages:
animation: !include common.yaml

View File

@@ -13,12 +13,5 @@ display:
reset_pin: 16
invert_colors: false
# Purposely test that `animation:` does auto-load `image:`
# Keep the `image:` undefined.
# image:
animation:
- id: rgb565_animation
file: ../../pnglogo.png
type: RGB565
use_transparency: false
packages:
animation: !include common.yaml

View File

@@ -13,12 +13,5 @@ display:
reset_pin: 22
invert_colors: false
# Purposely test that `animation:` does auto-load `image:`
# Keep the `image:` undefined.
# image:
animation:
- id: rgb565_animation
file: ../../pnglogo.png
type: RGB565
use_transparency: false
packages:
animation: !include common.yaml