ascii-art-python 2.1.0__tar.gz → 2.1.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ascii_art_python-2.1.0/src/ascii_art_python.egg-info → ascii_art_python-2.1.1}/PKG-INFO +1 -1
- {ascii_art_python-2.1.0 → ascii_art_python-2.1.1}/pyproject.toml +1 -1
- {ascii_art_python-2.1.0 → ascii_art_python-2.1.1}/src/ascii_art_python/__init__.py +1 -1
- {ascii_art_python-2.1.0 → ascii_art_python-2.1.1}/src/ascii_art_python/ascii_base.py +16 -8
- {ascii_art_python-2.1.0 → ascii_art_python-2.1.1/src/ascii_art_python.egg-info}/PKG-INFO +1 -1
- {ascii_art_python-2.1.0 → ascii_art_python-2.1.1}/LICENSE +0 -0
- {ascii_art_python-2.1.0 → ascii_art_python-2.1.1}/MANIFEST.in +0 -0
- {ascii_art_python-2.1.0 → ascii_art_python-2.1.1}/README.md +0 -0
- {ascii_art_python-2.1.0 → ascii_art_python-2.1.1}/setup.cfg +0 -0
- {ascii_art_python-2.1.0 → ascii_art_python-2.1.1}/src/ascii_art_python/assets/fonts/GoogleSansCode-Regular.ttf +0 -0
- {ascii_art_python-2.1.0 → ascii_art_python-2.1.1}/src/ascii_art_python/assets/fonts/KreativeSquareSM.ttf +0 -0
- {ascii_art_python-2.1.0 → ascii_art_python-2.1.1}/src/ascii_art_python/cli.py +0 -0
- {ascii_art_python-2.1.0 → ascii_art_python-2.1.1}/src/ascii_art_python/full_mode.py +0 -0
- {ascii_art_python-2.1.0 → ascii_art_python-2.1.1}/src/ascii_art_python/new_skool.py +0 -0
- {ascii_art_python-2.1.0 → ascii_art_python-2.1.1}/src/ascii_art_python/old_skool.py +0 -0
- {ascii_art_python-2.1.0 → ascii_art_python-2.1.1}/src/ascii_art_python/tools.py +0 -0
- {ascii_art_python-2.1.0 → ascii_art_python-2.1.1}/src/ascii_art_python.egg-info/SOURCES.txt +0 -0
- {ascii_art_python-2.1.0 → ascii_art_python-2.1.1}/src/ascii_art_python.egg-info/dependency_links.txt +0 -0
- {ascii_art_python-2.1.0 → ascii_art_python-2.1.1}/src/ascii_art_python.egg-info/entry_points.txt +0 -0
- {ascii_art_python-2.1.0 → ascii_art_python-2.1.1}/src/ascii_art_python.egg-info/requires.txt +0 -0
- {ascii_art_python-2.1.0 → ascii_art_python-2.1.1}/src/ascii_art_python.egg-info/top_level.txt +0 -0
- {ascii_art_python-2.1.0 → ascii_art_python-2.1.1}/tests/test_ascii_api.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ascii_art_python
|
|
3
|
-
Version: 2.1.
|
|
3
|
+
Version: 2.1.1
|
|
4
4
|
Summary: A Python library and CLI tool for converting images and videos into ASCII art.
|
|
5
5
|
Author-email: Guillem Prieur <prieurguillem38@gmail.com>
|
|
6
6
|
Project-URL: Homepage, https://gitlab.pprriieeuurr.fr/guill_prieur/ascii-art-python-2
|
|
@@ -10,7 +10,7 @@ import pathlib
|
|
|
10
10
|
import sys
|
|
11
11
|
import time
|
|
12
12
|
from abc import ABC, abstractmethod
|
|
13
|
-
from typing import Any, Callable, List, Optional
|
|
13
|
+
from typing import Any, Callable, List, Optional
|
|
14
14
|
|
|
15
15
|
import cv2
|
|
16
16
|
import numpy as np
|
|
@@ -560,7 +560,7 @@ class Video:
|
|
|
560
560
|
if hasattr(self, "_cap") and self._cap is not None:
|
|
561
561
|
self._cap.release()
|
|
562
562
|
|
|
563
|
-
def export(self, filename: str = "mika_export", sound: bool = False, font_size: int = 12):
|
|
563
|
+
def export(self, filename: str = "mika_export", sound: bool = False, font_size: int = 12) -> None:
|
|
564
564
|
"""
|
|
565
565
|
Exports the processed ASCII video to an mp4 file.
|
|
566
566
|
|
|
@@ -593,7 +593,6 @@ class Video:
|
|
|
593
593
|
out_width += 1
|
|
594
594
|
if out_height % 2 != 0:
|
|
595
595
|
out_height += 1
|
|
596
|
-
|
|
597
596
|
fourcc = cv2.VideoWriter_fourcc(*"mp4v")
|
|
598
597
|
out = cv2.VideoWriter(
|
|
599
598
|
filename + ".mp4",
|
|
@@ -636,11 +635,20 @@ class Video:
|
|
|
636
635
|
if not callable(func_print):
|
|
637
636
|
raise TypeError("func_print must be a callable")
|
|
638
637
|
|
|
639
|
-
|
|
640
|
-
|
|
638
|
+
actual_frame_skip = max(1, int(self.fps / self.max_fps))
|
|
639
|
+
effective_fps = self.fps / actual_frame_skip
|
|
640
|
+
|
|
641
|
+
frame_duration = 1.0 / effective_fps
|
|
641
642
|
|
|
642
643
|
with self:
|
|
643
|
-
|
|
644
|
-
|
|
644
|
+
start_time = time.perf_counter()
|
|
645
|
+
|
|
646
|
+
for i, frame in enumerate(self):
|
|
647
|
+
expected_time = start_time + (i * frame_duration)
|
|
648
|
+
|
|
649
|
+
sleep_time = expected_time - time.perf_counter()
|
|
650
|
+
|
|
651
|
+
if sleep_time > 0:
|
|
652
|
+
time.sleep(sleep_time)
|
|
653
|
+
|
|
645
654
|
func_print(frame.get_alternate_lines())
|
|
646
|
-
next_sleep += time_between
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ascii_art_python
|
|
3
|
-
Version: 2.1.
|
|
3
|
+
Version: 2.1.1
|
|
4
4
|
Summary: A Python library and CLI tool for converting images and videos into ASCII art.
|
|
5
5
|
Author-email: Guillem Prieur <prieurguillem38@gmail.com>
|
|
6
6
|
Project-URL: Homepage, https://gitlab.pprriieeuurr.fr/guill_prieur/ascii-art-python-2
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ascii_art_python-2.1.0 → ascii_art_python-2.1.1}/src/ascii_art_python.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{ascii_art_python-2.1.0 → ascii_art_python-2.1.1}/src/ascii_art_python.egg-info/entry_points.txt
RENAMED
|
File without changes
|
{ascii_art_python-2.1.0 → ascii_art_python-2.1.1}/src/ascii_art_python.egg-info/requires.txt
RENAMED
|
File without changes
|
{ascii_art_python-2.1.0 → ascii_art_python-2.1.1}/src/ascii_art_python.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|