mirror of
https://github.com/dnet/pySSTV.git
synced 2026-04-06 06:43:42 +00:00
codegen: pass real image width as parameter
This commit is contained in:
parent
dee321d59e
commit
d540abd852
2 changed files with 3 additions and 4 deletions
|
|
@ -53,7 +53,7 @@ def main(sstv_class=None):
|
|||
yield '#define ROW(x) x'
|
||||
yield '#define COL(x) x'
|
||||
yield '#define RGB(x) x'
|
||||
yield 'void convert(unsigned char *img, float *freqs, float *msecs) {\nint frq = 0;'
|
||||
yield 'void convert(unsigned char *img, float *freqs, float *msecs, const int width) {\nint frq = 0;'
|
||||
history = []
|
||||
lut = {}
|
||||
same_as = {}
|
||||
|
|
@ -71,8 +71,7 @@ def main(sstv_class=None):
|
|||
m_start, m_len = gen_matches(same_as, history, n)
|
||||
for i in xrange(same_as[m_start]):
|
||||
yield history[i][0]
|
||||
yield 'for (int row = 0; row < {0}; row += {1}) {{'.format(
|
||||
sstv.HEIGHT * sstv.WIDTH, sstv.WIDTH)
|
||||
yield 'for (int row = 0; row < width * {0}; row += width) {{'.format(sstv.HEIGHT)
|
||||
for i in xrange(same_as[m_start], same_as[m_start] + m_len - 1):
|
||||
yield ' ' + history[i][1]
|
||||
yield '}'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue