chore: fix spelling (#6401)

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Co-authored-by: Gabor Kiss-Vamosi <kisvegabor@gmail.com>
This commit is contained in:
Josh Soref
2024-06-28 03:09:23 -04:00
committed by GitHub
parent 94d48feb22
commit df0d36f02a
164 changed files with 414 additions and 411 deletions

View File

@@ -308,7 +308,7 @@ def write_c_array_file(
stride: int,
cf: ColorFormat,
filename: str,
premulitplied: bool,
premultiplied: bool,
compress: CompressMethod,
data: bytes):
varname = path.basename(filename).split('.')[0]
@@ -318,7 +318,7 @@ def write_c_array_file(
flags = "0"
if compress is not CompressMethod.NONE:
flags += " | LV_IMAGE_FLAGS_COMPRESSED"
if premulitplied:
if premultiplied:
flags += " | LV_IMAGE_FLAGS_PREMULTIPLIED"
macro = "LV_ATTRIBUTE_" + varname.upper()
@@ -494,7 +494,7 @@ class LVGLImage:
h: int = 0,
data: bytes = b'') -> None:
self.stride = 0 # default no valid stride value
self.premulitplied = False
self.premultiplied = False
self.set_data(cf, w, h, data)
def __repr__(self) -> str:
@@ -570,12 +570,12 @@ class LVGLImage:
self.stride = stride
self.data = bytearray(b''.join(data_out))
def premulitply(self):
def premultiply(self):
"""
Pre-multiply image RGB data with alpha, set corresponding image header flags
"""
if self.premulitplied:
raise ParameterError("Image already pre-mulitplied")
if self.premultiplied:
raise ParameterError("Image already pre-multiplied")
if not self.cf.has_alpha:
raise ParameterError(f"Image has no alpha channel: {self.cf.name}")
@@ -659,7 +659,7 @@ class LVGLImage:
else:
raise ParameterError(f"Not supported yet: {self.cf.name}")
self.premulitplied = True
self.premultiplied = True
@property
def data_len(self) -> int:
@@ -752,7 +752,7 @@ class LVGLImage:
bin = bytearray()
flags = 0
flags |= 0x08 if compress != CompressMethod.NONE else 0
flags |= 0x01 if self.premulitplied else 0
flags |= 0x01 if self.premultiplied else 0
header = LVGLImageHeader(self.cf,
self.w,
@@ -778,7 +778,7 @@ class LVGLImage:
else:
data = self.data
write_c_array_file(self.w, self.h, self.stride, self.cf, filename,
self.premulitplied,
self.premultiplied,
compress, data)
def to_png(self, filename: str):
@@ -1232,7 +1232,7 @@ class PNGConverter:
img = LVGLImage().from_png(f, self.cf, background=self.background)
img.adjust_stride(align=self.align)
if self.premultiply:
img.premulitply()
img.premultiply()
output.append((f, img))
if self.ofmt == OutputFormat.BIN_FILE:
img.to_bin(self._replace_ext(f, ".bin"),
@@ -1337,7 +1337,7 @@ def test():
cf=ColorFormat.ARGB8565,
background=0xFF_FF_00)
img.adjust_stride(align=16)
img.premulitply()
img.premultiply()
img.to_bin("output/cogwheel.ARGB8565.bin")
img.to_c_array("output/cogwheel-abc.c") # file name is used as c var name
img.to_png("output/cogwheel.ARGB8565.png.png") # convert back to png

View File

@@ -40,7 +40,7 @@ print("\tRES = " + str(width) + " x " + str(height) + '\n')
lenbuf = []
block_size = JPEG_SPLIT_HEIGHT;
spilts = math.ceil(height/block_size)
splits = math.ceil(height/block_size)
c_code = '''//LVGL SJPG C ARRAY\n#include "lvgl/lvgl.h"\n\nconst uint8_t ''' + OUTPUT_FILE_NAME + '''_map[] = {\n'''
@@ -49,7 +49,7 @@ sjpeg = bytearray()
row_remaining = height;
for i in range(spilts):
for i in range(splits):
if row_remaining < block_size:
crop = im.crop((0, i*block_size, width, row_remaining + i*block_size))
else:
@@ -61,7 +61,7 @@ for i in range(spilts):
for i in range(spilts):
for i in range(splits):
f = open(str(i)+".jpg", "rb")
a = f.read()
f.close()
@@ -83,7 +83,7 @@ header = header + width.to_bytes(2, byteorder='little');
header = header + height.to_bytes(2, byteorder='little');
#NUMBER OF ITEMS 2 BYTES
header = header + spilts.to_bytes(2, byteorder='little');
header = header + splits.to_bytes(2, byteorder='little');
#NUMBER OF ITEMS 2 BYTES
header = header + int(JPEG_SPLIT_HEIGHT).to_bytes(2, byteorder='little');

View File

@@ -421,7 +421,7 @@ props = [
{'name': 'FLEX_GROW',
'style_type': 'num', 'var_type': 'uint8_t', 'default':'`LV_FLEX_ALIGN_ROW`', 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Defines how mayn space to take proprtionally the free space of the object's trach"},
'dsc': "Defines how much space to take proportionally from the free space of the object's track"},