PySSTV 0.5.5__tar.gz → 0.5.7__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.
Files changed (30) hide show
  1. {PySSTV-0.5.5 → pysstv-0.5.7}/PKG-INFO +14 -5
  2. {PySSTV-0.5.5 → pysstv-0.5.7}/PySSTV.egg-info/PKG-INFO +14 -5
  3. {PySSTV-0.5.5 → pysstv-0.5.7}/README.md +13 -4
  4. {PySSTV-0.5.5 → pysstv-0.5.7}/pysstv/__main__.py +15 -2
  5. {PySSTV-0.5.5 → pysstv-0.5.7}/pysstv/color.py +52 -2
  6. {PySSTV-0.5.5 → pysstv-0.5.7}/setup.py +1 -1
  7. {PySSTV-0.5.5 → pysstv-0.5.7}/LICENSE.txt +0 -0
  8. {PySSTV-0.5.5 → pysstv-0.5.7}/MANIFEST.in +0 -0
  9. {PySSTV-0.5.5 → pysstv-0.5.7}/PySSTV.egg-info/SOURCES.txt +0 -0
  10. {PySSTV-0.5.5 → pysstv-0.5.7}/PySSTV.egg-info/dependency_links.txt +0 -0
  11. {PySSTV-0.5.5 → pysstv-0.5.7}/PySSTV.egg-info/entry_points.txt +0 -0
  12. {PySSTV-0.5.5 → pysstv-0.5.7}/PySSTV.egg-info/requires.txt +0 -0
  13. {PySSTV-0.5.5 → pysstv-0.5.7}/PySSTV.egg-info/top_level.txt +0 -0
  14. {PySSTV-0.5.5 → pysstv-0.5.7}/pyproject.toml +0 -0
  15. {PySSTV-0.5.5 → pysstv-0.5.7}/pysstv/__init__.py +0 -0
  16. {PySSTV-0.5.5 → pysstv-0.5.7}/pysstv/examples/__init__.py +0 -0
  17. {PySSTV-0.5.5 → pysstv-0.5.7}/pysstv/examples/codegen.py +0 -0
  18. {PySSTV-0.5.5 → pysstv-0.5.7}/pysstv/examples/get_floats.py +0 -0
  19. {PySSTV-0.5.5 → pysstv-0.5.7}/pysstv/examples/get_freq_bits.py +0 -0
  20. {PySSTV-0.5.5 → pysstv-0.5.7}/pysstv/examples/gimp-plugin.py +0 -0
  21. {PySSTV-0.5.5 → pysstv-0.5.7}/pysstv/examples/overlay.py +0 -0
  22. {PySSTV-0.5.5 → pysstv-0.5.7}/pysstv/examples/pyaudio_sstv.py +0 -0
  23. {PySSTV-0.5.5 → pysstv-0.5.7}/pysstv/examples/repeater.py +0 -0
  24. {PySSTV-0.5.5 → pysstv-0.5.7}/pysstv/grayscale.py +0 -0
  25. {PySSTV-0.5.5 → pysstv-0.5.7}/pysstv/sstv.py +0 -0
  26. {PySSTV-0.5.5 → pysstv-0.5.7}/pysstv/tests/__init__.py +0 -0
  27. {PySSTV-0.5.5 → pysstv-0.5.7}/pysstv/tests/common.py +0 -0
  28. {PySSTV-0.5.5 → pysstv-0.5.7}/pysstv/tests/test_color.py +0 -0
  29. {PySSTV-0.5.5 → pysstv-0.5.7}/pysstv/tests/test_sstv.py +0 -0
  30. {PySSTV-0.5.5 → pysstv-0.5.7}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PySSTV
3
- Version: 0.5.5
3
+ Version: 0.5.7
4
4
  Summary: Python classes for generating Slow-scan Television transmissions
5
5
  Home-page: https://github.com/dnet/pySSTV
6
6
  Author: András Veres-Szentkirályi
@@ -32,9 +32,10 @@ Command line usage
32
32
 
33
33
  $ python -m pysstv -h
34
34
  usage: __main__.py [-h]
35
- [--mode {MartinM1,MartinM2,ScottieS1,ScottieS2,Robot36,PasokonP3,PasokonP5,PasokonP7,PD90,PD120,PD160,PD180,PD240,PD290,Robot8BW,Robot24BW}]
35
+ [--mode {MartinM1,MartinM2,ScottieS1,ScottieS2,ScottieDX,Robot36,PasokonP3,PasokonP5,PasokonP7,PD90,PD120,PD160,PD180,PD240,PD290,WraaseSC2120,WraaseSC2180,Robot8BW,Robot24BW}]
36
36
  [--rate RATE] [--bits BITS] [--vox] [--fskid FSKID]
