Lines Matching refs:runs

84 uchar *runtocode ( ENCODER *e, short *runs, int nr, uchar *codes )
98 rlen = *runs++ ;
115 /* Pad/truncate run-length coded scan line 'runs' of 'nr' runs by 'pad'
116 pixels (truncate if negative). Returns the new number of runs. */
118 int xpad ( short *runs, int nr, int pad )
121 while ( pad < 0 ) pad += ( nr <= 0 ? -pad : runs [ --nr ] ) ;
122 runs [ nr++ ] = pad ;
124 if ( nr & 1 ) runs [ nr - 1 ] += pad ;
125 else runs [ nr++ ] = pad ;
132 If necessary, zero-length runs are created to avoid copying. Returns
135 int xshift ( short *runs, int nr, int s )
140 s += runs [ i ] ;
141 n -= runs [ i ] ;
142 runs [ i ] = 0 ;
147 runs [ i ] += s ;
219 run is white. Returns number of runs coded. */
221 int bittorun ( uchar *bits, int n, short *runs )
225 short *runs0 = runs ;
235 *runs = 0 ;
239 *(++runs) = *p++ ; /* new run */
241 *runs += *p++ ; /* continue run */
243 *(++runs) = *p++ ;
247 return runs - runs0 + 1 ;
254 not null. Returns the number of runs in the result. */
382 and store the runs in 'runs'. The font is scaled so it
385 line width if not null. Returns number of runs coded. */
389 short *runs, int *ppels )
411 nr = bittorun ( out, ( nc*cw + 7 )/8, runs ) ;
416 pels = xscale ( runs, nr, ( w * 256 ) / font->w ) ;
418 pels += xshift ( runs, nr, lmargin ) ;
451 runs. If pointer pels is not null it is used to save pixel count.
452 Returns number of runs stored, EOF on RTC, or -2 on EOF or other
455 int readruns ( IFILE *f, short *runs, int *pels )
465 maxp = ( p = runs ) + MAXRUNS ;
497 n = p - runs - 1 ;
498 for ( p = q = runs ; n-- > 0 ; )
505 n = q - runs ;
562 number of runs in runs and line width in pels if not null.
566 read. Fax pages also end at RTC. Returns number of runs stored
569 int readline ( IFILE *f, short *runs, int *pels )
594 runs, pels ) ;
604 nr = bittorun ( bits, f->page->w/8, runs ) ;
610 nr = readruns ( f, runs, pels ) ;
618 nr = bittorun ( bits, nb, runs ) ;
629 nr = xinvert ( runs, nr ) ;
1139 short runs [ MAXRUNS ] ;
1142 if ( readruns ( f, runs, &pels ) < 0 || pels ) /* skip first EOL */
1401 run is 4 bytes (255, count, byte, data count), so runs > 4 bytes
1403 compactly so are preferred over runs.
1511 copy of > 2 bytes, runs of > 4 or data >=127. Otherwise the
1513 uncoded byte (l) before output of runs/copies. */
1682 /* Convert array 'runs' of 'nr' run lengths into a bit map 'buf'. Returns
1685 int runtobit ( short *runs, int nr, uchar *buf )
1696 len = *runs++ ;
1920 /* Output scan line of nr runs no times to output file f. */
1922 void writeline ( OFILE *f, short *runs, int nr, int no )
1938 nb = runtobit ( runs, nr, buf ) ;
1959 p = runtocode ( &f->e, runs, nr, buf ) ;
2019 short runs [ MAXRUNS ] ;
2033 while ( ! err && ( nr = readline ( &f, runs, &pels ) ) >= 0 ) {
2035 nb += runtobit ( runs, nr, font->buf+nb ) ;
2188 /* white and black runs */
2209 t4tab wtab [ ( 64 + 27 + 13 ) + 1 ] = { /* runs of white */
2241 t4tab btab [ ( 64 + 27 + 13 ) + 1 ] = { /* runs of black */