|
25 | 25 |
|
26 | 26 | """
|
27 | 27 | import os
|
| 28 | + |
| 29 | +# Obsolete: This will be autodetected at runtime |
28 | 30 | SCREEN_W = 800 ## raspi touch
|
29 | 31 | SCREEN_H = 480 ## raspi touch
|
30 | 32 |
|
| 33 | +# Parameters for the three main effects |
| 34 | +# None: simple shot |
| 35 | +# Four: Collage of four shots |
| 36 | +# Animation : animated gif |
31 | 37 | EFFECTS_PARAMETERS = {
|
32 | 38 | "None": {
|
33 |
| - 'snap_size' : (1640,1232), |
34 |
| - 'logo_size' : 128, |
35 |
| - 'logo_padding' : 32 |
| 39 | + 'snap_size' : (1640,1232), #(width, height) => preferably use integer division of camera resolution |
| 40 | + 'logo_size' : 128, # height in pixels of the logo (will be thumbnailed to this size) |
| 41 | + 'logo_padding' : 32 # bottom and right padding of the logo (pixels) |
36 | 42 | },
|
37 | 43 | "Four": {
|
38 |
| - 'snap_size' : (820,616), |
39 |
| - 'foreground_image' : "collage_four_square.png" |
| 44 | + 'snap_size' : (820,616), #(width, height) of each shots of the 2x2 collage |
| 45 | + 'foreground_image' : "collage_four_square.png" # Overlay image on top of the collage |
40 | 46 | },
|
41 | 47 | "Animation": {
|
42 |
| - 'snap_size' : (500, 500), |
43 |
| - 'frame_number' : 10, |
44 |
| - 'snap_period_millis' : 200, |
45 |
| - 'gif_period_millis' : 50 |
| 48 | + 'snap_size' : (500, 500), #(width, height) => Caution, gif animation can be huge, keep this small |
| 49 | + 'frame_number' : 10, # number of frames in the animation |
| 50 | + 'snap_period_millis' : 200, # time interval between two snapshots |
| 51 | + 'gif_period_millis' : 50 # time interval in the animated gif |
46 | 52 | }
|
47 | 53 | }
|
48 | 54 |
|
| 55 | +# Path to icons for the software buttons (no hardware buttons setup) |
49 | 56 | SOFTWARE_BUTTONS = {
|
50 | 57 | "None": {
|
51 | 58 | "icon" : os.path.join("ressources","ic_photo.png")
|
|
58 | 65 | }
|
59 | 66 | }
|
60 | 67 |
|
| 68 | +# GPIO pin / Snapshots modes mapping |
| 69 | +# 'button_pins' are matched in this order ["No effect", "Four images", "Animation"] |
| 70 | +# 'pull_up_down' activates a pull_up or a pull_down on the GPIO pin itself (no external resistor needed) |
| 71 | +# 'active_state' should be 1 or 0: this is the value returned by the GPIO when switch is activated |
61 | 72 | HARDWARE_BUTTONS = {
|
62 | 73 | "button_pins": [10,8,12], # Change this and the following to reflect your hardware buttons
|
63 | 74 | "pull_up_down": "pull_down", # pull_up or pull_down
|
64 | 75 | "active_state": 1 # active 1 GPIO (pull_down with switch to VDD)
|
65 | 76 | }
|
66 | 77 |
|
| 78 | +#Keyboard shorcuts for actions |
| 79 | +#shortcut list must be valid tkinter events |
| 80 | +#See : http://effbot.org/tkinterbook/tkinter-events-and-bindings.htm |
67 | 81 | ACTIONS_KEYS_MAPPING = {
|
68 | 82 | "snap_None": ["s","S","<F1>"],
|
69 | 83 | "snap_Four": ["f","F","<F2>"],
|
|
73 | 87 | #,"send_print":["P"] #Uncomment if you want to a keyboard shortcut for printing
|
74 | 88 | }
|
75 | 89 |
|
| 90 | +#Image list for in-preview countdown |
| 91 | +#Use as many as you want |
| 92 | +# COUNTDOWN_OVERLAY_IMAGES[0] will be used during the last second of countdown |
| 93 | +# COUNTDOWN_OVERLAY_IMAGES[1] will be used during 1s to 2s |
| 94 | +# ... |
| 95 | +# last image of the list will be used for greater counts |
| 96 | +# (e.g. during the first 5 secs of a 10 secs countdown in this case) |
76 | 97 | COUNTDOWN_OVERLAY_IMAGES=[
|
77 | 98 | os.path.join("ressources","count_down_1.png"),
|
78 | 99 | os.path.join("ressources","count_down_2.png"),
|
79 | 100 | os.path.join("ressources","count_down_3.png"),
|
80 | 101 | os.path.join("ressources","count_down_4.png"),
|
81 | 102 | os.path.join("ressources","count_down_5.png"),
|
82 | 103 | os.path.join("ressources","count_down_ready.png")]
|
83 |
| -COUNTDOWN_IMAGE_MAX_HEIGHT_RATIO = 0.2 #(0. - 1.) Ratio of the countdown images over screen height |
| 104 | +# this defines the height ratio of the countdown images wrt. the preview size |
| 105 | +COUNTDOWN_IMAGE_MAX_HEIGHT_RATIO = 0.2 #[0. - 1.] range |
84 | 106 |
|
| 107 | +# Path to button icon ressources |
85 | 108 | EMAIL_BUTTON_IMG = os.path.join("ressources","ic_email.png")
|
86 | 109 | PRINT_BUTTON_IMG = os.path.join("ressources","ic_print.png")
|
| 110 | + |
| 111 | +# Interval in ms between two authentication tokens refreshing |
87 | 112 | OAUTH2_REFRESH_PERIOD = 1800000 # interval between two OAuth2 token refresh (ms)
|
88 |
| -HARDWARE_POLL_PERIOD = 100 # poll interval for buttons (ms) |
89 | 113 |
|
| 114 | +# Polling interval for hardware buttons (ms) |
| 115 | +HARDWARE_POLL_PERIOD = 100 |
| 116 | + |
| 117 | +# Path of various log and configuration files |
90 | 118 | CONFIGURATION_FILE = "configuration.json"
|
91 |
| -APP_ID_FILE = "client_id.json" |
| 119 | +APP_ID_FILE = "client_id.json" |
92 | 120 | CREDENTIALS_STORE_FILE = "credentials.dat"
|
93 | 121 | EMAILS_LOG_FILE = os.path.join("..","sendmail.log") # you should activate 'enable_mail_logging' key in configuration.json
|
0 commit comments