37
- [--chan CHAN]
37
+ [--chan CHAN] [--resize] [--keep-aspect-ratio]
38
+ [--keep-aspect] [--resample {nearest,bicubic,lanczos}]
38
39
  image.png output.wav
39
40
 
40
41
  Converts an image to an SSTV modulated WAV file.
@@ -43,15 +44,23 @@ Command line usage
43
44
  image.png input image file name
44
45
  output.wav output WAV file name
45
46
 
46
- optional arguments:
47
+ options:
47
48
  -h, --help show this help message and exit
48
- --mode {MartinM1,MartinM2,ScottieS1,ScottieS2,Robot36,PasokonP3,PasokonP5,PasokonP7,PD90,PD120D160,PD180,PD240,Robot8BW,Robot24BW}
49
+ --mode {MartinM1,MartinM2,ScottieS1,ScottieS2,ScottieDX,Robot36,PasokonP3,PasokonP5,PasokonP7,PD90,PD120,PD160,PD180,PD240,PD290,WraaseSC2120,WraaseSC2180,Robot8BW,Robot24BW}
49
50
  image mode (default: Martin M1)
50
51
  --rate RATE sampling rate (default: 48000)
51
52
  --bits BITS bits per sample (default: 16)
52
53
  --vox add VOX tones at the beginning
53
54
  --fskid FSKID add FSKID at the end
54
55
  --chan CHAN number of channels (default: mono)
56
+ --resize resize the image to the correct size
57
+ --keep-aspect-ratio keep the original aspect ratio when resizing
58
+ (and cut off excess pixels)
59
+ --keep-aspect keep the original aspect ratio when resizing
60
+ (not cut off excess pixels)
61
+ --resample {nearest,bicubic,lanczos}
62
+ which resampling filter to use for resizing
63
+ (see Pillow documentation)
55
64
 
56
65
  Python interface
57
66
  ----------------
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PySSTV
3
- Version: 0.5.5
3
+ Version: 0.5.7
4
4
  Summary: Python classes for generating Slow-scan Television transmissions
5
5
  Home-page: https://github.com/dnet/pySSTV
6
6
  Author: András Veres-Szentkirályi
@@ -32,9 +32,10 @@ Command line usage
32
32
 
33
33
  $ python -m pysstv -h
34
34
  usage: __main__.py [-h]
35
- [--mode {MartinM1,MartinM2,ScottieS1,ScottieS2,Robot36,PasokonP3,PasokonP5,PasokonP7,PD90,PD120,PD160,PD180,PD240,PD290,Robot8BW,Robot24BW}]
35
+ [--mode {MartinM1,MartinM2,ScottieS1,ScottieS2,ScottieDX,Robot36,PasokonP3,PasokonP5,PasokonP7,PD90,PD120,PD160,PD180,PD240,PD290,WraaseSC2120,WraaseSC2180,Robot8BW,Robot24BW}]
36
36
  [--rate RATE] [--bits BITS] [--vox] [--fskid FSKID]
37
- [--chan CHAN]
37
+ [--chan CHAN] [--resize] [--keep-aspect-ratio]
38
+ [--keep-aspect] [--resample {nearest,bicubic,lanczos}]
38
39
  image.png output.wav
39
40
 
40
41
  Converts an image to an SSTV modulated WAV file.
@@ -43,15 +44,23 @@ Command line usage
43
44
  image.png input image file name
44
45
  output.wav output WAV file name
45
46
 
46
- optional arguments:
47
+ options:
47
48
  -h, --help show this help message and exit
48
- --mode {MartinM1,MartinM2,ScottieS1,ScottieS2,Robot36,PasokonP3,PasokonP5,PasokonP7,PD90,PD120D160,PD180,PD240,Robot8BW,Robot24BW}
49
+ --mode {MartinM1,MartinM2,ScottieS1,ScottieS2,ScottieDX,Robot36,PasokonP3,PasokonP5,PasokonP7,PD90,PD120,PD160,PD180,PD240,PD290,WraaseSC2120,WraaseSC2180,Robot8BW,Robot24BW}
49
50
  image mode (default: Martin M1)
50
51
  --rate RATE sampling rate (default: 48000)
51
52
  --bits BITS bits per sample (default: 16)
52
53
  --vox add VOX tones at the beginning
