Skip to content

Commit

Permalink
ajout du premier binaire
Browse files Browse the repository at this point in the history
  • Loading branch information
Paullux committed Mar 11, 2023
1 parent d481cf9 commit 2d2035a
Show file tree
Hide file tree
Showing 8 changed files with 77 additions and 4 deletions.
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
__pycache__
test.py
/__pycache__
/test.py
/build/
/dist/
Binary file added Matrix.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 56 additions & 0 deletions Matrix.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# -*- mode: python ; coding: utf-8 -*-


block_cipher = None


a = Analysis(
['ascii12.py'],
pathex=[],
binaries=[],
datas=[('.\icon-32.png', '.\icon-32.png')],
hiddenimports=[],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False,
)
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
splash = Splash(
'Matrix.PNG',
binaries=a.binaries,
datas=a.datas,
text_pos=None,
text_size=12,
minify_script=True,
always_on_top=True,
)

exe = EXE(
pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
splash,
splash.binaries,
[],
name='Matrix',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=False,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
icon=['icon-32.png'],
)
19 changes: 17 additions & 2 deletions ascii12.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import threading
import os
import ctypes
import platform

# Définition des caractères à utiliser pour l'ASCII art
characters = np.asarray(list(' .,:;irsXA253hMHGS#9B&@'))
Expand Down Expand Up @@ -46,10 +47,20 @@ def image_to_ascii(image):
# Création de la fenêtre tkinter
root = tk.Tk()
root.configure(bg='#000')
root.geometry("1100x620")


sw = root.winfo_screenwidth()
sh = root.winfo_screenheight()
root.geometry("%dx%d+%d+%d" % (1100, 620, (sw-1100)/2, (sh-620)/2))
directory = os.getcwd()
root.tk.call('wm','iconphoto',root._w,tk.PhotoImage(file=directory + "/icon-32.png"))
root.title("ASCII Camera")
if getattr(sys, 'frozen', False):
import pyi_splash

# Fermeture du splash screen
pyi_splash.update_text('UI Loaded ...')
pyi_splash.close()

# Création du widget Label pour afficher l'ASCII art
w = tk.Label(root, text="", font=("Courier New", 8), fg='#0f0', bg='#000')
Expand All @@ -64,7 +75,11 @@ def image_to_ascii(image):
# Fonction pour mettre à jour l'image capturée
def capture_frame():
global frame
cap = cv2.VideoCapture(camera) # ⚠️ voir ligne 17 ⚠️
if platform.system() == 'Windows':
cap = cv2.VideoCapture(camera,cv2.CAP_DSHOW)
elif platform.system() == 'Linux':
cap = cv2.VideoCapture(camera)
#cap = cv2.VideoCapture(camera) # ⚠️ voir ligne 17 ⚠️
cap.set(cv2.CAP_PROP_FRAME_WIDTH, 1280)
cap.set(cv2.CAP_PROP_FRAME_HEIGHT, 720)
while running:
Expand Down
Binary file added icon-32.ico
Binary file not shown.
Binary file added output/Matrix.exe
Binary file not shown.
Binary file added output/icon-32.ico
Binary file not shown.
Binary file added output/icon-32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2d2035a

Please sign in to comment.