Merge pull request #6 from DominikAuras/pasokon_modes

Pasokon modes
This commit is contained in:
András Veres-Szentkirályi 2014-04-23 09:31:52 +02:00
commit b837723d93
2 changed files with 47 additions and 3 deletions

View file

@ -14,7 +14,7 @@ Command line usage
$ python -m pysstv -h
usage: __main__.py [-h]
[--mode {MartinM2,MartinM1,Robot24BW,ScottieS2,ScottieS1,Robot8BW}]
[--mode {MartinM2,MartinM1,Robot24BW,ScottieS2,ScottieS1,Robot8BW,PasokonP3,PasokonP5,PasokonP7}]
[--rate RATE] [--bits BITS]
image.png output.wav
@ -26,7 +26,7 @@ Command line usage
optional arguments:
-h, --help show this help message and exit
--mode {MartinM2,MartinM1,Robot24BW,ScottieS2,ScottieS1,Robot8BW}
--mode {MartinM2,MartinM1,Robot24BW,ScottieS2,ScottieS1,Robot8BW,PasokonP3,PasokonP5,PasokonP7}
image mode (default: Martin M1)
--rate RATE sampling rate (default: 48000)
--bits BITS bits per sample (default: 16)

View file

@ -102,6 +102,50 @@ class Robot36(ColorSSTV):
[(self.INTER_CH_FREQS[channel], self.INTER_CH_GAP),
(FREQ_VIS_START, self.PORCH)],
((byte_to_freq(p[channel]), uv_pixel_time) for p in pixels))
class PasokonP3(ColorSSTV):
"""
[ VIS code or horizontal sync here ]
Back porch - 5 time units of black (1500 Hz).
Red component - 640 pixels of 1 time unit each.
Gap - 5 time units of black.
Green component - 640 pixels of 1 time unit each.
Gap - 5 time units of black.
Blue component - 640 pixels of 1 time unit each.
Front porch - 5 time units of black.
Horizontal Sync - 25 time units of 1200 Hz.
"""
TIMEUNIT = 1000/4800. # ms
COLOR_SEQ = (RED, GREEN, BLUE)
VIS_CODE = 0x71
WIDTH = 640
HEIGHT = 480+16
SYNC = 25 * TIMEUNIT
SCAN = WIDTH * TIMEUNIT
INTER_CH_GAP = 5 * TIMEUNIT
def before_channel(self, index):
if index == self.COLOR_SEQ[0]:
yield FREQ_BLACK, self.INTER_CH_GAP
def after_channel(self, index):
yield FREQ_BLACK, self.INTER_CH_GAP
class PasokonP5(PasokonP3):
TIMEUNIT = 1000/3200. # ms
VIS_CODE = 0x72
SYNC = 25 * TIMEUNIT
SCAN = PasokonP3.WIDTH * TIMEUNIT
INTER_CH_GAP = 5 * TIMEUNIT
class PasokonP7(PasokonP3):
TIMEUNIT = 1000/2400. # ms
VIS_CODE = 0xF3
SYNC = 25 * TIMEUNIT
SCAN = PasokonP3.WIDTH * TIMEUNIT
INTER_CH_GAP = 5 * TIMEUNIT
MODES = (MartinM1, MartinM2, ScottieS1, ScottieS2, Robot36)
MODES = (MartinM1, MartinM2, ScottieS1, ScottieS2, Robot36, PasokonP3, PasokonP5, PasokonP7)