Lines Matching defs:?r

33 /* Make sure printf strings have only %d escapes and n or fewer
81 may need to be added and/or the putcode() buffer flushed. Returns
84 uchar *runtocode ( ENCODER *e, short *runs, int nr, uchar *codes )
97 while ( nr-- > 0 ) {
115 /* Pad/truncate run-length coded scan line 'runs' of 'nr' runs by 'pad'
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 ;
127 return nr ;
135 int xshift ( short *runs, int nr, int s )
139 for ( i = 0 ; s < 0 && i < nr ; i++ ) {
146 if ( i < nr ) {
154 /* Scale nr run lengths in buffer pointed to by p to scale image
158 int xscale ( short *p, int nr, int xs )
161 for ( ; nr-- > 0 ; p++ ) {
169 /* Invert a run-length buffer by prepending or removing a
172 int xinvert ( short *p, int nr )
176 for ( i=0 ; i<nr-1 ; i++ ) { /* remove */
179 nr-- ;
181 for ( i=nr ; i>0 ; i-- ) { /* insert */
185 nr++ ;
187 return nr ;
316 and comments. Returns the number or 0 on EOF. Reads one more
359 else putbits ( 0, -shift ) ; /* or flush bit buffer */
392 int i, nc = 0, cw, nr, pels ;
411 nr = bittorun ( out, ( nc*cw + 7 )/8, runs ) ;
416 pels = xscale ( runs, nr, ( w * 256 ) / font->w ) ;
418 pels += xshift ( runs, nr, lmargin ) ;
422 return nr ;
452 Returns number of runs stored, EOF on RTC, or -2 on EOF or other
564 would not fit or if the line contains a formfeed character.
567 or EOF at end of page. */
571 int nr = 0, nb ;
585 nr = EOF ; /* don't return any */
588 nr = EOF ;
591 if ( nr != EOF ) {
592 nr = texttorun ( (uchar*) f->text, f->font, f->charh - f->txtlines,
602 nr = EOF ;
604 nr = bittorun ( bits, f->page->w/8, runs ) ;
610 nr = readruns ( f, runs, pels ) ;
616 nr = EOF ;
618 nr = bittorun ( bits, nb, runs ) ;
625 nr = EOF ;
628 if ( nr >= 0 && f->page->black_is_zero ) { /* invert */
629 nr = xinvert ( runs, nr ) ;
632 if ( nr >= 0 && f->lines > 0 ) f->lines-- ;
635 return nr ;
764 /* Read 2- or 4-byte integers from a file and correct for file
826 } else { /* long or offset to data */
871 err = msg ( "E2can only read TIFF/G3 or TIFF/uncompressed" ) ;
1012 err = msg ( "E2 EOF or 0 dimension in PBM header" ) ;
1164 /* Skip to start of same (dp=0) or next (dp=1) page image.
1511 copy of > 2 bytes, runs of > 4 or data >=127. Otherwise the
1682 /* Convert array 'runs' of 'nr' run lengths into a bit map 'buf'. Returns
1685 int runtobit ( short *runs, int nr, uchar *buf )
1695 while ( nr-- > 0 ) {
1784 Returns 0 or 2 on errors. */
1904 headers or where we will update the headers on closing */
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 ) ;
1976 headers or where we will update the headers on closing */
2011 the file name is null, empty, or there are errors, the font is
2017 int err=0, i, j, n=0, nr, nb, fontok=0, pels ;
2033 while ( ! err && ( nr = readline ( &f, runs, &pels ) ) >= 0 ) {
2035 nb += runtobit ( runs, nr, font->buf+nb ) ;