Skip to content

Commit 518bb20

Browse files
Camera app: simplify
1 parent a657a3b commit 518bb20

File tree

1 file changed

+10
-18
lines changed

1 file changed

+10
-18
lines changed

internal_filesystem/apps/com.micropythonos.camera/assets/camera_settings.py

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,6 @@
77
from mpos.content.intent import Intent
88

99
class CameraSettingsActivity(Activity):
10-
"""Settings activity for comprehensive camera configuration."""
11-
12-
DEFAULT_WIDTH = 240 # 240 would be better but webcam doesn't support this (yet)
13-
DEFAULT_HEIGHT = 240
14-
DEFAULT_COLORMODE = True
15-
DEFAULT_SCANQR_WIDTH = 960
16-
DEFAULT_SCANQR_HEIGHT = 960
17-
DEFAULT_SCANQR_COLORMODE = False
1810

1911
# Original: { 2560, 1920, 0, 0, 2623, 1951, 32, 16, 2844, 1968 }
2012
# Worked for digital zoom in C: { 2560, 1920, 0, 0, 2623, 1951, 992, 736, 2844, 1968 }
@@ -65,22 +57,22 @@ class CameraSettingsActivity(Activity):
6557
"lenc": True,
6658
}
6759

68-
# Normal mode specific defaults (5 settings)
60+
# Normal mode specific defaults
6961
NORMAL_DEFAULTS = {
70-
"resolution_width": DEFAULT_WIDTH, # 240
71-
"resolution_height": DEFAULT_HEIGHT, # 240
72-
"colormode": DEFAULT_COLORMODE, # True
62+
"resolution_width": 240,
63+
"resolution_height": 240,
64+
"colormode": True,
7365
"ae_level": 0,
7466
"raw_gma": True,
7567
}
7668

77-
# Scanqr mode specific defaults (5 settings, optimized for QR detection)
69+
# Scanqr mode specific defaults
7870
SCANQR_DEFAULTS = {
79-
"resolution_width": DEFAULT_SCANQR_WIDTH, # 960
80-
"resolution_height": DEFAULT_SCANQR_HEIGHT, # 960
81-
"colormode": DEFAULT_SCANQR_COLORMODE, # False (grayscale)
82-
"ae_level": 2, # Higher exposure compensation
83-
"raw_gma": False, # Disable gamma for better contrast
71+
"resolution_width": 960,
72+
"resolution_height": 960,
73+
"colormode": False,
74+
"ae_level": 2, # Higher auto-exposure compensation
75+
"raw_gma": False, # Disable raw gamma for better contrast
8476
}
8577

8678
# Resolution options for both ESP32 and webcam

0 commit comments

Comments
 (0)