Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Mar 1997 07:05:48 +0100 (MET)
From:      Luigi Rizzo <luigi@labinfo.iet.unipi.it>
To:        hasty@rah.star-gate.com (Amancio Hasty)
Cc:        tom@inna.net, smp@csn.net, jamie@inna.net, multimedia@freebsd.org
Subject:   Re: Video Capture for FreeBSD
Message-ID:  <199703060605.HAA15873@labinfo.iet.unipi.it>
In-Reply-To: <199703060618.WAA00815@rah.star-gate.com> from "Amancio Hasty" at Mar 5, 97 10:18:37 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> Try compiling rgb16 as:
> 
> cc -o rgb16 -m486 -O2 rgb.c

nope, the trick is buffering data before writing:

> >  for (c = 0 ; c < ROWS*COLS; c++) {
> >                 b[0]= ((*rgb16 >> 7) & 0xf8);   /* r */
> >                 b[1]= ((*rgb16 >> 2) & 0xf8);   /* g */
> >                 b[2]= ((*rgb16++ << 3) & 0xf8); /* b */
> >                 write(o, &b[0], 3);

this one issues a system call for each pixel (3 bytes of output!).

	Luigi
-----------------------------+--------------------------------------
Luigi Rizzo                  |  Dip. di Ingegneria dell'Informazione
email: luigi@iet.unipi.it    |  Universita' di Pisa
tel: +39-50-568533           |  via Diotisalvi 2, 56126 PISA (Italy)
fax: +39-50-568522           |  http://www.iet.unipi.it/~luigi/
_____________________________|______________________________________



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199703060605.HAA15873>