mirror of
https://github.com/lvgl/lvgl.git
synced 2026-05-31 07:56:23 +08:00
fix(script): Remove TRUECOLOR for LVGLImage.py (#5523)
This commit is contained in:
+4
-12
@@ -104,8 +104,6 @@ class CompressMethod(Enum):
|
|||||||
|
|
||||||
class ColorFormat(Enum):
|
class ColorFormat(Enum):
|
||||||
UNKNOWN = 0x00
|
UNKNOWN = 0x00
|
||||||
TRUECOLOR = 0x04
|
|
||||||
TRUECOLOR_ALPHA = 0x05
|
|
||||||
L8 = 0x06
|
L8 = 0x06
|
||||||
I1 = 0x07
|
I1 = 0x07
|
||||||
I2 = 0x08
|
I2 = 0x08
|
||||||
@@ -142,8 +140,6 @@ class ColorFormat(Enum):
|
|||||||
ColorFormat.RGB565: 16,
|
ColorFormat.RGB565: 16,
|
||||||
ColorFormat.RGB565A8: 16, # 16bpp + a8 map
|
ColorFormat.RGB565A8: 16, # 16bpp + a8 map
|
||||||
ColorFormat.RGB888: 24,
|
ColorFormat.RGB888: 24,
|
||||||
ColorFormat.TRUECOLOR: 32,
|
|
||||||
ColorFormat.TRUECOLOR_ALPHA: 32,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return cf_map[self]
|
return cf_map[self]
|
||||||
@@ -179,16 +175,13 @@ class ColorFormat(Enum):
|
|||||||
return self.is_alpha_only or self in (
|
return self.is_alpha_only or self in (
|
||||||
ColorFormat.ARGB8888,
|
ColorFormat.ARGB8888,
|
||||||
ColorFormat.XRGB8888, # const alpha: 0xff
|
ColorFormat.XRGB8888, # const alpha: 0xff
|
||||||
ColorFormat.TRUECOLOR, # const alpha: 0xff
|
|
||||||
ColorFormat.TRUECOLOR_ALPHA,
|
|
||||||
ColorFormat.RGB565A8)
|
ColorFormat.RGB565A8)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def is_colormap(self) -> bool:
|
def is_colormap(self) -> bool:
|
||||||
return self in (ColorFormat.ARGB8888, ColorFormat.RGB888,
|
return self in (ColorFormat.ARGB8888, ColorFormat.RGB888,
|
||||||
ColorFormat.XRGB8888, ColorFormat.RGB565A8,
|
ColorFormat.XRGB8888, ColorFormat.RGB565A8,
|
||||||
ColorFormat.RGB565, ColorFormat.TRUECOLOR_ALPHA,
|
ColorFormat.RGB565)
|
||||||
ColorFormat.TRUECOLOR)
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def is_luma_only(self) -> bool:
|
def is_luma_only(self) -> bool:
|
||||||
@@ -819,11 +812,11 @@ const lv_img_dsc_t {varname} = {{
|
|||||||
|
|
||||||
def _png_to_colormap(self, cf, filename: str):
|
def _png_to_colormap(self, cf, filename: str):
|
||||||
|
|
||||||
if cf in (ColorFormat.ARGB8888, ColorFormat.TRUECOLOR_ALPHA):
|
if cf == ColorFormat.ARGB8888:
|
||||||
|
|
||||||
def pack(r, g, b, a):
|
def pack(r, g, b, a):
|
||||||
return uint32_t((a << 24) | (r << 16) | (g << 8) | (b << 0))
|
return uint32_t((a << 24) | (r << 16) | (g << 8) | (b << 0))
|
||||||
elif cf in (ColorFormat.XRGB8888, ColorFormat.TRUECOLOR):
|
elif cf == ColorFormat.XRGB8888:
|
||||||
|
|
||||||
def pack(r, g, b, a):
|
def pack(r, g, b, a):
|
||||||
r, g, b, a = color_pre_multiply(r, g, b, a, self.background)
|
r, g, b, a = color_pre_multiply(r, g, b, a, self.background)
|
||||||
@@ -1064,8 +1057,7 @@ def main():
|
|||||||
default="I8",
|
default="I8",
|
||||||
choices=[
|
choices=[
|
||||||
"L8", "I1", "I2", "I4", "I8", "A1", "A2", "A4", "A8", "ARGB8888",
|
"L8", "I1", "I2", "I4", "I8", "A1", "A2", "A4", "A8", "ARGB8888",
|
||||||
"XRGB8888", "RGB565", "RGB565A8", "RGB888", "TRUECOLOR",
|
"XRGB8888", "RGB565", "RGB565A8", "RGB888", "AUTO"
|
||||||
"TRUECOLOR_ALPHA", "AUTO"
|
|
||||||
])
|
])
|
||||||
|
|
||||||
parser.add_argument('--compress',
|
parser.add_argument('--compress',
|
||||||
|
|||||||
+1
-1
@@ -145,7 +145,7 @@ def generate_code_coverage_report():
|
|||||||
|
|
||||||
|
|
||||||
def generate_test_images():
|
def generate_test_images():
|
||||||
invalids = (ColorFormat.UNKNOWN, ColorFormat.TRUECOLOR, ColorFormat.TRUECOLOR_ALPHA)
|
invalids = (ColorFormat.UNKNOWN,)
|
||||||
formats = [i for i in ColorFormat if i not in invalids]
|
formats = [i for i in ColorFormat if i not in invalids]
|
||||||
png_path = os.path.join(lvgl_test_dir, "test_images/pngs")
|
png_path = os.path.join(lvgl_test_dir, "test_images/pngs")
|
||||||
pngs = list(Path(png_path).rglob("*.[pP][nN][gG]"))
|
pngs = list(Path(png_path).rglob("*.[pP][nN][gG]"))
|
||||||
|
|||||||
Reference in New Issue
Block a user