Lines Matching +full:apt +full:- +full:get

22 def uint8_t(val) -> bytes:
26 def uint16_t(val) -> bytes:
30 def uint24_t(val) -> bytes:
34 def uint32_t(val) -> bytes:
46 return ((r * a + (255 - a) * br) >> 8, (g * a + (255 - a) * bg) >> 8,
47 (b * a + (255 - a) * bb) >> 8, a)
74 def __init__(self, ncolors=256, dither=True, exec_path="") -> None:
76 self.cmd = (f"{executable} {'--nofs' if not dither else ''} "
77 f"{ncolors} --force - < ")
79 def convert(self, filename) -> bytes:
91 "`sudo apt install pngquant` for debian "
126 def bpp(self) -> int:
151 def ncolors(self) -> int:
163 return cf_map.get(self, 0)
166 def is_indexed(self) -> bool:
173 def is_alpha_only(self) -> bool:
177 def has_alpha(self) -> bool:
185 def is_colormap(self) -> bool:
191 def is_luma_only(self) -> bool:
206 res |= value << (8 - bpp_now)
212 def unpack_colors(data: bytes, cf: ColorFormat, w) -> List:
229 ret.append(values[(p >> (4 - i * 4)) & 0x0f])
240 ret.append(values[(p >> (6 - i * 2)) & 0x03])
250 ret.append(values[(p >> (7 - i)) & 0x01])
271 pixel_alpha = data[-alpha_size:]
272 pixel_data = data[:-alpha_size]
315 varname = varname.replace("-", "_")
409 def stride_align(self, align: int) -> int:
414 stride = (stride + align - 1) // align
423 def stride_default(self) -> int:
427 def binary(self) -> bytearray:
466 def _compress(self, raw_data: bytes) -> bytearray:
474 pad = b'\x00' * (self.blk_size - self.raw_data_len % self.blk_size)
497 data: bytes = b'') -> None:
503 def __repr__(self) -> str:
505 f"{'Pre-multiplied, ' if self.premultiplied else ''}"
551 padding = b'\x00' * (new_stride - current_stride)
568 a8_map = self.data[-a8_stride * self.h:]
578 Pre-multiply image RGB data with alpha, set corresponding image header flags
581 raise ParameterError("Image already pre-multiplied")
668 def data_len(self) -> int:
682 def header(self) -> bytearray:
856 for c in names[1:-1]:
879 # read the image data to get the metadata
909 palette += [(255, 255, 255, 0)] * (cf.ncolors - palette_len)
941 shift = 8 - cf.bpp
942 mask = 2**cf.bpp - 1
957 return 1.055 * pow(y, 1 / 2.4) - 0.055
1110 data: bytes = b'') -> None:
1224 data: bytes = b'') -> None:
1265 rgb565_dither=False) -> None:
1315 parser.add_argument('--ofmt',
1320 '--cf',
1330 parser.add_argument('--rgb565dither', action='store_true',
1333 parser.add_argument('--premultiply', action='store_true',
1334 help="pre-multiply color with alpha", default=False)
1336 parser.add_argument('--compress',
1341 parser.add_argument('--align',
1347 parser.add_argument('--background',
1353 parser.add_argument('-o',
1354 '--output',
1357 parser.add_argument('-v', '--verbose', action='store_true')
1411 img.to_c_array("output/cogwheel-abc.c") # file name is used as c var name
1420 img.to_c_array("output/cogwheel-raw.c")