53
54
  --fskid FSKID add FSKID at the end
54
55
  --chan CHAN number of channels (default: mono)
56
+ --resize resize the image to the correct size
57
+ --keep-aspect-ratio keep the original aspect ratio when resizing
58
+ (and cut off excess pixels)
59
+ --keep-aspect keep the original aspect ratio when resizing
60
+ (not cut off excess pixels)
61
+ --resample {nearest,bicubic,lanczos}
62
+ which resampling filter to use for resizing
63
+ (see Pillow documentation)
55
64
 
56
65
  Python interface
57
66
  ----------------
@@ -14,9 +14,10 @@ Command line usage
14
14
 
15
15
  $ python -m pysstv -h
16
16
  usage: __main__.py [-h]
17
- [--mode {MartinM1,MartinM2,ScottieS1,ScottieS2,Robot36,PasokonP3,PasokonP5,PasokonP7,PD90,PD120,PD160,PD180,PD240,PD290,Robot8BW,Robot24BW}]
17
+ [--mode {MartinM1,MartinM2,ScottieS1,ScottieS2,ScottieDX,Robot36,PasokonP3,PasokonP5,PasokonP7,PD90,PD120,PD160,PD180,PD240,PD290,WraaseSC2120,WraaseSC2180,Robot8BW,Robot24BW}]
18
18
  [--rate RATE] [--bits BITS] [--vox] [--fskid FSKID]
19
- [--chan CHAN]
19
+ [--chan CHAN] [--resize] [--keep-aspect-ratio]
20
+ [--keep-aspect] [--resample {nearest,bicubic,lanczos}]
20
21
  image.png output.wav
21
22
 
22
23
  Converts an image to an SSTV modulated WAV file.
@@ -25,15 +26,23 @@ Command line usage
25
26
  image.png input image file name
26
27
  output.wav output WAV file name
27
28
 
28
- optional arguments:
29
+ options:
29
30
  -h, --help show this help message and exit
30
- --mode {MartinM1,MartinM2,ScottieS1,ScottieS2,Robot36,PasokonP3,PasokonP5,PasokonP7,PD90,PD120D160,PD180,PD240,Robot8BW,Robot24BW}
31
+ --mode {MartinM1,MartinM2,ScottieS1,ScottieS2,ScottieDX,Robot36,PasokonP3,PasokonP5,PasokonP7,PD90,PD120,PD160,PD180,PD240,PD290,WraaseSC2120,WraaseSC2180,Robot8BW,Robot24BW}
31
32
  image mode (default: Martin M1)
32
33
  --rate RATE sampling rate (default: 48000)
33
34
  --bits BITS bits per sample (default: 16)
34
35
  --vox add VOX tones at the beginning
35
36
  --fskid FSKID add FSKID at the end
36
37
  --chan CHAN number of channels (default: mono)
38
+ --resize resize the image to the correct size
39
+ --keep-aspect-ratio keep the original aspect ratio when resizing
40
+ (and cut off excess pixels)
41
+ --keep-aspect keep the original aspect ratio when resizing
42
+ (not cut off excess pixels)
43
+ --resample {nearest,bicubic,lanczos}
44
+ which resampling filter to use for resizing
45
+ (see Pillow documentation)
37
46
 
38
47
  Python interface
39
48
  ----------------
@@ -34,6 +34,8 @@ def main():
34
34
  help='resize the image to the correct size')
35
35
  parser.add_argument('--keep-aspect-ratio', dest='keep_aspect_ratio', action='store_true',
36
36
  help='keep the original aspect ratio when resizing (and cut off excess pixels)')
37
+ parser.add_argument('--keep-aspect', dest='keep_aspect', action='store_true',
38
+ help='keep the original aspect ratio when resizing (not cut off excess pixels)')
37
39
  parser.add_argument('--resample', dest='resample', default='lanczos',
38
40
  choices=('nearest', 'bicubic', 'lanczos'),
39
41
  help='which resampling filter to use for resizing (see Pillow documentation)')
@@ -42,14 +44,17 @@ def main():
42
44
  mode = module_map[args.mode]
43
45
  if args.resize and any(i != m for i, m in zip(image.size, (mode.WIDTH, mode.HEIGHT))):
44
46
  resample = getattr(Image, args.resample.upper())
45
- if args.keep_aspect_ratio:
47
+ if args.keep_aspect_ratio or args.keep_aspect:
46
48
  orig_ratio = image.width / image.height
47
49
  mode_ratio = mode.WIDTH / mode.HEIGHT
48
50
  crop = orig_ratio != mode_ratio
49
51
  else:
50
52
  crop = False
51
53
  if crop:
52
- if orig_ratio < mode_ratio:
54
+ t = orig_ratio < mode_ratio
55
+ if args.keep_aspect:
56
+ t = orig_ratio > mode_ratio
57
+ if t:
53
58
  w = mode.WIDTH
54
59
  h = int(w / orig_ratio)
55
60
  else:
@@ -59,6 +64,14 @@ def main():
59
64
  w = mode.WIDTH
60
65
  h = mode.HEIGHT
61
66
  image = image.resize((w, h), resample)
67
+ if args.keep_aspect:
68
+ newbg = Image.new('RGB', (mode.WIDTH, mode.HEIGHT))
69
+ if t:
70
+ newbg.paste(image, (0, int((mode.HEIGHT/2)-(h/2))))
71
+ else:
72
+ newbg.paste(image, (int((mode.WIDTH/2)-(w/2)), 0))
73
+ image = newbg.copy()
74
+ crop = False
62
75
  if crop:
63
76
  x = (image.width - mode.WIDTH) / 2
64
77
  y = (image.height - mode.HEIGHT) / 2
@@ -77,6 +77,12 @@ class ScottieS2(ScottieS1):
77
77
  WIDTH = 160
78
78
 
79
79
 
80
+ class ScottieDX(ScottieS1):
81
+ VIS_CODE = 0x4c
82
+ # http://www.barberdsp.com/downloads/Dayton%20Paper.pdf
83
+ SCAN = 345.6000 - ScottieS1.INTER_CH_GAP
84
+
85
+
80
86
  class Robot36(ColorSSTV):
81
87
  VIS_CODE = 0x08
82
88
  WIDTH = 320
@@ -201,5 +207,49 @@ class PD290(PD240):
201
207
  PIXEL = 0.286
202
208
 
203
209
 
204
- MODES = (MartinM1, MartinM2, ScottieS1, ScottieS2, Robot36,
205
- PasokonP3, PasokonP5, PasokonP7, PD90, PD120, PD160, PD180, PD240, PD290)
210
+ class WraaseSC2180(ColorSSTV):
211
+ VIS_CODE = 0x37
212
+ WIDTH = 320
213
+ HEIGHT = 256
214
+ COLOR_SEQ = (Color.red, Color.green, Color.blue)
215
+
216
+ SYNC = 5.5225
217
+ PORCH = 0.5
218
+ SCAN = 235.0
219
+
220
+ def before_channel(self, color):
221
+ if color is Color.red:
222
+ yield FREQ_BLACK, self.PORCH
223
+ else:
224
+ return []
225
+
226
+ def after_channel(self, color):
227
+ return []
228
+
229
+
230
+ class WraaseSC2120(WraaseSC2180):
231
+ VIS_CODE = 0x3f
232
+
233
+ # NB: there are "authoritative" sounding documents that will tell you SC-2
234
+ # 120 uses red and blue channels that have half the line width of the
235
+ # green channel. Having spent several hours trying to nut out why SC2-120
236
+ # images weren't decoding in anything else, I can say this is utter
237
+ # bunkum. The line width is the same for all three channels, just
238
+ # shorter.
239
+
240
+ SCAN = 156.0
241
+
242
+ def before_channel(self, color):
243
+ # Not sure why, but SC2-120 decoding seems to need an extra few sync
244
+ # pulses to decode in QSSTV and slowrx. Take the extra pulse out, and
245
+ # it slants something chronic and QSSTV loses sync regularly even on
246
+ # DX mode. Put it in, and both decode reliably. Go figure. SC2-180
247
+ # works just fine without this extra pulse at the start of each
248
+ # channel.
249
+ yield FREQ_BLACK, self.PORCH
250
+ yield from super().before_channel(color)
251
+
252
+
253
+ MODES = (MartinM1, MartinM2, ScottieS1, ScottieS2, ScottieDX, Robot36,
254
+ PasokonP3, PasokonP5, PasokonP7, PD90, PD120, PD160, PD180, PD240,
255
+ PD290, WraaseSC2120, WraaseSC2180)
@@ -4,7 +4,7 @@ from setuptools import setup
4
4
 
5
5
  setup(
6
6
  name='PySSTV',
7
- version='0.5.5',
7
+ version='0.5.7',
8
8
  description='Python classes for generating Slow-scan Television transmissions',
9
9
  author=u'András Veres-Szentkirályi',
10
10
  author_email='vsza@vsza.hu',
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